OSDN Git Service

PR 30735
[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 @end table
1132
1133 It is possible to further refine the output of the @option{--help=}
1134 option by adding a comma separated list of qualifiers after the
1135 class.  These can be any from the following list:
1136
1137 @table @asis
1138 @item @samp{undocumented}
1139 Display only those options which are undocumented.
1140
1141 @item @samp{joined}
1142 Display options which take an argument that appears after an equal
1143 sign in the same continuous piece of text, such as:
1144 @samp{--help=target}.
1145
1146 @item @samp{separate}
1147 Display options which take an argument that appears as a separate word
1148 following the original option, such as: @samp{-o output-file}.
1149 @end table
1150
1151 Thus for example to display all the undocumented target-specific
1152 switches supported by the compiler the following can be used:
1153
1154 @smallexample
1155 --help=target,undocumented
1156 @end smallexample
1157
1158 The sense of a qualifier can be inverted by prefixing it with the
1159 @var{^} character, so for example to display all binary warning
1160 options (i.e. ones that are either on or off and that do not take an
1161 argument), which have a description the following can be used:
1162
1163 @smallexample
1164 --help=warnings,^joined,^undocumented
1165 @end smallexample
1166
1167 A class can also be used as a qualifier, although this usually
1168 restricts the output by so much that there is nothing to display.  One
1169 case where it does work however is when one of the classes is
1170 @var{target}.  So for example to display all the target-specific
1171 optimization options the following can be used:
1172
1173 @smallexample
1174 --help=target,optimizers
1175 @end smallexample
1176
1177 The @option{--help=} option can be repeated on the command line.  Each
1178 successive use will display its requested class of options, skipping
1179 those that have already been displayed.
1180
1181 If the @option{-Q} option appears on the command line before the
1182 @option{--help=} option, then the descriptive text displayed by
1183 @option{--help=} is changed.  Instead of describing the displayed
1184 options, an indication is given as to whether the option is enabled,
1185 disabled or set to a specific value (assuming that the compiler
1186 knows this at the point where the @option{--help=} option is used).
1187
1188 Here is a truncated example from the ARM port of @command{gcc}:
1189
1190 @smallexample
1191   % gcc -Q -mabi=2 --help=target -c
1192   The following options are target specific:
1193   -mabi=                                2
1194   -mabort-on-noreturn                   [disabled]
1195   -mapcs                                [disabled]
1196 @end smallexample
1197
1198 The output is sensitive to the effects of previous command line
1199 options, so for example it is possible to find out which optimizations
1200 are enabled at @option{-O2} by using:
1201
1202 @smallexample
1203 -O2 --help=optimizers
1204 @end smallexample
1205
1206 Alternatively you can discover which binary optimizations are enabled
1207 by @option{-O3} by using:
1208
1209 @smallexample
1210 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1211 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1212 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1213 @end smallexample
1214
1215 @item --version
1216 @opindex version
1217 Display the version number and copyrights of the invoked GCC@.
1218
1219 @include @value{srcdir}/../libiberty/at-file.texi
1220 @end table
1221
1222 @node Invoking G++
1223 @section Compiling C++ Programs
1224
1225 @cindex suffixes for C++ source
1226 @cindex C++ source file suffixes
1227 C++ source files conventionally use one of the suffixes @samp{.C},
1228 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1229 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1230 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1231 files with these names and compiles them as C++ programs even if you
1232 call the compiler the same way as for compiling C programs (usually
1233 with the name @command{gcc}).
1234
1235 @findex g++
1236 @findex c++
1237 However, the use of @command{gcc} does not add the C++ library.
1238 @command{g++} is a program that calls GCC and treats @samp{.c},
1239 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1240 files unless @option{-x} is used, and automatically specifies linking
1241 against the C++ library.  This program is also useful when
1242 precompiling a C header file with a @samp{.h} extension for use in C++
1243 compilations.  On many systems, @command{g++} is also installed with
1244 the name @command{c++}.
1245
1246 @cindex invoking @command{g++}
1247 When you compile C++ programs, you may specify many of the same
1248 command-line options that you use for compiling programs in any
1249 language; or command-line options meaningful for C and related
1250 languages; or options that are meaningful only for C++ programs.
1251 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1252 explanations of options for languages related to C@.
1253 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1254 explanations of options that are meaningful only for C++ programs.
1255
1256 @node C Dialect Options
1257 @section Options Controlling C Dialect
1258 @cindex dialect options
1259 @cindex language dialect options
1260 @cindex options, dialect
1261
1262 The following options control the dialect of C (or languages derived
1263 from C, such as C++, Objective-C and Objective-C++) that the compiler
1264 accepts:
1265
1266 @table @gcctabopt
1267 @cindex ANSI support
1268 @cindex ISO support
1269 @item -ansi
1270 @opindex ansi
1271 In C mode, support all ISO C90 programs.  In C++ mode,
1272 remove GNU extensions that conflict with ISO C++.
1273
1274 This turns off certain features of GCC that are incompatible with ISO
1275 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1276 such as the @code{asm} and @code{typeof} keywords, and
1277 predefined macros such as @code{unix} and @code{vax} that identify the
1278 type of system you are using.  It also enables the undesirable and
1279 rarely used ISO trigraph feature.  For the C compiler,
1280 it disables recognition of C++ style @samp{//} comments as well as
1281 the @code{inline} keyword.
1282
1283 The alternate keywords @code{__asm__}, @code{__extension__},
1284 @code{__inline__} and @code{__typeof__} continue to work despite
1285 @option{-ansi}.  You would not want to use them in an ISO C program, of
1286 course, but it is useful to put them in header files that might be included
1287 in compilations done with @option{-ansi}.  Alternate predefined macros
1288 such as @code{__unix__} and @code{__vax__} are also available, with or
1289 without @option{-ansi}.
1290
1291 The @option{-ansi} option does not cause non-ISO programs to be
1292 rejected gratuitously.  For that, @option{-pedantic} is required in
1293 addition to @option{-ansi}.  @xref{Warning Options}.
1294
1295 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1296 option is used.  Some header files may notice this macro and refrain
1297 from declaring certain functions or defining certain macros that the
1298 ISO standard doesn't call for; this is to avoid interfering with any
1299 programs that might use these names for other things.
1300
1301 Functions which would normally be built in but do not have semantics
1302 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1303 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1304 built-in functions provided by GCC}, for details of the functions
1305 affected.
1306
1307 @item -std=
1308 @opindex std
1309 Determine the language standard.  This option is currently only
1310 supported when compiling C or C++.  A value for this option must be
1311 provided; possible values are
1312
1313 @table @samp
1314 @item c89
1315 @itemx iso9899:1990
1316 ISO C90 (same as @option{-ansi}).
1317
1318 @item iso9899:199409
1319 ISO C90 as modified in amendment 1.
1320
1321 @item c99
1322 @itemx c9x
1323 @itemx iso9899:1999
1324 @itemx iso9899:199x
1325 ISO C99.  Note that this standard is not yet fully supported; see
1326 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1327 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1328
1329 @item gnu89
1330 Default, ISO C90 plus GNU extensions (including some C99 features).
1331
1332 @item gnu99
1333 @itemx gnu9x
1334 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1335 this will become the default.  The name @samp{gnu9x} is deprecated.
1336
1337 @item c++98
1338 The 1998 ISO C++ standard plus amendments.
1339
1340 @item gnu++98
1341 The same as @option{-std=c++98} plus GNU extensions.  This is the
1342 default for C++ code.
1343
1344 @item c++0x
1345 The working draft of the upcoming ISO C++0x standard. This option
1346 enables experimental features that are likely to be included in
1347 C++0x. The working draft is constantly changing, and any feature that is
1348 enabled by this flag may be removed from future versions of GCC if it is
1349 not part of the C++0x standard.
1350
1351 @item gnu++0x
1352 The same as @option{-std=c++0x} plus GNU extensions. As with
1353 @option{-std=c++0x}, this option enables experimental features that may
1354 be removed in future versions of GCC.
1355 @end table
1356
1357 Even when this option is not specified, you can still use some of the
1358 features of newer standards in so far as they do not conflict with
1359 previous C standards.  For example, you may use @code{__restrict__} even
1360 when @option{-std=c99} is not specified.
1361
1362 The @option{-std} options specifying some version of ISO C have the same
1363 effects as @option{-ansi}, except that features that were not in ISO C90
1364 but are in the specified version (for example, @samp{//} comments and
1365 the @code{inline} keyword in ISO C99) are not disabled.
1366
1367 @xref{Standards,,Language Standards Supported by GCC}, for details of
1368 these standard versions.
1369
1370 @item -fgnu89-inline
1371 @opindex fgnu89-inline
1372 The option @option{-fgnu89-inline} tells GCC to use the traditional
1373 GNU semantics for @code{inline} functions when in C99 mode.
1374 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1375 is accepted and ignored by GCC versions 4.1.3 up to but not including
1376 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1377 C99 mode.  Using this option is roughly equivalent to adding the
1378 @code{gnu_inline} function attribute to all inline functions
1379 (@pxref{Function Attributes}).
1380
1381 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1382 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1383 specifies the default behavior).  This option was first supported in
1384 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1385
1386 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1387 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1388 in effect for @code{inline} functions.  @xref{Common Predefined
1389 Macros,,,cpp,The C Preprocessor}.
1390
1391 @item -aux-info @var{filename}
1392 @opindex aux-info
1393 Output to the given filename prototyped declarations for all functions
1394 declared and/or defined in a translation unit, including those in header
1395 files.  This option is silently ignored in any language other than C@.
1396
1397 Besides declarations, the file indicates, in comments, the origin of
1398 each declaration (source file and line), whether the declaration was
1399 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1400 @samp{O} for old, respectively, in the first character after the line
1401 number and the colon), and whether it came from a declaration or a
1402 definition (@samp{C} or @samp{F}, respectively, in the following
1403 character).  In the case of function definitions, a K&R-style list of
1404 arguments followed by their declarations is also provided, inside
1405 comments, after the declaration.
1406
1407 @item -fno-asm
1408 @opindex fno-asm
1409 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1410 keyword, so that code can use these words as identifiers.  You can use
1411 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1412 instead.  @option{-ansi} implies @option{-fno-asm}.
1413
1414 In C++, this switch only affects the @code{typeof} keyword, since
1415 @code{asm} and @code{inline} are standard keywords.  You may want to
1416 use the @option{-fno-gnu-keywords} flag instead, which has the same
1417 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1418 switch only affects the @code{asm} and @code{typeof} keywords, since
1419 @code{inline} is a standard keyword in ISO C99.
1420
1421 @item -fno-builtin
1422 @itemx -fno-builtin-@var{function}
1423 @opindex fno-builtin
1424 @cindex built-in functions
1425 Don't recognize built-in functions that do not begin with
1426 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1427 functions provided by GCC}, for details of the functions affected,
1428 including those which are not built-in functions when @option{-ansi} or
1429 @option{-std} options for strict ISO C conformance are used because they
1430 do not have an ISO standard meaning.
1431
1432 GCC normally generates special code to handle certain built-in functions
1433 more efficiently; for instance, calls to @code{alloca} may become single
1434 instructions that adjust the stack directly, and calls to @code{memcpy}
1435 may become inline copy loops.  The resulting code is often both smaller
1436 and faster, but since the function calls no longer appear as such, you
1437 cannot set a breakpoint on those calls, nor can you change the behavior
1438 of the functions by linking with a different library.  In addition,
1439 when a function is recognized as a built-in function, GCC may use
1440 information about that function to warn about problems with calls to
1441 that function, or to generate more efficient code, even if the
1442 resulting code still contains calls to that function.  For example,
1443 warnings are given with @option{-Wformat} for bad calls to
1444 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1445 known not to modify global memory.
1446
1447 With the @option{-fno-builtin-@var{function}} option
1448 only the built-in function @var{function} is
1449 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1450 function is named this is not built-in in this version of GCC, this
1451 option is ignored.  There is no corresponding
1452 @option{-fbuiltin-@var{function}} option; if you wish to enable
1453 built-in functions selectively when using @option{-fno-builtin} or
1454 @option{-ffreestanding}, you may define macros such as:
1455
1456 @smallexample
1457 #define abs(n)          __builtin_abs ((n))
1458 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1459 @end smallexample
1460
1461 @item -fhosted
1462 @opindex fhosted
1463 @cindex hosted environment
1464
1465 Assert that compilation takes place in a hosted environment.  This implies
1466 @option{-fbuiltin}.  A hosted environment is one in which the
1467 entire standard library is available, and in which @code{main} has a return
1468 type of @code{int}.  Examples are nearly everything except a kernel.
1469 This is equivalent to @option{-fno-freestanding}.
1470
1471 @item -ffreestanding
1472 @opindex ffreestanding
1473 @cindex hosted environment
1474
1475 Assert that compilation takes place in a freestanding environment.  This
1476 implies @option{-fno-builtin}.  A freestanding environment
1477 is one in which the standard library may not exist, and program startup may
1478 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1479 This is equivalent to @option{-fno-hosted}.
1480
1481 @xref{Standards,,Language Standards Supported by GCC}, for details of
1482 freestanding and hosted environments.
1483
1484 @item -fopenmp
1485 @opindex fopenmp
1486 @cindex openmp parallel
1487 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1488 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1489 compiler generates parallel code according to the OpenMP Application
1490 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1491
1492 @item -fms-extensions
1493 @opindex fms-extensions
1494 Accept some non-standard constructs used in Microsoft header files.
1495
1496 Some cases of unnamed fields in structures and unions are only
1497 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1498 fields within structs/unions}, for details.
1499
1500 @item -trigraphs
1501 @opindex trigraphs
1502 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1503 options for strict ISO C conformance) implies @option{-trigraphs}.
1504
1505 @item -no-integrated-cpp
1506 @opindex no-integrated-cpp
1507 Performs a compilation in two passes: preprocessing and compiling.  This
1508 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1509 @option{-B} option.  The user supplied compilation step can then add in
1510 an additional preprocessing step after normal preprocessing but before
1511 compiling.  The default is to use the integrated cpp (internal cpp)
1512
1513 The semantics of this option will change if "cc1", "cc1plus", and
1514 "cc1obj" are merged.
1515
1516 @cindex traditional C language
1517 @cindex C language, traditional
1518 @item -traditional
1519 @itemx -traditional-cpp
1520 @opindex traditional-cpp
1521 @opindex traditional
1522 Formerly, these options caused GCC to attempt to emulate a pre-standard
1523 C compiler.  They are now only supported with the @option{-E} switch.
1524 The preprocessor continues to support a pre-standard mode.  See the GNU
1525 CPP manual for details.
1526
1527 @item -fcond-mismatch
1528 @opindex fcond-mismatch
1529 Allow conditional expressions with mismatched types in the second and
1530 third arguments.  The value of such an expression is void.  This option
1531 is not supported for C++.
1532
1533 @item -flax-vector-conversions
1534 @opindex flax-vector-conversions
1535 Allow implicit conversions between vectors with differing numbers of
1536 elements and/or incompatible element types.  This option should not be
1537 used for new code.
1538
1539 @item -funsigned-char
1540 @opindex funsigned-char
1541 Let the type @code{char} be unsigned, like @code{unsigned char}.
1542
1543 Each kind of machine has a default for what @code{char} should
1544 be.  It is either like @code{unsigned char} by default or like
1545 @code{signed char} by default.
1546
1547 Ideally, a portable program should always use @code{signed char} or
1548 @code{unsigned char} when it depends on the signedness of an object.
1549 But many programs have been written to use plain @code{char} and
1550 expect it to be signed, or expect it to be unsigned, depending on the
1551 machines they were written for.  This option, and its inverse, let you
1552 make such a program work with the opposite default.
1553
1554 The type @code{char} is always a distinct type from each of
1555 @code{signed char} or @code{unsigned char}, even though its behavior
1556 is always just like one of those two.
1557
1558 @item -fsigned-char
1559 @opindex fsigned-char
1560 Let the type @code{char} be signed, like @code{signed char}.
1561
1562 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1563 the negative form of @option{-funsigned-char}.  Likewise, the option
1564 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1565
1566 @item -fsigned-bitfields
1567 @itemx -funsigned-bitfields
1568 @itemx -fno-signed-bitfields
1569 @itemx -fno-unsigned-bitfields
1570 @opindex fsigned-bitfields
1571 @opindex funsigned-bitfields
1572 @opindex fno-signed-bitfields
1573 @opindex fno-unsigned-bitfields
1574 These options control whether a bit-field is signed or unsigned, when the
1575 declaration does not use either @code{signed} or @code{unsigned}.  By
1576 default, such a bit-field is signed, because this is consistent: the
1577 basic integer types such as @code{int} are signed types.
1578 @end table
1579
1580 @node C++ Dialect Options
1581 @section Options Controlling C++ Dialect
1582
1583 @cindex compiler options, C++
1584 @cindex C++ options, command line
1585 @cindex options, C++
1586 This section describes the command-line options that are only meaningful
1587 for C++ programs; but you can also use most of the GNU compiler options
1588 regardless of what language your program is in.  For example, you
1589 might compile a file @code{firstClass.C} like this:
1590
1591 @smallexample
1592 g++ -g -frepo -O -c firstClass.C
1593 @end smallexample
1594
1595 @noindent
1596 In this example, only @option{-frepo} is an option meant
1597 only for C++ programs; you can use the other options with any
1598 language supported by GCC@.
1599
1600 Here is a list of options that are @emph{only} for compiling C++ programs:
1601
1602 @table @gcctabopt
1603
1604 @item -fabi-version=@var{n}
1605 @opindex fabi-version
1606 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1607 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1608 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1609 the version that conforms most closely to the C++ ABI specification.
1610 Therefore, the ABI obtained using version 0 will change as ABI bugs
1611 are fixed.
1612
1613 The default is version 2.
1614
1615 @item -fno-access-control
1616 @opindex fno-access-control
1617 Turn off all access checking.  This switch is mainly useful for working
1618 around bugs in the access control code.
1619
1620 @item -fcheck-new
1621 @opindex fcheck-new
1622 Check that the pointer returned by @code{operator new} is non-null
1623 before attempting to modify the storage allocated.  This check is
1624 normally unnecessary because the C++ standard specifies that
1625 @code{operator new} will only return @code{0} if it is declared
1626 @samp{throw()}, in which case the compiler will always check the
1627 return value even without this option.  In all other cases, when
1628 @code{operator new} has a non-empty exception specification, memory
1629 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1630 @samp{new (nothrow)}.
1631
1632 @item -fconserve-space
1633 @opindex fconserve-space
1634 Put uninitialized or runtime-initialized global variables into the
1635 common segment, as C does.  This saves space in the executable at the
1636 cost of not diagnosing duplicate definitions.  If you compile with this
1637 flag and your program mysteriously crashes after @code{main()} has
1638 completed, you may have an object that is being destroyed twice because
1639 two definitions were merged.
1640
1641 This option is no longer useful on most targets, now that support has
1642 been added for putting variables into BSS without making them common.
1643
1644 @item -ffriend-injection
1645 @opindex ffriend-injection
1646 Inject friend functions into the enclosing namespace, so that they are
1647 visible outside the scope of the class in which they are declared.
1648 Friend functions were documented to work this way in the old Annotated
1649 C++ Reference Manual, and versions of G++ before 4.1 always worked
1650 that way.  However, in ISO C++ a friend function which is not declared
1651 in an enclosing scope can only be found using argument dependent
1652 lookup.  This option causes friends to be injected as they were in
1653 earlier releases.
1654
1655 This option is for compatibility, and may be removed in a future
1656 release of G++.
1657
1658 @item -fno-elide-constructors
1659 @opindex fno-elide-constructors
1660 The C++ standard allows an implementation to omit creating a temporary
1661 which is only used to initialize another object of the same type.
1662 Specifying this option disables that optimization, and forces G++ to
1663 call the copy constructor in all cases.
1664
1665 @item -fno-enforce-eh-specs
1666 @opindex fno-enforce-eh-specs
1667 Don't generate code to check for violation of exception specifications
1668 at runtime.  This option violates the C++ standard, but may be useful
1669 for reducing code size in production builds, much like defining
1670 @samp{NDEBUG}.  This does not give user code permission to throw
1671 exceptions in violation of the exception specifications; the compiler
1672 will still optimize based on the specifications, so throwing an
1673 unexpected exception will result in undefined behavior.
1674
1675 @item -ffor-scope
1676 @itemx -fno-for-scope
1677 @opindex ffor-scope
1678 @opindex fno-for-scope
1679 If @option{-ffor-scope} is specified, the scope of variables declared in
1680 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1681 as specified by the C++ standard.
1682 If @option{-fno-for-scope} is specified, the scope of variables declared in
1683 a @i{for-init-statement} extends to the end of the enclosing scope,
1684 as was the case in old versions of G++, and other (traditional)
1685 implementations of C++.
1686
1687 The default if neither flag is given to follow the standard,
1688 but to allow and give a warning for old-style code that would
1689 otherwise be invalid, or have different behavior.
1690
1691 @item -fno-gnu-keywords
1692 @opindex fno-gnu-keywords
1693 Do not recognize @code{typeof} as a keyword, so that code can use this
1694 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1695 @option{-ansi} implies @option{-fno-gnu-keywords}.
1696
1697 @item -fno-implicit-templates
1698 @opindex fno-implicit-templates
1699 Never emit code for non-inline templates which are instantiated
1700 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1701 @xref{Template Instantiation}, for more information.
1702
1703 @item -fno-implicit-inline-templates
1704 @opindex fno-implicit-inline-templates
1705 Don't emit code for implicit instantiations of inline templates, either.
1706 The default is to handle inlines differently so that compiles with and
1707 without optimization will need the same set of explicit instantiations.
1708
1709 @item -fno-implement-inlines
1710 @opindex fno-implement-inlines
1711 To save space, do not emit out-of-line copies of inline functions
1712 controlled by @samp{#pragma implementation}.  This will cause linker
1713 errors if these functions are not inlined everywhere they are called.
1714
1715 @item -fms-extensions
1716 @opindex fms-extensions
1717 Disable pedantic warnings about constructs used in MFC, such as implicit
1718 int and getting a pointer to member function via non-standard syntax.
1719
1720 @item -fno-nonansi-builtins
1721 @opindex fno-nonansi-builtins
1722 Disable built-in declarations of functions that are not mandated by
1723 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1724 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1725
1726 @item -fno-operator-names
1727 @opindex fno-operator-names
1728 Do not treat the operator name keywords @code{and}, @code{bitand},
1729 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1730 synonyms as keywords.
1731
1732 @item -fno-optional-diags
1733 @opindex fno-optional-diags
1734 Disable diagnostics that the standard says a compiler does not need to
1735 issue.  Currently, the only such diagnostic issued by G++ is the one for
1736 a name having multiple meanings within a class.
1737
1738 @item -fpermissive
1739 @opindex fpermissive
1740 Downgrade some diagnostics about nonconformant code from errors to
1741 warnings.  Thus, using @option{-fpermissive} will allow some
1742 nonconforming code to compile.
1743
1744 @item -frepo
1745 @opindex frepo
1746 Enable automatic template instantiation at link time.  This option also
1747 implies @option{-fno-implicit-templates}.  @xref{Template
1748 Instantiation}, for more information.
1749
1750 @item -fno-rtti
1751 @opindex fno-rtti
1752 Disable generation of information about every class with virtual
1753 functions for use by the C++ runtime type identification features
1754 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1755 of the language, you can save some space by using this flag.  Note that
1756 exception handling uses the same information, but it will generate it as
1757 needed. The @samp{dynamic_cast} operator can still be used for casts that
1758 do not require runtime type information, i.e. casts to @code{void *} or to
1759 unambiguous base classes.
1760
1761 @item -fstats
1762 @opindex fstats
1763 Emit statistics about front-end processing at the end of the compilation.
1764 This information is generally only useful to the G++ development team.
1765
1766 @item -ftemplate-depth-@var{n}
1767 @opindex ftemplate-depth
1768 Set the maximum instantiation depth for template classes to @var{n}.
1769 A limit on the template instantiation depth is needed to detect
1770 endless recursions during template class instantiation.  ANSI/ISO C++
1771 conforming programs must not rely on a maximum depth greater than 17.
1772
1773 @item -fno-threadsafe-statics
1774 @opindex fno-threadsafe-statics
1775 Do not emit the extra code to use the routines specified in the C++
1776 ABI for thread-safe initialization of local statics.  You can use this
1777 option to reduce code size slightly in code that doesn't need to be
1778 thread-safe.
1779
1780 @item -fuse-cxa-atexit
1781 @opindex fuse-cxa-atexit
1782 Register destructors for objects with static storage duration with the
1783 @code{__cxa_atexit} function rather than the @code{atexit} function.
1784 This option is required for fully standards-compliant handling of static
1785 destructors, but will only work if your C library supports
1786 @code{__cxa_atexit}.
1787
1788 @item -fno-use-cxa-get-exception-ptr
1789 @opindex fno-use-cxa-get-exception-ptr
1790 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1791 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1792 if the runtime routine is not available.
1793
1794 @item -fvisibility-inlines-hidden
1795 @opindex fvisibility-inlines-hidden
1796 This switch declares that the user does not attempt to compare
1797 pointers to inline methods where the addresses of the two functions
1798 were taken in different shared objects.
1799
1800 The effect of this is that GCC may, effectively, mark inline methods with
1801 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1802 appear in the export table of a DSO and do not require a PLT indirection
1803 when used within the DSO@.  Enabling this option can have a dramatic effect
1804 on load and link times of a DSO as it massively reduces the size of the
1805 dynamic export table when the library makes heavy use of templates.
1806
1807 The behavior of this switch is not quite the same as marking the
1808 methods as hidden directly, because it does not affect static variables
1809 local to the function or cause the compiler to deduce that
1810 the function is defined in only one shared object.
1811
1812 You may mark a method as having a visibility explicitly to negate the
1813 effect of the switch for that method.  For example, if you do want to
1814 compare pointers to a particular inline method, you might mark it as
1815 having default visibility.  Marking the enclosing class with explicit
1816 visibility will have no effect.
1817
1818 Explicitly instantiated inline methods are unaffected by this option
1819 as their linkage might otherwise cross a shared library boundary.
1820 @xref{Template Instantiation}.
1821
1822 @item -fno-weak
1823 @opindex fno-weak
1824 Do not use weak symbol support, even if it is provided by the linker.
1825 By default, G++ will use weak symbols if they are available.  This
1826 option exists only for testing, and should not be used by end-users;
1827 it will result in inferior code and has no benefits.  This option may
1828 be removed in a future release of G++.
1829
1830 @item -nostdinc++
1831 @opindex nostdinc++
1832 Do not search for header files in the standard directories specific to
1833 C++, but do still search the other standard directories.  (This option
1834 is used when building the C++ library.)
1835 @end table
1836
1837 In addition, these optimization, warning, and code generation options
1838 have meanings only for C++ programs:
1839
1840 @table @gcctabopt
1841 @item -fno-default-inline
1842 @opindex fno-default-inline
1843 Do not assume @samp{inline} for functions defined inside a class scope.
1844 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1845 functions will have linkage like inline functions; they just won't be
1846 inlined by default.
1847
1848 @item -Wabi @r{(C++ only)}
1849 @opindex Wabi
1850 Warn when G++ generates code that is probably not compatible with the
1851 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1852 all such cases, there are probably some cases that are not warned about,
1853 even though G++ is generating incompatible code.  There may also be
1854 cases where warnings are emitted even though the code that is generated
1855 will be compatible.
1856
1857 You should rewrite your code to avoid these warnings if you are
1858 concerned about the fact that code generated by G++ may not be binary
1859 compatible with code generated by other compilers.
1860
1861 The known incompatibilities at this point include:
1862
1863 @itemize @bullet
1864
1865 @item
1866 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1867 pack data into the same byte as a base class.  For example:
1868
1869 @smallexample
1870 struct A @{ virtual void f(); int f1 : 1; @};
1871 struct B : public A @{ int f2 : 1; @};
1872 @end smallexample
1873
1874 @noindent
1875 In this case, G++ will place @code{B::f2} into the same byte
1876 as@code{A::f1}; other compilers will not.  You can avoid this problem
1877 by explicitly padding @code{A} so that its size is a multiple of the
1878 byte size on your platform; that will cause G++ and other compilers to
1879 layout @code{B} identically.
1880
1881 @item
1882 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1883 tail padding when laying out virtual bases.  For example:
1884
1885 @smallexample
1886 struct A @{ virtual void f(); char c1; @};
1887 struct B @{ B(); char c2; @};
1888 struct C : public A, public virtual B @{@};
1889 @end smallexample
1890
1891 @noindent
1892 In this case, G++ will not place @code{B} into the tail-padding for
1893 @code{A}; other compilers will.  You can avoid this problem by
1894 explicitly padding @code{A} so that its size is a multiple of its
1895 alignment (ignoring virtual base classes); that will cause G++ and other
1896 compilers to layout @code{C} identically.
1897
1898 @item
1899 Incorrect handling of bit-fields with declared widths greater than that
1900 of their underlying types, when the bit-fields appear in a union.  For
1901 example:
1902
1903 @smallexample
1904 union U @{ int i : 4096; @};
1905 @end smallexample
1906
1907 @noindent
1908 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1909 union too small by the number of bits in an @code{int}.
1910
1911 @item
1912 Empty classes can be placed at incorrect offsets.  For example:
1913
1914 @smallexample
1915 struct A @{@};
1916
1917 struct B @{
1918   A a;
1919   virtual void f ();
1920 @};
1921
1922 struct C : public B, public A @{@};
1923 @end smallexample
1924
1925 @noindent
1926 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1927 it should be placed at offset zero.  G++ mistakenly believes that the
1928 @code{A} data member of @code{B} is already at offset zero.
1929
1930 @item
1931 Names of template functions whose types involve @code{typename} or
1932 template template parameters can be mangled incorrectly.
1933
1934 @smallexample
1935 template <typename Q>
1936 void f(typename Q::X) @{@}
1937
1938 template <template <typename> class Q>
1939 void f(typename Q<int>::X) @{@}
1940 @end smallexample
1941
1942 @noindent
1943 Instantiations of these templates may be mangled incorrectly.
1944
1945 @end itemize
1946
1947 @item -Wctor-dtor-privacy @r{(C++ only)}
1948 @opindex Wctor-dtor-privacy
1949 Warn when a class seems unusable because all the constructors or
1950 destructors in that class are private, and it has neither friends nor
1951 public static member functions.
1952
1953 @item -Wnon-virtual-dtor @r{(C++ only)}
1954 @opindex Wnon-virtual-dtor
1955 Warn when a class appears to be polymorphic, thereby requiring a virtual
1956 destructor, yet it declares a non-virtual one.  This warning is also
1957 enabled if -Weffc++ is specified.
1958
1959 @item -Wreorder @r{(C++ only)}
1960 @opindex Wreorder
1961 @cindex reordering, warning
1962 @cindex warning for reordering of member initializers
1963 Warn when the order of member initializers given in the code does not
1964 match the order in which they must be executed.  For instance:
1965
1966 @smallexample
1967 struct A @{
1968   int i;
1969   int j;
1970   A(): j (0), i (1) @{ @}
1971 @};
1972 @end smallexample
1973
1974 The compiler will rearrange the member initializers for @samp{i}
1975 and @samp{j} to match the declaration order of the members, emitting
1976 a warning to that effect.  This warning is enabled by @option{-Wall}.
1977 @end table
1978
1979 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1980
1981 @table @gcctabopt
1982 @item -Weffc++ @r{(C++ only)}
1983 @opindex Weffc++
1984 Warn about violations of the following style guidelines from Scott Meyers'
1985 @cite{Effective C++} book:
1986
1987 @itemize @bullet
1988 @item
1989 Item 11:  Define a copy constructor and an assignment operator for classes
1990 with dynamically allocated memory.
1991
1992 @item
1993 Item 12:  Prefer initialization to assignment in constructors.
1994
1995 @item
1996 Item 14:  Make destructors virtual in base classes.
1997
1998 @item
1999 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2000
2001 @item
2002 Item 23:  Don't try to return a reference when you must return an object.
2003
2004 @end itemize
2005
2006 Also warn about violations of the following style guidelines from
2007 Scott Meyers' @cite{More Effective C++} book:
2008
2009 @itemize @bullet
2010 @item
2011 Item 6:  Distinguish between prefix and postfix forms of increment and
2012 decrement operators.
2013
2014 @item
2015 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2016
2017 @end itemize
2018
2019 When selecting this option, be aware that the standard library
2020 headers do not obey all of these guidelines; use @samp{grep -v}
2021 to filter out those warnings.
2022
2023 @item -Wno-deprecated @r{(C++ only)}
2024 @opindex Wno-deprecated
2025 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
2026
2027 @item -Wstrict-null-sentinel @r{(C++ only)}
2028 @opindex Wstrict-null-sentinel
2029 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2030 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2031 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2032 it is guaranteed to of the same size as a pointer.  But this use is
2033 not portable across different compilers.
2034
2035 @item -Wno-non-template-friend @r{(C++ only)}
2036 @opindex Wno-non-template-friend
2037 Disable warnings when non-templatized friend functions are declared
2038 within a template.  Since the advent of explicit template specification
2039 support in G++, if the name of the friend is an unqualified-id (i.e.,
2040 @samp{friend foo(int)}), the C++ language specification demands that the
2041 friend declare or define an ordinary, nontemplate function.  (Section
2042 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2043 could be interpreted as a particular specialization of a templatized
2044 function.  Because this non-conforming behavior is no longer the default
2045 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2046 check existing code for potential trouble spots and is on by default.
2047 This new compiler behavior can be turned off with
2048 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2049 but disables the helpful warning.
2050
2051 @item -Wold-style-cast @r{(C++ only)}
2052 @opindex Wold-style-cast
2053 Warn if an old-style (C-style) cast to a non-void type is used within
2054 a C++ program.  The new-style casts (@samp{dynamic_cast},
2055 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2056 less vulnerable to unintended effects and much easier to search for.
2057
2058 @item -Woverloaded-virtual @r{(C++ only)}
2059 @opindex Woverloaded-virtual
2060 @cindex overloaded virtual fn, warning
2061 @cindex warning for overloaded virtual fn
2062 Warn when a function declaration hides virtual functions from a
2063 base class.  For example, in:
2064
2065 @smallexample
2066 struct A @{
2067   virtual void f();
2068 @};
2069
2070 struct B: public A @{
2071   void f(int);
2072 @};
2073 @end smallexample
2074
2075 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2076 like:
2077
2078 @smallexample
2079 B* b;
2080 b->f();
2081 @end smallexample
2082
2083 will fail to compile.
2084
2085 @item -Wno-pmf-conversions @r{(C++ only)}
2086 @opindex Wno-pmf-conversions
2087 Disable the diagnostic for converting a bound pointer to member function
2088 to a plain pointer.
2089
2090 @item -Wsign-promo @r{(C++ only)}
2091 @opindex Wsign-promo
2092 Warn when overload resolution chooses a promotion from unsigned or
2093 enumerated type to a signed type, over a conversion to an unsigned type of
2094 the same size.  Previous versions of G++ would try to preserve
2095 unsignedness, but the standard mandates the current behavior.
2096
2097 @smallexample
2098 struct A @{
2099   operator int ();
2100   A& operator = (int);
2101 @};
2102
2103 main ()
2104 @{
2105   A a,b;
2106   a = b;
2107 @}
2108 @end smallexample
2109
2110 In this example, G++ will synthesize a default @samp{A& operator =
2111 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2112 @end table
2113
2114 @node Objective-C and Objective-C++ Dialect Options
2115 @section Options Controlling Objective-C and Objective-C++ Dialects
2116
2117 @cindex compiler options, Objective-C and Objective-C++
2118 @cindex Objective-C and Objective-C++ options, command line
2119 @cindex options, Objective-C and Objective-C++
2120 (NOTE: This manual does not describe the Objective-C and Objective-C++
2121 languages themselves.  See @xref{Standards,,Language Standards
2122 Supported by GCC}, for references.)
2123
2124 This section describes the command-line options that are only meaningful
2125 for Objective-C and Objective-C++ programs, but you can also use most of
2126 the language-independent GNU compiler options.
2127 For example, you might compile a file @code{some_class.m} like this:
2128
2129 @smallexample
2130 gcc -g -fgnu-runtime -O -c some_class.m
2131 @end smallexample
2132
2133 @noindent
2134 In this example, @option{-fgnu-runtime} is an option meant only for
2135 Objective-C and Objective-C++ programs; you can use the other options with
2136 any language supported by GCC@.
2137
2138 Note that since Objective-C is an extension of the C language, Objective-C
2139 compilations may also use options specific to the C front-end (e.g.,
2140 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2141 C++-specific options (e.g., @option{-Wabi}).
2142
2143 Here is a list of options that are @emph{only} for compiling Objective-C
2144 and Objective-C++ programs:
2145
2146 @table @gcctabopt
2147 @item -fconstant-string-class=@var{class-name}
2148 @opindex fconstant-string-class
2149 Use @var{class-name} as the name of the class to instantiate for each
2150 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2151 class name is @code{NXConstantString} if the GNU runtime is being used, and
2152 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2153 @option{-fconstant-cfstrings} option, if also present, will override the
2154 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2155 to be laid out as constant CoreFoundation strings.
2156
2157 @item -fgnu-runtime
2158 @opindex fgnu-runtime
2159 Generate object code compatible with the standard GNU Objective-C
2160 runtime.  This is the default for most types of systems.
2161
2162 @item -fnext-runtime
2163 @opindex fnext-runtime
2164 Generate output compatible with the NeXT runtime.  This is the default
2165 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2166 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2167 used.
2168
2169 @item -fno-nil-receivers
2170 @opindex fno-nil-receivers
2171 Assume that all Objective-C message dispatches (e.g.,
2172 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2173 is not @code{nil}.  This allows for more efficient entry points in the runtime
2174 to be used.  Currently, this option is only available in conjunction with
2175 the NeXT runtime on Mac OS X 10.3 and later.
2176
2177 @item -fobjc-call-cxx-cdtors
2178 @opindex fobjc-call-cxx-cdtors
2179 For each Objective-C class, check if any of its instance variables is a
2180 C++ object with a non-trivial default constructor.  If so, synthesize a
2181 special @code{- (id) .cxx_construct} instance method that will run
2182 non-trivial default constructors on any such instance variables, in order,
2183 and then return @code{self}.  Similarly, check if any instance variable
2184 is a C++ object with a non-trivial destructor, and if so, synthesize a
2185 special @code{- (void) .cxx_destruct} method that will run
2186 all such default destructors, in reverse order.
2187
2188 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2189 thusly generated will only operate on instance variables declared in the
2190 current Objective-C class, and not those inherited from superclasses.  It
2191 is the responsibility of the Objective-C runtime to invoke all such methods
2192 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2193 will be invoked by the runtime immediately after a new object
2194 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2195 be invoked immediately before the runtime deallocates an object instance.
2196
2197 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2198 support for invoking the @code{- (id) .cxx_construct} and
2199 @code{- (void) .cxx_destruct} methods.
2200
2201 @item -fobjc-direct-dispatch
2202 @opindex fobjc-direct-dispatch
2203 Allow fast jumps to the message dispatcher.  On Darwin this is
2204 accomplished via the comm page.
2205
2206 @item -fobjc-exceptions
2207 @opindex fobjc-exceptions
2208 Enable syntactic support for structured exception handling in Objective-C,
2209 similar to what is offered by C++ and Java.  This option is
2210 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2211 earlier.
2212
2213 @smallexample
2214   @@try @{
2215     @dots{}
2216        @@throw expr;
2217     @dots{}
2218   @}
2219   @@catch (AnObjCClass *exc) @{
2220     @dots{}
2221       @@throw expr;
2222     @dots{}
2223       @@throw;
2224     @dots{}
2225   @}
2226   @@catch (AnotherClass *exc) @{
2227     @dots{}
2228   @}
2229   @@catch (id allOthers) @{
2230     @dots{}
2231   @}
2232   @@finally @{
2233     @dots{}
2234       @@throw expr;
2235     @dots{}
2236   @}
2237 @end smallexample
2238
2239 The @code{@@throw} statement may appear anywhere in an Objective-C or
2240 Objective-C++ program; when used inside of a @code{@@catch} block, the
2241 @code{@@throw} may appear without an argument (as shown above), in which case
2242 the object caught by the @code{@@catch} will be rethrown.
2243
2244 Note that only (pointers to) Objective-C objects may be thrown and
2245 caught using this scheme.  When an object is thrown, it will be caught
2246 by the nearest @code{@@catch} clause capable of handling objects of that type,
2247 analogously to how @code{catch} blocks work in C++ and Java.  A
2248 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2249 any and all Objective-C exceptions not caught by previous @code{@@catch}
2250 clauses (if any).
2251
2252 The @code{@@finally} clause, if present, will be executed upon exit from the
2253 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2254 regardless of whether any exceptions are thrown, caught or rethrown
2255 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2256 of the @code{finally} clause in Java.
2257
2258 There are several caveats to using the new exception mechanism:
2259
2260 @itemize @bullet
2261 @item
2262 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2263 idioms provided by the @code{NSException} class, the new
2264 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2265 systems, due to additional functionality needed in the (NeXT) Objective-C
2266 runtime.
2267
2268 @item
2269 As mentioned above, the new exceptions do not support handling
2270 types other than Objective-C objects.   Furthermore, when used from
2271 Objective-C++, the Objective-C exception model does not interoperate with C++
2272 exceptions at this time.  This means you cannot @code{@@throw} an exception
2273 from Objective-C and @code{catch} it in C++, or vice versa
2274 (i.e., @code{throw @dots{} @@catch}).
2275 @end itemize
2276
2277 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2278 blocks for thread-safe execution:
2279
2280 @smallexample
2281   @@synchronized (ObjCClass *guard) @{
2282     @dots{}
2283   @}
2284 @end smallexample
2285
2286 Upon entering the @code{@@synchronized} block, a thread of execution shall
2287 first check whether a lock has been placed on the corresponding @code{guard}
2288 object by another thread.  If it has, the current thread shall wait until
2289 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2290 the current thread will place its own lock on it, execute the code contained in
2291 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2292 making @code{guard} available to other threads).
2293
2294 Unlike Java, Objective-C does not allow for entire methods to be marked
2295 @code{@@synchronized}.  Note that throwing exceptions out of
2296 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2297 to be unlocked properly.
2298
2299 @item -fobjc-gc
2300 @opindex fobjc-gc
2301 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2302
2303 @item -freplace-objc-classes
2304 @opindex freplace-objc-classes
2305 Emit a special marker instructing @command{ld(1)} not to statically link in
2306 the resulting object file, and allow @command{dyld(1)} to load it in at
2307 run time instead.  This is used in conjunction with the Fix-and-Continue
2308 debugging mode, where the object file in question may be recompiled and
2309 dynamically reloaded in the course of program execution, without the need
2310 to restart the program itself.  Currently, Fix-and-Continue functionality
2311 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2312 and later.
2313
2314 @item -fzero-link
2315 @opindex fzero-link
2316 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2317 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2318 compile time) with static class references that get initialized at load time,
2319 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2320 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2321 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2322 for individual class implementations to be modified during program execution.
2323
2324 @item -gen-decls
2325 @opindex gen-decls
2326 Dump interface declarations for all classes seen in the source file to a
2327 file named @file{@var{sourcename}.decl}.
2328
2329 @item -Wassign-intercept
2330 @opindex Wassign-intercept
2331 Warn whenever an Objective-C assignment is being intercepted by the
2332 garbage collector.
2333
2334 @item -Wno-protocol
2335 @opindex Wno-protocol
2336 If a class is declared to implement a protocol, a warning is issued for
2337 every method in the protocol that is not implemented by the class.  The
2338 default behavior is to issue a warning for every method not explicitly
2339 implemented in the class, even if a method implementation is inherited
2340 from the superclass.  If you use the @option{-Wno-protocol} option, then
2341 methods inherited from the superclass are considered to be implemented,
2342 and no warning is issued for them.
2343
2344 @item -Wselector
2345 @opindex Wselector
2346 Warn if multiple methods of different types for the same selector are
2347 found during compilation.  The check is performed on the list of methods
2348 in the final stage of compilation.  Additionally, a check is performed
2349 for each selector appearing in a @code{@@selector(@dots{})}
2350 expression, and a corresponding method for that selector has been found
2351 during compilation.  Because these checks scan the method table only at
2352 the end of compilation, these warnings are not produced if the final
2353 stage of compilation is not reached, for example because an error is
2354 found during compilation, or because the @option{-fsyntax-only} option is
2355 being used.
2356
2357 @item -Wstrict-selector-match
2358 @opindex Wstrict-selector-match
2359 Warn if multiple methods with differing argument and/or return types are
2360 found for a given selector when attempting to send a message using this
2361 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2362 is off (which is the default behavior), the compiler will omit such warnings
2363 if any differences found are confined to types which share the same size
2364 and alignment.
2365
2366 @item -Wundeclared-selector
2367 @opindex Wundeclared-selector
2368 Warn if a @code{@@selector(@dots{})} expression referring to an
2369 undeclared selector is found.  A selector is considered undeclared if no
2370 method with that name has been declared before the
2371 @code{@@selector(@dots{})} expression, either explicitly in an
2372 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2373 an @code{@@implementation} section.  This option always performs its
2374 checks as soon as a @code{@@selector(@dots{})} expression is found,
2375 while @option{-Wselector} only performs its checks in the final stage of
2376 compilation.  This also enforces the coding style convention
2377 that methods and selectors must be declared before being used.
2378
2379 @item -print-objc-runtime-info
2380 @opindex print-objc-runtime-info
2381 Generate C header describing the largest structure that is passed by
2382 value, if any.
2383
2384 @end table
2385
2386 @node Language Independent Options
2387 @section Options to Control Diagnostic Messages Formatting
2388 @cindex options to control diagnostics formatting
2389 @cindex diagnostic messages
2390 @cindex message formatting
2391
2392 Traditionally, diagnostic messages have been formatted irrespective of
2393 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2394 below can be used to control the diagnostic messages formatting
2395 algorithm, e.g.@: how many characters per line, how often source location
2396 information should be reported.  Right now, only the C++ front end can
2397 honor these options.  However it is expected, in the near future, that
2398 the remaining front ends would be able to digest them correctly.
2399
2400 @table @gcctabopt
2401 @item -fmessage-length=@var{n}
2402 @opindex fmessage-length
2403 Try to format error messages so that they fit on lines of about @var{n}
2404 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2405 the front ends supported by GCC@.  If @var{n} is zero, then no
2406 line-wrapping will be done; each error message will appear on a single
2407 line.
2408
2409 @opindex fdiagnostics-show-location
2410 @item -fdiagnostics-show-location=once
2411 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2412 reporter to emit @emph{once} source location information; that is, in
2413 case the message is too long to fit on a single physical line and has to
2414 be wrapped, the source location won't be emitted (as prefix) again,
2415 over and over, in subsequent continuation lines.  This is the default
2416 behavior.
2417
2418 @item -fdiagnostics-show-location=every-line
2419 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2420 messages reporter to emit the same source location information (as
2421 prefix) for physical lines that result from the process of breaking
2422 a message which is too long to fit on a single line.
2423
2424 @item -fdiagnostics-show-option
2425 @opindex fdiagnostics-show-option
2426 This option instructs the diagnostic machinery to add text to each
2427 diagnostic emitted, which indicates which command line option directly
2428 controls that diagnostic, when such an option is known to the
2429 diagnostic machinery.
2430
2431 @item -Wcoverage-mismatch
2432 @opindex Wcoverage-mismatch
2433 Warn if feedback profiles do not match when using the
2434 @option{-fprofile-use} option.
2435 If a source file was changed between @option{-fprofile-gen} and
2436 @option{-fprofile-use}, the files with the profile feedback can fail
2437 to match the source file and GCC can not use the profile feedback
2438 information.  By default, GCC emits an error message in this case.
2439 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2440 error.  GCC does not use appropriate feedback profiles, so using this
2441 option can result in poorly optimized code.  This option is useful
2442 only in the case of very minor changes such as bug fixes to an
2443 existing code-base.
2444
2445 @end table
2446
2447 @node Warning Options
2448 @section Options to Request or Suppress Warnings
2449 @cindex options to control warnings
2450 @cindex warning messages
2451 @cindex messages, warning
2452 @cindex suppressing warnings
2453
2454 Warnings are diagnostic messages that report constructions which
2455 are not inherently erroneous but which are risky or suggest there
2456 may have been an error.
2457
2458 You can request many specific warnings with options beginning @samp{-W},
2459 for example @option{-Wimplicit} to request warnings on implicit
2460 declarations.  Each of these specific warning options also has a
2461 negative form beginning @samp{-Wno-} to turn off warnings;
2462 for example, @option{-Wno-implicit}.  This manual lists only one of the
2463 two forms, whichever is not the default.
2464
2465 The following options control the amount and kinds of warnings produced
2466 by GCC; for further, language-specific options also refer to
2467 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2468 Options}.
2469
2470 @table @gcctabopt
2471 @cindex syntax checking
2472 @item -fsyntax-only
2473 @opindex fsyntax-only
2474 Check the code for syntax errors, but don't do anything beyond that.
2475
2476 @item -pedantic
2477 @opindex pedantic
2478 Issue all the warnings demanded by strict ISO C and ISO C++;
2479 reject all programs that use forbidden extensions, and some other
2480 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2481 version of the ISO C standard specified by any @option{-std} option used.
2482
2483 Valid ISO C and ISO C++ programs should compile properly with or without
2484 this option (though a rare few will require @option{-ansi} or a
2485 @option{-std} option specifying the required version of ISO C)@.  However,
2486 without this option, certain GNU extensions and traditional C and C++
2487 features are supported as well.  With this option, they are rejected.
2488
2489 @option{-pedantic} does not cause warning messages for use of the
2490 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2491 warnings are also disabled in the expression that follows
2492 @code{__extension__}.  However, only system header files should use
2493 these escape routes; application programs should avoid them.
2494 @xref{Alternate Keywords}.
2495
2496 Some users try to use @option{-pedantic} to check programs for strict ISO
2497 C conformance.  They soon find that it does not do quite what they want:
2498 it finds some non-ISO practices, but not all---only those for which
2499 ISO C @emph{requires} a diagnostic, and some others for which
2500 diagnostics have been added.
2501
2502 A feature to report any failure to conform to ISO C might be useful in
2503 some instances, but would require considerable additional work and would
2504 be quite different from @option{-pedantic}.  We don't have plans to
2505 support such a feature in the near future.
2506
2507 Where the standard specified with @option{-std} represents a GNU
2508 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2509 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2510 extended dialect is based.  Warnings from @option{-pedantic} are given
2511 where they are required by the base standard.  (It would not make sense
2512 for such warnings to be given only for features not in the specified GNU
2513 C dialect, since by definition the GNU dialects of C include all
2514 features the compiler supports with the given option, and there would be
2515 nothing to warn about.)
2516
2517 @item -pedantic-errors
2518 @opindex pedantic-errors
2519 Like @option{-pedantic}, except that errors are produced rather than
2520 warnings.
2521
2522 @item -w
2523 @opindex w
2524 Inhibit all warning messages.
2525
2526 @item -Wno-import
2527 @opindex Wno-import
2528 Inhibit warning messages about the use of @samp{#import}.
2529
2530 @item -Wchar-subscripts
2531 @opindex Wchar-subscripts
2532 Warn if an array subscript has type @code{char}.  This is a common cause
2533 of error, as programmers often forget that this type is signed on some
2534 machines.
2535 This warning is enabled by @option{-Wall}.
2536
2537 @item -Wcomment
2538 @opindex Wcomment
2539 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2540 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2541 This warning is enabled by @option{-Wall}.
2542
2543 @item -Wfatal-errors
2544 @opindex Wfatal-errors
2545 This option causes the compiler to abort compilation on the first error
2546 occurred rather than trying to keep going and printing further error
2547 messages.
2548
2549 @item -Wformat
2550 @opindex Wformat
2551 @opindex ffreestanding
2552 @opindex fno-builtin
2553 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2554 the arguments supplied have types appropriate to the format string
2555 specified, and that the conversions specified in the format string make
2556 sense.  This includes standard functions, and others specified by format
2557 attributes (@pxref{Function Attributes}), in the @code{printf},
2558 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2559 not in the C standard) families (or other target-specific families).
2560 Which functions are checked without format attributes having been
2561 specified depends on the standard version selected, and such checks of
2562 functions without the attribute specified are disabled by
2563 @option{-ffreestanding} or @option{-fno-builtin}.
2564
2565 The formats are checked against the format features supported by GNU
2566 libc version 2.2.  These include all ISO C90 and C99 features, as well
2567 as features from the Single Unix Specification and some BSD and GNU
2568 extensions.  Other library implementations may not support all these
2569 features; GCC does not support warning about features that go beyond a
2570 particular library's limitations.  However, if @option{-pedantic} is used
2571 with @option{-Wformat}, warnings will be given about format features not
2572 in the selected standard version (but not for @code{strfmon} formats,
2573 since those are not in any version of the C standard).  @xref{C Dialect
2574 Options,,Options Controlling C Dialect}.
2575
2576 Since @option{-Wformat} also checks for null format arguments for
2577 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2578
2579 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2580 aspects of format checking, the options @option{-Wformat-y2k},
2581 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2582 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2583 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2584
2585 @item -Wformat-y2k
2586 @opindex Wformat-y2k
2587 If @option{-Wformat} is specified, also warn about @code{strftime}
2588 formats which may yield only a two-digit year.
2589
2590 @item -Wno-format-extra-args
2591 @opindex Wno-format-extra-args
2592 If @option{-Wformat} is specified, do not warn about excess arguments to a
2593 @code{printf} or @code{scanf} format function.  The C standard specifies
2594 that such arguments are ignored.
2595
2596 Where the unused arguments lie between used arguments that are
2597 specified with @samp{$} operand number specifications, normally
2598 warnings are still given, since the implementation could not know what
2599 type to pass to @code{va_arg} to skip the unused arguments.  However,
2600 in the case of @code{scanf} formats, this option will suppress the
2601 warning if the unused arguments are all pointers, since the Single
2602 Unix Specification says that such unused arguments are allowed.
2603
2604 @item -Wno-format-zero-length
2605 @opindex Wno-format-zero-length
2606 If @option{-Wformat} is specified, do not warn about zero-length formats.
2607 The C standard specifies that zero-length formats are allowed.
2608
2609 @item -Wformat-nonliteral
2610 @opindex Wformat-nonliteral
2611 If @option{-Wformat} is specified, also warn if the format string is not a
2612 string literal and so cannot be checked, unless the format function
2613 takes its format arguments as a @code{va_list}.
2614
2615 @item -Wformat-security
2616 @opindex Wformat-security
2617 If @option{-Wformat} is specified, also warn about uses of format
2618 functions that represent possible security problems.  At present, this
2619 warns about calls to @code{printf} and @code{scanf} functions where the
2620 format string is not a string literal and there are no format arguments,
2621 as in @code{printf (foo);}.  This may be a security hole if the format
2622 string came from untrusted input and contains @samp{%n}.  (This is
2623 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2624 in future warnings may be added to @option{-Wformat-security} that are not
2625 included in @option{-Wformat-nonliteral}.)
2626
2627 @item -Wformat=2
2628 @opindex Wformat=2
2629 Enable @option{-Wformat} plus format checks not included in
2630 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2631 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2632
2633 @item -Wnonnull
2634 @opindex Wnonnull
2635 Warn about passing a null pointer for arguments marked as
2636 requiring a non-null value by the @code{nonnull} function attribute.
2637
2638 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2639 can be disabled with the @option{-Wno-nonnull} option.
2640
2641 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2642 @opindex Winit-self
2643 Warn about uninitialized variables which are initialized with themselves.
2644 Note this option can only be used with the @option{-Wuninitialized} option,
2645 which in turn only works with @option{-O1} and above.
2646
2647 For example, GCC will warn about @code{i} being uninitialized in the
2648 following snippet only when @option{-Winit-self} has been specified:
2649 @smallexample
2650 @group
2651 int f()
2652 @{
2653   int i = i;
2654   return i;
2655 @}
2656 @end group
2657 @end smallexample
2658
2659 @item -Wimplicit-int
2660 @opindex Wimplicit-int
2661 Warn when a declaration does not specify a type.
2662 This warning is enabled by @option{-Wall}.
2663
2664 @item -Wimplicit-function-declaration
2665 @opindex Wimplicit-function-declaration
2666 @opindex Wno-implicit-function-declaration
2667 Give a warning whenever a function is used before being declared. In
2668 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2669 enabled by default and it is made into an error by
2670 @option{-pedantic-errors}. This warning is also enabled by
2671 @option{-Wall}.
2672
2673 @item -Wimplicit
2674 @opindex Wimplicit
2675 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2676 This warning is enabled by @option{-Wall}.
2677
2678 @item -Wmain
2679 @opindex Wmain
2680 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2681 function with external linkage, returning int, taking either zero
2682 arguments, two, or three arguments of appropriate types.
2683 This warning is enabled by @option{-Wall}.
2684
2685 @item -Wmissing-braces
2686 @opindex Wmissing-braces
2687 Warn if an aggregate or union initializer is not fully bracketed.  In
2688 the following example, the initializer for @samp{a} is not fully
2689 bracketed, but that for @samp{b} is fully bracketed.
2690
2691 @smallexample
2692 int a[2][2] = @{ 0, 1, 2, 3 @};
2693 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2694 @end smallexample
2695
2696 This warning is enabled by @option{-Wall}.
2697
2698 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2699 @opindex Wmissing-include-dirs
2700 Warn if a user-supplied include directory does not exist.
2701
2702 @item -Wparentheses
2703 @opindex Wparentheses
2704 Warn if parentheses are omitted in certain contexts, such
2705 as when there is an assignment in a context where a truth value
2706 is expected, or when operators are nested whose precedence people
2707 often get confused about.
2708
2709 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2710 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2711 interpretation from that of ordinary mathematical notation.
2712
2713 Also warn about constructions where there may be confusion to which
2714 @code{if} statement an @code{else} branch belongs.  Here is an example of
2715 such a case:
2716
2717 @smallexample
2718 @group
2719 @{
2720   if (a)
2721     if (b)
2722       foo ();
2723   else
2724     bar ();
2725 @}
2726 @end group
2727 @end smallexample
2728
2729 In C/C++, every @code{else} branch belongs to the innermost possible
2730 @code{if} statement, which in this example is @code{if (b)}.  This is
2731 often not what the programmer expected, as illustrated in the above
2732 example by indentation the programmer chose.  When there is the
2733 potential for this confusion, GCC will issue a warning when this flag
2734 is specified.  To eliminate the warning, add explicit braces around
2735 the innermost @code{if} statement so there is no way the @code{else}
2736 could belong to the enclosing @code{if}.  The resulting code would
2737 look like this:
2738
2739 @smallexample
2740 @group
2741 @{
2742   if (a)
2743     @{
2744       if (b)
2745         foo ();
2746       else
2747         bar ();
2748     @}
2749 @}
2750 @end group
2751 @end smallexample
2752
2753 This warning is enabled by @option{-Wall}.
2754
2755 @item -Wsequence-point
2756 @opindex Wsequence-point
2757 Warn about code that may have undefined semantics because of violations
2758 of sequence point rules in the C and C++ standards.
2759
2760 The C and C++ standards defines the order in which expressions in a C/C++
2761 program are evaluated in terms of @dfn{sequence points}, which represent
2762 a partial ordering between the execution of parts of the program: those
2763 executed before the sequence point, and those executed after it.  These
2764 occur after the evaluation of a full expression (one which is not part
2765 of a larger expression), after the evaluation of the first operand of a
2766 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2767 function is called (but after the evaluation of its arguments and the
2768 expression denoting the called function), and in certain other places.
2769 Other than as expressed by the sequence point rules, the order of
2770 evaluation of subexpressions of an expression is not specified.  All
2771 these rules describe only a partial order rather than a total order,
2772 since, for example, if two functions are called within one expression
2773 with no sequence point between them, the order in which the functions
2774 are called is not specified.  However, the standards committee have
2775 ruled that function calls do not overlap.
2776
2777 It is not specified when between sequence points modifications to the
2778 values of objects take effect.  Programs whose behavior depends on this
2779 have undefined behavior; the C and C++ standards specify that ``Between
2780 the previous and next sequence point an object shall have its stored
2781 value modified at most once by the evaluation of an expression.
2782 Furthermore, the prior value shall be read only to determine the value
2783 to be stored.''.  If a program breaks these rules, the results on any
2784 particular implementation are entirely unpredictable.
2785
2786 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2787 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2788 diagnosed by this option, and it may give an occasional false positive
2789 result, but in general it has been found fairly effective at detecting
2790 this sort of problem in programs.
2791
2792 The standard is worded confusingly, therefore there is some debate
2793 over the precise meaning of the sequence point rules in subtle cases.
2794 Links to discussions of the problem, including proposed formal
2795 definitions, may be found on the GCC readings page, at
2796 @w{@uref{http://gcc.gnu.org/readings.html}}.
2797
2798 This warning is enabled by @option{-Wall} for C and C++.
2799
2800 @item -Wreturn-type
2801 @opindex Wreturn-type
2802 Warn whenever a function is defined with a return-type that defaults to
2803 @code{int}.  Also warn about any @code{return} statement with no
2804 return-value in a function whose return-type is not @code{void}.
2805
2806 Also warn if the return type of a function has a type qualifier
2807 such as @code{const}.  For ISO C such a type qualifier has no effect,
2808 since the value returned by a function is not an lvalue.
2809 For C++, the warning is only emitted for scalar types or @code{void}.
2810 ISO C prohibits qualified @code{void} return types on function
2811 definitions, so such return types always receive a warning
2812 even without this option.
2813
2814 For C++, a function without return type always produces a diagnostic
2815 message, even when @option{-Wno-return-type} is specified.  The only
2816 exceptions are @samp{main} and functions defined in system headers.
2817
2818 This warning is enabled by @option{-Wall}.
2819
2820 @item -Wswitch
2821 @opindex Wswitch
2822 Warn whenever a @code{switch} statement has an index of enumerated type
2823 and lacks a @code{case} for one or more of the named codes of that
2824 enumeration.  (The presence of a @code{default} label prevents this
2825 warning.)  @code{case} labels outside the enumeration range also
2826 provoke warnings when this option is used.
2827 This warning is enabled by @option{-Wall}.
2828
2829 @item -Wswitch-default
2830 @opindex Wswitch-switch
2831 Warn whenever a @code{switch} statement does not have a @code{default}
2832 case.
2833
2834 @item -Wswitch-enum
2835 @opindex Wswitch-enum
2836 Warn whenever a @code{switch} statement has an index of enumerated type
2837 and lacks a @code{case} for one or more of the named codes of that
2838 enumeration.  @code{case} labels outside the enumeration range also
2839 provoke warnings when this option is used.
2840
2841 @item -Wtrigraphs
2842 @opindex Wtrigraphs
2843 Warn if any trigraphs are encountered that might change the meaning of
2844 the program (trigraphs within comments are not warned about).
2845 This warning is enabled by @option{-Wall}.
2846
2847 @item -Wunused-function
2848 @opindex Wunused-function
2849 Warn whenever a static function is declared but not defined or a
2850 non-inline static function is unused.
2851 This warning is enabled by @option{-Wall}.
2852
2853 @item -Wunused-label
2854 @opindex Wunused-label
2855 Warn whenever a label is declared but not used.
2856 This warning is enabled by @option{-Wall}.
2857
2858 To suppress this warning use the @samp{unused} attribute
2859 (@pxref{Variable Attributes}).
2860
2861 @item -Wunused-parameter
2862 @opindex Wunused-parameter
2863 Warn whenever a function parameter is unused aside from its declaration.
2864
2865 To suppress this warning use the @samp{unused} attribute
2866 (@pxref{Variable Attributes}).
2867
2868 @item -Wunused-variable
2869 @opindex Wunused-variable
2870 Warn whenever a local variable or non-constant static variable is unused
2871 aside from its declaration.
2872 This warning is enabled by @option{-Wall}.
2873
2874 To suppress this warning use the @samp{unused} attribute
2875 (@pxref{Variable Attributes}).
2876
2877 @item -Wunused-value
2878 @opindex Wunused-value
2879 Warn whenever a statement computes a result that is explicitly not
2880 used. To suppress this warning cast the unused expression to
2881 @samp{void}. This includes an expression-statement or the left-hand
2882 side of a comma expression that contains no side effects. For example,
2883 an expression such as @samp{x[i,j]} will cause a warning, while
2884 @samp{x[(void)i,j]} will not.
2885
2886 This warning is enabled by @option{-Wall}.
2887
2888 @item -Wunused
2889 @opindex Wunused
2890 All the above @option{-Wunused} options combined.
2891
2892 In order to get a warning about an unused function parameter, you must
2893 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2894 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2895
2896 @item -Wuninitialized
2897 @opindex Wuninitialized
2898 Warn if an automatic variable is used without first being initialized or
2899 if a variable may be clobbered by a @code{setjmp} call.
2900
2901 These warnings are possible only in optimizing compilation,
2902 because they require data flow information that is computed only
2903 when optimizing.  If you do not specify @option{-O}, you will not get
2904 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2905 requiring @option{-O}.
2906
2907 If you want to warn about code which uses the uninitialized value of the
2908 variable in its own initializer, use the @option{-Winit-self} option.
2909
2910 These warnings occur for individual uninitialized or clobbered
2911 elements of structure, union or array variables as well as for
2912 variables which are uninitialized or clobbered as a whole.  They do
2913 not occur for variables or elements declared @code{volatile}.  Because
2914 these warnings depend on optimization, the exact variables or elements
2915 for which there are warnings will depend on the precise optimization
2916 options and version of GCC used.
2917
2918 Note that there may be no warning about a variable that is used only
2919 to compute a value that itself is never used, because such
2920 computations may be deleted by data flow analysis before the warnings
2921 are printed.
2922
2923 These warnings are made optional because GCC is not smart
2924 enough to see all the reasons why the code might be correct
2925 despite appearing to have an error.  Here is one example of how
2926 this can happen:
2927
2928 @smallexample
2929 @group
2930 @{
2931   int x;
2932   switch (y)
2933     @{
2934     case 1: x = 1;
2935       break;
2936     case 2: x = 4;
2937       break;
2938     case 3: x = 5;
2939     @}
2940   foo (x);
2941 @}
2942 @end group
2943 @end smallexample
2944
2945 @noindent
2946 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2947 always initialized, but GCC doesn't know this.  Here is
2948 another common case:
2949
2950 @smallexample
2951 @{
2952   int save_y;
2953   if (change_y) save_y = y, y = new_y;
2954   @dots{}
2955   if (change_y) y = save_y;
2956 @}
2957 @end smallexample
2958
2959 @noindent
2960 This has no bug because @code{save_y} is used only if it is set.
2961
2962 @cindex @code{longjmp} warnings
2963 This option also warns when a non-volatile automatic variable might be
2964 changed by a call to @code{longjmp}.  These warnings as well are possible
2965 only in optimizing compilation.
2966
2967 The compiler sees only the calls to @code{setjmp}.  It cannot know
2968 where @code{longjmp} will be called; in fact, a signal handler could
2969 call it at any point in the code.  As a result, you may get a warning
2970 even when there is in fact no problem because @code{longjmp} cannot
2971 in fact be called at the place which would cause a problem.
2972
2973 Some spurious warnings can be avoided if you declare all the functions
2974 you use that never return as @code{noreturn}.  @xref{Function
2975 Attributes}.
2976
2977 This warning is enabled by @option{-Wall}.
2978
2979 @item -Wunknown-pragmas
2980 @opindex Wunknown-pragmas
2981 @cindex warning for unknown pragmas
2982 @cindex unknown pragmas, warning
2983 @cindex pragmas, warning of unknown
2984 Warn when a #pragma directive is encountered which is not understood by
2985 GCC@.  If this command line option is used, warnings will even be issued
2986 for unknown pragmas in system header files.  This is not the case if
2987 the warnings were only enabled by the @option{-Wall} command line option.
2988
2989 @item -Wno-pragmas
2990 @opindex Wno-pragmas
2991 @opindex Wpragmas
2992 Do not warn about misuses of pragmas, such as incorrect parameters,
2993 invalid syntax, or conflicts between pragmas.  See also
2994 @samp{-Wunknown-pragmas}.
2995
2996 @item -Wstrict-aliasing
2997 @opindex Wstrict-aliasing
2998 This option is only active when @option{-fstrict-aliasing} is active.
2999 It warns about code which might break the strict aliasing rules that the
3000 compiler is using for optimization.  The warning does not catch all
3001 cases, but does attempt to catch the more common pitfalls.  It is
3002 included in @option{-Wall}.
3003
3004 @item -Wstrict-aliasing=2
3005 @opindex Wstrict-aliasing=2
3006 This option is only active when @option{-fstrict-aliasing} is active.
3007 It warns about code which might break the strict aliasing rules that the
3008 compiler is using for optimization.  This warning catches more cases than
3009 @option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
3010 cases that are safe.
3011
3012 @item -Wstrict-overflow
3013 @item -Wstrict-overflow=@var{n}
3014 @opindex -Wstrict-overflow
3015 This option is only active when @option{-fstrict-overflow} is active.
3016 It warns about cases where the compiler optimizes based on the
3017 assumption that signed overflow does not occur.  Note that it does not
3018 warn about all cases where the code might overflow: it only warns
3019 about cases where the compiler implements some optimization.  Thus
3020 this warning depends on the optimization level.
3021
3022 An optimization which assumes that signed overflow does not occur is
3023 perfectly safe if the values of the variables involved are such that
3024 overflow never does, in fact, occur.  Therefore this warning can
3025 easily give a false positive: a warning about code which is not
3026 actually a problem.  To help focus on important issues, several
3027 warning levels are defined.
3028
3029 @table @option
3030 @item -Wstrict-overflow=1
3031 Warn about cases which are both questionable and easy to avoid.  For
3032 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3033 compiler will simplify this to @code{1}.  This level of
3034 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3035 are not, and must be explicitly requested.
3036
3037 @item -Wstrict-overflow=2
3038 Also warn about other cases where a comparison is simplified to a
3039 constant.  For example: @code{abs (x) >= 0}.  This can only be
3040 simplified when @option{-fstrict-overflow} is in effect, because
3041 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3042 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3043 @option{-Wstrict-overflow=2}.
3044
3045 @item -Wstrict-overflow=3
3046 Also warn about other cases where a comparison is simplified.  For
3047 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3048
3049 @item -Wstrict-overflow=4
3050 Also warn about other simplifications not covered by the above cases.
3051 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3052
3053 @item -Wstrict-overflow=5
3054 Also warn about cases where the compiler reduces the magnitude of a
3055 constant involved in a comparison.  For example: @code{x + 2 > y} will
3056 be simplified to @code{x + 1 >= y}.  This is reported only at the
3057 highest warning level because this simplification applies to many
3058 comparisons, so this warning level will give a very large number of
3059 false positives.
3060 @end table
3061
3062 @item -Warray-bounds
3063 @opindex Wno-array-bounds
3064 @opindex Warray-bounds
3065 This option is only active when @option{-ftree-vrp} is active
3066 (default for -O2 and above). It warns about subscripts to arrays
3067 that are always out of bounds. This warning is enabled by @option{-Wall}.
3068
3069 @item -Wall
3070 @opindex Wall
3071 All of the above @samp{-W} options combined.  This enables all the
3072 warnings about constructions that some users consider questionable, and
3073 that are easy to avoid (or modify to prevent the warning), even in
3074 conjunction with macros.  This also enables some language-specific
3075 warnings described in @ref{C++ Dialect Options} and
3076 @ref{Objective-C and Objective-C++ Dialect Options}.
3077 @end table
3078
3079 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
3080 Some of them warn about constructions that users generally do not
3081 consider questionable, but which occasionally you might wish to check
3082 for; others warn about constructions that are necessary or hard to avoid
3083 in some cases, and there is no simple way to modify the code to suppress
3084 the warning.
3085
3086 @table @gcctabopt
3087 @item -Wextra
3088 @opindex W
3089 @opindex Wextra
3090 (This option used to be called @option{-W}.  The older name is still
3091 supported, but the newer name is more descriptive.)  Print extra warning
3092 messages for these events:
3093
3094 @itemize @bullet
3095 @item
3096 A function can return either with or without a value.  (Falling
3097 off the end of the function body is considered returning without
3098 a value.)  For example, this function would evoke such a
3099 warning:
3100
3101 @smallexample
3102 @group
3103 foo (a)
3104 @{
3105   if (a > 0)
3106     return a;
3107 @}
3108 @end group
3109 @end smallexample
3110
3111 @item
3112 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
3113
3114 @item @r{(C only)}
3115 Storage-class specifiers like @code{static} are not the first things
3116 in a declaration.  According to the C Standard, this usage is
3117 obsolescent.  This warning can be independently controlled by
3118 @option{-Wold-style-declaration}.
3119
3120 @item
3121 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
3122 arguments.
3123
3124 @item
3125 A comparison between signed and unsigned values could produce an
3126 incorrect result when the signed value is converted to unsigned.
3127 (But don't warn if @option{-Wno-sign-compare} is also specified.)
3128
3129 @item
3130 An aggregate has an initializer which does not initialize all members.
3131 This warning can be independently controlled by
3132 @option{-Wmissing-field-initializers}.
3133
3134 @item
3135 An initialized field without side effects is overridden when using
3136 designated initializers (@pxref{Designated Inits, , Designated
3137 Initializers}).  This warning can be independently controlled by
3138 @option{-Woverride-init}.
3139
3140 @item @r{(C only)}
3141 A function parameter is declared without a type specifier in K&R-style
3142 functions.  This warning can be independently controlled by
3143 @option{-Wmissing-parameter-type}.
3144
3145 @item
3146 An empty body occurs in an @samp{if}, @samp{else} or
3147 @samp{do while} statement. This warning can be independently
3148 controlled by @option{-Wempty-body}.
3149
3150 @item
3151 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3152 @samp{>}, or @samp{>=}.
3153
3154 @item
3155 A variable might be changed by @samp{longjmp} or @samp{vfork}.
3156 This warning can be independently controlled by @option{-Wclobbered}.
3157
3158 @item @r{(C++ only)}
3159 An enumerator and a non-enumerator both appear in a conditional expression.
3160
3161 @item @r{(C++ only)}
3162 A non-static reference or non-static @samp{const} member appears in a
3163 class without constructors.
3164
3165 @item @r{(C++ only)}
3166 Ambiguous virtual bases.
3167
3168 @item @r{(C++ only)}
3169 Subscripting an array which has been declared @samp{register}.
3170
3171 @item @r{(C++ only)}
3172 Taking the address of a variable which has been declared @samp{register}.
3173
3174 @item @r{(C++ only)}
3175 A base class is not initialized in a derived class' copy constructor.
3176 @end itemize
3177
3178 @item -Wno-div-by-zero
3179 @opindex Wno-div-by-zero
3180 @opindex Wdiv-by-zero
3181 Do not warn about compile-time integer division by zero.  Floating point
3182 division by zero is not warned about, as it can be a legitimate way of
3183 obtaining infinities and NaNs.
3184
3185 @item -Wsystem-headers
3186 @opindex Wsystem-headers
3187 @cindex warnings from system headers
3188 @cindex system headers, warnings from
3189 Print warning messages for constructs found in system header files.
3190 Warnings from system headers are normally suppressed, on the assumption
3191 that they usually do not indicate real problems and would only make the
3192 compiler output harder to read.  Using this command line option tells
3193 GCC to emit warnings from system headers as if they occurred in user
3194 code.  However, note that using @option{-Wall} in conjunction with this
3195 option will @emph{not} warn about unknown pragmas in system
3196 headers---for that, @option{-Wunknown-pragmas} must also be used.
3197
3198 @item -Wfloat-equal
3199 @opindex Wfloat-equal
3200 Warn if floating point values are used in equality comparisons.
3201
3202 The idea behind this is that sometimes it is convenient (for the
3203 programmer) to consider floating-point values as approximations to
3204 infinitely precise real numbers.  If you are doing this, then you need
3205 to compute (by analyzing the code, or in some other way) the maximum or
3206 likely maximum error that the computation introduces, and allow for it
3207 when performing comparisons (and when producing output, but that's a
3208 different problem).  In particular, instead of testing for equality, you
3209 would check to see whether the two values have ranges that overlap; and
3210 this is done with the relational operators, so equality comparisons are
3211 probably mistaken.
3212
3213 @item -Wtraditional @r{(C only)}
3214 @opindex Wtraditional
3215 Warn about certain constructs that behave differently in traditional and
3216 ISO C@.  Also warn about ISO C constructs that have no traditional C
3217 equivalent, and/or problematic constructs which should be avoided.
3218
3219 @itemize @bullet
3220 @item
3221 Macro parameters that appear within string literals in the macro body.
3222 In traditional C macro replacement takes place within string literals,
3223 but does not in ISO C@.
3224
3225 @item
3226 In traditional C, some preprocessor directives did not exist.
3227 Traditional preprocessors would only consider a line to be a directive
3228 if the @samp{#} appeared in column 1 on the line.  Therefore
3229 @option{-Wtraditional} warns about directives that traditional C
3230 understands but would ignore because the @samp{#} does not appear as the
3231 first character on the line.  It also suggests you hide directives like
3232 @samp{#pragma} not understood by traditional C by indenting them.  Some
3233 traditional implementations would not recognize @samp{#elif}, so it
3234 suggests avoiding it altogether.
3235
3236 @item
3237 A function-like macro that appears without arguments.
3238
3239 @item
3240 The unary plus operator.
3241
3242 @item
3243 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3244 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3245 constants.)  Note, these suffixes appear in macros defined in the system
3246 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3247 Use of these macros in user code might normally lead to spurious
3248 warnings, however GCC's integrated preprocessor has enough context to
3249 avoid warning in these cases.
3250
3251 @item
3252 A function declared external in one block and then used after the end of
3253 the block.
3254
3255 @item
3256 A @code{switch} statement has an operand of type @code{long}.
3257
3258 @item
3259 A non-@code{static} function declaration follows a @code{static} one.
3260 This construct is not accepted by some traditional C compilers.
3261
3262 @item
3263 The ISO type of an integer constant has a different width or
3264 signedness from its traditional type.  This warning is only issued if
3265 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3266 typically represent bit patterns, are not warned about.
3267
3268 @item
3269 Usage of ISO string concatenation is detected.
3270
3271 @item
3272 Initialization of automatic aggregates.
3273
3274 @item
3275 Identifier conflicts with labels.  Traditional C lacks a separate
3276 namespace for labels.
3277
3278 @item
3279 Initialization of unions.  If the initializer is zero, the warning is
3280 omitted.  This is done under the assumption that the zero initializer in
3281 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3282 initializer warnings and relies on default initialization to zero in the
3283 traditional C case.
3284
3285 @item
3286 Conversions by prototypes between fixed/floating point values and vice
3287 versa.  The absence of these prototypes when compiling with traditional
3288 C would cause serious problems.  This is a subset of the possible
3289 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3290
3291 @item
3292 Use of ISO C style function definitions.  This warning intentionally is
3293 @emph{not} issued for prototype declarations or variadic functions
3294 because these ISO C features will appear in your code when using
3295 libiberty's traditional C compatibility macros, @code{PARAMS} and
3296 @code{VPARAMS}.  This warning is also bypassed for nested functions
3297 because that feature is already a GCC extension and thus not relevant to
3298 traditional C compatibility.
3299 @end itemize
3300
3301 @item -Wtraditional-conversion @r{(C only)}
3302 @opindex Wtraditional-conversion
3303 Warn if a prototype causes a type conversion that is different from what
3304 would happen to the same argument in the absence of a prototype.  This
3305 includes conversions of fixed point to floating and vice versa, and
3306 conversions changing the width or signedness of a fixed point argument
3307 except when the same as the default promotion.
3308
3309 @item -Wdeclaration-after-statement @r{(C only)}
3310 @opindex Wdeclaration-after-statement
3311 Warn when a declaration is found after a statement in a block.  This
3312 construct, known from C++, was introduced with ISO C99 and is by default
3313 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3314 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3315
3316 @item -Wundef
3317 @opindex Wundef
3318 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3319
3320 @item -Wno-endif-labels
3321 @opindex Wno-endif-labels
3322 @opindex Wendif-labels
3323 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3324
3325 @item -Wshadow
3326 @opindex Wshadow
3327 Warn whenever a local variable shadows another local variable, parameter or
3328 global variable or whenever a built-in function is shadowed.
3329
3330 @item -Wlarger-than-@var{len}
3331 @opindex Wlarger-than
3332 Warn whenever an object of larger than @var{len} bytes is defined.
3333
3334 @item -Wunsafe-loop-optimizations
3335 @opindex Wunsafe-loop-optimizations
3336 Warn if the loop cannot be optimized because the compiler could not
3337 assume anything on the bounds of the loop indices.  With
3338 @option{-funsafe-loop-optimizations} warn if the compiler made
3339 such assumptions.
3340
3341 @item -Wpointer-arith
3342 @opindex Wpointer-arith
3343 Warn about anything that depends on the ``size of'' a function type or
3344 of @code{void}.  GNU C assigns these types a size of 1, for
3345 convenience in calculations with @code{void *} pointers and pointers
3346 to functions.  In C++, warn also when an arithmetic operation involves
3347 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3348
3349 @item -Wbad-function-cast @r{(C only)}
3350 @opindex Wbad-function-cast
3351 Warn whenever a function call is cast to a non-matching type.
3352 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3353
3354 @item -Wc++-compat
3355 Warn about ISO C constructs that are outside of the common subset of
3356 ISO C and ISO C++, e.g.@: request for implicit conversion from
3357 @code{void *} to a pointer to non-@code{void} type.
3358
3359 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3360 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3361 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3362 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3363
3364 @item -Wcast-qual
3365 @opindex Wcast-qual
3366 Warn whenever a pointer is cast so as to remove a type qualifier from
3367 the target type.  For example, warn if a @code{const char *} is cast
3368 to an ordinary @code{char *}.
3369
3370 @item -Wcast-align
3371 @opindex Wcast-align
3372 Warn whenever a pointer is cast such that the required alignment of the
3373 target is increased.  For example, warn if a @code{char *} is cast to
3374 an @code{int *} on machines where integers can only be accessed at
3375 two- or four-byte boundaries.
3376
3377 @item -Wwrite-strings
3378 @opindex Wwrite-strings
3379 When compiling C, give string constants the type @code{const
3380 char[@var{length}]} so that
3381 copying the address of one into a non-@code{const} @code{char *}
3382 pointer will get a warning; when compiling C++, warn about the
3383 deprecated conversion from string literals to @code{char *}.  This
3384 warning, by default, is enabled for C++ programs.
3385 These warnings will help you find at
3386 compile time code that can try to write into a string constant, but
3387 only if you have been very careful about using @code{const} in
3388 declarations and prototypes.  Otherwise, it will just be a nuisance;
3389 this is why we did not make @option{-Wall} request these warnings.
3390
3391 @item -Wclobbered
3392 @opindex Wclobbered
3393 Warn for variables that might be changed by @samp{longjmp} or
3394 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3395
3396 @item -Wconversion
3397 @opindex Wconversion
3398 Warn for implicit conversions that may alter a value. This includes
3399 conversions between real and integer, like @code{abs (x)} when
3400 @code{x} is @code{double}; conversions between signed and unsigned,
3401 like @code{unsigned ui = -1}; and conversions to smaller types, like
3402 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3403 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3404 changed by the conversion like in @code{abs (2.0)}.
3405
3406 For C++, also warn for conversions between @code{NULL} and non-pointer
3407 types; confusing overload resolution for user-defined conversions; and
3408 conversions that will never use a type conversion operator:
3409 conversions to @code{void}, the same type, a base class or a reference
3410 to them.
3411
3412 @item -Wempty-body
3413 @opindex Wempty-body
3414 An empty body occurs in an @samp{if}, @samp{else} or @samp{do while}
3415 statement.  This warning is also enabled by @option{-Wextra}.
3416
3417 @item -Wsign-compare
3418 @opindex Wsign-compare
3419 @cindex warning for comparison of signed and unsigned values
3420 @cindex comparison of signed and unsigned values, warning
3421 @cindex signed and unsigned values, comparison warning
3422 Warn when a comparison between signed and unsigned values could produce
3423 an incorrect result when the signed value is converted to unsigned.
3424 This warning is also enabled by @option{-Wextra}; to get the other warnings
3425 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3426
3427 @item -Waddress
3428 @opindex Waddress
3429 @opindex Wno-address
3430 Warn about suspicious uses of memory addresses. These include using
3431 the address of a function in a conditional expression, such as
3432 @code{void func(void); if (func)}, and comparisons against the memory
3433 address of a string literal, such as @code{if (x == "abc")}.  Such
3434 uses typically indicate a programmer error: the address of a function
3435 always evaluates to true, so their use in a conditional usually
3436 indicate that the programmer forgot the parentheses in a function
3437 call; and comparisons against string literals result in unspecified
3438 behavior and are not portable in C, so they usually indicate that the
3439 programmer intended to use @code{strcmp}.  This warning is enabled by
3440 @option{-Wall}.
3441
3442 @item -Wlogical-op
3443 @opindex Wlogical-op
3444 @opindex Wno-logical-op
3445 Warn about suspicious uses of logical operators in expressions.
3446 This includes using logical operators in contexts where a
3447 bit-wise operator is likely to be expected.
3448
3449 @item -Waggregate-return
3450 @opindex Waggregate-return
3451 Warn if any functions that return structures or unions are defined or
3452 called.  (In languages where you can return an array, this also elicits
3453 a warning.)
3454
3455 @item -Wno-attributes
3456 @opindex Wno-attributes
3457 @opindex Wattributes
3458 Do not warn if an unexpected @code{__attribute__} is used, such as
3459 unrecognized attributes, function attributes applied to variables,
3460 etc.  This will not stop errors for incorrect use of supported
3461 attributes.
3462
3463 @item -Wstrict-prototypes @r{(C only)}
3464 @opindex Wstrict-prototypes
3465 Warn if a function is declared or defined without specifying the
3466 argument types.  (An old-style function definition is permitted without
3467 a warning if preceded by a declaration which specifies the argument
3468 types.)
3469
3470 @item -Wold-style-declaration @r{(C only)}
3471 @opindex Wold-style-declaration
3472 Warn for obsolescent usages, according to the C Standard, in a
3473 declaration. For example, warn if storage-class specifiers like
3474 @code{static} are not the first things in a declaration.  This warning
3475 is also enabled by @option{-Wextra}.
3476
3477 @item -Wold-style-definition @r{(C only)}
3478 @opindex Wold-style-definition
3479 Warn if an old-style function definition is used.  A warning is given
3480 even if there is a previous prototype.
3481
3482 @item -Wmissing-parameter-type @r{(C only)}
3483 @opindex Wmissing-parameter-type
3484 A function parameter is declared without a type specifier in K&R-style
3485 functions:
3486
3487 @smallexample
3488 void foo(bar) @{ @}
3489 @end smallexample
3490
3491 This warning is also enabled by @option{-Wextra}.
3492
3493 @item -Wmissing-prototypes @r{(C only)}
3494 @opindex Wmissing-prototypes
3495 Warn if a global function is defined without a previous prototype
3496 declaration.  This warning is issued even if the definition itself
3497 provides a prototype.  The aim is to detect global functions that fail
3498 to be declared in header files.
3499
3500 @item -Wmissing-declarations @r{(C and C++ only)}
3501 @opindex Wmissing-declarations
3502 Warn if a global function is defined without a previous declaration.
3503 Do so even if the definition itself provides a prototype.
3504 Use this option to detect global functions that are not declared in
3505 header files.  In C++, no warnings are issued for function templates,
3506 or for inline functions, or for functions in anonymous namespaces.
3507
3508 @item -Wmissing-field-initializers
3509 @opindex Wmissing-field-initializers
3510 @opindex W
3511 @opindex Wextra
3512 Warn if a structure's initializer has some fields missing.  For
3513 example, the following code would cause such a warning, because
3514 @code{x.h} is implicitly zero:
3515
3516 @smallexample
3517 struct s @{ int f, g, h; @};
3518 struct s x = @{ 3, 4 @};
3519 @end smallexample
3520
3521 This option does not warn about designated initializers, so the following
3522 modification would not trigger a warning:
3523
3524 @smallexample
3525 struct s @{ int f, g, h; @};
3526 struct s x = @{ .f = 3, .g = 4 @};
3527 @end smallexample
3528
3529 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3530 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3531
3532 @item -Wmissing-noreturn
3533 @opindex Wmissing-noreturn
3534 Warn about functions which might be candidates for attribute @code{noreturn}.
3535 Note these are only possible candidates, not absolute ones.  Care should
3536 be taken to manually verify functions actually do not ever return before
3537 adding the @code{noreturn} attribute, otherwise subtle code generation
3538 bugs could be introduced.  You will not get a warning for @code{main} in
3539 hosted C environments.
3540
3541 @item -Wmissing-format-attribute
3542 @opindex Wmissing-format-attribute
3543 @opindex Wformat
3544 Warn about function pointers which might be candidates for @code{format}
3545 attributes.  Note these are only possible candidates, not absolute ones.
3546 GCC will guess that function pointers with @code{format} attributes that
3547 are used in assignment, initialization, parameter passing or return
3548 statements should have a corresponding @code{format} attribute in the
3549 resulting type.  I.e.@: the left-hand side of the assignment or
3550 initialization, the type of the parameter variable, or the return type
3551 of the containing function respectively should also have a @code{format}
3552 attribute to avoid the warning.
3553
3554 GCC will also warn about function definitions which might be
3555 candidates for @code{format} attributes.  Again, these are only
3556 possible candidates.  GCC will guess that @code{format} attributes
3557 might be appropriate for any function that calls a function like
3558 @code{vprintf} or @code{vscanf}, but this might not always be the
3559 case, and some functions for which @code{format} attributes are
3560 appropriate may not be detected.
3561
3562 @item -Wno-multichar
3563 @opindex Wno-multichar
3564 @opindex Wmultichar
3565 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3566 Usually they indicate a typo in the user's code, as they have
3567 implementation-defined values, and should not be used in portable code.
3568
3569 @item -Wnormalized=<none|id|nfc|nfkc>
3570 @opindex Wnormalized
3571 @cindex NFC
3572 @cindex NFKC
3573 @cindex character set, input normalization
3574 In ISO C and ISO C++, two identifiers are different if they are
3575 different sequences of characters.  However, sometimes when characters
3576 outside the basic ASCII character set are used, you can have two
3577 different character sequences that look the same.  To avoid confusion,
3578 the ISO 10646 standard sets out some @dfn{normalization rules} which
3579 when applied ensure that two sequences that look the same are turned into
3580 the same sequence.  GCC can warn you if you are using identifiers which
3581 have not been normalized; this option controls that warning.
3582
3583 There are four levels of warning that GCC supports.  The default is
3584 @option{-Wnormalized=nfc}, which warns about any identifier which is
3585 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3586 recommended form for most uses.
3587
3588 Unfortunately, there are some characters which ISO C and ISO C++ allow
3589 in identifiers that when turned into NFC aren't allowable as
3590 identifiers.  That is, there's no way to use these symbols in portable
3591 ISO C or C++ and have all your identifiers in NFC.
3592 @option{-Wnormalized=id} suppresses the warning for these characters.
3593 It is hoped that future versions of the standards involved will correct
3594 this, which is why this option is not the default.
3595
3596 You can switch the warning off for all characters by writing
3597 @option{-Wnormalized=none}.  You would only want to do this if you
3598 were using some other normalization scheme (like ``D''), because
3599 otherwise you can easily create bugs that are literally impossible to see.
3600
3601 Some characters in ISO 10646 have distinct meanings but look identical
3602 in some fonts or display methodologies, especially once formatting has
3603 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3604 LETTER N'', will display just like a regular @code{n} which has been
3605 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3606 normalization scheme to convert all these into a standard form as
3607 well, and GCC will warn if your code is not in NFKC if you use
3608 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3609 about every identifier that contains the letter O because it might be
3610 confused with the digit 0, and so is not the default, but may be
3611 useful as a local coding convention if the programming environment is
3612 unable to be fixed to display these characters distinctly.
3613
3614 @item -Wno-deprecated-declarations
3615 @opindex Wno-deprecated-declarations
3616 Do not warn about uses of functions (@pxref{Function Attributes}),
3617 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3618 Attributes}) marked as deprecated by using the @code{deprecated}
3619 attribute.
3620
3621 @item -Wno-overflow
3622 @opindex Wno-overflow
3623 Do not warn about compile-time overflow in constant expressions.
3624
3625 @item -Woverride-init
3626 @opindex Woverride-init
3627 @opindex W
3628 @opindex Wextra
3629 Warn if an initialized field without side effects is overridden when
3630 using designated initializers (@pxref{Designated Inits, , Designated
3631 Initializers}).
3632
3633 This warning is included in @option{-Wextra}.  To get other
3634 @option{-Wextra} warnings without this one, use @samp{-Wextra
3635 -Wno-override-init}.
3636
3637 @item -Wpacked
3638 @opindex Wpacked
3639 Warn if a structure is given the packed attribute, but the packed
3640 attribute has no effect on the layout or size of the structure.
3641 Such structures may be mis-aligned for little benefit.  For
3642 instance, in this code, the variable @code{f.x} in @code{struct bar}
3643 will be misaligned even though @code{struct bar} does not itself
3644 have the packed attribute:
3645
3646 @smallexample
3647 @group
3648 struct foo @{
3649   int x;
3650   char a, b, c, d;
3651 @} __attribute__((packed));
3652 struct bar @{
3653   char z;
3654   struct foo f;
3655 @};
3656 @end group
3657 @end smallexample
3658
3659 @item -Wpadded
3660 @opindex Wpadded
3661 Warn if padding is included in a structure, either to align an element
3662 of the structure or to align the whole structure.  Sometimes when this
3663 happens it is possible to rearrange the fields of the structure to
3664 reduce the padding and so make the structure smaller.
3665
3666 @item -Wredundant-decls
3667 @opindex Wredundant-decls
3668 Warn if anything is declared more than once in the same scope, even in
3669 cases where multiple declaration is valid and changes nothing.
3670
3671 @item -Wnested-externs @r{(C only)}
3672 @opindex Wnested-externs
3673 Warn if an @code{extern} declaration is encountered within a function.
3674
3675 @item -Wunreachable-code
3676 @opindex Wunreachable-code
3677 Warn if the compiler detects that code will never be executed.
3678
3679 This option is intended to warn when the compiler detects that at
3680 least a whole line of source code will never be executed, because
3681 some condition is never satisfied or because it is after a
3682 procedure that never returns.
3683
3684 It is possible for this option to produce a warning even though there
3685 are circumstances under which part of the affected line can be executed,
3686 so care should be taken when removing apparently-unreachable code.
3687
3688 For instance, when a function is inlined, a warning may mean that the
3689 line is unreachable in only one inlined copy of the function.
3690
3691 This option is not made part of @option{-Wall} because in a debugging
3692 version of a program there is often substantial code which checks
3693 correct functioning of the program and is, hopefully, unreachable
3694 because the program does work.  Another common use of unreachable
3695 code is to provide behavior which is selectable at compile-time.
3696
3697 @item -Winline
3698 @opindex Winline
3699 Warn if a function can not be inlined and it was declared as inline.
3700 Even with this option, the compiler will not warn about failures to
3701 inline functions declared in system headers.
3702
3703 The compiler uses a variety of heuristics to determine whether or not
3704 to inline a function.  For example, the compiler takes into account
3705 the size of the function being inlined and the amount of inlining
3706 that has already been done in the current function.  Therefore,
3707 seemingly insignificant changes in the source program can cause the
3708 warnings produced by @option{-Winline} to appear or disappear.
3709
3710 @item -Wno-invalid-offsetof @r{(C++ only)}
3711 @opindex Wno-invalid-offsetof
3712 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3713 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3714 to a non-POD type is undefined.  In existing C++ implementations,
3715 however, @samp{offsetof} typically gives meaningful results even when
3716 applied to certain kinds of non-POD types. (Such as a simple
3717 @samp{struct} that fails to be a POD type only by virtue of having a
3718 constructor.)  This flag is for users who are aware that they are
3719 writing nonportable code and who have deliberately chosen to ignore the
3720 warning about it.
3721
3722 The restrictions on @samp{offsetof} may be relaxed in a future version
3723 of the C++ standard.
3724
3725 @item -Wno-int-to-pointer-cast @r{(C only)}
3726 @opindex Wno-int-to-pointer-cast
3727 Suppress warnings from casts to pointer type of an integer of a
3728 different size.
3729
3730 @item -Wno-pointer-to-int-cast @r{(C only)}
3731 @opindex Wno-pointer-to-int-cast
3732 Suppress warnings from casts from a pointer to an integer type of a
3733 different size.
3734
3735 @item -Winvalid-pch
3736 @opindex Winvalid-pch
3737 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3738 the search path but can't be used.
3739
3740 @item -Wlong-long
3741 @opindex Wlong-long
3742 @opindex Wno-long-long
3743 Warn if @samp{long long} type is used.  This is default.  To inhibit
3744 the warning messages, use @option{-Wno-long-long}.  Flags
3745 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3746 only when @option{-pedantic} flag is used.
3747
3748 @item -Wvariadic-macros
3749 @opindex Wvariadic-macros
3750 @opindex Wno-variadic-macros
3751 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3752 alternate syntax when in pedantic ISO C99 mode.  This is default.
3753 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3754
3755 @item -Wvla
3756 @opindex Wvla
3757 @opindex Wno-vla
3758 Warn if variable length array is used in the code.
3759 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
3760 the variable length array.
3761
3762 @item -Wvolatile-register-var
3763 @opindex Wvolatile-register-var
3764 @opindex Wno-volatile-register-var
3765 Warn if a register variable is declared volatile.  The volatile
3766 modifier does not inhibit all optimizations that may eliminate reads
3767 and/or writes to register variables.
3768
3769 @item -Wdisabled-optimization
3770 @opindex Wdisabled-optimization
3771 Warn if a requested optimization pass is disabled.  This warning does
3772 not generally indicate that there is anything wrong with your code; it
3773 merely indicates that GCC's optimizers were unable to handle the code
3774 effectively.  Often, the problem is that your code is too big or too
3775 complex; GCC will refuse to optimize programs when the optimization
3776 itself is likely to take inordinate amounts of time.
3777
3778 @item -Wpointer-sign
3779 @opindex Wpointer-sign
3780 @opindex Wno-pointer-sign
3781 Warn for pointer argument passing or assignment with different signedness.
3782 This option is only supported for C and Objective-C@.  It is implied by
3783 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3784 @option{-Wno-pointer-sign}.
3785
3786 @item -Werror
3787 @opindex Werror
3788 Make all warnings into errors.
3789
3790 @item -Werror=
3791 @opindex Werror=
3792 Make the specified warning into an errors.  The specifier for a
3793 warning is appended, for example @option{-Werror=switch} turns the
3794 warnings controlled by @option{-Wswitch} into errors.  This switch
3795 takes a negative form, to be used to negate @option{-Werror} for
3796 specific warnings, for example @option{-Wno-error=switch} makes
3797 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3798 is in effect.  You can use the @option{-fdiagnostics-show-option}
3799 option to have each controllable warning amended with the option which
3800 controls it, to determine what to use with this option.
3801
3802 Note that specifying @option{-Werror=}@var{foo} automatically implies
3803 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3804 imply anything.
3805
3806 @item -Wstack-protector
3807 @opindex Wstack-protector
3808 This option is only active when @option{-fstack-protector} is active.  It
3809 warns about functions that will not be protected against stack smashing.
3810
3811 @item -Woverlength-strings
3812 @opindex Woverlength-strings
3813 Warn about string constants which are longer than the ``minimum
3814 maximum'' length specified in the C standard.  Modern compilers
3815 generally allow string constants which are much longer than the
3816 standard's minimum limit, but very portable programs should avoid
3817 using longer strings.
3818
3819 The limit applies @emph{after} string constant concatenation, and does
3820 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3821 C99, it was raised to 4095.  C++98 does not specify a normative
3822 minimum maximum, so we do not diagnose overlength strings in C++@.
3823
3824 This option is implied by @option{-pedantic}, and can be disabled with
3825 @option{-Wno-overlength-strings}.
3826 @end table
3827
3828 @node Debugging Options
3829 @section Options for Debugging Your Program or GCC
3830 @cindex options, debugging
3831 @cindex debugging information options
3832
3833 GCC has various special options that are used for debugging
3834 either your program or GCC:
3835
3836 @table @gcctabopt
3837 @item -g
3838 @opindex g
3839 Produce debugging information in the operating system's native format
3840 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3841 information.
3842
3843 On most systems that use stabs format, @option{-g} enables use of extra
3844 debugging information that only GDB can use; this extra information
3845 makes debugging work better in GDB but will probably make other debuggers
3846 crash or
3847 refuse to read the program.  If you want to control for certain whether
3848 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3849 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3850
3851 GCC allows you to use @option{-g} with
3852 @option{-O}.  The shortcuts taken by optimized code may occasionally
3853 produce surprising results: some variables you declared may not exist
3854 at all; flow of control may briefly move where you did not expect it;
3855 some statements may not be executed because they compute constant
3856 results or their values were already at hand; some statements may
3857 execute in different places because they were moved out of loops.
3858
3859 Nevertheless it proves possible to debug optimized output.  This makes
3860 it reasonable to use the optimizer for programs that might have bugs.
3861
3862 The following options are useful when GCC is generated with the
3863 capability for more than one debugging format.
3864
3865 @item -ggdb
3866 @opindex ggdb
3867 Produce debugging information for use by GDB@.  This means to use the
3868 most expressive format available (DWARF 2, stabs, or the native format
3869 if neither of those are supported), including GDB extensions if at all
3870 possible.
3871
3872 @item -gstabs
3873 @opindex gstabs
3874 Produce debugging information in stabs format (if that is supported),
3875 without GDB extensions.  This is the format used by DBX on most BSD
3876 systems.  On MIPS, Alpha and System V Release 4 systems this option
3877 produces stabs debugging output which is not understood by DBX or SDB@.
3878 On System V Release 4 systems this option requires the GNU assembler.
3879
3880 @item -feliminate-unused-debug-symbols
3881 @opindex feliminate-unused-debug-symbols
3882 Produce debugging information in stabs format (if that is supported),
3883 for only symbols that are actually used.
3884
3885 @item -femit-class-debug-always
3886 Instead of emitting debugging information for a C++ class in only one
3887 object file, emit it in all object files using the class.  This option
3888 should be used only with debuggers that are unable to handle the way GCC
3889 normally emits debugging information for classes because using this
3890 option will increase the size of debugging information by as much as a
3891 factor of two.
3892
3893 @item -gstabs+
3894 @opindex gstabs+
3895 Produce debugging information in stabs format (if that is supported),
3896 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3897 use of these extensions is likely to make other debuggers crash or
3898 refuse to read the program.
3899
3900 @item -gcoff
3901 @opindex gcoff
3902 Produce debugging information in COFF format (if that is supported).
3903 This is the format used by SDB on most System V systems prior to
3904 System V Release 4.
3905
3906 @item -gxcoff
3907 @opindex gxcoff
3908 Produce debugging information in XCOFF format (if that is supported).
3909 This is the format used by the DBX debugger on IBM RS/6000 systems.
3910
3911 @item -gxcoff+
3912 @opindex gxcoff+
3913 Produce debugging information in XCOFF format (if that is supported),
3914 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3915 use of these extensions is likely to make other debuggers crash or
3916 refuse to read the program, and may cause assemblers other than the GNU
3917 assembler (GAS) to fail with an error.
3918
3919 @item -gdwarf-2
3920 @opindex gdwarf-2
3921 Produce debugging information in DWARF version 2 format (if that is
3922 supported).  This is the format used by DBX on IRIX 6.  With this
3923 option, GCC uses features of DWARF version 3 when they are useful;
3924 version 3 is upward compatible with version 2, but may still cause
3925 problems for older debuggers.
3926
3927 @item -gvms
3928 @opindex gvms
3929 Produce debugging information in VMS debug format (if that is
3930 supported).  This is the format used by DEBUG on VMS systems.
3931
3932 @item -g@var{level}
3933 @itemx -ggdb@var{level}
3934 @itemx -gstabs@var{level}
3935 @itemx -gcoff@var{level}
3936 @itemx -gxcoff@var{level}
3937 @itemx -gvms@var{level}
3938 Request debugging information and also use @var{level} to specify how
3939 much information.  The default level is 2.
3940
3941 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
3942 @option{-g}.
3943
3944 Level 1 produces minimal information, enough for making backtraces in
3945 parts of the program that you don't plan to debug.  This includes
3946 descriptions of functions and external variables, but no information
3947 about local variables and no line numbers.
3948
3949 Level 3 includes extra information, such as all the macro definitions
3950 present in the program.  Some debuggers support macro expansion when
3951 you use @option{-g3}.
3952
3953 @option{-gdwarf-2} does not accept a concatenated debug level, because
3954 GCC used to support an option @option{-gdwarf} that meant to generate
3955 debug information in version 1 of the DWARF format (which is very
3956 different from version 2), and it would have been too confusing.  That
3957 debug format is long obsolete, but the option cannot be changed now.
3958 Instead use an additional @option{-g@var{level}} option to change the
3959 debug level for DWARF2.
3960
3961 @item -feliminate-dwarf2-dups
3962 @opindex feliminate-dwarf2-dups
3963 Compress DWARF2 debugging information by eliminating duplicated
3964 information about each symbol.  This option only makes sense when
3965 generating DWARF2 debugging information with @option{-gdwarf-2}.
3966
3967 @cindex @command{prof}
3968 @item -p
3969 @opindex p
3970 Generate extra code to write profile information suitable for the
3971 analysis program @command{prof}.  You must use this option when compiling
3972 the source files you want data about, and you must also use it when
3973 linking.
3974
3975 @cindex @command{gprof}
3976 @item -pg
3977 @opindex pg
3978 Generate extra code to write profile information suitable for the
3979 analysis program @command{gprof}.  You must use this option when compiling
3980 the source files you want data about, and you must also use it when
3981 linking.
3982
3983 @item -Q
3984 @opindex Q
3985 Makes the compiler print out each function name as it is compiled, and
3986 print some statistics about each pass when it finishes.
3987
3988 @item -ftime-report
3989 @opindex ftime-report
3990 Makes the compiler print some statistics about the time consumed by each
3991 pass when it finishes.
3992
3993 @item -fmem-report
3994 @opindex fmem-report
3995 Makes the compiler print some statistics about permanent memory
3996 allocation when it finishes.
3997
3998 @item -fpre-ipa-mem-report
3999 @opindex fpre-ipa-mem-report
4000 @item -fpost-ipa-mem-report
4001 @opindex fpost-ipa-mem-report
4002 Makes the compiler print some statistics about permanent memory
4003 allocation before or after interprocedural optimization.
4004
4005 @item -fprofile-arcs
4006 @opindex fprofile-arcs
4007 Add code so that program flow @dfn{arcs} are instrumented.  During
4008 execution the program records how many times each branch and call is
4009 executed and how many times it is taken or returns.  When the compiled
4010 program exits it saves this data to a file called
4011 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4012 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4013 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4014 @var{auxname} is generated from the name of the output file, if
4015 explicitly specified and it is not the final executable, otherwise it is
4016 the basename of the source file.  In both cases any suffix is removed
4017 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4018 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4019 @xref{Cross-profiling}.
4020
4021 @cindex @command{gcov}
4022 @item --coverage
4023 @opindex coverage
4024
4025 This option is used to compile and link code instrumented for coverage
4026 analysis.  The option is a synonym for @option{-fprofile-arcs}
4027 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4028 linking).  See the documentation for those options for more details.
4029
4030 @itemize
4031
4032 @item
4033 Compile the source files with @option{-fprofile-arcs} plus optimization
4034 and code generation options.  For test coverage analysis, use the
4035 additional @option{-ftest-coverage} option.  You do not need to profile
4036 every source file in a program.
4037
4038 @item
4039 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4040 (the latter implies the former).
4041
4042 @item
4043 Run the program on a representative workload to generate the arc profile
4044 information.  This may be repeated any number of times.  You can run
4045 concurrent instances of your program, and provided that the file system
4046 supports locking, the data files will be correctly updated.  Also
4047 @code{fork} calls are detected and correctly handled (double counting
4048 will not happen).
4049
4050 @item
4051 For profile-directed optimizations, compile the source files again with
4052 the same optimization and code generation options plus
4053 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4054 Control Optimization}).
4055
4056 @item
4057 For test coverage analysis, use @command{gcov} to produce human readable
4058 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4059 @command{gcov} documentation for further information.
4060
4061 @end itemize
4062
4063 With @option{-fprofile-arcs}, for each function of your program GCC
4064 creates a program flow graph, then finds a spanning tree for the graph.
4065 Only arcs that are not on the spanning tree have to be instrumented: the
4066 compiler adds code to count the number of times that these arcs are
4067 executed.  When an arc is the only exit or only entrance to a block, the
4068 instrumentation code can be added to the block; otherwise, a new basic
4069 block must be created to hold the instrumentation code.
4070
4071 @need 2000
4072 @item -ftest-coverage
4073 @opindex ftest-coverage
4074 Produce a notes file that the @command{gcov} code-coverage utility
4075 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4076 show program coverage.  Each source file's note file is called
4077 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4078 above for a description of @var{auxname} and instructions on how to
4079 generate test coverage data.  Coverage data will match the source files
4080 more closely, if you do not optimize.
4081
4082 @item -d@var{letters}
4083 @item -fdump-rtl-@var{pass}
4084 @opindex d
4085 Says to make debugging dumps during compilation at times specified by
4086 @var{letters}.    This is used for debugging the RTL-based passes of the
4087 compiler.  The file names for most of the dumps are made by appending a
4088 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4089 from the name of the output file, if explicitly specified and it is not
4090 an executable, otherwise it is the basename of the source file.
4091
4092 Most debug dumps can be enabled either passing a letter to the @option{-d}
4093 option, or with a long @option{-fdump-rtl} switch; here are the possible
4094 letters for use in @var{letters} and @var{pass}, and their meanings:
4095
4096 @table @gcctabopt
4097 @item -dA
4098 @opindex dA
4099 Annotate the assembler output with miscellaneous debugging information.
4100
4101 @item -dB
4102 @itemx -fdump-rtl-bbro
4103 @opindex dB
4104 @opindex fdump-rtl-bbro
4105 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4106
4107 @item -dc
4108 @itemx -fdump-rtl-combine
4109 @opindex dc
4110 @opindex fdump-rtl-combine
4111 Dump after the RTL instruction combination pass, to the file
4112 @file{@var{file}.129r.combine}.
4113
4114 @item -dC
4115 @itemx -fdump-rtl-ce1
4116 @itemx -fdump-rtl-ce2
4117 @opindex dC
4118 @opindex fdump-rtl-ce1
4119 @opindex fdump-rtl-ce2
4120 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4121 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4122 and @option{-fdump-rtl-ce2} enable dumping after the second if
4123 conversion, to the file @file{@var{file}.130r.ce2}.
4124
4125 @item -dd
4126 @itemx -fdump-rtl-btl
4127 @itemx -fdump-rtl-dbr
4128 @opindex dd
4129 @opindex fdump-rtl-btl
4130 @opindex fdump-rtl-dbr
4131 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4132 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4133 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4134 scheduling, to @file{@var{file}.36.dbr}.
4135
4136 @item -dD
4137 @opindex dD
4138 Dump all macro definitions, at the end of preprocessing, in addition to
4139 normal output.
4140
4141 @item -dE
4142 @itemx -fdump-rtl-ce3
4143 @opindex dE
4144 @opindex fdump-rtl-ce3
4145 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4146
4147 @item -df
4148 @itemx -fdump-rtl-cfg
4149 @itemx -fdump-rtl-life
4150 @opindex df
4151 @opindex fdump-rtl-cfg
4152 @opindex fdump-rtl-life
4153 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4154 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4155 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4156 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4157
4158 @item -dg
4159 @itemx -fdump-rtl-greg
4160 @opindex dg
4161 @opindex fdump-rtl-greg
4162 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4163
4164 @item -dG
4165 @itemx -fdump-rtl-gcse
4166 @itemx -fdump-rtl-bypass
4167 @opindex dG
4168 @opindex fdump-rtl-gcse
4169 @opindex fdump-rtl-bypass
4170 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4171 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4172 enable dumping after jump bypassing and control flow optimizations, to
4173 @file{@var{file}.115r.bypass}.
4174
4175 @item -dh
4176 @itemx -fdump-rtl-eh
4177 @opindex dh
4178 @opindex fdump-rtl-eh
4179 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4180
4181 @item -di
4182 @itemx -fdump-rtl-sibling
4183 @opindex di
4184 @opindex fdump-rtl-sibling
4185 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4186
4187 @item -dj
4188 @itemx -fdump-rtl-jump
4189 @opindex dj
4190 @opindex fdump-rtl-jump
4191 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4192
4193 @item -dk
4194 @itemx -fdump-rtl-stack
4195 @opindex dk
4196 @opindex fdump-rtl-stack
4197 Dump after conversion from GCC's "flat register file" registers to the
4198 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4199
4200 @item -dl
4201 @itemx -fdump-rtl-lreg
4202 @opindex dl
4203 @opindex fdump-rtl-lreg
4204 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4205
4206 @item -dL
4207 @itemx -fdump-rtl-loop2
4208 @opindex dL
4209 @opindex fdump-rtl-loop2
4210 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4211 loop optimization pass, to @file{@var{file}.119r.loop2},
4212 @file{@var{file}.120r.loop2_init},
4213 @file{@var{file}.121r.loop2_invariant}, and
4214 @file{@var{file}.125r.loop2_done}.
4215
4216 @item -dm
4217 @itemx -fdump-rtl-sms
4218 @opindex dm
4219 @opindex fdump-rtl-sms
4220 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4221
4222 @item -dM
4223 @itemx -fdump-rtl-mach
4224 @opindex dM
4225 @opindex fdump-rtl-mach
4226 Dump after performing the machine dependent reorganization pass, to
4227 @file{@var{file}.155r.mach}.
4228
4229 @item -dn
4230 @itemx -fdump-rtl-rnreg
4231 @opindex dn
4232 @opindex fdump-rtl-rnreg
4233 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4234
4235 @item -dN
4236 @itemx -fdump-rtl-regmove
4237 @opindex dN
4238 @opindex fdump-rtl-regmove
4239 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4240
4241 @item -do
4242 @itemx -fdump-rtl-postreload
4243 @opindex do
4244 @opindex fdump-rtl-postreload
4245 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4246
4247 @item -dr
4248 @itemx -fdump-rtl-expand
4249 @opindex dr
4250 @opindex fdump-rtl-expand
4251 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4252
4253 @item -dR
4254 @itemx -fdump-rtl-sched2
4255 @opindex dR
4256 @opindex fdump-rtl-sched2
4257 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4258
4259 @item -ds
4260 @itemx -fdump-rtl-cse
4261 @opindex ds
4262 @opindex fdump-rtl-cse
4263 Dump after CSE (including the jump optimization that sometimes follows
4264 CSE), to @file{@var{file}.113r.cse}.
4265
4266 @item -dS
4267 @itemx -fdump-rtl-sched1
4268 @opindex dS
4269 @opindex fdump-rtl-sched1
4270 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4271
4272 @item -dt
4273 @itemx -fdump-rtl-cse2
4274 @opindex dt
4275 @opindex fdump-rtl-cse2
4276 Dump after the second CSE pass (including the jump optimization that
4277 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4278
4279 @item -dT
4280 @itemx -fdump-rtl-tracer
4281 @opindex dT
4282 @opindex fdump-rtl-tracer
4283 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4284
4285 @item -dV
4286 @itemx -fdump-rtl-vpt
4287 @itemx -fdump-rtl-vartrack
4288 @opindex dV
4289 @opindex fdump-rtl-vpt
4290 @opindex fdump-rtl-vartrack
4291 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4292 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4293 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4294 to @file{@var{file}.154r.vartrack}.
4295
4296 @item -dw
4297 @itemx -fdump-rtl-flow2
4298 @opindex dw
4299 @opindex fdump-rtl-flow2
4300 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4301
4302 @item -dz
4303 @itemx -fdump-rtl-peephole2
4304 @opindex dz
4305 @opindex fdump-rtl-peephole2
4306 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4307
4308 @item -dZ
4309 @itemx -fdump-rtl-web
4310 @opindex dZ
4311 @opindex fdump-rtl-web
4312 Dump after live range splitting, to @file{@var{file}.126r.web}.
4313
4314 @item -da
4315 @itemx -fdump-rtl-all
4316 @opindex da
4317 @opindex fdump-rtl-all
4318 Produce all the dumps listed above.
4319
4320 @item -dH
4321 @opindex dH
4322 Produce a core dump whenever an error occurs.
4323
4324 @item -dm
4325 @opindex dm
4326 Print statistics on memory usage, at the end of the run, to
4327 standard error.
4328
4329 @item -dp
4330 @opindex dp
4331 Annotate the assembler output with a comment indicating which
4332 pattern and alternative was used.  The length of each instruction is
4333 also printed.
4334
4335 @item -dP
4336 @opindex dP
4337 Dump the RTL in the assembler output as a comment before each instruction.
4338 Also turns on @option{-dp} annotation.
4339
4340 @item -dv
4341 @opindex dv
4342 For each of the other indicated dump files (either with @option{-d} or
4343 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4344 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4345
4346 @item -dx
4347 @opindex dx
4348 Just generate RTL for a function instead of compiling it.  Usually used
4349 with @samp{r} (@option{-fdump-rtl-expand}).
4350
4351 @item -dy
4352 @opindex dy
4353 Dump debugging information during parsing, to standard error.
4354 @end table
4355
4356 @item -fdump-noaddr
4357 @opindex fdump-noaddr
4358 When doing debugging dumps (see @option{-d} option above), suppress
4359 address output.  This makes it more feasible to use diff on debugging
4360 dumps for compiler invocations with different compiler binaries and/or
4361 different text / bss / data / heap / stack / dso start locations.
4362
4363 @item -fdump-unnumbered
4364 @opindex fdump-unnumbered
4365 When doing debugging dumps (see @option{-d} option above), suppress instruction
4366 numbers, line number note and address output.  This makes it more feasible to
4367 use diff on debugging dumps for compiler invocations with different
4368 options, in particular with and without @option{-g}.
4369
4370 @item -fdump-translation-unit @r{(C++ only)}
4371 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4372 @opindex fdump-translation-unit
4373 Dump a representation of the tree structure for the entire translation
4374 unit to a file.  The file name is made by appending @file{.tu} to the
4375 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4376 controls the details of the dump as described for the
4377 @option{-fdump-tree} options.
4378
4379 @item -fdump-class-hierarchy @r{(C++ only)}
4380 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4381 @opindex fdump-class-hierarchy
4382 Dump a representation of each class's hierarchy and virtual function
4383 table layout to a file.  The file name is made by appending @file{.class}
4384 to the source file name.  If the @samp{-@var{options}} form is used,
4385 @var{options} controls the details of the dump as described for the
4386 @option{-fdump-tree} options.
4387
4388 @item -fdump-ipa-@var{switch}
4389 @opindex fdump-ipa
4390 Control the dumping at various stages of inter-procedural analysis
4391 language tree to a file.  The file name is generated by appending a switch
4392 specific suffix to the source file name.  The following dumps are possible:
4393
4394 @table @samp
4395 @item all
4396 Enables all inter-procedural analysis dumps; currently the only produced
4397 dump is the @samp{cgraph} dump.
4398
4399 @item cgraph
4400 Dumps information about call-graph optimization, unused function removal,
4401 and inlining decisions.
4402 @end table
4403
4404 @item -fdump-tree-@var{switch}
4405 @itemx -fdump-tree-@var{switch}-@var{options}
4406 @opindex fdump-tree
4407 Control the dumping at various stages of processing the intermediate
4408 language tree to a file.  The file name is generated by appending a switch
4409 specific suffix to the source file name.  If the @samp{-@var{options}}
4410 form is used, @var{options} is a list of @samp{-} separated options that
4411 control the details of the dump.  Not all options are applicable to all
4412 dumps, those which are not meaningful will be ignored.  The following
4413 options are available
4414
4415 @table @samp
4416 @item address
4417 Print the address of each node.  Usually this is not meaningful as it
4418 changes according to the environment and source file.  Its primary use
4419 is for tying up a dump file with a debug environment.
4420 @item slim
4421 Inhibit dumping of members of a scope or body of a function merely
4422 because that scope has been reached.  Only dump such items when they
4423 are directly reachable by some other path.  When dumping pretty-printed
4424 trees, this option inhibits dumping the bodies of control structures.
4425 @item raw
4426 Print a raw representation of the tree.  By default, trees are
4427 pretty-printed into a C-like representation.
4428 @item details
4429 Enable more detailed dumps (not honored by every dump option).
4430 @item stats
4431 Enable dumping various statistics about the pass (not honored by every dump
4432 option).
4433 @item blocks
4434 Enable showing basic block boundaries (disabled in raw dumps).
4435 @item vops
4436 Enable showing virtual operands for every statement.
4437 @item lineno
4438 Enable showing line numbers for statements.
4439 @item uid
4440 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4441 @item all
4442 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4443 @end table
4444
4445 The following tree dumps are possible:
4446 @table @samp
4447
4448 @item original
4449 Dump before any tree based optimization, to @file{@var{file}.original}.
4450
4451 @item optimized
4452 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4453
4454 @item inlined
4455 Dump after function inlining, to @file{@var{file}.inlined}.
4456
4457 @item gimple
4458 @opindex fdump-tree-gimple
4459 Dump each function before and after the gimplification pass to a file.  The
4460 file name is made by appending @file{.gimple} to the source file name.
4461
4462 @item cfg
4463 @opindex fdump-tree-cfg
4464 Dump the control flow graph of each function to a file.  The file name is
4465 made by appending @file{.cfg} to the source file name.
4466
4467 @item vcg
4468 @opindex fdump-tree-vcg
4469 Dump the control flow graph of each function to a file in VCG format.  The
4470 file name is made by appending @file{.vcg} to the source file name.  Note
4471 that if the file contains more than one function, the generated file cannot
4472 be used directly by VCG@.  You will need to cut and paste each function's
4473 graph into its own separate file first.
4474
4475 @item ch
4476 @opindex fdump-tree-ch
4477 Dump each function after copying loop headers.  The file name is made by
4478 appending @file{.ch} to the source file name.
4479
4480 @item ssa
4481 @opindex fdump-tree-ssa
4482 Dump SSA related information to a file.  The file name is made by appending
4483 @file{.ssa} to the source file name.
4484
4485 @item salias
4486 @opindex fdump-tree-salias
4487 Dump structure aliasing variable information to a file.  This file name
4488 is made by appending @file{.salias} to the source file name.
4489
4490 @item alias
4491 @opindex fdump-tree-alias
4492 Dump aliasing information for each function.  The file name is made by
4493 appending @file{.alias} to the source file name.
4494
4495 @item ccp
4496 @opindex fdump-tree-ccp
4497 Dump each function after CCP@.  The file name is made by appending
4498 @file{.ccp} to the source file name.
4499
4500 @item storeccp
4501 @opindex fdump-tree-storeccp
4502 Dump each function after STORE-CCP.  The file name is made by appending
4503 @file{.storeccp} to the source file name.
4504
4505 @item pre
4506 @opindex fdump-tree-pre
4507 Dump trees after partial redundancy elimination.  The file name is made
4508 by appending @file{.pre} to the source file name.
4509
4510 @item fre
4511 @opindex fdump-tree-fre
4512 Dump trees after full redundancy elimination.  The file name is made
4513 by appending @file{.fre} to the source file name.
4514
4515 @item copyprop
4516 @opindex fdump-tree-copyprop
4517 Dump trees after copy propagation.  The file name is made
4518 by appending @file{.copyprop} to the source file name.
4519
4520 @item store_copyprop
4521 @opindex fdump-tree-store_copyprop
4522 Dump trees after store copy-propagation.  The file name is made
4523 by appending @file{.store_copyprop} to the source file name.
4524
4525 @item dce
4526 @opindex fdump-tree-dce
4527 Dump each function after dead code elimination.  The file name is made by
4528 appending @file{.dce} to the source file name.
4529
4530 @item mudflap
4531 @opindex fdump-tree-mudflap
4532 Dump each function after adding mudflap instrumentation.  The file name is
4533 made by appending @file{.mudflap} to the source file name.
4534
4535 @item sra
4536 @opindex fdump-tree-sra
4537 Dump each function after performing scalar replacement of aggregates.  The
4538 file name is made by appending @file{.sra} to the source file name.
4539
4540 @item sink
4541 @opindex fdump-tree-sink
4542 Dump each function after performing code sinking.  The file name is made
4543 by appending @file{.sink} to the source file name.
4544
4545 @item dom
4546 @opindex fdump-tree-dom
4547 Dump each function after applying dominator tree optimizations.  The file
4548 name is made by appending @file{.dom} to the source file name.
4549
4550 @item dse
4551 @opindex fdump-tree-dse
4552 Dump each function after applying dead store elimination.  The file
4553 name is made by appending @file{.dse} to the source file name.
4554
4555 @item phiopt
4556 @opindex fdump-tree-phiopt
4557 Dump each function after optimizing PHI nodes into straightline code.  The file
4558 name is made by appending @file{.phiopt} to the source file name.
4559
4560 @item forwprop
4561 @opindex fdump-tree-forwprop
4562 Dump each function after forward propagating single use variables.  The file
4563 name is made by appending @file{.forwprop} to the source file name.
4564
4565 @item copyrename
4566 @opindex fdump-tree-copyrename
4567 Dump each function after applying the copy rename optimization.  The file
4568 name is made by appending @file{.copyrename} to the source file name.
4569
4570 @item nrv
4571 @opindex fdump-tree-nrv
4572 Dump each function after applying the named return value optimization on
4573 generic trees.  The file name is made by appending @file{.nrv} to the source
4574 file name.
4575
4576 @item vect
4577 @opindex fdump-tree-vect
4578 Dump each function after applying vectorization of loops.  The file name is
4579 made by appending @file{.vect} to the source file name.
4580
4581 @item vrp
4582 @opindex fdump-tree-vrp
4583 Dump each function after Value Range Propagation (VRP).  The file name
4584 is made by appending @file{.vrp} to the source file name.
4585
4586 @item all
4587 @opindex fdump-tree-all
4588 Enable all the available tree dumps with the flags provided in this option.
4589 @end table
4590
4591 @item -ftree-vectorizer-verbose=@var{n}
4592 @opindex ftree-vectorizer-verbose
4593 This option controls the amount of debugging output the vectorizer prints.
4594 This information is written to standard error, unless
4595 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4596 in which case it is output to the usual dump listing file, @file{.vect}.
4597 For @var{n}=0 no diagnostic information is reported.
4598 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4599 and the total number of loops that got vectorized.
4600 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4601 the first analysis phase (vect_analyze_loop_form) - i.e. countable,
4602 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4603 level that @option{-fdump-tree-vect-stats} uses.
4604 Higher verbosity levels mean either more information dumped for each
4605 reported loop, or same amount of information reported for more loops:
4606 If @var{n}=3, alignment related information is added to the reports.
4607 If @var{n}=4, data-references related information (e.g. memory dependences,
4608 memory access-patterns) is added to the reports.
4609 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4610 that did not pass the first analysis phase (i.e. may not be countable, or
4611 may have complicated control-flow).
4612 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4613 For @var{n}=7, all the information the vectorizer generates during its
4614 analysis and transformation is reported.  This is the same verbosity level
4615 that @option{-fdump-tree-vect-details} uses.
4616
4617 @item -frandom-seed=@var{string}
4618 @opindex frandom-string
4619 This option provides a seed that GCC uses when it would otherwise use
4620 random numbers.  It is used to generate certain symbol names
4621 that have to be different in every compiled file.  It is also used to
4622 place unique stamps in coverage data files and the object files that
4623 produce them.  You can use the @option{-frandom-seed} option to produce
4624 reproducibly identical object files.
4625
4626 The @var{string} should be different for every file you compile.
4627
4628 @item -fsched-verbose=@var{n}
4629 @opindex fsched-verbose
4630 On targets that use instruction scheduling, this option controls the
4631 amount of debugging output the scheduler prints.  This information is
4632 written to standard error, unless @option{-dS} or @option{-dR} is
4633 specified, in which case it is output to the usual dump
4634 listing file, @file{.sched} or @file{.sched2} respectively.  However
4635 for @var{n} greater than nine, the output is always printed to standard
4636 error.
4637
4638 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4639 same information as @option{-dRS}.  For @var{n} greater than one, it
4640 also output basic block probabilities, detailed ready list information
4641 and unit/insn info.  For @var{n} greater than two, it includes RTL
4642 at abort point, control-flow and regions info.  And for @var{n} over
4643 four, @option{-fsched-verbose} also includes dependence info.
4644
4645 @item -save-temps
4646 @opindex save-temps
4647 Store the usual ``temporary'' intermediate files permanently; place them
4648 in the current directory and name them based on the source file.  Thus,
4649 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4650 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4651 preprocessed @file{foo.i} output file even though the compiler now
4652 normally uses an integrated preprocessor.
4653
4654 When used in combination with the @option{-x} command line option,
4655 @option{-save-temps} is sensible enough to avoid over writing an
4656 input source file with the same extension as an intermediate file.
4657 The corresponding intermediate file may be obtained by renaming the
4658 source file before using @option{-save-temps}.
4659
4660 @item -time
4661 @opindex time
4662 Report the CPU time taken by each subprocess in the compilation
4663 sequence.  For C source files, this is the compiler proper and assembler
4664 (plus the linker if linking is done).  The output looks like this:
4665
4666 @smallexample
4667 # cc1 0.12 0.01
4668 # as 0.00 0.01
4669 @end smallexample
4670
4671 The first number on each line is the ``user time'', that is time spent
4672 executing the program itself.  The second number is ``system time'',
4673 time spent executing operating system routines on behalf of the program.
4674 Both numbers are in seconds.
4675
4676 @item -fvar-tracking
4677 @opindex fvar-tracking
4678 Run variable tracking pass.  It computes where variables are stored at each
4679 position in code.  Better debugging information is then generated
4680 (if the debugging information format supports this information).
4681
4682 It is enabled by default when compiling with optimization (@option{-Os},
4683 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4684 the debug info format supports it.
4685
4686 @item -print-file-name=@var{library}
4687 @opindex print-file-name
4688 Print the full absolute name of the library file @var{library} that
4689 would be used when linking---and don't do anything else.  With this
4690 option, GCC does not compile or link anything; it just prints the
4691 file name.
4692
4693 @item -print-multi-directory
4694 @opindex print-multi-directory
4695 Print the directory name corresponding to the multilib selected by any
4696 other switches present in the command line.  This directory is supposed
4697 to exist in @env{GCC_EXEC_PREFIX}.
4698
4699 @item -print-multi-lib
4700 @opindex print-multi-lib
4701 Print the mapping from multilib directory names to compiler switches
4702 that enable them.  The directory name is separated from the switches by
4703 @samp{;}, and each switch starts with an @samp{@@} instead of the
4704 @samp{-}, without spaces between multiple switches.  This is supposed to
4705 ease shell-processing.
4706
4707 @item -print-prog-name=@var{program}
4708 @opindex print-prog-name
4709 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4710
4711 @item -print-libgcc-file-name
4712 @opindex print-libgcc-file-name
4713 Same as @option{-print-file-name=libgcc.a}.
4714
4715 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4716 but you do want to link with @file{libgcc.a}.  You can do
4717
4718 @smallexample
4719 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4720 @end smallexample
4721
4722 @item -print-search-dirs
4723 @opindex print-search-dirs
4724 Print the name of the configured installation directory and a list of
4725 program and library directories @command{gcc} will search---and don't do anything else.
4726
4727 This is useful when @command{gcc} prints the error message
4728 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4729 To resolve this you either need to put @file{cpp0} and the other compiler
4730 components where @command{gcc} expects to find them, or you can set the environment
4731 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4732 Don't forget the trailing @samp{/}.
4733 @xref{Environment Variables}.
4734
4735 @item -print-sysroot-headers-suffix
4736 @opindex print-sysroot-headers-suffix
4737 Print the suffix added to the target sysroot when searching for
4738 headers, or give an error if the compiler is not configured with such
4739 a suffix---and don't do anything else.
4740
4741 @item -dumpmachine
4742 @opindex dumpmachine
4743 Print the compiler's target machine (for example,
4744 @samp{i686-pc-linux-gnu})---and don't do anything else.
4745
4746 @item -dumpversion
4747 @opindex dumpversion
4748 Print the compiler version (for example, @samp{3.0})---and don't do
4749 anything else.
4750
4751 @item -dumpspecs
4752 @opindex dumpspecs
4753 Print the compiler's built-in specs---and don't do anything else.  (This
4754 is used when GCC itself is being built.)  @xref{Spec Files}.
4755
4756 @item -feliminate-unused-debug-types
4757 @opindex feliminate-unused-debug-types
4758 Normally, when producing DWARF2 output, GCC will emit debugging
4759 information for all types declared in a compilation
4760 unit, regardless of whether or not they are actually used
4761 in that compilation unit.  Sometimes this is useful, such as
4762 if, in the debugger, you want to cast a value to a type that is
4763 not actually used in your program (but is declared).  More often,
4764 however, this results in a significant amount of wasted space.
4765 With this option, GCC will avoid producing debug symbol output
4766 for types that are nowhere used in the source file being compiled.
4767 @end table
4768
4769 @node Optimize Options
4770 @section Options That Control Optimization
4771 @cindex optimize options
4772 @cindex options, optimization
4773
4774 These options control various sorts of optimizations.
4775
4776 Without any optimization option, the compiler's goal is to reduce the
4777 cost of compilation and to make debugging produce the expected
4778 results.  Statements are independent: if you stop the program with a
4779 breakpoint between statements, you can then assign a new value to any
4780 variable or change the program counter to any other statement in the
4781 function and get exactly the results you would expect from the source
4782 code.
4783
4784 Turning on optimization flags makes the compiler attempt to improve
4785 the performance and/or code size at the expense of compilation time
4786 and possibly the ability to debug the program.
4787
4788 The compiler performs optimization based on the knowledge it has of
4789 the program.  Optimization levels @option{-O} and above, in
4790 particular, enable @emph{unit-at-a-time} mode, which allows the
4791 compiler to consider information gained from later functions in
4792 the file when compiling a function.  Compiling multiple files at
4793 once to a single output file in @emph{unit-at-a-time} mode allows
4794 the compiler to use information gained from all of the files when
4795 compiling each of them.
4796
4797 Not all optimizations are controlled directly by a flag.  Only
4798 optimizations that have a flag are listed.
4799
4800 @table @gcctabopt
4801 @item -O
4802 @itemx -O1
4803 @opindex O
4804 @opindex O1
4805 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4806 more memory for a large function.
4807
4808 With @option{-O}, the compiler tries to reduce code size and execution
4809 time, without performing any optimizations that take a great deal of
4810 compilation time.
4811
4812 @option{-O} turns on the following optimization flags:
4813 @gccoptlist{-fdefer-pop @gol
4814 -fdelayed-branch @gol
4815 -fguess-branch-probability @gol
4816 -fcprop-registers @gol
4817 -fif-conversion @gol
4818 -fif-conversion2 @gol
4819 -fsplit-wide-types @gol
4820 -ftree-ccp @gol
4821 -ftree-dce @gol
4822 -ftree-dominator-opts @gol
4823 -ftree-dse @gol
4824 -ftree-ter @gol
4825 -ftree-sra @gol
4826 -ftree-copyrename @gol
4827 -ftree-fre @gol
4828 -ftree-ch @gol
4829 -funit-at-a-time @gol
4830 -fmerge-constants}
4831
4832 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4833 where doing so does not interfere with debugging.
4834
4835 @item -O2
4836 @opindex O2
4837 Optimize even more.  GCC performs nearly all supported optimizations
4838 that do not involve a space-speed tradeoff.  The compiler does not
4839 perform loop unrolling or function inlining when you specify @option{-O2}.
4840 As compared to @option{-O}, this option increases both compilation time
4841 and the performance of the generated code.
4842
4843 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4844 also turns on the following optimization flags:
4845 @gccoptlist{-fthread-jumps @gol
4846 -fcrossjumping @gol
4847 -foptimize-sibling-calls @gol
4848 -fcse-follow-jumps  -fcse-skip-blocks @gol
4849 -fgcse  -fgcse-lm  @gol
4850 -fexpensive-optimizations @gol
4851 -frerun-cse-after-loop  @gol
4852 -fcaller-saves @gol
4853 -fpeephole2 @gol
4854 -fschedule-insns  -fschedule-insns2 @gol
4855 -fsched-interblock  -fsched-spec @gol
4856 -fregmove @gol
4857 -fstrict-aliasing -fstrict-overflow @gol
4858 -fdelete-null-pointer-checks @gol
4859 -freorder-blocks  -freorder-functions @gol
4860 -falign-functions  -falign-jumps @gol
4861 -falign-loops  -falign-labels @gol
4862 -ftree-vrp @gol
4863 -ftree-pre}
4864
4865 Please note the warning under @option{-fgcse} about
4866 invoking @option{-O2} on programs that use computed gotos.
4867
4868 @item -O3
4869 @opindex O3
4870 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4871 @option{-O2} and also turns on the @option{-finline-functions},
4872 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4873
4874 @item -O0
4875 @opindex O0
4876 Reduce compilation time and make debugging produce the expected
4877 results.  This is the default.
4878
4879 @item -Os
4880 @opindex Os
4881 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4882 do not typically increase code size.  It also performs further
4883 optimizations designed to reduce code size.
4884
4885 @option{-Os} disables the following optimization flags:
4886 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4887 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
4888 -fprefetch-loop-arrays  -ftree-vect-loop-version}
4889
4890 If you use multiple @option{-O} options, with or without level numbers,
4891 the last such option is the one that is effective.
4892 @end table
4893
4894 Options of the form @option{-f@var{flag}} specify machine-independent
4895 flags.  Most flags have both positive and negative forms; the negative
4896 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4897 below, only one of the forms is listed---the one you typically will
4898 use.  You can figure out the other form by either removing @samp{no-}
4899 or adding it.
4900
4901 The following options control specific optimizations.  They are either
4902 activated by @option{-O} options or are related to ones that are.  You
4903 can use the following flags in the rare cases when ``fine-tuning'' of
4904 optimizations to be performed is desired.
4905
4906 @table @gcctabopt
4907 @item -fno-default-inline
4908 @opindex fno-default-inline
4909 Do not make member functions inline by default merely because they are
4910 defined inside the class scope (C++ only).  Otherwise, when you specify
4911 @w{@option{-O}}, member functions defined inside class scope are compiled
4912 inline by default; i.e., you don't need to add @samp{inline} in front of
4913 the member function name.
4914
4915 @item -fno-defer-pop
4916 @opindex fno-defer-pop
4917 Always pop the arguments to each function call as soon as that function
4918 returns.  For machines which must pop arguments after a function call,
4919 the compiler normally lets arguments accumulate on the stack for several
4920 function calls and pops them all at once.
4921
4922 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4923
4924 @item -fforce-addr
4925 @opindex fforce-addr
4926 Force memory address constants to be copied into registers before
4927 doing arithmetic on them.
4928
4929 @item -fforward-propagate
4930 @opindex fforward-propagate
4931 Perform a forward propagation pass on RTL.  The pass tries to combine two
4932 instructions and checks if the result can be simplified.  If loop unrolling
4933 is active, two passes are performed and the second is scheduled after
4934 loop unrolling.
4935
4936 This option is enabled by default at optimization levels @option{-O2},
4937 @option{-O3}, @option{-Os}.
4938
4939 @item -fomit-frame-pointer
4940 @opindex fomit-frame-pointer
4941 Don't keep the frame pointer in a register for functions that
4942 don't need one.  This avoids the instructions to save, set up and
4943 restore frame pointers; it also makes an extra register available
4944 in many functions.  @strong{It also makes debugging impossible on
4945 some machines.}
4946
4947 On some machines, such as the VAX, this flag has no effect, because
4948 the standard calling sequence automatically handles the frame pointer
4949 and nothing is saved by pretending it doesn't exist.  The
4950 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4951 whether a target machine supports this flag.  @xref{Registers,,Register
4952 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4953
4954 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4955
4956 @item -foptimize-sibling-calls
4957 @opindex foptimize-sibling-calls
4958 Optimize sibling and tail recursive calls.
4959
4960 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4961
4962 @item -fno-inline
4963 @opindex fno-inline
4964 Don't pay attention to the @code{inline} keyword.  Normally this option
4965 is used to keep the compiler from expanding any functions inline.
4966 Note that if you are not optimizing, no functions can be expanded inline.
4967
4968 @item -finline-functions
4969 @opindex finline-functions
4970 Integrate all simple functions into their callers.  The compiler
4971 heuristically decides which functions are simple enough to be worth
4972 integrating in this way.
4973
4974 If all calls to a given function are integrated, and the function is
4975 declared @code{static}, then the function is normally not output as
4976 assembler code in its own right.
4977
4978 Enabled at level @option{-O3}.
4979
4980 @item -finline-functions-called-once
4981 @opindex finline-functions-called-once
4982 Consider all @code{static} functions called once for inlining into their
4983 caller even if they are not marked @code{inline}.  If a call to a given
4984 function is integrated, then the function is not output as assembler code
4985 in its own right.
4986
4987 Enabled if @option{-funit-at-a-time} is enabled.
4988
4989 @item -fearly-inlining
4990 @opindex fearly-inlining
4991 Inline functions marked by @code{always_inline} and functions whose body seems
4992 smaller than the function call overhead early before doing
4993 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4994 makes profiling significantly cheaper and usually inlining faster on programs
4995 having large chains of nested wrapper functions.
4996
4997 Enabled by default.
4998
4999 @item -finline-limit=@var{n}
5000 @opindex finline-limit
5001 By default, GCC limits the size of functions that can be inlined.  This flag
5002 allows the control of this limit for functions that are explicitly marked as
5003 inline (i.e., marked with the inline keyword or defined within the class
5004 definition in c++).  @var{n} is the size of functions that can be inlined in
5005 number of pseudo instructions (not counting parameter handling).  The default
5006 value of @var{n} is 600.
5007 Increasing this value can result in more inlined code at
5008 the cost of compilation time and memory consumption.  Decreasing usually makes
5009 the compilation faster and less code will be inlined (which presumably
5010 means slower programs).  This option is particularly useful for programs that
5011 use inlining heavily such as those based on recursive templates with C++.
5012
5013 Inlining is actually controlled by a number of parameters, which may be
5014 specified individually by using @option{--param @var{name}=@var{value}}.
5015 The @option{-finline-limit=@var{n}} option sets some of these parameters
5016 as follows:
5017
5018 @table @gcctabopt
5019 @item max-inline-insns-single
5020  is set to @var{n}/2.
5021 @item max-inline-insns-auto
5022  is set to @var{n}/2.
5023 @item min-inline-insns
5024  is set to 130 or @var{n}/4, whichever is smaller.
5025 @item max-inline-insns-rtl
5026  is set to @var{n}.
5027 @end table
5028
5029 See below for a documentation of the individual
5030 parameters controlling inlining.
5031
5032 @emph{Note:} pseudo instruction represents, in this particular context, an
5033 abstract measurement of function's size.  In no way does it represent a count
5034 of assembly instructions and as such its exact meaning might change from one
5035 release to an another.
5036
5037 @item -fkeep-inline-functions
5038 @opindex fkeep-inline-functions
5039 In C, emit @code{static} functions that are declared @code{inline}
5040 into the object file, even if the function has been inlined into all
5041 of its callers.  This switch does not affect functions using the
5042 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5043 inline functions into the object file.
5044
5045 @item -fkeep-static-consts
5046 @opindex fkeep-static-consts
5047 Emit variables declared @code{static const} when optimization isn't turned
5048 on, even if the variables aren't referenced.
5049
5050 GCC enables this option by default.  If you want to force the compiler to
5051 check if the variable was referenced, regardless of whether or not
5052 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5053
5054 @item -fmerge-constants
5055 Attempt to merge identical constants (string constants and floating point
5056 constants) across compilation units.
5057
5058 This option is the default for optimized compilation if the assembler and
5059 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5060 behavior.
5061
5062 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5063
5064 @item -fmerge-all-constants
5065 Attempt to merge identical constants and identical variables.
5066
5067 This option implies @option{-fmerge-constants}.  In addition to
5068 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5069 arrays or initialized constant variables with integral or floating point
5070 types.  Languages like C or C++ require each non-automatic variable to
5071 have distinct location, so using this option will result in non-conforming
5072 behavior.
5073
5074 @item -fmodulo-sched
5075 @opindex fmodulo-sched
5076 Perform swing modulo scheduling immediately before the first scheduling
5077 pass.  This pass looks at innermost loops and reorders their
5078 instructions by overlapping different iterations.
5079
5080 @item -fno-branch-count-reg
5081 @opindex fno-branch-count-reg
5082 Do not use ``decrement and branch'' instructions on a count register,
5083 but instead generate a sequence of instructions that decrement a
5084 register, compare it against zero, then branch based upon the result.
5085 This option is only meaningful on architectures that support such
5086 instructions, which include x86, PowerPC, IA-64 and S/390.
5087
5088 The default is @option{-fbranch-count-reg}.
5089
5090 @item -fno-function-cse
5091 @opindex fno-function-cse
5092 Do not put function addresses in registers; make each instruction that
5093 calls a constant function contain the function's address explicitly.
5094
5095 This option results in less efficient code, but some strange hacks
5096 that alter the assembler output may be confused by the optimizations
5097 performed when this option is not used.
5098
5099 The default is @option{-ffunction-cse}
5100
5101 @item -fno-zero-initialized-in-bss
5102 @opindex fno-zero-initialized-in-bss
5103 If the target supports a BSS section, GCC by default puts variables that
5104 are initialized to zero into BSS@.  This can save space in the resulting
5105 code.
5106
5107 This option turns off this behavior because some programs explicitly
5108 rely on variables going to the data section.  E.g., so that the
5109 resulting executable can find the beginning of that section and/or make
5110 assumptions based on that.
5111
5112 The default is @option{-fzero-initialized-in-bss}.
5113
5114 @item -fbounds-check
5115 @opindex fbounds-check
5116 For front-ends that support it, generate additional code to check that
5117 indices used to access arrays are within the declared range.  This is
5118 currently only supported by the Java and Fortran front-ends, where
5119 this option defaults to true and false respectively.
5120
5121 @item -fmudflap -fmudflapth -fmudflapir
5122 @opindex fmudflap
5123 @opindex fmudflapth
5124 @opindex fmudflapir
5125 @cindex bounds checking
5126 @cindex mudflap
5127 For front-ends that support it (C and C++), instrument all risky
5128 pointer/array dereferencing operations, some standard library
5129 string/heap functions, and some other associated constructs with
5130 range/validity tests.  Modules so instrumented should be immune to
5131 buffer overflows, invalid heap use, and some other classes of C/C++
5132 programming errors.  The instrumentation relies on a separate runtime
5133 library (@file{libmudflap}), which will be linked into a program if
5134 @option{-fmudflap} is given at link time.  Run-time behavior of the
5135 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5136 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5137 for its options.
5138
5139 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5140 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5141 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5142 instrumentation should ignore pointer reads.  This produces less
5143 instrumentation (and therefore faster execution) and still provides
5144 some protection against outright memory corrupting writes, but allows
5145 erroneously read data to propagate within a program.
5146
5147 @item -fthread-jumps
5148 @opindex fthread-jumps
5149 Perform optimizations where we check to see if a jump branches to a
5150 location where another comparison subsumed by the first is found.  If
5151 so, the first branch is redirected to either the destination of the
5152 second branch or a point immediately following it, depending on whether
5153 the condition is known to be true or false.
5154
5155 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5156
5157 @item -fsplit-wide-types
5158 @opindex -fsplit-wide-types
5159 When using a type that occupies multiple registers, such as @code{long
5160 long} on a 32-bit system, split the registers apart and allocate them
5161 independently.  This normally generates better code for those types,
5162 but may make debugging more difficult.
5163
5164 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5165 @option{-Os}.
5166
5167 @item -fcse-follow-jumps
5168 @opindex fcse-follow-jumps
5169 In common subexpression elimination, scan through jump instructions
5170 when the target of the jump is not reached by any other path.  For
5171 example, when CSE encounters an @code{if} statement with an
5172 @code{else} clause, CSE will follow the jump when the condition
5173 tested is false.
5174
5175 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5176
5177 @item -fcse-skip-blocks
5178 @opindex fcse-skip-blocks
5179 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5180 follow jumps which conditionally skip over blocks.  When CSE
5181 encounters a simple @code{if} statement with no else clause,
5182 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5183 body of the @code{if}.
5184
5185 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5186
5187 @item -frerun-cse-after-loop
5188 @opindex frerun-cse-after-loop
5189 Re-run common subexpression elimination after loop optimizations has been
5190 performed.
5191
5192 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5193
5194 @item -fgcse
5195 @opindex fgcse
5196 Perform a global common subexpression elimination pass.
5197 This pass also performs global constant and copy propagation.
5198
5199 @emph{Note:} When compiling a program using computed gotos, a GCC
5200 extension, you may get better runtime performance if you disable
5201 the global common subexpression elimination pass by adding
5202 @option{-fno-gcse} to the command line.
5203
5204 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5205
5206 @item -fgcse-lm
5207 @opindex fgcse-lm
5208 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5209 attempt to move loads which are only killed by stores into themselves.  This
5210 allows a loop containing a load/store sequence to be changed to a load outside
5211 the loop, and a copy/store within the loop.
5212
5213 Enabled by default when gcse is enabled.
5214
5215 @item -fgcse-sm
5216 @opindex fgcse-sm
5217 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5218 global common subexpression elimination.  This pass will attempt to move
5219 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5220 loops containing a load/store sequence can be changed to a load before
5221 the loop and a store after the loop.
5222
5223 Not enabled at any optimization level.
5224
5225 @item -fgcse-las
5226 @opindex fgcse-las
5227 When @option{-fgcse-las} is enabled, the global common subexpression
5228 elimination pass eliminates redundant loads that come after stores to the
5229 same memory location (both partial and full redundancies).
5230
5231 Not enabled at any optimization level.
5232
5233 @item -fgcse-after-reload
5234 @opindex fgcse-after-reload
5235 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5236 pass is performed after reload.  The purpose of this pass is to cleanup
5237 redundant spilling.
5238
5239 @item -funsafe-loop-optimizations
5240 @opindex funsafe-loop-optimizations
5241 If given, the loop optimizer will assume that loop indices do not
5242 overflow, and that the loops with nontrivial exit condition are not
5243 infinite.  This enables a wider range of loop optimizations even if
5244 the loop optimizer itself cannot prove that these assumptions are valid.
5245 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5246 if it finds this kind of loop.
5247
5248 @item -fcrossjumping
5249 @opindex crossjumping
5250 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5251 resulting code may or may not perform better than without cross-jumping.
5252
5253 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5254
5255 @item -fif-conversion
5256 @opindex if-conversion
5257 Attempt to transform conditional jumps into branch-less equivalents.  This
5258 include use of conditional moves, min, max, set flags and abs instructions, and
5259 some tricks doable by standard arithmetics.  The use of conditional execution
5260 on chips where it is available is controlled by @code{if-conversion2}.
5261
5262 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5263
5264 @item -fif-conversion2
5265 @opindex if-conversion2
5266 Use conditional execution (where available) to transform conditional jumps into
5267 branch-less equivalents.
5268
5269 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5270
5271 @item -fdelete-null-pointer-checks
5272 @opindex fdelete-null-pointer-checks
5273 Use global dataflow analysis to identify and eliminate useless checks
5274 for null pointers.  The compiler assumes that dereferencing a null
5275 pointer would have halted the program.  If a pointer is checked after
5276 it has already been dereferenced, it cannot be null.
5277
5278 In some environments, this assumption is not true, and programs can
5279 safely dereference null pointers.  Use
5280 @option{-fno-delete-null-pointer-checks} to disable this optimization
5281 for programs which depend on that behavior.
5282
5283 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5284
5285 @item -fexpensive-optimizations
5286 @opindex fexpensive-optimizations
5287 Perform a number of minor optimizations that are relatively expensive.
5288
5289 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5290
5291 @item -foptimize-register-move
5292 @itemx -fregmove
5293 @opindex foptimize-register-move
5294 @opindex fregmove
5295 Attempt to reassign register numbers in move instructions and as
5296 operands of other simple instructions in order to maximize the amount of
5297 register tying.  This is especially helpful on machines with two-operand
5298 instructions.
5299
5300 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5301 optimization.
5302
5303 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5304
5305 @item -fdelayed-branch
5306 @opindex fdelayed-branch
5307 If supported for the target machine, attempt to reorder instructions
5308 to exploit instruction slots available after delayed branch
5309 instructions.
5310
5311 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5312
5313 @item -fschedule-insns
5314 @opindex fschedule-insns
5315 If supported for the target machine, attempt to reorder instructions to
5316 eliminate execution stalls due to required data being unavailable.  This
5317 helps machines that have slow floating point or memory load instructions
5318 by allowing other instructions to be issued until the result of the load
5319 or floating point instruction is required.
5320
5321 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5322
5323 @item -fschedule-insns2
5324 @opindex fschedule-insns2
5325 Similar to @option{-fschedule-insns}, but requests an additional pass of
5326 instruction scheduling after register allocation has been done.  This is
5327 especially useful on machines with a relatively small number of
5328 registers and where memory load instructions take more than one cycle.
5329
5330 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5331
5332 @item -fno-sched-interblock
5333 @opindex fno-sched-interblock
5334 Don't schedule instructions across basic blocks.  This is normally
5335 enabled by default when scheduling before register allocation, i.e.@:
5336 with @option{-fschedule-insns} or at @option{-O2} or higher.
5337
5338 @item -fno-sched-spec
5339 @opindex fno-sched-spec
5340 Don't allow speculative motion of non-load instructions.  This is normally
5341 enabled by default when scheduling before register allocation, i.e.@:
5342 with @option{-fschedule-insns} or at @option{-O2} or higher.
5343
5344 @item -fsched-spec-load
5345 @opindex fsched-spec-load
5346 Allow speculative motion of some load instructions.  This only makes
5347 sense when scheduling before register allocation, i.e.@: with
5348 @option{-fschedule-insns} or at @option{-O2} or higher.
5349
5350 @item -fsched-spec-load-dangerous
5351 @opindex fsched-spec-load-dangerous
5352 Allow speculative motion of more load instructions.  This only makes
5353 sense when scheduling before register allocation, i.e.@: with
5354 @option{-fschedule-insns} or at @option{-O2} or higher.
5355
5356 @item -fsched-stalled-insns=@var{n}
5357 @opindex fsched-stalled-insns
5358 Define how many insns (if any) can be moved prematurely from the queue
5359 of stalled insns into the ready list, during the second scheduling pass.
5360
5361 @item -fsched-stalled-insns-dep=@var{n}
5362 @opindex fsched-stalled-insns-dep
5363 Define how many insn groups (cycles) will be examined for a dependency
5364 on a stalled insn that is candidate for premature removal from the queue
5365 of stalled insns.  Has an effect only during the second scheduling pass,
5366 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5367
5368 @item -fsched2-use-superblocks
5369 @opindex fsched2-use-superblocks
5370 When scheduling after register allocation, do use superblock scheduling
5371 algorithm.  Superblock scheduling allows motion across basic block boundaries
5372 resulting on faster schedules.  This option is experimental, as not all machine
5373 descriptions used by GCC model the CPU closely enough to avoid unreliable
5374 results from the algorithm.
5375
5376 This only makes sense when scheduling after register allocation, i.e.@: with
5377 @option{-fschedule-insns2} or at @option{-O2} or higher.
5378
5379 @item -fsched2-use-traces
5380 @opindex fsched2-use-traces
5381 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5382 allocation and additionally perform code duplication in order to increase the
5383 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5384 trace formation.
5385
5386 This mode should produce faster but significantly longer programs.  Also
5387 without @option{-fbranch-probabilities} the traces constructed may not
5388 match the reality and hurt the performance.  This only makes
5389 sense when scheduling after register allocation, i.e.@: with
5390 @option{-fschedule-insns2} or at @option{-O2} or higher.
5391
5392 @item -fsee
5393 @opindex fsee
5394 Eliminates redundant extension instructions and move the non redundant
5395 ones to optimal placement using LCM.
5396
5397 @item -freschedule-modulo-scheduled-loops
5398 @opindex fscheduling-in-modulo-scheduled-loops
5399 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5400 we may want to prevent the later scheduling passes from changing its schedule, we use this
5401 option to control that.
5402
5403 @item -fcaller-saves
5404 @opindex fcaller-saves
5405 Enable values to be allocated in registers that will be clobbered by
5406 function calls, by emitting extra instructions to save and restore the
5407 registers around such calls.  Such allocation is done only when it
5408 seems to result in better code than would otherwise be produced.
5409
5410 This option is always enabled by default on certain machines, usually
5411 those which have no call-preserved registers to use instead.
5412
5413 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5414
5415 @item -ftree-pre
5416 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5417 enabled by default at @option{-O2} and @option{-O3}.
5418
5419 @item -ftree-fre
5420 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5421 between FRE and PRE is that FRE only considers expressions
5422 that are computed on all paths leading to the redundant computation.
5423 This analysis faster than PRE, though it exposes fewer redundancies.
5424 This flag is enabled by default at @option{-O} and higher.
5425
5426 @item -ftree-copy-prop
5427 Perform copy propagation on trees.  This pass eliminates unnecessary
5428 copy operations.  This flag is enabled by default at @option{-O} and
5429 higher.
5430
5431 @item -ftree-store-copy-prop
5432 Perform copy propagation of memory loads and stores.  This pass
5433 eliminates unnecessary copy operations in memory references
5434 (structures, global variables, arrays, etc).  This flag is enabled by
5435 default at @option{-O2} and higher.
5436
5437 @item -ftree-salias
5438 Perform structural alias analysis on trees.  This flag
5439 is enabled by default at @option{-O} and higher.
5440
5441 @item -fipa-pta
5442 Perform interprocedural pointer analysis.
5443
5444 @item -ftree-sink
5445 Perform forward store motion  on trees.  This flag is
5446 enabled by default at @option{-O} and higher.
5447
5448 @item -ftree-ccp
5449 Perform sparse conditional constant propagation (CCP) on trees.  This
5450 pass only operates on local scalar variables and is enabled by default
5451 at @option{-O} and higher.
5452
5453 @item -ftree-store-ccp
5454 Perform sparse conditional constant propagation (CCP) on trees.  This
5455 pass operates on both local scalar variables and memory stores and
5456 loads (global variables, structures, arrays, etc).  This flag is
5457 enabled by default at @option{-O2} and higher.
5458
5459 @item -ftree-dce
5460 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5461 default at @option{-O} and higher.
5462
5463 @item -ftree-dominator-opts
5464 Perform a variety of simple scalar cleanups (constant/copy
5465 propagation, redundancy elimination, range propagation and expression
5466 simplification) based on a dominator tree traversal.  This also
5467 performs jump threading (to reduce jumps to jumps). This flag is
5468 enabled by default at @option{-O} and higher.
5469
5470 @item -ftree-ch
5471 Perform loop header copying on trees.  This is beneficial since it increases
5472 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5473 is enabled by default at @option{-O} and higher.  It is not enabled
5474 for @option{-Os}, since it usually increases code size.
5475
5476 @item -ftree-loop-optimize
5477 Perform loop optimizations on trees.  This flag is enabled by default
5478 at @option{-O} and higher.
5479
5480 @item -ftree-loop-linear
5481 Perform linear loop transformations on tree.  This flag can improve cache
5482 performance and allow further loop optimizations to take place.
5483
5484 @item -fcheck-data-deps
5485 Compare the results of several data dependence analyzers.  This option
5486 is used for debugging the data dependence analyzers.
5487
5488 @item -ftree-loop-im
5489 Perform loop invariant motion on trees.  This pass moves only invariants that
5490 would be hard to handle at RTL level (function calls, operations that expand to
5491 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5492 operands of conditions that are invariant out of the loop, so that we can use
5493 just trivial invariantness analysis in loop unswitching.  The pass also includes
5494 store motion.
5495
5496 @item -ftree-loop-ivcanon
5497 Create a canonical counter for number of iterations in the loop for that
5498 determining number of iterations requires complicated analysis.  Later
5499 optimizations then may determine the number easily.  Useful especially
5500 in connection with unrolling.
5501
5502 @item -fivopts
5503 Perform induction variable optimizations (strength reduction, induction
5504 variable merging and induction variable elimination) on trees.
5505
5506 @item -ftree-sra
5507 Perform scalar replacement of aggregates.  This pass replaces structure
5508 references with scalars to prevent committing structures to memory too
5509 early.  This flag is enabled by default at @option{-O} and higher.
5510
5511 @item -ftree-copyrename
5512 Perform copy renaming on trees.  This pass attempts to rename compiler
5513 temporaries to other variables at copy locations, usually resulting in
5514 variable names which more closely resemble the original variables.  This flag
5515 is enabled by default at @option{-O} and higher.
5516
5517 @item -ftree-ter
5518 Perform temporary expression replacement during the SSA->normal phase.  Single
5519 use/single def temporaries are replaced at their use location with their
5520 defining expression.  This results in non-GIMPLE code, but gives the expanders
5521 much more complex trees to work on resulting in better RTL generation.  This is
5522 enabled by default at @option{-O} and higher.
5523
5524 @item -ftree-vectorize
5525 Perform loop vectorization on trees.
5526
5527 @item -ftree-vect-loop-version
5528 @opindex ftree-vect-loop-version
5529 Perform loop versioning when doing loop vectorization on trees.  When a loop
5530 appears to be vectorizable except that data alignment or data dependence cannot
5531 be determined at compile time then vectorized and non-vectorized versions of
5532 the loop are generated along with runtime checks for alignment or dependence
5533 to control which version is executed.  This option is enabled by default
5534 except at level @option{-Os} where it is disabled.
5535
5536 @item -ftree-vrp
5537 Perform Value Range Propagation on trees.  This is similar to the
5538 constant propagation pass, but instead of values, ranges of values are
5539 propagated.  This allows the optimizers to remove unnecessary range
5540 checks like array bound checks and null pointer checks.  This is
5541 enabled by default at @option{-O2} and higher.  Null pointer check
5542 elimination is only done if @option{-fdelete-null-pointer-checks} is
5543 enabled.
5544
5545 @item -ftracer
5546 @opindex ftracer
5547 Perform tail duplication to enlarge superblock size.  This transformation
5548 simplifies the control flow of the function allowing other optimizations to do
5549 better job.
5550
5551 @item -funroll-loops
5552 @opindex funroll-loops
5553 Unroll loops whose number of iterations can be determined at compile
5554 time or upon entry to the loop.  @option{-funroll-loops} implies
5555 @option{-frerun-cse-after-loop}.  This option makes code larger,
5556 and may or may not make it run faster.
5557
5558 @item -funroll-all-loops
5559 @opindex funroll-all-loops
5560 Unroll all loops, even if their number of iterations is uncertain when
5561 the loop is entered.  This usually makes programs run more slowly.
5562 @option{-funroll-all-loops} implies the same options as
5563 @option{-funroll-loops},
5564
5565 @item -fsplit-ivs-in-unroller
5566 @opindex -fsplit-ivs-in-unroller
5567 Enables expressing of values of induction variables in later iterations
5568 of the unrolled loop using the value in the first iteration.  This breaks
5569 long dependency chains, thus improving efficiency of the scheduling passes.
5570
5571 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5572 same effect.  However in cases the loop body is more complicated than
5573 a single basic block, this is not reliable.  It also does not work at all
5574 on some of the architectures due to restrictions in the CSE pass.
5575
5576 This optimization is enabled by default.
5577
5578 @item -fvariable-expansion-in-unroller
5579 @opindex -fvariable-expansion-in-unroller
5580 With this option, the compiler will create multiple copies of some
5581 local variables when unrolling a loop which can result in superior code.
5582
5583 @item -fprefetch-loop-arrays
5584 @opindex fprefetch-loop-arrays
5585 If supported by the target machine, generate instructions to prefetch
5586 memory to improve the performance of loops that access large arrays.
5587
5588 This option may generate better or worse code; results are highly
5589 dependent on the structure of loops within the source code.
5590
5591 Disabled at level @option{-Os}.
5592
5593 @item -fno-peephole
5594 @itemx -fno-peephole2
5595 @opindex fno-peephole
5596 @opindex fno-peephole2
5597 Disable any machine-specific peephole optimizations.  The difference
5598 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5599 are implemented in the compiler; some targets use one, some use the
5600 other, a few use both.
5601
5602 @option{-fpeephole} is enabled by default.
5603 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5604
5605 @item -fno-guess-branch-probability
5606 @opindex fno-guess-branch-probability
5607 Do not guess branch probabilities using heuristics.
5608
5609 GCC will use heuristics to guess branch probabilities if they are
5610 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5611 heuristics are based on the control flow graph.  If some branch probabilities
5612 are specified by @samp{__builtin_expect}, then the heuristics will be
5613 used to guess branch probabilities for the rest of the control flow graph,
5614 taking the @samp{__builtin_expect} info into account.  The interactions
5615 between the heuristics and @samp{__builtin_expect} can be complex, and in
5616 some cases, it may be useful to disable the heuristics so that the effects
5617 of @samp{__builtin_expect} are easier to understand.
5618
5619 The default is @option{-fguess-branch-probability} at levels
5620 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5621
5622 @item -freorder-blocks
5623 @opindex freorder-blocks
5624 Reorder basic blocks in the compiled function in order to reduce number of
5625 taken branches and improve code locality.
5626
5627 Enabled at levels @option{-O2}, @option{-O3}.
5628
5629 @item -freorder-blocks-and-partition
5630 @opindex freorder-blocks-and-partition
5631 In addition to reordering basic blocks in the compiled function, in order
5632 to reduce number of taken branches, partitions hot and cold basic blocks
5633 into separate sections of the assembly and .o files, to improve
5634 paging and cache locality performance.
5635
5636 This optimization is automatically turned off in the presence of
5637 exception handling, for linkonce sections, for functions with a user-defined
5638 section attribute and on any architecture that does not support named
5639 sections.
5640
5641 @item -freorder-functions
5642 @opindex freorder-functions
5643 Reorder functions in the object file in order to
5644 improve code locality.  This is implemented by using special
5645 subsections @code{.text.hot} for most frequently executed functions and
5646 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5647 the linker so object file format must support named sections and linker must
5648 place them in a reasonable way.
5649
5650 Also profile feedback must be available in to make this option effective.  See
5651 @option{-fprofile-arcs} for details.
5652
5653 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5654
5655 @item -fstrict-aliasing
5656 @opindex fstrict-aliasing
5657 Allows the compiler to assume the strictest aliasing rules applicable to
5658 the language being compiled.  For C (and C++), this activates
5659 optimizations based on the type of expressions.  In particular, an
5660 object of one type is assumed never to reside at the same address as an
5661 object of a different type, unless the types are almost the same.  For
5662 example, an @code{unsigned int} can alias an @code{int}, but not a
5663 @code{void*} or a @code{double}.  A character type may alias any other
5664 type.
5665
5666 Pay special attention to code like this:
5667 @smallexample
5668 union a_union @{
5669   int i;
5670   double d;
5671 @};
5672
5673 int f() @{
5674   a_union t;
5675   t.d = 3.0;
5676   return t.i;
5677 @}
5678 @end smallexample
5679 The practice of reading from a different union member than the one most
5680 recently written to (called ``type-punning'') is common.  Even with
5681 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5682 is accessed through the union type.  So, the code above will work as
5683 expected.  However, this code might not:
5684 @smallexample
5685 int f() @{
5686   a_union t;
5687   int* ip;
5688   t.d = 3.0;
5689   ip = &t.i;
5690   return *ip;
5691 @}
5692 @end smallexample
5693
5694 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5695
5696 @item -fstrict-overflow
5697 @opindex fstrict-overflow
5698 Allow the compiler to assume strict signed overflow rules, depending
5699 on the language being compiled.  For C (and C++) this means that
5700 overflow when doing arithmetic with signed numbers is undefined, which
5701 means that the compiler may assume that it will not happen.  This
5702 permits various optimizations.  For example, the compiler will assume
5703 that an expression like @code{i + 10 > i} will always be true for
5704 signed @code{i}.  This assumption is only valid if signed overflow is
5705 undefined, as the expression is false if @code{i + 10} overflows when
5706 using twos complement arithmetic.  When this option is in effect any
5707 attempt to determine whether an operation on signed numbers will
5708 overflow must be written carefully to not actually involve overflow.
5709
5710 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5711 that signed overflow is fully defined: it wraps.  When
5712 @option{-fwrapv} is used, there is no difference between
5713 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5714 @option{-fwrapv} certain types of overflow are permitted.  For
5715 example, if the compiler gets an overflow when doing arithmetic on
5716 constants, the overflowed value can still be used with
5717 @option{-fwrapv}, but not otherwise.
5718
5719 The @option{-fstrict-overflow} option is enabled at levels
5720 @option{-O2}, @option{-O3}, @option{-Os}.
5721
5722 @item -falign-functions
5723 @itemx -falign-functions=@var{n}
5724 @opindex falign-functions
5725 Align the start of functions to the next power-of-two greater than
5726 @var{n}, skipping up to @var{n} bytes.  For instance,
5727 @option{-falign-functions=32} aligns functions to the next 32-byte
5728 boundary, but @option{-falign-functions=24} would align to the next
5729 32-byte boundary only if this can be done by skipping 23 bytes or less.
5730
5731 @option{-fno-align-functions} and @option{-falign-functions=1} are
5732 equivalent and mean that functions will not be aligned.
5733
5734 Some assemblers only support this flag when @var{n} is a power of two;
5735 in that case, it is rounded up.
5736
5737 If @var{n} is not specified or is zero, use a machine-dependent default.
5738
5739 Enabled at levels @option{-O2}, @option{-O3}.
5740
5741 @item -falign-labels
5742 @itemx -falign-labels=@var{n}
5743 @opindex falign-labels
5744 Align all branch targets to a power-of-two boundary, skipping up to
5745 @var{n} bytes like @option{-falign-functions}.  This option can easily
5746 make code slower, because it must insert dummy operations for when the
5747 branch target is reached in the usual flow of the code.
5748
5749 @option{-fno-align-labels} and @option{-falign-labels=1} are
5750 equivalent and mean that labels will not be aligned.
5751
5752 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5753 are greater than this value, then their values are used instead.
5754
5755 If @var{n} is not specified or is zero, use a machine-dependent default
5756 which is very likely to be @samp{1}, meaning no alignment.
5757
5758 Enabled at levels @option{-O2}, @option{-O3}.
5759
5760 @item -falign-loops
5761 @itemx -falign-loops=@var{n}
5762 @opindex falign-loops
5763 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5764 like @option{-falign-functions}.  The hope is that the loop will be
5765 executed many times, which will make up for any execution of the dummy
5766 operations.
5767
5768 @option{-fno-align-loops} and @option{-falign-loops=1} are
5769 equivalent and mean that loops will not be aligned.
5770
5771 If @var{n} is not specified or is zero, use a machine-dependent default.
5772
5773 Enabled at levels @option{-O2}, @option{-O3}.
5774
5775 @item -falign-jumps
5776 @itemx -falign-jumps=@var{n}
5777 @opindex falign-jumps
5778 Align branch targets to a power-of-two boundary, for branch targets
5779 where the targets can only be reached by jumping, skipping up to @var{n}
5780 bytes like @option{-falign-functions}.  In this case, no dummy operations
5781 need be executed.
5782
5783 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5784 equivalent and mean that loops will not be aligned.
5785
5786 If @var{n} is not specified or is zero, use a machine-dependent default.
5787
5788 Enabled at levels @option{-O2}, @option{-O3}.
5789
5790 @item -funit-at-a-time
5791 @opindex funit-at-a-time
5792 Parse the whole compilation unit before starting to produce code.
5793 This allows some extra optimizations to take place but consumes
5794 more memory (in general).  There are some compatibility issues
5795 with @emph{unit-at-a-time} mode:
5796 @itemize @bullet
5797 @item
5798 enabling @emph{unit-at-a-time} mode may change the order
5799 in which functions, variables, and top-level @code{asm} statements
5800 are emitted, and will likely break code relying on some particular
5801 ordering.  The majority of such top-level @code{asm} statements,
5802 though, can be replaced by @code{section} attributes.  The
5803 @option{fno-toplevel-reorder} option may be used to keep the ordering
5804 used in the input file, at the cost of some optimizations.
5805
5806 @item
5807 @emph{unit-at-a-time} mode removes unreferenced static variables
5808 and functions.  This may result in undefined references
5809 when an @code{asm} statement refers directly to variables or functions
5810 that are otherwise unused.  In that case either the variable/function
5811 shall be listed as an operand of the @code{asm} statement operand or,
5812 in the case of top-level @code{asm} statements the attribute @code{used}
5813 shall be used on the declaration.
5814
5815 @item
5816 Static functions now can use non-standard passing conventions that
5817 may break @code{asm} statements calling functions directly.  Again,
5818 attribute @code{used} will prevent this behavior.
5819 @end itemize
5820
5821 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5822 but this scheme may not be supported by future releases of GCC@.
5823
5824 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5825
5826 @item -fno-toplevel-reorder
5827 Do not reorder top-level functions, variables, and @code{asm}
5828 statements.  Output them in the same order that they appear in the
5829 input file.  When this option is used, unreferenced static variables
5830 will not be removed.  This option is intended to support existing code
5831 which relies on a particular ordering.  For new code, it is better to
5832 use attributes.
5833
5834 @item -fweb
5835 @opindex fweb
5836 Constructs webs as commonly used for register allocation purposes and assign
5837 each web individual pseudo register.  This allows the register allocation pass
5838 to operate on pseudos directly, but also strengthens several other optimization
5839 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5840 however, make debugging impossible, since variables will no longer stay in a
5841 ``home register''.
5842
5843 Enabled by default with @option{-funroll-loops}.
5844
5845 @item -fwhole-program
5846 @opindex fwhole-program
5847 Assume that the current compilation unit represents whole program being
5848 compiled.  All public functions and variables with the exception of @code{main}
5849 and those merged by attribute @code{externally_visible} become static functions
5850 and in a affect gets more aggressively optimized by interprocedural optimizers.
5851 While this option is equivalent to proper use of @code{static} keyword for
5852 programs consisting of single file, in combination with option
5853 @option{--combine} this flag can be used to compile most of smaller scale C
5854 programs since the functions and variables become local for the whole combined
5855 compilation unit, not for the single source file itself.
5856
5857
5858 @item -fno-cprop-registers
5859 @opindex fno-cprop-registers
5860 After register allocation and post-register allocation instruction splitting,
5861 we perform a copy-propagation pass to try to reduce scheduling dependencies
5862 and occasionally eliminate the copy.
5863
5864 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5865
5866 @item -fprofile-generate
5867 @opindex fprofile-generate
5868
5869 Enable options usually used for instrumenting application to produce
5870 profile useful for later recompilation with profile feedback based
5871 optimization.  You must use @option{-fprofile-generate} both when
5872 compiling and when linking your program.
5873
5874 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5875
5876 @item -fprofile-use
5877 @opindex fprofile-use
5878 Enable profile feedback directed optimizations, and optimizations
5879 generally profitable only with profile feedback available.
5880
5881 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5882 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
5883
5884 By default, GCC emits an error message if the feedback profiles do not
5885 match the source code.  This error can be turned into a warning by using
5886 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
5887 code.
5888 @end table
5889
5890 The following options control compiler behavior regarding floating
5891 point arithmetic.  These options trade off between speed and
5892 correctness.  All must be specifically enabled.
5893
5894 @table @gcctabopt
5895 @item -ffloat-store
5896 @opindex ffloat-store
5897 Do not store floating point variables in registers, and inhibit other
5898 options that might change whether a floating point value is taken from a
5899 register or memory.
5900
5901 @cindex floating point precision
5902 This option prevents undesirable excess precision on machines such as
5903 the 68000 where the floating registers (of the 68881) keep more
5904 precision than a @code{double} is supposed to have.  Similarly for the
5905 x86 architecture.  For most programs, the excess precision does only
5906 good, but a few programs rely on the precise definition of IEEE floating
5907 point.  Use @option{-ffloat-store} for such programs, after modifying
5908 them to store all pertinent intermediate computations into variables.
5909
5910 @item -ffast-math
5911 @opindex ffast-math
5912 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5913 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5914 @option{-fno-rounding-math}, @option{-fno-signaling-nans},
5915 @option{-fno-signed-zeros} and @option{fcx-limited-range}.
5916
5917 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5918
5919 This option is not turned on by any @option{-O} option since
5920 it can result in incorrect output for programs which depend on
5921 an exact implementation of IEEE or ISO rules/specifications for
5922 math functions. It may, however, yield faster code for programs
5923 that do not require the guarantees of these specifications.
5924
5925 @item -fno-math-errno
5926 @opindex fno-math-errno
5927 Do not set ERRNO after calling math functions that are executed
5928 with a single instruction, e.g., sqrt.  A program that relies on
5929 IEEE exceptions for math error handling may want to use this flag
5930 for speed while maintaining IEEE arithmetic compatibility.
5931
5932 This option is not turned on by any @option{-O} option since
5933 it can result in incorrect output for programs which depend on
5934 an exact implementation of IEEE or ISO rules/specifications for
5935 math functions. It may, however, yield faster code for programs
5936 that do not require the guarantees of these specifications.
5937
5938 The default is @option{-fmath-errno}.
5939
5940 On Darwin systems, the math library never sets @code{errno}.  There is
5941 therefore no reason for the compiler to consider the possibility that
5942 it might, and @option{-fno-math-errno} is the default.
5943
5944 @item -funsafe-math-optimizations
5945 @opindex funsafe-math-optimizations
5946 Allow optimizations for floating-point arithmetic that (a) assume
5947 that arguments and results are valid and (b) may violate IEEE or
5948 ANSI standards.  When used at link-time, it may include libraries
5949 or startup files that change the default FPU control word or other
5950 similar optimizations.
5951
5952 This option is not turned on by any @option{-O} option since
5953 it can result in incorrect output for programs which depend on
5954 an exact implementation of IEEE or ISO rules/specifications for
5955 math functions. It may, however, yield faster code for programs
5956 that do not require the guarantees of these specifications.
5957
5958 The default is @option{-fno-unsafe-math-optimizations}.
5959
5960 @item -ffinite-math-only
5961 @opindex ffinite-math-only
5962 Allow optimizations for floating-point arithmetic that assume
5963 that arguments and results are not NaNs or +-Infs.
5964
5965 This option is not turned on by any @option{-O} option since
5966 it can result in incorrect output for programs which depend on
5967 an exact implementation of IEEE or ISO rules/specifications for
5968 math functions. It may, however, yield faster code for programs
5969 that do not require the guarantees of these specifications.
5970
5971 The default is @option{-fno-finite-math-only}.
5972
5973 @item -fno-signed-zeros
5974 @opindex fno-signed-zeros
5975 Allow optimizations for floating point arithmetic that ignore the
5976 signedness of zero.  IEEE arithmetic specifies the behavior of
5977 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
5978 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
5979 This option implies that the sign of a zero result isn't significant.
5980
5981 The default is @option{-fsigned-zeros}.
5982
5983 @item -fno-trapping-math
5984 @opindex fno-trapping-math
5985 Compile code assuming that floating-point operations cannot generate
5986 user-visible traps.  These traps include division by zero, overflow,
5987 underflow, inexact result and invalid operation.  This option implies
5988 @option{-fno-signaling-nans}.  Setting this option may allow faster
5989 code if one relies on ``non-stop'' IEEE arithmetic, for example.
5990
5991 This option should never be turned on by any @option{-O} option since
5992 it can result in incorrect output for programs which depend on
5993 an exact implementation of IEEE or ISO rules/specifications for
5994 math functions.
5995
5996 The default is @option{-ftrapping-math}.
5997
5998 @item -frounding-math
5999 @opindex frounding-math
6000 Disable transformations and optimizations that assume default floating
6001 point rounding behavior.  This is round-to-zero for all floating point
6002 to integer conversions, and round-to-nearest for all other arithmetic
6003 truncations.  This option should be specified for programs that change
6004 the FP rounding mode dynamically, or that may be executed with a
6005 non-default rounding mode.  This option disables constant folding of
6006 floating point expressions at compile-time (which may be affected by
6007 rounding mode) and arithmetic transformations that are unsafe in the
6008 presence of sign-dependent rounding modes.
6009
6010 The default is @option{-fno-rounding-math}.
6011
6012 This option is experimental and does not currently guarantee to
6013 disable all GCC optimizations that are affected by rounding mode.
6014 Future versions of GCC may provide finer control of this setting
6015 using C99's @code{FENV_ACCESS} pragma.  This command line option
6016 will be used to specify the default state for @code{FENV_ACCESS}.
6017
6018 @item -frtl-abstract-sequences
6019 @opindex frtl-abstract-sequences
6020 It is a size optimization method. This option is to find identical
6021 sequences of code, which can be turned into pseudo-procedures  and
6022 then  replace  all  occurrences with  calls to  the  newly created
6023 subroutine. It is kind of an opposite of @option{-finline-functions}.
6024 This optimization runs at RTL level.
6025
6026 @item -fsignaling-nans
6027 @opindex fsignaling-nans
6028 Compile code assuming that IEEE signaling NaNs may generate user-visible
6029 traps during floating-point operations.  Setting this option disables
6030 optimizations that may change the number of exceptions visible with
6031 signaling NaNs.  This option implies @option{-ftrapping-math}.
6032
6033 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6034 be defined.
6035
6036 The default is @option{-fno-signaling-nans}.
6037
6038 This option is experimental and does not currently guarantee to
6039 disable all GCC optimizations that affect signaling NaN behavior.
6040
6041 @item -fsingle-precision-constant
6042 @opindex fsingle-precision-constant
6043 Treat floating point constant as single precision constant instead of
6044 implicitly converting it to double precision constant.
6045
6046 @item -fcx-limited-range
6047 @itemx -fno-cx-limited-range
6048 @opindex fcx-limited-range
6049 @opindex fno-cx-limited-range
6050 When enabled, this option states that a range reduction step is not
6051 needed when performing complex division.  The default is
6052 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
6053
6054 This option controls the default setting of the ISO C99
6055 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6056 all languages.
6057
6058 @end table
6059
6060 The following options control optimizations that may improve
6061 performance, but are not enabled by any @option{-O} options.  This
6062 section includes experimental options that may produce broken code.
6063
6064 @table @gcctabopt
6065 @item -fbranch-probabilities
6066 @opindex fbranch-probabilities
6067 After running a program compiled with @option{-fprofile-arcs}
6068 (@pxref{Debugging Options,, Options for Debugging Your Program or
6069 @command{gcc}}), you can compile it a second time using
6070 @option{-fbranch-probabilities}, to improve optimizations based on
6071 the number of times each branch was taken.  When the program
6072 compiled with @option{-fprofile-arcs} exits it saves arc execution
6073 counts to a file called @file{@var{sourcename}.gcda} for each source
6074 file.  The information in this data file is very dependent on the
6075 structure of the generated code, so you must use the same source code
6076 and the same optimization options for both compilations.
6077
6078 With @option{-fbranch-probabilities}, GCC puts a
6079 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6080 These can be used to improve optimization.  Currently, they are only
6081 used in one place: in @file{reorg.c}, instead of guessing which path a
6082 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6083 exactly determine which path is taken more often.
6084
6085 @item -fprofile-values
6086 @opindex fprofile-values
6087 If combined with @option{-fprofile-arcs}, it adds code so that some
6088 data about values of expressions in the program is gathered.
6089
6090 With @option{-fbranch-probabilities}, it reads back the data gathered
6091 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6092 notes to instructions for their later usage in optimizations.
6093
6094 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6095
6096 @item -fvpt
6097 @opindex fvpt
6098 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6099 a code to gather information about values of expressions.
6100
6101 With @option{-fbranch-probabilities}, it reads back the data gathered
6102 and actually performs the optimizations based on them.
6103 Currently the optimizations include specialization of division operation
6104 using the knowledge about the value of the denominator.
6105
6106 @item -frename-registers
6107 @opindex frename-registers
6108 Attempt to avoid false dependencies in scheduled code by making use
6109 of registers left over after register allocation.  This optimization
6110 will most benefit processors with lots of registers.  Depending on the
6111 debug information format adopted by the target, however, it can
6112 make debugging impossible, since variables will no longer stay in
6113 a ``home register''.
6114
6115 Enabled by default with @option{-funroll-loops}.
6116
6117 @item -ftracer
6118 @opindex ftracer
6119 Perform tail duplication to enlarge superblock size.  This transformation
6120 simplifies the control flow of the function allowing other optimizations to do
6121 better job.
6122
6123 Enabled with @option{-fprofile-use}.
6124
6125 @item -funroll-loops
6126 @opindex funroll-loops
6127 Unroll loops whose number of iterations can be determined at compile time or
6128 upon entry to the loop.  @option{-funroll-loops} implies
6129 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6130 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6131 small constant number of iterations).  This option makes code larger, and may
6132 or may not make it run faster.
6133
6134 Enabled with @option{-fprofile-use}.
6135
6136 @item -funroll-all-loops
6137 @opindex funroll-all-loops
6138 Unroll all loops, even if their number of iterations is uncertain when
6139 the loop is entered.  This usually makes programs run more slowly.
6140 @option{-funroll-all-loops} implies the same options as
6141 @option{-funroll-loops}.
6142
6143 @item -fpeel-loops
6144 @opindex fpeel-loops
6145 Peels the loops for that there is enough information that they do not
6146 roll much (from profile feedback).  It also turns on complete loop peeling
6147 (i.e.@: complete removal of loops with small constant number of iterations).
6148
6149 Enabled with @option{-fprofile-use}.
6150
6151 @item -fmove-loop-invariants
6152 @opindex fmove-loop-invariants
6153 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6154 at level @option{-O1}
6155
6156 @item -funswitch-loops
6157 @opindex funswitch-loops
6158 Move branches with loop invariant conditions out of the loop, with duplicates
6159 of the loop on both branches (modified according to result of the condition).
6160
6161 @item -ffunction-sections
6162 @itemx -fdata-sections
6163 @opindex ffunction-sections
6164 @opindex fdata-sections
6165 Place each function or data item into its own section in the output
6166 file if the target supports arbitrary sections.  The name of the
6167 function or the name of the data item determines the section's name
6168 in the output file.
6169
6170 Use these options on systems where the linker can perform optimizations
6171 to improve locality of reference in the instruction space.  Most systems
6172 using the ELF object format and SPARC processors running Solaris 2 have
6173 linkers with such optimizations.  AIX may have these optimizations in
6174 the future.
6175
6176 Only use these options when there are significant benefits from doing
6177 so.  When you specify these options, the assembler and linker will
6178 create larger object and executable files and will also be slower.
6179 You will not be able to use @code{gprof} on all systems if you
6180 specify this option and you may have problems with debugging if
6181 you specify both this option and @option{-g}.
6182
6183 @item -fbranch-target-load-optimize
6184 @opindex fbranch-target-load-optimize
6185 Perform branch target register load optimization before prologue / epilogue
6186 threading.
6187 The use of target registers can typically be exposed only during reload,
6188 thus hoisting loads out of loops and doing inter-block scheduling needs
6189 a separate optimization pass.
6190
6191 @item -fbranch-target-load-optimize2
6192 @opindex fbranch-target-load-optimize2
6193 Perform branch target register load optimization after prologue / epilogue
6194 threading.
6195
6196 @item -fbtr-bb-exclusive
6197 @opindex fbtr-bb-exclusive
6198 When performing branch target register load optimization, don't reuse
6199 branch target registers in within any basic block.
6200
6201 @item -fstack-protector
6202 Emit extra code to check for buffer overflows, such as stack smashing
6203 attacks.  This is done by adding a guard variable to functions with
6204 vulnerable objects.  This includes functions that call alloca, and
6205 functions with buffers larger than 8 bytes.  The guards are initialized
6206 when a function is entered and then checked when the function exits.
6207 If a guard check fails, an error message is printed and the program exits.
6208
6209 @item -fstack-protector-all
6210 Like @option{-fstack-protector} except that all functions are protected.
6211
6212 @item -fsection-anchors
6213 @opindex fsection-anchors
6214 Try to reduce the number of symbolic address calculations by using
6215 shared ``anchor'' symbols to address nearby objects.  This transformation
6216 can help to reduce the number of GOT entries and GOT accesses on some
6217 targets.
6218
6219 For example, the implementation of the following function @code{foo}:
6220
6221 @smallexample
6222 static int a, b, c;
6223 int foo (void) @{ return a + b + c; @}
6224 @end smallexample
6225
6226 would usually calculate the addresses of all three variables, but if you
6227 compile it with @option{-fsection-anchors}, it will access the variables
6228 from a common anchor point instead.  The effect is similar to the
6229 following pseudocode (which isn't valid C):
6230
6231 @smallexample
6232 int foo (void)
6233 @{
6234   register int *xr = &x;
6235   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6236 @}
6237 @end smallexample
6238
6239 Not all targets support this option.
6240
6241 @item --param @var{name}=@var{value}
6242 @opindex param
6243 In some places, GCC uses various constants to control the amount of
6244 optimization that is done.  For example, GCC will not inline functions
6245 that contain more that a certain number of instructions.  You can
6246 control some of these constants on the command-line using the
6247 @option{--param} option.
6248
6249 The names of specific parameters, and the meaning of the values, are
6250 tied to the internals of the compiler, and are subject to change
6251 without notice in future releases.
6252
6253 In each case, the @var{value} is an integer.  The allowable choices for
6254 @var{name} are given in the following table:
6255
6256 @table @gcctabopt
6257 @item salias-max-implicit-fields
6258 The maximum number of fields in a variable without direct
6259 structure accesses for which structure aliasing will consider trying
6260 to track each field.  The default is 5
6261
6262 @item salias-max-array-elements
6263 The maximum number of elements an array can have and its elements
6264 still be tracked individually by structure aliasing. The default is 4
6265
6266 @item sra-max-structure-size
6267 The maximum structure size, in bytes, at which the scalar replacement
6268 of aggregates (SRA) optimization will perform block copies.  The
6269 default value, 0, implies that GCC will select the most appropriate
6270 size itself.
6271
6272 @item sra-field-structure-ratio
6273 The threshold ratio (as a percentage) between instantiated fields and
6274 the complete structure size.  We say that if the ratio of the number
6275 of bytes in instantiated fields to the number of bytes in the complete
6276 structure exceeds this parameter, then block copies are not used.  The
6277 default is 75.
6278
6279 @item max-crossjump-edges
6280 The maximum number of incoming edges to consider for crossjumping.
6281 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6282 the number of edges incoming to each block.  Increasing values mean
6283 more aggressive optimization, making the compile time increase with
6284 probably small improvement in executable size.
6285
6286 @item min-crossjump-insns
6287 The minimum number of instructions which must be matched at the end
6288 of two blocks before crossjumping will be performed on them.  This
6289 value is ignored in the case where all instructions in the block being
6290 crossjumped from are matched.  The default value is 5.
6291
6292 @item max-grow-copy-bb-insns
6293 The maximum code size expansion factor when copying basic blocks
6294 instead of jumping.  The expansion is relative to a jump instruction.
6295 The default value is 8.
6296
6297 @item max-goto-duplication-insns
6298 The maximum number of instructions to duplicate to a block that jumps
6299 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6300 passes, GCC factors computed gotos early in the compilation process,
6301 and unfactors them as late as possible.  Only computed jumps at the
6302 end of a basic blocks with no more than max-goto-duplication-insns are
6303 unfactored.  The default value is 8.
6304
6305 @item max-delay-slot-insn-search
6306 The maximum number of instructions to consider when looking for an
6307 instruction to fill a delay slot.  If more than this arbitrary number of
6308 instructions is searched, the time savings from filling the delay slot
6309 will be minimal so stop searching.  Increasing values mean more
6310 aggressive optimization, making the compile time increase with probably
6311 small improvement in executable run time.
6312
6313 @item max-delay-slot-live-search
6314 When trying to fill delay slots, the maximum number of instructions to
6315 consider when searching for a block with valid live register
6316 information.  Increasing this arbitrarily chosen value means more
6317 aggressive optimization, increasing the compile time.  This parameter
6318 should be removed when the delay slot code is rewritten to maintain the
6319 control-flow graph.
6320
6321 @item max-gcse-memory
6322 The approximate maximum amount of memory that will be allocated in
6323 order to perform the global common subexpression elimination
6324 optimization.  If more memory than specified is required, the
6325 optimization will not be done.
6326
6327 @item max-gcse-passes
6328 The maximum number of passes of GCSE to run.  The default is 1.
6329
6330 @item max-pending-list-length
6331 The maximum number of pending dependencies scheduling will allow
6332 before flushing the current state and starting over.  Large functions
6333 with few branches or calls can create excessively large lists which
6334 needlessly consume memory and resources.
6335
6336 @item max-inline-insns-single
6337 Several parameters control the tree inliner used in gcc.
6338 This number sets the maximum number of instructions (counted in GCC's
6339 internal representation) in a single function that the tree inliner
6340 will consider for inlining.  This only affects functions declared
6341 inline and methods implemented in a class declaration (C++).
6342 The default value is 450.
6343
6344 @item max-inline-insns-auto
6345 When you use @option{-finline-functions} (included in @option{-O3}),
6346 a lot of functions that would otherwise not be considered for inlining
6347 by the compiler will be investigated.  To those functions, a different
6348 (more restrictive) limit compared to functions declared inline can
6349 be applied.
6350 The default value is 90.
6351
6352 @item large-function-insns
6353 The limit specifying really large functions.  For functions larger than this
6354 limit after inlining inlining is constrained by
6355 @option{--param large-function-growth}.  This parameter is useful primarily
6356 to avoid extreme compilation time caused by non-linear algorithms used by the
6357 backend.
6358 This parameter is ignored when @option{-funit-at-a-time} is not used.
6359 The default value is 2700.
6360
6361 @item large-function-growth
6362 Specifies maximal growth of large function caused by inlining in percents.
6363 This parameter is ignored when @option{-funit-at-a-time} is not used.
6364 The default value is 100 which limits large function growth to 2.0 times
6365 the original size.
6366
6367 @item large-unit-insns
6368 The limit specifying large translation unit.  Growth caused by inlining of
6369 units larger than this limit is limited by @option{--param inline-unit-growth}.
6370 For small units this might be too tight (consider unit consisting of function A
6371 that is inline and B that just calls A three time.  If B is small relative to
6372 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6373 large units consisting of small inlininable functions however the overall unit
6374 growth limit is needed to avoid exponential explosion of code size.  Thus for
6375 smaller units, the size is increased to @option{--param large-unit-insns}
6376 before applying @option{--param inline-unit-growth}.  The default is 10000
6377
6378 @item inline-unit-growth
6379 Specifies maximal overall growth of the compilation unit caused by inlining.
6380 This parameter is ignored when @option{-funit-at-a-time} is not used.
6381 The default value is 30 which limits unit growth to 1.3 times the original
6382 size.
6383
6384 @item large-stack-frame
6385 The limit specifying large stack frames.  While inlining the algorithm is trying
6386 to not grow past this limit too much.  Default value is 256 bytes.
6387
6388 @item large-stack-frame-growth
6389 Specifies maximal growth of large stack frames caused by inlining in percents.
6390 The default value is 1000 which limits large stack frame growth to 11 times
6391 the original size.
6392
6393 @item max-inline-insns-recursive
6394 @itemx max-inline-insns-recursive-auto
6395 Specifies maximum number of instructions out-of-line copy of self recursive inline
6396 function can grow into by performing recursive inlining.
6397
6398 For functions declared inline @option{--param max-inline-insns-recursive} is
6399 taken into account.  For function not declared inline, recursive inlining
6400 happens only when @option{-finline-functions} (included in @option{-O3}) is
6401 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6402 default value is 450.
6403
6404 @item max-inline-recursive-depth
6405 @itemx max-inline-recursive-depth-auto
6406 Specifies maximum recursion depth used by the recursive inlining.
6407
6408 For functions declared inline @option{--param max-inline-recursive-depth} is
6409 taken into account.  For function not declared inline, recursive inlining
6410 happens only when @option{-finline-functions} (included in @option{-O3}) is
6411 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6412 default value is 450.
6413
6414 @item min-inline-recursive-probability
6415 Recursive inlining is profitable only for function having deep recursion
6416 in average and can hurt for function having little recursion depth by
6417 increasing the prologue size or complexity of function body to other
6418 optimizers.
6419
6420 When profile feedback is available (see @option{-fprofile-generate}) the actual
6421 recursion depth can be guessed from probability that function will recurse via
6422 given call expression.  This parameter limits inlining only to call expression
6423 whose probability exceeds given threshold (in percents).  The default value is
6424 10.
6425
6426 @item inline-call-cost
6427 Specify cost of call instruction relative to simple arithmetics operations
6428 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6429 functions and at the same time increases size of leaf function that is believed to
6430 reduce function size by being inlined.  In effect it increases amount of
6431 inlining for code having large abstraction penalty (many functions that just
6432 pass the arguments to other functions) and decrease inlining for code with low
6433 abstraction penalty.  The default value is 16.
6434
6435 @item min-vect-loop-bound
6436 The minimum number of iterations under which a loop will not get vectorized
6437 when @option{-ftree-vectorize} is used.  The number of iterations after
6438 vectorization needs to be greater than the value specified by this option
6439 to allow vectorization.  The default value is 0.
6440
6441 @item max-unrolled-insns
6442 The maximum number of instructions that a loop should have if that loop
6443 is unrolled, and if the loop is unrolled, it determines how many times
6444 the loop code is unrolled.
6445
6446 @item max-average-unrolled-insns
6447 The maximum number of instructions biased by probabilities of their execution
6448 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6449 it determines how many times the loop code is unrolled.
6450
6451 @item max-unroll-times
6452 The maximum number of unrollings of a single loop.
6453
6454 @item max-peeled-insns
6455 The maximum number of instructions that a loop should have if that loop
6456 is peeled, and if the loop is peeled, it determines how many times
6457 the loop code is peeled.
6458
6459 @item max-peel-times
6460 The maximum number of peelings of a single loop.
6461
6462 @item max-completely-peeled-insns
6463 The maximum number of insns of a completely peeled loop.
6464
6465 @item max-completely-peel-times
6466 The maximum number of iterations of a loop to be suitable for complete peeling.
6467
6468 @item max-unswitch-insns
6469 The maximum number of insns of an unswitched loop.
6470
6471 @item max-unswitch-level
6472 The maximum number of branches unswitched in a single loop.
6473
6474 @item lim-expensive
6475 The minimum cost of an expensive expression in the loop invariant motion.
6476
6477 @item iv-consider-all-candidates-bound
6478 Bound on number of candidates for induction variables below that
6479 all candidates are considered for each use in induction variable
6480 optimizations.  Only the most relevant candidates are considered
6481 if there are more candidates, to avoid quadratic time complexity.
6482
6483 @item iv-max-considered-uses
6484 The induction variable optimizations give up on loops that contain more
6485 induction variable uses.
6486
6487 @item iv-always-prune-cand-set-bound
6488 If number of candidates in the set is smaller than this value,
6489 we always try to remove unnecessary ivs from the set during its
6490 optimization when a new iv is added to the set.
6491
6492 @item scev-max-expr-size
6493 Bound on size of expressions used in the scalar evolutions analyzer.
6494 Large expressions slow the analyzer.
6495
6496 @item omega-max-vars
6497 The maximum number of variables in an Omega constraint system.
6498 The default value is 128.
6499
6500 @item omega-max-geqs
6501 The maximum number of inequalities in an Omega constraint system.
6502 The default value is 256.
6503
6504 @item omega-max-eqs
6505 The maximum number of equalities in an Omega constraint system.
6506 The default value is 128.
6507
6508 @item omega-max-wild-cards
6509 The maximum number of wildcard variables that the Omega solver will
6510 be able to insert.  The default value is 18.
6511
6512 @item omega-hash-table-size
6513 The size of the hash table in the Omega solver.  The default value is
6514 550.
6515
6516 @item omega-max-keys
6517 The maximal number of keys used by the Omega solver.  The default
6518 value is 500.
6519
6520 @item omega-eliminate-redundant-constraints
6521 When set to 1, use expensive methods to eliminate all redundant
6522 constraints.  The default value is 0.
6523
6524 @item vect-max-version-checks
6525 The maximum number of runtime checks that can be performed when doing
6526 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6527 for more information.
6528
6529 @item max-iterations-to-track
6530
6531 The maximum number of iterations of a loop the brute force algorithm
6532 for analysis of # of iterations of the loop tries to evaluate.
6533
6534 @item hot-bb-count-fraction
6535 Select fraction of the maximal count of repetitions of basic block in program
6536 given basic block needs to have to be considered hot.
6537
6538 @item hot-bb-frequency-fraction
6539 Select fraction of the maximal frequency of executions of basic block in
6540 function given basic block needs to have to be considered hot
6541
6542 @item max-predicted-iterations
6543 The maximum number of loop iterations we predict statically.  This is useful
6544 in cases where function contain single loop with known bound and other loop
6545 with unknown.  We predict the known number of iterations correctly, while
6546 the unknown number of iterations average to roughly 10.  This means that the
6547 loop without bounds would appear artificially cold relative to the other one.
6548
6549 @item tracer-dynamic-coverage
6550 @itemx tracer-dynamic-coverage-feedback
6551
6552 This value is used to limit superblock formation once the given percentage of
6553 executed instructions is covered.  This limits unnecessary code size
6554 expansion.
6555
6556 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6557 feedback is available.  The real profiles (as opposed to statically estimated
6558 ones) are much less balanced allowing the threshold to be larger value.
6559
6560 @item tracer-max-code-growth
6561 Stop tail duplication once code growth has reached given percentage.  This is
6562 rather hokey argument, as most of the duplicates will be eliminated later in
6563 cross jumping, so it may be set to much higher values than is the desired code
6564 growth.
6565
6566 @item tracer-min-branch-ratio
6567
6568 Stop reverse growth when the reverse probability of best edge is less than this
6569 threshold (in percent).
6570
6571 @item tracer-min-branch-ratio
6572 @itemx tracer-min-branch-ratio-feedback
6573
6574 Stop forward growth if the best edge do have probability lower than this
6575 threshold.
6576
6577 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6578 compilation for profile feedback and one for compilation without.  The value
6579 for compilation with profile feedback needs to be more conservative (higher) in
6580 order to make tracer effective.
6581
6582 @item max-cse-path-length
6583
6584 Maximum number of basic blocks on path that cse considers.  The default is 10.
6585
6586 @item max-cse-insns
6587 The maximum instructions CSE process before flushing. The default is 1000.
6588
6589 @item max-aliased-vops
6590
6591 Maximum number of virtual operands per function allowed to represent
6592 aliases before triggering the alias partitioning heuristic.  Alias
6593 partitioning reduces compile times and memory consumption needed for
6594 aliasing at the expense of precision loss in alias information.  The
6595 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
6596 for -O3.
6597
6598 Notice that if a function contains more memory statements than the
6599 value of this parameter, it is not really possible to achieve this
6600 reduction.  In this case, the compiler will use the number of memory
6601 statements as the value for @option{max-aliased-vops}.
6602
6603 @item avg-aliased-vops
6604
6605 Average number of virtual operands per statement allowed to represent
6606 aliases before triggering the alias partitioning heuristic.  This
6607 works in conjunction with @option{max-aliased-vops}.  If a function
6608 contains more than @option{max-aliased-vops} virtual operators, then
6609 memory symbols will be grouped into memory partitions until either the
6610 total number of virtual operators is below @option{max-aliased-vops}
6611 or the average number of virtual operators per memory statement is
6612 below @option{avg-aliased-vops}.  The default value for this parameter
6613 is 1 for -O1 and -O2, and 3 for -O3.
6614
6615 @item ggc-min-expand
6616
6617 GCC uses a garbage collector to manage its own memory allocation.  This
6618 parameter specifies the minimum percentage by which the garbage
6619 collector's heap should be allowed to expand between collections.
6620 Tuning this may improve compilation speed; it has no effect on code
6621 generation.
6622
6623 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6624 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6625 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6626 GCC is not able to calculate RAM on a particular platform, the lower
6627 bound of 30% is used.  Setting this parameter and
6628 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6629 every opportunity.  This is extremely slow, but can be useful for
6630 debugging.
6631
6632 @item ggc-min-heapsize
6633
6634 Minimum size of the garbage collector's heap before it begins bothering
6635 to collect garbage.  The first collection occurs after the heap expands
6636 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6637 tuning this may improve compilation speed, and has no effect on code
6638 generation.
6639
6640 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6641 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6642 with a lower bound of 4096 (four megabytes) and an upper bound of
6643 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6644 particular platform, the lower bound is used.  Setting this parameter
6645 very large effectively disables garbage collection.  Setting this
6646 parameter and @option{ggc-min-expand} to zero causes a full collection
6647 to occur at every opportunity.
6648
6649 @item max-reload-search-insns
6650 The maximum number of instruction reload should look backward for equivalent
6651 register.  Increasing values mean more aggressive optimization, making the
6652 compile time increase with probably slightly better performance.  The default
6653 value is 100.
6654
6655 @item max-cselib-memory-locations
6656 The maximum number of memory locations cselib should take into account.
6657 Increasing values mean more aggressive optimization, making the compile time
6658 increase with probably slightly better performance.  The default value is 500.
6659
6660 @item max-flow-memory-locations
6661 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6662 The default value is 100.
6663
6664 @item reorder-blocks-duplicate
6665 @itemx reorder-blocks-duplicate-feedback
6666
6667 Used by basic block reordering pass to decide whether to use unconditional
6668 branch or duplicate the code on its destination.  Code is duplicated when its
6669 estimated size is smaller than this value multiplied by the estimated size of
6670 unconditional jump in the hot spots of the program.
6671
6672 The @option{reorder-block-duplicate-feedback} is used only when profile
6673 feedback is available and may be set to higher values than
6674 @option{reorder-block-duplicate} since information about the hot spots is more
6675 accurate.
6676
6677 @item max-sched-ready-insns
6678 The maximum number of instructions ready to be issued the scheduler should
6679 consider at any given time during the first scheduling pass.  Increasing
6680 values mean more thorough searches, making the compilation time increase
6681 with probably little benefit.  The default value is 100.
6682
6683 @item max-sched-region-blocks
6684 The maximum number of blocks in a region to be considered for
6685 interblock scheduling.  The default value is 10.
6686
6687 @item max-sched-region-insns
6688 The maximum number of insns in a region to be considered for
6689 interblock scheduling.  The default value is 100.
6690
6691 @item min-spec-prob
6692 The minimum probability (in percents) of reaching a source block
6693 for interblock speculative scheduling.  The default value is 40.
6694
6695 @item max-sched-extend-regions-iters
6696 The maximum number of iterations through CFG to extend regions.
6697 0 - disable region extension,
6698 N - do at most N iterations.
6699 The default value is 0.
6700
6701 @item max-sched-insn-conflict-delay
6702 The maximum conflict delay for an insn to be considered for speculative motion.
6703 The default value is 3.
6704
6705 @item sched-spec-prob-cutoff
6706 The minimal probability of speculation success (in percents), so that
6707 speculative insn will be scheduled.
6708 The default value is 40.
6709
6710 @item max-last-value-rtl
6711
6712 The maximum size measured as number of RTLs that can be recorded in an expression
6713 in combiner for a pseudo register as last known value of that register.  The default
6714 is 10000.
6715
6716 @item integer-share-limit
6717 Small integer constants can use a shared data structure, reducing the
6718 compiler's memory usage and increasing its speed.  This sets the maximum
6719 value of a shared integer constant's.  The default value is 256.
6720
6721 @item min-virtual-mappings
6722 Specifies the minimum number of virtual mappings in the incremental
6723 SSA updater that should be registered to trigger the virtual mappings
6724 heuristic defined by virtual-mappings-ratio.  The default value is
6725 100.
6726
6727 @item virtual-mappings-ratio
6728 If the number of virtual mappings is virtual-mappings-ratio bigger
6729 than the number of virtual symbols to be updated, then the incremental
6730 SSA updater switches to a full update for those symbols.  The default
6731 ratio is 3.
6732
6733 @item ssp-buffer-size
6734 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6735 protection when @option{-fstack-protection} is used.
6736
6737 @item max-jump-thread-duplication-stmts
6738 Maximum number of statements allowed in a block that needs to be
6739 duplicated when threading jumps.
6740
6741 @item max-fields-for-field-sensitive
6742 Maximum number of fields in a structure we will treat in
6743 a field sensitive manner during pointer analysis.
6744
6745 @item prefetch-latency
6746 Estimate on average number of instructions that are executed before
6747 prefetch finishes.  The distance we prefetch ahead is proportional
6748 to this constant.  Increasing this number may also lead to less
6749 streams being prefetched (see @option{simultaneous-prefetches}).
6750
6751 @item simultaneous-prefetches
6752 Maximum number of prefetches that can run at the same time.
6753
6754 @item l1-cache-line-size
6755 The size of cache line in L1 cache, in bytes.
6756
6757 @item l1-cache-size
6758 The number of cache lines in L1 cache.
6759
6760 @item verify-canonical-types
6761 Whether the compiler should verify the ``canonical'' types used for
6762 type equality comparisons within the C++ and Objective-C++ front
6763 ends. Set to 1 (the default when GCC is configured with
6764 --enable-checking) to enable verification, 0 to disable verification
6765 (the default when GCC is configured with --disable-checking).
6766
6767 @end table
6768 @end table
6769
6770 @node Preprocessor Options
6771 @section Options Controlling the Preprocessor
6772 @cindex preprocessor options
6773 @cindex options, preprocessor
6774
6775 These options control the C preprocessor, which is run on each C source
6776 file before actual compilation.
6777
6778 If you use the @option{-E} option, nothing is done except preprocessing.
6779 Some of these options make sense only together with @option{-E} because
6780 they cause the preprocessor output to be unsuitable for actual
6781 compilation.
6782
6783 @table @gcctabopt
6784 @opindex Wp
6785 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6786 and pass @var{option} directly through to the preprocessor.  If
6787 @var{option} contains commas, it is split into multiple options at the
6788 commas.  However, many options are modified, translated or interpreted
6789 by the compiler driver before being passed to the preprocessor, and
6790 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6791 interface is undocumented and subject to change, so whenever possible
6792 you should avoid using @option{-Wp} and let the driver handle the
6793 options instead.
6794
6795 @item -Xpreprocessor @var{option}
6796 @opindex preprocessor
6797 Pass @var{option} as an option to the preprocessor.  You can use this to
6798 supply system-specific preprocessor options which GCC does not know how to
6799 recognize.
6800
6801 If you want to pass an option that takes an argument, you must use
6802 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6803 @end table
6804
6805 @include cppopts.texi
6806
6807 @node Assembler Options
6808 @section Passing Options to the Assembler
6809
6810 @c prevent bad page break with this line
6811 You can pass options to the assembler.
6812
6813 @table @gcctabopt
6814 @item -Wa,@var{option}
6815 @opindex Wa
6816 Pass @var{option} as an option to the assembler.  If @var{option}
6817 contains commas, it is split into multiple options at the commas.
6818
6819 @item -Xassembler @var{option}
6820 @opindex Xassembler
6821 Pass @var{option} as an option to the assembler.  You can use this to
6822 supply system-specific assembler options which GCC does not know how to
6823 recognize.
6824
6825 If you want to pass an option that takes an argument, you must use
6826 @option{-Xassembler} twice, once for the option and once for the argument.
6827
6828 @end table
6829
6830 @node Link Options
6831 @section Options for Linking
6832 @cindex link options
6833 @cindex options, linking
6834
6835 These options come into play when the compiler links object files into
6836 an executable output file.  They are meaningless if the compiler is
6837 not doing a link step.
6838
6839 @table @gcctabopt
6840 @cindex file names
6841 @item @var{object-file-name}
6842 A file name that does not end in a special recognized suffix is
6843 considered to name an object file or library.  (Object files are
6844 distinguished from libraries by the linker according to the file
6845 contents.)  If linking is done, these object files are used as input
6846 to the linker.
6847
6848 @item -c
6849 @itemx -S
6850 @itemx -E
6851 @opindex c
6852 @opindex S
6853 @opindex E
6854 If any of these options is used, then the linker is not run, and
6855 object file names should not be used as arguments.  @xref{Overall
6856 Options}.
6857
6858 @cindex Libraries
6859 @item -l@var{library}
6860 @itemx -l @var{library}
6861 @opindex l
6862 Search the library named @var{library} when linking.  (The second
6863 alternative with the library as a separate argument is only for
6864 POSIX compliance and is not recommended.)
6865
6866 It makes a difference where in the command you write this option; the
6867 linker searches and processes libraries and object files in the order they
6868 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6869 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6870 to functions in @samp{z}, those functions may not be loaded.
6871
6872 The linker searches a standard list of directories for the library,
6873 which is actually a file named @file{lib@var{library}.a}.  The linker
6874 then uses this file as if it had been specified precisely by name.
6875
6876 The directories searched include several standard system directories
6877 plus any that you specify with @option{-L}.
6878
6879 Normally the files found this way are library files---archive files
6880 whose members are object files.  The linker handles an archive file by
6881 scanning through it for members which define symbols that have so far
6882 been referenced but not defined.  But if the file that is found is an
6883 ordinary object file, it is linked in the usual fashion.  The only
6884 difference between using an @option{-l} option and specifying a file name
6885 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6886 and searches several directories.
6887
6888 @item -lobjc
6889 @opindex lobjc
6890 You need this special case of the @option{-l} option in order to
6891 link an Objective-C or Objective-C++ program.
6892
6893 @item -nostartfiles
6894 @opindex nostartfiles
6895 Do not use the standard system startup files when linking.
6896 The standard system libraries are used normally, unless @option{-nostdlib}
6897 or @option{-nodefaultlibs} is used.
6898
6899 @item -nodefaultlibs
6900 @opindex nodefaultlibs
6901 Do not use the standard system libraries when linking.
6902 Only the libraries you specify will be passed to the linker.
6903 The standard startup files are used normally, unless @option{-nostartfiles}
6904 is used.  The compiler may generate calls to @code{memcmp},
6905 @code{memset}, @code{memcpy} and @code{memmove}.
6906 These entries are usually resolved by entries in
6907 libc.  These entry points should be supplied through some other
6908 mechanism when this option is specified.
6909
6910 @item -nostdlib
6911 @opindex nostdlib
6912 Do not use the standard system startup files or libraries when linking.
6913 No startup files and only the libraries you specify will be passed to
6914 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6915 @code{memcpy} and @code{memmove}.
6916 These entries are usually resolved by entries in
6917 libc.  These entry points should be supplied through some other
6918 mechanism when this option is specified.
6919
6920 @cindex @option{-lgcc}, use with @option{-nostdlib}
6921 @cindex @option{-nostdlib} and unresolved references
6922 @cindex unresolved references and @option{-nostdlib}
6923 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6924 @cindex @option{-nodefaultlibs} and unresolved references
6925 @cindex unresolved references and @option{-nodefaultlibs}
6926 One of the standard libraries bypassed by @option{-nostdlib} and
6927 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6928 that GCC uses to overcome shortcomings of particular machines, or special
6929 needs for some languages.
6930 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6931 Collection (GCC) Internals},
6932 for more discussion of @file{libgcc.a}.)
6933 In most cases, you need @file{libgcc.a} even when you want to avoid
6934 other standard libraries.  In other words, when you specify @option{-nostdlib}
6935 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6936 This ensures that you have no unresolved references to internal GCC
6937 library subroutines.  (For example, @samp{__main}, used to ensure C++
6938 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6939 GNU Compiler Collection (GCC) Internals}.)
6940
6941 @item -pie
6942 @opindex pie
6943 Produce a position independent executable on targets which support it.
6944 For predictable results, you must also specify the same set of options
6945 that were used to generate code (@option{-fpie}, @option{-fPIE},
6946 or model suboptions) when you specify this option.
6947
6948 @item -rdynamic
6949 @opindex rdynamic
6950 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6951 that support it. This instructs the linker to add all symbols, not
6952 only used ones, to the dynamic symbol table. This option is needed
6953 for some uses of @code{dlopen} or to allow obtaining backtraces
6954 from within a program.
6955
6956 @item -s
6957 @opindex s
6958 Remove all symbol table and relocation information from the executable.
6959
6960 @item -static
6961 @opindex static
6962 On systems that support dynamic linking, this prevents linking with the shared
6963 libraries.  On other systems, this option has no effect.
6964
6965 @item -shared
6966 @opindex shared
6967 Produce a shared object which can then be linked with other objects to
6968 form an executable.  Not all systems support this option.  For predictable
6969 results, you must also specify the same set of options that were used to
6970 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6971 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6972 needs to build supplementary stub code for constructors to work.  On
6973 multi-libbed systems, @samp{gcc -shared} must select the correct support
6974 libraries to link against.  Failing to supply the correct flags may lead
6975 to subtle defects.  Supplying them in cases where they are not necessary
6976 is innocuous.}
6977
6978 @item -shared-libgcc
6979 @itemx -static-libgcc
6980 @opindex shared-libgcc
6981 @opindex static-libgcc
6982 On systems that provide @file{libgcc} as a shared library, these options
6983 force the use of either the shared or static version respectively.
6984 If no shared version of @file{libgcc} was built when the compiler was
6985 configured, these options have no effect.
6986
6987 There are several situations in which an application should use the
6988 shared @file{libgcc} instead of the static version.  The most common
6989 of these is when the application wishes to throw and catch exceptions
6990 across different shared libraries.  In that case, each of the libraries
6991 as well as the application itself should use the shared @file{libgcc}.
6992
6993 Therefore, the G++ and GCJ drivers automatically add
6994 @option{-shared-libgcc} whenever you build a shared library or a main
6995 executable, because C++ and Java programs typically use exceptions, so
6996 this is the right thing to do.
6997
6998 If, instead, you use the GCC driver to create shared libraries, you may
6999 find that they will not always be linked with the shared @file{libgcc}.
7000 If GCC finds, at its configuration time, that you have a non-GNU linker
7001 or a GNU linker that does not support option @option{--eh-frame-hdr},
7002 it will link the shared version of @file{libgcc} into shared libraries
7003 by default.  Otherwise, it will take advantage of the linker and optimize
7004 away the linking with the shared version of @file{libgcc}, linking with
7005 the static version of libgcc by default.  This allows exceptions to
7006 propagate through such shared libraries, without incurring relocation
7007 costs at library load time.
7008
7009 However, if a library or main executable is supposed to throw or catch
7010 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7011 for the languages used in the program, or using the option
7012 @option{-shared-libgcc}, such that it is linked with the shared
7013 @file{libgcc}.
7014
7015 @item -symbolic
7016 @opindex symbolic
7017 Bind references to global symbols when building a shared object.  Warn
7018 about any unresolved references (unless overridden by the link editor
7019 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7020 this option.
7021
7022 @item -Xlinker @var{option}
7023 @opindex Xlinker
7024 Pass @var{option} as an option to the linker.  You can use this to
7025 supply system-specific linker options which GCC does not know how to
7026 recognize.
7027
7028 If you want to pass an option that takes an argument, you must use
7029 @option{-Xlinker} twice, once for the option and once for the argument.
7030 For example, to pass @option{-assert definitions}, you must write
7031 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7032 @option{-Xlinker "-assert definitions"}, because this passes the entire
7033 string as a single argument, which is not what the linker expects.
7034
7035 @item -Wl,@var{option}
7036 @opindex Wl
7037 Pass @var{option} as an option to the linker.  If @var{option} contains
7038 commas, it is split into multiple options at the commas.
7039
7040 @item -u @var{symbol}
7041 @opindex u
7042 Pretend the symbol @var{symbol} is undefined, to force linking of
7043 library modules to define it.  You can use @option{-u} multiple times with
7044 different symbols to force loading of additional library modules.
7045 @end table
7046
7047 @node Directory Options
7048 @section Options for Directory Search
7049 @cindex directory options
7050 @cindex options, directory search
7051 @cindex search path
7052
7053 These options specify directories to search for header files, for
7054 libraries and for parts of the compiler:
7055
7056 @table @gcctabopt
7057 @item -I@var{dir}
7058 @opindex I
7059 Add the directory @var{dir} to the head of the list of directories to be
7060 searched for header files.  This can be used to override a system header
7061 file, substituting your own version, since these directories are
7062 searched before the system header file directories.  However, you should
7063 not use this option to add directories that contain vendor-supplied
7064 system header files (use @option{-isystem} for that).  If you use more than
7065 one @option{-I} option, the directories are scanned in left-to-right
7066 order; the standard system directories come after.
7067
7068 If a standard system include directory, or a directory specified with
7069 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7070 option will be ignored.  The directory will still be searched but as a
7071 system directory at its normal position in the system include chain.
7072 This is to ensure that GCC's procedure to fix buggy system headers and
7073 the ordering for the include_next directive are not inadvertently changed.
7074 If you really need to change the search order for system directories,
7075 use the @option{-nostdinc} and/or @option{-isystem} options.
7076
7077 @item -iquote@var{dir}
7078 @opindex iquote
7079 Add the directory @var{dir} to the head of the list of directories to
7080 be searched for header files only for the case of @samp{#include
7081 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7082 otherwise just like @option{-I}.
7083
7084 @item -L@var{dir}
7085 @opindex L
7086 Add directory @var{dir} to the list of directories to be searched
7087 for @option{-l}.
7088
7089 @item -B@var{prefix}
7090 @opindex B
7091 This option specifies where to find the executables, libraries,
7092 include files, and data files of the compiler itself.
7093
7094 The compiler driver program runs one or more of the subprograms
7095 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7096 @var{prefix} as a prefix for each program it tries to run, both with and
7097 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7098
7099 For each subprogram to be run, the compiler driver first tries the
7100 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7101 was not specified, the driver tries two standard prefixes, which are
7102 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7103 those results in a file name that is found, the unmodified program
7104 name is searched for using the directories specified in your
7105 @env{PATH} environment variable.
7106
7107 The compiler will check to see if the path provided by the @option{-B}
7108 refers to a directory, and if necessary it will add a directory
7109 separator character at the end of the path.
7110
7111 @option{-B} prefixes that effectively specify directory names also apply
7112 to libraries in the linker, because the compiler translates these
7113 options into @option{-L} options for the linker.  They also apply to
7114 includes files in the preprocessor, because the compiler translates these
7115 options into @option{-isystem} options for the preprocessor.  In this case,
7116 the compiler appends @samp{include} to the prefix.
7117
7118 The run-time support file @file{libgcc.a} can also be searched for using
7119 the @option{-B} prefix, if needed.  If it is not found there, the two
7120 standard prefixes above are tried, and that is all.  The file is left
7121 out of the link if it is not found by those means.
7122
7123 Another way to specify a prefix much like the @option{-B} prefix is to use
7124 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7125 Variables}.
7126
7127 As a special kludge, if the path provided by @option{-B} is
7128 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7129 9, then it will be replaced by @file{[dir/]include}.  This is to help
7130 with boot-strapping the compiler.
7131
7132 @item -specs=@var{file}
7133 @opindex specs
7134 Process @var{file} after the compiler reads in the standard @file{specs}
7135 file, in order to override the defaults that the @file{gcc} driver
7136 program uses when determining what switches to pass to @file{cc1},
7137 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7138 @option{-specs=@var{file}} can be specified on the command line, and they
7139 are processed in order, from left to right.
7140
7141 @item --sysroot=@var{dir}
7142 @opindex sysroot
7143 Use @var{dir} as the logical root directory for headers and libraries.
7144 For example, if the compiler would normally search for headers in
7145 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7146 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7147
7148 If you use both this option and the @option{-isysroot} option, then
7149 the @option{--sysroot} option will apply to libraries, but the
7150 @option{-isysroot} option will apply to header files.
7151
7152 The GNU linker (beginning with version 2.16) has the necessary support
7153 for this option.  If your linker does not support this option, the
7154 header file aspect of @option{--sysroot} will still work, but the
7155 library aspect will not.
7156
7157 @item -I-
7158 @opindex I-
7159 This option has been deprecated.  Please use @option{-iquote} instead for
7160 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7161 Any directories you specify with @option{-I} options before the @option{-I-}
7162 option are searched only for the case of @samp{#include "@var{file}"};
7163 they are not searched for @samp{#include <@var{file}>}.
7164
7165 If additional directories are specified with @option{-I} options after
7166 the @option{-I-}, these directories are searched for all @samp{#include}
7167 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7168 this way.)
7169
7170 In addition, the @option{-I-} option inhibits the use of the current
7171 directory (where the current input file came from) as the first search
7172 directory for @samp{#include "@var{file}"}.  There is no way to
7173 override this effect of @option{-I-}.  With @option{-I.} you can specify
7174 searching the directory which was current when the compiler was
7175 invoked.  That is not exactly the same as what the preprocessor does
7176 by default, but it is often satisfactory.
7177
7178 @option{-I-} does not inhibit the use of the standard system directories
7179 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7180 independent.
7181 @end table
7182
7183 @c man end
7184
7185 @node Spec Files
7186 @section Specifying subprocesses and the switches to pass to them
7187 @cindex Spec Files
7188
7189 @command{gcc} is a driver program.  It performs its job by invoking a
7190 sequence of other programs to do the work of compiling, assembling and
7191 linking.  GCC interprets its command-line parameters and uses these to
7192 deduce which programs it should invoke, and which command-line options
7193 it ought to place on their command lines.  This behavior is controlled
7194 by @dfn{spec strings}.  In most cases there is one spec string for each
7195 program that GCC can invoke, but a few programs have multiple spec
7196 strings to control their behavior.  The spec strings built into GCC can
7197 be overridden by using the @option{-specs=} command-line switch to specify
7198 a spec file.
7199
7200 @dfn{Spec files} are plaintext files that are used to construct spec
7201 strings.  They consist of a sequence of directives separated by blank
7202 lines.  The type of directive is determined by the first non-whitespace
7203 character on the line and it can be one of the following:
7204
7205 @table @code
7206 @item %@var{command}
7207 Issues a @var{command} to the spec file processor.  The commands that can
7208 appear here are:
7209
7210 @table @code
7211 @item %include <@var{file}>
7212 @cindex %include
7213 Search for @var{file} and insert its text at the current point in the
7214 specs file.
7215
7216 @item %include_noerr <@var{file}>
7217 @cindex %include_noerr
7218 Just like @samp{%include}, but do not generate an error message if the include
7219 file cannot be found.
7220
7221 @item %rename @var{old_name} @var{new_name}
7222 @cindex %rename
7223 Rename the spec string @var{old_name} to @var{new_name}.
7224
7225 @end table
7226
7227 @item *[@var{spec_name}]:
7228 This tells the compiler to create, override or delete the named spec
7229 string.  All lines after this directive up to the next directive or
7230 blank line are considered to be the text for the spec string.  If this
7231 results in an empty string then the spec will be deleted.  (Or, if the
7232 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7233 does not currently exist a new spec will be created.  If the spec does
7234 exist then its contents will be overridden by the text of this
7235 directive, unless the first character of that text is the @samp{+}
7236 character, in which case the text will be appended to the spec.
7237
7238 @item [@var{suffix}]:
7239 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7240 and up to the next directive or blank line are considered to make up the
7241 spec string for the indicated suffix.  When the compiler encounters an
7242 input file with the named suffix, it will processes the spec string in
7243 order to work out how to compile that file.  For example:
7244
7245 @smallexample
7246 .ZZ:
7247 z-compile -input %i
7248 @end smallexample
7249
7250 This says that any input file whose name ends in @samp{.ZZ} should be
7251 passed to the program @samp{z-compile}, which should be invoked with the
7252 command-line switch @option{-input} and with the result of performing the
7253 @samp{%i} substitution.  (See below.)
7254
7255 As an alternative to providing a spec string, the text that follows a
7256 suffix directive can be one of the following:
7257
7258 @table @code
7259 @item @@@var{language}
7260 This says that the suffix is an alias for a known @var{language}.  This is
7261 similar to using the @option{-x} command-line switch to GCC to specify a
7262 language explicitly.  For example:
7263
7264 @smallexample
7265 .ZZ:
7266 @@c++
7267 @end smallexample
7268
7269 Says that .ZZ files are, in fact, C++ source files.
7270
7271 @item #@var{name}
7272 This causes an error messages saying:
7273
7274 @smallexample
7275 @var{name} compiler not installed on this system.
7276 @end smallexample
7277 @end table
7278
7279 GCC already has an extensive list of suffixes built into it.
7280 This directive will add an entry to the end of the list of suffixes, but
7281 since the list is searched from the end backwards, it is effectively
7282 possible to override earlier entries using this technique.
7283
7284 @end table
7285
7286 GCC has the following spec strings built into it.  Spec files can
7287 override these strings or create their own.  Note that individual
7288 targets can also add their own spec strings to this list.
7289
7290 @smallexample
7291 asm          Options to pass to the assembler
7292 asm_final    Options to pass to the assembler post-processor
7293 cpp          Options to pass to the C preprocessor
7294 cc1          Options to pass to the C compiler
7295 cc1plus      Options to pass to the C++ compiler
7296 endfile      Object files to include at the end of the link
7297 link         Options to pass to the linker
7298 lib          Libraries to include on the command line to the linker
7299 libgcc       Decides which GCC support library to pass to the linker
7300 linker       Sets the name of the linker
7301 predefines   Defines to be passed to the C preprocessor
7302 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7303              by default
7304 startfile    Object files to include at the start of the link
7305 @end smallexample
7306
7307 Here is a small example of a spec file:
7308
7309 @smallexample
7310 %rename lib                 old_lib
7311
7312 *lib:
7313 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7314 @end smallexample
7315
7316 This example renames the spec called @samp{lib} to @samp{old_lib} and
7317 then overrides the previous definition of @samp{lib} with a new one.
7318 The new definition adds in some extra command-line options before
7319 including the text of the old definition.
7320
7321 @dfn{Spec strings} are a list of command-line options to be passed to their
7322 corresponding program.  In addition, the spec strings can contain
7323 @samp{%}-prefixed sequences to substitute variable text or to
7324 conditionally insert text into the command line.  Using these constructs
7325 it is possible to generate quite complex command lines.
7326
7327 Here is a table of all defined @samp{%}-sequences for spec
7328 strings.  Note that spaces are not generated automatically around the
7329 results of expanding these sequences.  Therefore you can concatenate them
7330 together or combine them with constant text in a single argument.
7331
7332 @table @code
7333 @item %%
7334 Substitute one @samp{%} into the program name or argument.
7335
7336 @item %i
7337 Substitute the name of the input file being processed.
7338
7339 @item %b
7340 Substitute the basename of the input file being processed.
7341 This is the substring up to (and not including) the last period
7342 and not including the directory.
7343
7344 @item %B
7345 This is the same as @samp{%b}, but include the file suffix (text after
7346 the last period).
7347
7348 @item %d
7349 Marks the argument containing or following the @samp{%d} as a
7350 temporary file name, so that that file will be deleted if GCC exits
7351 successfully.  Unlike @samp{%g}, this contributes no text to the
7352 argument.
7353
7354 @item %g@var{suffix}
7355 Substitute a file name that has suffix @var{suffix} and is chosen
7356 once per compilation, and mark the argument in the same way as
7357 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7358 name is now chosen in a way that is hard to predict even when previously
7359 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7360 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7361 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7362 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7363 was simply substituted with a file name chosen once per compilation,
7364 without regard to any appended suffix (which was therefore treated
7365 just like ordinary text), making such attacks more likely to succeed.
7366
7367 @item %u@var{suffix}
7368 Like @samp{%g}, but generates a new temporary file name even if
7369 @samp{%u@var{suffix}} was already seen.
7370
7371 @item %U@var{suffix}
7372 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7373 new one if there is no such last file name.  In the absence of any
7374 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7375 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7376 would involve the generation of two distinct file names, one
7377 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7378 simply substituted with a file name chosen for the previous @samp{%u},
7379 without regard to any appended suffix.
7380
7381 @item %j@var{suffix}
7382 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7383 writable, and if save-temps is off; otherwise, substitute the name
7384 of a temporary file, just like @samp{%u}.  This temporary file is not
7385 meant for communication between processes, but rather as a junk
7386 disposal mechanism.
7387
7388 @item %|@var{suffix}
7389 @itemx %m@var{suffix}
7390 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7391 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7392 all.  These are the two most common ways to instruct a program that it
7393 should read from standard input or write to standard output.  If you
7394 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7395 construct: see for example @file{f/lang-specs.h}.
7396
7397 @item %.@var{SUFFIX}
7398 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7399 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7400 terminated by the next space or %.
7401
7402 @item %w
7403 Marks the argument containing or following the @samp{%w} as the
7404 designated output file of this compilation.  This puts the argument
7405 into the sequence of arguments that @samp{%o} will substitute later.
7406
7407 @item %o
7408 Substitutes the names of all the output files, with spaces
7409 automatically placed around them.  You should write spaces
7410 around the @samp{%o} as well or the results are undefined.
7411 @samp{%o} is for use in the specs for running the linker.
7412 Input files whose names have no recognized suffix are not compiled
7413 at all, but they are included among the output files, so they will
7414 be linked.
7415
7416 @item %O
7417 Substitutes the suffix for object files.  Note that this is
7418 handled specially when it immediately follows @samp{%g, %u, or %U},
7419 because of the need for those to form complete file names.  The
7420 handling is such that @samp{%O} is treated exactly as if it had already
7421 been substituted, except that @samp{%g, %u, and %U} do not currently
7422 support additional @var{suffix} characters following @samp{%O} as they would
7423 following, for example, @samp{.o}.
7424
7425 @item %p
7426 Substitutes the standard macro predefinitions for the
7427 current target machine.  Use this when running @code{cpp}.
7428
7429 @item %P
7430 Like @samp{%p}, but puts @samp{__} before and after the name of each
7431 predefined macro, except for macros that start with @samp{__} or with
7432 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7433 C@.
7434
7435 @item %I
7436 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7437 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7438 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7439 and @option{-imultilib} as necessary.
7440
7441 @item %s
7442 Current argument is the name of a library or startup file of some sort.
7443 Search for that file in a standard list of directories and substitute
7444 the full name found.
7445
7446 @item %e@var{str}
7447 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7448 Use this when inconsistent options are detected.
7449
7450 @item %(@var{name})
7451 Substitute the contents of spec string @var{name} at this point.
7452
7453 @item %[@var{name}]
7454 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7455
7456 @item %x@{@var{option}@}
7457 Accumulate an option for @samp{%X}.
7458
7459 @item %X
7460 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7461 spec string.
7462
7463 @item %Y
7464 Output the accumulated assembler options specified by @option{-Wa}.
7465
7466 @item %Z
7467 Output the accumulated preprocessor options specified by @option{-Wp}.
7468
7469 @item %a
7470 Process the @code{asm} spec.  This is used to compute the
7471 switches to be passed to the assembler.
7472
7473 @item %A
7474 Process the @code{asm_final} spec.  This is a spec string for
7475 passing switches to an assembler post-processor, if such a program is
7476 needed.
7477
7478 @item %l
7479 Process the @code{link} spec.  This is the spec for computing the
7480 command line passed to the linker.  Typically it will make use of the
7481 @samp{%L %G %S %D and %E} sequences.
7482
7483 @item %D
7484 Dump out a @option{-L} option for each directory that GCC believes might
7485 contain startup files.  If the target supports multilibs then the
7486 current multilib directory will be prepended to each of these paths.
7487
7488 @item %L
7489 Process the @code{lib} spec.  This is a spec string for deciding which
7490 libraries should be included on the command line to the linker.
7491
7492 @item %G
7493 Process the @code{libgcc} spec.  This is a spec string for deciding
7494 which GCC support library should be included on the command line to the linker.
7495
7496 @item %S
7497 Process the @code{startfile} spec.  This is a spec for deciding which
7498 object files should be the first ones passed to the linker.  Typically
7499 this might be a file named @file{crt0.o}.
7500
7501 @item %E
7502 Process the @code{endfile} spec.  This is a spec string that specifies
7503 the last object files that will be passed to the linker.
7504
7505 @item %C
7506 Process the @code{cpp} spec.  This is used to construct the arguments
7507 to be passed to the C preprocessor.
7508
7509 @item %1
7510 Process the @code{cc1} spec.  This is used to construct the options to be
7511 passed to the actual C compiler (@samp{cc1}).
7512
7513 @item %2
7514 Process the @code{cc1plus} spec.  This is used to construct the options to be
7515 passed to the actual C++ compiler (@samp{cc1plus}).
7516
7517 @item %*
7518 Substitute the variable part of a matched option.  See below.
7519 Note that each comma in the substituted string is replaced by
7520 a single space.
7521
7522 @item %<@code{S}
7523 Remove all occurrences of @code{-S} from the command line.  Note---this
7524 command is position dependent.  @samp{%} commands in the spec string
7525 before this one will see @code{-S}, @samp{%} commands in the spec string
7526 after this one will not.
7527
7528 @item %:@var{function}(@var{args})
7529 Call the named function @var{function}, passing it @var{args}.
7530 @var{args} is first processed as a nested spec string, then split
7531 into an argument vector in the usual fashion.  The function returns
7532 a string which is processed as if it had appeared literally as part
7533 of the current spec.
7534
7535 The following built-in spec functions are provided:
7536
7537 @table @code
7538 @item @code{getenv}
7539 The @code{getenv} spec function takes two arguments: an environment
7540 variable name and a string.  If the environment variable is not
7541 defined, a fatal error is issued.  Otherwise, the return value is the
7542 value of the environment variable concatenated with the string.  For
7543 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
7544
7545 @smallexample
7546 %:getenv(TOPDIR /include)
7547 @end smallexample
7548
7549 expands to @file{/path/to/top/include}.
7550
7551 @item @code{if-exists}
7552 The @code{if-exists} spec function takes one argument, an absolute
7553 pathname to a file.  If the file exists, @code{if-exists} returns the
7554 pathname.  Here is a small example of its usage:
7555
7556 @smallexample
7557 *startfile:
7558 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7559 @end smallexample
7560
7561 @item @code{if-exists-else}
7562 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7563 spec function, except that it takes two arguments.  The first argument is
7564 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7565 returns the pathname.  If it does not exist, it returns the second argument.
7566 This way, @code{if-exists-else} can be used to select one file or another,
7567 based on the existence of the first.  Here is a small example of its usage:
7568
7569 @smallexample
7570 *startfile:
7571 crt0%O%s %:if-exists(crti%O%s) \
7572 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7573 @end smallexample
7574
7575 @item @code{replace-outfile}
7576 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7577 first argument in the outfiles array and replaces it with the second argument.  Here
7578 is a small example of its usage:
7579
7580 @smallexample
7581 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7582 @end smallexample
7583
7584 @end table
7585
7586 @item %@{@code{S}@}
7587 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7588 If that switch was not specified, this substitutes nothing.  Note that
7589 the leading dash is omitted when specifying this option, and it is
7590 automatically inserted if the substitution is performed.  Thus the spec
7591 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7592 and would output the command line option @option{-foo}.
7593
7594 @item %W@{@code{S}@}
7595 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7596 deleted on failure.
7597
7598 @item %@{@code{S}*@}
7599 Substitutes all the switches specified to GCC whose names start
7600 with @code{-S}, but which also take an argument.  This is used for
7601 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7602 GCC considers @option{-o foo} as being
7603 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7604 text, including the space.  Thus two arguments would be generated.
7605
7606 @item %@{@code{S}*&@code{T}*@}
7607 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7608 (the order of @code{S} and @code{T} in the spec is not significant).
7609 There can be any number of ampersand-separated variables; for each the
7610 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7611
7612 @item %@{@code{S}:@code{X}@}
7613 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7614
7615 @item %@{!@code{S}:@code{X}@}
7616 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7617
7618 @item %@{@code{S}*:@code{X}@}
7619 Substitutes @code{X} if one or more switches whose names start with
7620 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7621 once, no matter how many such switches appeared.  However, if @code{%*}
7622 appears somewhere in @code{X}, then @code{X} will be substituted once
7623 for each matching switch, with the @code{%*} replaced by the part of
7624 that switch that matched the @code{*}.
7625
7626 @item %@{.@code{S}:@code{X}@}
7627 Substitutes @code{X}, if processing a file with suffix @code{S}.
7628
7629 @item %@{!.@code{S}:@code{X}@}
7630 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7631
7632 @item %@{,@code{S}:@code{X}@}
7633 Substitutes @code{X}, if processing a file for language @code{S}.
7634
7635 @item %@{!,@code{S}:@code{X}@}
7636 Substitutes @code{X}, if not processing a file for language @code{S}.
7637
7638 @item %@{@code{S}|@code{P}:@code{X}@}
7639 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
7640 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
7641 @code{*} sequences as well, although they have a stronger binding than
7642 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
7643 alternatives must be starred, and only the first matching alternative
7644 is substituted.
7645
7646 For example, a spec string like this:
7647
7648 @smallexample
7649 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7650 @end smallexample
7651
7652 will output the following command-line options from the following input
7653 command-line options:
7654
7655 @smallexample
7656 fred.c        -foo -baz
7657 jim.d         -bar -boggle
7658 -d fred.c     -foo -baz -boggle
7659 -d jim.d      -bar -baz -boggle
7660 @end smallexample
7661
7662 @item %@{S:X; T:Y; :D@}
7663
7664 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7665 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7666 be as many clauses as you need.  This may be combined with @code{.},
7667 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
7668
7669
7670 @end table
7671
7672 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7673 construct may contain other nested @samp{%} constructs or spaces, or
7674 even newlines.  They are processed as usual, as described above.
7675 Trailing white space in @code{X} is ignored.  White space may also
7676 appear anywhere on the left side of the colon in these constructs,
7677 except between @code{.} or @code{*} and the corresponding word.
7678
7679 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7680 handled specifically in these constructs.  If another value of
7681 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7682 @option{-W} switch is found later in the command line, the earlier
7683 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7684 just one letter, which passes all matching options.
7685
7686 The character @samp{|} at the beginning of the predicate text is used to
7687 indicate that a command should be piped to the following command, but
7688 only if @option{-pipe} is specified.
7689
7690 It is built into GCC which switches take arguments and which do not.
7691 (You might think it would be useful to generalize this to allow each
7692 compiler's spec to say which switches take arguments.  But this cannot
7693 be done in a consistent fashion.  GCC cannot even decide which input
7694 files have been specified without knowing which switches take arguments,
7695 and it must know which input files to compile in order to tell which
7696 compilers to run).
7697
7698 GCC also knows implicitly that arguments starting in @option{-l} are to be
7699 treated as compiler output files, and passed to the linker in their
7700 proper position among the other output files.
7701
7702 @c man begin OPTIONS
7703
7704 @node Target Options
7705 @section Specifying Target Machine and Compiler Version
7706 @cindex target options
7707 @cindex cross compiling
7708 @cindex specifying machine version
7709 @cindex specifying compiler version and target machine
7710 @cindex compiler version, specifying
7711 @cindex target machine, specifying
7712
7713 The usual way to run GCC is to run the executable called @file{gcc}, or
7714 @file{<machine>-gcc} when cross-compiling, or
7715 @file{<machine>-gcc-<version>} to run a version other than the one that
7716 was installed last.  Sometimes this is inconvenient, so GCC provides
7717 options that will switch to another cross-compiler or version.
7718
7719 @table @gcctabopt
7720 @item -b @var{machine}
7721 @opindex b
7722 The argument @var{machine} specifies the target machine for compilation.
7723
7724 The value to use for @var{machine} is the same as was specified as the
7725 machine type when configuring GCC as a cross-compiler.  For
7726 example, if a cross-compiler was configured with @samp{configure
7727 arm-elf}, meaning to compile for an arm processor with elf binaries,
7728 then you would specify @option{-b arm-elf} to run that cross compiler.
7729 Because there are other options beginning with @option{-b}, the
7730 configuration must contain a hyphen.
7731
7732 @item -V @var{version}
7733 @opindex V
7734 The argument @var{version} specifies which version of GCC to run.
7735 This is useful when multiple versions are installed.  For example,
7736 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7737 @end table
7738
7739 The @option{-V} and @option{-b} options work by running the
7740 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7741 use them if you can just run that directly.
7742
7743 @node Submodel Options
7744 @section Hardware Models and Configurations
7745 @cindex submodel options
7746 @cindex specifying hardware config
7747 @cindex hardware models and configurations, specifying
7748 @cindex machine dependent options
7749
7750 Earlier we discussed the standard option @option{-b} which chooses among
7751 different installed compilers for completely different target
7752 machines, such as VAX vs.@: 68000 vs.@: 80386.
7753
7754 In addition, each of these target machine types can have its own
7755 special options, starting with @samp{-m}, to choose among various
7756 hardware models or configurations---for example, 68010 vs 68020,
7757 floating coprocessor or none.  A single installed version of the
7758 compiler can compile for any model or configuration, according to the
7759 options specified.
7760
7761 Some configurations of the compiler also support additional special
7762 options, usually for compatibility with other compilers on the same
7763 platform.
7764
7765 @c This list is ordered alphanumerically by subsection name.
7766 @c It should be the same order and spelling as these options are listed
7767 @c in Machine Dependent Options
7768
7769 @menu
7770 * ARC Options::
7771 * ARM Options::
7772 * AVR Options::
7773 * Blackfin Options::
7774 * CRIS Options::
7775 * CRX Options::
7776 * Darwin Options::
7777 * DEC Alpha Options::
7778 * DEC Alpha/VMS Options::
7779 * FRV Options::
7780 * GNU/Linux Options::
7781 * H8/300 Options::
7782 * HPPA Options::
7783 * i386 and x86-64 Options::
7784 * IA-64 Options::
7785 * M32C Options::
7786 * M32R/D Options::
7787 * M680x0 Options::
7788 * M68hc1x Options::
7789 * MCore Options::
7790 * MIPS Options::
7791 * MMIX Options::
7792 * MN10300 Options::
7793 * MT Options::
7794 * PDP-11 Options::
7795 * PowerPC Options::
7796 * RS/6000 and PowerPC Options::
7797 * S/390 and zSeries Options::
7798 * Score Options::
7799 * SH Options::
7800 * SPARC Options::
7801 * SPU Options::
7802 * System V Options::
7803 * TMS320C3x/C4x Options::
7804 * V850 Options::
7805 * VAX Options::
7806 * VxWorks Options::
7807 * x86-64 Options::
7808 * Xstormy16 Options::
7809 * Xtensa Options::
7810 * zSeries Options::
7811 @end menu
7812
7813 @node ARC Options
7814 @subsection ARC Options
7815 @cindex ARC Options
7816
7817 These options are defined for ARC implementations:
7818
7819 @table @gcctabopt
7820 @item -EL
7821 @opindex EL
7822 Compile code for little endian mode.  This is the default.
7823
7824 @item -EB
7825 @opindex EB
7826 Compile code for big endian mode.
7827
7828 @item -mmangle-cpu
7829 @opindex mmangle-cpu
7830 Prepend the name of the cpu to all public symbol names.
7831 In multiple-processor systems, there are many ARC variants with different
7832 instruction and register set characteristics.  This flag prevents code
7833 compiled for one cpu to be linked with code compiled for another.
7834 No facility exists for handling variants that are ``almost identical''.
7835 This is an all or nothing option.
7836
7837 @item -mcpu=@var{cpu}
7838 @opindex mcpu
7839 Compile code for ARC variant @var{cpu}.
7840 Which variants are supported depend on the configuration.
7841 All variants support @option{-mcpu=base}, this is the default.
7842
7843 @item -mtext=@var{text-section}
7844 @itemx -mdata=@var{data-section}
7845 @itemx -mrodata=@var{readonly-data-section}
7846 @opindex mtext
7847 @opindex mdata
7848 @opindex mrodata
7849 Put functions, data, and readonly data in @var{text-section},
7850 @var{data-section}, and @var{readonly-data-section} respectively
7851 by default.  This can be overridden with the @code{section} attribute.
7852 @xref{Variable Attributes}.
7853
7854 @end table
7855
7856 @node ARM Options
7857 @subsection ARM Options
7858 @cindex ARM options
7859
7860 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7861 architectures:
7862
7863 @table @gcctabopt
7864 @item -mabi=@var{name}
7865 @opindex mabi
7866 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7867 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
7868
7869 @item -mapcs-frame
7870 @opindex mapcs-frame
7871 Generate a stack frame that is compliant with the ARM Procedure Call
7872 Standard for all functions, even if this is not strictly necessary for
7873 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7874 with this option will cause the stack frames not to be generated for
7875 leaf functions.  The default is @option{-mno-apcs-frame}.
7876
7877 @item -mapcs
7878 @opindex mapcs
7879 This is a synonym for @option{-mapcs-frame}.
7880
7881 @ignore
7882 @c not currently implemented
7883 @item -mapcs-stack-check
7884 @opindex mapcs-stack-check
7885 Generate code to check the amount of stack space available upon entry to
7886 every function (that actually uses some stack space).  If there is
7887 insufficient space available then either the function
7888 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7889 called, depending upon the amount of stack space required.  The run time
7890 system is required to provide these functions.  The default is
7891 @option{-mno-apcs-stack-check}, since this produces smaller code.
7892
7893 @c not currently implemented
7894 @item -mapcs-float
7895 @opindex mapcs-float
7896 Pass floating point arguments using the float point registers.  This is
7897 one of the variants of the APCS@.  This option is recommended if the
7898 target hardware has a floating point unit or if a lot of floating point
7899 arithmetic is going to be performed by the code.  The default is
7900 @option{-mno-apcs-float}, since integer only code is slightly increased in
7901 size if @option{-mapcs-float} is used.
7902
7903 @c not currently implemented
7904 @item -mapcs-reentrant
7905 @opindex mapcs-reentrant
7906 Generate reentrant, position independent code.  The default is
7907 @option{-mno-apcs-reentrant}.
7908 @end ignore
7909
7910 @item -mthumb-interwork
7911 @opindex mthumb-interwork
7912 Generate code which supports calling between the ARM and Thumb
7913 instruction sets.  Without this option the two instruction sets cannot
7914 be reliably used inside one program.  The default is
7915 @option{-mno-thumb-interwork}, since slightly larger code is generated
7916 when @option{-mthumb-interwork} is specified.
7917
7918 @item -mno-sched-prolog
7919 @opindex mno-sched-prolog
7920 Prevent the reordering of instructions in the function prolog, or the
7921 merging of those instruction with the instructions in the function's
7922 body.  This means that all functions will start with a recognizable set
7923 of instructions (or in fact one of a choice from a small set of
7924 different function prologues), and this information can be used to
7925 locate the start if functions inside an executable piece of code.  The
7926 default is @option{-msched-prolog}.
7927
7928 @item -mhard-float
7929 @opindex mhard-float
7930 Generate output containing floating point instructions.  This is the
7931 default.
7932
7933 @item -msoft-float
7934 @opindex msoft-float
7935 Generate output containing library calls for floating point.
7936 @strong{Warning:} the requisite libraries are not available for all ARM
7937 targets.  Normally the facilities of the machine's usual C compiler are
7938 used, but this cannot be done directly in cross-compilation.  You must make
7939 your own arrangements to provide suitable library functions for
7940 cross-compilation.
7941
7942 @option{-msoft-float} changes the calling convention in the output file;
7943 therefore, it is only useful if you compile @emph{all} of a program with
7944 this option.  In particular, you need to compile @file{libgcc.a}, the
7945 library that comes with GCC, with @option{-msoft-float} in order for
7946 this to work.
7947
7948 @item -mfloat-abi=@var{name}
7949 @opindex mfloat-abi
7950 Specifies which ABI to use for floating point values.  Permissible values
7951 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7952
7953 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7954 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7955 of floating point instructions, but still uses the soft-float calling
7956 conventions.
7957
7958 @item -mlittle-endian
7959 @opindex mlittle-endian
7960 Generate code for a processor running in little-endian mode.  This is
7961 the default for all standard configurations.
7962
7963 @item -mbig-endian
7964 @opindex mbig-endian
7965 Generate code for a processor running in big-endian mode; the default is
7966 to compile code for a little-endian processor.
7967
7968 @item -mwords-little-endian
7969 @opindex mwords-little-endian
7970 This option only applies when generating code for big-endian processors.
7971 Generate code for a little-endian word order but a big-endian byte
7972 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7973 option should only be used if you require compatibility with code for
7974 big-endian ARM processors generated by versions of the compiler prior to
7975 2.8.
7976
7977 @item -mcpu=@var{name}
7978 @opindex mcpu
7979 This specifies the name of the target ARM processor.  GCC uses this name
7980 to determine what kind of instructions it can emit when generating
7981 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7982 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7983 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7984 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7985 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7986 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7987 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7988 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7989 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7990 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7991 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7992 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7993 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7994 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
7995 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
7996 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
7997
7998 @itemx -mtune=@var{name}
7999 @opindex mtune
8000 This option is very similar to the @option{-mcpu=} option, except that
8001 instead of specifying the actual target processor type, and hence
8002 restricting which instructions can be used, it specifies that GCC should
8003 tune the performance of the code as if the target were of the type
8004 specified in this option, but still choosing the instructions that it
8005 will generate based on the cpu specified by a @option{-mcpu=} option.
8006 For some ARM implementations better performance can be obtained by using
8007 this option.
8008
8009 @item -march=@var{name}
8010 @opindex march
8011 This specifies the name of the target ARM architecture.  GCC uses this
8012 name to determine what kind of instructions it can emit when generating
8013 assembly code.  This option can be used in conjunction with or instead
8014 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8015 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8016 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8017 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a},
8018 @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{ep9312}.
8019
8020 @item -mfpu=@var{name}
8021 @itemx -mfpe=@var{number}
8022 @itemx -mfp=@var{number}
8023 @opindex mfpu
8024 @opindex mfpe
8025 @opindex mfp
8026 This specifies what floating point hardware (or hardware emulation) is
8027 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8028 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
8029 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8030 with older versions of GCC@.
8031
8032 If @option{-msoft-float} is specified this specifies the format of
8033 floating point values.
8034
8035 @item -mstructure-size-boundary=@var{n}
8036 @opindex mstructure-size-boundary
8037 The size of all structures and unions will be rounded up to a multiple
8038 of the number of bits set by this option.  Permissible values are 8, 32
8039 and 64.  The default value varies for different toolchains.  For the COFF
8040 targeted toolchain the default value is 8.  A value of 64 is only allowed
8041 if the underlying ABI supports it.
8042
8043 Specifying the larger number can produce faster, more efficient code, but
8044 can also increase the size of the program.  Different values are potentially
8045 incompatible.  Code compiled with one value cannot necessarily expect to
8046 work with code or libraries compiled with another value, if they exchange
8047 information using structures or unions.
8048
8049 @item -mabort-on-noreturn
8050 @opindex mabort-on-noreturn
8051 Generate a call to the function @code{abort} at the end of a
8052 @code{noreturn} function.  It will be executed if the function tries to
8053 return.
8054
8055 @item -mlong-calls
8056 @itemx -mno-long-calls
8057 @opindex mlong-calls
8058 @opindex mno-long-calls
8059 Tells the compiler to perform function calls by first loading the
8060 address of the function into a register and then performing a subroutine
8061 call on this register.  This switch is needed if the target function
8062 will lie outside of the 64 megabyte addressing range of the offset based
8063 version of subroutine call instruction.
8064
8065 Even if this switch is enabled, not all function calls will be turned
8066 into long calls.  The heuristic is that static functions, functions
8067 which have the @samp{short-call} attribute, functions that are inside
8068 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8069 definitions have already been compiled within the current compilation
8070 unit, will not be turned into long calls.  The exception to this rule is
8071 that weak function definitions, functions with the @samp{long-call}
8072 attribute or the @samp{section} attribute, and functions that are within
8073 the scope of a @samp{#pragma long_calls} directive, will always be
8074 turned into long calls.
8075
8076 This feature is not enabled by default.  Specifying
8077 @option{-mno-long-calls} will restore the default behavior, as will
8078 placing the function calls within the scope of a @samp{#pragma
8079 long_calls_off} directive.  Note these switches have no effect on how
8080 the compiler generates code to handle function calls via function
8081 pointers.
8082
8083 @item -mnop-fun-dllimport
8084 @opindex mnop-fun-dllimport
8085 Disable support for the @code{dllimport} attribute.
8086
8087 @item -msingle-pic-base
8088 @opindex msingle-pic-base
8089 Treat the register used for PIC addressing as read-only, rather than
8090 loading it in the prologue for each function.  The run-time system is
8091 responsible for initializing this register with an appropriate value
8092 before execution begins.
8093
8094 @item -mpic-register=@var{reg}
8095 @opindex mpic-register
8096 Specify the register to be used for PIC addressing.  The default is R10
8097 unless stack-checking is enabled, when R9 is used.
8098
8099 @item -mcirrus-fix-invalid-insns
8100 @opindex mcirrus-fix-invalid-insns
8101 @opindex mno-cirrus-fix-invalid-insns
8102 Insert NOPs into the instruction stream to in order to work around
8103 problems with invalid Maverick instruction combinations.  This option
8104 is only valid if the @option{-mcpu=ep9312} option has been used to
8105 enable generation of instructions for the Cirrus Maverick floating
8106 point co-processor.  This option is not enabled by default, since the
8107 problem is only present in older Maverick implementations.  The default
8108 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8109 switch.
8110
8111 @item -mpoke-function-name
8112 @opindex mpoke-function-name
8113 Write the name of each function into the text section, directly
8114 preceding the function prologue.  The generated code is similar to this:
8115
8116 @smallexample
8117      t0
8118          .ascii "arm_poke_function_name", 0
8119          .align
8120      t1
8121          .word 0xff000000 + (t1 - t0)
8122      arm_poke_function_name
8123          mov     ip, sp
8124          stmfd   sp!, @{fp, ip, lr, pc@}
8125          sub     fp, ip, #4
8126 @end smallexample
8127
8128 When performing a stack backtrace, code can inspect the value of
8129 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8130 location @code{pc - 12} and the top 8 bits are set, then we know that
8131 there is a function name embedded immediately preceding this location
8132 and has length @code{((pc[-3]) & 0xff000000)}.
8133
8134 @item -mthumb
8135 @opindex mthumb
8136 Generate code for the Thumb instruction set.  The default is to
8137 use the 32-bit ARM instruction set.
8138 This option automatically enables either 16-bit Thumb-1 or
8139 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8140 and @option{-march=@var{name}} options.
8141
8142 @item -mtpcs-frame
8143 @opindex mtpcs-frame
8144 Generate a stack frame that is compliant with the Thumb Procedure Call
8145 Standard for all non-leaf functions.  (A leaf function is one that does
8146 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8147
8148 @item -mtpcs-leaf-frame
8149 @opindex mtpcs-leaf-frame
8150 Generate a stack frame that is compliant with the Thumb Procedure Call
8151 Standard for all leaf functions.  (A leaf function is one that does
8152 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8153
8154 @item -mcallee-super-interworking
8155 @opindex mcallee-super-interworking
8156 Gives all externally visible functions in the file being compiled an ARM
8157 instruction set header which switches to Thumb mode before executing the
8158 rest of the function.  This allows these functions to be called from
8159 non-interworking code.
8160
8161 @item -mcaller-super-interworking
8162 @opindex mcaller-super-interworking
8163 Allows calls via function pointers (including virtual functions) to
8164 execute correctly regardless of whether the target code has been
8165 compiled for interworking or not.  There is a small overhead in the cost
8166 of executing a function pointer if this option is enabled.
8167
8168 @item -mtp=@var{name}
8169 @opindex mtp
8170 Specify the access model for the thread local storage pointer.  The valid
8171 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8172 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8173 (supported in the arm6k architecture), and @option{auto}, which uses the
8174 best available method for the selected processor.  The default setting is
8175 @option{auto}.
8176
8177 @end table
8178
8179 @node AVR Options
8180 @subsection AVR Options
8181 @cindex AVR Options
8182
8183 These options are defined for AVR implementations:
8184
8185 @table @gcctabopt
8186 @item -mmcu=@var{mcu}
8187 @opindex mmcu
8188 Specify ATMEL AVR instruction set or MCU type.
8189
8190 Instruction set avr1 is for the minimal AVR core, not supported by the C
8191 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8192 attiny11, attiny12, attiny15, attiny28).
8193
8194 Instruction set avr2 (default) is for the classic AVR core with up to
8195 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8196 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8197 at90c8534, at90s8535).
8198
8199 Instruction set avr3 is for the classic AVR core with up to 128K program
8200 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8201
8202 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8203 memory space (MCU types: atmega8, atmega83, atmega85).
8204
8205 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8206 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8207 atmega64, atmega128, at43usb355, at94k).
8208
8209 @item -msize
8210 @opindex msize
8211 Output instruction sizes to the asm file.
8212
8213 @item -minit-stack=@var{N}
8214 @opindex minit-stack
8215 Specify the initial stack address, which may be a symbol or numeric value,
8216 @samp{__stack} is the default.
8217
8218 @item -mno-interrupts
8219 @opindex mno-interrupts
8220 Generated code is not compatible with hardware interrupts.
8221 Code size will be smaller.
8222
8223 @item -mcall-prologues
8224 @opindex mcall-prologues
8225 Functions prologues/epilogues expanded as call to appropriate
8226 subroutines.  Code size will be smaller.
8227
8228 @item -mno-tablejump
8229 @opindex mno-tablejump
8230 Do not generate tablejump insns which sometimes increase code size.
8231
8232 @item -mtiny-stack
8233 @opindex mtiny-stack
8234 Change only the low 8 bits of the stack pointer.
8235
8236 @item -mint8
8237 @opindex mint8
8238 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8239 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8240 and long long will be 4 bytes.  Please note that this option does not
8241 comply to the C standards, but it will provide you with smaller code
8242 size.
8243 @end table
8244
8245 @node Blackfin Options
8246 @subsection Blackfin Options
8247 @cindex Blackfin Options
8248
8249 @table @gcctabopt
8250 @item -momit-leaf-frame-pointer
8251 @opindex momit-leaf-frame-pointer
8252 Don't keep the frame pointer in a register for leaf functions.  This
8253 avoids the instructions to save, set up and restore frame pointers and
8254 makes an extra register available in leaf functions.  The option
8255 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8256 which might make debugging harder.
8257
8258 @item -mspecld-anomaly
8259 @opindex mspecld-anomaly
8260 When enabled, the compiler will ensure that the generated code does not
8261 contain speculative loads after jump instructions.  This option is enabled
8262 by default.
8263
8264 @item -mno-specld-anomaly
8265 @opindex mno-specld-anomaly
8266 Don't generate extra code to prevent speculative loads from occurring.
8267
8268 @item -mcsync-anomaly
8269 @opindex mcsync-anomaly
8270 When enabled, the compiler will ensure that the generated code does not
8271 contain CSYNC or SSYNC instructions too soon after conditional branches.
8272 This option is enabled by default.
8273
8274 @item -mno-csync-anomaly
8275 @opindex mno-csync-anomaly
8276 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8277 occurring too soon after a conditional branch.
8278
8279 @item -mlow-64k
8280 @opindex mlow-64k
8281 When enabled, the compiler is free to take advantage of the knowledge that
8282 the entire program fits into the low 64k of memory.
8283
8284 @item -mno-low-64k
8285 @opindex mno-low-64k
8286 Assume that the program is arbitrarily large.  This is the default.
8287
8288 @item -mstack-check-l1
8289 @opindex mstack-check-l1
8290 Do stack checking using information placed into L1 scratchpad memory by the
8291 uClinux kernel.
8292
8293 @item -mid-shared-library
8294 @opindex mid-shared-library
8295 Generate code that supports shared libraries via the library ID method.
8296 This allows for execute in place and shared libraries in an environment
8297 without virtual memory management.  This option implies @option{-fPIC}.
8298
8299 @item -mno-id-shared-library
8300 @opindex mno-id-shared-library
8301 Generate code that doesn't assume ID based shared libraries are being used.
8302 This is the default.
8303
8304 @item -mleaf-id-shared-library
8305 @opindex mleaf-id-shared-library
8306 Generate code that supports shared libraries via the library ID method,
8307 but assumes that this library or executable won't link against any other
8308 ID shared libraries.  That allows the compiler to use faster code for jumps
8309 and calls.
8310
8311 @item -mno-leaf-id-shared-library
8312 @opindex mno-leaf-id-shared-library
8313 Do not assume that the code being compiled won't link against any ID shared
8314 libraries.  Slower code will be generated for jump and call insns.
8315
8316 @item -mshared-library-id=n
8317 @opindex mshared-library-id
8318 Specified the identification number of the ID based shared library being
8319 compiled.  Specifying a value of 0 will generate more compact code, specifying
8320 other values will force the allocation of that number to the current
8321 library but is no more space or time efficient than omitting this option.
8322
8323 @item -msep-data
8324 @opindex msep-data
8325 Generate code that allows the data segment to be located in a different
8326 area of memory from the text segment.  This allows for execute in place in
8327 an environment without virtual memory management by eliminating relocations
8328 against the text section.
8329
8330 @item -mno-sep-data
8331 @opindex mno-sep-data
8332 Generate code that assumes that the data segment follows the text segment.
8333 This is the default.
8334
8335 @item -mlong-calls
8336 @itemx -mno-long-calls
8337 @opindex mlong-calls
8338 @opindex mno-long-calls
8339 Tells the compiler to perform function calls by first loading the
8340 address of the function into a register and then performing a subroutine
8341 call on this register.  This switch is needed if the target function
8342 will lie outside of the 24 bit addressing range of the offset based
8343 version of subroutine call instruction.
8344
8345 This feature is not enabled by default.  Specifying
8346 @option{-mno-long-calls} will restore the default behavior.  Note these
8347 switches have no effect on how the compiler generates code to handle
8348 function calls via function pointers.
8349 @end table
8350
8351 @node CRIS Options
8352 @subsection CRIS Options
8353 @cindex CRIS Options
8354
8355 These options are defined specifically for the CRIS ports.
8356
8357 @table @gcctabopt
8358 @item -march=@var{architecture-type}
8359 @itemx -mcpu=@var{architecture-type}
8360 @opindex march
8361 @opindex mcpu
8362 Generate code for the specified architecture.  The choices for
8363 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8364 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8365 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8366 @samp{v10}.
8367
8368 @item -mtune=@var{architecture-type}
8369 @opindex mtune
8370 Tune to @var{architecture-type} everything applicable about the generated
8371 code, except for the ABI and the set of available instructions.  The
8372 choices for @var{architecture-type} are the same as for
8373 @option{-march=@var{architecture-type}}.
8374
8375 @item -mmax-stack-frame=@var{n}
8376 @opindex mmax-stack-frame
8377 Warn when the stack frame of a function exceeds @var{n} bytes.
8378
8379 @item -melinux-stacksize=@var{n}
8380 @opindex melinux-stacksize
8381 Only available with the @samp{cris-axis-aout} target.  Arranges for
8382 indications in the program to the kernel loader that the stack of the
8383 program should be set to @var{n} bytes.
8384
8385 @item -metrax4
8386 @itemx -metrax100
8387 @opindex metrax4
8388 @opindex metrax100
8389 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8390 @option{-march=v3} and @option{-march=v8} respectively.
8391
8392 @item -mmul-bug-workaround
8393 @itemx -mno-mul-bug-workaround
8394 @opindex mmul-bug-workaround
8395 @opindex mno-mul-bug-workaround
8396 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8397 models where it applies.  This option is active by default.
8398
8399 @item -mpdebug
8400 @opindex mpdebug
8401 Enable CRIS-specific verbose debug-related information in the assembly
8402 code.  This option also has the effect to turn off the @samp{#NO_APP}
8403 formatted-code indicator to the assembler at the beginning of the
8404 assembly file.
8405
8406 @item -mcc-init
8407 @opindex mcc-init
8408 Do not use condition-code results from previous instruction; always emit
8409 compare and test instructions before use of condition codes.
8410
8411 @item -mno-side-effects
8412 @opindex mno-side-effects
8413 Do not emit instructions with side-effects in addressing modes other than
8414 post-increment.
8415
8416 @item -mstack-align
8417 @itemx -mno-stack-align
8418 @itemx -mdata-align
8419 @itemx -mno-data-align
8420 @itemx -mconst-align
8421 @itemx -mno-const-align
8422 @opindex mstack-align
8423 @opindex mno-stack-align
8424 @opindex mdata-align
8425 @opindex mno-data-align
8426 @opindex mconst-align
8427 @opindex mno-const-align
8428 These options (no-options) arranges (eliminate arrangements) for the
8429 stack-frame, individual data and constants to be aligned for the maximum
8430 single data access size for the chosen CPU model.  The default is to
8431 arrange for 32-bit alignment.  ABI details such as structure layout are
8432 not affected by these options.
8433
8434 @item -m32-bit
8435 @itemx -m16-bit
8436 @itemx -m8-bit
8437 @opindex m32-bit
8438 @opindex m16-bit
8439 @opindex m8-bit
8440 Similar to the stack- data- and const-align options above, these options
8441 arrange for stack-frame, writable data and constants to all be 32-bit,
8442 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8443
8444 @item -mno-prologue-epilogue
8445 @itemx -mprologue-epilogue
8446 @opindex mno-prologue-epilogue
8447 @opindex mprologue-epilogue
8448 With @option{-mno-prologue-epilogue}, the normal function prologue and
8449 epilogue that sets up the stack-frame are omitted and no return
8450 instructions or return sequences are generated in the code.  Use this
8451 option only together with visual inspection of the compiled code: no
8452 warnings or errors are generated when call-saved registers must be saved,
8453 or storage for local variable needs to be allocated.
8454
8455 @item -mno-gotplt
8456 @itemx -mgotplt
8457 @opindex mno-gotplt
8458 @opindex mgotplt
8459 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8460 instruction sequences that load addresses for functions from the PLT part
8461 of the GOT rather than (traditional on other architectures) calls to the
8462 PLT@.  The default is @option{-mgotplt}.
8463
8464 @item -maout
8465 @opindex maout
8466 Legacy no-op option only recognized with the cris-axis-aout target.
8467
8468 @item -melf
8469 @opindex melf
8470 Legacy no-op option only recognized with the cris-axis-elf and
8471 cris-axis-linux-gnu targets.
8472
8473 @item -melinux
8474 @opindex melinux
8475 Only recognized with the cris-axis-aout target, where it selects a
8476 GNU/linux-like multilib, include files and instruction set for
8477 @option{-march=v8}.
8478
8479 @item -mlinux
8480 @opindex mlinux
8481 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8482
8483 @item -sim
8484 @opindex sim
8485 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8486 to link with input-output functions from a simulator library.  Code,
8487 initialized data and zero-initialized data are allocated consecutively.
8488
8489 @item -sim2
8490 @opindex sim2
8491 Like @option{-sim}, but pass linker options to locate initialized data at
8492 0x40000000 and zero-initialized data at 0x80000000.
8493 @end table
8494
8495 @node CRX Options
8496 @subsection CRX Options
8497 @cindex CRX Options
8498
8499 These options are defined specifically for the CRX ports.
8500
8501 @table @gcctabopt
8502
8503 @item -mmac
8504 @opindex mmac
8505 Enable the use of multiply-accumulate instructions. Disabled by default.
8506
8507 @item -mpush-args
8508 @opindex mpush-args
8509 Push instructions will be used to pass outgoing arguments when functions
8510 are called. Enabled by default.
8511 @end table
8512
8513 @node Darwin Options
8514 @subsection Darwin Options
8515 @cindex Darwin options
8516
8517 These options are defined for all architectures running the Darwin operating
8518 system.
8519
8520 FSF GCC on Darwin does not create ``fat'' object files; it will create
8521 an object file for the single architecture that it was built to
8522 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8523 @option{-arch} options are used; it does so by running the compiler or
8524 linker multiple times and joining the results together with
8525 @file{lipo}.
8526
8527 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8528 @samp{i686}) is determined by the flags that specify the ISA
8529 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8530 @option{-force_cpusubtype_ALL} option can be used to override this.
8531
8532 The Darwin tools vary in their behavior when presented with an ISA
8533 mismatch.  The assembler, @file{as}, will only permit instructions to
8534 be used that are valid for the subtype of the file it is generating,
8535 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8536 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8537 and print an error if asked to create a shared library with a less
8538 restrictive subtype than its input files (for instance, trying to put
8539 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8540 for executables, @file{ld}, will quietly give the executable the most
8541 restrictive subtype of any of its input files.
8542
8543 @table @gcctabopt
8544 @item -F@var{dir}
8545 @opindex F
8546 Add the framework directory @var{dir} to the head of the list of
8547 directories to be searched for header files.  These directories are
8548 interleaved with those specified by @option{-I} options and are
8549 scanned in a left-to-right order.
8550
8551 A framework directory is a directory with frameworks in it.  A
8552 framework is a directory with a @samp{"Headers"} and/or
8553 @samp{"PrivateHeaders"} directory contained directly in it that ends
8554 in @samp{".framework"}.  The name of a framework is the name of this
8555 directory excluding the @samp{".framework"}.  Headers associated with
8556 the framework are found in one of those two directories, with
8557 @samp{"Headers"} being searched first.  A subframework is a framework
8558 directory that is in a framework's @samp{"Frameworks"} directory.
8559 Includes of subframework headers can only appear in a header of a
8560 framework that contains the subframework, or in a sibling subframework
8561 header.  Two subframeworks are siblings if they occur in the same
8562 framework.  A subframework should not have the same name as a
8563 framework, a warning will be issued if this is violated.  Currently a
8564 subframework cannot have subframeworks, in the future, the mechanism
8565 may be extended to support this.  The standard frameworks can be found
8566 in @samp{"/System/Library/Frameworks"} and
8567 @samp{"/Library/Frameworks"}.  An example include looks like
8568 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8569 the name of the framework and header.h is found in the
8570 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8571
8572 @item -iframework@var{dir}
8573 @opindex iframework
8574 Like @option{-F} except the directory is a treated as a system
8575 directory.  The main difference between this @option{-iframework} and
8576 @option{-F} is that with @option{-iframework} the compiler does not
8577 warn about constructs contained within header files found via
8578 @var{dir}.  This option is valid only for the C family of languages.
8579
8580 @item -gused
8581 @opindex -gused
8582 Emit debugging information for symbols that are used.  For STABS
8583 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8584 This is by default ON@.
8585
8586 @item -gfull
8587 @opindex -gfull
8588 Emit debugging information for all symbols and types.
8589
8590 @item -mmacosx-version-min=@var{version}
8591 The earliest version of MacOS X that this executable will run on
8592 is @var{version}.  Typical values of @var{version} include @code{10.1},
8593 @code{10.2}, and @code{10.3.9}.
8594
8595 The default for this option is to make choices that seem to be most
8596 useful.
8597
8598 @item -mkernel
8599 @opindex mkernel
8600 Enable kernel development mode.  The @option{-mkernel} option sets
8601 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8602 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8603 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8604 applicable.  This mode also sets @option{-mno-altivec},
8605 @option{-msoft-float}, @option{-fno-builtin} and
8606 @option{-mlong-branch} for PowerPC targets.
8607
8608 @item -mone-byte-bool
8609 @opindex -mone-byte-bool
8610 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8611 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8612 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8613 option has no effect on x86.
8614
8615 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8616 to generate code that is not binary compatible with code generated
8617 without that switch.  Using this switch may require recompiling all
8618 other modules in a program, including system libraries.  Use this
8619 switch to conform to a non-default data model.
8620
8621 @item -mfix-and-continue
8622 @itemx -ffix-and-continue
8623 @itemx -findirect-data
8624 @opindex mfix-and-continue
8625 @opindex ffix-and-continue
8626 @opindex findirect-data
8627 Generate code suitable for fast turn around development.  Needed to
8628 enable gdb to dynamically load @code{.o} files into already running
8629 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8630 are provided for backwards compatibility.
8631
8632 @item -all_load
8633 @opindex all_load
8634 Loads all members of static archive libraries.
8635 See man ld(1) for more information.
8636
8637 @item -arch_errors_fatal
8638 @opindex arch_errors_fatal
8639 Cause the errors having to do with files that have the wrong architecture
8640 to be fatal.
8641
8642 @item -bind_at_load
8643 @opindex bind_at_load
8644 Causes the output file to be marked such that the dynamic linker will
8645 bind all undefined references when the file is loaded or launched.
8646
8647 @item -bundle
8648 @opindex bundle
8649 Produce a Mach-o bundle format file.
8650 See man ld(1) for more information.
8651
8652 @item -bundle_loader @var{executable}
8653 @opindex bundle_loader
8654 This option specifies the @var{executable} that will be loading the build
8655 output file being linked.  See man ld(1) for more information.
8656
8657 @item -dynamiclib
8658 @opindex -dynamiclib
8659 When passed this option, GCC will produce a dynamic library instead of
8660 an executable when linking, using the Darwin @file{libtool} command.
8661
8662 @item -force_cpusubtype_ALL
8663 @opindex -force_cpusubtype_ALL
8664 This causes GCC's output file to have the @var{ALL} subtype, instead of
8665 one controlled by the @option{-mcpu} or @option{-march} option.
8666
8667 @item -allowable_client  @var{client_name}
8668 @itemx -client_name
8669 @itemx -compatibility_version
8670 @itemx -current_version
8671 @itemx -dead_strip
8672 @itemx -dependency-file
8673 @itemx -dylib_file
8674 @itemx -dylinker_install_name
8675 @itemx -dynamic
8676 @itemx -exported_symbols_list
8677 @itemx -filelist
8678 @itemx -flat_namespace
8679 @itemx -force_flat_namespace
8680 @itemx -headerpad_max_install_names
8681 @itemx -image_base
8682 @itemx -init
8683 @itemx -install_name
8684 @itemx -keep_private_externs
8685 @itemx -multi_module
8686 @itemx -multiply_defined
8687 @itemx -multiply_defined_unused
8688 @itemx -noall_load
8689 @itemx -no_dead_strip_inits_and_terms
8690 @itemx -nofixprebinding
8691 @itemx -nomultidefs
8692 @itemx -noprebind
8693 @itemx -noseglinkedit
8694 @itemx -pagezero_size
8695 @itemx -prebind
8696 @itemx -prebind_all_twolevel_modules
8697 @itemx -private_bundle
8698 @itemx -read_only_relocs
8699 @itemx -sectalign
8700 @itemx -sectobjectsymbols
8701 @itemx -whyload
8702 @itemx -seg1addr
8703 @itemx -sectcreate
8704 @itemx -sectobjectsymbols
8705 @itemx -sectorder
8706 @itemx -segaddr
8707 @itemx -segs_read_only_addr
8708 @itemx -segs_read_write_addr
8709 @itemx -seg_addr_table
8710 @itemx -seg_addr_table_filename
8711 @itemx -seglinkedit
8712 @itemx -segprot
8713 @itemx -segs_read_only_addr
8714 @itemx -segs_read_write_addr
8715 @itemx -single_module
8716 @itemx -static
8717 @itemx -sub_library
8718 @itemx -sub_umbrella
8719 @itemx -twolevel_namespace
8720 @itemx -umbrella
8721 @itemx -undefined
8722 @itemx -unexported_symbols_list
8723 @itemx -weak_reference_mismatches
8724 @itemx -whatsloaded
8725
8726 @opindex allowable_client
8727 @opindex client_name
8728 @opindex compatibility_version
8729 @opindex current_version
8730 @opindex dead_strip
8731 @opindex dependency-file
8732 @opindex dylib_file
8733 @opindex dylinker_install_name
8734 @opindex dynamic
8735 @opindex exported_symbols_list
8736 @opindex filelist
8737 @opindex flat_namespace
8738 @opindex force_flat_namespace
8739 @opindex headerpad_max_install_names
8740 @opindex image_base
8741 @opindex init
8742 @opindex install_name
8743 @opindex keep_private_externs
8744 @opindex multi_module
8745 @opindex multiply_defined
8746 @opindex multiply_defined_unused
8747 @opindex noall_load
8748 @opindex no_dead_strip_inits_and_terms
8749 @opindex nofixprebinding
8750 @opindex nomultidefs
8751 @opindex noprebind
8752 @opindex noseglinkedit
8753 @opindex pagezero_size
8754 @opindex prebind
8755 @opindex prebind_all_twolevel_modules
8756 @opindex private_bundle
8757 @opindex read_only_relocs
8758 @opindex sectalign
8759 @opindex sectobjectsymbols
8760 @opindex whyload
8761 @opindex seg1addr
8762 @opindex sectcreate
8763 @opindex sectobjectsymbols
8764 @opindex sectorder
8765 @opindex segaddr
8766 @opindex segs_read_only_addr
8767 @opindex segs_read_write_addr
8768 @opindex seg_addr_table
8769 @opindex seg_addr_table_filename
8770 @opindex seglinkedit
8771 @opindex segprot
8772 @opindex segs_read_only_addr
8773 @opindex segs_read_write_addr
8774 @opindex single_module
8775 @opindex static
8776 @opindex sub_library
8777 @opindex sub_umbrella
8778 @opindex twolevel_namespace
8779 @opindex umbrella
8780 @opindex undefined
8781 @opindex unexported_symbols_list
8782 @opindex weak_reference_mismatches
8783 @opindex whatsloaded
8784
8785 These options are passed to the Darwin linker.  The Darwin linker man page
8786 describes them in detail.
8787 @end table
8788
8789 @node DEC Alpha Options
8790 @subsection DEC Alpha Options
8791
8792 These @samp{-m} options are defined for the DEC Alpha implementations:
8793
8794 @table @gcctabopt
8795 @item -mno-soft-float
8796 @itemx -msoft-float
8797 @opindex mno-soft-float
8798 @opindex msoft-float
8799 Use (do not use) the hardware floating-point instructions for
8800 floating-point operations.  When @option{-msoft-float} is specified,
8801 functions in @file{libgcc.a} will be used to perform floating-point
8802 operations.  Unless they are replaced by routines that emulate the
8803 floating-point operations, or compiled in such a way as to call such
8804 emulations routines, these routines will issue floating-point
8805 operations.   If you are compiling for an Alpha without floating-point
8806 operations, you must ensure that the library is built so as not to call
8807 them.
8808
8809 Note that Alpha implementations without floating-point operations are
8810 required to have floating-point registers.
8811
8812 @item -mfp-reg
8813 @itemx -mno-fp-regs
8814 @opindex mfp-reg
8815 @opindex mno-fp-regs
8816 Generate code that uses (does not use) the floating-point register set.
8817 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8818 register set is not used, floating point operands are passed in integer
8819 registers as if they were integers and floating-point results are passed
8820 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8821 so any function with a floating-point argument or return value called by code
8822 compiled with @option{-mno-fp-regs} must also be compiled with that
8823 option.
8824
8825 A typical use of this option is building a kernel that does not use,
8826 and hence need not save and restore, any floating-point registers.
8827
8828 @item -mieee
8829 @opindex mieee
8830 The Alpha architecture implements floating-point hardware optimized for
8831 maximum performance.  It is mostly compliant with the IEEE floating
8832 point standard.  However, for full compliance, software assistance is
8833 required.  This option generates code fully IEEE compliant code
8834 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8835 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8836 defined during compilation.  The resulting code is less efficient but is
8837 able to correctly support denormalized numbers and exceptional IEEE
8838 values such as not-a-number and plus/minus infinity.  Other Alpha
8839 compilers call this option @option{-ieee_with_no_inexact}.
8840
8841 @item -mieee-with-inexact
8842 @opindex mieee-with-inexact
8843 This is like @option{-mieee} except the generated code also maintains
8844 the IEEE @var{inexact-flag}.  Turning on this option causes the
8845 generated code to implement fully-compliant IEEE math.  In addition to
8846 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8847 macro.  On some Alpha implementations the resulting code may execute
8848 significantly slower than the code generated by default.  Since there is
8849 very little code that depends on the @var{inexact-flag}, you should
8850 normally not specify this option.  Other Alpha compilers call this
8851 option @option{-ieee_with_inexact}.
8852
8853 @item -mfp-trap-mode=@var{trap-mode}
8854 @opindex mfp-trap-mode
8855 This option controls what floating-point related traps are enabled.
8856 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8857 The trap mode can be set to one of four values:
8858
8859 @table @samp
8860 @item n
8861 This is the default (normal) setting.  The only traps that are enabled
8862 are the ones that cannot be disabled in software (e.g., division by zero
8863 trap).
8864
8865 @item u
8866 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8867 as well.
8868
8869 @item su
8870 Like @samp{u}, but the instructions are marked to be safe for software
8871 completion (see Alpha architecture manual for details).
8872
8873 @item sui
8874 Like @samp{su}, but inexact traps are enabled as well.
8875 @end table
8876
8877 @item -mfp-rounding-mode=@var{rounding-mode}
8878 @opindex mfp-rounding-mode
8879 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8880 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8881 of:
8882
8883 @table @samp
8884 @item n
8885 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8886 the nearest machine number or towards the even machine number in case
8887 of a tie.
8888
8889 @item m
8890 Round towards minus infinity.
8891
8892 @item c
8893 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8894
8895 @item d
8896 Dynamic rounding mode.  A field in the floating point control register
8897 (@var{fpcr}, see Alpha architecture reference manual) controls the
8898 rounding mode in effect.  The C library initializes this register for
8899 rounding towards plus infinity.  Thus, unless your program modifies the
8900 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8901 @end table
8902
8903 @item -mtrap-precision=@var{trap-precision}
8904 @opindex mtrap-precision
8905 In the Alpha architecture, floating point traps are imprecise.  This
8906 means without software assistance it is impossible to recover from a
8907 floating trap and program execution normally needs to be terminated.
8908 GCC can generate code that can assist operating system trap handlers
8909 in determining the exact location that caused a floating point trap.
8910 Depending on the requirements of an application, different levels of
8911 precisions can be selected:
8912
8913 @table @samp
8914 @item p
8915 Program precision.  This option is the default and means a trap handler
8916 can only identify which program caused a floating point exception.
8917
8918 @item f
8919 Function precision.  The trap handler can determine the function that
8920 caused a floating point exception.
8921
8922 @item i
8923 Instruction precision.  The trap handler can determine the exact
8924 instruction that caused a floating point exception.
8925 @end table
8926
8927 Other Alpha compilers provide the equivalent options called
8928 @option{-scope_safe} and @option{-resumption_safe}.
8929
8930 @item -mieee-conformant
8931 @opindex mieee-conformant
8932 This option marks the generated code as IEEE conformant.  You must not
8933 use this option unless you also specify @option{-mtrap-precision=i} and either
8934 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8935 is to emit the line @samp{.eflag 48} in the function prologue of the
8936 generated assembly file.  Under DEC Unix, this has the effect that
8937 IEEE-conformant math library routines will be linked in.
8938
8939 @item -mbuild-constants
8940 @opindex mbuild-constants
8941 Normally GCC examines a 32- or 64-bit integer constant to
8942 see if it can construct it from smaller constants in two or three
8943 instructions.  If it cannot, it will output the constant as a literal and
8944 generate code to load it from the data segment at runtime.
8945
8946 Use this option to require GCC to construct @emph{all} integer constants
8947 using code, even if it takes more instructions (the maximum is six).
8948
8949 You would typically use this option to build a shared library dynamic
8950 loader.  Itself a shared library, it must relocate itself in memory
8951 before it can find the variables and constants in its own data segment.
8952
8953 @item -malpha-as
8954 @itemx -mgas
8955 @opindex malpha-as
8956 @opindex mgas
8957 Select whether to generate code to be assembled by the vendor-supplied
8958 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8959
8960 @item -mbwx
8961 @itemx -mno-bwx
8962 @itemx -mcix
8963 @itemx -mno-cix
8964 @itemx -mfix
8965 @itemx -mno-fix
8966 @itemx -mmax
8967 @itemx -mno-max
8968 @opindex mbwx
8969 @opindex mno-bwx
8970 @opindex mcix
8971 @opindex mno-cix
8972 @opindex mfix
8973 @opindex mno-fix
8974 @opindex mmax
8975 @opindex mno-max
8976 Indicate whether GCC should generate code to use the optional BWX,
8977 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8978 sets supported by the CPU type specified via @option{-mcpu=} option or that
8979 of the CPU on which GCC was built if none was specified.
8980
8981 @item -mfloat-vax
8982 @itemx -mfloat-ieee
8983 @opindex mfloat-vax
8984 @opindex mfloat-ieee
8985 Generate code that uses (does not use) VAX F and G floating point
8986 arithmetic instead of IEEE single and double precision.
8987
8988 @item -mexplicit-relocs
8989 @itemx -mno-explicit-relocs
8990 @opindex mexplicit-relocs
8991 @opindex mno-explicit-relocs
8992 Older Alpha assemblers provided no way to generate symbol relocations
8993 except via assembler macros.  Use of these macros does not allow
8994 optimal instruction scheduling.  GNU binutils as of version 2.12
8995 supports a new syntax that allows the compiler to explicitly mark
8996 which relocations should apply to which instructions.  This option
8997 is mostly useful for debugging, as GCC detects the capabilities of
8998 the assembler when it is built and sets the default accordingly.
8999
9000 @item -msmall-data
9001 @itemx -mlarge-data
9002 @opindex msmall-data
9003 @opindex mlarge-data
9004 When @option{-mexplicit-relocs} is in effect, static data is
9005 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9006 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9007 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9008 16-bit relocations off of the @code{$gp} register.  This limits the
9009 size of the small data area to 64KB, but allows the variables to be
9010 directly accessed via a single instruction.
9011
9012 The default is @option{-mlarge-data}.  With this option the data area
9013 is limited to just below 2GB@.  Programs that require more than 2GB of
9014 data must use @code{malloc} or @code{mmap} to allocate the data in the
9015 heap instead of in the program's data segment.
9016
9017 When generating code for shared libraries, @option{-fpic} implies
9018 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9019
9020 @item -msmall-text
9021 @itemx -mlarge-text
9022 @opindex msmall-text
9023 @opindex mlarge-text
9024 When @option{-msmall-text} is used, the compiler assumes that the
9025 code of the entire program (or shared library) fits in 4MB, and is
9026 thus reachable with a branch instruction.  When @option{-msmall-data}
9027 is used, the compiler can assume that all local symbols share the
9028 same @code{$gp} value, and thus reduce the number of instructions
9029 required for a function call from 4 to 1.
9030
9031 The default is @option{-mlarge-text}.
9032
9033 @item -mcpu=@var{cpu_type}
9034 @opindex mcpu
9035 Set the instruction set and instruction scheduling parameters for
9036 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9037 style name or the corresponding chip number.  GCC supports scheduling
9038 parameters for the EV4, EV5 and EV6 family of processors and will
9039 choose the default values for the instruction set from the processor
9040 you specify.  If you do not specify a processor type, GCC will default
9041 to the processor on which the compiler was built.
9042
9043 Supported values for @var{cpu_type} are
9044
9045 @table @samp
9046 @item ev4
9047 @itemx ev45
9048 @itemx 21064
9049 Schedules as an EV4 and has no instruction set extensions.
9050
9051 @item ev5
9052 @itemx 21164
9053 Schedules as an EV5 and has no instruction set extensions.
9054
9055 @item ev56
9056 @itemx 21164a
9057 Schedules as an EV5 and supports the BWX extension.
9058
9059 @item pca56
9060 @itemx 21164pc
9061 @itemx 21164PC
9062 Schedules as an EV5 and supports the BWX and MAX extensions.
9063
9064 @item ev6
9065 @itemx 21264
9066 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9067
9068 @item ev67
9069 @itemx 21264a
9070 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9071 @end table
9072
9073 @item -mtune=@var{cpu_type}
9074 @opindex mtune
9075 Set only the instruction scheduling parameters for machine type
9076 @var{cpu_type}.  The instruction set is not changed.
9077
9078 @item -mmemory-latency=@var{time}
9079 @opindex mmemory-latency
9080 Sets the latency the scheduler should assume for typical memory
9081 references as seen by the application.  This number is highly
9082 dependent on the memory access patterns used by the application
9083 and the size of the external cache on the machine.
9084
9085 Valid options for @var{time} are
9086
9087 @table @samp
9088 @item @var{number}
9089 A decimal number representing clock cycles.
9090
9091 @item L1
9092 @itemx L2
9093 @itemx L3
9094 @itemx main
9095 The compiler contains estimates of the number of clock cycles for
9096 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9097 (also called Dcache, Scache, and Bcache), as well as to main memory.
9098 Note that L3 is only valid for EV5.
9099
9100 @end table
9101 @end table
9102
9103 @node DEC Alpha/VMS Options
9104 @subsection DEC Alpha/VMS Options
9105
9106 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9107
9108 @table @gcctabopt
9109 @item -mvms-return-codes
9110 @opindex mvms-return-codes
9111 Return VMS condition codes from main.  The default is to return POSIX
9112 style condition (e.g.@ error) codes.
9113 @end table
9114
9115 @node FRV Options
9116 @subsection FRV Options
9117 @cindex FRV Options
9118
9119 @table @gcctabopt
9120 @item -mgpr-32
9121 @opindex mgpr-32
9122
9123 Only use the first 32 general purpose registers.
9124
9125 @item -mgpr-64
9126 @opindex mgpr-64
9127
9128 Use all 64 general purpose registers.
9129
9130 @item -mfpr-32
9131 @opindex mfpr-32
9132
9133 Use only the first 32 floating point registers.
9134
9135 @item -mfpr-64
9136 @opindex mfpr-64
9137
9138 Use all 64 floating point registers
9139
9140 @item -mhard-float
9141 @opindex mhard-float
9142
9143 Use hardware instructions for floating point operations.
9144
9145 @item -msoft-float
9146 @opindex msoft-float
9147
9148 Use library routines for floating point operations.
9149
9150 @item -malloc-cc
9151 @opindex malloc-cc
9152
9153 Dynamically allocate condition code registers.
9154
9155 @item -mfixed-cc
9156 @opindex mfixed-cc
9157
9158 Do not try to dynamically allocate condition code registers, only
9159 use @code{icc0} and @code{fcc0}.
9160
9161 @item -mdword
9162 @opindex mdword
9163
9164 Change ABI to use double word insns.
9165
9166 @item -mno-dword
9167 @opindex mno-dword
9168
9169 Do not use double word instructions.
9170
9171 @item -mdouble
9172 @opindex mdouble
9173
9174 Use floating point double instructions.
9175
9176 @item -mno-double
9177 @opindex mno-double
9178
9179 Do not use floating point double instructions.
9180
9181 @item -mmedia
9182 @opindex mmedia
9183
9184 Use media instructions.
9185
9186 @item -mno-media
9187 @opindex mno-media
9188
9189 Do not use media instructions.
9190
9191 @item -mmuladd
9192 @opindex mmuladd
9193
9194 Use multiply and add/subtract instructions.
9195
9196 @item -mno-muladd
9197 @opindex mno-muladd
9198
9199 Do not use multiply and add/subtract instructions.
9200
9201 @item -mfdpic
9202 @opindex mfdpic
9203
9204 Select the FDPIC ABI, that uses function descriptors to represent
9205 pointers to functions.  Without any PIC/PIE-related options, it
9206 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
9207 assumes GOT entries and small data are within a 12-bit range from the
9208 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
9209 are computed with 32 bits.
9210
9211 @item -minline-plt
9212 @opindex minline-plt
9213
9214 Enable inlining of PLT entries in function calls to functions that are
9215 not known to bind locally.  It has no effect without @option{-mfdpic}.
9216 It's enabled by default if optimizing for speed and compiling for
9217 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
9218 optimization option such as @option{-O3} or above is present in the
9219 command line.
9220
9221 @item -mTLS
9222 @opindex TLS
9223
9224 Assume a large TLS segment when generating thread-local code.
9225
9226 @item -mtls
9227 @opindex tls
9228
9229 Do not assume a large TLS segment when generating thread-local code.
9230
9231 @item -mgprel-ro
9232 @opindex mgprel-ro
9233
9234 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
9235 that is known to be in read-only sections.  It's enabled by default,
9236 except for @option{-fpic} or @option{-fpie}: even though it may help
9237 make the global offset table smaller, it trades 1 instruction for 4.
9238 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9239 one of which may be shared by multiple symbols, and it avoids the need
9240 for a GOT entry for the referenced symbol, so it's more likely to be a
9241 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9242
9243 @item -multilib-library-pic
9244 @opindex multilib-library-pic
9245
9246 Link with the (library, not FD) pic libraries.  It's implied by
9247 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9248 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9249 it explicitly.
9250
9251 @item -mlinked-fp
9252 @opindex mlinked-fp
9253
9254 Follow the EABI requirement of always creating a frame pointer whenever
9255 a stack frame is allocated.  This option is enabled by default and can
9256 be disabled with @option{-mno-linked-fp}.
9257
9258 @item -mlong-calls
9259 @opindex mlong-calls
9260
9261 Use indirect addressing to call functions outside the current
9262 compilation unit.  This allows the functions to be placed anywhere
9263 within the 32-bit address space.
9264
9265 @item -malign-labels
9266 @opindex malign-labels
9267
9268 Try to align labels to an 8-byte boundary by inserting nops into the
9269 previous packet.  This option only has an effect when VLIW packing
9270 is enabled.  It doesn't create new packets; it merely adds nops to
9271 existing ones.
9272
9273 @item -mlibrary-pic
9274 @opindex mlibrary-pic
9275
9276 Generate position-independent EABI code.
9277
9278 @item -macc-4
9279 @opindex macc-4
9280
9281 Use only the first four media accumulator registers.
9282
9283 @item -macc-8
9284 @opindex macc-8
9285
9286 Use all eight media accumulator registers.
9287
9288 @item -mpack
9289 @opindex mpack
9290
9291 Pack VLIW instructions.
9292
9293 @item -mno-pack
9294 @opindex mno-pack
9295
9296 Do not pack VLIW instructions.
9297
9298 @item -mno-eflags
9299 @opindex mno-eflags
9300
9301 Do not mark ABI switches in e_flags.
9302
9303 @item -mcond-move
9304 @opindex mcond-move
9305
9306 Enable the use of conditional-move instructions (default).
9307
9308 This switch is mainly for debugging the compiler and will likely be removed
9309 in a future version.
9310
9311 @item -mno-cond-move
9312 @opindex mno-cond-move
9313
9314 Disable the use of conditional-move instructions.
9315
9316 This switch is mainly for debugging the compiler and will likely be removed
9317 in a future version.
9318
9319 @item -mscc
9320 @opindex mscc
9321
9322 Enable the use of conditional set instructions (default).
9323
9324 This switch is mainly for debugging the compiler and will likely be removed
9325 in a future version.
9326
9327 @item -mno-scc
9328 @opindex mno-scc
9329
9330 Disable the use of conditional set instructions.
9331
9332 This switch is mainly for debugging the compiler and will likely be removed
9333 in a future version.
9334
9335 @item -mcond-exec
9336 @opindex mcond-exec
9337
9338 Enable the use of conditional execution (default).
9339
9340 This switch is mainly for debugging the compiler and will likely be removed
9341 in a future version.
9342
9343 @item -mno-cond-exec
9344 @opindex mno-cond-exec
9345
9346 Disable the use of conditional execution.
9347
9348 This switch is mainly for debugging the compiler and will likely be removed
9349 in a future version.
9350
9351 @item -mvliw-branch
9352 @opindex mvliw-branch
9353
9354 Run a pass to pack branches into VLIW instructions (default).
9355
9356 This switch is mainly for debugging the compiler and will likely be removed
9357 in a future version.
9358
9359 @item -mno-vliw-branch
9360 @opindex mno-vliw-branch
9361
9362 Do not run a pass to pack branches into VLIW instructions.
9363
9364 This switch is mainly for debugging the compiler and will likely be removed
9365 in a future version.
9366
9367 @item -mmulti-cond-exec
9368 @opindex mmulti-cond-exec
9369
9370 Enable optimization of @code{&&} and @code{||} in conditional execution
9371 (default).
9372
9373 This switch is mainly for debugging the compiler and will likely be removed
9374 in a future version.
9375
9376 @item -mno-multi-cond-exec
9377 @opindex mno-multi-cond-exec
9378
9379 Disable optimization of @code{&&} and @code{||} in conditional execution.
9380
9381 This switch is mainly for debugging the compiler and will likely be removed
9382 in a future version.
9383
9384 @item -mnested-cond-exec
9385 @opindex mnested-cond-exec
9386
9387 Enable nested conditional execution optimizations (default).
9388
9389 This switch is mainly for debugging the compiler and will likely be removed
9390 in a future version.
9391
9392 @item -mno-nested-cond-exec
9393 @opindex mno-nested-cond-exec
9394
9395 Disable nested conditional execution optimizations.
9396
9397 This switch is mainly for debugging the compiler and will likely be removed
9398 in a future version.
9399
9400 @item -moptimize-membar
9401 @opindex moptimize-membar
9402
9403 This switch removes redundant @code{membar} instructions from the
9404 compiler generated code.  It is enabled by default.
9405
9406 @item -mno-optimize-membar
9407 @opindex mno-optimize-membar
9408
9409 This switch disables the automatic removal of redundant @code{membar}
9410 instructions from the generated code.
9411
9412 @item -mtomcat-stats
9413 @opindex mtomcat-stats
9414
9415 Cause gas to print out tomcat statistics.
9416
9417 @item -mcpu=@var{cpu}
9418 @opindex mcpu
9419
9420 Select the processor type for which to generate code.  Possible values are
9421 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9422 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9423
9424 @end table
9425
9426 @node GNU/Linux Options
9427 @subsection GNU/Linux Options
9428
9429 These @samp{-m} options are defined for GNU/Linux targets:
9430
9431 @table @gcctabopt
9432 @item -mglibc
9433 @opindex mglibc
9434 Use the GNU C library instead of uClibc.  This is the default except
9435 on @samp{*-*-linux-*uclibc*} targets.
9436
9437 @item -muclibc
9438 @opindex muclibc
9439 Use uClibc instead of the GNU C library.  This is the default on
9440 @samp{*-*-linux-*uclibc*} targets.
9441 @end table
9442
9443 @node H8/300 Options
9444 @subsection H8/300 Options
9445
9446 These @samp{-m} options are defined for the H8/300 implementations:
9447
9448 @table @gcctabopt
9449 @item -mrelax
9450 @opindex mrelax
9451 Shorten some address references at link time, when possible; uses the
9452 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9453 ld, Using ld}, for a fuller description.
9454
9455 @item -mh
9456 @opindex mh
9457 Generate code for the H8/300H@.
9458
9459 @item -ms
9460 @opindex ms
9461 Generate code for the H8S@.
9462
9463 @item -mn
9464 @opindex mn
9465 Generate code for the H8S and H8/300H in the normal mode.  This switch
9466 must be used either with @option{-mh} or @option{-ms}.
9467
9468 @item -ms2600
9469 @opindex ms2600
9470 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9471
9472 @item -mint32
9473 @opindex mint32
9474 Make @code{int} data 32 bits by default.
9475
9476 @item -malign-300
9477 @opindex malign-300
9478 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9479 The default for the H8/300H and H8S is to align longs and floats on 4
9480 byte boundaries.
9481 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9482 This option has no effect on the H8/300.
9483 @end table
9484
9485 @node HPPA Options
9486 @subsection HPPA Options
9487 @cindex HPPA Options
9488
9489 These @samp{-m} options are defined for the HPPA family of computers:
9490
9491 @table @gcctabopt
9492 @item -march=@var{architecture-type}
9493 @opindex march
9494 Generate code for the specified architecture.  The choices for
9495 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9496 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9497 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9498 architecture option for your machine.  Code compiled for lower numbered
9499 architectures will run on higher numbered architectures, but not the
9500 other way around.
9501
9502 @item -mpa-risc-1-0
9503 @itemx -mpa-risc-1-1
9504 @itemx -mpa-risc-2-0
9505 @opindex mpa-risc-1-0
9506 @opindex mpa-risc-1-1
9507 @opindex mpa-risc-2-0
9508 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9509
9510 @item -mbig-switch
9511 @opindex mbig-switch
9512 Generate code suitable for big switch tables.  Use this option only if
9513 the assembler/linker complain about out of range branches within a switch
9514 table.
9515
9516 @item -mjump-in-delay
9517 @opindex mjump-in-delay
9518 Fill delay slots of function calls with unconditional jump instructions
9519 by modifying the return pointer for the function call to be the target
9520 of the conditional jump.
9521
9522 @item -mdisable-fpregs
9523 @opindex mdisable-fpregs
9524 Prevent floating point registers from being used in any manner.  This is
9525 necessary for compiling kernels which perform lazy context switching of
9526 floating point registers.  If you use this option and attempt to perform
9527 floating point operations, the compiler will abort.
9528
9529 @item -mdisable-indexing
9530 @opindex mdisable-indexing
9531 Prevent the compiler from using indexing address modes.  This avoids some
9532 rather obscure problems when compiling MIG generated code under MACH@.
9533
9534 @item -mno-space-regs
9535 @opindex mno-space-regs
9536 Generate code that assumes the target has no space registers.  This allows
9537 GCC to generate faster indirect calls and use unscaled index address modes.
9538
9539 Such code is suitable for level 0 PA systems and kernels.
9540
9541 @item -mfast-indirect-calls
9542 @opindex mfast-indirect-calls
9543 Generate code that assumes calls never cross space boundaries.  This
9544 allows GCC to emit code which performs faster indirect calls.
9545
9546 This option will not work in the presence of shared libraries or nested
9547 functions.
9548
9549 @item -mfixed-range=@var{register-range}
9550 @opindex mfixed-range
9551 Generate code treating the given register range as fixed registers.
9552 A fixed register is one that the register allocator can not use.  This is
9553 useful when compiling kernel code.  A register range is specified as
9554 two registers separated by a dash.  Multiple register ranges can be
9555 specified separated by a comma.
9556
9557 @item -mlong-load-store
9558 @opindex mlong-load-store
9559 Generate 3-instruction load and store sequences as sometimes required by
9560 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9561 the HP compilers.
9562
9563 @item -mportable-runtime
9564 @opindex mportable-runtime
9565 Use the portable calling conventions proposed by HP for ELF systems.
9566
9567 @item -mgas
9568 @opindex mgas
9569 Enable the use of assembler directives only GAS understands.
9570
9571 @item -mschedule=@var{cpu-type}
9572 @opindex mschedule
9573 Schedule code according to the constraints for the machine type
9574 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9575 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9576 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9577 proper scheduling option for your machine.  The default scheduling is
9578 @samp{8000}.
9579
9580 @item -mlinker-opt
9581 @opindex mlinker-opt
9582 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9583 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9584 linkers in which they give bogus error messages when linking some programs.
9585
9586 @item -msoft-float
9587 @opindex msoft-float
9588 Generate output containing library calls for floating point.
9589 @strong{Warning:} the requisite libraries are not available for all HPPA
9590 targets.  Normally the facilities of the machine's usual C compiler are
9591 used, but this cannot be done directly in cross-compilation.  You must make
9592 your own arrangements to provide suitable library functions for
9593 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9594 does provide software floating point support.
9595
9596 @option{-msoft-float} changes the calling convention in the output file;
9597 therefore, it is only useful if you compile @emph{all} of a program with
9598 this option.  In particular, you need to compile @file{libgcc.a}, the
9599 library that comes with GCC, with @option{-msoft-float} in order for
9600 this to work.
9601
9602 @item -msio
9603 @opindex msio
9604 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9605 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9606 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9607 options are available under HP-UX and HI-UX@.
9608
9609 @item -mgnu-ld
9610 @opindex gnu-ld
9611 Use GNU ld specific options.  This passes @option{-shared} to ld when
9612 building a shared library.  It is the default when GCC is configured,
9613 explicitly or implicitly, with the GNU linker.  This option does not
9614 have any affect on which ld is called, it only changes what parameters
9615 are passed to that ld.  The ld that is called is determined by the
9616 @option{--with-ld} configure option, GCC's program search path, and
9617 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9618 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9619 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9620
9621 @item -mhp-ld
9622 @opindex hp-ld
9623 Use HP ld specific options.  This passes @option{-b} to ld when building
9624 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9625 links.  It is the default when GCC is configured, explicitly or
9626 implicitly, with the HP linker.  This option does not have any affect on
9627 which ld is called, it only changes what parameters are passed to that
9628 ld.  The ld that is called is determined by the @option{--with-ld}
9629 configure option, GCC's program search path, and finally by the user's
9630 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9631 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9632 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9633
9634 @item -mlong-calls
9635 @opindex mno-long-calls
9636 Generate code that uses long call sequences.  This ensures that a call
9637 is always able to reach linker generated stubs.  The default is to generate
9638 long calls only when the distance from the call site to the beginning
9639 of the function or translation unit, as the case may be, exceeds a
9640 predefined limit set by the branch type being used.  The limits for
9641 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9642 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9643 240,000 bytes.
9644
9645 Distances are measured from the beginning of functions when using the
9646 @option{-ffunction-sections} option, or when using the @option{-mgas}
9647 and @option{-mno-portable-runtime} options together under HP-UX with
9648 the SOM linker.
9649
9650 It is normally not desirable to use this option as it will degrade
9651 performance.  However, it may be useful in large applications,
9652 particularly when partial linking is used to build the application.
9653
9654 The types of long calls used depends on the capabilities of the
9655 assembler and linker, and the type of code being generated.  The
9656 impact on systems that support long absolute calls, and long pic
9657 symbol-difference or pc-relative calls should be relatively small.
9658 However, an indirect call is used on 32-bit ELF systems in pic code
9659 and it is quite long.
9660
9661 @item -munix=@var{unix-std}
9662 @opindex march
9663 Generate compiler predefines and select a startfile for the specified
9664 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9665 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9666 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9667 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9668 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9669 and later.
9670
9671 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9672 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9673 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9674 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9675 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9676 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9677
9678 It is @emph{important} to note that this option changes the interfaces
9679 for various library routines.  It also affects the operational behavior
9680 of the C library.  Thus, @emph{extreme} care is needed in using this
9681 option.
9682
9683 Library code that is intended to operate with more than one UNIX
9684 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9685 as appropriate.  Most GNU software doesn't provide this capability.
9686
9687 @item -nolibdld
9688 @opindex nolibdld
9689 Suppress the generation of link options to search libdld.sl when the
9690 @option{-static} option is specified on HP-UX 10 and later.
9691
9692 @item -static
9693 @opindex static
9694 The HP-UX implementation of setlocale in libc has a dependency on
9695 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9696 when the @option{-static} option is specified, special link options
9697 are needed to resolve this dependency.
9698
9699 On HP-UX 10 and later, the GCC driver adds the necessary options to
9700 link with libdld.sl when the @option{-static} option is specified.
9701 This causes the resulting binary to be dynamic.  On the 64-bit port,
9702 the linkers generate dynamic binaries by default in any case.  The
9703 @option{-nolibdld} option can be used to prevent the GCC driver from
9704 adding these link options.
9705
9706 @item -threads
9707 @opindex threads
9708 Add support for multithreading with the @dfn{dce thread} library
9709 under HP-UX@.  This option sets flags for both the preprocessor and
9710 linker.
9711 @end table
9712
9713 @node i386 and x86-64 Options
9714 @subsection Intel 386 and AMD x86-64 Options
9715 @cindex i386 Options
9716 @cindex x86-64 Options
9717 @cindex Intel 386 Options
9718 @cindex AMD x86-64 Options
9719
9720 These @samp{-m} options are defined for the i386 and x86-64 family of
9721 computers:
9722
9723 @table @gcctabopt
9724 @item -mtune=@var{cpu-type}
9725 @opindex mtune
9726 Tune to @var{cpu-type} everything applicable about the generated code, except
9727 for the ABI and the set of available instructions.  The choices for
9728 @var{cpu-type} are:
9729 @table @emph
9730 @item generic
9731 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9732 If you know the CPU on which your code will run, then you should use
9733 the corresponding @option{-mtune} option instead of
9734 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9735 of your application will have, then you should use this option.
9736
9737 As new processors are deployed in the marketplace, the behavior of this
9738 option will change.  Therefore, if you upgrade to a newer version of
9739 GCC, the code generated option will change to reflect the processors
9740 that were most common when that version of GCC was released.
9741
9742 There is no @option{-march=generic} option because @option{-march}
9743 indicates the instruction set the compiler can use, and there is no
9744 generic instruction set applicable to all processors.  In contrast,
9745 @option{-mtune} indicates the processor (or, in this case, collection of
9746 processors) for which the code is optimized.
9747 @item native
9748 This selects the CPU to tune for at compilation time by determining
9749 the processor type of the compiling machine.  Using @option{-mtune=native}
9750 will produce code optimized for the local machine under the constraints
9751 of the selected instruction set.  Using @option{-march=native} will
9752 enable all instruction subsets supported by the local machine (hence
9753 the result might not run on different machines).
9754 @item i386
9755 Original Intel's i386 CPU@.
9756 @item i486
9757 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9758 @item i586, pentium
9759 Intel Pentium CPU with no MMX support.
9760 @item pentium-mmx
9761 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9762 @item pentiumpro
9763 Intel PentiumPro CPU@.
9764 @item i686
9765 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9766 instruction set will be used, so the code will run on all i686 family chips.
9767 @item pentium2
9768 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9769 @item pentium3, pentium3m
9770 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9771 support.
9772 @item pentium-m
9773 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9774 support.  Used by Centrino notebooks.
9775 @item pentium4, pentium4m
9776 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9777 @item prescott
9778 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9779 set support.
9780 @item nocona
9781 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9782 SSE2 and SSE3 instruction set support.
9783 @item core2
9784 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9785 instruction set support.
9786 @item k6
9787 AMD K6 CPU with MMX instruction set support.
9788 @item k6-2, k6-3
9789 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9790 @item athlon, athlon-tbird
9791 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9792 support.
9793 @item athlon-4, athlon-xp, athlon-mp
9794 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9795 instruction set support.
9796 @item k8, opteron, athlon64, athlon-fx
9797 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9798 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9799 @item amdfam10, barcelona
9800 AMD Family 10 core based CPUs with x86-64 instruction set support.  (This
9801 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
9802 instruction set extensions.)
9803 @item winchip-c6
9804 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9805 set support.
9806 @item winchip2
9807 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9808 instruction set support.
9809 @item c3
9810 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9811 implemented for this chip.)
9812 @item c3-2
9813 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9814 implemented for this chip.)
9815 @item geode
9816 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9817 @end table
9818
9819 While picking a specific @var{cpu-type} will schedule things appropriately
9820 for that particular chip, the compiler will not generate any code that
9821 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9822 being used.
9823
9824 @item -march=@var{cpu-type}
9825 @opindex march
9826 Generate instructions for the machine type @var{cpu-type}.  The choices
9827 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9828 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9829
9830 @item -mcpu=@var{cpu-type}
9831 @opindex mcpu
9832 A deprecated synonym for @option{-mtune}.
9833
9834 @item -m386
9835 @itemx -m486
9836 @itemx -mpentium
9837 @itemx -mpentiumpro
9838 @opindex m386
9839 @opindex m486
9840 @opindex mpentium
9841 @opindex mpentiumpro
9842 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9843 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9844 These synonyms are deprecated.
9845
9846 @item -mfpmath=@var{unit}
9847 @opindex march
9848 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9849 for @var{unit} are:
9850
9851 @table @samp
9852 @item 387
9853 Use the standard 387 floating point coprocessor present majority of chips and
9854 emulated otherwise.  Code compiled with this option will run almost everywhere.
9855 The temporary results are computed in 80bit precision instead of precision
9856 specified by the type resulting in slightly different results compared to most
9857 of other chips.  See @option{-ffloat-store} for more detailed description.
9858
9859 This is the default choice for i386 compiler.
9860
9861 @item sse
9862 Use scalar floating point instructions present in the SSE instruction set.
9863 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9864 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9865 instruction set supports only single precision arithmetics, thus the double and
9866 extended precision arithmetics is still done using 387.  Later version, present
9867 only in Pentium4 and the future AMD x86-64 chips supports double precision
9868 arithmetics too.
9869
9870 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9871 or @option{-msse2} switches to enable SSE extensions and make this option
9872 effective.  For the x86-64 compiler, these extensions are enabled by default.
9873
9874 The resulting code should be considerably faster in the majority of cases and avoid
9875 the numerical instability problems of 387 code, but may break some existing
9876 code that expects temporaries to be 80bit.
9877
9878 This is the default choice for the x86-64 compiler.
9879
9880 @item sse,387
9881 Attempt to utilize both instruction sets at once.  This effectively double the
9882 amount of available registers and on chips with separate execution units for
9883 387 and SSE the execution resources too.  Use this option with care, as it is
9884 still experimental, because the GCC register allocator does not model separate
9885 functional units well resulting in instable performance.
9886 @end table
9887
9888 @item -masm=@var{dialect}
9889 @opindex masm=@var{dialect}
9890 Output asm instructions using selected @var{dialect}.  Supported
9891 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9892 not support @samp{intel}.
9893
9894 @item -mieee-fp
9895 @itemx -mno-ieee-fp
9896 @opindex mieee-fp
9897 @opindex mno-ieee-fp
9898 Control whether or not the compiler uses IEEE floating point
9899 comparisons.  These handle correctly the case where the result of a
9900 comparison is unordered.
9901
9902 @item -msoft-float
9903 @opindex msoft-float
9904 Generate output containing library calls for floating point.
9905 @strong{Warning:} the requisite libraries are not part of GCC@.
9906 Normally the facilities of the machine's usual C compiler are used, but
9907 this can't be done directly in cross-compilation.  You must make your
9908 own arrangements to provide suitable library functions for
9909 cross-compilation.
9910
9911 On machines where a function returns floating point results in the 80387
9912 register stack, some floating point opcodes may be emitted even if
9913 @option{-msoft-float} is used.
9914
9915 @item -mno-fp-ret-in-387
9916 @opindex mno-fp-ret-in-387
9917 Do not use the FPU registers for return values of functions.
9918
9919 The usual calling convention has functions return values of types
9920 @code{float} and @code{double} in an FPU register, even if there
9921 is no FPU@.  The idea is that the operating system should emulate
9922 an FPU@.
9923
9924 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9925 in ordinary CPU registers instead.
9926
9927 @item -mno-fancy-math-387
9928 @opindex mno-fancy-math-387
9929 Some 387 emulators do not support the @code{sin}, @code{cos} and
9930 @code{sqrt} instructions for the 387.  Specify this option to avoid
9931 generating those instructions.  This option is the default on FreeBSD,
9932 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9933 indicates that the target cpu will always have an FPU and so the
9934 instruction will not need emulation.  As of revision 2.6.1, these
9935 instructions are not generated unless you also use the
9936 @option{-funsafe-math-optimizations} switch.
9937
9938 @item -malign-double
9939 @itemx -mno-align-double
9940 @opindex malign-double
9941 @opindex mno-align-double
9942 Control whether GCC aligns @code{double}, @code{long double}, and
9943 @code{long long} variables on a two word boundary or a one word
9944 boundary.  Aligning @code{double} variables on a two word boundary will
9945 produce code that runs somewhat faster on a @samp{Pentium} at the
9946 expense of more memory.
9947
9948 On x86-64, @option{-malign-double} is enabled by default.
9949
9950 @strong{Warning:} if you use the @option{-malign-double} switch,
9951 structures containing the above types will be aligned differently than
9952 the published application binary interface specifications for the 386
9953 and will not be binary compatible with structures in code compiled
9954 without that switch.
9955
9956 @item -m96bit-long-double
9957 @itemx -m128bit-long-double
9958 @opindex m96bit-long-double
9959 @opindex m128bit-long-double
9960 These switches control the size of @code{long double} type.  The i386
9961 application binary interface specifies the size to be 96 bits,
9962 so @option{-m96bit-long-double} is the default in 32 bit mode.
9963
9964 Modern architectures (Pentium and newer) would prefer @code{long double}
9965 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9966 conforming to the ABI, this would not be possible.  So specifying a
9967 @option{-m128bit-long-double} will align @code{long double}
9968 to a 16 byte boundary by padding the @code{long double} with an additional
9969 32 bit zero.
9970
9971 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9972 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9973
9974 Notice that neither of these options enable any extra precision over the x87
9975 standard of 80 bits for a @code{long double}.
9976
9977 @strong{Warning:} if you override the default value for your target ABI, the
9978 structures and arrays containing @code{long double} variables will change
9979 their size as well as function calling convention for function taking
9980 @code{long double} will be modified.  Hence they will not be binary
9981 compatible with arrays or structures in code compiled without that switch.
9982
9983 @item -mmlarge-data-threshold=@var{number}
9984 @opindex mlarge-data-threshold=@var{number}
9985 When @option{-mcmodel=medium} is specified, the data greater than
9986 @var{threshold} are placed in large data section.  This value must be the
9987 same across all object linked into the binary and defaults to 65535.
9988
9989 @item -msvr3-shlib
9990 @itemx -mno-svr3-shlib
9991 @opindex msvr3-shlib
9992 @opindex mno-svr3-shlib
9993 Control whether GCC places uninitialized local variables into the
9994 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9995 into @code{bss}.  These options are meaningful only on System V Release 3.
9996
9997 @item -mrtd
9998 @opindex mrtd
9999 Use a different function-calling convention, in which functions that
10000 take a fixed number of arguments return with the @code{ret} @var{num}
10001 instruction, which pops their arguments while returning.  This saves one
10002 instruction in the caller since there is no need to pop the arguments
10003 there.
10004
10005 You can specify that an individual function is called with this calling
10006 sequence with the function attribute @samp{stdcall}.  You can also
10007 override the @option{-mrtd} option by using the function attribute
10008 @samp{cdecl}.  @xref{Function Attributes}.
10009
10010 @strong{Warning:} this calling convention is incompatible with the one
10011 normally used on Unix, so you cannot use it if you need to call
10012 libraries compiled with the Unix compiler.
10013
10014 Also, you must provide function prototypes for all functions that
10015 take variable numbers of arguments (including @code{printf});
10016 otherwise incorrect code will be generated for calls to those
10017 functions.
10018
10019 In addition, seriously incorrect code will result if you call a
10020 function with too many arguments.  (Normally, extra arguments are
10021 harmlessly ignored.)
10022
10023 @item -mregparm=@var{num}
10024 @opindex mregparm
10025 Control how many registers are used to pass integer arguments.  By
10026 default, no registers are used to pass arguments, and at most 3
10027 registers can be used.  You can control this behavior for a specific
10028 function by using the function attribute @samp{regparm}.
10029 @xref{Function Attributes}.
10030
10031 @strong{Warning:} if you use this switch, and
10032 @var{num} is nonzero, then you must build all modules with the same
10033 value, including any libraries.  This includes the system libraries and
10034 startup modules.
10035
10036 @item -msseregparm
10037 @opindex msseregparm
10038 Use SSE register passing conventions for float and double arguments
10039 and return values.  You can control this behavior for a specific
10040 function by using the function attribute @samp{sseregparm}.
10041 @xref{Function Attributes}.
10042
10043 @strong{Warning:} if you use this switch then you must build all
10044 modules with the same value, including any libraries.  This includes
10045 the system libraries and startup modules.
10046
10047 @item -mpc32
10048 @itemx -mpc64
10049 @itemx -mpc80
10050 @opindex mpc32
10051 @opindex mpc64
10052 @opindex mpc80
10053
10054 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10055 is specified, the significand of floating-point operations is rounded to 24
10056 bits (single precision), @option{-mpc64} rounds the significand of
10057 floating-point operations to 53 bits (double precision) and @option{-mpc80}
10058 rounds the significand of floating-point operations to 64 bits (extended
10059 double precision).  Note that a change of default precision control may
10060 affect the results returned by some of the mathematical functions.
10061
10062 @item -mstackrealign
10063 @opindex mstackrealign
10064 Realign the stack at entry.  On the Intel x86, the
10065 @option{-mstackrealign} option will generate an alternate prologue and
10066 epilogue that realigns the runtime stack.  This supports mixing legacy
10067 codes that keep a 4-byte aligned stack with modern codes that keep a
10068 16-byte stack for SSE compatibility.  The alternate prologue and
10069 epilogue are slower and bigger than the regular ones, and the
10070 alternate prologue requires an extra scratch register; this lowers the
10071 number of registers available if used in conjunction with the
10072 @code{regparm} attribute.  The @option{-mstackrealign} option is
10073 incompatible with the nested function prologue; this is considered a
10074 hard error.  See also the attribute @code{force_align_arg_pointer},
10075 applicable to individual functions.
10076
10077 @item -mpreferred-stack-boundary=@var{num}
10078 @opindex mpreferred-stack-boundary
10079 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10080 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10081 the default is 4 (16 bytes or 128 bits).
10082
10083 On Pentium and PentiumPro, @code{double} and @code{long double} values
10084 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10085 suffer significant run time performance penalties.  On Pentium III, the
10086 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10087 properly if it is not 16 byte aligned.
10088
10089 To ensure proper alignment of this values on the stack, the stack boundary
10090 must be as aligned as that required by any value stored on the stack.
10091 Further, every function must be generated such that it keeps the stack
10092 aligned.  Thus calling a function compiled with a higher preferred
10093 stack boundary from a function compiled with a lower preferred stack
10094 boundary will most likely misalign the stack.  It is recommended that
10095 libraries that use callbacks always use the default setting.
10096
10097 This extra alignment does consume extra stack space, and generally
10098 increases code size.  Code that is sensitive to stack space usage, such
10099 as embedded systems and operating system kernels, may want to reduce the
10100 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10101
10102 @item -mmmx
10103 @itemx -mno-mmx
10104 @item -msse
10105 @itemx -mno-sse
10106 @item -msse2
10107 @itemx -mno-sse2
10108 @item -msse3
10109 @itemx -mno-sse3
10110 @item -mssse3
10111 @itemx -mno-ssse3
10112 @item -msse4a
10113 @item -mno-sse4a
10114 @item -m3dnow
10115 @itemx -mno-3dnow
10116 @item -mpopcnt
10117 @itemx -mno-popcnt
10118 @item -mabm
10119 @itemx -mno-abm
10120 @opindex mmmx
10121 @opindex mno-mmx
10122 @opindex msse
10123 @opindex mno-sse
10124 @opindex m3dnow
10125 @opindex mno-3dnow
10126 These switches enable or disable the use of instructions in the MMX,
10127 SSE, SSE2, SSE3, SSSE3, SSE4A, ABM or 3DNow! extended instruction sets.
10128 These extensions are also available as built-in functions: see
10129 @ref{X86 Built-in Functions}, for details of the functions enabled and
10130 disabled by these switches.
10131
10132 To have SSE/SSE2 instructions generated automatically from floating-point
10133 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10134
10135 These options will enable GCC to use these extended instructions in
10136 generated code, even without @option{-mfpmath=sse}.  Applications which
10137 perform runtime CPU detection must compile separate files for each
10138 supported architecture, using the appropriate flags.  In particular,
10139 the file containing the CPU detection code should be compiled without
10140 these options.
10141
10142 @item -mcx16
10143 @opindex -mcx16
10144 This option will enable GCC to use CMPXCHG16B instruction in generated code.
10145 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
10146 data types.  This is useful for high resolution counters that could be updated
10147 by multiple processors (or cores).  This instruction is generated as part of
10148 atomic built-in functions: see @ref{Atomic Builtins} for details.
10149
10150 @item -msahf
10151 @opindex -msahf
10152 This option will enable GCC to use SAHF instruction in generated 64-bit code.
10153 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
10154 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
10155 SAHF are load and store instructions, respectively, for certain status flags.
10156 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
10157 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
10158
10159 @item -mpush-args
10160 @itemx -mno-push-args
10161 @opindex mpush-args
10162 @opindex mno-push-args
10163 Use PUSH operations to store outgoing parameters.  This method is shorter
10164 and usually equally fast as method using SUB/MOV operations and is enabled
10165 by default.  In some cases disabling it may improve performance because of
10166 improved scheduling and reduced dependencies.
10167
10168 @item -maccumulate-outgoing-args
10169 @opindex maccumulate-outgoing-args
10170 If enabled, the maximum amount of space required for outgoing arguments will be
10171 computed in the function prologue.  This is faster on most modern CPUs
10172 because of reduced dependencies, improved scheduling and reduced stack usage
10173 when preferred stack boundary is not equal to 2.  The drawback is a notable
10174 increase in code size.  This switch implies @option{-mno-push-args}.
10175
10176 @item -mthreads
10177 @opindex mthreads
10178 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
10179 on thread-safe exception handling must compile and link all code with the
10180 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
10181 @option{-D_MT}; when linking, it links in a special thread helper library
10182 @option{-lmingwthrd} which cleans up per thread exception handling data.
10183
10184 @item -mno-align-stringops
10185 @opindex mno-align-stringops
10186 Do not align destination of inlined string operations.  This switch reduces
10187 code size and improves performance in case the destination is already aligned,
10188 but GCC doesn't know about it.
10189
10190 @item -minline-all-stringops
10191 @opindex minline-all-stringops
10192 By default GCC inlines string operations only when destination is known to be
10193 aligned at least to 4 byte boundary.  This enables more inlining, increase code
10194 size, but may improve performance of code that depends on fast memcpy, strlen
10195 and memset for short lengths.
10196
10197 @item -minline-stringops-dynamically
10198 @opindex minline-stringops-dynamically
10199 For string operation of unknown size, inline runtime checks so for small
10200 blocks inline code is used, while for large blocks library call is used.
10201
10202 @item -mstringop-strategy=@var{alg}
10203 @opindex mstringop-strategy=@var{alg}
10204 Overwrite internal decision heuristic about particular algorithm to inline
10205 string operation with.  The allowed values are @code{rep_byte},
10206 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
10207 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
10208 expanding inline loop, @code{libcall} for always expanding library call.
10209
10210 @item -momit-leaf-frame-pointer
10211 @opindex momit-leaf-frame-pointer
10212 Don't keep the frame pointer in a register for leaf functions.  This
10213 avoids the instructions to save, set up and restore frame pointers and
10214 makes an extra register available in leaf functions.  The option
10215 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10216 which might make debugging harder.
10217
10218 @item -mtls-direct-seg-refs
10219 @itemx -mno-tls-direct-seg-refs
10220 @opindex mtls-direct-seg-refs
10221 Controls whether TLS variables may be accessed with offsets from the
10222 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
10223 or whether the thread base pointer must be added.  Whether or not this
10224 is legal depends on the operating system, and whether it maps the
10225 segment to cover the entire TLS area.
10226
10227 For systems that use GNU libc, the default is on.
10228 @end table
10229
10230 These @samp{-m} switches are supported in addition to the above
10231 on AMD x86-64 processors in 64-bit environments.
10232
10233 @table @gcctabopt
10234 @item -m32
10235 @itemx -m64
10236 @opindex m32
10237 @opindex m64
10238 Generate code for a 32-bit or 64-bit environment.
10239 The 32-bit environment sets int, long and pointer to 32 bits and
10240 generates code that runs on any i386 system.
10241 The 64-bit environment sets int to 32 bits and long and pointer
10242 to 64 bits and generates code for AMD's x86-64 architecture. For
10243 darwin only the -m64 option turns off the @option{-fno-pic} and
10244 @option{-mdynamic-no-pic} options.
10245
10246 @item -mno-red-zone
10247 @opindex no-red-zone
10248 Do not use a so called red zone for x86-64 code.  The red zone is mandated
10249 by the x86-64 ABI, it is a 128-byte area beyond the location of the
10250 stack pointer that will not be modified by signal or interrupt handlers
10251 and therefore can be used for temporary data without adjusting the stack
10252 pointer.  The flag @option{-mno-red-zone} disables this red zone.
10253
10254 @item -mcmodel=small
10255 @opindex mcmodel=small
10256 Generate code for the small code model: the program and its symbols must
10257 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
10258 Programs can be statically or dynamically linked.  This is the default
10259 code model.
10260
10261 @item -mcmodel=kernel
10262 @opindex mcmodel=kernel
10263 Generate code for the kernel code model.  The kernel runs in the
10264 negative 2 GB of the address space.
10265 This model has to be used for Linux kernel code.
10266
10267 @item -mcmodel=medium
10268 @opindex mcmodel=medium
10269 Generate code for the medium model: The program is linked in the lower 2
10270 GB of the address space but symbols can be located anywhere in the
10271 address space.  Programs can be statically or dynamically linked, but
10272 building of shared libraries are not supported with the medium model.
10273
10274 @item -mcmodel=large
10275 @opindex mcmodel=large
10276 Generate code for the large model: This model makes no assumptions
10277 about addresses and sizes of sections.
10278 @end table
10279
10280 @node IA-64 Options
10281 @subsection IA-64 Options
10282 @cindex IA-64 Options
10283
10284 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10285
10286 @table @gcctabopt
10287 @item -mbig-endian
10288 @opindex mbig-endian
10289 Generate code for a big endian target.  This is the default for HP-UX@.
10290
10291 @item -mlittle-endian
10292 @opindex mlittle-endian
10293 Generate code for a little endian target.  This is the default for AIX5
10294 and GNU/Linux.
10295
10296 @item -mgnu-as
10297 @itemx -mno-gnu-as
10298 @opindex mgnu-as
10299 @opindex mno-gnu-as
10300 Generate (or don't) code for the GNU assembler.  This is the default.
10301 @c Also, this is the default if the configure option @option{--with-gnu-as}
10302 @c is used.
10303
10304 @item -mgnu-ld
10305 @itemx -mno-gnu-ld
10306 @opindex mgnu-ld
10307 @opindex mno-gnu-ld
10308 Generate (or don't) code for the GNU linker.  This is the default.
10309 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10310 @c is used.
10311
10312 @item -mno-pic
10313 @opindex mno-pic
10314 Generate code that does not use a global pointer register.  The result
10315 is not position independent code, and violates the IA-64 ABI@.
10316
10317 @item -mvolatile-asm-stop
10318 @itemx -mno-volatile-asm-stop
10319 @opindex mvolatile-asm-stop
10320 @opindex mno-volatile-asm-stop
10321 Generate (or don't) a stop bit immediately before and after volatile asm
10322 statements.
10323
10324 @item -mregister-names
10325 @itemx -mno-register-names
10326 @opindex mregister-names
10327 @opindex mno-register-names
10328 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10329 the stacked registers.  This may make assembler output more readable.
10330
10331 @item -mno-sdata
10332 @itemx -msdata
10333 @opindex mno-sdata
10334 @opindex msdata
10335 Disable (or enable) optimizations that use the small data section.  This may
10336 be useful for working around optimizer bugs.
10337
10338 @item -mconstant-gp
10339 @opindex mconstant-gp
10340 Generate code that uses a single constant global pointer value.  This is
10341 useful when compiling kernel code.
10342
10343 @item -mauto-pic
10344 @opindex mauto-pic
10345 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10346 This is useful when compiling firmware code.
10347
10348 @item -minline-float-divide-min-latency
10349 @opindex minline-float-divide-min-latency
10350 Generate code for inline divides of floating point values
10351 using the minimum latency algorithm.
10352
10353 @item -minline-float-divide-max-throughput
10354 @opindex minline-float-divide-max-throughput
10355 Generate code for inline divides of floating point values
10356 using the maximum throughput algorithm.
10357
10358 @item -minline-int-divide-min-latency
10359 @opindex minline-int-divide-min-latency
10360 Generate code for inline divides of integer values
10361 using the minimum latency algorithm.
10362
10363 @item -minline-int-divide-max-throughput
10364 @opindex minline-int-divide-max-throughput
10365 Generate code for inline divides of integer values
10366 using the maximum throughput algorithm.
10367
10368 @item -minline-sqrt-min-latency
10369 @opindex minline-sqrt-min-latency
10370 Generate code for inline square roots
10371 using the minimum latency algorithm.
10372
10373 @item -minline-sqrt-max-throughput
10374 @opindex minline-sqrt-max-throughput
10375 Generate code for inline square roots
10376 using the maximum throughput algorithm.
10377
10378 @item -mno-dwarf2-asm
10379 @itemx -mdwarf2-asm
10380 @opindex mno-dwarf2-asm
10381 @opindex mdwarf2-asm
10382 Don't (or do) generate assembler code for the DWARF2 line number debugging
10383 info.  This may be useful when not using the GNU assembler.
10384
10385 @item -mearly-stop-bits
10386 @itemx -mno-early-stop-bits
10387 @opindex mearly-stop-bits
10388 @opindex mno-early-stop-bits
10389 Allow stop bits to be placed earlier than immediately preceding the
10390 instruction that triggered the stop bit.  This can improve instruction
10391 scheduling, but does not always do so.
10392
10393 @item -mfixed-range=@var{register-range}
10394 @opindex mfixed-range
10395 Generate code treating the given register range as fixed registers.
10396 A fixed register is one that the register allocator can not use.  This is
10397 useful when compiling kernel code.  A register range is specified as
10398 two registers separated by a dash.  Multiple register ranges can be
10399 specified separated by a comma.
10400
10401 @item -mtls-size=@var{tls-size}
10402 @opindex mtls-size
10403 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10404 64.
10405
10406 @item -mtune=@var{cpu-type}
10407 @opindex mtune
10408 Tune the instruction scheduling for a particular CPU, Valid values are
10409 itanium, itanium1, merced, itanium2, and mckinley.
10410
10411 @item -mt
10412 @itemx -pthread
10413 @opindex mt
10414 @opindex pthread
10415 Add support for multithreading using the POSIX threads library.  This
10416 option sets flags for both the preprocessor and linker.  It does
10417 not affect the thread safety of object code produced by the compiler or
10418 that of libraries supplied with it.  These are HP-UX specific flags.
10419
10420 @item -milp32
10421 @itemx -mlp64
10422 @opindex milp32
10423 @opindex mlp64
10424 Generate code for a 32-bit or 64-bit environment.
10425 The 32-bit environment sets int, long and pointer to 32 bits.
10426 The 64-bit environment sets int to 32 bits and long and pointer
10427 to 64 bits.  These are HP-UX specific flags.
10428
10429 @item -mno-sched-br-data-spec
10430 @itemx -msched-br-data-spec
10431 @opindex -mno-sched-br-data-spec
10432 @opindex -msched-br-data-spec
10433 (Dis/En)able data speculative scheduling before reload.
10434 This will result in generation of the ld.a instructions and
10435 the corresponding check instructions (ld.c / chk.a).
10436 The default is 'disable'.
10437
10438 @item -msched-ar-data-spec
10439 @itemx -mno-sched-ar-data-spec
10440 @opindex -msched-ar-data-spec
10441 @opindex -mno-sched-ar-data-spec
10442 (En/Dis)able data speculative scheduling after reload.
10443 This will result in generation of the ld.a instructions and
10444 the corresponding check instructions (ld.c / chk.a).
10445 The default is 'enable'.
10446
10447 @item -mno-sched-control-spec
10448 @itemx -msched-control-spec
10449 @opindex -mno-sched-control-spec
10450 @opindex -msched-control-spec
10451 (Dis/En)able control speculative scheduling.  This feature is
10452 available only during region scheduling (i.e. before reload).
10453 This will result in generation of the ld.s instructions and
10454 the corresponding check instructions chk.s .
10455 The default is 'disable'.
10456
10457 @item -msched-br-in-data-spec
10458 @itemx -mno-sched-br-in-data-spec
10459 @opindex -msched-br-in-data-spec
10460 @opindex -mno-sched-br-in-data-spec
10461 (En/Dis)able speculative scheduling of the instructions that
10462 are dependent on the data speculative loads before reload.
10463 This is effective only with @option{-msched-br-data-spec} enabled.
10464 The default is 'enable'.
10465
10466 @item -msched-ar-in-data-spec
10467 @itemx -mno-sched-ar-in-data-spec
10468 @opindex -msched-ar-in-data-spec
10469 @opindex -mno-sched-ar-in-data-spec
10470 (En/Dis)able speculative scheduling of the instructions that
10471 are dependent on the data speculative loads after reload.
10472 This is effective only with @option{-msched-ar-data-spec} enabled.
10473 The default is 'enable'.
10474
10475 @item -msched-in-control-spec
10476 @itemx -mno-sched-in-control-spec
10477 @opindex -msched-in-control-spec
10478 @opindex -mno-sched-in-control-spec
10479 (En/Dis)able speculative scheduling of the instructions that
10480 are dependent on the control speculative loads.
10481 This is effective only with @option{-msched-control-spec} enabled.
10482 The default is 'enable'.
10483
10484 @item -msched-ldc
10485 @itemx -mno-sched-ldc
10486 @opindex -msched-ldc
10487 @opindex -mno-sched-ldc
10488 (En/Dis)able use of simple data speculation checks ld.c .
10489 If disabled, only chk.a instructions will be emitted to check
10490 data speculative loads.
10491 The default is 'enable'.
10492
10493 @item -mno-sched-control-ldc
10494 @itemx -msched-control-ldc
10495 @opindex -mno-sched-control-ldc
10496 @opindex -msched-control-ldc
10497 (Dis/En)able use of ld.c instructions to check control speculative loads.
10498 If enabled, in case of control speculative load with no speculatively
10499 scheduled dependent instructions this load will be emitted as ld.sa and
10500 ld.c will be used to check it.
10501 The default is 'disable'.
10502
10503 @item -mno-sched-spec-verbose
10504 @itemx -msched-spec-verbose
10505 @opindex -mno-sched-spec-verbose
10506 @opindex -msched-spec-verbose
10507 (Dis/En)able printing of the information about speculative motions.
10508
10509 @item -mno-sched-prefer-non-data-spec-insns
10510 @itemx -msched-prefer-non-data-spec-insns
10511 @opindex -mno-sched-prefer-non-data-spec-insns
10512 @opindex -msched-prefer-non-data-spec-insns
10513 If enabled, data speculative instructions will be chosen for schedule
10514 only if there are no other choices at the moment.  This will make
10515 the use of the data speculation much more conservative.
10516 The default is 'disable'.
10517
10518 @item -mno-sched-prefer-non-control-spec-insns
10519 @itemx -msched-prefer-non-control-spec-insns
10520 @opindex -mno-sched-prefer-non-control-spec-insns
10521 @opindex -msched-prefer-non-control-spec-insns
10522 If enabled, control speculative instructions will be chosen for schedule
10523 only if there are no other choices at the moment.  This will make
10524 the use of the control speculation much more conservative.
10525 The default is 'disable'.
10526
10527 @item -mno-sched-count-spec-in-critical-path
10528 @itemx -msched-count-spec-in-critical-path
10529 @opindex -mno-sched-count-spec-in-critical-path
10530 @opindex -msched-count-spec-in-critical-path
10531 If enabled, speculative dependencies will be considered during
10532 computation of the instructions priorities.  This will make the use of the
10533 speculation a bit more conservative.
10534 The default is 'disable'.
10535
10536 @end table
10537
10538 @node M32C Options
10539 @subsection M32C Options
10540 @cindex M32C options
10541
10542 @table @gcctabopt
10543 @item -mcpu=@var{name}
10544 @opindex mcpu=
10545 Select the CPU for which code is generated.  @var{name} may be one of
10546 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10547 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10548 the M32C/80 series.
10549
10550 @item -msim
10551 @opindex msim
10552 Specifies that the program will be run on the simulator.  This causes
10553 an alternate runtime library to be linked in which supports, for
10554 example, file I/O.  You must not use this option when generating
10555 programs that will run on real hardware; you must provide your own
10556 runtime library for whatever I/O functions are needed.
10557
10558 @item -memregs=@var{number}
10559 @opindex memregs=
10560 Specifies the number of memory-based pseudo-registers GCC will use
10561 during code generation.  These pseudo-registers will be used like real
10562 registers, so there is a tradeoff between GCC's ability to fit the
10563 code into available registers, and the performance penalty of using
10564 memory instead of registers.  Note that all modules in a program must
10565 be compiled with the same value for this option.  Because of that, you
10566 must not use this option with the default runtime libraries gcc
10567 builds.
10568
10569 @end table
10570
10571 @node M32R/D Options
10572 @subsection M32R/D Options
10573 @cindex M32R/D options
10574
10575 These @option{-m} options are defined for Renesas M32R/D architectures:
10576
10577 @table @gcctabopt
10578 @item -m32r2
10579 @opindex m32r2
10580 Generate code for the M32R/2@.
10581
10582 @item -m32rx
10583 @opindex m32rx
10584 Generate code for the M32R/X@.
10585
10586 @item -m32r
10587 @opindex m32r
10588 Generate code for the M32R@.  This is the default.
10589
10590 @item -mmodel=small
10591 @opindex mmodel=small
10592 Assume all objects live in the lower 16MB of memory (so that their addresses
10593 can be loaded with the @code{ld24} instruction), and assume all subroutines
10594 are reachable with the @code{bl} instruction.
10595 This is the default.
10596
10597 The addressability of a particular object can be set with the
10598 @code{model} attribute.
10599
10600 @item -mmodel=medium
10601 @opindex mmodel=medium
10602 Assume objects may be anywhere in the 32-bit address space (the compiler
10603 will generate @code{seth/add3} instructions to load their addresses), and
10604 assume all subroutines are reachable with the @code{bl} instruction.
10605
10606 @item -mmodel=large
10607 @opindex mmodel=large
10608 Assume objects may be anywhere in the 32-bit address space (the compiler
10609 will generate @code{seth/add3} instructions to load their addresses), and
10610 assume subroutines may not be reachable with the @code{bl} instruction
10611 (the compiler will generate the much slower @code{seth/add3/jl}
10612 instruction sequence).
10613
10614 @item -msdata=none
10615 @opindex msdata=none
10616 Disable use of the small data area.  Variables will be put into
10617 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10618 @code{section} attribute has been specified).
10619 This is the default.
10620
10621 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10622 Objects may be explicitly put in the small data area with the
10623 @code{section} attribute using one of these sections.
10624
10625 @item -msdata=sdata
10626 @opindex msdata=sdata
10627 Put small global and static data in the small data area, but do not
10628 generate special code to reference them.
10629
10630 @item -msdata=use
10631 @opindex msdata=use
10632 Put small global and static data in the small data area, and generate
10633 special instructions to reference them.
10634
10635 @item -G @var{num}
10636 @opindex G
10637 @cindex smaller data references
10638 Put global and static objects less than or equal to @var{num} bytes
10639 into the small data or bss sections instead of the normal data or bss
10640 sections.  The default value of @var{num} is 8.
10641 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10642 for this option to have any effect.
10643
10644 All modules should be compiled with the same @option{-G @var{num}} value.
10645 Compiling with different values of @var{num} may or may not work; if it
10646 doesn't the linker will give an error message---incorrect code will not be
10647 generated.
10648
10649 @item -mdebug
10650 @opindex mdebug
10651 Makes the M32R specific code in the compiler display some statistics
10652 that might help in debugging programs.
10653
10654 @item -malign-loops
10655 @opindex malign-loops
10656 Align all loops to a 32-byte boundary.
10657
10658 @item -mno-align-loops
10659 @opindex mno-align-loops
10660 Do not enforce a 32-byte alignment for loops.  This is the default.
10661
10662 @item -missue-rate=@var{number}
10663 @opindex missue-rate=@var{number}
10664 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10665 or 2.
10666
10667 @item -mbranch-cost=@var{number}
10668 @opindex mbranch-cost=@var{number}
10669 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10670 preferred over conditional code, if it is 2, then the opposite will
10671 apply.
10672
10673 @item -mflush-trap=@var{number}
10674 @opindex mflush-trap=@var{number}
10675 Specifies the trap number to use to flush the cache.  The default is
10676 12.  Valid numbers are between 0 and 15 inclusive.
10677
10678 @item -mno-flush-trap
10679 @opindex mno-flush-trap
10680 Specifies that the cache cannot be flushed by using a trap.
10681
10682 @item -mflush-func=@var{name}
10683 @opindex mflush-func=@var{name}
10684 Specifies the name of the operating system function to call to flush
10685 the cache.  The default is @emph{_flush_cache}, but a function call
10686 will only be used if a trap is not available.
10687
10688 @item -mno-flush-func
10689 @opindex mno-flush-func
10690 Indicates that there is no OS function for flushing the cache.
10691
10692 @end table
10693
10694 @node M680x0 Options
10695 @subsection M680x0 Options
10696 @cindex M680x0 options
10697
10698 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
10699 The default settings depend on which architecture was selected when
10700 the compiler was configured; the defaults for the most common choices
10701 are given below.
10702
10703 @table @gcctabopt
10704 @item -march=@var{arch}
10705 @opindex march
10706 Generate code for a specific M680x0 or ColdFire instruction set
10707 architecture.  Permissible values of @var{arch} for M680x0
10708 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
10709 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
10710 architectures are selected according to Freescale's ISA classification
10711 and the permissible values are: @samp{isaa}, @samp{isaaplus},
10712 @samp{isab} and @samp{isac}.
10713
10714 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
10715 code for a ColdFire target.  The @var{arch} in this macro is one of the
10716 @option{-march} arguments given above.
10717
10718 When used together, @option{-march} and @option{-mtune} select code
10719 that runs on a family of similar processors but that is optimized
10720 for a particular microarchitecture.
10721
10722 @item -mcpu=@var{cpu}
10723 @opindex mcpu
10724 Generate code for a specific M680x0 or ColdFire processor.
10725 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
10726 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
10727 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
10728 below, which also classifies the CPUs into families:
10729
10730 @multitable @columnfractions 0.20 0.80
10731 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
10732 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
10733 @item @samp{5206e} @tab @samp{5206e}
10734 @item @samp{5208} @tab @samp{5207} @samp{5208}
10735 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
10736 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
10737 @item @samp{5216} @tab @samp{5214} @samp{5216}
10738 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
10739 @item @samp{5225} @tab @samp{5224} @samp{5225}
10740 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
10741 @item @samp{5249} @tab @samp{5249}
10742 @item @samp{5250} @tab @samp{5250}
10743 @item @samp{5271} @tab @samp{5270} @samp{5271}
10744 @item @samp{5272} @tab @samp{5272}
10745 @item @samp{5275} @tab @samp{5274} @samp{5275}
10746 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
10747 @item @samp{5307} @tab @samp{5307}
10748 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
10749 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
10750 @item @samp{5407} @tab @samp{5407}
10751 @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}
10752 @end multitable
10753
10754 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
10755 @var{arch} is compatible with @var{cpu}.  Other combinations of
10756 @option{-mcpu} and @option{-march} are rejected.
10757
10758 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
10759 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
10760 where the value of @var{family} is given by the table above.
10761
10762 @item -mtune=@var{tune}
10763 @opindex mtune
10764 Tune the code for a particular microarchitecture, within the
10765 constraints set by @option{-march} and @option{-mcpu}.
10766 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
10767 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
10768 and @samp{cpu32}.  The ColdFire microarchitectures
10769 are: @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
10770
10771 You can also use @option{-mtune=68020-40} for code that needs
10772 to run relatively well on 68020, 68030 and 68040 targets.
10773 @option{-mtune=68020-60} is similar but includes 68060 targets
10774 as well.  These two options select the same tuning decisions as
10775 @option{-m68020-40} and @option{-m68020-60} respectively.
10776
10777 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
10778 when tuning for 680x0 architecture @var{arch}.  It also defines
10779 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
10780 option is used.  If gcc is tuning for a range of architectures,
10781 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
10782 it defines the macros for every architecture in the range.
10783
10784 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
10785 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
10786 of the arguments given above.
10787
10788 @item -m68000
10789 @itemx -mc68000
10790 @opindex m68000
10791 @opindex mc68000
10792 Generate output for a 68000.  This is the default
10793 when the compiler is configured for 68000-based systems.
10794 It is equivalent to @option{-march=68000}.
10795
10796 Use this option for microcontrollers with a 68000 or EC000 core,
10797 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10798
10799 @item -m68010
10800 @opindex m68010
10801 Generate output for a 68010.  This is the default
10802 when the compiler is configured for 68010-based systems.
10803 It is equivalent to @option{-march=68010}.
10804
10805 @item -m68020
10806 @itemx -mc68020
10807 @opindex m68020
10808 @opindex mc68020
10809 Generate output for a 68020.  This is the default
10810 when the compiler is configured for 68020-based systems.
10811 It is equivalent to @option{-march=68020}.
10812
10813 @item -m68030
10814 @opindex m68030
10815 Generate output for a 68030.  This is the default when the compiler is
10816 configured for 68030-based systems.  It is equivalent to
10817 @option{-march=68030}.
10818
10819 @item -m68040
10820 @opindex m68040
10821 Generate output for a 68040.  This is the default when the compiler is
10822 configured for 68040-based systems.  It is equivalent to
10823 @option{-march=68040}.
10824
10825 This option inhibits the use of 68881/68882 instructions that have to be
10826 emulated by software on the 68040.  Use this option if your 68040 does not
10827 have code to emulate those instructions.
10828
10829 @item -m68060
10830 @opindex m68060
10831 Generate output for a 68060.  This is the default when the compiler is
10832 configured for 68060-based systems.  It is equivalent to
10833 @option{-march=68060}.
10834
10835 This option inhibits the use of 68020 and 68881/68882 instructions that
10836 have to be emulated by software on the 68060.  Use this option if your 68060
10837 does not have code to emulate those instructions.
10838
10839 @item -mcpu32
10840 @opindex mcpu32
10841 Generate output for a CPU32.  This is the default
10842 when the compiler is configured for CPU32-based systems.
10843 It is equivalent to @option{-march=cpu32}.
10844
10845 Use this option for microcontrollers with a
10846 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
10847 68336, 68340, 68341, 68349 and 68360.
10848
10849 @item -m5200
10850 @opindex m5200
10851 Generate output for a 520X ColdFire CPU.  This is the default
10852 when the compiler is configured for 520X-based systems.
10853 It is equivalent to @option{-mcpu=5206}, and is now deprecated
10854 in favor of that option.
10855
10856 Use this option for microcontroller with a 5200 core, including
10857 the MCF5202, MCF5203, MCF5204 and MCF5206.
10858
10859 @item -m5206e
10860 @opindex m5206e
10861 Generate output for a 5206e ColdFire CPU.  The option is now
10862 deprecated in favor of the equivalent @option{-mcpu=5206e}.
10863
10864 @item -m528x
10865 @opindex m528x
10866 Generate output for a member of the ColdFire 528X family.
10867 The option is now deprecated in favor of the equivalent
10868 @option{-mcpu=528x}.
10869
10870 @item -m5307
10871 @opindex m5307
10872 Generate output for a ColdFire 5307 CPU.  The option is now deprecated
10873 in favor of the equivalent @option{-mcpu=5307}.
10874
10875 @item -m5407
10876 @opindex m5407
10877 Generate output for a ColdFire 5407 CPU.  The option is now deprecated
10878 in favor of the equivalent @option{-mcpu=5407}.
10879
10880 @item -mcfv4e
10881 @opindex mcfv4e
10882 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
10883 This includes use of hardware floating point instructions.
10884 The option is equivalent to @option{-mcpu=547x}, and is now
10885 deprecated in favor of that option.
10886
10887 @item -m68020-40
10888 @opindex m68020-40
10889 Generate output for a 68040, without using any of the new instructions.
10890 This results in code which can run relatively efficiently on either a
10891 68020/68881 or a 68030 or a 68040.  The generated code does use the
10892 68881 instructions that are emulated on the 68040.
10893
10894 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
10895
10896 @item -m68020-60
10897 @opindex m68020-60
10898 Generate output for a 68060, without using any of the new instructions.
10899 This results in code which can run relatively efficiently on either a
10900 68020/68881 or a 68030 or a 68040.  The generated code does use the
10901 68881 instructions that are emulated on the 68060.
10902
10903 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
10904
10905 @item -mhard-float
10906 @itemx -m68881
10907 @opindex mhard-float
10908 @opindex m68881
10909 Generate floating-point instructions.  This is the default for 68020
10910 and above, and for ColdFire devices that have an FPU.  It defines the
10911 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
10912 on ColdFire targets.
10913
10914 @item -msoft-float
10915 @opindex msoft-float
10916 Do not generate floating-point instructions; use library calls instead.
10917 This is the default for 68000, 68010, and 68832 targets.  It is also
10918 the default for ColdFire devices that have no FPU.
10919
10920 @item -mdiv
10921 @itemx -mno-div
10922 @opindex mdiv
10923 @opindex mno-div
10924 Generate (do not generate) ColdFire hardware divide and remainder
10925 instructions.  If @option{-march} is used without @option{-mcpu},
10926 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
10927 architectures.  Otherwise, the default is taken from the target CPU
10928 (either the default CPU, or the one specified by @option{-mcpu}).  For
10929 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
10930 @option{-mcpu=5206e}.
10931
10932 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
10933
10934 @item -mshort
10935 @opindex mshort
10936 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10937 Additionally, parameters passed on the stack are also aligned to a
10938 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10939
10940 @item -mno-short
10941 @opindex -mno-short
10942 Do not consider type @code{int} to be 16 bits wide.  This is the default.
10943
10944 @item -mnobitfield
10945 @itemx -mno-bitfield
10946 @opindex mnobitfield
10947 @opindex mno-bitfield
10948 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10949 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10950
10951 @item -mbitfield
10952 @opindex mbitfield
10953 Do use the bit-field instructions.  The @option{-m68020} option implies
10954 @option{-mbitfield}.  This is the default if you use a configuration
10955 designed for a 68020.
10956
10957 @item -mrtd
10958 @opindex mrtd
10959 Use a different function-calling convention, in which functions
10960 that take a fixed number of arguments return with the @code{rtd}
10961 instruction, which pops their arguments while returning.  This
10962 saves one instruction in the caller since there is no need to pop
10963 the arguments there.
10964
10965 This calling convention is incompatible with the one normally
10966 used on Unix, so you cannot use it if you need to call libraries
10967 compiled with the Unix compiler.
10968
10969 Also, you must provide function prototypes for all functions that
10970 take variable numbers of arguments (including @code{printf});
10971 otherwise incorrect code will be generated for calls to those
10972 functions.
10973
10974 In addition, seriously incorrect code will result if you call a
10975 function with too many arguments.  (Normally, extra arguments are
10976 harmlessly ignored.)
10977
10978 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10979 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10980
10981 @item -mno-rtd
10982 @opindex mno-rtd
10983 Do not use the calling conventions selected by @option{-mrtd}.
10984 This is the default.
10985
10986 @item -malign-int
10987 @itemx -mno-align-int
10988 @opindex malign-int
10989 @opindex mno-align-int
10990 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10991 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10992 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10993 Aligning variables on 32-bit boundaries produces code that runs somewhat
10994 faster on processors with 32-bit busses at the expense of more memory.
10995
10996 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
10997 align structures containing the above types  differently than
10998 most published application binary interface specifications for the m68k.
10999
11000 @item -mpcrel
11001 @opindex mpcrel
11002 Use the pc-relative addressing mode of the 68000 directly, instead of
11003 using a global offset table.  At present, this option implies @option{-fpic},
11004 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
11005 not presently supported with @option{-mpcrel}, though this could be supported for
11006 68020 and higher processors.
11007
11008 @item -mno-strict-align
11009 @itemx -mstrict-align
11010 @opindex mno-strict-align
11011 @opindex mstrict-align
11012 Do not (do) assume that unaligned memory references will be handled by
11013 the system.
11014
11015 @item -msep-data
11016 Generate code that allows the data segment to be located in a different
11017 area of memory from the text segment.  This allows for execute in place in
11018 an environment without virtual memory management.  This option implies
11019 @option{-fPIC}.
11020
11021 @item -mno-sep-data
11022 Generate code that assumes that the data segment follows the text segment.
11023 This is the default.
11024
11025 @item -mid-shared-library
11026 Generate code that supports shared libraries via the library ID method.
11027 This allows for execute in place and shared libraries in an environment
11028 without virtual memory management.  This option implies @option{-fPIC}.
11029
11030 @item -mno-id-shared-library
11031 Generate code that doesn't assume ID based shared libraries are being used.
11032 This is the default.
11033
11034 @item -mshared-library-id=n
11035 Specified the identification number of the ID based shared library being
11036 compiled.  Specifying a value of 0 will generate more compact code, specifying
11037 other values will force the allocation of that number to the current
11038 library but is no more space or time efficient than omitting this option.
11039
11040 @end table
11041
11042 @node M68hc1x Options
11043 @subsection M68hc1x Options
11044 @cindex M68hc1x options
11045
11046 These are the @samp{-m} options defined for the 68hc11 and 68hc12
11047 microcontrollers.  The default values for these options depends on
11048 which style of microcontroller was selected when the compiler was configured;
11049 the defaults for the most common choices are given below.
11050
11051 @table @gcctabopt
11052 @item -m6811
11053 @itemx -m68hc11
11054 @opindex m6811
11055 @opindex m68hc11
11056 Generate output for a 68HC11.  This is the default
11057 when the compiler is configured for 68HC11-based systems.
11058
11059 @item -m6812
11060 @itemx -m68hc12
11061 @opindex m6812
11062 @opindex m68hc12
11063 Generate output for a 68HC12.  This is the default
11064 when the compiler is configured for 68HC12-based systems.
11065
11066 @item -m68S12
11067 @itemx -m68hcs12
11068 @opindex m68S12
11069 @opindex m68hcs12
11070 Generate output for a 68HCS12.
11071
11072 @item -mauto-incdec
11073 @opindex mauto-incdec
11074 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
11075 addressing modes.
11076
11077 @item -minmax
11078 @itemx -nominmax
11079 @opindex minmax
11080 @opindex mnominmax
11081 Enable the use of 68HC12 min and max instructions.
11082
11083 @item -mlong-calls
11084 @itemx -mno-long-calls
11085 @opindex mlong-calls
11086 @opindex mno-long-calls
11087 Treat all calls as being far away (near).  If calls are assumed to be
11088 far away, the compiler will use the @code{call} instruction to
11089 call a function and the @code{rtc} instruction for returning.
11090
11091 @item -mshort
11092 @opindex mshort
11093 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11094
11095 @item -msoft-reg-count=@var{count}
11096 @opindex msoft-reg-count
11097 Specify the number of pseudo-soft registers which are used for the
11098 code generation.  The maximum number is 32.  Using more pseudo-soft
11099 register may or may not result in better code depending on the program.
11100 The default is 4 for 68HC11 and 2 for 68HC12.
11101
11102 @end table
11103
11104 @node MCore Options
11105 @subsection MCore Options
11106 @cindex MCore options
11107
11108 These are the @samp{-m} options defined for the Motorola M*Core
11109 processors.
11110
11111 @table @gcctabopt
11112
11113 @item -mhardlit
11114 @itemx -mno-hardlit
11115 @opindex mhardlit
11116 @opindex mno-hardlit
11117 Inline constants into the code stream if it can be done in two
11118 instructions or less.
11119
11120 @item -mdiv
11121 @itemx -mno-div
11122 @opindex mdiv
11123 @opindex mno-div
11124 Use the divide instruction.  (Enabled by default).
11125
11126 @item -mrelax-immediate
11127 @itemx -mno-relax-immediate
11128 @opindex mrelax-immediate
11129 @opindex mno-relax-immediate
11130 Allow arbitrary sized immediates in bit operations.
11131
11132 @item -mwide-bitfields
11133 @itemx -mno-wide-bitfields
11134 @opindex mwide-bitfields
11135 @opindex mno-wide-bitfields
11136 Always treat bit-fields as int-sized.
11137
11138 @item -m4byte-functions
11139 @itemx -mno-4byte-functions
11140 @opindex m4byte-functions
11141 @opindex mno-4byte-functions
11142 Force all functions to be aligned to a four byte boundary.
11143
11144 @item -mcallgraph-data
11145 @itemx -mno-callgraph-data
11146 @opindex mcallgraph-data
11147 @opindex mno-callgraph-data
11148 Emit callgraph information.
11149
11150 @item -mslow-bytes
11151 @itemx -mno-slow-bytes
11152 @opindex mslow-bytes
11153 @opindex mno-slow-bytes
11154 Prefer word access when reading byte quantities.
11155
11156 @item -mlittle-endian
11157 @itemx -mbig-endian
11158 @opindex mlittle-endian
11159 @opindex mbig-endian
11160 Generate code for a little endian target.
11161
11162 @item -m210
11163 @itemx -m340
11164 @opindex m210
11165 @opindex m340
11166 Generate code for the 210 processor.
11167 @end table
11168
11169 @node MIPS Options
11170 @subsection MIPS Options
11171 @cindex MIPS options
11172
11173 @table @gcctabopt
11174
11175 @item -EB
11176 @opindex EB
11177 Generate big-endian code.
11178
11179 @item -EL
11180 @opindex EL
11181 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
11182 configurations.
11183
11184 @item -march=@var{arch}
11185 @opindex march
11186 Generate code that will run on @var{arch}, which can be the name of a
11187 generic MIPS ISA, or the name of a particular processor.
11188 The ISA names are:
11189 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
11190 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
11191 The processor names are:
11192 @samp{4kc}, @samp{4km}, @samp{4kp},
11193 @samp{4kec}, @samp{4kem}, @samp{4kep},
11194 @samp{5kc}, @samp{5kf},
11195 @samp{20kc},
11196 @samp{24kc}, @samp{24kf}, @samp{24kx},
11197 @samp{24kec}, @samp{24kef}, @samp{24kex},
11198 @samp{34kc}, @samp{34kf}, @samp{34kx},
11199 @samp{m4k},
11200 @samp{orion},
11201 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
11202 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
11203 @samp{rm7000}, @samp{rm9000},
11204 @samp{sb1},
11205 @samp{sr71000},
11206 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
11207 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
11208 The special value @samp{from-abi} selects the
11209 most compatible architecture for the selected ABI (that is,
11210 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
11211
11212 In processor names, a final @samp{000} can be abbreviated as @samp{k}
11213 (for example, @samp{-march=r2k}).  Prefixes are optional, and
11214 @samp{vr} may be written @samp{r}.
11215
11216 GCC defines two macros based on the value of this option.  The first
11217 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
11218 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
11219 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
11220 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
11221 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
11222
11223 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
11224 above.  In other words, it will have the full prefix and will not
11225 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
11226 the macro names the resolved architecture (either @samp{"mips1"} or
11227 @samp{"mips3"}).  It names the default architecture when no
11228 @option{-march} option is given.
11229
11230 @item -mtune=@var{arch}
11231 @opindex mtune
11232 Optimize for @var{arch}.  Among other things, this option controls
11233 the way instructions are scheduled, and the perceived cost of arithmetic
11234 operations.  The list of @var{arch} values is the same as for
11235 @option{-march}.
11236
11237 When this option is not used, GCC will optimize for the processor
11238 specified by @option{-march}.  By using @option{-march} and
11239 @option{-mtune} together, it is possible to generate code that will
11240 run on a family of processors, but optimize the code for one
11241 particular member of that family.
11242
11243 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
11244 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
11245 @samp{-march} ones described above.
11246
11247 @item -mips1
11248 @opindex mips1
11249 Equivalent to @samp{-march=mips1}.
11250
11251 @item -mips2
11252 @opindex mips2
11253 Equivalent to @samp{-march=mips2}.
11254
11255 @item -mips3
11256 @opindex mips3
11257 Equivalent to @samp{-march=mips3}.
11258
11259 @item -mips4
11260 @opindex mips4
11261 Equivalent to @samp{-march=mips4}.
11262
11263 @item -mips32
11264 @opindex mips32
11265 Equivalent to @samp{-march=mips32}.
11266
11267 @item -mips32r2
11268 @opindex mips32r2
11269 Equivalent to @samp{-march=mips32r2}.
11270
11271 @item -mips64
11272 @opindex mips64
11273 Equivalent to @samp{-march=mips64}.
11274
11275 @item -mips16
11276 @itemx -mno-mips16
11277 @opindex mips16
11278 @opindex mno-mips16
11279 Generate (do not generate) MIPS16 code.  If GCC is targetting a
11280 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
11281
11282 @item -mabi=32
11283 @itemx -mabi=o64
11284 @itemx -mabi=n32
11285 @itemx -mabi=64
11286 @itemx -mabi=eabi
11287 @opindex mabi=32
11288 @opindex mabi=o64
11289 @opindex mabi=n32
11290 @opindex mabi=64
11291 @opindex mabi=eabi
11292 Generate code for the given ABI@.
11293
11294 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
11295 generates 64-bit code when you select a 64-bit architecture, but you
11296 can use @option{-mgp32} to get 32-bit code instead.
11297
11298 For information about the O64 ABI, see
11299 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
11300
11301 GCC supports a variant of the o32 ABI in which floating-point registers
11302 are 64 rather than 32 bits wide.  You can select this combination with
11303 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
11304 and @samp{mfhc1} instructions and is therefore only supported for
11305 MIPS32R2 processors.
11306
11307 The register assignments for arguments and return values remain the
11308 same, but each scalar value is passed in a single 64-bit register
11309 rather than a pair of 32-bit registers.  For example, scalar
11310 floating-point values are returned in @samp{$f0} only, not a
11311 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
11312 remains the same, but all 64 bits are saved.
11313
11314 @item -mabicalls
11315 @itemx -mno-abicalls
11316 @opindex mabicalls
11317 @opindex mno-abicalls
11318 Generate (do not generate) code that is suitable for SVR4-style
11319 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
11320 systems.
11321
11322 @item -mshared
11323 @itemx -mno-shared
11324 Generate (do not generate) code that is fully position-independent,
11325 and that can therefore be linked into shared libraries.  This option
11326 only affects @option{-mabicalls}.
11327
11328 All @option{-mabicalls} code has traditionally been position-independent,
11329 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
11330 as an extension, the GNU toolchain allows executables to use absolute
11331 accesses for locally-binding symbols.  It can also use shorter GP
11332 initialization sequences and generate direct calls to locally-defined
11333 functions.  This mode is selected by @option{-mno-shared}.
11334
11335 @option{-mno-shared} depends on binutils 2.16 or higher and generates
11336 objects that can only be linked by the GNU linker.  However, the option
11337 does not affect the ABI of the final executable; it only affects the ABI
11338 of relocatable objects.  Using @option{-mno-shared} will generally make
11339 executables both smaller and quicker.
11340
11341 @option{-mshared} is the default.
11342
11343 @item -mxgot
11344 @itemx -mno-xgot
11345 @opindex mxgot
11346 @opindex mno-xgot
11347 Lift (do not lift) the usual restrictions on the size of the global
11348 offset table.
11349
11350 GCC normally uses a single instruction to load values from the GOT@.
11351 While this is relatively efficient, it will only work if the GOT
11352 is smaller than about 64k.  Anything larger will cause the linker
11353 to report an error such as:
11354
11355 @cindex relocation truncated to fit (MIPS)
11356 @smallexample
11357 relocation truncated to fit: R_MIPS_GOT16 foobar
11358 @end smallexample
11359
11360 If this happens, you should recompile your code with @option{-mxgot}.
11361 It should then work with very large GOTs, although it will also be
11362 less efficient, since it will take three instructions to fetch the
11363 value of a global symbol.
11364
11365 Note that some linkers can create multiple GOTs.  If you have such a
11366 linker, you should only need to use @option{-mxgot} when a single object
11367 file accesses more than 64k's worth of GOT entries.  Very few do.
11368
11369 These options have no effect unless GCC is generating position
11370 independent code.
11371
11372 @item -mgp32
11373 @opindex mgp32
11374 Assume that general-purpose registers are 32 bits wide.
11375
11376 @item -mgp64
11377 @opindex mgp64
11378 Assume that general-purpose registers are 64 bits wide.
11379
11380 @item -mfp32
11381 @opindex mfp32
11382 Assume that floating-point registers are 32 bits wide.
11383
11384 @item -mfp64
11385 @opindex mfp64
11386 Assume that floating-point registers are 64 bits wide.
11387
11388 @item -mhard-float
11389 @opindex mhard-float
11390 Use floating-point coprocessor instructions.
11391
11392 @item -msoft-float
11393 @opindex msoft-float
11394 Do not use floating-point coprocessor instructions.  Implement
11395 floating-point calculations using library calls instead.
11396
11397 @item -msingle-float
11398 @opindex msingle-float
11399 Assume that the floating-point coprocessor only supports single-precision
11400 operations.
11401
11402 @itemx -mdouble-float
11403 @opindex mdouble-float
11404 Assume that the floating-point coprocessor supports double-precision
11405 operations.  This is the default.
11406
11407 @itemx -mdsp
11408 @itemx -mno-dsp
11409 @opindex mdsp
11410 @opindex mno-dsp
11411 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
11412
11413 @itemx -mdspr2
11414 @itemx -mno-dspr2
11415 @opindex mdspr2
11416 @opindex mno-dspr2
11417 Use (do not use) the MIPS DSP ASE REV 2.  @xref{MIPS DSP Built-in Functions}.
11418 The option @option{-mdspr2} implies @option{-mdsp}.
11419
11420 @itemx -mpaired-single
11421 @itemx -mno-paired-single
11422 @opindex mpaired-single
11423 @opindex mno-paired-single
11424 Use (do not use) paired-single floating-point instructions.
11425 @xref{MIPS Paired-Single Support}.  This option can only be used
11426 when generating 64-bit code and requires hardware floating-point
11427 support to be enabled.
11428
11429 @itemx -mips3d
11430 @itemx -mno-mips3d
11431 @opindex mips3d
11432 @opindex mno-mips3d
11433 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
11434 The option @option{-mips3d} implies @option{-mpaired-single}.
11435
11436 @item -mlong64
11437 @opindex mlong64
11438 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
11439 an explanation of the default and the way that the pointer size is
11440 determined.
11441
11442 @item -mlong32
11443 @opindex mlong32
11444 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
11445
11446 The default size of @code{int}s, @code{long}s and pointers depends on
11447 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
11448 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
11449 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
11450 or the same size as integer registers, whichever is smaller.
11451
11452 @item -msym32
11453 @itemx -mno-sym32
11454 @opindex msym32
11455 @opindex mno-sym32
11456 Assume (do not assume) that all symbols have 32-bit values, regardless
11457 of the selected ABI@.  This option is useful in combination with
11458 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11459 to generate shorter and faster references to symbolic addresses.
11460
11461 @item -G @var{num}
11462 @opindex G
11463 @cindex smaller data references (MIPS)
11464 @cindex gp-relative references (MIPS)
11465 Put global and static items less than or equal to @var{num} bytes into
11466 the small data or bss section instead of the normal data or bss section.
11467 This allows the data to be accessed using a single instruction.
11468
11469 All modules should be compiled with the same @option{-G @var{num}}
11470 value.
11471
11472 @item -membedded-data
11473 @itemx -mno-embedded-data
11474 @opindex membedded-data
11475 @opindex mno-embedded-data
11476 Allocate variables to the read-only data section first if possible, then
11477 next in the small data section if possible, otherwise in data.  This gives
11478 slightly slower code than the default, but reduces the amount of RAM required
11479 when executing, and thus may be preferred for some embedded systems.
11480
11481 @item -muninit-const-in-rodata
11482 @itemx -mno-uninit-const-in-rodata
11483 @opindex muninit-const-in-rodata
11484 @opindex mno-uninit-const-in-rodata
11485 Put uninitialized @code{const} variables in the read-only data section.
11486 This option is only meaningful in conjunction with @option{-membedded-data}.
11487
11488 @item -msplit-addresses
11489 @itemx -mno-split-addresses
11490 @opindex msplit-addresses
11491 @opindex mno-split-addresses
11492 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
11493 relocation operators.  This option has been superseded by
11494 @option{-mexplicit-relocs} but is retained for backwards compatibility.
11495
11496 @item -mexplicit-relocs
11497 @itemx -mno-explicit-relocs
11498 @opindex mexplicit-relocs
11499 @opindex mno-explicit-relocs
11500 Use (do not use) assembler relocation operators when dealing with symbolic
11501 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
11502 is to use assembler macros instead.
11503
11504 @option{-mexplicit-relocs} is the default if GCC was configured
11505 to use an assembler that supports relocation operators.
11506
11507 @item -mcheck-zero-division
11508 @itemx -mno-check-zero-division
11509 @opindex mcheck-zero-division
11510 @opindex mno-check-zero-division
11511 Trap (do not trap) on integer division by zero.
11512
11513 The default is @option{-mcheck-zero-division}.
11514
11515 @item -mdivide-traps
11516 @itemx -mdivide-breaks
11517 @opindex mdivide-traps
11518 @opindex mdivide-breaks
11519 MIPS systems check for division by zero by generating either a
11520 conditional trap or a break instruction.  Using traps results in
11521 smaller code, but is only supported on MIPS II and later.  Also, some
11522 versions of the Linux kernel have a bug that prevents trap from
11523 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
11524 allow conditional traps on architectures that support them and
11525 @option{-mdivide-breaks} to force the use of breaks.
11526
11527 The default is usually @option{-mdivide-traps}, but this can be
11528 overridden at configure time using @option{--with-divide=breaks}.
11529 Divide-by-zero checks can be completely disabled using
11530 @option{-mno-check-zero-division}.
11531
11532 @item -mmemcpy
11533 @itemx -mno-memcpy
11534 @opindex mmemcpy
11535 @opindex mno-memcpy
11536 Force (do not force) the use of @code{memcpy()} for non-trivial block
11537 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
11538 most constant-sized copies.
11539
11540 @item -mlong-calls
11541 @itemx -mno-long-calls
11542 @opindex mlong-calls
11543 @opindex mno-long-calls
11544 Disable (do not disable) use of the @code{jal} instruction.  Calling
11545 functions using @code{jal} is more efficient but requires the caller
11546 and callee to be in the same 256 megabyte segment.
11547
11548 This option has no effect on abicalls code.  The default is
11549 @option{-mno-long-calls}.
11550
11551 @item -mmad
11552 @itemx -mno-mad
11553 @opindex mmad
11554 @opindex mno-mad
11555 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
11556 instructions, as provided by the R4650 ISA@.
11557
11558 @item -mfused-madd
11559 @itemx -mno-fused-madd
11560 @opindex mfused-madd
11561 @opindex mno-fused-madd
11562 Enable (disable) use of the floating point multiply-accumulate
11563 instructions, when they are available.  The default is
11564 @option{-mfused-madd}.
11565
11566 When multiply-accumulate instructions are used, the intermediate
11567 product is calculated to infinite precision and is not subject to
11568 the FCSR Flush to Zero bit.  This may be undesirable in some
11569 circumstances.
11570
11571 @item -nocpp
11572 @opindex nocpp
11573 Tell the MIPS assembler to not run its preprocessor over user
11574 assembler files (with a @samp{.s} suffix) when assembling them.
11575
11576 @item -mfix-r4000
11577 @itemx -mno-fix-r4000
11578 @opindex mfix-r4000
11579 @opindex mno-fix-r4000
11580 Work around certain R4000 CPU errata:
11581 @itemize @minus
11582 @item
11583 A double-word or a variable shift may give an incorrect result if executed
11584 immediately after starting an integer division.
11585 @item
11586 A double-word or a variable shift may give an incorrect result if executed
11587 while an integer multiplication is in progress.
11588 @item
11589 An integer division may give an incorrect result if started in a delay slot
11590 of a taken branch or a jump.
11591 @end itemize
11592
11593 @item -mfix-r4400
11594 @itemx -mno-fix-r4400
11595 @opindex mfix-r4400
11596 @opindex mno-fix-r4400
11597 Work around certain R4400 CPU errata:
11598 @itemize @minus
11599 @item
11600 A double-word or a variable shift may give an incorrect result if executed
11601 immediately after starting an integer division.
11602 @end itemize
11603
11604 @item -mfix-vr4120
11605 @itemx -mno-fix-vr4120
11606 @opindex mfix-vr4120
11607 Work around certain VR4120 errata:
11608 @itemize @minus
11609 @item
11610 @code{dmultu} does not always produce the correct result.
11611 @item
11612 @code{div} and @code{ddiv} do not always produce the correct result if one
11613 of the operands is negative.
11614 @end itemize
11615 The workarounds for the division errata rely on special functions in
11616 @file{libgcc.a}.  At present, these functions are only provided by
11617 the @code{mips64vr*-elf} configurations.
11618
11619 Other VR4120 errata require a nop to be inserted between certain pairs of
11620 instructions.  These errata are handled by the assembler, not by GCC itself.
11621
11622 @item -mfix-vr4130
11623 @opindex mfix-vr4130
11624 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11625 workarounds are implemented by the assembler rather than by GCC,
11626 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11627 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11628 instructions are available instead.
11629
11630 @item -mfix-sb1
11631 @itemx -mno-fix-sb1
11632 @opindex mfix-sb1
11633 Work around certain SB-1 CPU core errata.
11634 (This flag currently works around the SB-1 revision 2
11635 ``F1'' and ``F2'' floating point errata.)
11636
11637 @item -mflush-func=@var{func}
11638 @itemx -mno-flush-func
11639 @opindex mflush-func
11640 Specifies the function to call to flush the I and D caches, or to not
11641 call any such function.  If called, the function must take the same
11642 arguments as the common @code{_flush_func()}, that is, the address of the
11643 memory range for which the cache is being flushed, the size of the
11644 memory range, and the number 3 (to flush both caches).  The default
11645 depends on the target GCC was configured for, but commonly is either
11646 @samp{_flush_func} or @samp{__cpu_flush}.
11647
11648 @item -mbranch-likely
11649 @itemx -mno-branch-likely
11650 @opindex mbranch-likely
11651 @opindex mno-branch-likely
11652 Enable or disable use of Branch Likely instructions, regardless of the
11653 default for the selected architecture.  By default, Branch Likely
11654 instructions may be generated if they are supported by the selected
11655 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11656 and processors which implement those architectures; for those, Branch
11657 Likely instructions will not be generated by default because the MIPS32
11658 and MIPS64 architectures specifically deprecate their use.
11659
11660 @item -mfp-exceptions
11661 @itemx -mno-fp-exceptions
11662 @opindex mfp-exceptions
11663 Specifies whether FP exceptions are enabled.  This affects how we schedule
11664 FP instructions for some processors.  The default is that FP exceptions are
11665 enabled.
11666
11667 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11668 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11669 FP pipe.
11670
11671 @item -mvr4130-align
11672 @itemx -mno-vr4130-align
11673 @opindex mvr4130-align
11674 The VR4130 pipeline is two-way superscalar, but can only issue two
11675 instructions together if the first one is 8-byte aligned.  When this
11676 option is enabled, GCC will align pairs of instructions that it
11677 thinks should execute in parallel.
11678
11679 This option only has an effect when optimizing for the VR4130.
11680 It normally makes code faster, but at the expense of making it bigger.
11681 It is enabled by default at optimization level @option{-O3}.
11682 @end table
11683
11684 @node MMIX Options
11685 @subsection MMIX Options
11686 @cindex MMIX Options
11687
11688 These options are defined for the MMIX:
11689
11690 @table @gcctabopt
11691 @item -mlibfuncs
11692 @itemx -mno-libfuncs
11693 @opindex mlibfuncs
11694 @opindex mno-libfuncs
11695 Specify that intrinsic library functions are being compiled, passing all
11696 values in registers, no matter the size.
11697
11698 @item -mepsilon
11699 @itemx -mno-epsilon
11700 @opindex mepsilon
11701 @opindex mno-epsilon
11702 Generate floating-point comparison instructions that compare with respect
11703 to the @code{rE} epsilon register.
11704
11705 @item -mabi=mmixware
11706 @itemx -mabi=gnu
11707 @opindex mabi-mmixware
11708 @opindex mabi=gnu
11709 Generate code that passes function parameters and return values that (in
11710 the called function) are seen as registers @code{$0} and up, as opposed to
11711 the GNU ABI which uses global registers @code{$231} and up.
11712
11713 @item -mzero-extend
11714 @itemx -mno-zero-extend
11715 @opindex mzero-extend
11716 @opindex mno-zero-extend
11717 When reading data from memory in sizes shorter than 64 bits, use (do not
11718 use) zero-extending load instructions by default, rather than
11719 sign-extending ones.
11720
11721 @item -mknuthdiv
11722 @itemx -mno-knuthdiv
11723 @opindex mknuthdiv
11724 @opindex mno-knuthdiv
11725 Make the result of a division yielding a remainder have the same sign as
11726 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11727 remainder follows the sign of the dividend.  Both methods are
11728 arithmetically valid, the latter being almost exclusively used.
11729
11730 @item -mtoplevel-symbols
11731 @itemx -mno-toplevel-symbols
11732 @opindex mtoplevel-symbols
11733 @opindex mno-toplevel-symbols
11734 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11735 code can be used with the @code{PREFIX} assembly directive.
11736
11737 @item -melf
11738 @opindex melf
11739 Generate an executable in the ELF format, rather than the default
11740 @samp{mmo} format used by the @command{mmix} simulator.
11741
11742 @item -mbranch-predict
11743 @itemx -mno-branch-predict
11744 @opindex mbranch-predict
11745 @opindex mno-branch-predict
11746 Use (do not use) the probable-branch instructions, when static branch
11747 prediction indicates a probable branch.
11748
11749 @item -mbase-addresses
11750 @itemx -mno-base-addresses
11751 @opindex mbase-addresses
11752 @opindex mno-base-addresses
11753 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11754 base address automatically generates a request (handled by the assembler
11755 and the linker) for a constant to be set up in a global register.  The
11756 register is used for one or more base address requests within the range 0
11757 to 255 from the value held in the register.  The generally leads to short
11758 and fast code, but the number of different data items that can be
11759 addressed is limited.  This means that a program that uses lots of static
11760 data may require @option{-mno-base-addresses}.
11761
11762 @item -msingle-exit
11763 @itemx -mno-single-exit
11764 @opindex msingle-exit
11765 @opindex mno-single-exit
11766 Force (do not force) generated code to have a single exit point in each
11767 function.
11768 @end table
11769
11770 @node MN10300 Options
11771 @subsection MN10300 Options
11772 @cindex MN10300 options
11773
11774 These @option{-m} options are defined for Matsushita MN10300 architectures:
11775
11776 @table @gcctabopt
11777 @item -mmult-bug
11778 @opindex mmult-bug
11779 Generate code to avoid bugs in the multiply instructions for the MN10300
11780 processors.  This is the default.
11781
11782 @item -mno-mult-bug
11783 @opindex mno-mult-bug
11784 Do not generate code to avoid bugs in the multiply instructions for the
11785 MN10300 processors.
11786
11787 @item -mam33
11788 @opindex mam33
11789 Generate code which uses features specific to the AM33 processor.
11790
11791 @item -mno-am33
11792 @opindex mno-am33
11793 Do not generate code which uses features specific to the AM33 processor.  This
11794 is the default.
11795
11796 @item -mreturn-pointer-on-d0
11797 @opindex mreturn-pointer-on-d0
11798 When generating a function which returns a pointer, return the pointer
11799 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11800 only in a0, and attempts to call such functions without a prototype
11801 would result in errors.  Note that this option is on by default; use
11802 @option{-mno-return-pointer-on-d0} to disable it.
11803
11804 @item -mno-crt0
11805 @opindex mno-crt0
11806 Do not link in the C run-time initialization object file.
11807
11808 @item -mrelax
11809 @opindex mrelax
11810 Indicate to the linker that it should perform a relaxation optimization pass
11811 to shorten branches, calls and absolute memory addresses.  This option only
11812 has an effect when used on the command line for the final link step.
11813
11814 This option makes symbolic debugging impossible.
11815 @end table
11816
11817 @node MT Options
11818 @subsection MT Options
11819 @cindex MT options
11820
11821 These @option{-m} options are defined for Morpho MT architectures:
11822
11823 @table @gcctabopt
11824
11825 @item -march=@var{cpu-type}
11826 @opindex march
11827 Generate code that will run on @var{cpu-type}, which is the name of a system
11828 representing a certain processor type.  Possible values for
11829 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
11830 @samp{ms1-16-003} and @samp{ms2}.
11831
11832 When this option is not used, the default is @option{-march=ms1-16-002}.
11833
11834 @item -mbacc
11835 @opindex mbacc
11836 Use byte loads and stores when generating code.
11837
11838 @item -mno-bacc
11839 @opindex mno-bacc
11840 Do not use byte loads and stores when generating code.
11841
11842 @item -msim
11843 @opindex msim
11844 Use simulator runtime
11845
11846 @item -mno-crt0
11847 @opindex mno-crt0
11848 Do not link in the C run-time initialization object file
11849 @file{crti.o}.  Other run-time initialization and termination files
11850 such as @file{startup.o} and @file{exit.o} are still included on the
11851 linker command line.
11852
11853 @end table
11854
11855 @node PDP-11 Options
11856 @subsection PDP-11 Options
11857 @cindex PDP-11 Options
11858
11859 These options are defined for the PDP-11:
11860
11861 @table @gcctabopt
11862 @item -mfpu
11863 @opindex mfpu
11864 Use hardware FPP floating point.  This is the default.  (FIS floating
11865 point on the PDP-11/40 is not supported.)
11866
11867 @item -msoft-float
11868 @opindex msoft-float
11869 Do not use hardware floating point.
11870
11871 @item -mac0
11872 @opindex mac0
11873 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
11874
11875 @item -mno-ac0
11876 @opindex mno-ac0
11877 Return floating-point results in memory.  This is the default.
11878
11879 @item -m40
11880 @opindex m40
11881 Generate code for a PDP-11/40.
11882
11883 @item -m45
11884 @opindex m45
11885 Generate code for a PDP-11/45.  This is the default.
11886
11887 @item -m10
11888 @opindex m10
11889 Generate code for a PDP-11/10.
11890
11891 @item -mbcopy-builtin
11892 @opindex bcopy-builtin
11893 Use inline @code{movmemhi} patterns for copying memory.  This is the
11894 default.
11895
11896 @item -mbcopy
11897 @opindex mbcopy
11898 Do not use inline @code{movmemhi} patterns for copying memory.
11899
11900 @item -mint16
11901 @itemx -mno-int32
11902 @opindex mint16
11903 @opindex mno-int32
11904 Use 16-bit @code{int}.  This is the default.
11905
11906 @item -mint32
11907 @itemx -mno-int16
11908 @opindex mint32
11909 @opindex mno-int16
11910 Use 32-bit @code{int}.
11911
11912 @item -mfloat64
11913 @itemx -mno-float32
11914 @opindex mfloat64
11915 @opindex mno-float32
11916 Use 64-bit @code{float}.  This is the default.
11917
11918 @item -mfloat32
11919 @itemx -mno-float64
11920 @opindex mfloat32
11921 @opindex mno-float64
11922 Use 32-bit @code{float}.
11923
11924 @item -mabshi
11925 @opindex mabshi
11926 Use @code{abshi2} pattern.  This is the default.
11927
11928 @item -mno-abshi
11929 @opindex mno-abshi
11930 Do not use @code{abshi2} pattern.
11931
11932 @item -mbranch-expensive
11933 @opindex mbranch-expensive
11934 Pretend that branches are expensive.  This is for experimenting with
11935 code generation only.
11936
11937 @item -mbranch-cheap
11938 @opindex mbranch-cheap
11939 Do not pretend that branches are expensive.  This is the default.
11940
11941 @item -msplit
11942 @opindex msplit
11943 Generate code for a system with split I&D@.
11944
11945 @item -mno-split
11946 @opindex mno-split
11947 Generate code for a system without split I&D@.  This is the default.
11948
11949 @item -munix-asm
11950 @opindex munix-asm
11951 Use Unix assembler syntax.  This is the default when configured for
11952 @samp{pdp11-*-bsd}.
11953
11954 @item -mdec-asm
11955 @opindex mdec-asm
11956 Use DEC assembler syntax.  This is the default when configured for any
11957 PDP-11 target other than @samp{pdp11-*-bsd}.
11958 @end table
11959
11960 @node PowerPC Options
11961 @subsection PowerPC Options
11962 @cindex PowerPC options
11963
11964 These are listed under @xref{RS/6000 and PowerPC Options}.
11965
11966 @node RS/6000 and PowerPC Options
11967 @subsection IBM RS/6000 and PowerPC Options
11968 @cindex RS/6000 and PowerPC Options
11969 @cindex IBM RS/6000 and PowerPC Options
11970
11971 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11972 @table @gcctabopt
11973 @item -mpower
11974 @itemx -mno-power
11975 @itemx -mpower2
11976 @itemx -mno-power2
11977 @itemx -mpowerpc
11978 @itemx -mno-powerpc
11979 @itemx -mpowerpc-gpopt
11980 @itemx -mno-powerpc-gpopt
11981 @itemx -mpowerpc-gfxopt
11982 @itemx -mno-powerpc-gfxopt
11983 @itemx -mpowerpc64
11984 @itemx -mno-powerpc64
11985 @itemx -mmfcrf
11986 @itemx -mno-mfcrf
11987 @itemx -mpopcntb
11988 @itemx -mno-popcntb
11989 @itemx -mfprnd
11990 @itemx -mno-fprnd
11991 @itemx -mcmpb
11992 @itemx -mno-cmpb
11993 @itemx -mmfpgpr
11994 @itemx -mno-mfpgpr
11995 @itemx -mdfp
11996 @itemx -mno-dfp
11997 @opindex mpower
11998 @opindex mno-power
11999 @opindex mpower2
12000 @opindex mno-power2
12001 @opindex mpowerpc
12002 @opindex mno-powerpc
12003 @opindex mpowerpc-gpopt
12004 @opindex mno-powerpc-gpopt
12005 @opindex mpowerpc-gfxopt
12006 @opindex mno-powerpc-gfxopt
12007 @opindex mpowerpc64
12008 @opindex mno-powerpc64
12009 @opindex mmfcrf
12010 @opindex mno-mfcrf
12011 @opindex mpopcntb
12012 @opindex mno-popcntb
12013 @opindex mfprnd
12014 @opindex mno-fprnd
12015 @opindex mcmpb
12016 @opindex mno-cmpb
12017 @opindex mmfpgpr
12018 @opindex mno-mfpgpr
12019 @opindex mdfp
12020 @opindex mno-dfp
12021 GCC supports two related instruction set architectures for the
12022 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
12023 instructions supported by the @samp{rios} chip set used in the original
12024 RS/6000 systems and the @dfn{PowerPC} instruction set is the
12025 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
12026 the IBM 4xx, 6xx, and follow-on microprocessors.
12027
12028 Neither architecture is a subset of the other.  However there is a
12029 large common subset of instructions supported by both.  An MQ
12030 register is included in processors supporting the POWER architecture.
12031
12032 You use these options to specify which instructions are available on the
12033 processor you are using.  The default value of these options is
12034 determined when configuring GCC@.  Specifying the
12035 @option{-mcpu=@var{cpu_type}} overrides the specification of these
12036 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
12037 rather than the options listed above.
12038
12039 The @option{-mpower} option allows GCC to generate instructions that
12040 are found only in the POWER architecture and to use the MQ register.
12041 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
12042 to generate instructions that are present in the POWER2 architecture but
12043 not the original POWER architecture.
12044
12045 The @option{-mpowerpc} option allows GCC to generate instructions that
12046 are found only in the 32-bit subset of the PowerPC architecture.
12047 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
12048 GCC to use the optional PowerPC architecture instructions in the
12049 General Purpose group, including floating-point square root.  Specifying
12050 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
12051 use the optional PowerPC architecture instructions in the Graphics
12052 group, including floating-point select.
12053
12054 The @option{-mmfcrf} option allows GCC to generate the move from
12055 condition register field instruction implemented on the POWER4
12056 processor and other processors that support the PowerPC V2.01
12057 architecture.
12058 The @option{-mpopcntb} option allows GCC to generate the popcount and
12059 double precision FP reciprocal estimate instruction implemented on the
12060 POWER5 processor and other processors that support the PowerPC V2.02
12061 architecture.
12062 The @option{-mfprnd} option allows GCC to generate the FP round to
12063 integer instructions implemented on the POWER5+ processor and other
12064 processors that support the PowerPC V2.03 architecture.
12065 The @option{-mcmpb} option allows GCC to generate the compare bytes
12066 instruction implemented on the POWER6 processor and other processors
12067 that support the PowerPC V2.05 architecture.
12068 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
12069 general purpose register instructions implemented on the POWER6X
12070 processor and other processors that support the extended PowerPC V2.05
12071 architecture.
12072 The @option{-mdfp} option allows GCC to generate the decimal floating
12073 point instructions implemented on some POWER processors.
12074
12075 The @option{-mpowerpc64} option allows GCC to generate the additional
12076 64-bit instructions that are found in the full PowerPC64 architecture
12077 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
12078 @option{-mno-powerpc64}.
12079
12080 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
12081 will use only the instructions in the common subset of both
12082 architectures plus some special AIX common-mode calls, and will not use
12083 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
12084 permits GCC to use any instruction from either architecture and to
12085 allow use of the MQ register; specify this for the Motorola MPC601.
12086
12087 @item -mnew-mnemonics
12088 @itemx -mold-mnemonics
12089 @opindex mnew-mnemonics
12090 @opindex mold-mnemonics
12091 Select which mnemonics to use in the generated assembler code.  With
12092 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
12093 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
12094 assembler mnemonics defined for the POWER architecture.  Instructions
12095 defined in only one architecture have only one mnemonic; GCC uses that
12096 mnemonic irrespective of which of these options is specified.
12097
12098 GCC defaults to the mnemonics appropriate for the architecture in
12099 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
12100 value of these option.  Unless you are building a cross-compiler, you
12101 should normally not specify either @option{-mnew-mnemonics} or
12102 @option{-mold-mnemonics}, but should instead accept the default.
12103
12104 @item -mcpu=@var{cpu_type}
12105 @opindex mcpu
12106 Set architecture type, register usage, choice of mnemonics, and
12107 instruction scheduling parameters for machine type @var{cpu_type}.
12108 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
12109 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
12110 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
12111 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
12112 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
12113 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
12114 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
12115 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
12116 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
12117 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
12118
12119 @option{-mcpu=common} selects a completely generic processor.  Code
12120 generated under this option will run on any POWER or PowerPC processor.
12121 GCC will use only the instructions in the common subset of both
12122 architectures, and will not use the MQ register.  GCC assumes a generic
12123 processor model for scheduling purposes.
12124
12125 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
12126 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
12127 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
12128 types, with an appropriate, generic processor model assumed for
12129 scheduling purposes.
12130
12131 The other options specify a specific processor.  Code generated under
12132 those options will run best on that processor, and may not run at all on
12133 others.
12134
12135 The @option{-mcpu} options automatically enable or disable the
12136 following options:
12137
12138 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
12139 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
12140 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
12141
12142 The particular options set for any particular CPU will vary between
12143 compiler versions, depending on what setting seems to produce optimal
12144 code for that CPU; it doesn't necessarily reflect the actual hardware's
12145 capabilities.  If you wish to set an individual option to a particular
12146 value, you may specify it after the @option{-mcpu} option, like
12147 @samp{-mcpu=970 -mno-altivec}.
12148
12149 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
12150 not enabled or disabled by the @option{-mcpu} option at present because
12151 AIX does not have full support for these options.  You may still
12152 enable or disable them individually if you're sure it'll work in your
12153 environment.
12154
12155 @item -mtune=@var{cpu_type}
12156 @opindex mtune
12157 Set the instruction scheduling parameters for machine type
12158 @var{cpu_type}, but do not set the architecture type, register usage, or
12159 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
12160 values for @var{cpu_type} are used for @option{-mtune} as for
12161 @option{-mcpu}.  If both are specified, the code generated will use the
12162 architecture, registers, and mnemonics set by @option{-mcpu}, but the
12163 scheduling parameters set by @option{-mtune}.
12164
12165 @item -mswdiv
12166 @itemx -mno-swdiv
12167 @opindex mswdiv
12168 @opindex mno-swdiv
12169 Generate code to compute division as reciprocal estimate and iterative
12170 refinement, creating opportunities for increased throughput.  This
12171 feature requires: optional PowerPC Graphics instruction set for single
12172 precision and FRE instruction for double precision, assuming divides
12173 cannot generate user-visible traps, and the domain values not include
12174 Infinities, denormals or zero denominator.
12175
12176 @item -maltivec
12177 @itemx -mno-altivec
12178 @opindex maltivec
12179 @opindex mno-altivec
12180 Generate code that uses (does not use) AltiVec instructions, and also
12181 enable the use of built-in functions that allow more direct access to
12182 the AltiVec instruction set.  You may also need to set
12183 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
12184 enhancements.
12185
12186 @item -mvrsave
12187 @item -mno-vrsave
12188 @opindex mvrsave
12189 @opindex mno-vrsave
12190 Generate VRSAVE instructions when generating AltiVec code.
12191
12192 @item -msecure-plt
12193 @opindex msecure-plt
12194 Generate code that allows ld and ld.so to build executables and shared
12195 libraries with non-exec .plt and .got sections.  This is a PowerPC
12196 32-bit SYSV ABI option.
12197
12198 @item -mbss-plt
12199 @opindex mbss-plt
12200 Generate code that uses a BSS .plt section that ld.so fills in, and
12201 requires .plt and .got sections that are both writable and executable.
12202 This is a PowerPC 32-bit SYSV ABI option.
12203
12204 @item -misel
12205 @itemx -mno-isel
12206 @opindex misel
12207 @opindex mno-isel
12208 This switch enables or disables the generation of ISEL instructions.
12209
12210 @item -misel=@var{yes/no}
12211 This switch has been deprecated.  Use @option{-misel} and
12212 @option{-mno-isel} instead.
12213
12214 @item -mspe
12215 @itemx -mno-spe
12216 @opindex mspe
12217 @opindex mno-spe
12218 This switch enables or disables the generation of SPE simd
12219 instructions.
12220
12221 @item -mspe=@var{yes/no}
12222 This option has been deprecated.  Use @option{-mspe} and
12223 @option{-mno-spe} instead.
12224
12225 @item -mfloat-gprs=@var{yes/single/double/no}
12226 @itemx -mfloat-gprs
12227 @opindex mfloat-gprs
12228 This switch enables or disables the generation of floating point
12229 operations on the general purpose registers for architectures that
12230 support it.
12231
12232 The argument @var{yes} or @var{single} enables the use of
12233 single-precision floating point operations.
12234
12235 The argument @var{double} enables the use of single and
12236 double-precision floating point operations.
12237
12238 The argument @var{no} disables floating point operations on the
12239 general purpose registers.
12240
12241 This option is currently only available on the MPC854x.
12242
12243 @item -m32
12244 @itemx -m64
12245 @opindex m32
12246 @opindex m64
12247 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12248 targets (including GNU/Linux).  The 32-bit environment sets int, long
12249 and pointer to 32 bits and generates code that runs on any PowerPC
12250 variant.  The 64-bit environment sets int to 32 bits and long and
12251 pointer to 64 bits, and generates code for PowerPC64, as for
12252 @option{-mpowerpc64}.
12253
12254 @item -mfull-toc
12255 @itemx -mno-fp-in-toc
12256 @itemx -mno-sum-in-toc
12257 @itemx -mminimal-toc
12258 @opindex mfull-toc
12259 @opindex mno-fp-in-toc
12260 @opindex mno-sum-in-toc
12261 @opindex mminimal-toc
12262 Modify generation of the TOC (Table Of Contents), which is created for
12263 every executable file.  The @option{-mfull-toc} option is selected by
12264 default.  In that case, GCC will allocate at least one TOC entry for
12265 each unique non-automatic variable reference in your program.  GCC
12266 will also place floating-point constants in the TOC@.  However, only
12267 16,384 entries are available in the TOC@.
12268
12269 If you receive a linker error message that saying you have overflowed
12270 the available TOC space, you can reduce the amount of TOC space used
12271 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
12272 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
12273 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
12274 generate code to calculate the sum of an address and a constant at
12275 run-time instead of putting that sum into the TOC@.  You may specify one
12276 or both of these options.  Each causes GCC to produce very slightly
12277 slower and larger code at the expense of conserving TOC space.
12278
12279 If you still run out of space in the TOC even when you specify both of
12280 these options, specify @option{-mminimal-toc} instead.  This option causes
12281 GCC to make only one TOC entry for every file.  When you specify this
12282 option, GCC will produce code that is slower and larger but which
12283 uses extremely little TOC space.  You may wish to use this option
12284 only on files that contain less frequently executed code.
12285
12286 @item -maix64
12287 @itemx -maix32
12288 @opindex maix64
12289 @opindex maix32
12290 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
12291 @code{long} type, and the infrastructure needed to support them.
12292 Specifying @option{-maix64} implies @option{-mpowerpc64} and
12293 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
12294 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
12295
12296 @item -mxl-compat
12297 @itemx -mno-xl-compat
12298 @opindex mxl-compat
12299 @opindex mno-xl-compat
12300 Produce code that conforms more closely to IBM XL compiler semantics
12301 when using AIX-compatible ABI.  Pass floating-point arguments to
12302 prototyped functions beyond the register save area (RSA) on the stack
12303 in addition to argument FPRs.  Do not assume that most significant
12304 double in 128-bit long double value is properly rounded when comparing
12305 values and converting to double.  Use XL symbol names for long double
12306 support routines.
12307
12308 The AIX calling convention was extended but not initially documented to
12309 handle an obscure K&R C case of calling a function that takes the
12310 address of its arguments with fewer arguments than declared.  IBM XL
12311 compilers access floating point arguments which do not fit in the
12312 RSA from the stack when a subroutine is compiled without
12313 optimization.  Because always storing floating-point arguments on the
12314 stack is inefficient and rarely needed, this option is not enabled by
12315 default and only is necessary when calling subroutines compiled by IBM
12316 XL compilers without optimization.
12317
12318 @item -mpe
12319 @opindex mpe
12320 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
12321 application written to use message passing with special startup code to
12322 enable the application to run.  The system must have PE installed in the
12323 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
12324 must be overridden with the @option{-specs=} option to specify the
12325 appropriate directory location.  The Parallel Environment does not
12326 support threads, so the @option{-mpe} option and the @option{-pthread}
12327 option are incompatible.
12328
12329 @item -malign-natural
12330 @itemx -malign-power
12331 @opindex malign-natural
12332 @opindex malign-power
12333 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12334 @option{-malign-natural} overrides the ABI-defined alignment of larger
12335 types, such as floating-point doubles, on their natural size-based boundary.
12336 The option @option{-malign-power} instructs GCC to follow the ABI-specified
12337 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
12338
12339 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
12340 is not supported.
12341
12342 @item -msoft-float
12343 @itemx -mhard-float
12344 @opindex msoft-float
12345 @opindex mhard-float
12346 Generate code that does not use (uses) the floating-point register set.
12347 Software floating point emulation is provided if you use the
12348 @option{-msoft-float} option, and pass the option to GCC when linking.
12349
12350 @item -mmultiple
12351 @itemx -mno-multiple
12352 @opindex mmultiple
12353 @opindex mno-multiple
12354 Generate code that uses (does not use) the load multiple word
12355 instructions and the store multiple word instructions.  These
12356 instructions are generated by default on POWER systems, and not
12357 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
12358 endian PowerPC systems, since those instructions do not work when the
12359 processor is in little endian mode.  The exceptions are PPC740 and
12360 PPC750 which permit the instructions usage in little endian mode.
12361
12362 @item -mstring
12363 @itemx -mno-string
12364 @opindex mstring
12365 @opindex mno-string
12366 Generate code that uses (does not use) the load string instructions
12367 and the store string word instructions to save multiple registers and
12368 do small block moves.  These instructions are generated by default on
12369 POWER systems, and not generated on PowerPC systems.  Do not use
12370 @option{-mstring} on little endian PowerPC systems, since those
12371 instructions do not work when the processor is in little endian mode.
12372 The exceptions are PPC740 and PPC750 which permit the instructions
12373 usage in little endian mode.
12374
12375 @item -mupdate
12376 @itemx -mno-update
12377 @opindex mupdate
12378 @opindex mno-update
12379 Generate code that uses (does not use) the load or store instructions
12380 that update the base register to the address of the calculated memory
12381 location.  These instructions are generated by default.  If you use
12382 @option{-mno-update}, there is a small window between the time that the
12383 stack pointer is updated and the address of the previous frame is
12384 stored, which means code that walks the stack frame across interrupts or
12385 signals may get corrupted data.
12386
12387 @item -mfused-madd
12388 @itemx -mno-fused-madd
12389 @opindex mfused-madd
12390 @opindex mno-fused-madd
12391 Generate code that uses (does not use) the floating point multiply and
12392 accumulate instructions.  These instructions are generated by default if
12393 hardware floating is used.
12394
12395 @item -mmulhw
12396 @itemx -mno-mulhw
12397 @opindex mmulhw
12398 @opindex mno-mulhw
12399 Generate code that uses (does not use) the half-word multiply and
12400 multiply-accumulate instructions on the IBM 405 and 440 processors.
12401 These instructions are generated by default when targetting those
12402 processors.
12403
12404 @item -mdlmzb
12405 @itemx -mno-dlmzb
12406 @opindex mdlmzb
12407 @opindex mno-dlmzb
12408 Generate code that uses (does not use) the string-search @samp{dlmzb}
12409 instruction on the IBM 405 and 440 processors.  This instruction is
12410 generated by default when targetting those processors.
12411
12412 @item -mno-bit-align
12413 @itemx -mbit-align
12414 @opindex mno-bit-align
12415 @opindex mbit-align
12416 On System V.4 and embedded PowerPC systems do not (do) force structures
12417 and unions that contain bit-fields to be aligned to the base type of the
12418 bit-field.
12419
12420 For example, by default a structure containing nothing but 8
12421 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
12422 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
12423 the structure would be aligned to a 1 byte boundary and be one byte in
12424 size.
12425
12426 @item -mno-strict-align
12427 @itemx -mstrict-align
12428 @opindex mno-strict-align
12429 @opindex mstrict-align
12430 On System V.4 and embedded PowerPC systems do not (do) assume that
12431 unaligned memory references will be handled by the system.
12432
12433 @item -mrelocatable
12434 @itemx -mno-relocatable
12435 @opindex mrelocatable
12436 @opindex mno-relocatable
12437 On embedded PowerPC systems generate code that allows (does not allow)
12438 the program to be relocated to a different address at runtime.  If you
12439 use @option{-mrelocatable} on any module, all objects linked together must
12440 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
12441
12442 @item -mrelocatable-lib
12443 @itemx -mno-relocatable-lib
12444 @opindex mrelocatable-lib
12445 @opindex mno-relocatable-lib
12446 On embedded PowerPC systems generate code that allows (does not allow)
12447 the program to be relocated to a different address at runtime.  Modules
12448 compiled with @option{-mrelocatable-lib} can be linked with either modules
12449 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
12450 with modules compiled with the @option{-mrelocatable} options.
12451
12452 @item -mno-toc
12453 @itemx -mtoc
12454 @opindex mno-toc
12455 @opindex mtoc
12456 On System V.4 and embedded PowerPC systems do not (do) assume that
12457 register 2 contains a pointer to a global area pointing to the addresses
12458 used in the program.
12459
12460 @item -mlittle
12461 @itemx -mlittle-endian
12462 @opindex mlittle
12463 @opindex mlittle-endian
12464 On System V.4 and embedded PowerPC systems compile code for the
12465 processor in little endian mode.  The @option{-mlittle-endian} option is
12466 the same as @option{-mlittle}.
12467
12468 @item -mbig
12469 @itemx -mbig-endian
12470 @opindex mbig
12471 @opindex mbig-endian
12472 On System V.4 and embedded PowerPC systems compile code for the
12473 processor in big endian mode.  The @option{-mbig-endian} option is
12474 the same as @option{-mbig}.
12475
12476 @item -mdynamic-no-pic
12477 @opindex mdynamic-no-pic
12478 On Darwin and Mac OS X systems, compile code so that it is not
12479 relocatable, but that its external references are relocatable.  The
12480 resulting code is suitable for applications, but not shared
12481 libraries.
12482
12483 @item -mprioritize-restricted-insns=@var{priority}
12484 @opindex mprioritize-restricted-insns
12485 This option controls the priority that is assigned to
12486 dispatch-slot restricted instructions during the second scheduling
12487 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
12488 @var{no/highest/second-highest} priority to dispatch slot restricted
12489 instructions.
12490
12491 @item -msched-costly-dep=@var{dependence_type}
12492 @opindex msched-costly-dep
12493 This option controls which dependences are considered costly
12494 by the target during instruction scheduling.  The argument
12495 @var{dependence_type} takes one of the following values:
12496 @var{no}: no dependence is costly,
12497 @var{all}: all dependences are costly,
12498 @var{true_store_to_load}: a true dependence from store to load is costly,
12499 @var{store_to_load}: any dependence from store to load is costly,
12500 @var{number}: any dependence which latency >= @var{number} is costly.
12501
12502 @item -minsert-sched-nops=@var{scheme}
12503 @opindex minsert-sched-nops
12504 This option controls which nop insertion scheme will be used during
12505 the second scheduling pass.  The argument @var{scheme} takes one of the
12506 following values:
12507 @var{no}: Don't insert nops.
12508 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
12509 according to the scheduler's grouping.
12510 @var{regroup_exact}: Insert nops to force costly dependent insns into
12511 separate groups.  Insert exactly as many nops as needed to force an insn
12512 to a new group, according to the estimated processor grouping.
12513 @var{number}: Insert nops to force costly dependent insns into
12514 separate groups.  Insert @var{number} nops to force an insn to a new group.
12515
12516 @item -mcall-sysv
12517 @opindex mcall-sysv
12518 On System V.4 and embedded PowerPC systems compile code using calling
12519 conventions that adheres to the March 1995 draft of the System V
12520 Application Binary Interface, PowerPC processor supplement.  This is the
12521 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
12522
12523 @item -mcall-sysv-eabi
12524 @opindex mcall-sysv-eabi
12525 Specify both @option{-mcall-sysv} and @option{-meabi} options.
12526
12527 @item -mcall-sysv-noeabi
12528 @opindex mcall-sysv-noeabi
12529 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
12530
12531 @item -mcall-solaris
12532 @opindex mcall-solaris
12533 On System V.4 and embedded PowerPC systems compile code for the Solaris
12534 operating system.
12535
12536 @item -mcall-linux
12537 @opindex mcall-linux
12538 On System V.4 and embedded PowerPC systems compile code for the
12539 Linux-based GNU system.
12540
12541 @item -mcall-gnu
12542 @opindex mcall-gnu
12543 On System V.4 and embedded PowerPC systems compile code for the
12544 Hurd-based GNU system.
12545
12546 @item -mcall-netbsd
12547 @opindex mcall-netbsd
12548 On System V.4 and embedded PowerPC systems compile code for the
12549 NetBSD operating system.
12550
12551 @item -maix-struct-return
12552 @opindex maix-struct-return
12553 Return all structures in memory (as specified by the AIX ABI)@.
12554
12555 @item -msvr4-struct-return
12556 @opindex msvr4-struct-return
12557 Return structures smaller than 8 bytes in registers (as specified by the
12558 SVR4 ABI)@.
12559
12560 @item -mabi=@var{abi-type}
12561 @opindex mabi
12562 Extend the current ABI with a particular extension, or remove such extension.
12563 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
12564 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
12565
12566 @item -mabi=spe
12567 @opindex mabi=spe
12568 Extend the current ABI with SPE ABI extensions.  This does not change
12569 the default ABI, instead it adds the SPE ABI extensions to the current
12570 ABI@.
12571
12572 @item -mabi=no-spe
12573 @opindex mabi=no-spe
12574 Disable Booke SPE ABI extensions for the current ABI@.
12575
12576 @item -mabi=ibmlongdouble
12577 @opindex mabi=ibmlongdouble
12578 Change the current ABI to use IBM extended precision long double.
12579 This is a PowerPC 32-bit SYSV ABI option.
12580
12581 @item -mabi=ieeelongdouble
12582 @opindex mabi=ieeelongdouble
12583 Change the current ABI to use IEEE extended precision long double.
12584 This is a PowerPC 32-bit Linux ABI option.
12585
12586 @item -mprototype
12587 @itemx -mno-prototype
12588 @opindex mprototype
12589 @opindex mno-prototype
12590 On System V.4 and embedded PowerPC systems assume that all calls to
12591 variable argument functions are properly prototyped.  Otherwise, the
12592 compiler must insert an instruction before every non prototyped call to
12593 set or clear bit 6 of the condition code register (@var{CR}) to
12594 indicate whether floating point values were passed in the floating point
12595 registers in case the function takes a variable arguments.  With
12596 @option{-mprototype}, only calls to prototyped variable argument functions
12597 will set or clear the bit.
12598
12599 @item -msim
12600 @opindex msim
12601 On embedded PowerPC systems, assume that the startup module is called
12602 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12603 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12604 configurations.
12605
12606 @item -mmvme
12607 @opindex mmvme
12608 On embedded PowerPC systems, assume that the startup module is called
12609 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12610 @file{libc.a}.
12611
12612 @item -mads
12613 @opindex mads
12614 On embedded PowerPC systems, assume that the startup module is called
12615 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12616 @file{libc.a}.
12617
12618 @item -myellowknife
12619 @opindex myellowknife
12620 On embedded PowerPC systems, assume that the startup module is called
12621 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12622 @file{libc.a}.
12623
12624 @item -mvxworks
12625 @opindex mvxworks
12626 On System V.4 and embedded PowerPC systems, specify that you are
12627 compiling for a VxWorks system.
12628
12629 @item -mwindiss
12630 @opindex mwindiss
12631 Specify that you are compiling for the WindISS simulation environment.
12632
12633 @item -memb
12634 @opindex memb
12635 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12636 header to indicate that @samp{eabi} extended relocations are used.
12637
12638 @item -meabi
12639 @itemx -mno-eabi
12640 @opindex meabi
12641 @opindex mno-eabi
12642 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12643 Embedded Applications Binary Interface (eabi) which is a set of
12644 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12645 means that the stack is aligned to an 8 byte boundary, a function
12646 @code{__eabi} is called to from @code{main} to set up the eabi
12647 environment, and the @option{-msdata} option can use both @code{r2} and
12648 @code{r13} to point to two separate small data areas.  Selecting
12649 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12650 do not call an initialization function from @code{main}, and the
12651 @option{-msdata} option will only use @code{r13} to point to a single
12652 small data area.  The @option{-meabi} option is on by default if you
12653 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12654
12655 @item -msdata=eabi
12656 @opindex msdata=eabi
12657 On System V.4 and embedded PowerPC systems, put small initialized
12658 @code{const} global and static data in the @samp{.sdata2} section, which
12659 is pointed to by register @code{r2}.  Put small initialized
12660 non-@code{const} global and static data in the @samp{.sdata} section,
12661 which is pointed to by register @code{r13}.  Put small uninitialized
12662 global and static data in the @samp{.sbss} section, which is adjacent to
12663 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12664 incompatible with the @option{-mrelocatable} option.  The
12665 @option{-msdata=eabi} option also sets the @option{-memb} option.
12666
12667 @item -msdata=sysv
12668 @opindex msdata=sysv
12669 On System V.4 and embedded PowerPC systems, put small global and static
12670 data in the @samp{.sdata} section, which is pointed to by register
12671 @code{r13}.  Put small uninitialized global and static data in the
12672 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12673 The @option{-msdata=sysv} option is incompatible with the
12674 @option{-mrelocatable} option.
12675
12676 @item -msdata=default
12677 @itemx -msdata
12678 @opindex msdata=default
12679 @opindex msdata
12680 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12681 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12682 same as @option{-msdata=sysv}.
12683
12684 @item -msdata-data
12685 @opindex msdata-data
12686 On System V.4 and embedded PowerPC systems, put small global
12687 data in the @samp{.sdata} section.  Put small uninitialized global
12688 data in the @samp{.sbss} section.  Do not use register @code{r13}
12689 to address small data however.  This is the default behavior unless
12690 other @option{-msdata} options are used.
12691
12692 @item -msdata=none
12693 @itemx -mno-sdata
12694 @opindex msdata=none
12695 @opindex mno-sdata
12696 On embedded PowerPC systems, put all initialized global and static data
12697 in the @samp{.data} section, and all uninitialized data in the
12698 @samp{.bss} section.
12699
12700 @item -G @var{num}
12701 @opindex G
12702 @cindex smaller data references (PowerPC)
12703 @cindex .sdata/.sdata2 references (PowerPC)
12704 On embedded PowerPC systems, put global and static items less than or
12705 equal to @var{num} bytes into the small data or bss sections instead of
12706 the normal data or bss section.  By default, @var{num} is 8.  The
12707 @option{-G @var{num}} switch is also passed to the linker.
12708 All modules should be compiled with the same @option{-G @var{num}} value.
12709
12710 @item -mregnames
12711 @itemx -mno-regnames
12712 @opindex mregnames
12713 @opindex mno-regnames
12714 On System V.4 and embedded PowerPC systems do (do not) emit register
12715 names in the assembly language output using symbolic forms.
12716
12717 @item -mlongcall
12718 @itemx -mno-longcall
12719 @opindex mlongcall
12720 @opindex mno-longcall
12721 By default assume that all calls are far away so that a longer more
12722 expensive calling sequence is required.  This is required for calls
12723 further than 32 megabytes (33,554,432 bytes) from the current location.
12724 A short call will be generated if the compiler knows
12725 the call cannot be that far away.  This setting can be overridden by
12726 the @code{shortcall} function attribute, or by @code{#pragma
12727 longcall(0)}.
12728
12729 Some linkers are capable of detecting out-of-range calls and generating
12730 glue code on the fly.  On these systems, long calls are unnecessary and
12731 generate slower code.  As of this writing, the AIX linker can do this,
12732 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12733 to the GNU linker for 32-bit PowerPC systems as well.
12734
12735 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12736 callee, L42'', plus a ``branch island'' (glue code).  The two target
12737 addresses represent the callee and the ``branch island''.  The
12738 Darwin/PPC linker will prefer the first address and generate a ``bl
12739 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12740 otherwise, the linker will generate ``bl L42'' to call the ``branch
12741 island''.  The ``branch island'' is appended to the body of the
12742 calling function; it computes the full 32-bit address of the callee
12743 and jumps to it.
12744
12745 On Mach-O (Darwin) systems, this option directs the compiler emit to
12746 the glue for every direct call, and the Darwin linker decides whether
12747 to use or discard it.
12748
12749 In the future, we may cause GCC to ignore all longcall specifications
12750 when the linker is known to generate glue.
12751
12752 @item -pthread
12753 @opindex pthread
12754 Adds support for multithreading with the @dfn{pthreads} library.
12755 This option sets flags for both the preprocessor and linker.
12756
12757 @end table
12758
12759 @node S/390 and zSeries Options
12760 @subsection S/390 and zSeries Options
12761 @cindex S/390 and zSeries Options
12762
12763 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12764
12765 @table @gcctabopt
12766 @item -mhard-float
12767 @itemx -msoft-float
12768 @opindex mhard-float
12769 @opindex msoft-float
12770 Use (do not use) the hardware floating-point instructions and registers
12771 for floating-point operations.  When @option{-msoft-float} is specified,
12772 functions in @file{libgcc.a} will be used to perform floating-point
12773 operations.  When @option{-mhard-float} is specified, the compiler
12774 generates IEEE floating-point instructions.  This is the default.
12775
12776 @item -mlong-double-64
12777 @itemx -mlong-double-128
12778 @opindex mlong-double-64
12779 @opindex mlong-double-128
12780 These switches control the size of @code{long double} type. A size
12781 of 64bit makes the @code{long double} type equivalent to the @code{double}
12782 type. This is the default.
12783
12784 @item -mbackchain
12785 @itemx -mno-backchain
12786 @opindex mbackchain
12787 @opindex mno-backchain
12788 Store (do not store) the address of the caller's frame as backchain pointer
12789 into the callee's stack frame.
12790 A backchain may be needed to allow debugging using tools that do not understand
12791 DWARF-2 call frame information.
12792 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12793 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12794 the backchain is placed into the topmost word of the 96/160 byte register
12795 save area.
12796
12797 In general, code compiled with @option{-mbackchain} is call-compatible with
12798 code compiled with @option{-mmo-backchain}; however, use of the backchain
12799 for debugging purposes usually requires that the whole binary is built with
12800 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12801 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12802 to build a linux kernel use @option{-msoft-float}.
12803
12804 The default is to not maintain the backchain.
12805
12806 @item -mpacked-stack
12807 @item -mno-packed-stack
12808 @opindex mpacked-stack
12809 @opindex mno-packed-stack
12810 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12811 specified, the compiler uses the all fields of the 96/160 byte register save
12812 area only for their default purpose; unused fields still take up stack space.
12813 When @option{-mpacked-stack} is specified, register save slots are densely
12814 packed at the top of the register save area; unused space is reused for other
12815 purposes, allowing for more efficient use of the available stack space.
12816 However, when @option{-mbackchain} is also in effect, the topmost word of
12817 the save area is always used to store the backchain, and the return address
12818 register is always saved two words below the backchain.
12819
12820 As long as the stack frame backchain is not used, code generated with
12821 @option{-mpacked-stack} is call-compatible with code generated with
12822 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
12823 S/390 or zSeries generated code that uses the stack frame backchain at run
12824 time, not just for debugging purposes.  Such code is not call-compatible
12825 with code compiled with @option{-mpacked-stack}.  Also, note that the
12826 combination of @option{-mbackchain},
12827 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12828 to build a linux kernel use @option{-msoft-float}.
12829
12830 The default is to not use the packed stack layout.
12831
12832 @item -msmall-exec
12833 @itemx -mno-small-exec
12834 @opindex msmall-exec
12835 @opindex mno-small-exec
12836 Generate (or do not generate) code using the @code{bras} instruction
12837 to do subroutine calls.
12838 This only works reliably if the total executable size does not
12839 exceed 64k.  The default is to use the @code{basr} instruction instead,
12840 which does not have this limitation.
12841
12842 @item -m64
12843 @itemx -m31
12844 @opindex m64
12845 @opindex m31
12846 When @option{-m31} is specified, generate code compliant to the
12847 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
12848 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
12849 particular to generate 64-bit instructions.  For the @samp{s390}
12850 targets, the default is @option{-m31}, while the @samp{s390x}
12851 targets default to @option{-m64}.
12852
12853 @item -mzarch
12854 @itemx -mesa
12855 @opindex mzarch
12856 @opindex mesa
12857 When @option{-mzarch} is specified, generate code using the
12858 instructions available on z/Architecture.
12859 When @option{-mesa} is specified, generate code using the
12860 instructions available on ESA/390.  Note that @option{-mesa} is
12861 not possible with @option{-m64}.
12862 When generating code compliant to the GNU/Linux for S/390 ABI,
12863 the default is @option{-mesa}.  When generating code compliant
12864 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
12865
12866 @item -mmvcle
12867 @itemx -mno-mvcle
12868 @opindex mmvcle
12869 @opindex mno-mvcle
12870 Generate (or do not generate) code using the @code{mvcle} instruction
12871 to perform block moves.  When @option{-mno-mvcle} is specified,
12872 use a @code{mvc} loop instead.  This is the default unless optimizing for
12873 size.
12874
12875 @item -mdebug
12876 @itemx -mno-debug
12877 @opindex mdebug
12878 @opindex mno-debug
12879 Print (or do not print) additional debug information when compiling.
12880 The default is to not print debug information.
12881
12882 @item -march=@var{cpu-type}
12883 @opindex march
12884 Generate code that will run on @var{cpu-type}, which is the name of a system
12885 representing a certain processor type.  Possible values for
12886 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
12887 When generating code using the instructions available on z/Architecture,
12888 the default is @option{-march=z900}.  Otherwise, the default is
12889 @option{-march=g5}.
12890
12891 @item -mtune=@var{cpu-type}
12892 @opindex mtune
12893 Tune to @var{cpu-type} everything applicable about the generated code,
12894 except for the ABI and the set of available instructions.
12895 The list of @var{cpu-type} values is the same as for @option{-march}.
12896 The default is the value used for @option{-march}.
12897
12898 @item -mtpf-trace
12899 @itemx -mno-tpf-trace
12900 @opindex mtpf-trace
12901 @opindex mno-tpf-trace
12902 Generate code that adds (does not add) in TPF OS specific branches to trace
12903 routines in the operating system.  This option is off by default, even
12904 when compiling for the TPF OS@.
12905
12906 @item -mfused-madd
12907 @itemx -mno-fused-madd
12908 @opindex mfused-madd
12909 @opindex mno-fused-madd
12910 Generate code that uses (does not use) the floating point multiply and
12911 accumulate instructions.  These instructions are generated by default if
12912 hardware floating point is used.
12913
12914 @item -mwarn-framesize=@var{framesize}
12915 @opindex mwarn-framesize
12916 Emit a warning if the current function exceeds the given frame size.  Because
12917 this is a compile time check it doesn't need to be a real problem when the program
12918 runs.  It is intended to identify functions which most probably cause
12919 a stack overflow.  It is useful to be used in an environment with limited stack
12920 size e.g.@: the linux kernel.
12921
12922 @item -mwarn-dynamicstack
12923 @opindex mwarn-dynamicstack
12924 Emit a warning if the function calls alloca or uses dynamically
12925 sized arrays.  This is generally a bad idea with a limited stack size.
12926
12927 @item -mstack-guard=@var{stack-guard}
12928 @item -mstack-size=@var{stack-size}
12929 @opindex mstack-guard
12930 @opindex mstack-size
12931 If these options are provided the s390 back end emits additional instructions in
12932 the function prologue which trigger a trap if the stack size is @var{stack-guard}
12933 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
12934 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
12935 the frame size of the compiled function is chosen.
12936 These options are intended to be used to help debugging stack overflow problems.
12937 The additionally emitted code causes only little overhead and hence can also be
12938 used in production like systems without greater performance degradation.  The given
12939 values have to be exact powers of 2 and @var{stack-size} has to be greater than
12940 @var{stack-guard} without exceeding 64k.
12941 In order to be efficient the extra code makes the assumption that the stack starts
12942 at an address aligned to the value given by @var{stack-size}.
12943 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
12944 @end table
12945
12946 @node Score Options
12947 @subsection Score Options
12948 @cindex Score Options
12949
12950 These options are defined for Score implementations:
12951
12952 @table @gcctabopt
12953 @item -meb
12954 @opindex meb
12955 Compile code for big endian mode.  This is the default.
12956
12957 @item -mel
12958 @opindex -mel
12959 Compile code for little endian mode. 
12960
12961 @item -mnhwloop
12962 @opindex -mnhwloop
12963 Disable generate bcnz instruction.
12964
12965 @item -muls
12966 @opindex -muls
12967 Enable generate unaligned load and store instruction.
12968
12969 @item -mmac
12970 @opindex mmac
12971 Enable the use of multiply-accumulate instructions. Disabled by default. 
12972
12973 @item -mscore5
12974 @opindex mscore5
12975 Specify the SCORE5 as the target architecture.
12976
12977 @item -mscore5u
12978 @opindex mscore5u
12979 Specify the SCORE5U of the target architecture.
12980
12981 @item -mscore7
12982 @opindex mscore7
12983 Specify the SCORE7 as the target architecture. This is the default.
12984
12985 @item -mscore7d
12986 @opindex mscore7d
12987 Specify the SCORE7D as the target architecture.
12988 @end table
12989
12990 @node SH Options
12991 @subsection SH Options
12992
12993 These @samp{-m} options are defined for the SH implementations:
12994
12995 @table @gcctabopt
12996 @item -m1
12997 @opindex m1
12998 Generate code for the SH1.
12999
13000 @item -m2
13001 @opindex m2
13002 Generate code for the SH2.
13003
13004 @item -m2e
13005 Generate code for the SH2e.
13006
13007 @item -m3
13008 @opindex m3
13009 Generate code for the SH3.
13010
13011 @item -m3e
13012 @opindex m3e
13013 Generate code for the SH3e.
13014
13015 @item -m4-nofpu
13016 @opindex m4-nofpu
13017 Generate code for the SH4 without a floating-point unit.
13018
13019 @item -m4-single-only
13020 @opindex m4-single-only
13021 Generate code for the SH4 with a floating-point unit that only
13022 supports single-precision arithmetic.
13023
13024 @item -m4-single
13025 @opindex m4-single
13026 Generate code for the SH4 assuming the floating-point unit is in
13027 single-precision mode by default.
13028
13029 @item -m4
13030 @opindex m4
13031 Generate code for the SH4.
13032
13033 @item -m4a-nofpu
13034 @opindex m4a-nofpu
13035 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
13036 floating-point unit is not used.
13037
13038 @item -m4a-single-only
13039 @opindex m4a-single-only
13040 Generate code for the SH4a, in such a way that no double-precision
13041 floating point operations are used.
13042
13043 @item -m4a-single
13044 @opindex m4a-single
13045 Generate code for the SH4a assuming the floating-point unit is in
13046 single-precision mode by default.
13047
13048 @item -m4a
13049 @opindex m4a
13050 Generate code for the SH4a.
13051
13052 @item -m4al
13053 @opindex m4al
13054 Same as @option{-m4a-nofpu}, except that it implicitly passes
13055 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
13056 instructions at the moment.
13057
13058 @item -mb
13059 @opindex mb
13060 Compile code for the processor in big endian mode.
13061
13062 @item -ml
13063 @opindex ml
13064 Compile code for the processor in little endian mode.
13065
13066 @item -mdalign
13067 @opindex mdalign
13068 Align doubles at 64-bit boundaries.  Note that this changes the calling
13069 conventions, and thus some functions from the standard C library will
13070 not work unless you recompile it first with @option{-mdalign}.
13071
13072 @item -mrelax
13073 @opindex mrelax
13074 Shorten some address references at link time, when possible; uses the
13075 linker option @option{-relax}.
13076
13077 @item -mbigtable
13078 @opindex mbigtable
13079 Use 32-bit offsets in @code{switch} tables.  The default is to use
13080 16-bit offsets.
13081
13082 @item -mfmovd
13083 @opindex mfmovd
13084 Enable the use of the instruction @code{fmovd}.
13085
13086 @item -mhitachi
13087 @opindex mhitachi
13088 Comply with the calling conventions defined by Renesas.
13089
13090 @item -mrenesas
13091 @opindex mhitachi
13092 Comply with the calling conventions defined by Renesas.
13093
13094 @item -mno-renesas
13095 @opindex mhitachi
13096 Comply with the calling conventions defined for GCC before the Renesas
13097 conventions were available.  This option is the default for all
13098 targets of the SH toolchain except for @samp{sh-symbianelf}.
13099
13100 @item -mnomacsave
13101 @opindex mnomacsave
13102 Mark the @code{MAC} register as call-clobbered, even if
13103 @option{-mhitachi} is given.
13104
13105 @item -mieee
13106 @opindex mieee
13107 Increase IEEE-compliance of floating-point code.
13108 At the moment, this is equivalent to @option{-fno-finite-math-only}.
13109 When generating 16 bit SH opcodes, getting IEEE-conforming results for
13110 comparisons of NANs / infinities incurs extra overhead in every
13111 floating point comparison, therefore the default is set to
13112 @option{-ffinite-math-only}.
13113
13114 @item -minline-ic_invalidate
13115 @opindex minline-ic_invalidate
13116 Inline code to invalidate instruction cache entries after setting up
13117 nested function trampolines.
13118 This option has no effect if -musermode is in effect and the selected
13119 code generation option (e.g. -m4) does not allow the use of the icbi
13120 instruction.
13121 If the selected code generation option does not allow the use of the icbi
13122 instruction, and -musermode is not in effect, the inlined code will
13123 manipulate the instruction cache address array directly with an associative
13124 write.  This not only requires privileged mode, but it will also
13125 fail if the cache line had been mapped via the TLB and has become unmapped.
13126
13127 @item -misize
13128 @opindex misize
13129 Dump instruction size and location in the assembly code.
13130
13131 @item -mpadstruct
13132 @opindex mpadstruct
13133 This option is deprecated.  It pads structures to multiple of 4 bytes,
13134 which is incompatible with the SH ABI@.
13135
13136 @item -mspace
13137 @opindex mspace
13138 Optimize for space instead of speed.  Implied by @option{-Os}.
13139
13140 @item -mprefergot
13141 @opindex mprefergot
13142 When generating position-independent code, emit function calls using
13143 the Global Offset Table instead of the Procedure Linkage Table.
13144
13145 @item -musermode
13146 @opindex musermode
13147 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
13148 if the inlined code would not work in user mode.
13149 This is the default when the target is @code{sh-*-linux*}.
13150
13151 @item -multcost=@var{number}
13152 @opindex multcost=@var{number}
13153 Set the cost to assume for a multiply insn.
13154
13155 @item -mdiv=@var{strategy}
13156 @opindex mdiv=@var{strategy}
13157 Set the division strategy to use for SHmedia code.  @var{strategy} must be
13158 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
13159 inv:call2, inv:fp .
13160 "fp" performs the operation in floating point.  This has a very high latency,
13161 but needs only a few instructions, so it might be a good choice if
13162 your code has enough easily exploitable ILP to allow the compiler to
13163 schedule the floating point instructions together with other instructions.
13164 Division by zero causes a floating point exception.
13165 "inv" uses integer operations to calculate the inverse of the divisor,
13166 and then multiplies the dividend with the inverse.  This strategy allows
13167 cse and hoisting of the inverse calculation.  Division by zero calculates
13168 an unspecified result, but does not trap.
13169 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
13170 have been found, or if the entire operation has been hoisted to the same
13171 place, the last stages of the inverse calculation are intertwined with the
13172 final multiply to reduce the overall latency, at the expense of using a few
13173 more instructions, and thus offering fewer scheduling opportunities with
13174 other code.
13175 "call" calls a library function that usually implements the inv:minlat
13176 strategy.
13177 This gives high code density for m5-*media-nofpu compilations.
13178 "call2" uses a different entry point of the same library function, where it
13179 assumes that a pointer to a lookup table has already been set up, which
13180 exposes the pointer load to cse / code hoisting optimizations.
13181 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
13182 code generation, but if the code stays unoptimized, revert to the "call",
13183 "call2", or "fp" strategies, respectively.  Note that the
13184 potentially-trapping side effect of division by zero is carried by a
13185 separate instruction, so it is possible that all the integer instructions
13186 are hoisted out, but the marker for the side effect stays where it is.
13187 A recombination to fp operations or a call is not possible in that case.
13188 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
13189 that the inverse calculation was nor separated from the multiply, they speed
13190 up division where the dividend fits into 20 bits (plus sign where applicable),
13191 by inserting a test to skip a number of operations in this case; this test
13192 slows down the case of larger dividends.  inv20u assumes the case of a such
13193 a small dividend to be unlikely, and inv20l assumes it to be likely.
13194
13195 @item -mdivsi3_libfunc=@var{name}
13196 @opindex mdivsi3_libfunc=@var{name}
13197 Set the name of the library function used for 32 bit signed division to
13198 @var{name}.  This only affect the name used in the call and inv:call
13199 division strategies, and the compiler will still expect the same
13200 sets of input/output/clobbered registers as if this option was not present.
13201
13202 @item -madjust-unroll
13203 @opindex madjust-unroll
13204 Throttle unrolling to avoid thrashing target registers.
13205 This option only has an effect if the gcc code base supports the
13206 TARGET_ADJUST_UNROLL_MAX target hook.
13207
13208 @item -mindexed-addressing
13209 @opindex mindexed-addressing
13210 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
13211 This is only safe if the hardware and/or OS implement 32 bit wrap-around
13212 semantics for the indexed addressing mode.  The architecture allows the
13213 implementation of processors with 64 bit MMU, which the OS could use to
13214 get 32 bit addressing, but since no current hardware implementation supports
13215 this or any other way to make the indexed addressing mode safe to use in
13216 the 32 bit ABI, the default is -mno-indexed-addressing.
13217
13218 @item -mgettrcost=@var{number}
13219 @opindex mgettrcost=@var{number}
13220 Set the cost assumed for the gettr instruction to @var{number}.
13221 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
13222
13223 @item -mpt-fixed
13224 @opindex mpt-fixed
13225 Assume pt* instructions won't trap.  This will generally generate better
13226 scheduled code, but is unsafe on current hardware.  The current architecture
13227 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
13228 This has the unintentional effect of making it unsafe to schedule ptabs /
13229 ptrel before a branch, or hoist it out of a loop.  For example,
13230 __do_global_ctors, a part of libgcc that runs constructors at program
13231 startup, calls functions in a list which is delimited by @minus{}1.  With the
13232 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
13233 That means that all the constructors will be run a bit quicker, but when
13234 the loop comes to the end of the list, the program crashes because ptabs
13235 loads @minus{}1 into a target register.  Since this option is unsafe for any
13236 hardware implementing the current architecture specification, the default
13237 is -mno-pt-fixed.  Unless the user specifies a specific cost with
13238 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
13239 this deters register allocation using target registers for storing
13240 ordinary integers.
13241
13242 @item -minvalid-symbols
13243 @opindex minvalid-symbols
13244 Assume symbols might be invalid.  Ordinary function symbols generated by
13245 the compiler will always be valid to load with movi/shori/ptabs or
13246 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
13247 to generate symbols that will cause ptabs / ptrel to trap.
13248 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
13249 It will then prevent cross-basic-block cse, hoisting and most scheduling
13250 of symbol loads.  The default is @option{-mno-invalid-symbols}.
13251 @end table
13252
13253 @node SPARC Options
13254 @subsection SPARC Options
13255 @cindex SPARC options
13256
13257 These @samp{-m} options are supported on the SPARC:
13258
13259 @table @gcctabopt
13260 @item -mno-app-regs
13261 @itemx -mapp-regs
13262 @opindex mno-app-regs
13263 @opindex mapp-regs
13264 Specify @option{-mapp-regs} to generate output using the global registers
13265 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
13266 is the default.
13267
13268 To be fully SVR4 ABI compliant at the cost of some performance loss,
13269 specify @option{-mno-app-regs}.  You should compile libraries and system
13270 software with this option.
13271
13272 @item -mfpu
13273 @itemx -mhard-float
13274 @opindex mfpu
13275 @opindex mhard-float
13276 Generate output containing floating point instructions.  This is the
13277 default.
13278
13279 @item -mno-fpu
13280 @itemx -msoft-float
13281 @opindex mno-fpu
13282 @opindex msoft-float
13283 Generate output containing library calls for floating point.
13284 @strong{Warning:} the requisite libraries are not available for all SPARC
13285 targets.  Normally the facilities of the machine's usual C compiler are
13286 used, but this cannot be done directly in cross-compilation.  You must make
13287 your own arrangements to provide suitable library functions for
13288 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
13289 @samp{sparclite-*-*} do provide software floating point support.
13290
13291 @option{-msoft-float} changes the calling convention in the output file;
13292 therefore, it is only useful if you compile @emph{all} of a program with
13293 this option.  In particular, you need to compile @file{libgcc.a}, the
13294 library that comes with GCC, with @option{-msoft-float} in order for
13295 this to work.
13296
13297 @item -mhard-quad-float
13298 @opindex mhard-quad-float
13299 Generate output containing quad-word (long double) floating point
13300 instructions.
13301
13302 @item -msoft-quad-float
13303 @opindex msoft-quad-float
13304 Generate output containing library calls for quad-word (long double)
13305 floating point instructions.  The functions called are those specified
13306 in the SPARC ABI@.  This is the default.
13307
13308 As of this writing, there are no SPARC implementations that have hardware
13309 support for the quad-word floating point instructions.  They all invoke
13310 a trap handler for one of these instructions, and then the trap handler
13311 emulates the effect of the instruction.  Because of the trap handler overhead,
13312 this is much slower than calling the ABI library routines.  Thus the
13313 @option{-msoft-quad-float} option is the default.
13314
13315 @item -mno-unaligned-doubles
13316 @itemx -munaligned-doubles
13317 @opindex mno-unaligned-doubles
13318 @opindex munaligned-doubles
13319 Assume that doubles have 8 byte alignment.  This is the default.
13320
13321 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
13322 alignment only if they are contained in another type, or if they have an
13323 absolute address.  Otherwise, it assumes they have 4 byte alignment.
13324 Specifying this option avoids some rare compatibility problems with code
13325 generated by other compilers.  It is not the default because it results
13326 in a performance loss, especially for floating point code.
13327
13328 @item -mno-faster-structs
13329 @itemx -mfaster-structs
13330 @opindex mno-faster-structs
13331 @opindex mfaster-structs
13332 With @option{-mfaster-structs}, the compiler assumes that structures
13333 should have 8 byte alignment.  This enables the use of pairs of
13334 @code{ldd} and @code{std} instructions for copies in structure
13335 assignment, in place of twice as many @code{ld} and @code{st} pairs.
13336 However, the use of this changed alignment directly violates the SPARC
13337 ABI@.  Thus, it's intended only for use on targets where the developer
13338 acknowledges that their resulting code will not be directly in line with
13339 the rules of the ABI@.
13340
13341 @item -mimpure-text
13342 @opindex mimpure-text
13343 @option{-mimpure-text}, used in addition to @option{-shared}, tells
13344 the compiler to not pass @option{-z text} to the linker when linking a
13345 shared object.  Using this option, you can link position-dependent
13346 code into a shared object.
13347
13348 @option{-mimpure-text} suppresses the ``relocations remain against
13349 allocatable but non-writable sections'' linker error message.
13350 However, the necessary relocations will trigger copy-on-write, and the
13351 shared object is not actually shared across processes.  Instead of
13352 using @option{-mimpure-text}, you should compile all source code with
13353 @option{-fpic} or @option{-fPIC}.
13354
13355 This option is only available on SunOS and Solaris.
13356
13357 @item -mcpu=@var{cpu_type}
13358 @opindex mcpu
13359 Set the instruction set, register set, and instruction scheduling parameters
13360 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
13361 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
13362 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
13363 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
13364 @samp{ultrasparc3}, and @samp{niagara}.
13365
13366 Default instruction scheduling parameters are used for values that select
13367 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
13368 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
13369
13370 Here is a list of each supported architecture and their supported
13371 implementations.
13372
13373 @smallexample
13374     v7:             cypress
13375     v8:             supersparc, hypersparc
13376     sparclite:      f930, f934, sparclite86x
13377     sparclet:       tsc701
13378     v9:             ultrasparc, ultrasparc3, niagara
13379 @end smallexample
13380
13381 By default (unless configured otherwise), GCC generates code for the V7
13382 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
13383 additionally optimizes it for the Cypress CY7C602 chip, as used in the
13384 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
13385 SPARCStation 1, 2, IPX etc.
13386
13387 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
13388 architecture.  The only difference from V7 code is that the compiler emits
13389 the integer multiply and integer divide instructions which exist in SPARC-V8
13390 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
13391 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
13392 2000 series.
13393
13394 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
13395 the SPARC architecture.  This adds the integer multiply, integer divide step
13396 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
13397 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
13398 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
13399 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
13400 MB86934 chip, which is the more recent SPARClite with FPU@.
13401
13402 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
13403 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
13404 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
13405 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
13406 optimizes it for the TEMIC SPARClet chip.
13407
13408 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
13409 architecture.  This adds 64-bit integer and floating-point move instructions,
13410 3 additional floating-point condition code registers and conditional move
13411 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
13412 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
13413 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
13414 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
13415 @option{-mcpu=niagara}, the compiler additionally optimizes it for
13416 Sun UltraSPARC T1 chips.
13417
13418 @item -mtune=@var{cpu_type}
13419 @opindex mtune
13420 Set the instruction scheduling parameters for machine type
13421 @var{cpu_type}, but do not set the instruction set or register set that the
13422 option @option{-mcpu=@var{cpu_type}} would.
13423
13424 The same values for @option{-mcpu=@var{cpu_type}} can be used for
13425 @option{-mtune=@var{cpu_type}}, but the only useful values are those
13426 that select a particular cpu implementation.  Those are @samp{cypress},
13427 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
13428 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
13429 @samp{ultrasparc3}, and @samp{niagara}.
13430
13431 @item -mv8plus
13432 @itemx -mno-v8plus
13433 @opindex mv8plus
13434 @opindex mno-v8plus
13435 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
13436 difference from the V8 ABI is that the global and out registers are
13437 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
13438 mode for all SPARC-V9 processors.
13439
13440 @item -mvis
13441 @itemx -mno-vis
13442 @opindex mvis
13443 @opindex mno-vis
13444 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
13445 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
13446 @end table
13447
13448 These @samp{-m} options are supported in addition to the above
13449 on SPARC-V9 processors in 64-bit environments:
13450
13451 @table @gcctabopt
13452 @item -mlittle-endian
13453 @opindex mlittle-endian
13454 Generate code for a processor running in little-endian mode.  It is only
13455 available for a few configurations and most notably not on Solaris and Linux.
13456
13457 @item -m32
13458 @itemx -m64
13459 @opindex m32
13460 @opindex m64
13461 Generate code for a 32-bit or 64-bit environment.
13462 The 32-bit environment sets int, long and pointer to 32 bits.
13463 The 64-bit environment sets int to 32 bits and long and pointer
13464 to 64 bits.
13465
13466 @item -mcmodel=medlow
13467 @opindex mcmodel=medlow
13468 Generate code for the Medium/Low code model: 64-bit addresses, programs
13469 must be linked in the low 32 bits of memory.  Programs can be statically
13470 or dynamically linked.
13471
13472 @item -mcmodel=medmid
13473 @opindex mcmodel=medmid
13474 Generate code for the Medium/Middle code model: 64-bit addresses, programs
13475 must be linked in the low 44 bits of memory, the text and data segments must
13476 be less than 2GB in size and the data segment must be located within 2GB of
13477 the text segment.
13478
13479 @item -mcmodel=medany
13480 @opindex mcmodel=medany
13481 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
13482 may be linked anywhere in memory, the text and data segments must be less
13483 than 2GB in size and the data segment must be located within 2GB of the
13484 text segment.
13485
13486 @item -mcmodel=embmedany
13487 @opindex mcmodel=embmedany
13488 Generate code for the Medium/Anywhere code model for embedded systems:
13489 64-bit addresses, the text and data segments must be less than 2GB in
13490 size, both starting anywhere in memory (determined at link time).  The
13491 global register %g4 points to the base of the data segment.  Programs
13492 are statically linked and PIC is not supported.
13493
13494 @item -mstack-bias
13495 @itemx -mno-stack-bias
13496 @opindex mstack-bias
13497 @opindex mno-stack-bias
13498 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
13499 frame pointer if present, are offset by @minus{}2047 which must be added back
13500 when making stack frame references.  This is the default in 64-bit mode.
13501 Otherwise, assume no such offset is present.
13502 @end table
13503
13504 These switches are supported in addition to the above on Solaris:
13505
13506 @table @gcctabopt
13507 @item -threads
13508 @opindex threads
13509 Add support for multithreading using the Solaris threads library.  This
13510 option sets flags for both the preprocessor and linker.  This option does
13511 not affect the thread safety of object code produced by the compiler or
13512 that of libraries supplied with it.
13513
13514 @item -pthreads
13515 @opindex pthreads
13516 Add support for multithreading using the POSIX threads library.  This
13517 option sets flags for both the preprocessor and linker.  This option does
13518 not affect the thread safety of object code produced  by the compiler or
13519 that of libraries supplied with it.
13520
13521 @item -pthread
13522 @opindex pthread
13523 This is a synonym for @option{-pthreads}.
13524 @end table
13525
13526 @node SPU Options
13527 @subsection SPU Options
13528 @cindex SPU options
13529
13530 These @samp{-m} options are supported on the SPU:
13531
13532 @table @gcctabopt
13533 @item -mwarn-reloc
13534 @itemx -merror-reloc
13535 @opindex mwarn-reloc
13536 @opindex merror-reloc
13537
13538 The loader for SPU does not handle dynamic relocations.  By default, GCC
13539 will give an error when it generates code that requires a dynamic
13540 relocation.  @option{-mno-error-reloc} disables the error,
13541 @option{-mwarn-reloc} will generate a warning instead.
13542
13543 @item -msafe-dma
13544 @itemx -munsafe-dma
13545 @opindex msafe-dma
13546 @opindex munsafe-dma
13547
13548 Instructions which initiate or test completion of DMA must not be
13549 reordered with respect to loads and stores of the memory which is being
13550 accessed.  Users typically address this problem using the volatile
13551 keyword, but that can lead to inefficient code in places where the
13552 memory is known to not change.  Rather than mark the memory as volatile
13553 we treat the DMA instructions as potentially effecting all memory.  With
13554 @option{-munsafe-dma} users must use the volatile keyword to protect
13555 memory accesses.
13556
13557 @item -mbranch-hints
13558 @opindex mbranch-hints
13559
13560 By default, GCC will generate a branch hint instruction to avoid
13561 pipeline stalls for always taken or probably taken branches.  A hint
13562 will not be generated closer than 8 instructions away from its branch.
13563 There is little reason to disable them, except for debugging purposes,
13564 or to make an object a little bit smaller.
13565
13566 @item -msmall-mem
13567 @itemx -mlarge-mem
13568 @opindex msmall-mem
13569 @opindex mlarge-mem
13570
13571 By default, GCC generates code assuming that addresses are never larger
13572 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
13573 a full 32 bit address.
13574
13575 @item -mstdmain
13576 @opindex mstdmain
13577
13578 By default, GCC links against startup code that assumes the SPU-style
13579 main function interface (which has an unconventional parameter list).
13580 With @option{-mstdmain}, GCC will link your program against startup
13581 code that assumes a C99-style interface to @code{main}, including a
13582 local copy of @code{argv} strings.
13583
13584 @item -mfixed-range=@var{register-range}
13585 @opindex mfixed-range
13586 Generate code treating the given register range as fixed registers.
13587 A fixed register is one that the register allocator can not use.  This is
13588 useful when compiling kernel code.  A register range is specified as
13589 two registers separated by a dash.  Multiple register ranges can be
13590 specified separated by a comma.
13591
13592 @end table
13593
13594 @node System V Options
13595 @subsection Options for System V
13596
13597 These additional options are available on System V Release 4 for
13598 compatibility with other compilers on those systems:
13599
13600 @table @gcctabopt
13601 @item -G
13602 @opindex G
13603 Create a shared object.
13604 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13605
13606 @item -Qy
13607 @opindex Qy
13608 Identify the versions of each tool used by the compiler, in a
13609 @code{.ident} assembler directive in the output.
13610
13611 @item -Qn
13612 @opindex Qn
13613 Refrain from adding @code{.ident} directives to the output file (this is
13614 the default).
13615
13616 @item -YP,@var{dirs}
13617 @opindex YP
13618 Search the directories @var{dirs}, and no others, for libraries
13619 specified with @option{-l}.
13620
13621 @item -Ym,@var{dir}
13622 @opindex Ym
13623 Look in the directory @var{dir} to find the M4 preprocessor.
13624 The assembler uses this option.
13625 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13626 @c the generic assembler that comes with Solaris takes just -Ym.
13627 @end table
13628
13629 @node TMS320C3x/C4x Options
13630 @subsection TMS320C3x/C4x Options
13631 @cindex TMS320C3x/C4x Options
13632
13633 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
13634
13635 @table @gcctabopt
13636
13637 @item -mcpu=@var{cpu_type}
13638 @opindex mcpu
13639 Set the instruction set, register set, and instruction scheduling
13640 parameters for machine type @var{cpu_type}.  Supported values for
13641 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
13642 @samp{c44}.  The default is @samp{c40} to generate code for the
13643 TMS320C40.
13644
13645 @item -mbig-memory
13646 @itemx -mbig
13647 @itemx -msmall-memory
13648 @itemx -msmall
13649 @opindex mbig-memory
13650 @opindex mbig
13651 @opindex msmall-memory
13652 @opindex msmall
13653 Generates code for the big or small memory model.  The small memory
13654 model assumed that all data fits into one 64K word page.  At run-time
13655 the data page (DP) register must be set to point to the 64K page
13656 containing the .bss and .data program sections.  The big memory model is
13657 the default and requires reloading of the DP register for every direct
13658 memory access.
13659
13660 @item -mbk
13661 @itemx -mno-bk
13662 @opindex mbk
13663 @opindex mno-bk
13664 Allow (disallow) allocation of general integer operands into the block
13665 count register BK@.
13666
13667 @item -mdb
13668 @itemx -mno-db
13669 @opindex mdb
13670 @opindex mno-db
13671 Enable (disable) generation of code using decrement and branch,
13672 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13673 on the safe side, this is disabled for the C3x, since the maximum
13674 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13675 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13676 that it can utilize the decrement and branch instruction, but will give
13677 up if there is more than one memory reference in the loop.  Thus a loop
13678 where the loop counter is decremented can generate slightly more
13679 efficient code, in cases where the RPTB instruction cannot be utilized.
13680
13681 @item -mdp-isr-reload
13682 @itemx -mparanoid
13683 @opindex mdp-isr-reload
13684 @opindex mparanoid
13685 Force the DP register to be saved on entry to an interrupt service
13686 routine (ISR), reloaded to point to the data section, and restored on
13687 exit from the ISR@.  This should not be required unless someone has
13688 violated the small memory model by modifying the DP register, say within
13689 an object library.
13690
13691 @item -mmpyi
13692 @itemx -mno-mpyi
13693 @opindex mmpyi
13694 @opindex mno-mpyi
13695 For the C3x use the 24-bit MPYI instruction for integer multiplies
13696 instead of a library call to guarantee 32-bit results.  Note that if one
13697 of the operands is a constant, then the multiplication will be performed
13698 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13699 then squaring operations are performed inline instead of a library call.
13700
13701 @item -mfast-fix
13702 @itemx -mno-fast-fix
13703 @opindex mfast-fix
13704 @opindex mno-fast-fix
13705 The C3x/C4x FIX instruction to convert a floating point value to an
13706 integer value chooses the nearest integer less than or equal to the
13707 floating point value rather than to the nearest integer.  Thus if the
13708 floating point number is negative, the result will be incorrectly
13709 truncated an additional code is necessary to detect and correct this
13710 case.  This option can be used to disable generation of the additional
13711 code required to correct the result.
13712
13713 @item -mrptb
13714 @itemx -mno-rptb
13715 @opindex mrptb
13716 @opindex mno-rptb
13717 Enable (disable) generation of repeat block sequences using the RPTB
13718 instruction for zero overhead looping.  The RPTB construct is only used
13719 for innermost loops that do not call functions or jump across the loop
13720 boundaries.  There is no advantage having nested RPTB loops due to the
13721 overhead required to save and restore the RC, RS, and RE registers.
13722 This is enabled by default with @option{-O2}.
13723
13724 @item -mrpts=@var{count}
13725 @itemx -mno-rpts
13726 @opindex mrpts
13727 @opindex mno-rpts
13728 Enable (disable) the use of the single instruction repeat instruction
13729 RPTS@.  If a repeat block contains a single instruction, and the loop
13730 count can be guaranteed to be less than the value @var{count}, GCC will
13731 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13732 then a RPTS will be emitted even if the loop count cannot be determined
13733 at compile time.  Note that the repeated instruction following RPTS does
13734 not have to be reloaded from memory each iteration, thus freeing up the
13735 CPU buses for operands.  However, since interrupts are blocked by this
13736 instruction, it is disabled by default.
13737
13738 @item -mloop-unsigned
13739 @itemx -mno-loop-unsigned
13740 @opindex mloop-unsigned
13741 @opindex mno-loop-unsigned
13742 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13743 is @math{2^{31} + 1} since these instructions test if the iteration count is
13744 negative to terminate the loop.  If the iteration count is unsigned
13745 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13746 exceeded.  This switch allows an unsigned iteration count.
13747
13748 @item -mti
13749 @opindex mti
13750 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13751 with.  This also enforces compatibility with the API employed by the TI
13752 C3x C compiler.  For example, long doubles are passed as structures
13753 rather than in floating point registers.
13754
13755 @item -mregparm
13756 @itemx -mmemparm
13757 @opindex mregparm
13758 @opindex mmemparm
13759 Generate code that uses registers (stack) for passing arguments to functions.
13760 By default, arguments are passed in registers where possible rather
13761 than by pushing arguments on to the stack.
13762
13763 @item -mparallel-insns
13764 @itemx -mno-parallel-insns
13765 @opindex mparallel-insns
13766 @opindex mno-parallel-insns
13767 Allow the generation of parallel instructions.  This is enabled by
13768 default with @option{-O2}.
13769
13770 @item -mparallel-mpy
13771 @itemx -mno-parallel-mpy
13772 @opindex mparallel-mpy
13773 @opindex mno-parallel-mpy
13774 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13775 provided @option{-mparallel-insns} is also specified.  These instructions have
13776 tight register constraints which can pessimize the code generation
13777 of large functions.
13778
13779 @end table
13780
13781 @node V850 Options
13782 @subsection V850 Options
13783 @cindex V850 Options
13784
13785 These @samp{-m} options are defined for V850 implementations:
13786
13787 @table @gcctabopt
13788 @item -mlong-calls
13789 @itemx -mno-long-calls
13790 @opindex mlong-calls
13791 @opindex mno-long-calls
13792 Treat all calls as being far away (near).  If calls are assumed to be
13793 far away, the compiler will always load the functions address up into a
13794 register, and call indirect through the pointer.
13795
13796 @item -mno-ep
13797 @itemx -mep
13798 @opindex mno-ep
13799 @opindex mep
13800 Do not optimize (do optimize) basic blocks that use the same index
13801 pointer 4 or more times to copy pointer into the @code{ep} register, and
13802 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13803 option is on by default if you optimize.
13804
13805 @item -mno-prolog-function
13806 @itemx -mprolog-function
13807 @opindex mno-prolog-function
13808 @opindex mprolog-function
13809 Do not use (do use) external functions to save and restore registers
13810 at the prologue and epilogue of a function.  The external functions
13811 are slower, but use less code space if more than one function saves
13812 the same number of registers.  The @option{-mprolog-function} option
13813 is on by default if you optimize.
13814
13815 @item -mspace
13816 @opindex mspace
13817 Try to make the code as small as possible.  At present, this just turns
13818 on the @option{-mep} and @option{-mprolog-function} options.
13819
13820 @item -mtda=@var{n}
13821 @opindex mtda
13822 Put static or global variables whose size is @var{n} bytes or less into
13823 the tiny data area that register @code{ep} points to.  The tiny data
13824 area can hold up to 256 bytes in total (128 bytes for byte references).
13825
13826 @item -msda=@var{n}
13827 @opindex msda
13828 Put static or global variables whose size is @var{n} bytes or less into
13829 the small data area that register @code{gp} points to.  The small data
13830 area can hold up to 64 kilobytes.
13831
13832 @item -mzda=@var{n}
13833 @opindex mzda
13834 Put static or global variables whose size is @var{n} bytes or less into
13835 the first 32 kilobytes of memory.
13836
13837 @item -mv850
13838 @opindex mv850
13839 Specify that the target processor is the V850.
13840
13841 @item -mbig-switch
13842 @opindex mbig-switch
13843 Generate code suitable for big switch tables.  Use this option only if
13844 the assembler/linker complain about out of range branches within a switch
13845 table.
13846
13847 @item -mapp-regs
13848 @opindex mapp-regs
13849 This option will cause r2 and r5 to be used in the code generated by
13850 the compiler.  This setting is the default.
13851
13852 @item -mno-app-regs
13853 @opindex mno-app-regs
13854 This option will cause r2 and r5 to be treated as fixed registers.
13855
13856 @item -mv850e1
13857 @opindex mv850e1
13858 Specify that the target processor is the V850E1.  The preprocessor
13859 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
13860 this option is used.
13861
13862 @item -mv850e
13863 @opindex mv850e
13864 Specify that the target processor is the V850E@.  The preprocessor
13865 constant @samp{__v850e__} will be defined if this option is used.
13866
13867 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
13868 are defined then a default target processor will be chosen and the
13869 relevant @samp{__v850*__} preprocessor constant will be defined.
13870
13871 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
13872 defined, regardless of which processor variant is the target.
13873
13874 @item -mdisable-callt
13875 @opindex mdisable-callt
13876 This option will suppress generation of the CALLT instruction for the
13877 v850e and v850e1 flavors of the v850 architecture.  The default is
13878 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
13879
13880 @end table
13881
13882 @node VAX Options
13883 @subsection VAX Options
13884 @cindex VAX options
13885
13886 These @samp{-m} options are defined for the VAX:
13887
13888 @table @gcctabopt
13889 @item -munix
13890 @opindex munix
13891 Do not output certain jump instructions (@code{aobleq} and so on)
13892 that the Unix assembler for the VAX cannot handle across long
13893 ranges.
13894
13895 @item -mgnu
13896 @opindex mgnu
13897 Do output those jump instructions, on the assumption that you
13898 will assemble with the GNU assembler.
13899
13900 @item -mg
13901 @opindex mg
13902 Output code for g-format floating point numbers instead of d-format.
13903 @end table
13904
13905 @node VxWorks Options
13906 @subsection VxWorks Options
13907 @cindex VxWorks Options
13908
13909 The options in this section are defined for all VxWorks targets.
13910 Options specific to the target hardware are listed with the other
13911 options for that target.
13912
13913 @table @gcctabopt
13914 @item -mrtp
13915 @opindex mrtp
13916 GCC can generate code for both VxWorks kernels and real time processes
13917 (RTPs).  This option switches from the former to the latter.  It also
13918 defines the preprocessor macro @code{__RTP__}.
13919
13920 @item -non-static
13921 @opindex non-static
13922 Link an RTP executable against shared libraries rather than static
13923 libraries.  The options @option{-static} and @option{-shared} can
13924 also be used for RTPs (@pxref{Link Options}); @option{-static}
13925 is the default.
13926
13927 @item -Bstatic
13928 @itemx -Bdynamic
13929 @opindex Bstatic
13930 @opindex Bdynamic
13931 These options are passed down to the linker.  They are defined for
13932 compatibility with Diab.
13933
13934 @item -Xbind-lazy
13935 @opindex Xbind-lazy
13936 Enable lazy binding of function calls.  This option is equivalent to
13937 @option{-Wl,-z,now} and is defined for compatibility with Diab.
13938
13939 @item -Xbind-now
13940 @opindex Xbind-now
13941 Disable lazy binding of function calls.  This option is the default and
13942 is defined for compatibility with Diab.
13943 @end table
13944
13945 @node x86-64 Options
13946 @subsection x86-64 Options
13947 @cindex x86-64 options
13948
13949 These are listed under @xref{i386 and x86-64 Options}.
13950
13951 @node Xstormy16 Options
13952 @subsection Xstormy16 Options
13953 @cindex Xstormy16 Options
13954
13955 These options are defined for Xstormy16:
13956
13957 @table @gcctabopt
13958 @item -msim
13959 @opindex msim
13960 Choose startup files and linker script suitable for the simulator.
13961 @end table
13962
13963 @node Xtensa Options
13964 @subsection Xtensa Options
13965 @cindex Xtensa Options
13966
13967 These options are supported for Xtensa targets:
13968
13969 @table @gcctabopt
13970 @item -mconst16
13971 @itemx -mno-const16
13972 @opindex mconst16
13973 @opindex mno-const16
13974 Enable or disable use of @code{CONST16} instructions for loading
13975 constant values.  The @code{CONST16} instruction is currently not a
13976 standard option from Tensilica.  When enabled, @code{CONST16}
13977 instructions are always used in place of the standard @code{L32R}
13978 instructions.  The use of @code{CONST16} is enabled by default only if
13979 the @code{L32R} instruction is not available.
13980
13981 @item -mfused-madd
13982 @itemx -mno-fused-madd
13983 @opindex mfused-madd
13984 @opindex mno-fused-madd
13985 Enable or disable use of fused multiply/add and multiply/subtract
13986 instructions in the floating-point option.  This has no effect if the
13987 floating-point option is not also enabled.  Disabling fused multiply/add
13988 and multiply/subtract instructions forces the compiler to use separate
13989 instructions for the multiply and add/subtract operations.  This may be
13990 desirable in some cases where strict IEEE 754-compliant results are
13991 required: the fused multiply add/subtract instructions do not round the
13992 intermediate result, thereby producing results with @emph{more} bits of
13993 precision than specified by the IEEE standard.  Disabling fused multiply
13994 add/subtract instructions also ensures that the program output is not
13995 sensitive to the compiler's ability to combine multiply and add/subtract
13996 operations.
13997
13998 @item -mtext-section-literals
13999 @itemx -mno-text-section-literals
14000 @opindex mtext-section-literals
14001 @opindex mno-text-section-literals
14002 Control the treatment of literal pools.  The default is
14003 @option{-mno-text-section-literals}, which places literals in a separate
14004 section in the output file.  This allows the literal pool to be placed
14005 in a data RAM/ROM, and it also allows the linker to combine literal
14006 pools from separate object files to remove redundant literals and
14007 improve code size.  With @option{-mtext-section-literals}, the literals
14008 are interspersed in the text section in order to keep them as close as
14009 possible to their references.  This may be necessary for large assembly
14010 files.
14011
14012 @item -mtarget-align
14013 @itemx -mno-target-align
14014 @opindex mtarget-align
14015 @opindex mno-target-align
14016 When this option is enabled, GCC instructs the assembler to
14017 automatically align instructions to reduce branch penalties at the
14018 expense of some code density.  The assembler attempts to widen density
14019 instructions to align branch targets and the instructions following call
14020 instructions.  If there are not enough preceding safe density
14021 instructions to align a target, no widening will be performed.  The
14022 default is @option{-mtarget-align}.  These options do not affect the
14023 treatment of auto-aligned instructions like @code{LOOP}, which the
14024 assembler will always align, either by widening density instructions or
14025 by inserting no-op instructions.
14026
14027 @item -mlongcalls
14028 @itemx -mno-longcalls
14029 @opindex mlongcalls
14030 @opindex mno-longcalls
14031 When this option is enabled, GCC instructs the assembler to translate
14032 direct calls to indirect calls unless it can determine that the target
14033 of a direct call is in the range allowed by the call instruction.  This
14034 translation typically occurs for calls to functions in other source
14035 files.  Specifically, the assembler translates a direct @code{CALL}
14036 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
14037 The default is @option{-mno-longcalls}.  This option should be used in
14038 programs where the call target can potentially be out of range.  This
14039 option is implemented in the assembler, not the compiler, so the
14040 assembly code generated by GCC will still show direct call
14041 instructions---look at the disassembled object code to see the actual
14042 instructions.  Note that the assembler will use an indirect call for
14043 every cross-file call, not just those that really will be out of range.
14044 @end table
14045
14046 @node zSeries Options
14047 @subsection zSeries Options
14048 @cindex zSeries options
14049
14050 These are listed under @xref{S/390 and zSeries Options}.
14051
14052 @node Code Gen Options
14053 @section Options for Code Generation Conventions
14054 @cindex code generation conventions
14055 @cindex options, code generation
14056 @cindex run-time options
14057
14058 These machine-independent options control the interface conventions
14059 used in code generation.
14060
14061 Most of them have both positive and negative forms; the negative form
14062 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
14063 one of the forms is listed---the one which is not the default.  You
14064 can figure out the other form by either removing @samp{no-} or adding
14065 it.
14066
14067 @table @gcctabopt
14068 @item -fbounds-check
14069 @opindex fbounds-check
14070 For front-ends that support it, generate additional code to check that
14071 indices used to access arrays are within the declared range.  This is
14072 currently only supported by the Java and Fortran front-ends, where
14073 this option defaults to true and false respectively.
14074
14075 @item -ftrapv
14076 @opindex ftrapv
14077 This option generates traps for signed overflow on addition, subtraction,
14078 multiplication operations.
14079
14080 @item -fwrapv
14081 @opindex fwrapv
14082 This option instructs the compiler to assume that signed arithmetic
14083 overflow of addition, subtraction and multiplication wraps around
14084 using twos-complement representation.  This flag enables some optimizations
14085 and disables others.  This option is enabled by default for the Java
14086 front-end, as required by the Java language specification.
14087
14088 @item -fexceptions
14089 @opindex fexceptions
14090 Enable exception handling.  Generates extra code needed to propagate
14091 exceptions.  For some targets, this implies GCC will generate frame
14092 unwind information for all functions, which can produce significant data
14093 size overhead, although it does not affect execution.  If you do not
14094 specify this option, GCC will enable it by default for languages like
14095 C++ which normally require exception handling, and disable it for
14096 languages like C that do not normally require it.  However, you may need
14097 to enable this option when compiling C code that needs to interoperate
14098 properly with exception handlers written in C++.  You may also wish to
14099 disable this option if you are compiling older C++ programs that don't
14100 use exception handling.
14101
14102 @item -fnon-call-exceptions
14103 @opindex fnon-call-exceptions
14104 Generate code that allows trapping instructions to throw exceptions.
14105 Note that this requires platform-specific runtime support that does
14106 not exist everywhere.  Moreover, it only allows @emph{trapping}
14107 instructions to throw exceptions, i.e.@: memory references or floating
14108 point instructions.  It does not allow exceptions to be thrown from
14109 arbitrary signal handlers such as @code{SIGALRM}.
14110
14111 @item -funwind-tables
14112 @opindex funwind-tables
14113 Similar to @option{-fexceptions}, except that it will just generate any needed
14114 static data, but will not affect the generated code in any other way.
14115 You will normally not enable this option; instead, a language processor
14116 that needs this handling would enable it on your behalf.
14117
14118 @item -fasynchronous-unwind-tables
14119 @opindex fasynchronous-unwind-tables
14120 Generate unwind table in dwarf2 format, if supported by target machine.  The
14121 table is exact at each instruction boundary, so it can be used for stack
14122 unwinding from asynchronous events (such as debugger or garbage collector).
14123
14124 @item -fpcc-struct-return
14125 @opindex fpcc-struct-return
14126 Return ``short'' @code{struct} and @code{union} values in memory like
14127 longer ones, rather than in registers.  This convention is less
14128 efficient, but it has the advantage of allowing intercallability between
14129 GCC-compiled files and files compiled with other compilers, particularly
14130 the Portable C Compiler (pcc).
14131
14132 The precise convention for returning structures in memory depends
14133 on the target configuration macros.
14134
14135 Short structures and unions are those whose size and alignment match
14136 that of some integer type.
14137
14138 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
14139 switch is not binary compatible with code compiled with the
14140 @option{-freg-struct-return} switch.
14141 Use it to conform to a non-default application binary interface.
14142
14143 @item -freg-struct-return
14144 @opindex freg-struct-return
14145 Return @code{struct} and @code{union} values in registers when possible.
14146 This is more efficient for small structures than
14147 @option{-fpcc-struct-return}.
14148
14149 If you specify neither @option{-fpcc-struct-return} nor
14150 @option{-freg-struct-return}, GCC defaults to whichever convention is
14151 standard for the target.  If there is no standard convention, GCC
14152 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14153 the principal compiler.  In those cases, we can choose the standard, and
14154 we chose the more efficient register return alternative.
14155
14156 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14157 switch is not binary compatible with code compiled with the
14158 @option{-fpcc-struct-return} switch.
14159 Use it to conform to a non-default application binary interface.
14160
14161 @item -fshort-enums
14162 @opindex fshort-enums
14163 Allocate to an @code{enum} type only as many bytes as it needs for the
14164 declared range of possible values.  Specifically, the @code{enum} type
14165 will be equivalent to the smallest integer type which has enough room.
14166
14167 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14168 code that is not binary compatible with code generated without that switch.
14169 Use it to conform to a non-default application binary interface.
14170
14171 @item -fshort-double
14172 @opindex fshort-double
14173 Use the same size for @code{double} as for @code{float}.
14174
14175 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
14176 code that is not binary compatible with code generated without that switch.
14177 Use it to conform to a non-default application binary interface.
14178
14179 @item -fshort-wchar
14180 @opindex fshort-wchar
14181 Override the underlying type for @samp{wchar_t} to be @samp{short
14182 unsigned int} instead of the default for the target.  This option is
14183 useful for building programs to run under WINE@.
14184
14185 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14186 code that is not binary compatible with code generated without that switch.
14187 Use it to conform to a non-default application binary interface.
14188
14189 @item -fno-common
14190 @opindex fno-common
14191 In C, allocate even uninitialized global variables in the data section of the
14192 object file, rather than generating them as common blocks.  This has the
14193 effect that if the same variable is declared (without @code{extern}) in
14194 two different compilations, you will get an error when you link them.
14195 The only reason this might be useful is if you wish to verify that the
14196 program will work on other systems which always work this way.
14197
14198 @item -fno-ident
14199 @opindex fno-ident
14200 Ignore the @samp{#ident} directive.
14201
14202 @item -finhibit-size-directive
14203 @opindex finhibit-size-directive
14204 Don't output a @code{.size} assembler directive, or anything else that
14205 would cause trouble if the function is split in the middle, and the
14206 two halves are placed at locations far apart in memory.  This option is
14207 used when compiling @file{crtstuff.c}; you should not need to use it
14208 for anything else.
14209
14210 @item -fverbose-asm
14211 @opindex fverbose-asm
14212 Put extra commentary information in the generated assembly code to
14213 make it more readable.  This option is generally only of use to those
14214 who actually need to read the generated assembly code (perhaps while
14215 debugging the compiler itself).
14216
14217 @option{-fno-verbose-asm}, the default, causes the
14218 extra information to be omitted and is useful when comparing two assembler
14219 files.
14220
14221 @item -frecord-gcc-switches
14222 @opindex frecord-gcc-switches
14223 This switch causes the command line that was used to invoke the
14224 compiler to be recorded into the object file that is being created.
14225 This switch is only implemented on some targets and the exact format
14226 of the recording is target and binary file format dependent, but it
14227 usually takes the form of a section containing ASCII text.  This
14228 switch is related to the @option{-fverbose-asm} switch, but that
14229 switch only records information in the assembler output file as
14230 comments, so it never reaches the object file.
14231
14232 @item -fpic
14233 @opindex fpic
14234 @cindex global offset table
14235 @cindex PIC
14236 Generate position-independent code (PIC) suitable for use in a shared
14237 library, if supported for the target machine.  Such code accesses all
14238 constant addresses through a global offset table (GOT)@.  The dynamic
14239 loader resolves the GOT entries when the program starts (the dynamic
14240 loader is not part of GCC; it is part of the operating system).  If
14241 the GOT size for the linked executable exceeds a machine-specific
14242 maximum size, you get an error message from the linker indicating that
14243 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14244 instead.  (These maximums are 8k on the SPARC and 32k
14245 on the m68k and RS/6000.  The 386 has no such limit.)
14246
14247 Position-independent code requires special support, and therefore works
14248 only on certain machines.  For the 386, GCC supports PIC for System V
14249 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14250 position-independent.
14251
14252 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14253 are defined to 1.
14254
14255 @item -fPIC
14256 @opindex fPIC
14257 If supported for the target machine, emit position-independent code,
14258 suitable for dynamic linking and avoiding any limit on the size of the
14259 global offset table.  This option makes a difference on the m68k,
14260 PowerPC and SPARC@.
14261
14262 Position-independent code requires special support, and therefore works
14263 only on certain machines.
14264
14265 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14266 are defined to 2.
14267
14268 @item -fpie
14269 @itemx -fPIE
14270 @opindex fpie
14271 @opindex fPIE
14272 These options are similar to @option{-fpic} and @option{-fPIC}, but
14273 generated position independent code can be only linked into executables.
14274 Usually these options are used when @option{-pie} GCC option will be
14275 used during linking.
14276
14277 @option{-fpie} and @option{-fPIE} both define the macros
14278 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
14279 for @option{-fpie} and 2 for @option{-fPIE}.
14280
14281 @item -fno-jump-tables
14282 @opindex fno-jump-tables
14283 Do not use jump tables for switch statements even where it would be
14284 more efficient than other code generation strategies.  This option is
14285 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14286 building code which forms part of a dynamic linker and cannot
14287 reference the address of a jump table.  On some targets, jump tables
14288 do not require a GOT and this option is not needed.
14289
14290 @item -ffixed-@var{reg}
14291 @opindex ffixed
14292 Treat the register named @var{reg} as a fixed register; generated code
14293 should never refer to it (except perhaps as a stack pointer, frame
14294 pointer or in some other fixed role).
14295
14296 @var{reg} must be the name of a register.  The register names accepted
14297 are machine-specific and are defined in the @code{REGISTER_NAMES}
14298 macro in the machine description macro file.
14299
14300 This flag does not have a negative form, because it specifies a
14301 three-way choice.
14302
14303 @item -fcall-used-@var{reg}
14304 @opindex fcall-used
14305 Treat the register named @var{reg} as an allocable register that is
14306 clobbered by function calls.  It may be allocated for temporaries or
14307 variables that do not live across a call.  Functions compiled this way
14308 will not save and restore the register @var{reg}.
14309
14310 It is an error to used this flag with the frame pointer or stack pointer.
14311 Use of this flag for other registers that have fixed pervasive roles in
14312 the machine's execution model will produce disastrous results.
14313
14314 This flag does not have a negative form, because it specifies a
14315 three-way choice.
14316
14317 @item -fcall-saved-@var{reg}
14318 @opindex fcall-saved
14319 Treat the register named @var{reg} as an allocable register saved by
14320 functions.  It may be allocated even for temporaries or variables that
14321 live across a call.  Functions compiled this way will save and restore
14322 the register @var{reg} if they use it.
14323
14324 It is an error to used this flag with the frame pointer or stack pointer.
14325 Use of this flag for other registers that have fixed pervasive roles in
14326 the machine's execution model will produce disastrous results.
14327
14328 A different sort of disaster will result from the use of this flag for
14329 a register in which function values may be returned.
14330
14331 This flag does not have a negative form, because it specifies a
14332 three-way choice.
14333
14334 @item -fpack-struct[=@var{n}]
14335 @opindex fpack-struct
14336 Without a value specified, pack all structure members together without
14337 holes.  When a value is specified (which must be a small power of two), pack
14338 structure members according to this value, representing the maximum
14339 alignment (that is, objects with default alignment requirements larger than
14340 this will be output potentially unaligned at the next fitting location.
14341
14342 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14343 code that is not binary compatible with code generated without that switch.
14344 Additionally, it makes the code suboptimal.
14345 Use it to conform to a non-default application binary interface.
14346
14347 @item -finstrument-functions
14348 @opindex finstrument-functions
14349 Generate instrumentation calls for entry and exit to functions.  Just
14350 after function entry and just before function exit, the following
14351 profiling functions will be called with the address of the current
14352 function and its call site.  (On some platforms,
14353 @code{__builtin_return_address} does not work beyond the current
14354 function, so the call site information may not be available to the
14355 profiling functions otherwise.)
14356
14357 @smallexample
14358 void __cyg_profile_func_enter (void *this_fn,
14359                                void *call_site);
14360 void __cyg_profile_func_exit  (void *this_fn,
14361                                void *call_site);
14362 @end smallexample
14363
14364 The first argument is the address of the start of the current function,
14365 which may be looked up exactly in the symbol table.
14366
14367 This instrumentation is also done for functions expanded inline in other
14368 functions.  The profiling calls will indicate where, conceptually, the
14369 inline function is entered and exited.  This means that addressable
14370 versions of such functions must be available.  If all your uses of a
14371 function are expanded inline, this may mean an additional expansion of
14372 code size.  If you use @samp{extern inline} in your C code, an
14373 addressable version of such functions must be provided.  (This is
14374 normally the case anyways, but if you get lucky and the optimizer always
14375 expands the functions inline, you might have gotten away without
14376 providing static copies.)
14377
14378 A function may be given the attribute @code{no_instrument_function}, in
14379 which case this instrumentation will not be done.  This can be used, for
14380 example, for the profiling functions listed above, high-priority
14381 interrupt routines, and any functions from which the profiling functions
14382 cannot safely be called (perhaps signal handlers, if the profiling
14383 routines generate output or allocate memory).
14384
14385 @item -fstack-check
14386 @opindex fstack-check
14387 Generate code to verify that you do not go beyond the boundary of the
14388 stack.  You should specify this flag if you are running in an
14389 environment with multiple threads, but only rarely need to specify it in
14390 a single-threaded environment since stack overflow is automatically
14391 detected on nearly all systems if there is only one stack.
14392
14393 Note that this switch does not actually cause checking to be done; the
14394 operating system must do that.  The switch causes generation of code
14395 to ensure that the operating system sees the stack being extended.
14396
14397 @item -fstack-limit-register=@var{reg}
14398 @itemx -fstack-limit-symbol=@var{sym}
14399 @itemx -fno-stack-limit
14400 @opindex fstack-limit-register
14401 @opindex fstack-limit-symbol
14402 @opindex fno-stack-limit
14403 Generate code to ensure that the stack does not grow beyond a certain value,
14404 either the value of a register or the address of a symbol.  If the stack
14405 would grow beyond the value, a signal is raised.  For most targets,
14406 the signal is raised before the stack overruns the boundary, so
14407 it is possible to catch the signal without taking special precautions.
14408
14409 For instance, if the stack starts at absolute address @samp{0x80000000}
14410 and grows downwards, you can use the flags
14411 @option{-fstack-limit-symbol=__stack_limit} and
14412 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
14413 of 128KB@.  Note that this may only work with the GNU linker.
14414
14415 @cindex aliasing of parameters
14416 @cindex parameters, aliased
14417 @item -fargument-alias
14418 @itemx -fargument-noalias
14419 @itemx -fargument-noalias-global
14420 @itemx -fargument-noalias-anything
14421 @opindex fargument-alias
14422 @opindex fargument-noalias
14423 @opindex fargument-noalias-global
14424 @opindex fargument-noalias-anything
14425 Specify the possible relationships among parameters and between
14426 parameters and global data.
14427
14428 @option{-fargument-alias} specifies that arguments (parameters) may
14429 alias each other and may alias global storage.@*
14430 @option{-fargument-noalias} specifies that arguments do not alias
14431 each other, but may alias global storage.@*
14432 @option{-fargument-noalias-global} specifies that arguments do not
14433 alias each other and do not alias global storage.
14434 @option{-fargument-noalias-anything} specifies that arguments do not
14435 alias any other storage.
14436
14437 Each language will automatically use whatever option is required by
14438 the language standard.  You should not need to use these options yourself.
14439
14440 @item -fleading-underscore
14441 @opindex fleading-underscore
14442 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
14443 change the way C symbols are represented in the object file.  One use
14444 is to help link with legacy assembly code.
14445
14446 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
14447 generate code that is not binary compatible with code generated without that
14448 switch.  Use it to conform to a non-default application binary interface.
14449 Not all targets provide complete support for this switch.
14450
14451 @item -ftls-model=@var{model}
14452 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
14453 The @var{model} argument should be one of @code{global-dynamic},
14454 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
14455
14456 The default without @option{-fpic} is @code{initial-exec}; with
14457 @option{-fpic} the default is @code{global-dynamic}.
14458
14459 @item -fvisibility=@var{default|internal|hidden|protected}
14460 @opindex fvisibility
14461 Set the default ELF image symbol visibility to the specified option---all
14462 symbols will be marked with this unless overridden within the code.
14463 Using this feature can very substantially improve linking and
14464 load times of shared object libraries, produce more optimized
14465 code, provide near-perfect API export and prevent symbol clashes.
14466 It is @strong{strongly} recommended that you use this in any shared objects
14467 you distribute.
14468
14469 Despite the nomenclature, @code{default} always means public ie;
14470 available to be linked against from outside the shared object.
14471 @code{protected} and @code{internal} are pretty useless in real-world
14472 usage so the only other commonly used option will be @code{hidden}.
14473 The default if @option{-fvisibility} isn't specified is
14474 @code{default}, i.e., make every
14475 symbol public---this causes the same behavior as previous versions of
14476 GCC@.
14477
14478 A good explanation of the benefits offered by ensuring ELF
14479 symbols have the correct visibility is given by ``How To Write
14480 Shared Libraries'' by Ulrich Drepper (which can be found at
14481 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
14482 solution made possible by this option to marking things hidden when
14483 the default is public is to make the default hidden and mark things
14484 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
14485 and @code{__attribute__ ((visibility("default")))} instead of
14486 @code{__declspec(dllexport)} you get almost identical semantics with
14487 identical syntax.  This is a great boon to those working with
14488 cross-platform projects.
14489
14490 For those adding visibility support to existing code, you may find
14491 @samp{#pragma GCC visibility} of use.  This works by you enclosing
14492 the declarations you wish to set visibility for with (for example)
14493 @samp{#pragma GCC visibility push(hidden)} and
14494 @samp{#pragma GCC visibility pop}.
14495 Bear in mind that symbol visibility should be viewed @strong{as
14496 part of the API interface contract} and thus all new code should
14497 always specify visibility when it is not the default ie; declarations
14498 only for use within the local DSO should @strong{always} be marked explicitly
14499 as hidden as so to avoid PLT indirection overheads---making this
14500 abundantly clear also aids readability and self-documentation of the code.
14501 Note that due to ISO C++ specification requirements, operator new and
14502 operator delete must always be of default visibility.
14503
14504 Be aware that headers from outside your project, in particular system
14505 headers and headers from any other library you use, may not be
14506 expecting to be compiled with visibility other than the default.  You
14507 may need to explicitly say @samp{#pragma GCC visibility push(default)}
14508 before including any such headers.
14509
14510 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
14511 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
14512 no modifications.  However, this means that calls to @samp{extern}
14513 functions with no explicit visibility will use the PLT, so it is more
14514 effective to use @samp{__attribute ((visibility))} and/or
14515 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
14516 declarations should be treated as hidden.
14517
14518 Note that @samp{-fvisibility} does affect C++ vague linkage
14519 entities. This means that, for instance, an exception class that will
14520 be thrown between DSOs must be explicitly marked with default
14521 visibility so that the @samp{type_info} nodes will be unified between
14522 the DSOs.
14523
14524 An overview of these techniques, their benefits and how to use them
14525 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
14526
14527 @end table
14528
14529 @c man end
14530
14531 @node Environment Variables
14532 @section Environment Variables Affecting GCC
14533 @cindex environment variables
14534
14535 @c man begin ENVIRONMENT
14536 This section describes several environment variables that affect how GCC
14537 operates.  Some of them work by specifying directories or prefixes to use
14538 when searching for various kinds of files.  Some are used to specify other
14539 aspects of the compilation environment.
14540
14541 Note that you can also specify places to search using options such as
14542 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
14543 take precedence over places specified using environment variables, which
14544 in turn take precedence over those specified by the configuration of GCC@.
14545 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
14546 GNU Compiler Collection (GCC) Internals}.
14547
14548 @table @env
14549 @item LANG
14550 @itemx LC_CTYPE
14551 @c @itemx LC_COLLATE
14552 @itemx LC_MESSAGES
14553 @c @itemx LC_MONETARY
14554 @c @itemx LC_NUMERIC
14555 @c @itemx LC_TIME
14556 @itemx LC_ALL
14557 @findex LANG
14558 @findex LC_CTYPE
14559 @c @findex LC_COLLATE
14560 @findex LC_MESSAGES
14561 @c @findex LC_MONETARY
14562 @c @findex LC_NUMERIC
14563 @c @findex LC_TIME
14564 @findex LC_ALL
14565 @cindex locale
14566 These environment variables control the way that GCC uses
14567 localization information that allow GCC to work with different
14568 national conventions.  GCC inspects the locale categories
14569 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
14570 so.  These locale categories can be set to any value supported by your
14571 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
14572 Kingdom encoded in UTF-8.
14573
14574 The @env{LC_CTYPE} environment variable specifies character
14575 classification.  GCC uses it to determine the character boundaries in
14576 a string; this is needed for some multibyte encodings that contain quote
14577 and escape characters that would otherwise be interpreted as a string
14578 end or escape.
14579
14580 The @env{LC_MESSAGES} environment variable specifies the language to
14581 use in diagnostic messages.
14582
14583 If the @env{LC_ALL} environment variable is set, it overrides the value
14584 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
14585 and @env{LC_MESSAGES} default to the value of the @env{LANG}
14586 environment variable.  If none of these variables are set, GCC
14587 defaults to traditional C English behavior.
14588
14589 @item TMPDIR
14590 @findex TMPDIR
14591 If @env{TMPDIR} is set, it specifies the directory to use for temporary
14592 files.  GCC uses temporary files to hold the output of one stage of
14593 compilation which is to be used as input to the next stage: for example,
14594 the output of the preprocessor, which is the input to the compiler
14595 proper.
14596
14597 @item GCC_EXEC_PREFIX
14598 @findex GCC_EXEC_PREFIX
14599 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
14600 names of the subprograms executed by the compiler.  No slash is added
14601 when this prefix is combined with the name of a subprogram, but you can
14602 specify a prefix that ends with a slash if you wish.
14603
14604 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
14605 an appropriate prefix to use based on the pathname it was invoked with.
14606
14607 If GCC cannot find the subprogram using the specified prefix, it
14608 tries looking in the usual places for the subprogram.
14609
14610 The default value of @env{GCC_EXEC_PREFIX} is
14611 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
14612 the installed compiler. In many cases @var{prefix} is the value
14613 of @code{prefix} when you ran the @file{configure} script.
14614
14615 Other prefixes specified with @option{-B} take precedence over this prefix.
14616
14617 This prefix is also used for finding files such as @file{crt0.o} that are
14618 used for linking.
14619
14620 In addition, the prefix is used in an unusual way in finding the
14621 directories to search for header files.  For each of the standard
14622 directories whose name normally begins with @samp{/usr/local/lib/gcc}
14623 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
14624 replacing that beginning with the specified prefix to produce an
14625 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
14626 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
14627 These alternate directories are searched first; the standard directories
14628 come next. If a standard directory begins with the configured
14629 @var{prefix} then the value of @var{prefix} is replaced by
14630 @env{GCC_EXEC_PREFIX} when looking for header files.
14631
14632 @item COMPILER_PATH
14633 @findex COMPILER_PATH
14634 The value of @env{COMPILER_PATH} is a colon-separated list of
14635 directories, much like @env{PATH}.  GCC tries the directories thus
14636 specified when searching for subprograms, if it can't find the
14637 subprograms using @env{GCC_EXEC_PREFIX}.
14638
14639 @item LIBRARY_PATH
14640 @findex LIBRARY_PATH
14641 The value of @env{LIBRARY_PATH} is a colon-separated list of
14642 directories, much like @env{PATH}.  When configured as a native compiler,
14643 GCC tries the directories thus specified when searching for special
14644 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
14645 using GCC also uses these directories when searching for ordinary
14646 libraries for the @option{-l} option (but directories specified with
14647 @option{-L} come first).
14648
14649 @item LANG
14650 @findex LANG
14651 @cindex locale definition
14652 This variable is used to pass locale information to the compiler.  One way in
14653 which this information is used is to determine the character set to be used
14654 when character literals, string literals and comments are parsed in C and C++.
14655 When the compiler is configured to allow multibyte characters,
14656 the following values for @env{LANG} are recognized:
14657
14658 @table @samp
14659 @item C-JIS
14660 Recognize JIS characters.
14661 @item C-SJIS
14662 Recognize SJIS characters.
14663 @item C-EUCJP
14664 Recognize EUCJP characters.
14665 @end table
14666
14667 If @env{LANG} is not defined, or if it has some other value, then the
14668 compiler will use mblen and mbtowc as defined by the default locale to
14669 recognize and translate multibyte characters.
14670 @end table
14671
14672 @noindent
14673 Some additional environments variables affect the behavior of the
14674 preprocessor.
14675
14676 @include cppenv.texi
14677
14678 @c man end
14679
14680 @node Precompiled Headers
14681 @section Using Precompiled Headers
14682 @cindex precompiled headers
14683 @cindex speed of compilation
14684
14685 Often large projects have many header files that are included in every
14686 source file.  The time the compiler takes to process these header files
14687 over and over again can account for nearly all of the time required to
14688 build the project.  To make builds faster, GCC allows users to
14689 `precompile' a header file; then, if builds can use the precompiled
14690 header file they will be much faster.
14691
14692 To create a precompiled header file, simply compile it as you would any
14693 other file, if necessary using the @option{-x} option to make the driver
14694 treat it as a C or C++ header file.  You will probably want to use a
14695 tool like @command{make} to keep the precompiled header up-to-date when
14696 the headers it contains change.
14697
14698 A precompiled header file will be searched for when @code{#include} is
14699 seen in the compilation.  As it searches for the included file
14700 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
14701 compiler looks for a precompiled header in each directory just before it
14702 looks for the include file in that directory.  The name searched for is
14703 the name specified in the @code{#include} with @samp{.gch} appended.  If
14704 the precompiled header file can't be used, it is ignored.
14705
14706 For instance, if you have @code{#include "all.h"}, and you have
14707 @file{all.h.gch} in the same directory as @file{all.h}, then the
14708 precompiled header file will be used if possible, and the original
14709 header will be used otherwise.
14710
14711 Alternatively, you might decide to put the precompiled header file in a
14712 directory and use @option{-I} to ensure that directory is searched
14713 before (or instead of) the directory containing the original header.
14714 Then, if you want to check that the precompiled header file is always
14715 used, you can put a file of the same name as the original header in this
14716 directory containing an @code{#error} command.
14717
14718 This also works with @option{-include}.  So yet another way to use
14719 precompiled headers, good for projects not designed with precompiled
14720 header files in mind, is to simply take most of the header files used by
14721 a project, include them from another header file, precompile that header
14722 file, and @option{-include} the precompiled header.  If the header files
14723 have guards against multiple inclusion, they will be skipped because
14724 they've already been included (in the precompiled header).
14725
14726 If you need to precompile the same header file for different
14727 languages, targets, or compiler options, you can instead make a
14728 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14729 header in the directory, perhaps using @option{-o}.  It doesn't matter
14730 what you call the files in the directory, every precompiled header in
14731 the directory will be considered.  The first precompiled header
14732 encountered in the directory that is valid for this compilation will
14733 be used; they're searched in no particular order.
14734
14735 There are many other possibilities, limited only by your imagination,
14736 good sense, and the constraints of your build system.
14737
14738 A precompiled header file can be used only when these conditions apply:
14739
14740 @itemize
14741 @item
14742 Only one precompiled header can be used in a particular compilation.
14743
14744 @item
14745 A precompiled header can't be used once the first C token is seen.  You
14746 can have preprocessor directives before a precompiled header; you can
14747 even include a precompiled header from inside another header, so long as
14748 there are no C tokens before the @code{#include}.
14749
14750 @item
14751 The precompiled header file must be produced for the same language as
14752 the current compilation.  You can't use a C precompiled header for a C++
14753 compilation.
14754
14755 @item
14756 The precompiled header file must have been produced by the same compiler
14757 binary as the current compilation is using.
14758
14759 @item
14760 Any macros defined before the precompiled header is included must
14761 either be defined in the same way as when the precompiled header was
14762 generated, or must not affect the precompiled header, which usually
14763 means that they don't appear in the precompiled header at all.
14764
14765 The @option{-D} option is one way to define a macro before a
14766 precompiled header is included; using a @code{#define} can also do it.
14767 There are also some options that define macros implicitly, like
14768 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14769 defined this way.
14770
14771 @item If debugging information is output when using the precompiled
14772 header, using @option{-g} or similar, the same kind of debugging information
14773 must have been output when building the precompiled header.  However,
14774 a precompiled header built using @option{-g} can be used in a compilation
14775 when no debugging information is being output.
14776
14777 @item The same @option{-m} options must generally be used when building
14778 and using the precompiled header.  @xref{Submodel Options},
14779 for any cases where this rule is relaxed.
14780
14781 @item Each of the following options must be the same when building and using
14782 the precompiled header:
14783
14784 @gccoptlist{-fexceptions -funit-at-a-time}
14785
14786 @item
14787 Some other command-line options starting with @option{-f},
14788 @option{-p}, or @option{-O} must be defined in the same way as when
14789 the precompiled header was generated.  At present, it's not clear
14790 which options are safe to change and which are not; the safest choice
14791 is to use exactly the same options when generating and using the
14792 precompiled header.  The following are known to be safe:
14793
14794 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
14795 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
14796 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
14797 -pedantic-errors}
14798
14799 @end itemize
14800
14801 For all of these except the last, the compiler will automatically
14802 ignore the precompiled header if the conditions aren't met.  If you
14803 find an option combination that doesn't work and doesn't cause the
14804 precompiled header to be ignored, please consider filing a bug report,
14805 see @ref{Bugs}.
14806
14807 If you do use differing options when generating and using the
14808 precompiled header, the actual behavior will be a mixture of the
14809 behavior for the options.  For instance, if you use @option{-g} to
14810 generate the precompiled header but not when using it, you may or may
14811 not get debugging information for routines in the precompiled header.
14812
14813 @node Running Protoize
14814 @section Running Protoize
14815
14816 The program @code{protoize} is an optional part of GCC@.  You can use
14817 it to add prototypes to a program, thus converting the program to ISO
14818 C in one respect.  The companion program @code{unprotoize} does the
14819 reverse: it removes argument types from any prototypes that are found.
14820
14821 When you run these programs, you must specify a set of source files as
14822 command line arguments.  The conversion programs start out by compiling
14823 these files to see what functions they define.  The information gathered
14824 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
14825
14826 After scanning comes actual conversion.  The specified files are all
14827 eligible to be converted; any files they include (whether sources or
14828 just headers) are eligible as well.
14829
14830 But not all the eligible files are converted.  By default,
14831 @code{protoize} and @code{unprotoize} convert only source and header
14832 files in the current directory.  You can specify additional directories
14833 whose files should be converted with the @option{-d @var{directory}}
14834 option.  You can also specify particular files to exclude with the
14835 @option{-x @var{file}} option.  A file is converted if it is eligible, its
14836 directory name matches one of the specified directory names, and its
14837 name within the directory has not been excluded.
14838
14839 Basic conversion with @code{protoize} consists of rewriting most
14840 function definitions and function declarations to specify the types of
14841 the arguments.  The only ones not rewritten are those for varargs
14842 functions.
14843
14844 @code{protoize} optionally inserts prototype declarations at the
14845 beginning of the source file, to make them available for any calls that
14846 precede the function's definition.  Or it can insert prototype
14847 declarations with block scope in the blocks where undeclared functions
14848 are called.
14849
14850 Basic conversion with @code{unprotoize} consists of rewriting most
14851 function declarations to remove any argument types, and rewriting
14852 function definitions to the old-style pre-ISO form.
14853
14854 Both conversion programs print a warning for any function declaration or
14855 definition that they can't convert.  You can suppress these warnings
14856 with @option{-q}.
14857
14858 The output from @code{protoize} or @code{unprotoize} replaces the
14859 original source file.  The original file is renamed to a name ending
14860 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
14861 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
14862 for DOS) file already exists, then the source file is simply discarded.
14863
14864 @code{protoize} and @code{unprotoize} both depend on GCC itself to
14865 scan the program and collect information about the functions it uses.
14866 So neither of these programs will work until GCC is installed.
14867
14868 Here is a table of the options you can use with @code{protoize} and
14869 @code{unprotoize}.  Each option works with both programs unless
14870 otherwise stated.
14871
14872 @table @code
14873 @item -B @var{directory}
14874 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
14875 usual directory (normally @file{/usr/local/lib}).  This file contains
14876 prototype information about standard system functions.  This option
14877 applies only to @code{protoize}.
14878
14879 @item -c @var{compilation-options}
14880 Use @var{compilation-options} as the options when running @command{gcc} to
14881 produce the @samp{.X} files.  The special option @option{-aux-info} is
14882 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
14883
14884 Note that the compilation options must be given as a single argument to
14885 @code{protoize} or @code{unprotoize}.  If you want to specify several
14886 @command{gcc} options, you must quote the entire set of compilation options
14887 to make them a single word in the shell.
14888
14889 There are certain @command{gcc} arguments that you cannot use, because they
14890 would produce the wrong kind of output.  These include @option{-g},
14891 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
14892 the @var{compilation-options}, they are ignored.
14893
14894 @item -C
14895 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
14896 systems) instead of @samp{.c}.  This is convenient if you are converting
14897 a C program to C++.  This option applies only to @code{protoize}.
14898
14899 @item -g
14900 Add explicit global declarations.  This means inserting explicit
14901 declarations at the beginning of each source file for each function
14902 that is called in the file and was not declared.  These declarations
14903 precede the first function definition that contains a call to an
14904 undeclared function.  This option applies only to @code{protoize}.
14905
14906 @item -i @var{string}
14907 Indent old-style parameter declarations with the string @var{string}.
14908 This option applies only to @code{protoize}.
14909
14910 @code{unprotoize} converts prototyped function definitions to old-style
14911 function definitions, where the arguments are declared between the
14912 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
14913 uses five spaces as the indentation.  If you want to indent with just
14914 one space instead, use @option{-i " "}.
14915
14916 @item -k
14917 Keep the @samp{.X} files.  Normally, they are deleted after conversion
14918 is finished.
14919
14920 @item -l
14921 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
14922 a prototype declaration for each function in each block which calls the
14923 function without any declaration.  This option applies only to
14924 @code{protoize}.
14925
14926 @item -n
14927 Make no real changes.  This mode just prints information about the conversions
14928 that would have been done without @option{-n}.
14929
14930 @item -N
14931 Make no @samp{.save} files.  The original files are simply deleted.
14932 Use this option with caution.
14933
14934 @item -p @var{program}
14935 Use the program @var{program} as the compiler.  Normally, the name
14936 @file{gcc} is used.
14937
14938 @item -q
14939 Work quietly.  Most warnings are suppressed.
14940
14941 @item -v
14942 Print the version number, just like @option{-v} for @command{gcc}.
14943 @end table
14944
14945 If you need special compiler options to compile one of your program's
14946 source files, then you should generate that file's @samp{.X} file
14947 specially, by running @command{gcc} on that source file with the
14948 appropriate options and the option @option{-aux-info}.  Then run
14949 @code{protoize} on the entire set of files.  @code{protoize} will use
14950 the existing @samp{.X} file because it is newer than the source file.
14951 For example:
14952
14953 @smallexample
14954 gcc -Dfoo=bar file1.c -aux-info file1.X
14955 protoize *.c
14956 @end smallexample
14957
14958 @noindent
14959 You need to include the special files along with the rest in the
14960 @code{protoize} command, even though their @samp{.X} files already
14961 exist, because otherwise they won't get converted.
14962
14963 @xref{Protoize Caveats}, for more information on how to use
14964 @code{protoize} successfully.