]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/blob - contrib/gcc/doc/invoke.texi
MFC r362623:
[FreeBSD/stable/8.git] / contrib / 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 Free Software Foundation, Inc.
3 @c This is part of the GCC manual.
4 @c For copying conditions, see the file gcc.texi.
5
6 @ignore
7 @c man begin INCLUDE
8 @include gcc-vers.texi
9 @c man end
10
11 @c man begin COPYRIGHT
12 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
13 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
14
15 Permission is granted to copy, distribute and/or modify this document
16 under the terms of the GNU Free Documentation License, Version 1.2 or
17 any later version published by the Free Software Foundation; with the
18 Invariant Sections being ``GNU General Public License'' and ``Funding
19 Free Software'', the Front-Cover texts being (a) (see below), and with
20 the Back-Cover Texts being (b) (see below).  A copy of the license is
21 included in the gfdl(7) man page.
22
23 (a) The FSF's Front-Cover Text is:
24
25      A GNU Manual
26
27 (b) The FSF's Back-Cover Text is:
28
29      You have freedom to copy and modify this GNU Manual, like GNU
30      software.  Copies published by the Free Software Foundation raise
31      funds for GNU development.
32 @c man end
33 @c Set file name and title for the man page.
34 @setfilename gcc
35 @settitle GNU project C and C++ compiler
36 @c man begin SYNOPSIS
37 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
38     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
39     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
40     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
41     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
42     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
43     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
44
45 Only the most useful options are listed here; see below for the
46 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
47 @c man end
48 @c man begin SEEALSO
49 gpl(7), gfdl(7), fsf-funding(7),
50 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
51 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
52 @file{ld}, @file{binutils} and @file{gdb}.
53 @c man end
54 @c man begin BUGS
55 For instructions on reporting bugs, see
56 @w{@uref{http://gcc.gnu.org/bugs.html}}.
57 @c man end
58 @c man begin AUTHOR
59 See the Info entry for @command{gcc}, or
60 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
61 for contributors to GCC@.
62 @c man end
63 @end ignore
64
65 @node Invoking GCC
66 @chapter GCC Command Options
67 @cindex GCC command options
68 @cindex command options
69 @cindex options, GCC command
70
71 @c man begin DESCRIPTION
72 When you invoke GCC, it normally does preprocessing, compilation,
73 assembly and linking.  The ``overall options'' allow you to stop this
74 process at an intermediate stage.  For example, the @option{-c} option
75 says not to run the linker.  Then the output consists of object files
76 output by the assembler.
77
78 Other options are passed on to one stage of processing.  Some options
79 control the preprocessor and others the compiler itself.  Yet other
80 options control the assembler and linker; most of these are not
81 documented here, since you rarely need to use any of them.
82
83 @cindex C compilation options
84 Most of the command line options that you can use with GCC are useful
85 for C programs; when an option is only useful with another language
86 (usually C++), the explanation says so explicitly.  If the description
87 for a particular option does not mention a source language, you can use
88 that option with all supported languages.
89
90 @cindex C++ compilation options
91 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
92 options for compiling C++ programs.
93
94 @cindex grouping options
95 @cindex options, grouping
96 The @command{gcc} program accepts options and file names as operands.  Many
97 options have multi-letter names; therefore multiple single-letter options
98 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
99 -r}}.
100
101 @cindex order of options
102 @cindex options, order
103 You can mix options and other arguments.  For the most part, the order
104 you use doesn't matter.  Order does matter when you use several options
105 of the same kind; for example, if you specify @option{-L} more than once,
106 the directories are searched in the order specified.
107
108 Many options have long names starting with @samp{-f} or with
109 @samp{-W}---for example, 
110 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
111 these have both positive and negative forms; the negative form of
112 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
113 only one of these two forms, whichever one is not the default.
114
115 @c man end
116
117 @xref{Option Index}, for an index to GCC's options.
118
119 @menu
120 * Option Summary::      Brief list of all options, without explanations.
121 * Overall Options::     Controlling the kind of output:
122                         an executable, object files, assembler files,
123                         or preprocessed source.
124 * Invoking G++::        Compiling C++ programs.
125 * C Dialect Options::   Controlling the variant of C language compiled.
126 * C++ Dialect Options:: Variations on C++.
127 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
128                         and Objective-C++.
129 * Language Independent Options:: Controlling how diagnostics should be
130                         formatted.
131 * Warning Options::     How picky should the compiler be?
132 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
133 * Optimize Options::    How much optimization?
134 * Preprocessor Options:: Controlling header files and macro definitions.
135                          Also, getting dependency information for Make.
136 * Assembler Options::   Passing options to the assembler.
137 * Link Options::        Specifying libraries and so on.
138 * Directory Options::   Where to find header files and libraries.
139                         Where to find the compiler executable files.
140 * Spec Files::          How to pass switches to sub-processes.
141 * Target Options::      Running a cross-compiler, or an old version of GCC.
142 * Submodel Options::    Specifying minor hardware or convention variations,
143                         such as 68010 vs 68020.
144 * Code Gen Options::    Specifying conventions for function calls, data layout
145                         and register usage.
146 * Environment Variables:: Env vars that affect GCC.
147 * Precompiled Headers:: Compiling a header once, and using it many times.
148 * Running Protoize::    Automatically adding or removing function prototypes.
149 @end menu
150
151 @c man begin OPTIONS
152
153 @node Option Summary
154 @section Option Summary
155
156 Here is a summary of all the options, grouped by type.  Explanations are
157 in the following sections.
158
159 @table @emph
160 @item Overall Options
161 @xref{Overall Options,,Options Controlling the Kind of Output}.
162 @gccoptlist{-c  -S  -E  -o @var{file}  -combine -pipe  -pass-exit-codes  @gol
163 -x @var{language}  -v  -###  --help  --target-help  --version @@@var{file}}
164
165 @item C Language Options
166 @xref{C Dialect Options,,Options Controlling C Dialect}.
167 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
168 -aux-info @var{filename} @gol
169 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
170 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
171 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
172 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
173 -fsigned-bitfields  -fsigned-char @gol
174 @c APPLE LOCAL -Wnewline-eof 2001-08-23 --sts **
175 -Wnewline-eof (Apple compatible) @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 -fvisibility-ms-compat @gol
194 -Wabi  -Wctor-dtor-privacy @gol
195 -Wnon-virtual-dtor  -Wreorder @gol
196 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
197 -Wno-non-template-friend  -Wold-style-cast @gol
198 -Woverloaded-virtual  -Wno-pmf-conversions @gol
199 -Wsign-promo}
200
201 @item Objective-C and Objective-C++ Language Options
202 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
203 Objective-C and Objective-C++ Dialects}.
204 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
205 -fgnu-runtime  -fnext-runtime @gol
206 -fno-nil-receivers @gol
207 -fobjc-call-cxx-cdtors @gol
208 -fobjc-direct-dispatch @gol
209 -fobjc-exceptions @gol
210 -fobjc-gc @gol
211 -freplace-objc-classes @gol
212 -fzero-link @gol
213 -gen-decls @gol
214 -Wassign-intercept @gol
215 -Wno-protocol  -Wselector @gol
216 -Wstrict-selector-match @gol
217 -Wundeclared-selector}
218
219 @item Language Independent Options
220 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
221 @gccoptlist{-fmessage-length=@var{n}  @gol
222 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
223 -fdiagnostics-show-option}
224
225 @item Warning Options
226 @xref{Warning Options,,Options to Request or Suppress Warnings}.
227 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
228 -w  -Wextra  -Wall  -Waddress  -Waggregate-return -Wno-attributes @gol
229 -Wc++-compat -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment @gol
230 -Wconversion  -Wno-deprecated-declarations @gol
231 -Wdisabled-optimization  -Wno-div-by-zero  -Wno-endif-labels @gol
232 -Werror  -Werror=* -Werror-implicit-function-declaration @gol
233 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
234 -Wno-format-extra-args -Wformat-nonliteral @gol
235 -Wformat-security  -Wformat-y2k @gol
236 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
237 -Wimport  -Wno-import  -Winit-self  -Winline @gol
238 -Wno-int-to-pointer-cast @gol
239 -Wno-invalid-offsetof  -Winvalid-pch @gol
240 -Wlarger-than-@var{len}  -Wframe-larger-than-@var{len} @gol
241 -Wunsafe-loop-optimizations  -Wlong-long @gol
242 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
243 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
244 -Wmissing-noreturn @gol
245 @c APPLE LOCAL -Wmost
246 -Wmost (APPLE ONLY) @gol
247 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
248 -Woverlength-strings  -Wpacked  -Wpadded @gol
249 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
250 -Wredundant-decls @gol
251 -Wreturn-type  -Wsequence-point  -Wshadow @gol
252 -Wsign-compare  -Wstack-protector @gol
253 -Wstrict-aliasing -Wstrict-aliasing=2 @gol
254 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
255 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
256 -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
257 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
258 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
259 -Wunused-value  -Wunused-variable @gol
260 -Wvariadic-macros -Wvla @gol
261 -Wvolatile-register-var  -Wwrite-strings}
262
263 @item C-only Warning Options
264 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
265 -Wmissing-prototypes  -Wnested-externs  -Wold-style-definition @gol
266 -Wstrict-prototypes  -Wtraditional @gol
267 -Wdeclaration-after-statement -Wpointer-sign}
268
269 @item Debugging Options
270 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
271 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
272 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
273 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
274 -fdump-ipa-all -fdump-ipa-cgraph @gol
275 -fdump-tree-all @gol
276 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
277 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
278 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
279 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
280 -fdump-tree-ch @gol
281 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
282 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
283 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
284 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
285 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
288 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-nrv -fdump-tree-vect @gol
290 -fdump-tree-sink @gol
291 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-salias @gol
293 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
295 -ftree-vectorizer-verbose=@var{n} @gol
296 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
297 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
298 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
299 -fmem-report -fprofile-arcs @gol
300 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
301 -ftest-coverage  -ftime-report -fvar-tracking @gol
302 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
303 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
304 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
305 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
306 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
307 -print-multi-directory  -print-multi-lib @gol
308 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
309 -save-temps  -time}
310
311 @item Optimization Options
312 @xref{Optimize Options,,Options that Control Optimization}.
313 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
314 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
315 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
316 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
317 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
318 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
319 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
320 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
321 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
322 -fforce-addr  -ffunction-sections @gol
323 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
324 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
325 -finline-functions  -finline-functions-called-once @gol
326 -finline-limit=@var{n}  -fkeep-inline-functions @gol
327 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
328 -fmodulo-sched -fno-branch-count-reg @gol
329 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
330 -fno-function-cse  -fno-guess-branch-probability @gol
331 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
332 -funsafe-math-optimizations  -funsafe-loop-optimizations  -ffinite-math-only @gol
333 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
334 -fomit-frame-pointer  -foptimize-register-move @gol
335 -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
336 -fprofile-generate -fprofile-use @gol
337 -fregmove  -frename-registers @gol
338 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
339 -frerun-cse-after-loop @gol
340 -frounding-math -frtl-abstract-sequences @gol
341 -fschedule-insns  -fschedule-insns2 @gol
342 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
343 -fsched-spec-load-dangerous  @gol
344 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
345 -fsched2-use-superblocks @gol
346 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
347 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
348 -fstack-protector  -fstack-protector-all @gol
349 -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps @gol
350 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
351 -fsplit-ivs-in-unroller -funswitch-loops @gol
352 -fvariable-expansion-in-unroller @gol
353 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
354 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
355 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
356 -ftree-ch -ftree-sra -ftree-ter -ftree-lrs -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 -mid-shared-library @gol
443 -mno-id-shared-library -mshared-library-id=@var{n} @gol
444 -mlong-calls  -mno-long-calls}
445
446 @emph{CRIS Options}
447 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
448 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
449 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
450 -mstack-align  -mdata-align  -mconst-align @gol
451 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
452 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
453 -mmul-bug-workaround  -mno-mul-bug-workaround}
454
455 @emph{CRX Options}
456 @gccoptlist{-mmac -mpush-args}
457
458 @emph{Darwin Options}
459 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
460 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
461 -client_name  -compatibility_version  -current_version @gol
462 -dead_strip @gol
463 -dependency-file  -dylib_file  -dylinker_install_name @gol
464 -dynamic  -dynamiclib  -exported_symbols_list @gol
465 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
466 -force_flat_namespace  -headerpad_max_install_names @gol
467 -image_base  -init  -install_name  -keep_private_externs @gol
468 -multi_module  -multiply_defined  -multiply_defined_unused @gol
469 -noall_load   -no_dead_strip_inits_and_terms @gol
470 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
471 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
472 -private_bundle  -read_only_relocs  -sectalign @gol
473 -sectobjectsymbols  -whyload  -seg1addr @gol
474 -sectcreate  -sectobjectsymbols  -sectorder @gol
475 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
476 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
477 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
478 -single_module  -static  -sub_library  -sub_umbrella @gol
479 -twolevel_namespace  -umbrella  -undefined @gol
480 -unexported_symbols_list  -weak_reference_mismatches @gol
481 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
482 -mkernel -mone-byte-bool}
483
484 @emph{DEC Alpha Options}
485 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
486 -mieee  -mieee-with-inexact  -mieee-conformant @gol
487 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
488 -mtrap-precision=@var{mode}  -mbuild-constants @gol
489 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
490 -mbwx  -mmax  -mfix  -mcix @gol
491 -mfloat-vax  -mfloat-ieee @gol
492 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
493 -msmall-text  -mlarge-text @gol
494 -mmemory-latency=@var{time}}
495
496 @emph{DEC Alpha/VMS Options}
497 @gccoptlist{-mvms-return-codes}
498
499 @emph{FRV Options}
500 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
501 -mhard-float  -msoft-float @gol
502 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
503 -mdouble  -mno-double @gol
504 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
505 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
506 -mlinked-fp  -mlong-calls  -malign-labels @gol
507 -mlibrary-pic  -macc-4  -macc-8 @gol
508 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
509 -moptimize-membar -mno-optimize-membar @gol
510 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
511 -mvliw-branch  -mno-vliw-branch @gol
512 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
513 -mno-nested-cond-exec  -mtomcat-stats @gol
514 -mTLS -mtls @gol
515 -mcpu=@var{cpu}}
516
517 @emph{GNU/Linux Options}
518 @gccoptlist{-muclibc}
519
520 @emph{H8/300 Options}
521 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
522
523 @emph{HPPA Options}
524 @gccoptlist{-march=@var{architecture-type} @gol
525 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
526 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
527 -mfixed-range=@var{register-range} @gol
528 -mjump-in-delay -mlinker-opt -mlong-calls @gol
529 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
530 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
531 -mno-jump-in-delay  -mno-long-load-store @gol
532 -mno-portable-runtime  -mno-soft-float @gol
533 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
534 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
535 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
536 -munix=@var{unix-std}  -nolibdld  -static  -threads}
537
538 @emph{i386 and x86-64 Options}
539 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
540 -mfpmath=@var{unit} @gol
541 -masm=@var{dialect}  -mno-fancy-math-387 @gol
542 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
543 -mno-wide-multiply  -mrtd  -malign-double @gol
544 -mpreferred-stack-boundary=@var{num} @gol
545 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4a -m3dnow -mpopcnt -mabm @gol
546 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
547 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
548 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
549 -mstackrealign @gol
550 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
551 -mcmodel=@var{code-model} @gol
552 -m32  -m64 -mlarge-data-threshold=@var{num}}
553
554 @emph{IA-64 Options}
555 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
556 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
557 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
558 -minline-float-divide-max-throughput @gol
559 -minline-int-divide-min-latency @gol
560 -minline-int-divide-max-throughput  @gol
561 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
562 -mno-dwarf2-asm -mearly-stop-bits @gol
563 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
564 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
565 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
566 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
567 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
568 -mno-sched-prefer-non-data-spec-insns @gol
569 -mno-sched-prefer-non-control-spec-insns @gol
570 -mno-sched-count-spec-in-critical-path}
571
572 @emph{M32R/D Options}
573 @gccoptlist{-m32r2 -m32rx -m32r @gol
574 -mdebug @gol
575 -malign-loops -mno-align-loops @gol
576 -missue-rate=@var{number} @gol
577 -mbranch-cost=@var{number} @gol
578 -mmodel=@var{code-size-model-type} @gol
579 -msdata=@var{sdata-type} @gol
580 -mno-flush-func -mflush-func=@var{name} @gol
581 -mno-flush-trap -mflush-trap=@var{number} @gol
582 -G @var{num}}
583
584 @emph{M32C Options}
585 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
586
587 @emph{M680x0 Options}
588 @gccoptlist{-m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
589 -m68060  -mcpu32  -m5200  -mcfv4e -m68881  -mbitfield  @gol
590 -mc68000  -mc68020   @gol
591 -mnobitfield  -mrtd  -mshort  -msoft-float  -mpcrel @gol
592 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
593 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
594
595 @emph{M68hc1x Options}
596 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
597 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
598 -msoft-reg-count=@var{count}}
599
600 @emph{MCore Options}
601 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
602 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
603 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
604 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
605 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
606
607 @emph{MIPS Options}
608 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
609 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
610 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
611 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64  @gol
612 -mfp32  -mfp64  -mhard-float  -msoft-float  @gol
613 -msingle-float  -mdouble-float  -mdsp  -mpaired-single  -mips3d @gol
614 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
615 -G@var{num}  -membedded-data  -mno-embedded-data @gol
616 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
617 -msplit-addresses  -mno-split-addresses  @gol
618 -mexplicit-relocs  -mno-explicit-relocs  @gol
619 -mcheck-zero-division  -mno-check-zero-division @gol
620 -mdivide-traps  -mdivide-breaks @gol
621 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
622 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
623 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
624 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130 @gol
625 -mfix-sb1  -mno-fix-sb1 @gol
626 -mflush-func=@var{func}  -mno-flush-func @gol
627 -mbranch-likely  -mno-branch-likely @gol
628 -mfp-exceptions -mno-fp-exceptions @gol
629 -mvr4130-align -mno-vr4130-align}
630
631 @emph{MMIX Options}
632 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
633 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
634 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
635 -mno-base-addresses  -msingle-exit  -mno-single-exit}
636
637 @emph{MN10300 Options}
638 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
639 -mam33  -mno-am33 @gol
640 -mam33-2  -mno-am33-2 @gol
641 -mreturn-pointer-on-d0 @gol
642 -mno-crt0  -mrelax}
643
644 @emph{MT Options}
645 @gccoptlist{-mno-crt0 -mbacc -msim @gol
646 -march=@var{cpu-type} }
647
648 @emph{PDP-11 Options}
649 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
650 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
651 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
652 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
653 -mbranch-expensive  -mbranch-cheap @gol
654 -msplit  -mno-split  -munix-asm  -mdec-asm}
655
656 @emph{PowerPC Options}
657 See RS/6000 and PowerPC Options.
658
659 @emph{RS/6000 and PowerPC Options}
660 @gccoptlist{-mcpu=@var{cpu-type} @gol
661 -mtune=@var{cpu-type} @gol
662 -mpower  -mno-power  -mpower2  -mno-power2 @gol
663 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
664 -maltivec  -mno-altivec @gol
665 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
666 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
667 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
668 -mnew-mnemonics  -mold-mnemonics @gol
669 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
670 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
671 -malign-power  -malign-natural @gol
672 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
673 -mstring  -mno-string  -mupdate  -mno-update @gol
674 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
675 -mstrict-align  -mno-strict-align  -mrelocatable @gol
676 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
677 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
678 -mdynamic-no-pic  -maltivec  -mswdiv @gol
679 -mprioritize-restricted-insns=@var{priority} @gol
680 -msched-costly-dep=@var{dependence_type} @gol
681 -minsert-sched-nops=@var{scheme} @gol
682 -mcall-sysv  -mcall-netbsd @gol
683 -maix-struct-return  -msvr4-struct-return @gol
684 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
685 -misel -mno-isel @gol
686 -misel=yes  -misel=no @gol
687 -mspe -mno-spe @gol
688 -mspe=yes  -mspe=no @gol
689 -mvrsave -mno-vrsave @gol
690 -mmulhw -mno-mulhw @gol
691 -mdlmzb -mno-dlmzb @gol
692 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
693 -mprototype  -mno-prototype @gol
694 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
695 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
696
697 @emph{S/390 and zSeries Options}
698 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
699 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
700 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
701 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
702 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
703 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
704 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
705
706 @emph{Score Options}
707 @gccoptlist{-meb -mel @gol
708 -mnhwloop @gol
709 -muls @gol
710 -mmac @gol
711 -mscore5 -mscore5u -mscore7 -mscore7d}
712  
713 @emph{SH Options}
714 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
715 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
716 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
717 -m5-64media  -m5-64media-nofpu @gol
718 -m5-32media  -m5-32media-nofpu @gol
719 -m5-compact  -m5-compact-nofpu @gol
720 -mb  -ml  -mdalign  -mrelax @gol
721 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
722 -mieee  -misize  -mpadstruct  -mspace @gol
723 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
724 -mdivsi3_libfunc=@var{name}  @gol
725 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
726  -minvalid-symbols}
727
728 @emph{SPARC Options}
729 @gccoptlist{-mcpu=@var{cpu-type} @gol
730 -mtune=@var{cpu-type} @gol
731 -mcmodel=@var{code-model} @gol
732 -m32  -m64  -mapp-regs  -mno-app-regs @gol
733 -mfaster-structs  -mno-faster-structs @gol
734 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
735 -mhard-quad-float  -msoft-quad-float @gol
736 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
737 -mstack-bias  -mno-stack-bias @gol
738 -munaligned-doubles  -mno-unaligned-doubles @gol
739 -mv8plus  -mno-v8plus  -mvis  -mno-vis
740 -threads -pthreads -pthread}
741
742 @emph{System V Options}
743 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
744
745 @emph{TMS320C3x/C4x Options}
746 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
747 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
748 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
749 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
750
751 @emph{V850 Options}
752 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
753 -mprolog-function  -mno-prolog-function  -mspace @gol
754 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
755 -mapp-regs  -mno-app-regs @gol
756 -mdisable-callt  -mno-disable-callt @gol
757 -mv850e1 @gol
758 -mv850e @gol
759 -mv850  -mbig-switch}
760
761 @emph{VAX Options}
762 @gccoptlist{-mg  -mgnu  -munix}
763
764 @emph{x86-64 Options}
765 See i386 and x86-64 Options.
766
767 @emph{Xstormy16 Options}
768 @gccoptlist{-msim}
769
770 @emph{Xtensa Options}
771 @gccoptlist{-mconst16 -mno-const16 @gol
772 -mfused-madd  -mno-fused-madd @gol
773 -mtext-section-literals  -mno-text-section-literals @gol
774 -mtarget-align  -mno-target-align @gol
775 -mlongcalls  -mno-longcalls}
776
777 @emph{zSeries Options}
778 See S/390 and zSeries Options.
779
780 @item Code Generation Options
781 @xref{Code Gen Options,,Options for Code Generation Conventions}.
782 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
783 -ffixed-@var{reg}  -fexceptions @gol
784 -fnon-call-exceptions  -funwind-tables @gol
785 -fasynchronous-unwind-tables @gol
786 -finhibit-size-directive  -finstrument-functions @gol
787 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
788 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
789 -fno-common  -fno-ident @gol
790 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
791 -fno-jump-tables @gol
792 -freg-struct-return  -fshort-enums @gol
793 -fshort-double  -fshort-wchar @gol
794 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
795 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
796 -fargument-alias  -fargument-noalias @gol
797 -fargument-noalias-global  -fargument-noalias-anything
798 -fleading-underscore  -ftls-model=@var{model} @gol
799 -ftrapv  -fwrapv  -fbounds-check @gol
800 -fvisibility}
801 @end table
802
803 @menu
804 * Overall Options::     Controlling the kind of output:
805                         an executable, object files, assembler files,
806                         or preprocessed source.
807 * C Dialect Options::   Controlling the variant of C language compiled.
808 * C++ Dialect Options:: Variations on C++.
809 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
810                         and Objective-C++.
811 * Language Independent Options:: Controlling how diagnostics should be
812                         formatted.
813 * Warning Options::     How picky should the compiler be?
814 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
815 * Optimize Options::    How much optimization?
816 * Preprocessor Options:: Controlling header files and macro definitions.
817                          Also, getting dependency information for Make.
818 * Assembler Options::   Passing options to the assembler.
819 * Link Options::        Specifying libraries and so on.
820 * Directory Options::   Where to find header files and libraries.
821                         Where to find the compiler executable files.
822 * Spec Files::          How to pass switches to sub-processes.
823 * Target Options::      Running a cross-compiler, or an old version of GCC.
824 @end menu
825
826 @node Overall Options
827 @section Options Controlling the Kind of Output
828
829 Compilation can involve up to four stages: preprocessing, compilation
830 proper, assembly and linking, always in that order.  GCC is capable of
831 preprocessing and compiling several files either into several
832 assembler input files, or into one assembler input file; then each
833 assembler input file produces an object file, and linking combines all
834 the object files (those newly compiled, and those specified as input)
835 into an executable file.
836
837 @cindex file name suffix
838 For any given input file, the file name suffix determines what kind of
839 compilation is done:
840
841 @table @gcctabopt
842 @item @var{file}.c
843 C source code which must be preprocessed.
844
845 @item @var{file}.i
846 C source code which should not be preprocessed.
847
848 @item @var{file}.ii
849 C++ source code which should not be preprocessed.
850
851 @item @var{file}.m
852 Objective-C source code.  Note that you must link with the @file{libobjc}
853 library to make an Objective-C program work.
854
855 @item @var{file}.mi
856 Objective-C source code which should not be preprocessed.
857
858 @item @var{file}.mm
859 @itemx @var{file}.M
860 Objective-C++ source code.  Note that you must link with the @file{libobjc}
861 library to make an Objective-C++ program work.  Note that @samp{.M} refers
862 to a literal capital M@.
863
864 @item @var{file}.mii
865 Objective-C++ source code which should not be preprocessed.
866
867 @item @var{file}.h
868 C, C++, Objective-C or Objective-C++ header file to be turned into a
869 precompiled header.
870
871 @item @var{file}.cc
872 @itemx @var{file}.cp
873 @itemx @var{file}.cxx
874 @itemx @var{file}.cpp
875 @itemx @var{file}.CPP
876 @itemx @var{file}.c++
877 @itemx @var{file}.C
878 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
879 the last two letters must both be literally @samp{x}.  Likewise,
880 @samp{.C} refers to a literal capital C@.
881
882 @item @var{file}.mm
883 @itemx @var{file}.M
884 Objective-C++ source code which must be preprocessed.
885
886 @item @var{file}.mii
887 Objective-C++ source code which should not be preprocessed.
888
889 @item @var{file}.hh
890 @itemx @var{file}.H
891 C++ header file to be turned into a precompiled header.
892
893 @item @var{file}.f
894 @itemx @var{file}.for
895 @itemx @var{file}.FOR
896 Fixed form Fortran source code which should not be preprocessed.
897
898 @item @var{file}.F
899 @itemx @var{file}.fpp
900 @itemx @var{file}.FPP
901 Fixed form Fortran source code which must be preprocessed (with the traditional
902 preprocessor).
903
904 @item @var{file}.f90
905 @itemx @var{file}.f95
906 Free form Fortran source code which should not be preprocessed.
907
908 @item @var{file}.F90
909 @itemx @var{file}.F95
910 Free form Fortran source code which must be preprocessed (with the
911 traditional preprocessor).
912
913 @c FIXME: Descriptions of Java file types.
914 @c @var{file}.java
915 @c @var{file}.class
916 @c @var{file}.zip
917 @c @var{file}.jar
918
919 @item @var{file}.ads
920 Ada source code file which contains a library unit declaration (a
921 declaration of a package, subprogram, or generic, or a generic
922 instantiation), or a library unit renaming declaration (a package,
923 generic, or subprogram renaming declaration).  Such files are also
924 called @dfn{specs}.
925
926 @itemx @var{file}.adb
927 Ada source code file containing a library unit body (a subprogram or
928 package body).  Such files are also called @dfn{bodies}.
929
930 @c GCC also knows about some suffixes for languages not yet included:
931 @c Pascal:
932 @c @var{file}.p
933 @c @var{file}.pas
934 @c Ratfor:
935 @c @var{file}.r
936
937 @item @var{file}.s
938 Assembler code.
939
940 @item @var{file}.S
941 Assembler code which must be preprocessed.
942
943 @item @var{other}
944 An object file to be fed straight into linking.
945 Any file name with no recognized suffix is treated this way.
946 @end table
947
948 @opindex x
949 You can specify the input language explicitly with the @option{-x} option:
950
951 @table @gcctabopt
952 @item -x @var{language}
953 Specify explicitly the @var{language} for the following input files
954 (rather than letting the compiler choose a default based on the file
955 name suffix).  This option applies to all following input files until
956 the next @option{-x} option.  Possible values for @var{language} are:
957 @smallexample
958 c  c-header  c-cpp-output
959 c++  c++-header  c++-cpp-output
960 objective-c  objective-c-header  objective-c-cpp-output
961 objective-c++ objective-c++-header objective-c++-cpp-output
962 assembler  assembler-with-cpp
963 ada
964 f95  f95-cpp-input
965 java
966 treelang
967 @end smallexample
968
969 @item -x none
970 Turn off any specification of a language, so that subsequent files are
971 handled according to their file name suffixes (as they are if @option{-x}
972 has not been used at all).
973
974 @item -pass-exit-codes
975 @opindex pass-exit-codes
976 Normally the @command{gcc} program will exit with the code of 1 if any
977 phase of the compiler returns a non-success return code.  If you specify
978 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
979 numerically highest error produced by any phase that returned an error
980 indication.  The C, C++, and Fortran frontends return 4, if an internal
981 compiler error is encountered.
982 @end table
983
984 If you only want some of the stages of compilation, you can use
985 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
986 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
987 @command{gcc} is to stop.  Note that some combinations (for example,
988 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
989
990 @table @gcctabopt
991 @item -c
992 @opindex c
993 Compile or assemble the source files, but do not link.  The linking
994 stage simply is not done.  The ultimate output is in the form of an
995 object file for each source file.
996
997 By default, the object file name for a source file is made by replacing
998 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
999
1000 Unrecognized input files, not requiring compilation or assembly, are
1001 ignored.
1002
1003 @item -S
1004 @opindex S
1005 Stop after the stage of compilation proper; do not assemble.  The output
1006 is in the form of an assembler code file for each non-assembler input
1007 file specified.
1008
1009 By default, the assembler file name for a source file is made by
1010 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1011
1012 Input files that don't require compilation are ignored.
1013
1014 @item -E
1015 @opindex E
1016 Stop after the preprocessing stage; do not run the compiler proper.  The
1017 output is in the form of preprocessed source code, which is sent to the
1018 standard output.
1019
1020 Input files which don't require preprocessing are ignored.
1021
1022 @cindex output file option
1023 @item -o @var{file}
1024 @opindex o
1025 Place output in file @var{file}.  This applies regardless to whatever
1026 sort of output is being produced, whether it be an executable file,
1027 an object file, an assembler file or preprocessed C code.
1028
1029 If @option{-o} is not specified, the default is to put an executable
1030 file in @file{a.out}, the object file for
1031 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1032 assembler file in @file{@var{source}.s}, a precompiled header file in
1033 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1034 standard output.
1035
1036 @item -v
1037 @opindex v
1038 Print (on standard error output) the commands executed to run the stages
1039 of compilation.  Also print the version number of the compiler driver
1040 program and of the preprocessor and the compiler proper.
1041
1042 @item -###
1043 @opindex ###
1044 Like @option{-v} except the commands are not executed and all command
1045 arguments are quoted.  This is useful for shell scripts to capture the
1046 driver-generated command lines.
1047
1048 @item -pipe
1049 @opindex pipe
1050 Use pipes rather than temporary files for communication between the
1051 various stages of compilation.  This fails to work on some systems where
1052 the assembler is unable to read from a pipe; but the GNU assembler has
1053 no trouble.
1054
1055 @item -combine
1056 @opindex combine
1057 If you are compiling multiple source files, this option tells the driver
1058 to pass all the source files to the compiler at once (for those
1059 languages for which the compiler can handle this).  This will allow
1060 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1061 language for which this is supported is C@.  If you pass source files for
1062 multiple languages to the driver, using this option, the driver will invoke
1063 the compiler(s) that support IMA once each, passing each compiler all the
1064 source files appropriate for it.  For those languages that do not support
1065 IMA this option will be ignored, and the compiler will be invoked once for
1066 each source file in that language.  If you use this option in conjunction
1067 with @option{-save-temps}, the compiler will generate multiple
1068 pre-processed files
1069 (one for each source file), but only one (combined) @file{.o} or
1070 @file{.s} file.
1071
1072 @item --help
1073 @opindex help
1074 Print (on the standard output) a description of the command line options
1075 understood by @command{gcc}.  If the @option{-v} option is also specified
1076 then @option{--help} will also be passed on to the various processes
1077 invoked by @command{gcc}, so that they can display the command line options
1078 they accept.  If the @option{-Wextra} option is also specified then command
1079 line options which have no documentation associated with them will also
1080 be displayed.
1081
1082 @item --target-help
1083 @opindex target-help
1084 Print (on the standard output) a description of target specific command
1085 line options for each tool.
1086
1087 @item --version
1088 @opindex version
1089 Display the version number and copyrights of the invoked GCC@.
1090
1091 @include @value{srcdir}/../libiberty/at-file.texi
1092 @end table
1093
1094 @node Invoking G++
1095 @section Compiling C++ Programs
1096
1097 @cindex suffixes for C++ source
1098 @cindex C++ source file suffixes
1099 C++ source files conventionally use one of the suffixes @samp{.C},
1100 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1101 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1102 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1103 files with these names and compiles them as C++ programs even if you
1104 call the compiler the same way as for compiling C programs (usually
1105 with the name @command{gcc}).
1106
1107 @findex g++
1108 @findex c++
1109 However, the use of @command{gcc} does not add the C++ library.
1110 @command{g++} is a program that calls GCC and treats @samp{.c},
1111 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1112 files unless @option{-x} is used, and automatically specifies linking
1113 against the C++ library.  This program is also useful when
1114 precompiling a C header file with a @samp{.h} extension for use in C++
1115 compilations.  On many systems, @command{g++} is also installed with
1116 the name @command{c++}.
1117
1118 @cindex invoking @command{g++}
1119 When you compile C++ programs, you may specify many of the same
1120 command-line options that you use for compiling programs in any
1121 language; or command-line options meaningful for C and related
1122 languages; or options that are meaningful only for C++ programs.
1123 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1124 explanations of options for languages related to C@.
1125 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1126 explanations of options that are meaningful only for C++ programs.
1127
1128 @node C Dialect Options
1129 @section Options Controlling C Dialect
1130 @cindex dialect options
1131 @cindex language dialect options
1132 @cindex options, dialect
1133
1134 The following options control the dialect of C (or languages derived
1135 from C, such as C++, Objective-C and Objective-C++) that the compiler
1136 accepts:
1137
1138 @table @gcctabopt
1139 @cindex ANSI support
1140 @cindex ISO support
1141 @item -ansi
1142 @opindex ansi
1143 In C mode, support all ISO C90 programs.  In C++ mode,
1144 remove GNU extensions that conflict with ISO C++.
1145
1146 This turns off certain features of GCC that are incompatible with ISO
1147 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1148 such as the @code{asm} and @code{typeof} keywords, and
1149 predefined macros such as @code{unix} and @code{vax} that identify the
1150 type of system you are using.  It also enables the undesirable and
1151 rarely used ISO trigraph feature.  For the C compiler,
1152 it disables recognition of C++ style @samp{//} comments as well as
1153 the @code{inline} keyword.
1154
1155 The alternate keywords @code{__asm__}, @code{__extension__},
1156 @code{__inline__} and @code{__typeof__} continue to work despite
1157 @option{-ansi}.  You would not want to use them in an ISO C program, of
1158 course, but it is useful to put them in header files that might be included
1159 in compilations done with @option{-ansi}.  Alternate predefined macros
1160 such as @code{__unix__} and @code{__vax__} are also available, with or
1161 without @option{-ansi}.
1162
1163 The @option{-ansi} option does not cause non-ISO programs to be
1164 rejected gratuitously.  For that, @option{-pedantic} is required in
1165 addition to @option{-ansi}.  @xref{Warning Options}.
1166
1167 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1168 option is used.  Some header files may notice this macro and refrain
1169 from declaring certain functions or defining certain macros that the
1170 ISO standard doesn't call for; this is to avoid interfering with any
1171 programs that might use these names for other things.
1172
1173 Functions which would normally be built in but do not have semantics
1174 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1175 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1176 built-in functions provided by GCC}, for details of the functions
1177 affected.
1178
1179 @item -std=
1180 @opindex std
1181 Determine the language standard.  This option is currently only
1182 supported when compiling C or C++.  A value for this option must be
1183 provided; possible values are
1184
1185 @table @samp
1186 @item c89
1187 @itemx iso9899:1990
1188 ISO C90 (same as @option{-ansi}).
1189
1190 @item iso9899:199409
1191 ISO C90 as modified in amendment 1.
1192
1193 @item c99
1194 @itemx c9x
1195 @itemx iso9899:1999
1196 @itemx iso9899:199x
1197 ISO C99.  Note that this standard is not yet fully supported; see
1198 @w{@uref{http://gcc.gnu.org/gcc-4.2/c99status.html}} for more information.  The
1199 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1200
1201 @item gnu89
1202 Default, ISO C90 plus GNU extensions (including some C99 features).
1203
1204 @item gnu99
1205 @itemx gnu9x
1206 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1207 this will become the default.  The name @samp{gnu9x} is deprecated.
1208
1209 @item c++98
1210 The 1998 ISO C++ standard plus amendments.
1211
1212 @item gnu++98
1213 The same as @option{-std=c++98} plus GNU extensions.  This is the
1214 default for C++ code.
1215 @end table
1216
1217 Even when this option is not specified, you can still use some of the
1218 features of newer standards in so far as they do not conflict with
1219 previous C standards.  For example, you may use @code{__restrict__} even
1220 when @option{-std=c99} is not specified.
1221
1222 The @option{-std} options specifying some version of ISO C have the same
1223 effects as @option{-ansi}, except that features that were not in ISO C90
1224 but are in the specified version (for example, @samp{//} comments and
1225 the @code{inline} keyword in ISO C99) are not disabled.
1226
1227 @xref{Standards,,Language Standards Supported by GCC}, for details of
1228 these standard versions.
1229
1230 @item -fgnu89-inline
1231 @opindex fgnu89-inline
1232 The option @option{-fgnu89-inline} tells GCC to use the traditional
1233 GNU semantics for @code{inline} functions when in C99 mode.
1234 @xref{Inline,,An Inline Function is As Fast As a Macro}.  Using this
1235 option is roughly equivalent to adding the @code{gnu_inline} function
1236 attribute to all inline functions (@pxref{Function Attributes}).
1237
1238 This option is accepted by GCC versions 4.1.3 and up.  In GCC versions
1239 prior to 4.3, C99 inline semantics are not supported, and thus this
1240 option is effectively assumed to be present regardless of whether or not
1241 it is specified; the only effect of specifying it explicitly is to
1242 disable warnings about using inline functions in C99 mode.  Likewise,
1243 the option @option{-fno-gnu89-inline} is not supported in versions of
1244 GCC before 4.3.  It will be supported only in C99 or gnu99 mode, not in
1245 C89 or gnu89 mode.
1246
1247 The preprocesor macros @code{__GNUC_GNU_INLINE__} and
1248 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1249 in effect for @code{inline} functions.  @xref{Common Predefined
1250 Macros,,,cpp,The C Preprocessor}.
1251
1252 @item -aux-info @var{filename}
1253 @opindex aux-info
1254 Output to the given filename prototyped declarations for all functions
1255 declared and/or defined in a translation unit, including those in header
1256 files.  This option is silently ignored in any language other than C@.
1257
1258 Besides declarations, the file indicates, in comments, the origin of
1259 each declaration (source file and line), whether the declaration was
1260 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1261 @samp{O} for old, respectively, in the first character after the line
1262 number and the colon), and whether it came from a declaration or a
1263 definition (@samp{C} or @samp{F}, respectively, in the following
1264 character).  In the case of function definitions, a K&R-style list of
1265 arguments followed by their declarations is also provided, inside
1266 comments, after the declaration.
1267
1268 @item -fno-asm
1269 @opindex fno-asm
1270 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1271 keyword, so that code can use these words as identifiers.  You can use
1272 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1273 instead.  @option{-ansi} implies @option{-fno-asm}.
1274
1275 In C++, this switch only affects the @code{typeof} keyword, since
1276 @code{asm} and @code{inline} are standard keywords.  You may want to
1277 use the @option{-fno-gnu-keywords} flag instead, which has the same
1278 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1279 switch only affects the @code{asm} and @code{typeof} keywords, since
1280 @code{inline} is a standard keyword in ISO C99.
1281
1282 @item -fno-builtin
1283 @itemx -fno-builtin-@var{function}
1284 @opindex fno-builtin
1285 @cindex built-in functions
1286 Don't recognize built-in functions that do not begin with
1287 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1288 functions provided by GCC}, for details of the functions affected,
1289 including those which are not built-in functions when @option{-ansi} or
1290 @option{-std} options for strict ISO C conformance are used because they
1291 do not have an ISO standard meaning.
1292
1293 GCC normally generates special code to handle certain built-in functions
1294 more efficiently; for instance, calls to @code{alloca} may become single
1295 instructions that adjust the stack directly, and calls to @code{memcpy}
1296 may become inline copy loops.  The resulting code is often both smaller
1297 and faster, but since the function calls no longer appear as such, you
1298 cannot set a breakpoint on those calls, nor can you change the behavior
1299 of the functions by linking with a different library.  In addition,
1300 when a function is recognized as a built-in function, GCC may use
1301 information about that function to warn about problems with calls to
1302 that function, or to generate more efficient code, even if the
1303 resulting code still contains calls to that function.  For example,
1304 warnings are given with @option{-Wformat} for bad calls to
1305 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1306 known not to modify global memory.
1307
1308 With the @option{-fno-builtin-@var{function}} option
1309 only the built-in function @var{function} is
1310 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1311 function is named this is not built-in in this version of GCC, this
1312 option is ignored.  There is no corresponding
1313 @option{-fbuiltin-@var{function}} option; if you wish to enable
1314 built-in functions selectively when using @option{-fno-builtin} or
1315 @option{-ffreestanding}, you may define macros such as:
1316
1317 @smallexample
1318 #define abs(n)          __builtin_abs ((n))
1319 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1320 @end smallexample
1321
1322 @item -fhosted
1323 @opindex fhosted
1324 @cindex hosted environment
1325
1326 Assert that compilation takes place in a hosted environment.  This implies
1327 @option{-fbuiltin}.  A hosted environment is one in which the
1328 entire standard library is available, and in which @code{main} has a return
1329 type of @code{int}.  Examples are nearly everything except a kernel.
1330 This is equivalent to @option{-fno-freestanding}.
1331
1332 @item -ffreestanding
1333 @opindex ffreestanding
1334 @cindex hosted environment
1335
1336 Assert that compilation takes place in a freestanding environment.  This
1337 implies @option{-fno-builtin}.  A freestanding environment
1338 is one in which the standard library may not exist, and program startup may
1339 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1340 This is equivalent to @option{-fno-hosted}.
1341
1342 @xref{Standards,,Language Standards Supported by GCC}, for details of
1343 freestanding and hosted environments.
1344
1345 @item -fopenmp
1346 @opindex fopenmp
1347 @cindex openmp parallel
1348 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1349 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1350 compiler generates parallel code according to the OpenMP Application
1351 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1352
1353 @item -fms-extensions
1354 @opindex fms-extensions
1355 Accept some non-standard constructs used in Microsoft header files.
1356
1357 Some cases of unnamed fields in structures and unions are only
1358 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1359 fields within structs/unions}, for details.
1360
1361 @item -trigraphs
1362 @opindex trigraphs
1363 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1364 options for strict ISO C conformance) implies @option{-trigraphs}.
1365
1366 @item -no-integrated-cpp
1367 @opindex no-integrated-cpp
1368 Performs a compilation in two passes: preprocessing and compiling.  This
1369 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1370 @option{-B} option.  The user supplied compilation step can then add in
1371 an additional preprocessing step after normal preprocessing but before
1372 compiling.  The default is to use the integrated cpp (internal cpp)
1373
1374 The semantics of this option will change if "cc1", "cc1plus", and
1375 "cc1obj" are merged.
1376
1377 @cindex traditional C language
1378 @cindex C language, traditional
1379 @item -traditional
1380 @itemx -traditional-cpp
1381 @opindex traditional-cpp
1382 @opindex traditional
1383 Formerly, these options caused GCC to attempt to emulate a pre-standard
1384 C compiler.  They are now only supported with the @option{-E} switch.
1385 The preprocessor continues to support a pre-standard mode.  See the GNU
1386 CPP manual for details.
1387
1388 @item -fcond-mismatch
1389 @opindex fcond-mismatch
1390 Allow conditional expressions with mismatched types in the second and
1391 third arguments.  The value of such an expression is void.  This option
1392 is not supported for C++.
1393
1394 @item -flax-vector-conversions
1395 @opindex flax-vector-conversions
1396 Allow implicit conversions between vectors with differing numbers of
1397 elements and/or incompatible element types.  This option should not be
1398 used for new code.
1399
1400 @item -funsigned-char
1401 @opindex funsigned-char
1402 Let the type @code{char} be unsigned, like @code{unsigned char}.
1403
1404 Each kind of machine has a default for what @code{char} should
1405 be.  It is either like @code{unsigned char} by default or like
1406 @code{signed char} by default.
1407
1408 Ideally, a portable program should always use @code{signed char} or
1409 @code{unsigned char} when it depends on the signedness of an object.
1410 But many programs have been written to use plain @code{char} and
1411 expect it to be signed, or expect it to be unsigned, depending on the
1412 machines they were written for.  This option, and its inverse, let you
1413 make such a program work with the opposite default.
1414
1415 The type @code{char} is always a distinct type from each of
1416 @code{signed char} or @code{unsigned char}, even though its behavior
1417 is always just like one of those two.
1418
1419 @item -fsigned-char
1420 @opindex fsigned-char
1421 Let the type @code{char} be signed, like @code{signed char}.
1422
1423 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1424 the negative form of @option{-funsigned-char}.  Likewise, the option
1425 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1426
1427 @item -fsigned-bitfields
1428 @itemx -funsigned-bitfields
1429 @itemx -fno-signed-bitfields
1430 @itemx -fno-unsigned-bitfields
1431 @opindex fsigned-bitfields
1432 @opindex funsigned-bitfields
1433 @opindex fno-signed-bitfields
1434 @opindex fno-unsigned-bitfields
1435 These options control whether a bit-field is signed or unsigned, when the
1436 declaration does not use either @code{signed} or @code{unsigned}.  By
1437 default, such a bit-field is signed, because this is consistent: the
1438 basic integer types such as @code{int} are signed types.
1439 @end table
1440
1441 @node C++ Dialect Options
1442 @section Options Controlling C++ Dialect
1443
1444 @cindex compiler options, C++
1445 @cindex C++ options, command line
1446 @cindex options, C++
1447 This section describes the command-line options that are only meaningful
1448 for C++ programs; but you can also use most of the GNU compiler options
1449 regardless of what language your program is in.  For example, you
1450 might compile a file @code{firstClass.C} like this:
1451
1452 @smallexample
1453 g++ -g -frepo -O -c firstClass.C
1454 @end smallexample
1455
1456 @noindent
1457 In this example, only @option{-frepo} is an option meant
1458 only for C++ programs; you can use the other options with any
1459 language supported by GCC@.
1460
1461 Here is a list of options that are @emph{only} for compiling C++ programs:
1462
1463 @table @gcctabopt
1464
1465 @item -fabi-version=@var{n}
1466 @opindex fabi-version
1467 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1468 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1469 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1470 the version that conforms most closely to the C++ ABI specification.
1471 Therefore, the ABI obtained using version 0 will change as ABI bugs
1472 are fixed.
1473
1474 The default is version 2.
1475
1476 @item -fno-access-control
1477 @opindex fno-access-control
1478 Turn off all access checking.  This switch is mainly useful for working
1479 around bugs in the access control code.
1480
1481 @item -fcheck-new
1482 @opindex fcheck-new
1483 Check that the pointer returned by @code{operator new} is non-null
1484 before attempting to modify the storage allocated.  This check is
1485 normally unnecessary because the C++ standard specifies that
1486 @code{operator new} will only return @code{0} if it is declared
1487 @samp{throw()}, in which case the compiler will always check the
1488 return value even without this option.  In all other cases, when
1489 @code{operator new} has a non-empty exception specification, memory
1490 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1491 @samp{new (nothrow)}.
1492
1493 @item -fconserve-space
1494 @opindex fconserve-space
1495 Put uninitialized or runtime-initialized global variables into the
1496 common segment, as C does.  This saves space in the executable at the
1497 cost of not diagnosing duplicate definitions.  If you compile with this
1498 flag and your program mysteriously crashes after @code{main()} has
1499 completed, you may have an object that is being destroyed twice because
1500 two definitions were merged.
1501
1502 This option is no longer useful on most targets, now that support has
1503 been added for putting variables into BSS without making them common.
1504
1505 @item -ffriend-injection
1506 @opindex ffriend-injection
1507 Inject friend functions into the enclosing namespace, so that they are
1508 visible outside the scope of the class in which they are declared.
1509 Friend functions were documented to work this way in the old Annotated
1510 C++ Reference Manual, and versions of G++ before 4.1 always worked
1511 that way.  However, in ISO C++ a friend function which is not declared
1512 in an enclosing scope can only be found using argument dependent
1513 lookup.  This option causes friends to be injected as they were in
1514 earlier releases.
1515
1516 This option is for compatibility, and may be removed in a future
1517 release of G++.
1518
1519 @item -fno-elide-constructors
1520 @opindex fno-elide-constructors
1521 The C++ standard allows an implementation to omit creating a temporary
1522 which is only used to initialize another object of the same type.
1523 Specifying this option disables that optimization, and forces G++ to
1524 call the copy constructor in all cases.
1525
1526 @item -fno-enforce-eh-specs
1527 @opindex fno-enforce-eh-specs
1528 Don't generate code to check for violation of exception specifications
1529 at runtime.  This option violates the C++ standard, but may be useful
1530 for reducing code size in production builds, much like defining
1531 @samp{NDEBUG}.  This does not give user code permission to throw
1532 exceptions in violation of the exception specifications; the compiler
1533 will still optimize based on the specifications, so throwing an
1534 unexpected exception will result in undefined behavior.
1535
1536 @item -ffor-scope
1537 @itemx -fno-for-scope
1538 @opindex ffor-scope
1539 @opindex fno-for-scope
1540 If @option{-ffor-scope} is specified, the scope of variables declared in
1541 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1542 as specified by the C++ standard.
1543 If @option{-fno-for-scope} is specified, the scope of variables declared in
1544 a @i{for-init-statement} extends to the end of the enclosing scope,
1545 as was the case in old versions of G++, and other (traditional)
1546 implementations of C++.
1547
1548 The default if neither flag is given to follow the standard,
1549 but to allow and give a warning for old-style code that would
1550 otherwise be invalid, or have different behavior.
1551
1552 @item -fno-gnu-keywords
1553 @opindex fno-gnu-keywords
1554 Do not recognize @code{typeof} as a keyword, so that code can use this
1555 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1556 @option{-ansi} implies @option{-fno-gnu-keywords}.
1557
1558 @item -fno-implicit-templates
1559 @opindex fno-implicit-templates
1560 Never emit code for non-inline templates which are instantiated
1561 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1562 @xref{Template Instantiation}, for more information.
1563
1564 @item -fno-implicit-inline-templates
1565 @opindex fno-implicit-inline-templates
1566 Don't emit code for implicit instantiations of inline templates, either.
1567 The default is to handle inlines differently so that compiles with and
1568 without optimization will need the same set of explicit instantiations.
1569
1570 @item -fno-implement-inlines
1571 @opindex fno-implement-inlines
1572 To save space, do not emit out-of-line copies of inline functions
1573 controlled by @samp{#pragma implementation}.  This will cause linker
1574 errors if these functions are not inlined everywhere they are called.
1575
1576 @item -fms-extensions
1577 @opindex fms-extensions
1578 Disable pedantic warnings about constructs used in MFC, such as implicit
1579 int and getting a pointer to member function via non-standard syntax.
1580
1581 @item -fno-nonansi-builtins
1582 @opindex fno-nonansi-builtins
1583 Disable built-in declarations of functions that are not mandated by
1584 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1585 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1586
1587 @item -fno-operator-names
1588 @opindex fno-operator-names
1589 Do not treat the operator name keywords @code{and}, @code{bitand},
1590 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1591 synonyms as keywords.
1592
1593 @item -fno-optional-diags
1594 @opindex fno-optional-diags
1595 Disable diagnostics that the standard says a compiler does not need to
1596 issue.  Currently, the only such diagnostic issued by G++ is the one for
1597 a name having multiple meanings within a class.
1598
1599 @item -fpermissive
1600 @opindex fpermissive
1601 Downgrade some diagnostics about nonconformant code from errors to
1602 warnings.  Thus, using @option{-fpermissive} will allow some
1603 nonconforming code to compile.
1604
1605 @item -frepo
1606 @opindex frepo
1607 Enable automatic template instantiation at link time.  This option also
1608 implies @option{-fno-implicit-templates}.  @xref{Template
1609 Instantiation}, for more information.
1610
1611 @item -fno-rtti
1612 @opindex fno-rtti
1613 Disable generation of information about every class with virtual
1614 functions for use by the C++ runtime type identification features
1615 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1616 of the language, you can save some space by using this flag.  Note that
1617 exception handling uses the same information, but it will generate it as
1618 needed. The @samp{dynamic_cast} operator can still be used for casts that
1619 do not require runtime type information, i.e. casts to @code{void *} or to
1620 unambiguous base classes.
1621
1622 @item -fstats
1623 @opindex fstats
1624 Emit statistics about front-end processing at the end of the compilation.
1625 This information is generally only useful to the G++ development team.
1626
1627 @item -ftemplate-depth-@var{n}
1628 @opindex ftemplate-depth
1629 Set the maximum instantiation depth for template classes to @var{n}.
1630 A limit on the template instantiation depth is needed to detect
1631 endless recursions during template class instantiation.  ANSI/ISO C++
1632 conforming programs must not rely on a maximum depth greater than 17.
1633
1634 @item -fno-threadsafe-statics
1635 @opindex fno-threadsafe-statics
1636 Do not emit the extra code to use the routines specified in the C++
1637 ABI for thread-safe initialization of local statics.  You can use this
1638 option to reduce code size slightly in code that doesn't need to be
1639 thread-safe.
1640
1641 @item -fuse-cxa-atexit
1642 @opindex fuse-cxa-atexit
1643 Register destructors for objects with static storage duration with the
1644 @code{__cxa_atexit} function rather than the @code{atexit} function.
1645 This option is required for fully standards-compliant handling of static
1646 destructors, but will only work if your C library supports
1647 @code{__cxa_atexit}.
1648
1649 @item -fno-use-cxa-get-exception-ptr
1650 @opindex fno-use-cxa-get-exception-ptr
1651 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1652 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1653 if the runtime routine is not available.
1654
1655 @item -fvisibility-inlines-hidden
1656 @opindex fvisibility-inlines-hidden
1657 This switch declares that the user does not attempt to compare
1658 pointers to inline methods where the addresses of the two functions
1659 were taken in different shared objects.
1660
1661 The effect of this is that GCC may, effectively, mark inline methods with
1662 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1663 appear in the export table of a DSO and do not require a PLT indirection
1664 when used within the DSO@.  Enabling this option can have a dramatic effect
1665 on load and link times of a DSO as it massively reduces the size of the
1666 dynamic export table when the library makes heavy use of templates.
1667
1668 The behaviour of this switch is not quite the same as marking the
1669 methods as hidden directly, because it does not affect static variables
1670 local to the function or cause the compiler to deduce that
1671 the function is defined in only one shared object.
1672
1673 You may mark a method as having a visibility explicitly to negate the
1674 effect of the switch for that method.  For example, if you do want to
1675 compare pointers to a particular inline method, you might mark it as
1676 having default visibility.  Marking the enclosing class with explicit
1677 visibility will have no effect.
1678
1679 Explicitly instantiated inline methods are unaffected by this option
1680 as their linkage might otherwise cross a shared library boundary.
1681 @xref{Template Instantiation}.
1682
1683 @item -fvisibility-ms-compat
1684 @opindex fvisibility-ms-compat
1685 This flag attempts to use visibility settings to make GCC's C++
1686 linkage model compatible with that of Microsoft Visual Studio.
1687
1688 The flag makes these changes to GCC's linkage model:
1689
1690 @enumerate
1691 @item
1692 It sets the default visibility to @code{hidden}, like
1693 @option{-fvisibility=hidden}.
1694
1695 @item
1696 Types, but not their members, are not hidden by default.
1697
1698 @item
1699 The One Definition Rule is relaxed for types without explicit
1700 visibility specifications which are defined in more than one different
1701 shared object: those declarations are permitted if they would have
1702 been permitted when this option was not used.
1703 @end enumerate
1704
1705 In new code it is better to use @option{-fvisibility=hidden} and
1706 export those classes which are intended to be externally visible.
1707 Unfortunately it is possible for code to rely, perhaps accidentally,
1708 on the Visual Studio behaviour.
1709
1710 Among the consequences of these changes are that static data members
1711 of the same type with the same name but defined in different shared
1712 objects will be different, so changing one will not change the other;
1713 and that pointers to function members defined in different shared
1714 objects may not compare equal.  When this flag is given, it is a
1715 violation of the ODR to define types with the same name differently.
1716
1717 @item -fno-weak
1718 @opindex fno-weak
1719 Do not use weak symbol support, even if it is provided by the linker.
1720 By default, G++ will use weak symbols if they are available.  This
1721 option exists only for testing, and should not be used by end-users;
1722 it will result in inferior code and has no benefits.  This option may
1723 be removed in a future release of G++.
1724
1725 @item -nostdinc++
1726 @opindex nostdinc++
1727 Do not search for header files in the standard directories specific to
1728 C++, but do still search the other standard directories.  (This option
1729 is used when building the C++ library.)
1730 @end table
1731
1732 In addition, these optimization, warning, and code generation options
1733 have meanings only for C++ programs:
1734
1735 @table @gcctabopt
1736 @item -fno-default-inline
1737 @opindex fno-default-inline
1738 Do not assume @samp{inline} for functions defined inside a class scope.
1739 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1740 functions will have linkage like inline functions; they just won't be
1741 inlined by default.
1742
1743 @item -Wabi @r{(C++ only)}
1744 @opindex Wabi
1745 Warn when G++ generates code that is probably not compatible with the
1746 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1747 all such cases, there are probably some cases that are not warned about,
1748 even though G++ is generating incompatible code.  There may also be
1749 cases where warnings are emitted even though the code that is generated
1750 will be compatible.
1751
1752 You should rewrite your code to avoid these warnings if you are
1753 concerned about the fact that code generated by G++ may not be binary
1754 compatible with code generated by other compilers.
1755
1756 The known incompatibilities at this point include:
1757
1758 @itemize @bullet
1759
1760 @item
1761 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1762 pack data into the same byte as a base class.  For example:
1763
1764 @smallexample
1765 struct A @{ virtual void f(); int f1 : 1; @};
1766 struct B : public A @{ int f2 : 1; @};
1767 @end smallexample
1768
1769 @noindent
1770 In this case, G++ will place @code{B::f2} into the same byte
1771 as@code{A::f1}; other compilers will not.  You can avoid this problem
1772 by explicitly padding @code{A} so that its size is a multiple of the
1773 byte size on your platform; that will cause G++ and other compilers to
1774 layout @code{B} identically.
1775
1776 @item
1777 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1778 tail padding when laying out virtual bases.  For example:
1779
1780 @smallexample
1781 struct A @{ virtual void f(); char c1; @};
1782 struct B @{ B(); char c2; @};
1783 struct C : public A, public virtual B @{@};
1784 @end smallexample
1785
1786 @noindent
1787 In this case, G++ will not place @code{B} into the tail-padding for
1788 @code{A}; other compilers will.  You can avoid this problem by
1789 explicitly padding @code{A} so that its size is a multiple of its
1790 alignment (ignoring virtual base classes); that will cause G++ and other
1791 compilers to layout @code{C} identically.
1792
1793 @item
1794 Incorrect handling of bit-fields with declared widths greater than that
1795 of their underlying types, when the bit-fields appear in a union.  For
1796 example:
1797
1798 @smallexample
1799 union U @{ int i : 4096; @};
1800 @end smallexample
1801
1802 @noindent
1803 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1804 union too small by the number of bits in an @code{int}.
1805
1806 @item
1807 Empty classes can be placed at incorrect offsets.  For example:
1808
1809 @smallexample
1810 struct A @{@};
1811
1812 struct B @{
1813   A a;
1814   virtual void f ();
1815 @};
1816
1817 struct C : public B, public A @{@};
1818 @end smallexample
1819
1820 @noindent
1821 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1822 it should be placed at offset zero.  G++ mistakenly believes that the
1823 @code{A} data member of @code{B} is already at offset zero.
1824
1825 @item
1826 Names of template functions whose types involve @code{typename} or
1827 template template parameters can be mangled incorrectly.
1828
1829 @smallexample
1830 template <typename Q>
1831 void f(typename Q::X) @{@}
1832
1833 template <template <typename> class Q>
1834 void f(typename Q<int>::X) @{@}
1835 @end smallexample
1836
1837 @noindent
1838 Instantiations of these templates may be mangled incorrectly.
1839
1840 @end itemize
1841
1842 @item -Wctor-dtor-privacy @r{(C++ only)}
1843 @opindex Wctor-dtor-privacy
1844 Warn when a class seems unusable because all the constructors or
1845 destructors in that class are private, and it has neither friends nor
1846 public static member functions.
1847
1848 @item -Wnon-virtual-dtor @r{(C++ only)}
1849 @opindex Wnon-virtual-dtor
1850 Warn when a class appears to be polymorphic, thereby requiring a virtual
1851 destructor, yet it declares a non-virtual one.  This warning is also
1852 enabled if -Weffc++ is specified.
1853
1854 @item -Wreorder @r{(C++ only)}
1855 @opindex Wreorder
1856 @cindex reordering, warning
1857 @cindex warning for reordering of member initializers
1858 Warn when the order of member initializers given in the code does not
1859 match the order in which they must be executed.  For instance:
1860
1861 @smallexample
1862 struct A @{
1863   int i;
1864   int j;
1865   A(): j (0), i (1) @{ @}
1866 @};
1867 @end smallexample
1868
1869 The compiler will rearrange the member initializers for @samp{i}
1870 and @samp{j} to match the declaration order of the members, emitting
1871 a warning to that effect.  This warning is enabled by @option{-Wall}.
1872 @end table
1873
1874 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1875
1876 @table @gcctabopt
1877 @item -Weffc++ @r{(C++ only)}
1878 @opindex Weffc++
1879 Warn about violations of the following style guidelines from Scott Meyers'
1880 @cite{Effective C++} book:
1881
1882 @itemize @bullet
1883 @item
1884 Item 11:  Define a copy constructor and an assignment operator for classes
1885 with dynamically allocated memory.
1886
1887 @item
1888 Item 12:  Prefer initialization to assignment in constructors.
1889
1890 @item
1891 Item 14:  Make destructors virtual in base classes.
1892
1893 @item
1894 Item 15:  Have @code{operator=} return a reference to @code{*this}.
1895
1896 @item
1897 Item 23:  Don't try to return a reference when you must return an object.
1898
1899 @end itemize
1900
1901 Also warn about violations of the following style guidelines from
1902 Scott Meyers' @cite{More Effective C++} book:
1903
1904 @itemize @bullet
1905 @item
1906 Item 6:  Distinguish between prefix and postfix forms of increment and
1907 decrement operators.
1908
1909 @item
1910 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
1911
1912 @end itemize
1913
1914 When selecting this option, be aware that the standard library
1915 headers do not obey all of these guidelines; use @samp{grep -v}
1916 to filter out those warnings.
1917
1918 @item -Wno-deprecated @r{(C++ only)}
1919 @opindex Wno-deprecated
1920 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
1921
1922 @item -Wstrict-null-sentinel @r{(C++ only)}
1923 @opindex Wstrict-null-sentinel
1924 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
1925 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
1926 to @code{__null}.  Although it is a null pointer constant not a null pointer,
1927 it is guaranteed to of the same size as a pointer.  But this use is
1928 not portable across different compilers.
1929
1930 @item -Wno-non-template-friend @r{(C++ only)}
1931 @opindex Wno-non-template-friend
1932 Disable warnings when non-templatized friend functions are declared
1933 within a template.  Since the advent of explicit template specification
1934 support in G++, if the name of the friend is an unqualified-id (i.e.,
1935 @samp{friend foo(int)}), the C++ language specification demands that the
1936 friend declare or define an ordinary, nontemplate function.  (Section
1937 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
1938 could be interpreted as a particular specialization of a templatized
1939 function.  Because this non-conforming behavior is no longer the default
1940 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
1941 check existing code for potential trouble spots and is on by default.
1942 This new compiler behavior can be turned off with
1943 @option{-Wno-non-template-friend} which keeps the conformant compiler code
1944 but disables the helpful warning.
1945
1946 @item -Wold-style-cast @r{(C++ only)}
1947 @opindex Wold-style-cast
1948 Warn if an old-style (C-style) cast to a non-void type is used within
1949 a C++ program.  The new-style casts (@samp{dynamic_cast},
1950 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
1951 less vulnerable to unintended effects and much easier to search for.
1952
1953 @item -Woverloaded-virtual @r{(C++ only)}
1954 @opindex Woverloaded-virtual
1955 @cindex overloaded virtual fn, warning
1956 @cindex warning for overloaded virtual fn
1957 Warn when a function declaration hides virtual functions from a
1958 base class.  For example, in:
1959
1960 @smallexample
1961 struct A @{
1962   virtual void f();
1963 @};
1964
1965 struct B: public A @{
1966   void f(int);
1967 @};
1968 @end smallexample
1969
1970 the @code{A} class version of @code{f} is hidden in @code{B}, and code
1971 like:
1972
1973 @smallexample
1974 B* b;
1975 b->f();
1976 @end smallexample
1977
1978 will fail to compile.
1979
1980 @item -Wno-pmf-conversions @r{(C++ only)}
1981 @opindex Wno-pmf-conversions
1982 Disable the diagnostic for converting a bound pointer to member function
1983 to a plain pointer.
1984
1985 @item -Wsign-promo @r{(C++ only)}
1986 @opindex Wsign-promo
1987 Warn when overload resolution chooses a promotion from unsigned or
1988 enumerated type to a signed type, over a conversion to an unsigned type of
1989 the same size.  Previous versions of G++ would try to preserve
1990 unsignedness, but the standard mandates the current behavior.
1991
1992 @smallexample
1993 struct A @{
1994   operator int ();
1995   A& operator = (int);
1996 @};
1997
1998 main ()
1999 @{
2000   A a,b;
2001   a = b;
2002 @}
2003 @end smallexample
2004
2005 In this example, G++ will synthesize a default @samp{A& operator =
2006 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2007 @end table
2008
2009 @node Objective-C and Objective-C++ Dialect Options
2010 @section Options Controlling Objective-C and Objective-C++ Dialects
2011
2012 @cindex compiler options, Objective-C and Objective-C++
2013 @cindex Objective-C and Objective-C++ options, command line
2014 @cindex options, Objective-C and Objective-C++
2015 (NOTE: This manual does not describe the Objective-C and Objective-C++
2016 languages themselves.  See @xref{Standards,,Language Standards
2017 Supported by GCC}, for references.)
2018
2019 This section describes the command-line options that are only meaningful
2020 for Objective-C and Objective-C++ programs, but you can also use most of
2021 the language-independent GNU compiler options.
2022 For example, you might compile a file @code{some_class.m} like this:
2023
2024 @smallexample
2025 gcc -g -fgnu-runtime -O -c some_class.m
2026 @end smallexample
2027
2028 @noindent
2029 In this example, @option{-fgnu-runtime} is an option meant only for
2030 Objective-C and Objective-C++ programs; you can use the other options with
2031 any language supported by GCC@.
2032
2033 Note that since Objective-C is an extension of the C language, Objective-C
2034 compilations may also use options specific to the C front-end (e.g.,
2035 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2036 C++-specific options (e.g., @option{-Wabi}).
2037
2038 Here is a list of options that are @emph{only} for compiling Objective-C
2039 and Objective-C++ programs:
2040
2041 @table @gcctabopt
2042 @item -fconstant-string-class=@var{class-name}
2043 @opindex fconstant-string-class
2044 Use @var{class-name} as the name of the class to instantiate for each
2045 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2046 class name is @code{NXConstantString} if the GNU runtime is being used, and
2047 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2048 @option{-fconstant-cfstrings} option, if also present, will override the
2049 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2050 to be laid out as constant CoreFoundation strings.
2051
2052 @item -fgnu-runtime
2053 @opindex fgnu-runtime
2054 Generate object code compatible with the standard GNU Objective-C
2055 runtime.  This is the default for most types of systems.
2056
2057 @item -fnext-runtime
2058 @opindex fnext-runtime
2059 Generate output compatible with the NeXT runtime.  This is the default
2060 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2061 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2062 used.
2063
2064 @item -fno-nil-receivers
2065 @opindex fno-nil-receivers
2066 Assume that all Objective-C message dispatches (e.g.,
2067 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2068 is not @code{nil}.  This allows for more efficient entry points in the runtime
2069 to be used.  Currently, this option is only available in conjunction with
2070 the NeXT runtime on Mac OS X 10.3 and later.
2071
2072 @item -fobjc-call-cxx-cdtors
2073 @opindex fobjc-call-cxx-cdtors
2074 For each Objective-C class, check if any of its instance variables is a
2075 C++ object with a non-trivial default constructor.  If so, synthesize a
2076 special @code{- (id) .cxx_construct} instance method that will run
2077 non-trivial default constructors on any such instance variables, in order,
2078 and then return @code{self}.  Similarly, check if any instance variable
2079 is a C++ object with a non-trivial destructor, and if so, synthesize a
2080 special @code{- (void) .cxx_destruct} method that will run
2081 all such default destructors, in reverse order.
2082
2083 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2084 thusly generated will only operate on instance variables declared in the
2085 current Objective-C class, and not those inherited from superclasses.  It
2086 is the responsibility of the Objective-C runtime to invoke all such methods
2087 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2088 will be invoked by the runtime immediately after a new object
2089 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2090 be invoked immediately before the runtime deallocates an object instance.
2091
2092 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2093 support for invoking the @code{- (id) .cxx_construct} and
2094 @code{- (void) .cxx_destruct} methods.
2095
2096 @item -fobjc-direct-dispatch
2097 @opindex fobjc-direct-dispatch
2098 Allow fast jumps to the message dispatcher.  On Darwin this is
2099 accomplished via the comm page.
2100
2101 @item -fobjc-exceptions
2102 @opindex fobjc-exceptions
2103 Enable syntactic support for structured exception handling in Objective-C,
2104 similar to what is offered by C++ and Java.  This option is
2105 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2106 earlier.
2107
2108 @smallexample
2109   @@try @{
2110     @dots{}
2111        @@throw expr;
2112     @dots{}
2113   @}
2114   @@catch (AnObjCClass *exc) @{
2115     @dots{}
2116       @@throw expr;
2117     @dots{}
2118       @@throw;
2119     @dots{}
2120   @}
2121   @@catch (AnotherClass *exc) @{
2122     @dots{}
2123   @}
2124   @@catch (id allOthers) @{
2125     @dots{}
2126   @}
2127   @@finally @{
2128     @dots{}
2129       @@throw expr;
2130     @dots{}
2131   @}
2132 @end smallexample
2133
2134 The @code{@@throw} statement may appear anywhere in an Objective-C or
2135 Objective-C++ program; when used inside of a @code{@@catch} block, the
2136 @code{@@throw} may appear without an argument (as shown above), in which case
2137 the object caught by the @code{@@catch} will be rethrown.
2138
2139 Note that only (pointers to) Objective-C objects may be thrown and
2140 caught using this scheme.  When an object is thrown, it will be caught
2141 by the nearest @code{@@catch} clause capable of handling objects of that type,
2142 analogously to how @code{catch} blocks work in C++ and Java.  A
2143 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2144 any and all Objective-C exceptions not caught by previous @code{@@catch}
2145 clauses (if any).
2146
2147 The @code{@@finally} clause, if present, will be executed upon exit from the
2148 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2149 regardless of whether any exceptions are thrown, caught or rethrown
2150 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2151 of the @code{finally} clause in Java.
2152
2153 There are several caveats to using the new exception mechanism:
2154
2155 @itemize @bullet
2156 @item
2157 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2158 idioms provided by the @code{NSException} class, the new
2159 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2160 systems, due to additional functionality needed in the (NeXT) Objective-C
2161 runtime.
2162
2163 @item
2164 As mentioned above, the new exceptions do not support handling
2165 types other than Objective-C objects.   Furthermore, when used from
2166 Objective-C++, the Objective-C exception model does not interoperate with C++
2167 exceptions at this time.  This means you cannot @code{@@throw} an exception
2168 from Objective-C and @code{catch} it in C++, or vice versa
2169 (i.e., @code{throw @dots{} @@catch}).
2170 @end itemize
2171
2172 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2173 blocks for thread-safe execution:
2174
2175 @smallexample
2176   @@synchronized (ObjCClass *guard) @{
2177     @dots{}
2178   @}
2179 @end smallexample
2180
2181 Upon entering the @code{@@synchronized} block, a thread of execution shall
2182 first check whether a lock has been placed on the corresponding @code{guard}
2183 object by another thread.  If it has, the current thread shall wait until
2184 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2185 the current thread will place its own lock on it, execute the code contained in
2186 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2187 making @code{guard} available to other threads).
2188
2189 Unlike Java, Objective-C does not allow for entire methods to be marked
2190 @code{@@synchronized}.  Note that throwing exceptions out of
2191 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2192 to be unlocked properly.
2193
2194 @item -fobjc-gc
2195 @opindex fobjc-gc
2196 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2197
2198 @item -freplace-objc-classes
2199 @opindex freplace-objc-classes
2200 Emit a special marker instructing @command{ld(1)} not to statically link in
2201 the resulting object file, and allow @command{dyld(1)} to load it in at
2202 run time instead.  This is used in conjunction with the Fix-and-Continue
2203 debugging mode, where the object file in question may be recompiled and
2204 dynamically reloaded in the course of program execution, without the need
2205 to restart the program itself.  Currently, Fix-and-Continue functionality
2206 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2207 and later.
2208
2209 @item -fzero-link
2210 @opindex fzero-link
2211 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2212 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2213 compile time) with static class references that get initialized at load time,
2214 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2215 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2216 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2217 for individual class implementations to be modified during program execution.
2218
2219 @item -gen-decls
2220 @opindex gen-decls
2221 Dump interface declarations for all classes seen in the source file to a
2222 file named @file{@var{sourcename}.decl}.
2223
2224 @item -Wassign-intercept
2225 @opindex Wassign-intercept
2226 Warn whenever an Objective-C assignment is being intercepted by the
2227 garbage collector.
2228
2229 @item -Wno-protocol
2230 @opindex Wno-protocol
2231 If a class is declared to implement a protocol, a warning is issued for
2232 every method in the protocol that is not implemented by the class.  The
2233 default behavior is to issue a warning for every method not explicitly
2234 implemented in the class, even if a method implementation is inherited
2235 from the superclass.  If you use the @option{-Wno-protocol} option, then
2236 methods inherited from the superclass are considered to be implemented,
2237 and no warning is issued for them.
2238
2239 @item -Wselector
2240 @opindex Wselector
2241 Warn if multiple methods of different types for the same selector are
2242 found during compilation.  The check is performed on the list of methods
2243 in the final stage of compilation.  Additionally, a check is performed
2244 for each selector appearing in a @code{@@selector(@dots{})}
2245 expression, and a corresponding method for that selector has been found
2246 during compilation.  Because these checks scan the method table only at
2247 the end of compilation, these warnings are not produced if the final
2248 stage of compilation is not reached, for example because an error is
2249 found during compilation, or because the @option{-fsyntax-only} option is
2250 being used.
2251
2252 @item -Wstrict-selector-match
2253 @opindex Wstrict-selector-match
2254 Warn if multiple methods with differing argument and/or return types are
2255 found for a given selector when attempting to send a message using this
2256 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2257 is off (which is the default behavior), the compiler will omit such warnings
2258 if any differences found are confined to types which share the same size
2259 and alignment.
2260
2261 @item -Wundeclared-selector
2262 @opindex Wundeclared-selector
2263 Warn if a @code{@@selector(@dots{})} expression referring to an
2264 undeclared selector is found.  A selector is considered undeclared if no
2265 method with that name has been declared before the
2266 @code{@@selector(@dots{})} expression, either explicitly in an
2267 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2268 an @code{@@implementation} section.  This option always performs its
2269 checks as soon as a @code{@@selector(@dots{})} expression is found,
2270 while @option{-Wselector} only performs its checks in the final stage of
2271 compilation.  This also enforces the coding style convention
2272 that methods and selectors must be declared before being used.
2273
2274 @item -print-objc-runtime-info
2275 @opindex print-objc-runtime-info
2276 Generate C header describing the largest structure that is passed by
2277 value, if any.
2278
2279 @end table
2280
2281 @node Language Independent Options
2282 @section Options to Control Diagnostic Messages Formatting
2283 @cindex options to control diagnostics formatting
2284 @cindex diagnostic messages
2285 @cindex message formatting
2286
2287 Traditionally, diagnostic messages have been formatted irrespective of
2288 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2289 below can be used to control the diagnostic messages formatting
2290 algorithm, e.g.@: how many characters per line, how often source location
2291 information should be reported.  Right now, only the C++ front end can
2292 honor these options.  However it is expected, in the near future, that
2293 the remaining front ends would be able to digest them correctly.
2294
2295 @table @gcctabopt
2296 @item -fmessage-length=@var{n}
2297 @opindex fmessage-length
2298 Try to format error messages so that they fit on lines of about @var{n}
2299 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2300 the front ends supported by GCC@.  If @var{n} is zero, then no
2301 line-wrapping will be done; each error message will appear on a single
2302 line.
2303
2304 @opindex fdiagnostics-show-location
2305 @item -fdiagnostics-show-location=once
2306 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2307 reporter to emit @emph{once} source location information; that is, in
2308 case the message is too long to fit on a single physical line and has to
2309 be wrapped, the source location won't be emitted (as prefix) again,
2310 over and over, in subsequent continuation lines.  This is the default
2311 behavior.
2312
2313 @item -fdiagnostics-show-location=every-line
2314 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2315 messages reporter to emit the same source location information (as
2316 prefix) for physical lines that result from the process of breaking
2317 a message which is too long to fit on a single line.
2318
2319 @item -fdiagnostics-show-option
2320 @opindex fdiagnostics-show-option
2321 This option instructs the diagnostic machinery to add text to each
2322 diagnostic emitted, which indicates which command line option directly
2323 controls that diagnostic, when such an option is known to the
2324 diagnostic machinery.
2325
2326 @end table
2327
2328 @node Warning Options
2329 @section Options to Request or Suppress Warnings
2330 @cindex options to control warnings
2331 @cindex warning messages
2332 @cindex messages, warning
2333 @cindex suppressing warnings
2334
2335 Warnings are diagnostic messages that report constructions which
2336 are not inherently erroneous but which are risky or suggest there
2337 may have been an error.
2338
2339 You can request many specific warnings with options beginning @samp{-W},
2340 for example @option{-Wimplicit} to request warnings on implicit
2341 declarations.  Each of these specific warning options also has a
2342 negative form beginning @samp{-Wno-} to turn off warnings;
2343 for example, @option{-Wno-implicit}.  This manual lists only one of the
2344 two forms, whichever is not the default.
2345
2346 The following options control the amount and kinds of warnings produced
2347 by GCC; for further, language-specific options also refer to
2348 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2349 Options}.
2350
2351 @table @gcctabopt
2352 @cindex syntax checking
2353 @item -fsyntax-only
2354 @opindex fsyntax-only
2355 Check the code for syntax errors, but don't do anything beyond that.
2356
2357 @item -pedantic
2358 @opindex pedantic
2359 Issue all the warnings demanded by strict ISO C and ISO C++;
2360 reject all programs that use forbidden extensions, and some other
2361 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2362 version of the ISO C standard specified by any @option{-std} option used.
2363
2364 Valid ISO C and ISO C++ programs should compile properly with or without
2365 this option (though a rare few will require @option{-ansi} or a
2366 @option{-std} option specifying the required version of ISO C)@.  However,
2367 without this option, certain GNU extensions and traditional C and C++
2368 features are supported as well.  With this option, they are rejected.
2369
2370 @option{-pedantic} does not cause warning messages for use of the
2371 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2372 warnings are also disabled in the expression that follows
2373 @code{__extension__}.  However, only system header files should use
2374 these escape routes; application programs should avoid them.
2375 @xref{Alternate Keywords}.
2376
2377 Some users try to use @option{-pedantic} to check programs for strict ISO
2378 C conformance.  They soon find that it does not do quite what they want:
2379 it finds some non-ISO practices, but not all---only those for which
2380 ISO C @emph{requires} a diagnostic, and some others for which
2381 diagnostics have been added.
2382
2383 A feature to report any failure to conform to ISO C might be useful in
2384 some instances, but would require considerable additional work and would
2385 be quite different from @option{-pedantic}.  We don't have plans to
2386 support such a feature in the near future.
2387
2388 Where the standard specified with @option{-std} represents a GNU
2389 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2390 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2391 extended dialect is based.  Warnings from @option{-pedantic} are given
2392 where they are required by the base standard.  (It would not make sense
2393 for such warnings to be given only for features not in the specified GNU
2394 C dialect, since by definition the GNU dialects of C include all
2395 features the compiler supports with the given option, and there would be
2396 nothing to warn about.)
2397
2398 @item -pedantic-errors
2399 @opindex pedantic-errors
2400 Like @option{-pedantic}, except that errors are produced rather than
2401 warnings.
2402
2403 @item -w
2404 @opindex w
2405 Inhibit all warning messages.
2406
2407 @item -Wno-import
2408 @opindex Wno-import
2409 Inhibit warning messages about the use of @samp{#import}.
2410
2411 @c APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts **
2412 @item -Wnewline-eof
2413 @opindex Wnewline-eof
2414 Warn about files missing a newline at the end of the file.  (Apple compatible)
2415 @c APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts **
2416
2417 @item -Wchar-subscripts
2418 @opindex Wchar-subscripts
2419 Warn if an array subscript has type @code{char}.  This is a common cause
2420 of error, as programmers often forget that this type is signed on some
2421 machines.
2422 This warning is enabled by @option{-Wall}.
2423
2424 @item -Wcomment
2425 @opindex Wcomment
2426 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2427 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2428 This warning is enabled by @option{-Wall}.
2429
2430 @item -Wfatal-errors
2431 @opindex Wfatal-errors
2432 This option causes the compiler to abort compilation on the first error
2433 occurred rather than trying to keep going and printing further error
2434 messages.
2435
2436 @item -Wformat
2437 @opindex Wformat
2438 @opindex ffreestanding
2439 @opindex fno-builtin
2440 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2441 the arguments supplied have types appropriate to the format string
2442 specified, and that the conversions specified in the format string make
2443 sense.  This includes standard functions, and others specified by format
2444 attributes (@pxref{Function Attributes}), in the @code{printf},
2445 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2446 not in the C standard) families (or other target-specific families).
2447 Which functions are checked without format attributes having been
2448 specified depends on the standard version selected, and such checks of
2449 functions without the attribute specified are disabled by
2450 @option{-ffreestanding} or @option{-fno-builtin}.
2451
2452 The formats are checked against the format features supported by GNU
2453 libc version 2.2.  These include all ISO C90 and C99 features, as well
2454 as features from the Single Unix Specification and some BSD and GNU
2455 extensions.  Other library implementations may not support all these
2456 features; GCC does not support warning about features that go beyond a
2457 particular library's limitations.  However, if @option{-pedantic} is used
2458 with @option{-Wformat}, warnings will be given about format features not
2459 in the selected standard version (but not for @code{strfmon} formats,
2460 since those are not in any version of the C standard).  @xref{C Dialect
2461 Options,,Options Controlling C Dialect}.
2462
2463 Since @option{-Wformat} also checks for null format arguments for
2464 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2465
2466 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2467 aspects of format checking, the options @option{-Wformat-y2k},
2468 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2469 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2470 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2471
2472 @item -Wformat-y2k
2473 @opindex Wformat-y2k
2474 If @option{-Wformat} is specified, also warn about @code{strftime}
2475 formats which may yield only a two-digit year.
2476
2477 @item -Wno-format-extra-args
2478 @opindex Wno-format-extra-args
2479 If @option{-Wformat} is specified, do not warn about excess arguments to a
2480 @code{printf} or @code{scanf} format function.  The C standard specifies
2481 that such arguments are ignored.
2482
2483 Where the unused arguments lie between used arguments that are
2484 specified with @samp{$} operand number specifications, normally
2485 warnings are still given, since the implementation could not know what
2486 type to pass to @code{va_arg} to skip the unused arguments.  However,
2487 in the case of @code{scanf} formats, this option will suppress the
2488 warning if the unused arguments are all pointers, since the Single
2489 Unix Specification says that such unused arguments are allowed.
2490
2491 @item -Wno-format-zero-length
2492 @opindex Wno-format-zero-length
2493 If @option{-Wformat} is specified, do not warn about zero-length formats.
2494 The C standard specifies that zero-length formats are allowed.
2495
2496 @item -Wformat-nonliteral
2497 @opindex Wformat-nonliteral
2498 If @option{-Wformat} is specified, also warn if the format string is not a
2499 string literal and so cannot be checked, unless the format function
2500 takes its format arguments as a @code{va_list}.
2501
2502 @item -Wformat-security
2503 @opindex Wformat-security
2504 If @option{-Wformat} is specified, also warn about uses of format
2505 functions that represent possible security problems.  At present, this
2506 warns about calls to @code{printf} and @code{scanf} functions where the
2507 format string is not a string literal and there are no format arguments,
2508 as in @code{printf (foo);}.  This may be a security hole if the format
2509 string came from untrusted input and contains @samp{%n}.  (This is
2510 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2511 in future warnings may be added to @option{-Wformat-security} that are not
2512 included in @option{-Wformat-nonliteral}.)
2513
2514 @item -Wformat=2
2515 @opindex Wformat=2
2516 Enable @option{-Wformat} plus format checks not included in
2517 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2518 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2519
2520 @item -Wnonnull
2521 @opindex Wnonnull
2522 Warn about passing a null pointer for arguments marked as
2523 requiring a non-null value by the @code{nonnull} function attribute.
2524
2525 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2526 can be disabled with the @option{-Wno-nonnull} option.
2527
2528 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2529 @opindex Winit-self
2530 Warn about uninitialized variables which are initialized with themselves.
2531 Note this option can only be used with the @option{-Wuninitialized} option,
2532 which in turn only works with @option{-O1} and above.
2533
2534 For example, GCC will warn about @code{i} being uninitialized in the
2535 following snippet only when @option{-Winit-self} has been specified:
2536 @smallexample
2537 @group
2538 int f()
2539 @{
2540   int i = i;
2541   return i;
2542 @}
2543 @end group
2544 @end smallexample
2545
2546 @item -Wimplicit-int
2547 @opindex Wimplicit-int
2548 Warn when a declaration does not specify a type.
2549 This warning is enabled by @option{-Wall}.
2550
2551 @item -Wimplicit-function-declaration
2552 @itemx -Werror-implicit-function-declaration
2553 @opindex Wimplicit-function-declaration
2554 @opindex Werror-implicit-function-declaration
2555 Give a warning (or error) whenever a function is used before being
2556 declared.  The form @option{-Wno-error-implicit-function-declaration}
2557 is not supported.
2558 This warning is enabled by @option{-Wall} (as a warning, not an error).
2559
2560 @item -Wimplicit
2561 @opindex Wimplicit
2562 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2563 This warning is enabled by @option{-Wall}.
2564
2565 @item -Wmain
2566 @opindex Wmain
2567 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2568 function with external linkage, returning int, taking either zero
2569 arguments, two, or three arguments of appropriate types.
2570 This warning is enabled by @option{-Wall}.
2571
2572 @item -Wmissing-braces
2573 @opindex Wmissing-braces
2574 Warn if an aggregate or union initializer is not fully bracketed.  In
2575 the following example, the initializer for @samp{a} is not fully
2576 bracketed, but that for @samp{b} is fully bracketed.
2577
2578 @smallexample
2579 int a[2][2] = @{ 0, 1, 2, 3 @};
2580 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2581 @end smallexample
2582
2583 This warning is enabled by @option{-Wall}.
2584
2585 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2586 @opindex Wmissing-include-dirs
2587 Warn if a user-supplied include directory does not exist.
2588
2589 @item -Wparentheses
2590 @opindex Wparentheses
2591 Warn if parentheses are omitted in certain contexts, such
2592 as when there is an assignment in a context where a truth value
2593 is expected, or when operators are nested whose precedence people
2594 often get confused about.
2595
2596 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2597 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2598 interpretation from that of ordinary mathematical notation.
2599
2600 Also warn about constructions where there may be confusion to which
2601 @code{if} statement an @code{else} branch belongs.  Here is an example of
2602 such a case:
2603
2604 @smallexample
2605 @group
2606 @{
2607   if (a)
2608     if (b)
2609       foo ();
2610   else
2611     bar ();
2612 @}
2613 @end group
2614 @end smallexample
2615
2616 In C/C++, every @code{else} branch belongs to the innermost possible
2617 @code{if} statement, which in this example is @code{if (b)}.  This is
2618 often not what the programmer expected, as illustrated in the above
2619 example by indentation the programmer chose.  When there is the
2620 potential for this confusion, GCC will issue a warning when this flag
2621 is specified.  To eliminate the warning, add explicit braces around
2622 the innermost @code{if} statement so there is no way the @code{else}
2623 could belong to the enclosing @code{if}.  The resulting code would
2624 look like this:
2625
2626 @smallexample
2627 @group
2628 @{
2629   if (a)
2630     @{
2631       if (b)
2632         foo ();
2633       else
2634         bar ();
2635     @}
2636 @}
2637 @end group
2638 @end smallexample
2639
2640 This warning is enabled by @option{-Wall}.
2641
2642 @item -Wsequence-point
2643 @opindex Wsequence-point
2644 Warn about code that may have undefined semantics because of violations
2645 of sequence point rules in the C and C++ standards.
2646
2647 The C and C++ standards defines the order in which expressions in a C/C++
2648 program are evaluated in terms of @dfn{sequence points}, which represent
2649 a partial ordering between the execution of parts of the program: those
2650 executed before the sequence point, and those executed after it.  These
2651 occur after the evaluation of a full expression (one which is not part
2652 of a larger expression), after the evaluation of the first operand of a
2653 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2654 function is called (but after the evaluation of its arguments and the
2655 expression denoting the called function), and in certain other places.
2656 Other than as expressed by the sequence point rules, the order of
2657 evaluation of subexpressions of an expression is not specified.  All
2658 these rules describe only a partial order rather than a total order,
2659 since, for example, if two functions are called within one expression
2660 with no sequence point between them, the order in which the functions
2661 are called is not specified.  However, the standards committee have
2662 ruled that function calls do not overlap.
2663
2664 It is not specified when between sequence points modifications to the
2665 values of objects take effect.  Programs whose behavior depends on this
2666 have undefined behavior; the C and C++ standards specify that ``Between
2667 the previous and next sequence point an object shall have its stored
2668 value modified at most once by the evaluation of an expression.  
2669 Furthermore, the prior value shall be read only to determine the value
2670 to be stored.''.  If a program breaks these rules, the results on any
2671 particular implementation are entirely unpredictable.
2672
2673 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2674 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2675 diagnosed by this option, and it may give an occasional false positive
2676 result, but in general it has been found fairly effective at detecting
2677 this sort of problem in programs.
2678
2679 The standard is worded confusingly, therefore there is some debate
2680 over the precise meaning of the sequence point rules in subtle cases.
2681 Links to discussions of the problem, including proposed formal
2682 definitions, may be found on the GCC readings page, at
2683 @w{@uref{http://gcc.gnu.org/readings.html}}.
2684
2685 This warning is enabled by @option{-Wall} for C and C++.
2686
2687 @item -Wreturn-type
2688 @opindex Wreturn-type
2689 Warn whenever a function is defined with a return-type that defaults to
2690 @code{int}.  Also warn about any @code{return} statement with no
2691 return-value in a function whose return-type is not @code{void}.
2692
2693 For C, also warn if the return type of a function has a type qualifier
2694 such as @code{const}.  Such a type qualifier has no effect, since the
2695 value returned by a function is not an lvalue.  ISO C prohibits
2696 qualified @code{void} return types on function definitions, so such
2697 return types always receive a warning even without this option.
2698
2699 For C++, a function without return type always produces a diagnostic
2700 message, even when @option{-Wno-return-type} is specified.  The only
2701 exceptions are @samp{main} and functions defined in system headers.
2702
2703 This warning is enabled by @option{-Wall}.
2704
2705 @item -Wswitch
2706 @opindex Wswitch
2707 Warn whenever a @code{switch} statement has an index of enumerated type
2708 and lacks a @code{case} for one or more of the named codes of that
2709 enumeration.  (The presence of a @code{default} label prevents this
2710 warning.)  @code{case} labels outside the enumeration range also
2711 provoke warnings when this option is used.
2712 This warning is enabled by @option{-Wall}.
2713
2714 @item -Wswitch-default
2715 @opindex Wswitch-switch
2716 Warn whenever a @code{switch} statement does not have a @code{default}
2717 case.
2718
2719 @item -Wswitch-enum
2720 @opindex Wswitch-enum
2721 Warn whenever a @code{switch} statement has an index of enumerated type
2722 and lacks a @code{case} for one or more of the named codes of that
2723 enumeration.  @code{case} labels outside the enumeration range also
2724 provoke warnings when this option is used.
2725
2726 @item -Wtrigraphs
2727 @opindex Wtrigraphs
2728 Warn if any trigraphs are encountered that might change the meaning of
2729 the program (trigraphs within comments are not warned about).
2730 This warning is enabled by @option{-Wall}.
2731
2732 @item -Wunused-function
2733 @opindex Wunused-function
2734 Warn whenever a static function is declared but not defined or a
2735 non-inline static function is unused.
2736 This warning is enabled by @option{-Wall}.
2737
2738 @item -Wunused-label
2739 @opindex Wunused-label
2740 Warn whenever a label is declared but not used.
2741 This warning is enabled by @option{-Wall}.
2742
2743 To suppress this warning use the @samp{unused} attribute
2744 (@pxref{Variable Attributes}).
2745
2746 @item -Wunused-parameter
2747 @opindex Wunused-parameter
2748 Warn whenever a function parameter is unused aside from its declaration.
2749
2750 To suppress this warning use the @samp{unused} attribute
2751 (@pxref{Variable Attributes}).
2752
2753 @item -Wunused-variable
2754 @opindex Wunused-variable
2755 Warn whenever a local variable or non-constant static variable is unused
2756 aside from its declaration.
2757 This warning is enabled by @option{-Wall}.
2758
2759 To suppress this warning use the @samp{unused} attribute
2760 (@pxref{Variable Attributes}).
2761
2762 @item -Wunused-value
2763 @opindex Wunused-value
2764 Warn whenever a statement computes a result that is explicitly not used.
2765 This warning is enabled by @option{-Wall}.
2766
2767 To suppress this warning cast the expression to @samp{void}.
2768
2769 @item -Wunused
2770 @opindex Wunused
2771 All the above @option{-Wunused} options combined.
2772
2773 In order to get a warning about an unused function parameter, you must
2774 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2775 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2776
2777 @item -Wuninitialized
2778 @opindex Wuninitialized
2779 Warn if an automatic variable is used without first being initialized or
2780 if a variable may be clobbered by a @code{setjmp} call.
2781
2782 These warnings are possible only in optimizing compilation,
2783 because they require data flow information that is computed only
2784 when optimizing.  If you do not specify @option{-O}, you will not get 
2785 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2786 requiring @option{-O}.
2787
2788 If you want to warn about code which uses the uninitialized value of the
2789 variable in its own initializer, use the @option{-Winit-self} option.
2790
2791 These warnings occur for individual uninitialized or clobbered
2792 elements of structure, union or array variables as well as for
2793 variables which are uninitialized or clobbered as a whole.  They do
2794 not occur for variables or elements declared @code{volatile}.  Because
2795 these warnings depend on optimization, the exact variables or elements
2796 for which there are warnings will depend on the precise optimization
2797 options and version of GCC used.
2798
2799 Note that there may be no warning about a variable that is used only
2800 to compute a value that itself is never used, because such
2801 computations may be deleted by data flow analysis before the warnings
2802 are printed.
2803
2804 These warnings are made optional because GCC is not smart
2805 enough to see all the reasons why the code might be correct
2806 despite appearing to have an error.  Here is one example of how
2807 this can happen:
2808
2809 @smallexample
2810 @group
2811 @{
2812   int x;
2813   switch (y)
2814     @{
2815     case 1: x = 1;
2816       break;
2817     case 2: x = 4;
2818       break;
2819     case 3: x = 5;
2820     @}
2821   foo (x);
2822 @}
2823 @end group
2824 @end smallexample
2825
2826 @noindent
2827 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2828 always initialized, but GCC doesn't know this.  Here is
2829 another common case:
2830
2831 @smallexample
2832 @{
2833   int save_y;
2834   if (change_y) save_y = y, y = new_y;
2835   @dots{}
2836   if (change_y) y = save_y;
2837 @}
2838 @end smallexample
2839
2840 @noindent
2841 This has no bug because @code{save_y} is used only if it is set.
2842
2843 @cindex @code{longjmp} warnings
2844 This option also warns when a non-volatile automatic variable might be
2845 changed by a call to @code{longjmp}.  These warnings as well are possible
2846 only in optimizing compilation.
2847
2848 The compiler sees only the calls to @code{setjmp}.  It cannot know
2849 where @code{longjmp} will be called; in fact, a signal handler could
2850 call it at any point in the code.  As a result, you may get a warning
2851 even when there is in fact no problem because @code{longjmp} cannot
2852 in fact be called at the place which would cause a problem.
2853
2854 Some spurious warnings can be avoided if you declare all the functions
2855 you use that never return as @code{noreturn}.  @xref{Function
2856 Attributes}.
2857
2858 This warning is enabled by @option{-Wall}.
2859
2860 @item -Wunknown-pragmas
2861 @opindex Wunknown-pragmas
2862 @cindex warning for unknown pragmas
2863 @cindex unknown pragmas, warning
2864 @cindex pragmas, warning of unknown
2865 Warn when a #pragma directive is encountered which is not understood by
2866 GCC@.  If this command line option is used, warnings will even be issued
2867 for unknown pragmas in system header files.  This is not the case if
2868 the warnings were only enabled by the @option{-Wall} command line option.
2869
2870 @item -Wno-pragmas
2871 @opindex Wno-pragmas
2872 @opindex Wpragmas
2873 Do not warn about misuses of pragmas, such as incorrect parameters,
2874 invalid syntax, or conflicts between pragmas.  See also
2875 @samp{-Wunknown-pragmas}.
2876
2877 @item -Wstrict-aliasing
2878 @opindex Wstrict-aliasing
2879 This option is only active when @option{-fstrict-aliasing} is active.
2880 It warns about code which might break the strict aliasing rules that the
2881 compiler is using for optimization.  The warning does not catch all
2882 cases, but does attempt to catch the more common pitfalls.  It is
2883 included in @option{-Wall}.
2884 It is equivalent to -Wstrict-aliasing=3
2885
2886 @item -Wstrict-aliasing=n
2887 @opindex Wstrict-aliasing=n
2888 This option is only active when @option{-fstrict-aliasing} is active.
2889 It warns about code which might break the strict aliasing rules that the
2890 compiler is using for optimization.
2891 Higher levels correspond to higher accuracy (fewer false positives).
2892 Higher levels also correspond to more effort, similar to the way -O works.
2893 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
2894 with n=3.
2895
2896 Level 1: Most aggressive, quick, least accurate.
2897 Possibly useful when higher levels
2898 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
2899 false negatives.  However, it has many false positives.
2900 Warns for all pointer conversions between possibly incompatible types, 
2901 even if never dereferenced.  Runs in the frontend only.
2902
2903 Level 2: Aggressive, quick, not too precise.
2904 May still have many false positives (not as many as level 1 though),
2905 and few false negatives (but possibly more than level 1).
2906 Unlike level 1, it only warns when an address is taken.  Warns about
2907 incomplete types.  Runs in the frontend only.
2908
2909 Level 3 (default for @option{-Wstrict-aliasing}): 
2910 Should have very few false positives and few false 
2911 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
2912 Takes care of the common punn+dereference pattern in the frontend:
2913 @code{*(int*)&some_float}.
2914 If optimization is enabled, it also runs in the backend, where it deals 
2915 with multiple statement cases using flow-sensitive points-to information.
2916 Only warns when the converted pointer is dereferenced.
2917 Does not warn about incomplete types.
2918
2919 @item -Wstrict-overflow
2920 @item -Wstrict-overflow=@var{n}
2921 @opindex Wstrict-overflow
2922 This option is only active when @option{-fstrict-overflow} is active.
2923 It warns about cases where the compiler optimizes based on the
2924 assumption that signed overflow does not occur.  Note that it does not
2925 warn about all cases where the code might overflow: it only warns
2926 about cases where the compiler implements some optimization.  Thus
2927 this warning depends on the optimization level.
2928
2929 An optimization which assumes that signed overflow does not occur is
2930 perfectly safe if the values of the variables involved are such that
2931 overflow never does, in fact, occur.  Therefore this warning can
2932 easily give a false positive: a warning about code which is not
2933 actually a problem.  To help focus on important issues, several
2934 warning levels are defined.  No warnings are issued for the use of
2935 undefined signed overflow when estimating how many iterations a loop
2936 will require, in particular when determining whether a loop will be
2937 executed at all.
2938
2939 @table @option
2940 @item -Wstrict-overflow=1
2941 Warn about cases which are both questionable and easy to avoid.  For
2942 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
2943 compiler will simplify this to @code{1}.  This level of
2944 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
2945 are not, and must be explicitly requested.
2946
2947 @item -Wstrict-overflow=2
2948 Also warn about other cases where a comparison is simplified to a
2949 constant.  For example: @code{abs (x) >= 0}.  This can only be
2950 simplified when @option{-fstrict-overflow} is in effect, because
2951 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
2952 zero.  @option{-Wstrict-overflow} (with no level) is the same as
2953 @option{-Wstrict-overflow=2}.
2954
2955 @item -Wstrict-overflow=3
2956 Also warn about other cases where a comparison is simplified.  For
2957 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
2958
2959 @item -Wstrict-overflow=4
2960 Also warn about other simplifications not covered by the above cases.
2961 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
2962
2963 @item -Wstrict-overflow=5
2964 Also warn about cases where the compiler reduces the magnitude of a
2965 constant involved in a comparison.  For example: @code{x + 2 > y} will
2966 be simplified to @code{x + 1 >= y}.  This is reported only at the
2967 highest warning level because this simplification applies to many
2968 comparisons, so this warning level will give a very large number of
2969 false positives.
2970 @end table
2971
2972 @item -Wall
2973 @opindex Wall
2974 All of the above @samp{-W} options combined.  This enables all the
2975 warnings about constructions that some users consider questionable, and
2976 that are easy to avoid (or modify to prevent the warning), even in
2977 conjunction with macros.  This also enables some language-specific
2978 warnings described in @ref{C++ Dialect Options} and
2979 @ref{Objective-C and Objective-C++ Dialect Options}.
2980 @c APPLE LOCAL begin -Wmost
2981 @item -Wmost
2982 @opindex Wmost
2983 This is equivalent to -Wall -Wno-parentheses.  (Apple compatible)
2984 @end table
2985 @c APPLE LOCAL end -Wmost
2986
2987 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
2988 Some of them warn about constructions that users generally do not
2989 consider questionable, but which occasionally you might wish to check
2990 for; others warn about constructions that are necessary or hard to avoid
2991 in some cases, and there is no simple way to modify the code to suppress
2992 the warning.
2993
2994 @table @gcctabopt
2995 @item -Wextra
2996 @opindex W
2997 @opindex Wextra
2998 (This option used to be called @option{-W}.  The older name is still
2999 supported, but the newer name is more descriptive.)  Print extra warning
3000 messages for these events:
3001
3002 @itemize @bullet
3003 @item
3004 A function can return either with or without a value.  (Falling
3005 off the end of the function body is considered returning without
3006 a value.)  For example, this function would evoke such a
3007 warning:
3008
3009 @smallexample
3010 @group
3011 foo (a)
3012 @{
3013   if (a > 0)
3014     return a;
3015 @}
3016 @end group
3017 @end smallexample
3018
3019 @item
3020 An expression-statement or the left-hand side of a comma expression
3021 contains no side effects.
3022 To suppress the warning, cast the unused expression to void.
3023 For example, an expression such as @samp{x[i,j]} will cause a warning,
3024 but @samp{x[(void)i,j]} will not.
3025
3026 @item
3027 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
3028
3029 @item
3030 Storage-class specifiers like @code{static} are not the first things in
3031 a declaration.  According to the C Standard, this usage is obsolescent.
3032
3033 @item
3034 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
3035 arguments.
3036
3037 @item
3038 A comparison between signed and unsigned values could produce an
3039 incorrect result when the signed value is converted to unsigned.
3040 (But don't warn if @option{-Wno-sign-compare} is also specified.)
3041
3042 @item
3043 An aggregate has an initializer which does not initialize all members.
3044 This warning can be independently controlled by
3045 @option{-Wmissing-field-initializers}.
3046
3047 @item
3048 An initialized field without side effects is overridden when using
3049 designated initializers (@pxref{Designated Inits, , Designated
3050 Initializers}).  This warning can be independently controlled by
3051 @option{-Woverride-init}.
3052
3053 @item
3054 A function parameter is declared without a type specifier in K&R-style
3055 functions:
3056
3057 @smallexample
3058 void foo(bar) @{ @}
3059 @end smallexample
3060
3061 @item
3062 An empty body occurs in an @samp{if} or @samp{else} statement.
3063
3064 @item
3065 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3066 @samp{>}, or @samp{>=}.
3067
3068 @item
3069 A variable might be changed by @samp{longjmp} or @samp{vfork}.
3070
3071 @item @r{(C++ only)}
3072 An enumerator and a non-enumerator both appear in a conditional expression.
3073
3074 @item @r{(C++ only)}
3075 A non-static reference or non-static @samp{const} member appears in a
3076 class without constructors.
3077
3078 @item @r{(C++ only)}
3079 Ambiguous virtual bases.
3080
3081 @item @r{(C++ only)}
3082 Subscripting an array which has been declared @samp{register}.
3083
3084 @item @r{(C++ only)}
3085 Taking the address of a variable which has been declared @samp{register}.
3086
3087 @item @r{(C++ only)}
3088 A base class is not initialized in a derived class' copy constructor.
3089 @end itemize
3090
3091 @item -Wno-div-by-zero
3092 @opindex Wno-div-by-zero
3093 @opindex Wdiv-by-zero
3094 Do not warn about compile-time integer division by zero.  Floating point
3095 division by zero is not warned about, as it can be a legitimate way of
3096 obtaining infinities and NaNs.
3097
3098 @item -Wsystem-headers
3099 @opindex Wsystem-headers
3100 @cindex warnings from system headers
3101 @cindex system headers, warnings from
3102 Print warning messages for constructs found in system header files.
3103 Warnings from system headers are normally suppressed, on the assumption
3104 that they usually do not indicate real problems and would only make the
3105 compiler output harder to read.  Using this command line option tells
3106 GCC to emit warnings from system headers as if they occurred in user
3107 code.  However, note that using @option{-Wall} in conjunction with this
3108 option will @emph{not} warn about unknown pragmas in system
3109 headers---for that, @option{-Wunknown-pragmas} must also be used.
3110
3111 @item -Wfloat-equal
3112 @opindex Wfloat-equal
3113 Warn if floating point values are used in equality comparisons.
3114
3115 The idea behind this is that sometimes it is convenient (for the
3116 programmer) to consider floating-point values as approximations to
3117 infinitely precise real numbers.  If you are doing this, then you need
3118 to compute (by analyzing the code, or in some other way) the maximum or
3119 likely maximum error that the computation introduces, and allow for it
3120 when performing comparisons (and when producing output, but that's a
3121 different problem).  In particular, instead of testing for equality, you
3122 would check to see whether the two values have ranges that overlap; and
3123 this is done with the relational operators, so equality comparisons are
3124 probably mistaken.
3125
3126 @item -Wtraditional @r{(C only)}
3127 @opindex Wtraditional
3128 Warn about certain constructs that behave differently in traditional and
3129 ISO C@.  Also warn about ISO C constructs that have no traditional C
3130 equivalent, and/or problematic constructs which should be avoided.
3131
3132 @itemize @bullet
3133 @item
3134 Macro parameters that appear within string literals in the macro body.
3135 In traditional C macro replacement takes place within string literals,
3136 but does not in ISO C@.
3137
3138 @item
3139 In traditional C, some preprocessor directives did not exist.
3140 Traditional preprocessors would only consider a line to be a directive
3141 if the @samp{#} appeared in column 1 on the line.  Therefore
3142 @option{-Wtraditional} warns about directives that traditional C
3143 understands but would ignore because the @samp{#} does not appear as the
3144 first character on the line.  It also suggests you hide directives like
3145 @samp{#pragma} not understood by traditional C by indenting them.  Some
3146 traditional implementations would not recognize @samp{#elif}, so it
3147 suggests avoiding it altogether.
3148
3149 @item
3150 A function-like macro that appears without arguments.
3151
3152 @item
3153 The unary plus operator.
3154
3155 @item
3156 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3157 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3158 constants.)  Note, these suffixes appear in macros defined in the system
3159 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3160 Use of these macros in user code might normally lead to spurious
3161 warnings, however GCC's integrated preprocessor has enough context to
3162 avoid warning in these cases.
3163
3164 @item
3165 A function declared external in one block and then used after the end of
3166 the block.
3167
3168 @item
3169 A @code{switch} statement has an operand of type @code{long}.
3170
3171 @item
3172 A non-@code{static} function declaration follows a @code{static} one.
3173 This construct is not accepted by some traditional C compilers.
3174
3175 @item
3176 The ISO type of an integer constant has a different width or
3177 signedness from its traditional type.  This warning is only issued if
3178 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3179 typically represent bit patterns, are not warned about.
3180
3181 @item
3182 Usage of ISO string concatenation is detected.
3183
3184 @item
3185 Initialization of automatic aggregates.
3186
3187 @item
3188 Identifier conflicts with labels.  Traditional C lacks a separate
3189 namespace for labels.
3190
3191 @item
3192 Initialization of unions.  If the initializer is zero, the warning is
3193 omitted.  This is done under the assumption that the zero initializer in
3194 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3195 initializer warnings and relies on default initialization to zero in the
3196 traditional C case.
3197
3198 @item
3199 Conversions by prototypes between fixed/floating point values and vice
3200 versa.  The absence of these prototypes when compiling with traditional
3201 C would cause serious problems.  This is a subset of the possible
3202 conversion warnings, for the full set use @option{-Wconversion}.
3203
3204 @item
3205 Use of ISO C style function definitions.  This warning intentionally is
3206 @emph{not} issued for prototype declarations or variadic functions
3207 because these ISO C features will appear in your code when using
3208 libiberty's traditional C compatibility macros, @code{PARAMS} and
3209 @code{VPARAMS}.  This warning is also bypassed for nested functions
3210 because that feature is already a GCC extension and thus not relevant to
3211 traditional C compatibility.
3212 @end itemize
3213
3214 @item -Wdeclaration-after-statement @r{(C only)}
3215 @opindex Wdeclaration-after-statement
3216 Warn when a declaration is found after a statement in a block.  This
3217 construct, known from C++, was introduced with ISO C99 and is by default
3218 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3219 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3220
3221 @item -Wundef
3222 @opindex Wundef
3223 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3224
3225 @item -Wno-endif-labels
3226 @opindex Wno-endif-labels
3227 @opindex Wendif-labels
3228 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3229
3230 @item -Wshadow
3231 @opindex Wshadow
3232 Warn whenever a local variable shadows another local variable, parameter or
3233 global variable or whenever a built-in function is shadowed.
3234
3235 @item -Wlarger-than-@var{len}
3236 @opindex Wlarger-than
3237 Warn whenever an object of larger than @var{len} bytes is defined.
3238
3239 @item -Wframe-larger-than-@var{len}
3240 @opindex Wframe-larger-than
3241 Warn whenever the frame size of a function is larger than @var{len} bytes.
3242
3243 @item -Wunsafe-loop-optimizations
3244 @opindex Wunsafe-loop-optimizations
3245 Warn if the loop cannot be optimized because the compiler could not
3246 assume anything on the bounds of the loop indices.  With
3247 @option{-funsafe-loop-optimizations} warn if the compiler made
3248 such assumptions.
3249
3250 @item -Wpointer-arith
3251 @opindex Wpointer-arith
3252 Warn about anything that depends on the ``size of'' a function type or
3253 of @code{void}.  GNU C assigns these types a size of 1, for
3254 convenience in calculations with @code{void *} pointers and pointers
3255 to functions.
3256
3257 @item -Wbad-function-cast @r{(C only)}
3258 @opindex Wbad-function-cast
3259 Warn whenever a function call is cast to a non-matching type.
3260 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3261
3262 @item -Wc++-compat
3263 Warn about ISO C constructs that are outside of the common subset of
3264 ISO C and ISO C++, e.g.@: request for implicit conversion from
3265 @code{void *} to a pointer to non-@code{void} type.
3266
3267 @item -Wcast-qual
3268 @opindex Wcast-qual
3269 Warn whenever a pointer is cast so as to remove a type qualifier from
3270 the target type.  For example, warn if a @code{const char *} is cast
3271 to an ordinary @code{char *}.
3272
3273 @item -Wcast-align
3274 @opindex Wcast-align
3275 Warn whenever a pointer is cast such that the required alignment of the
3276 target is increased.  For example, warn if a @code{char *} is cast to
3277 an @code{int *} on machines where integers can only be accessed at
3278 two- or four-byte boundaries.
3279
3280 @item -Wwrite-strings
3281 @opindex Wwrite-strings
3282 When compiling C, give string constants the type @code{const
3283 char[@var{length}]} so that
3284 copying the address of one into a non-@code{const} @code{char *}
3285 pointer will get a warning; when compiling C++, warn about the
3286 deprecated conversion from string literals to @code{char *}.  This
3287 warning, by default, is enabled for C++ programs.
3288 These warnings will help you find at
3289 compile time code that can try to write into a string constant, but
3290 only if you have been very careful about using @code{const} in
3291 declarations and prototypes.  Otherwise, it will just be a nuisance;
3292 this is why we did not make @option{-Wall} request these warnings.
3293
3294 @item -Wconversion
3295 @opindex Wconversion
3296 Warn if a prototype causes a type conversion that is different from what
3297 would happen to the same argument in the absence of a prototype.  This
3298 includes conversions of fixed point to floating and vice versa, and
3299 conversions changing the width or signedness of a fixed point argument
3300 except when the same as the default promotion.
3301
3302 Also, warn if a negative integer constant expression is implicitly
3303 converted to an unsigned type.  For example, warn about the assignment
3304 @code{x = -1} if @code{x} is unsigned.  But do not warn about explicit
3305 casts like @code{(unsigned) -1}.
3306
3307 @item -Wsign-compare
3308 @opindex Wsign-compare
3309 @cindex warning for comparison of signed and unsigned values
3310 @cindex comparison of signed and unsigned values, warning
3311 @cindex signed and unsigned values, comparison warning
3312 Warn when a comparison between signed and unsigned values could produce
3313 an incorrect result when the signed value is converted to unsigned.
3314 This warning is also enabled by @option{-Wextra}; to get the other warnings
3315 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3316
3317 @item -Waddress
3318 @opindex Waddress
3319 @opindex Wno-address
3320 Warn about suspicious uses of memory addresses. These include using
3321 the address of a function in a conditional expression, such as
3322 @code{void func(void); if (func)}, and comparisons against the memory
3323 address of a string literal, such as @code{if (x == "abc")}.  Such
3324 uses typically indicate a programmer error: the address of a function
3325 always evaluates to true, so their use in a conditional usually
3326 indicate that the programmer forgot the parentheses in a function
3327 call; and comparisons against string literals result in unspecified
3328 behavior and are not portable in C, so they usually indicate that the
3329 programmer intended to use @code{strcmp}.  This warning is enabled by
3330 @option{-Wall}.
3331
3332 @item -Waggregate-return
3333 @opindex Waggregate-return
3334 Warn if any functions that return structures or unions are defined or
3335 called.  (In languages where you can return an array, this also elicits
3336 a warning.)
3337
3338 @item -Wno-attributes
3339 @opindex Wno-attributes
3340 @opindex Wattributes
3341 Do not warn if an unexpected @code{__attribute__} is used, such as
3342 unrecognized attributes, function attributes applied to variables,
3343 etc.  This will not stop errors for incorrect use of supported
3344 attributes.
3345
3346 @item -Wstrict-prototypes @r{(C only)}
3347 @opindex Wstrict-prototypes
3348 Warn if a function is declared or defined without specifying the
3349 argument types.  (An old-style function definition is permitted without
3350 a warning if preceded by a declaration which specifies the argument
3351 types.)
3352
3353 @item -Wold-style-definition @r{(C only)}
3354 @opindex Wold-style-definition
3355 Warn if an old-style function definition is used.  A warning is given
3356 even if there is a previous prototype.
3357
3358 @item -Wmissing-prototypes @r{(C only)}
3359 @opindex Wmissing-prototypes
3360 Warn if a global function is defined without a previous prototype
3361 declaration.  This warning is issued even if the definition itself
3362 provides a prototype.  The aim is to detect global functions that fail
3363 to be declared in header files.
3364
3365 @item -Wmissing-declarations @r{(C only)}
3366 @opindex Wmissing-declarations
3367 Warn if a global function is defined without a previous declaration.
3368 Do so even if the definition itself provides a prototype.
3369 Use this option to detect global functions that are not declared in
3370 header files.
3371
3372 @item -Wmissing-field-initializers
3373 @opindex Wmissing-field-initializers
3374 @opindex W
3375 @opindex Wextra
3376 Warn if a structure's initializer has some fields missing.  For
3377 example, the following code would cause such a warning, because
3378 @code{x.h} is implicitly zero:
3379
3380 @smallexample
3381 struct s @{ int f, g, h; @};
3382 struct s x = @{ 3, 4 @};
3383 @end smallexample
3384
3385 This option does not warn about designated initializers, so the following
3386 modification would not trigger a warning:
3387
3388 @smallexample
3389 struct s @{ int f, g, h; @};
3390 struct s x = @{ .f = 3, .g = 4 @};
3391 @end smallexample
3392
3393 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3394 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3395
3396 @item -Wmissing-noreturn
3397 @opindex Wmissing-noreturn
3398 Warn about functions which might be candidates for attribute @code{noreturn}.
3399 Note these are only possible candidates, not absolute ones.  Care should
3400 be taken to manually verify functions actually do not ever return before
3401 adding the @code{noreturn} attribute, otherwise subtle code generation
3402 bugs could be introduced.  You will not get a warning for @code{main} in
3403 hosted C environments.
3404
3405 @item -Wmissing-format-attribute
3406 @opindex Wmissing-format-attribute
3407 @opindex Wformat
3408 Warn about function pointers which might be candidates for @code{format}
3409 attributes.  Note these are only possible candidates, not absolute ones.
3410 GCC will guess that function pointers with @code{format} attributes that
3411 are used in assignment, initialization, parameter passing or return
3412 statements should have a corresponding @code{format} attribute in the
3413 resulting type.  I.e.@: the left-hand side of the assignment or
3414 initialization, the type of the parameter variable, or the return type
3415 of the containing function respectively should also have a @code{format}
3416 attribute to avoid the warning.
3417
3418 GCC will also warn about function definitions which might be
3419 candidates for @code{format} attributes.  Again, these are only
3420 possible candidates.  GCC will guess that @code{format} attributes
3421 might be appropriate for any function that calls a function like
3422 @code{vprintf} or @code{vscanf}, but this might not always be the
3423 case, and some functions for which @code{format} attributes are
3424 appropriate may not be detected.
3425
3426 @item -Wno-multichar
3427 @opindex Wno-multichar
3428 @opindex Wmultichar
3429 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3430 Usually they indicate a typo in the user's code, as they have
3431 implementation-defined values, and should not be used in portable code.
3432
3433 @item -Wnormalized=<none|id|nfc|nfkc>
3434 @opindex Wnormalized
3435 @cindex NFC
3436 @cindex NFKC
3437 @cindex character set, input normalization
3438 In ISO C and ISO C++, two identifiers are different if they are
3439 different sequences of characters.  However, sometimes when characters
3440 outside the basic ASCII character set are used, you can have two
3441 different character sequences that look the same.  To avoid confusion,
3442 the ISO 10646 standard sets out some @dfn{normalization rules} which
3443 when applied ensure that two sequences that look the same are turned into
3444 the same sequence.  GCC can warn you if you are using identifiers which
3445 have not been normalized; this option controls that warning.
3446
3447 There are four levels of warning that GCC supports.  The default is
3448 @option{-Wnormalized=nfc}, which warns about any identifier which is
3449 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3450 recommended form for most uses.
3451
3452 Unfortunately, there are some characters which ISO C and ISO C++ allow
3453 in identifiers that when turned into NFC aren't allowable as
3454 identifiers.  That is, there's no way to use these symbols in portable
3455 ISO C or C++ and have all your identifiers in NFC.
3456 @option{-Wnormalized=id} suppresses the warning for these characters.
3457 It is hoped that future versions of the standards involved will correct
3458 this, which is why this option is not the default.
3459
3460 You can switch the warning off for all characters by writing
3461 @option{-Wnormalized=none}.  You would only want to do this if you
3462 were using some other normalization scheme (like ``D''), because
3463 otherwise you can easily create bugs that are literally impossible to see.
3464
3465 Some characters in ISO 10646 have distinct meanings but look identical
3466 in some fonts or display methodologies, especially once formatting has
3467 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3468 LETTER N'', will display just like a regular @code{n} which has been
3469 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3470 normalization scheme to convert all these into a standard form as
3471 well, and GCC will warn if your code is not in NFKC if you use
3472 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3473 about every identifier that contains the letter O because it might be
3474 confused with the digit 0, and so is not the default, but may be
3475 useful as a local coding convention if the programming environment is
3476 unable to be fixed to display these characters distinctly.
3477
3478 @item -Wno-deprecated-declarations
3479 @opindex Wno-deprecated-declarations
3480 Do not warn about uses of functions (@pxref{Function Attributes}),
3481 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3482 Attributes}) marked as deprecated by using the @code{deprecated}
3483 attribute.
3484
3485 @item -Wno-overflow
3486 @opindex Wno-overflow
3487 Do not warn about compile-time overflow in constant expressions.
3488
3489 @item -Woverride-init
3490 @opindex Woverride-init
3491 @opindex W
3492 @opindex Wextra
3493 Warn if an initialized field without side effects is overridden when
3494 using designated initializers (@pxref{Designated Inits, , Designated
3495 Initializers}).
3496
3497 This warning is included in @option{-Wextra}.  To get other
3498 @option{-Wextra} warnings without this one, use @samp{-Wextra
3499 -Wno-override-init}.
3500
3501 @item -Wpacked
3502 @opindex Wpacked
3503 Warn if a structure is given the packed attribute, but the packed
3504 attribute has no effect on the layout or size of the structure.
3505 Such structures may be mis-aligned for little benefit.  For
3506 instance, in this code, the variable @code{f.x} in @code{struct bar}
3507 will be misaligned even though @code{struct bar} does not itself
3508 have the packed attribute:
3509
3510 @smallexample
3511 @group
3512 struct foo @{
3513   int x;
3514   char a, b, c, d;
3515 @} __attribute__((packed));
3516 struct bar @{
3517   char z;
3518   struct foo f;
3519 @};
3520 @end group
3521 @end smallexample
3522
3523 @item -Wpadded
3524 @opindex Wpadded
3525 Warn if padding is included in a structure, either to align an element
3526 of the structure or to align the whole structure.  Sometimes when this
3527 happens it is possible to rearrange the fields of the structure to
3528 reduce the padding and so make the structure smaller.
3529
3530 @item -Wredundant-decls
3531 @opindex Wredundant-decls
3532 Warn if anything is declared more than once in the same scope, even in
3533 cases where multiple declaration is valid and changes nothing.
3534
3535 @item -Wnested-externs @r{(C only)}
3536 @opindex Wnested-externs
3537 Warn if an @code{extern} declaration is encountered within a function.
3538
3539 @item -Wunreachable-code
3540 @opindex Wunreachable-code
3541 Warn if the compiler detects that code will never be executed.
3542
3543 This option is intended to warn when the compiler detects that at
3544 least a whole line of source code will never be executed, because
3545 some condition is never satisfied or because it is after a
3546 procedure that never returns.
3547
3548 It is possible for this option to produce a warning even though there
3549 are circumstances under which part of the affected line can be executed,
3550 so care should be taken when removing apparently-unreachable code.
3551
3552 For instance, when a function is inlined, a warning may mean that the
3553 line is unreachable in only one inlined copy of the function.
3554
3555 This option is not made part of @option{-Wall} because in a debugging
3556 version of a program there is often substantial code which checks
3557 correct functioning of the program and is, hopefully, unreachable
3558 because the program does work.  Another common use of unreachable
3559 code is to provide behavior which is selectable at compile-time.
3560
3561 @item -Winline
3562 @opindex Winline
3563 Warn if a function can not be inlined and it was declared as inline.
3564 Even with this option, the compiler will not warn about failures to
3565 inline functions declared in system headers.
3566
3567 The compiler uses a variety of heuristics to determine whether or not
3568 to inline a function.  For example, the compiler takes into account
3569 the size of the function being inlined and the amount of inlining
3570 that has already been done in the current function.  Therefore,
3571 seemingly insignificant changes in the source program can cause the
3572 warnings produced by @option{-Winline} to appear or disappear.
3573
3574 @item -Wno-invalid-offsetof @r{(C++ only)}
3575 @opindex Wno-invalid-offsetof
3576 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3577 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3578 to a non-POD type is undefined.  In existing C++ implementations,
3579 however, @samp{offsetof} typically gives meaningful results even when
3580 applied to certain kinds of non-POD types. (Such as a simple
3581 @samp{struct} that fails to be a POD type only by virtue of having a
3582 constructor.)  This flag is for users who are aware that they are
3583 writing nonportable code and who have deliberately chosen to ignore the
3584 warning about it.
3585
3586 The restrictions on @samp{offsetof} may be relaxed in a future version
3587 of the C++ standard.
3588
3589 @item -Wno-int-to-pointer-cast @r{(C only)}
3590 @opindex Wno-int-to-pointer-cast
3591 Suppress warnings from casts to pointer type of an integer of a
3592 different size.
3593
3594 @item -Wno-pointer-to-int-cast @r{(C only)}
3595 @opindex Wno-pointer-to-int-cast
3596 Suppress warnings from casts from a pointer to an integer type of a
3597 different size.
3598
3599 @item -Winvalid-pch
3600 @opindex Winvalid-pch
3601 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3602 the search path but can't be used.
3603
3604 @item -Wlong-long
3605 @opindex Wlong-long
3606 @opindex Wno-long-long
3607 Warn if @samp{long long} type is used.  This is default.  To inhibit
3608 the warning messages, use @option{-Wno-long-long}.  Flags
3609 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3610 only when @option{-pedantic} flag is used.
3611
3612 @item -Wvariadic-macros
3613 @opindex Wvariadic-macros
3614 @opindex Wno-variadic-macros
3615 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3616 alternate syntax when in pedantic ISO C99 mode.  This is default.
3617 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3618
3619 @item -Wvla
3620 @opindex Wvla
3621 @opindex Wno-vla
3622 Warn if variable length array is used in the code.
3623 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
3624 the variable length array.
3625
3626 @item -Wvolatile-register-var
3627 @opindex Wvolatile-register-var
3628 @opindex Wno-volatile-register-var
3629 Warn if a register variable is declared volatile.  The volatile
3630 modifier does not inhibit all optimizations that may eliminate reads
3631 and/or writes to register variables.
3632
3633 @item -Wdisabled-optimization
3634 @opindex Wdisabled-optimization
3635 Warn if a requested optimization pass is disabled.  This warning does
3636 not generally indicate that there is anything wrong with your code; it
3637 merely indicates that GCC's optimizers were unable to handle the code
3638 effectively.  Often, the problem is that your code is too big or too
3639 complex; GCC will refuse to optimize programs when the optimization
3640 itself is likely to take inordinate amounts of time.
3641
3642 @item -Wpointer-sign
3643 @opindex Wpointer-sign
3644 @opindex Wno-pointer-sign
3645 Warn for pointer argument passing or assignment with different signedness.
3646 This option is only supported for C and Objective-C@.  It is implied by
3647 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3648 @option{-Wno-pointer-sign}.
3649
3650 @item -Werror
3651 @opindex Werror
3652 Make all warnings into errors.
3653
3654 @item -Werror=
3655 @opindex Werror=
3656 Make the specified warning into an errors.  The specifier for a
3657 warning is appended, for example @option{-Werror=switch} turns the
3658 warnings controlled by @option{-Wswitch} into errors.  This switch
3659 takes a negative form, to be used to negate @option{-Werror} for
3660 specific warnings, for example @option{-Wno-error=switch} makes
3661 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3662 is in effect.  You can use the @option{-fdiagnostics-show-option}
3663 option to have each controllable warning amended with the option which
3664 controls it, to determine what to use with this option.
3665
3666 Note that specifying @option{-Werror=}@var{foo} automatically implies
3667 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3668 imply anything.
3669
3670 @item -Wstack-protector
3671 @opindex Wstack-protector
3672 This option is only active when @option{-fstack-protector} is active.  It
3673 warns about functions that will not be protected against stack smashing.
3674
3675 @item -Woverlength-strings
3676 @opindex Woverlength-strings
3677 Warn about string constants which are longer than the ``minimum
3678 maximum'' length specified in the C standard.  Modern compilers
3679 generally allow string constants which are much longer than the
3680 standard's minimum limit, but very portable programs should avoid
3681 using longer strings.
3682
3683 The limit applies @emph{after} string constant concatenation, and does
3684 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3685 C99, it was raised to 4095.  C++98 does not specify a normative
3686 minimum maximum, so we do not diagnose overlength strings in C++@.
3687
3688 This option is implied by @option{-pedantic}, and can be disabled with
3689 @option{-Wno-overlength-strings}.
3690 @end table
3691
3692 @node Debugging Options
3693 @section Options for Debugging Your Program or GCC
3694 @cindex options, debugging
3695 @cindex debugging information options
3696
3697 GCC has various special options that are used for debugging
3698 either your program or GCC:
3699
3700 @table @gcctabopt
3701 @item -g
3702 @opindex g
3703 Produce debugging information in the operating system's native format
3704 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3705 information.
3706
3707 On most systems that use stabs format, @option{-g} enables use of extra
3708 debugging information that only GDB can use; this extra information
3709 makes debugging work better in GDB but will probably make other debuggers
3710 crash or
3711 refuse to read the program.  If you want to control for certain whether
3712 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3713 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3714
3715 GCC allows you to use @option{-g} with
3716 @option{-O}.  The shortcuts taken by optimized code may occasionally
3717 produce surprising results: some variables you declared may not exist
3718 at all; flow of control may briefly move where you did not expect it;
3719 some statements may not be executed because they compute constant
3720 results or their values were already at hand; some statements may
3721 execute in different places because they were moved out of loops.
3722
3723 Nevertheless it proves possible to debug optimized output.  This makes
3724 it reasonable to use the optimizer for programs that might have bugs.
3725
3726 The following options are useful when GCC is generated with the
3727 capability for more than one debugging format.
3728
3729 @item -ggdb
3730 @opindex ggdb
3731 Produce debugging information for use by GDB@.  This means to use the
3732 most expressive format available (DWARF 2, stabs, or the native format
3733 if neither of those are supported), including GDB extensions if at all
3734 possible.
3735
3736 @item -gstabs
3737 @opindex gstabs
3738 Produce debugging information in stabs format (if that is supported),
3739 without GDB extensions.  This is the format used by DBX on most BSD
3740 systems.  On MIPS, Alpha and System V Release 4 systems this option
3741 produces stabs debugging output which is not understood by DBX or SDB@.
3742 On System V Release 4 systems this option requires the GNU assembler.
3743
3744 @item -feliminate-unused-debug-symbols
3745 @opindex feliminate-unused-debug-symbols
3746 Produce debugging information in stabs format (if that is supported),
3747 for only symbols that are actually used.
3748
3749 @item -femit-class-debug-always
3750 Instead of emitting debugging information for a C++ class in only one
3751 object file, emit it in all object files using the class.  This option
3752 should be used only with debuggers that are unable to handle the way GCC
3753 normally emits debugging information for classes because using this
3754 option will increase the size of debugging information by as much as a
3755 factor of two.
3756
3757 @item -gstabs+
3758 @opindex gstabs+
3759 Produce debugging information in stabs format (if that is supported),
3760 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3761 use of these extensions is likely to make other debuggers crash or
3762 refuse to read the program.
3763
3764 @item -gcoff
3765 @opindex gcoff
3766 Produce debugging information in COFF format (if that is supported).
3767 This is the format used by SDB on most System V systems prior to
3768 System V Release 4.
3769
3770 @item -gxcoff
3771 @opindex gxcoff
3772 Produce debugging information in XCOFF format (if that is supported).
3773 This is the format used by the DBX debugger on IBM RS/6000 systems.
3774
3775 @item -gxcoff+
3776 @opindex gxcoff+
3777 Produce debugging information in XCOFF format (if that is supported),
3778 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3779 use of these extensions is likely to make other debuggers crash or
3780 refuse to read the program, and may cause assemblers other than the GNU
3781 assembler (GAS) to fail with an error.
3782
3783 @item -gdwarf-2
3784 @opindex gdwarf-2
3785 Produce debugging information in DWARF version 2 format (if that is
3786 supported).  This is the format used by DBX on IRIX 6.  With this
3787 option, GCC uses features of DWARF version 3 when they are useful;
3788 version 3 is upward compatible with version 2, but may still cause
3789 problems for older debuggers.
3790
3791 @item -gvms
3792 @opindex gvms
3793 Produce debugging information in VMS debug format (if that is
3794 supported).  This is the format used by DEBUG on VMS systems.
3795
3796 @item -g@var{level}
3797 @itemx -ggdb@var{level}
3798 @itemx -gstabs@var{level}
3799 @itemx -gcoff@var{level}
3800 @itemx -gxcoff@var{level}
3801 @itemx -gvms@var{level}
3802 Request debugging information and also use @var{level} to specify how
3803 much information.  The default level is 2.
3804
3805 Level 1 produces minimal information, enough for making backtraces in
3806 parts of the program that you don't plan to debug.  This includes
3807 descriptions of functions and external variables, but no information
3808 about local variables and no line numbers.
3809
3810 Level 3 includes extra information, such as all the macro definitions
3811 present in the program.  Some debuggers support macro expansion when
3812 you use @option{-g3}.
3813
3814 @option{-gdwarf-2} does not accept a concatenated debug level, because
3815 GCC used to support an option @option{-gdwarf} that meant to generate
3816 debug information in version 1 of the DWARF format (which is very
3817 different from version 2), and it would have been too confusing.  That
3818 debug format is long obsolete, but the option cannot be changed now.
3819 Instead use an additional @option{-g@var{level}} option to change the
3820 debug level for DWARF2.
3821
3822 @item -feliminate-dwarf2-dups
3823 @opindex feliminate-dwarf2-dups
3824 Compress DWARF2 debugging information by eliminating duplicated
3825 information about each symbol.  This option only makes sense when
3826 generating DWARF2 debugging information with @option{-gdwarf-2}.
3827
3828 @item -femit-struct-debug-baseonly
3829 Emit debug information for struct-like types
3830 only when the base name of the compilation source file
3831 matches the base name of file in which the struct was defined.
3832
3833 This option substantially reduces the size of debugging information,
3834 but at significant potential loss in type information to the debugger.
3835 See @option{-femit-struct-debug-reduced} for a less aggressive option.
3836 See @option{-femit-struct-debug-detailed} for more detailed control.
3837
3838 This option works only with DWARF 2.
3839
3840 @item -femit-struct-debug-reduced
3841 Emit debug information for struct-like types
3842 only when the base name of the compilation source file
3843 matches the base name of file in which the type was defined,
3844 unless the struct is a template or defined in a system header.
3845
3846 This option significantly reduces the size of debugging information,
3847 with some potential loss in type information to the debugger.
3848 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
3849 See @option{-femit-struct-debug-detailed} for more detailed control.
3850
3851 This option works only with DWARF 2.
3852
3853 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
3854 Specify the struct-like types
3855 for which the compiler will generate debug information.
3856 The intent is to reduce duplicate struct debug information
3857 between different object files within the same program.
3858
3859 This option is a detailed version of
3860 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
3861 which will serve for most needs.
3862
3863 A specification has the syntax
3864 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
3865
3866 The optional first word limits the specification to
3867 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
3868 A struct type is used directly when it is the type of a variable, member.
3869 Indirect uses arise through pointers to structs.
3870 That is, when use of an incomplete struct would be legal, the use is indirect.
3871 An example is
3872 @samp{struct one direct; struct two * indirect;}.
3873
3874 The optional second word limits the specification to
3875 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
3876 Generic structs are a bit complicated to explain.
3877 For C++, these are non-explicit specializations of template classes,
3878 or non-template classes within the above.
3879 Other programming languages have generics,
3880 but @samp{-femit-struct-debug-detailed} does not yet implement them.
3881
3882 The third word specifies the source files for those
3883 structs for which the compiler will emit debug information.
3884 The values @samp{none} and @samp{any} have the normal meaning.
3885 The value @samp{base} means that
3886 the base of name of the file in which the type declaration appears
3887 must match the base of the name of the main compilation file.
3888 In practice, this means that
3889 types declared in @file{foo.c} and @file{foo.h} will have debug information,
3890 but types declared in other header will not.
3891 The value @samp{sys} means those types satisfying @samp{base}
3892 or declared in system or compiler headers.
3893
3894 You may need to experiment to determine the best settings for your application.
3895
3896 The default is @samp{-femit-struct-debug-detailed=all}.
3897
3898 This option works only with DWARF 2.
3899
3900 @cindex @command{prof}
3901 @item -p
3902 @opindex p
3903 Generate extra code to write profile information suitable for the
3904 analysis program @command{prof}.  You must use this option when compiling
3905 the source files you want data about, and you must also use it when
3906 linking.
3907
3908 @cindex @command{gprof}
3909 @item -pg
3910 @opindex pg
3911 Generate extra code to write profile information suitable for the
3912 analysis program @command{gprof}.  You must use this option when compiling
3913 the source files you want data about, and you must also use it when
3914 linking.
3915
3916 @item -Q
3917 @opindex Q
3918 Makes the compiler print out each function name as it is compiled, and
3919 print some statistics about each pass when it finishes.
3920
3921 @item -ftime-report
3922 @opindex ftime-report
3923 Makes the compiler print some statistics about the time consumed by each
3924 pass when it finishes.
3925
3926 @item -fmem-report
3927 @opindex fmem-report
3928 Makes the compiler print some statistics about permanent memory
3929 allocation when it finishes.
3930
3931 @item -fprofile-arcs
3932 @opindex fprofile-arcs
3933 Add code so that program flow @dfn{arcs} are instrumented.  During
3934 execution the program records how many times each branch and call is
3935 executed and how many times it is taken or returns.  When the compiled
3936 program exits it saves this data to a file called
3937 @file{@var{auxname}.gcda} for each source file.  The data may be used for
3938 profile-directed optimizations (@option{-fbranch-probabilities}), or for
3939 test coverage analysis (@option{-ftest-coverage}).  Each object file's
3940 @var{auxname} is generated from the name of the output file, if
3941 explicitly specified and it is not the final executable, otherwise it is
3942 the basename of the source file.  In both cases any suffix is removed
3943 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
3944 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
3945 @xref{Cross-profiling}.
3946
3947 @cindex @command{gcov}
3948 @item --coverage
3949 @opindex coverage
3950
3951 This option is used to compile and link code instrumented for coverage
3952 analysis.  The option is a synonym for @option{-fprofile-arcs}
3953 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
3954 linking).  See the documentation for those options for more details.
3955
3956 @itemize
3957
3958 @item
3959 Compile the source files with @option{-fprofile-arcs} plus optimization
3960 and code generation options.  For test coverage analysis, use the
3961 additional @option{-ftest-coverage} option.  You do not need to profile
3962 every source file in a program.
3963
3964 @item
3965 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
3966 (the latter implies the former).
3967
3968 @item
3969 Run the program on a representative workload to generate the arc profile
3970 information.  This may be repeated any number of times.  You can run
3971 concurrent instances of your program, and provided that the file system
3972 supports locking, the data files will be correctly updated.  Also
3973 @code{fork} calls are detected and correctly handled (double counting
3974 will not happen).
3975
3976 @item
3977 For profile-directed optimizations, compile the source files again with
3978 the same optimization and code generation options plus
3979 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
3980 Control Optimization}).
3981
3982 @item
3983 For test coverage analysis, use @command{gcov} to produce human readable
3984 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
3985 @command{gcov} documentation for further information.
3986
3987 @end itemize
3988
3989 With @option{-fprofile-arcs}, for each function of your program GCC
3990 creates a program flow graph, then finds a spanning tree for the graph.
3991 Only arcs that are not on the spanning tree have to be instrumented: the
3992 compiler adds code to count the number of times that these arcs are
3993 executed.  When an arc is the only exit or only entrance to a block, the
3994 instrumentation code can be added to the block; otherwise, a new basic
3995 block must be created to hold the instrumentation code.
3996
3997 @need 2000
3998 @item -ftest-coverage
3999 @opindex ftest-coverage
4000 Produce a notes file that the @command{gcov} code-coverage utility
4001 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4002 show program coverage.  Each source file's note file is called
4003 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4004 above for a description of @var{auxname} and instructions on how to
4005 generate test coverage data.  Coverage data will match the source files
4006 more closely, if you do not optimize.
4007
4008 @item -d@var{letters}
4009 @item -fdump-rtl-@var{pass}
4010 @opindex d
4011 Says to make debugging dumps during compilation at times specified by
4012 @var{letters}.    This is used for debugging the RTL-based passes of the
4013 compiler.  The file names for most of the dumps are made by appending a
4014 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4015 from the name of the output file, if explicitly specified and it is not
4016 an executable, otherwise it is the basename of the source file. These
4017 switches may have different effects when @option{-E} is used for
4018 preprocessing.
4019
4020 Most debug dumps can be enabled either passing a letter to the @option{-d}
4021 option, or with a long @option{-fdump-rtl} switch; here are the possible
4022 letters for use in @var{letters} and @var{pass}, and their meanings:
4023
4024 @table @gcctabopt
4025 @item -dA
4026 @opindex dA
4027 Annotate the assembler output with miscellaneous debugging information.
4028
4029 @item -dB
4030 @itemx -fdump-rtl-bbro
4031 @opindex dB
4032 @opindex fdump-rtl-bbro
4033 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4034
4035 @item -dc
4036 @itemx -fdump-rtl-combine
4037 @opindex dc
4038 @opindex fdump-rtl-combine
4039 Dump after instruction combination, to the file @file{@var{file}.129r.combine}.
4040
4041 @item -dC
4042 @itemx -fdump-rtl-ce1
4043 @itemx -fdump-rtl-ce2
4044 @opindex dC
4045 @opindex fdump-rtl-ce1
4046 @opindex fdump-rtl-ce2
4047 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4048 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4049 and @option{-fdump-rtl-ce2} enable dumping after the second if
4050 conversion, to the file @file{@var{file}.130r.ce2}.
4051
4052 @item -dd
4053 @itemx -fdump-rtl-btl
4054 @itemx -fdump-rtl-dbr
4055 @opindex dd
4056 @opindex fdump-rtl-btl
4057 @opindex fdump-rtl-dbr
4058 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4059 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4060 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4061 scheduling, to @file{@var{file}.36.dbr}.
4062
4063 @item -dD
4064 @opindex dD
4065 Dump all macro definitions, at the end of preprocessing, in addition to
4066 normal output.
4067
4068 @item -dE
4069 @itemx -fdump-rtl-ce3
4070 @opindex dE
4071 @opindex fdump-rtl-ce3
4072 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4073
4074 @item -df
4075 @itemx -fdump-rtl-cfg
4076 @itemx -fdump-rtl-life
4077 @opindex df
4078 @opindex fdump-rtl-cfg
4079 @opindex fdump-rtl-life
4080 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4081 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4082 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4083 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4084
4085 @item -dg
4086 @itemx -fdump-rtl-greg
4087 @opindex dg
4088 @opindex fdump-rtl-greg
4089 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4090
4091 @item -dG
4092 @itemx -fdump-rtl-gcse
4093 @itemx -fdump-rtl-bypass
4094 @opindex dG
4095 @opindex fdump-rtl-gcse
4096 @opindex fdump-rtl-bypass
4097 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4098 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4099 enable dumping after jump bypassing and control flow optimizations, to
4100 @file{@var{file}.115r.bypass}.
4101
4102 @item -dh
4103 @itemx -fdump-rtl-eh
4104 @opindex dh
4105 @opindex fdump-rtl-eh
4106 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4107
4108 @item -di
4109 @itemx -fdump-rtl-sibling
4110 @opindex di
4111 @opindex fdump-rtl-sibling
4112 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4113
4114 @item -dj
4115 @itemx -fdump-rtl-jump
4116 @opindex dj
4117 @opindex fdump-rtl-jump
4118 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4119
4120 @item -dk
4121 @itemx -fdump-rtl-stack
4122 @opindex dk
4123 @opindex fdump-rtl-stack
4124 Dump after conversion from registers to stack, to @file{@var{file}.152r.stack}.
4125
4126 @item -dl
4127 @itemx -fdump-rtl-lreg
4128 @opindex dl
4129 @opindex fdump-rtl-lreg
4130 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4131
4132 @item -dL
4133 @itemx -fdump-rtl-loop2
4134 @opindex dL
4135 @opindex fdump-rtl-loop2
4136 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4137 loop optimization pass, to @file{@var{file}.119r.loop2},
4138 @file{@var{file}.120r.loop2_init},
4139 @file{@var{file}.121r.loop2_invariant}, and
4140 @file{@var{file}.125r.loop2_done}.
4141
4142 @item -dm
4143 @itemx -fdump-rtl-sms
4144 @opindex dm
4145 @opindex fdump-rtl-sms
4146 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4147
4148 @item -dM
4149 @itemx -fdump-rtl-mach
4150 @opindex dM
4151 @opindex fdump-rtl-mach
4152 Dump after performing the machine dependent reorganization pass, to
4153 @file{@var{file}.155r.mach} if that pass exists.
4154
4155 @item -dn
4156 @itemx -fdump-rtl-rnreg
4157 @opindex dn
4158 @opindex fdump-rtl-rnreg
4159 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4160
4161 @item -dN
4162 @itemx -fdump-rtl-regmove
4163 @opindex dN
4164 @opindex fdump-rtl-regmove
4165 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4166
4167 @item -do
4168 @itemx -fdump-rtl-postreload
4169 @opindex do
4170 @opindex fdump-rtl-postreload
4171 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4172
4173 @item -dr
4174 @itemx -fdump-rtl-expand
4175 @opindex dr
4176 @opindex fdump-rtl-expand
4177 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4178
4179 @item -dR
4180 @itemx -fdump-rtl-sched2
4181 @opindex dR
4182 @opindex fdump-rtl-sched2
4183 Dump after the second scheduling pass, to @file{@var{file}.150r.sched2}.
4184
4185 @item -ds
4186 @itemx -fdump-rtl-cse
4187 @opindex ds
4188 @opindex fdump-rtl-cse
4189 Dump after CSE (including the jump optimization that sometimes follows
4190 CSE), to @file{@var{file}.113r.cse}.
4191
4192 @item -dS
4193 @itemx -fdump-rtl-sched
4194 @opindex dS
4195 @opindex fdump-rtl-sched
4196 Dump after the first scheduling pass, to @file{@var{file}.21.sched}.
4197
4198 @item -dt
4199 @itemx -fdump-rtl-cse2
4200 @opindex dt
4201 @opindex fdump-rtl-cse2
4202 Dump after the second CSE pass (including the jump optimization that
4203 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4204
4205 @item -dT
4206 @itemx -fdump-rtl-tracer
4207 @opindex dT
4208 @opindex fdump-rtl-tracer
4209 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4210
4211 @item -dV
4212 @itemx -fdump-rtl-vpt
4213 @itemx -fdump-rtl-vartrack
4214 @opindex dV
4215 @opindex fdump-rtl-vpt
4216 @opindex fdump-rtl-vartrack
4217 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4218 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4219 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4220 to @file{@var{file}.154r.vartrack}.
4221
4222 @item -dw
4223 @itemx -fdump-rtl-flow2
4224 @opindex dw
4225 @opindex fdump-rtl-flow2
4226 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4227
4228 @item -dz
4229 @itemx -fdump-rtl-peephole2
4230 @opindex dz
4231 @opindex fdump-rtl-peephole2
4232 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4233
4234 @item -dZ
4235 @itemx -fdump-rtl-web
4236 @opindex dZ
4237 @opindex fdump-rtl-web
4238 Dump after live range splitting, to @file{@var{file}.126r.web}.
4239
4240 @item -da
4241 @itemx -fdump-rtl-all
4242 @opindex da
4243 @opindex fdump-rtl-all
4244 Produce all the dumps listed above.
4245
4246 @item -dH
4247 @opindex dH
4248 Produce a core dump whenever an error occurs.
4249
4250 @item -dm
4251 @opindex dm
4252 Print statistics on memory usage, at the end of the run, to
4253 standard error.
4254
4255 @item -dp
4256 @opindex dp
4257 Annotate the assembler output with a comment indicating which
4258 pattern and alternative was used.  The length of each instruction is
4259 also printed.
4260
4261 @item -dP
4262 @opindex dP
4263 Dump the RTL in the assembler output as a comment before each instruction.
4264 Also turns on @option{-dp} annotation.
4265
4266 @item -dv
4267 @opindex dv
4268 For each of the other indicated dump files (either with @option{-d} or
4269 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4270 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4271
4272 @item -dx
4273 @opindex dx
4274 Just generate RTL for a function instead of compiling it.  Usually used
4275 with @samp{r} (@option{-fdump-rtl-expand}).
4276
4277 @item -dy
4278 @opindex dy
4279 Dump debugging information during parsing, to standard error.
4280 @end table
4281
4282 @item -fdump-noaddr
4283 @opindex fdump-noaddr
4284 When doing debugging dumps (see @option{-d} option above), suppress
4285 address output.  This makes it more feasible to use diff on debugging
4286 dumps for compiler invocations with different compiler binaries and/or
4287 different text / bss / data / heap / stack / dso start locations.
4288
4289 @item -fdump-unnumbered
4290 @opindex fdump-unnumbered
4291 When doing debugging dumps (see @option{-d} option above), suppress instruction
4292 numbers, line number note and address output.  This makes it more feasible to
4293 use diff on debugging dumps for compiler invocations with different
4294 options, in particular with and without @option{-g}.
4295
4296 @item -fdump-translation-unit @r{(C++ only)}
4297 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4298 @opindex fdump-translation-unit
4299 Dump a representation of the tree structure for the entire translation
4300 unit to a file.  The file name is made by appending @file{.tu} to the
4301 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4302 controls the details of the dump as described for the
4303 @option{-fdump-tree} options.
4304
4305 @item -fdump-class-hierarchy @r{(C++ only)}
4306 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4307 @opindex fdump-class-hierarchy
4308 Dump a representation of each class's hierarchy and virtual function
4309 table layout to a file.  The file name is made by appending @file{.class}
4310 to the source file name.  If the @samp{-@var{options}} form is used,
4311 @var{options} controls the details of the dump as described for the
4312 @option{-fdump-tree} options.
4313
4314 @item -fdump-ipa-@var{switch}
4315 @opindex fdump-ipa
4316 Control the dumping at various stages of inter-procedural analysis
4317 language tree to a file.  The file name is generated by appending a switch
4318 specific suffix to the source file name.  The following dumps are possible:
4319
4320 @table @samp
4321 @item all
4322 Enables all inter-procedural analysis dumps; currently the only produced
4323 dump is the @samp{cgraph} dump.
4324
4325 @item cgraph
4326 Dumps information about call-graph optimization, unused function removal,
4327 and inlining decisions.
4328 @end table
4329
4330 @item -fdump-tree-@var{switch}
4331 @itemx -fdump-tree-@var{switch}-@var{options}
4332 @opindex fdump-tree
4333 Control the dumping at various stages of processing the intermediate
4334 language tree to a file.  The file name is generated by appending a switch
4335 specific suffix to the source file name.  If the @samp{-@var{options}}
4336 form is used, @var{options} is a list of @samp{-} separated options that
4337 control the details of the dump.  Not all options are applicable to all
4338 dumps, those which are not meaningful will be ignored.  The following
4339 options are available
4340
4341 @table @samp
4342 @item address
4343 Print the address of each node.  Usually this is not meaningful as it
4344 changes according to the environment and source file.  Its primary use
4345 is for tying up a dump file with a debug environment.
4346 @item slim
4347 Inhibit dumping of members of a scope or body of a function merely
4348 because that scope has been reached.  Only dump such items when they
4349 are directly reachable by some other path.  When dumping pretty-printed
4350 trees, this option inhibits dumping the bodies of control structures.
4351 @item raw
4352 Print a raw representation of the tree.  By default, trees are
4353 pretty-printed into a C-like representation.
4354 @item details
4355 Enable more detailed dumps (not honored by every dump option).
4356 @item stats
4357 Enable dumping various statistics about the pass (not honored by every dump
4358 option).
4359 @item blocks
4360 Enable showing basic block boundaries (disabled in raw dumps).
4361 @item vops
4362 Enable showing virtual operands for every statement.
4363 @item lineno
4364 Enable showing line numbers for statements.
4365 @item uid
4366 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4367 @item all
4368 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4369 @end table
4370
4371 The following tree dumps are possible:
4372 @table @samp
4373
4374 @item original
4375 Dump before any tree based optimization, to @file{@var{file}.original}.
4376
4377 @item optimized
4378 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4379
4380 @item inlined
4381 Dump after function inlining, to @file{@var{file}.inlined}.
4382
4383 @item gimple
4384 @opindex fdump-tree-gimple
4385 Dump each function before and after the gimplification pass to a file.  The
4386 file name is made by appending @file{.gimple} to the source file name.
4387
4388 @item cfg
4389 @opindex fdump-tree-cfg
4390 Dump the control flow graph of each function to a file.  The file name is
4391 made by appending @file{.cfg} to the source file name.
4392
4393 @item vcg
4394 @opindex fdump-tree-vcg
4395 Dump the control flow graph of each function to a file in VCG format.  The
4396 file name is made by appending @file{.vcg} to the source file name.  Note
4397 that if the file contains more than one function, the generated file cannot
4398 be used directly by VCG@.  You will need to cut and paste each function's
4399 graph into its own separate file first.
4400
4401 @item ch
4402 @opindex fdump-tree-ch
4403 Dump each function after copying loop headers.  The file name is made by
4404 appending @file{.ch} to the source file name.
4405
4406 @item ssa
4407 @opindex fdump-tree-ssa
4408 Dump SSA related information to a file.  The file name is made by appending
4409 @file{.ssa} to the source file name.
4410
4411 @item salias
4412 @opindex fdump-tree-salias
4413 Dump structure aliasing variable information to a file.  This file name
4414 is made by appending @file{.salias} to the source file name.
4415
4416 @item alias
4417 @opindex fdump-tree-alias
4418 Dump aliasing information for each function.  The file name is made by
4419 appending @file{.alias} to the source file name.
4420
4421 @item ccp
4422 @opindex fdump-tree-ccp
4423 Dump each function after CCP@.  The file name is made by appending
4424 @file{.ccp} to the source file name.
4425
4426 @item storeccp
4427 @opindex fdump-tree-storeccp
4428 Dump each function after STORE-CCP.  The file name is made by appending
4429 @file{.storeccp} to the source file name.
4430
4431 @item pre
4432 @opindex fdump-tree-pre
4433 Dump trees after partial redundancy elimination.  The file name is made
4434 by appending @file{.pre} to the source file name.
4435
4436 @item fre
4437 @opindex fdump-tree-fre
4438 Dump trees after full redundancy elimination.  The file name is made
4439 by appending @file{.fre} to the source file name.
4440
4441 @item copyprop
4442 @opindex fdump-tree-copyprop
4443 Dump trees after copy propagation.  The file name is made
4444 by appending @file{.copyprop} to the source file name.
4445
4446 @item store_copyprop
4447 @opindex fdump-tree-store_copyprop
4448 Dump trees after store copy-propagation.  The file name is made
4449 by appending @file{.store_copyprop} to the source file name.
4450
4451 @item dce
4452 @opindex fdump-tree-dce
4453 Dump each function after dead code elimination.  The file name is made by
4454 appending @file{.dce} to the source file name.
4455
4456 @item mudflap
4457 @opindex fdump-tree-mudflap
4458 Dump each function after adding mudflap instrumentation.  The file name is
4459 made by appending @file{.mudflap} to the source file name.
4460
4461 @item sra
4462 @opindex fdump-tree-sra
4463 Dump each function after performing scalar replacement of aggregates.  The
4464 file name is made by appending @file{.sra} to the source file name.
4465
4466 @item sink
4467 @opindex fdump-tree-sink
4468 Dump each function after performing code sinking.  The file name is made
4469 by appending @file{.sink} to the source file name. 
4470
4471 @item dom
4472 @opindex fdump-tree-dom
4473 Dump each function after applying dominator tree optimizations.  The file
4474 name is made by appending @file{.dom} to the source file name.
4475
4476 @item dse
4477 @opindex fdump-tree-dse
4478 Dump each function after applying dead store elimination.  The file
4479 name is made by appending @file{.dse} to the source file name.
4480
4481 @item phiopt
4482 @opindex fdump-tree-phiopt
4483 Dump each function after optimizing PHI nodes into straightline code.  The file
4484 name is made by appending @file{.phiopt} to the source file name.
4485
4486 @item forwprop
4487 @opindex fdump-tree-forwprop
4488 Dump each function after forward propagating single use variables.  The file
4489 name is made by appending @file{.forwprop} to the source file name.
4490
4491 @item copyrename
4492 @opindex fdump-tree-copyrename
4493 Dump each function after applying the copy rename optimization.  The file
4494 name is made by appending @file{.copyrename} to the source file name.
4495
4496 @item nrv
4497 @opindex fdump-tree-nrv
4498 Dump each function after applying the named return value optimization on
4499 generic trees.  The file name is made by appending @file{.nrv} to the source
4500 file name.
4501
4502 @item vect
4503 @opindex fdump-tree-vect
4504 Dump each function after applying vectorization of loops.  The file name is
4505 made by appending @file{.vect} to the source file name.
4506
4507 @item vrp
4508 @opindex fdump-tree-vrp
4509 Dump each function after Value Range Propagation (VRP).  The file name
4510 is made by appending @file{.vrp} to the source file name.
4511
4512 @item all
4513 @opindex fdump-tree-all
4514 Enable all the available tree dumps with the flags provided in this option.
4515 @end table
4516
4517 @item -ftree-vectorizer-verbose=@var{n}
4518 @opindex ftree-vectorizer-verbose
4519 This option controls the amount of debugging output the vectorizer prints.
4520 This information is written to standard error, unless 
4521 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified, 
4522 in which case it is output to the usual dump listing file, @file{.vect}.
4523 For @var{n}=0 no diagnostic information is reported.
4524 If @var{n}=1 the vectorizer reports each loop that got vectorized, 
4525 and the total number of loops that got vectorized.
4526 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed 
4527 the first analysis phase (vect_analyze_loop_form) - i.e. countable, 
4528 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity 
4529 level that @option{-fdump-tree-vect-stats} uses.
4530 Higher verbosity levels mean either more information dumped for each 
4531 reported loop, or same amount of information reported for more loops:
4532 If @var{n}=3, alignment related information is added to the reports.
4533 If @var{n}=4, data-references related information (e.g. memory dependences, 
4534 memory access-patterns) is added to the reports.
4535 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops 
4536 that did not pass the first analysis phase (i.e. may not be countable, or 
4537 may have complicated control-flow).
4538 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4539 For @var{n}=7, all the information the vectorizer generates during its 
4540 analysis and transformation is reported.  This is the same verbosity level
4541 that @option{-fdump-tree-vect-details} uses.
4542
4543 @item -frandom-seed=@var{string}
4544 @opindex frandom-string
4545 This option provides a seed that GCC uses when it would otherwise use
4546 random numbers.  It is used to generate certain symbol names
4547 that have to be different in every compiled file.  It is also used to
4548 place unique stamps in coverage data files and the object files that
4549 produce them.  You can use the @option{-frandom-seed} option to produce
4550 reproducibly identical object files.
4551
4552 The @var{string} should be different for every file you compile.
4553
4554 @item -fsched-verbose=@var{n}
4555 @opindex fsched-verbose
4556 On targets that use instruction scheduling, this option controls the
4557 amount of debugging output the scheduler prints.  This information is
4558 written to standard error, unless @option{-dS} or @option{-dR} is
4559 specified, in which case it is output to the usual dump
4560 listing file, @file{.sched} or @file{.sched2} respectively.  However
4561 for @var{n} greater than nine, the output is always printed to standard
4562 error.
4563
4564 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4565 same information as @option{-dRS}.  For @var{n} greater than one, it
4566 also output basic block probabilities, detailed ready list information
4567 and unit/insn info.  For @var{n} greater than two, it includes RTL
4568 at abort point, control-flow and regions info.  And for @var{n} over
4569 four, @option{-fsched-verbose} also includes dependence info.
4570
4571 @item -save-temps
4572 @opindex save-temps
4573 Store the usual ``temporary'' intermediate files permanently; place them
4574 in the current directory and name them based on the source file.  Thus,
4575 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4576 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4577 preprocessed @file{foo.i} output file even though the compiler now
4578 normally uses an integrated preprocessor.
4579
4580 When used in combination with the @option{-x} command line option,
4581 @option{-save-temps} is sensible enough to avoid over writing an
4582 input source file with the same extension as an intermediate file.
4583 The corresponding intermediate file may be obtained by renaming the
4584 source file before using @option{-save-temps}.
4585
4586 @item -time
4587 @opindex time
4588 Report the CPU time taken by each subprocess in the compilation
4589 sequence.  For C source files, this is the compiler proper and assembler
4590 (plus the linker if linking is done).  The output looks like this:
4591
4592 @smallexample
4593 # cc1 0.12 0.01
4594 # as 0.00 0.01
4595 @end smallexample
4596
4597 The first number on each line is the ``user time'', that is time spent
4598 executing the program itself.  The second number is ``system time'',
4599 time spent executing operating system routines on behalf of the program.
4600 Both numbers are in seconds.
4601
4602 @item -fvar-tracking
4603 @opindex fvar-tracking
4604 Run variable tracking pass.  It computes where variables are stored at each
4605 position in code.  Better debugging information is then generated
4606 (if the debugging information format supports this information).
4607
4608 It is enabled by default when compiling with optimization (@option{-Os},
4609 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4610 the debug info format supports it.
4611
4612 @item -print-file-name=@var{library}
4613 @opindex print-file-name
4614 Print the full absolute name of the library file @var{library} that
4615 would be used when linking---and don't do anything else.  With this
4616 option, GCC does not compile or link anything; it just prints the
4617 file name.
4618
4619 @item -print-multi-directory
4620 @opindex print-multi-directory
4621 Print the directory name corresponding to the multilib selected by any
4622 other switches present in the command line.  This directory is supposed
4623 to exist in @env{GCC_EXEC_PREFIX}.
4624
4625 @item -print-multi-lib
4626 @opindex print-multi-lib
4627 Print the mapping from multilib directory names to compiler switches
4628 that enable them.  The directory name is separated from the switches by
4629 @samp{;}, and each switch starts with an @samp{@@} instead of the
4630 @samp{-}, without spaces between multiple switches.  This is supposed to
4631 ease shell-processing.
4632
4633 @item -print-prog-name=@var{program}
4634 @opindex print-prog-name
4635 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4636
4637 @item -print-libgcc-file-name
4638 @opindex print-libgcc-file-name
4639 Same as @option{-print-file-name=libgcc.a}.
4640
4641 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4642 but you do want to link with @file{libgcc.a}.  You can do
4643
4644 @smallexample
4645 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4646 @end smallexample
4647
4648 @item -print-search-dirs
4649 @opindex print-search-dirs
4650 Print the name of the configured installation directory and a list of
4651 program and library directories @command{gcc} will search---and don't do anything else.
4652
4653 This is useful when @command{gcc} prints the error message
4654 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4655 To resolve this you either need to put @file{cpp0} and the other compiler
4656 components where @command{gcc} expects to find them, or you can set the environment
4657 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4658 Don't forget the trailing @samp{/}.
4659 @xref{Environment Variables}.
4660
4661 @item -dumpmachine
4662 @opindex dumpmachine
4663 Print the compiler's target machine (for example,
4664 @samp{i686-pc-linux-gnu})---and don't do anything else.
4665
4666 @item -dumpversion
4667 @opindex dumpversion
4668 Print the compiler version (for example, @samp{3.0})---and don't do
4669 anything else.
4670
4671 @item -dumpspecs
4672 @opindex dumpspecs
4673 Print the compiler's built-in specs---and don't do anything else.  (This
4674 is used when GCC itself is being built.)  @xref{Spec Files}.
4675
4676 @item -feliminate-unused-debug-types
4677 @opindex feliminate-unused-debug-types
4678 Normally, when producing DWARF2 output, GCC will emit debugging
4679 information for all types declared in a compilation
4680 unit, regardless of whether or not they are actually used
4681 in that compilation unit.  Sometimes this is useful, such as
4682 if, in the debugger, you want to cast a value to a type that is
4683 not actually used in your program (but is declared).  More often,
4684 however, this results in a significant amount of wasted space.
4685 With this option, GCC will avoid producing debug symbol output
4686 for types that are nowhere used in the source file being compiled.
4687 @end table
4688
4689 @node Optimize Options
4690 @section Options That Control Optimization
4691 @cindex optimize options
4692 @cindex options, optimization
4693
4694 These options control various sorts of optimizations.
4695
4696 Without any optimization option, the compiler's goal is to reduce the
4697 cost of compilation and to make debugging produce the expected
4698 results.  Statements are independent: if you stop the program with a
4699 breakpoint between statements, you can then assign a new value to any
4700 variable or change the program counter to any other statement in the
4701 function and get exactly the results you would expect from the source
4702 code.
4703
4704 Turning on optimization flags makes the compiler attempt to improve
4705 the performance and/or code size at the expense of compilation time
4706 and possibly the ability to debug the program.
4707
4708 The compiler performs optimization based on the knowledge it has of
4709 the program.  Optimization levels @option{-O} and above, in
4710 particular, enable @emph{unit-at-a-time} mode, which allows the
4711 compiler to consider information gained from later functions in
4712 the file when compiling a function.  Compiling multiple files at
4713 once to a single output file in @emph{unit-at-a-time} mode allows
4714 the compiler to use information gained from all of the files when
4715 compiling each of them.
4716
4717 Not all optimizations are controlled directly by a flag.  Only
4718 optimizations that have a flag are listed.
4719
4720 @table @gcctabopt
4721 @item -O
4722 @itemx -O1
4723 @opindex O
4724 @opindex O1
4725 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4726 more memory for a large function.
4727
4728 With @option{-O}, the compiler tries to reduce code size and execution
4729 time, without performing any optimizations that take a great deal of
4730 compilation time.
4731
4732 @option{-O} turns on the following optimization flags:
4733 @gccoptlist{-fdefer-pop @gol
4734 -fdelayed-branch @gol
4735 -fguess-branch-probability @gol
4736 -fcprop-registers @gol
4737 -fif-conversion @gol
4738 -fif-conversion2 @gol
4739 -ftree-ccp @gol
4740 -ftree-dce @gol
4741 -ftree-dominator-opts @gol
4742 -ftree-dse @gol
4743 -ftree-ter @gol
4744 -ftree-lrs @gol
4745 -ftree-sra @gol
4746 -ftree-copyrename @gol
4747 -ftree-fre @gol
4748 -ftree-ch @gol
4749 -funit-at-a-time @gol
4750 -fmerge-constants}
4751
4752 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4753 where doing so does not interfere with debugging.
4754
4755 @item -O2
4756 @opindex O2
4757 Optimize even more.  GCC performs nearly all supported optimizations
4758 that do not involve a space-speed tradeoff.  The compiler does not
4759 perform loop unrolling or function inlining when you specify @option{-O2}.
4760 As compared to @option{-O}, this option increases both compilation time
4761 and the performance of the generated code.
4762
4763 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4764 also turns on the following optimization flags:
4765 @gccoptlist{-fthread-jumps @gol
4766 -fcrossjumping @gol
4767 -foptimize-sibling-calls @gol
4768 -fcse-follow-jumps  -fcse-skip-blocks @gol
4769 -fgcse  -fgcse-lm  @gol
4770 -fexpensive-optimizations @gol
4771 -frerun-cse-after-loop  @gol
4772 -fcaller-saves @gol
4773 -fpeephole2 @gol
4774 -fschedule-insns  -fschedule-insns2 @gol
4775 -fsched-interblock  -fsched-spec @gol
4776 -fregmove @gol
4777 -fstrict-aliasing -fstrict-overflow @gol
4778 -fdelete-null-pointer-checks @gol
4779 -freorder-blocks  -freorder-functions @gol
4780 -falign-functions  -falign-jumps @gol
4781 -falign-loops  -falign-labels @gol
4782 -ftree-vrp @gol
4783 -ftree-pre}
4784
4785 Please note the warning under @option{-fgcse} about
4786 invoking @option{-O2} on programs that use computed gotos.
4787
4788 @option{-O2} doesn't turn on @option{-ftree-vrp} for the Ada compiler.
4789 This option must be explicitly specified on the command line to be
4790 enabled for the Ada compiler.
4791
4792 @item -O3
4793 @opindex O3
4794 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4795 @option{-O2} and also turns on the @option{-finline-functions},
4796 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4797
4798 @item -O0
4799 @opindex O0
4800 Do not optimize.  This is the default.
4801
4802 @item -Os
4803 @opindex Os
4804 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4805 do not typically increase code size.  It also performs further
4806 optimizations designed to reduce code size.
4807
4808 @option{-Os} disables the following optimization flags:
4809 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4810 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
4811 -fprefetch-loop-arrays  -ftree-vect-loop-version}
4812
4813 If you use multiple @option{-O} options, with or without level numbers,
4814 the last such option is the one that is effective.
4815 @end table
4816
4817 Options of the form @option{-f@var{flag}} specify machine-independent
4818 flags.  Most flags have both positive and negative forms; the negative
4819 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4820 below, only one of the forms is listed---the one you typically will
4821 use.  You can figure out the other form by either removing @samp{no-}
4822 or adding it.
4823
4824 The following options control specific optimizations.  They are either
4825 activated by @option{-O} options or are related to ones that are.  You
4826 can use the following flags in the rare cases when ``fine-tuning'' of
4827 optimizations to be performed is desired.
4828
4829 @table @gcctabopt
4830 @item -fno-default-inline
4831 @opindex fno-default-inline
4832 Do not make member functions inline by default merely because they are
4833 defined inside the class scope (C++ only).  Otherwise, when you specify
4834 @w{@option{-O}}, member functions defined inside class scope are compiled
4835 inline by default; i.e., you don't need to add @samp{inline} in front of
4836 the member function name.
4837
4838 @item -fno-defer-pop
4839 @opindex fno-defer-pop
4840 Always pop the arguments to each function call as soon as that function
4841 returns.  For machines which must pop arguments after a function call,
4842 the compiler normally lets arguments accumulate on the stack for several
4843 function calls and pops them all at once.
4844
4845 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4846
4847 @item -fforce-mem
4848 @opindex fforce-mem
4849 Force memory operands to be copied into registers before doing
4850 arithmetic on them.  This produces better code by making all memory
4851 references potential common subexpressions.  When they are not common
4852 subexpressions, instruction combination should eliminate the separate
4853 register-load. This option is now a nop and will be removed in 4.3.
4854
4855 @item -fforce-addr
4856 @opindex fforce-addr
4857 Force memory address constants to be copied into registers before
4858 doing arithmetic on them.
4859
4860 @item -fomit-frame-pointer
4861 @opindex fomit-frame-pointer
4862 Don't keep the frame pointer in a register for functions that
4863 don't need one.  This avoids the instructions to save, set up and
4864 restore frame pointers; it also makes an extra register available
4865 in many functions.  @strong{It also makes debugging impossible on
4866 some machines.}
4867
4868 On some machines, such as the VAX, this flag has no effect, because
4869 the standard calling sequence automatically handles the frame pointer
4870 and nothing is saved by pretending it doesn't exist.  The
4871 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4872 whether a target machine supports this flag.  @xref{Registers,,Register
4873 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4874
4875 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4876
4877 @item -foptimize-sibling-calls
4878 @opindex foptimize-sibling-calls
4879 Optimize sibling and tail recursive calls.
4880
4881 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4882
4883 @item -fno-inline
4884 @opindex fno-inline
4885 Don't pay attention to the @code{inline} keyword.  Normally this option
4886 is used to keep the compiler from expanding any functions inline.
4887 Note that if you are not optimizing, no functions can be expanded inline.
4888
4889 @item -finline-functions
4890 @opindex finline-functions
4891 Integrate all simple functions into their callers.  The compiler
4892 heuristically decides which functions are simple enough to be worth
4893 integrating in this way.
4894
4895 If all calls to a given function are integrated, and the function is
4896 declared @code{static}, then the function is normally not output as
4897 assembler code in its own right.
4898
4899 Enabled at level @option{-O3}.
4900
4901 @item -finline-functions-called-once
4902 @opindex finline-functions-called-once
4903 Consider all @code{static} functions called once for inlining into their
4904 caller even if they are not marked @code{inline}.  If a call to a given
4905 function is integrated, then the function is not output as assembler code
4906 in its own right.
4907
4908 Enabled if @option{-funit-at-a-time} is enabled.
4909
4910 @item -fearly-inlining
4911 @opindex fearly-inlining
4912 Inline functions marked by @code{always_inline} and functions whose body seems
4913 smaller than the function call overhead early before doing
4914 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4915 makes profiling significantly cheaper and usually inlining faster on programs
4916 having large chains of nested wrapper functions.
4917
4918 Enabled by default.
4919
4920 @item -finline-limit=@var{n}
4921 @opindex finline-limit
4922 By default, GCC limits the size of functions that can be inlined.  This flag
4923 allows the control of this limit for functions that are explicitly marked as
4924 inline (i.e., marked with the inline keyword or defined within the class
4925 definition in c++).  @var{n} is the size of functions that can be inlined in
4926 number of pseudo instructions (not counting parameter handling).  The default
4927 value of @var{n} is 600.
4928 Increasing this value can result in more inlined code at
4929 the cost of compilation time and memory consumption.  Decreasing usually makes
4930 the compilation faster and less code will be inlined (which presumably
4931 means slower programs).  This option is particularly useful for programs that
4932 use inlining heavily such as those based on recursive templates with C++.
4933
4934 Inlining is actually controlled by a number of parameters, which may be
4935 specified individually by using @option{--param @var{name}=@var{value}}.
4936 The @option{-finline-limit=@var{n}} option sets some of these parameters
4937 as follows:
4938
4939 @table @gcctabopt
4940 @item max-inline-insns-single
4941  is set to @var{n}/2.
4942 @item max-inline-insns-auto
4943  is set to @var{n}/2.
4944 @item min-inline-insns
4945  is set to 130 or @var{n}/4, whichever is smaller.
4946 @item max-inline-insns-rtl
4947  is set to @var{n}.
4948 @end table
4949
4950 See below for a documentation of the individual
4951 parameters controlling inlining.
4952
4953 @emph{Note:} pseudo instruction represents, in this particular context, an
4954 abstract measurement of function's size.  In no way does it represent a count
4955 of assembly instructions and as such its exact meaning might change from one
4956 release to an another.
4957
4958 @item -fkeep-inline-functions
4959 @opindex fkeep-inline-functions
4960 In C, emit @code{static} functions that are declared @code{inline}
4961 into the object file, even if the function has been inlined into all
4962 of its callers.  This switch does not affect functions using the
4963 @code{extern inline} extension in GNU C@.  In C++, emit any and all
4964 inline functions into the object file.
4965
4966 @item -fkeep-static-consts
4967 @opindex fkeep-static-consts
4968 Emit variables declared @code{static const} when optimization isn't turned
4969 on, even if the variables aren't referenced.
4970
4971 GCC enables this option by default.  If you want to force the compiler to
4972 check if the variable was referenced, regardless of whether or not
4973 optimization is turned on, use the @option{-fno-keep-static-consts} option.
4974
4975 @item -fmerge-constants
4976 Attempt to merge identical constants (string constants and floating point
4977 constants) across compilation units.
4978
4979 This option is the default for optimized compilation if the assembler and
4980 linker support it.  Use @option{-fno-merge-constants} to inhibit this
4981 behavior.
4982
4983 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4984
4985 @item -fmerge-all-constants
4986 Attempt to merge identical constants and identical variables.
4987
4988 This option implies @option{-fmerge-constants}.  In addition to
4989 @option{-fmerge-constants} this considers e.g.@: even constant initialized
4990 arrays or initialized constant variables with integral or floating point
4991 types.  Languages like C or C++ require each non-automatic variable to
4992 have distinct location, so using this option will result in non-conforming
4993 behavior.
4994
4995 @item -fmodulo-sched
4996 @opindex fmodulo-sched
4997 Perform swing modulo scheduling immediately before the first scheduling
4998 pass.  This pass looks at innermost loops and reorders their
4999 instructions by overlapping different iterations.
5000
5001 @item -fno-branch-count-reg
5002 @opindex fno-branch-count-reg
5003 Do not use ``decrement and branch'' instructions on a count register,
5004 but instead generate a sequence of instructions that decrement a
5005 register, compare it against zero, then branch based upon the result.
5006 This option is only meaningful on architectures that support such
5007 instructions, which include x86, PowerPC, IA-64 and S/390.
5008
5009 The default is @option{-fbranch-count-reg}.
5010
5011 @item -fno-function-cse
5012 @opindex fno-function-cse
5013 Do not put function addresses in registers; make each instruction that
5014 calls a constant function contain the function's address explicitly.
5015
5016 This option results in less efficient code, but some strange hacks
5017 that alter the assembler output may be confused by the optimizations
5018 performed when this option is not used.
5019
5020 The default is @option{-ffunction-cse}
5021
5022 @item -fno-zero-initialized-in-bss
5023 @opindex fno-zero-initialized-in-bss
5024 If the target supports a BSS section, GCC by default puts variables that
5025 are initialized to zero into BSS@.  This can save space in the resulting
5026 code.
5027
5028 This option turns off this behavior because some programs explicitly
5029 rely on variables going to the data section.  E.g., so that the
5030 resulting executable can find the beginning of that section and/or make
5031 assumptions based on that.
5032
5033 The default is @option{-fzero-initialized-in-bss}.
5034
5035 @item -fbounds-check
5036 @opindex fbounds-check
5037 For front-ends that support it, generate additional code to check that
5038 indices used to access arrays are within the declared range.  This is
5039 currently only supported by the Java and Fortran front-ends, where
5040 this option defaults to true and false respectively.
5041
5042 @item -fmudflap -fmudflapth -fmudflapir
5043 @opindex fmudflap
5044 @opindex fmudflapth
5045 @opindex fmudflapir
5046 @cindex bounds checking
5047 @cindex mudflap
5048 For front-ends that support it (C and C++), instrument all risky
5049 pointer/array dereferencing operations, some standard library
5050 string/heap functions, and some other associated constructs with
5051 range/validity tests.  Modules so instrumented should be immune to
5052 buffer overflows, invalid heap use, and some other classes of C/C++
5053 programming errors.  The instrumentation relies on a separate runtime
5054 library (@file{libmudflap}), which will be linked into a program if
5055 @option{-fmudflap} is given at link time.  Run-time behavior of the
5056 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5057 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5058 for its options.
5059
5060 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5061 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5062 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5063 instrumentation should ignore pointer reads.  This produces less
5064 instrumentation (and therefore faster execution) and still provides
5065 some protection against outright memory corrupting writes, but allows
5066 erroneously read data to propagate within a program.
5067
5068 @item -fthread-jumps
5069 @opindex fthread-jumps
5070 Perform optimizations where we check to see if a jump branches to a
5071 location where another comparison subsumed by the first is found.  If
5072 so, the first branch is redirected to either the destination of the
5073 second branch or a point immediately following it, depending on whether
5074 the condition is known to be true or false.
5075
5076 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5077
5078 @item -fcse-follow-jumps
5079 @opindex fcse-follow-jumps
5080 In common subexpression elimination, scan through jump instructions
5081 when the target of the jump is not reached by any other path.  For
5082 example, when CSE encounters an @code{if} statement with an
5083 @code{else} clause, CSE will follow the jump when the condition
5084 tested is false.
5085
5086 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5087
5088 @item -fcse-skip-blocks
5089 @opindex fcse-skip-blocks
5090 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5091 follow jumps which conditionally skip over blocks.  When CSE
5092 encounters a simple @code{if} statement with no else clause,
5093 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5094 body of the @code{if}.
5095
5096 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5097
5098 @item -frerun-cse-after-loop
5099 @opindex frerun-cse-after-loop
5100 Re-run common subexpression elimination after loop optimizations has been
5101 performed.
5102
5103 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5104
5105 @item -fgcse
5106 @opindex fgcse
5107 Perform a global common subexpression elimination pass.
5108 This pass also performs global constant and copy propagation.
5109
5110 @emph{Note:} When compiling a program using computed gotos, a GCC
5111 extension, you may get better runtime performance if you disable
5112 the global common subexpression elimination pass by adding
5113 @option{-fno-gcse} to the command line.
5114
5115 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5116
5117 @item -fgcse-lm
5118 @opindex fgcse-lm
5119 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5120 attempt to move loads which are only killed by stores into themselves.  This
5121 allows a loop containing a load/store sequence to be changed to a load outside
5122 the loop, and a copy/store within the loop.
5123
5124 Enabled by default when gcse is enabled.
5125
5126 @item -fgcse-sm
5127 @opindex fgcse-sm
5128 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5129 global common subexpression elimination.  This pass will attempt to move
5130 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5131 loops containing a load/store sequence can be changed to a load before
5132 the loop and a store after the loop.
5133
5134 Not enabled at any optimization level.
5135
5136 @item -fgcse-las
5137 @opindex fgcse-las
5138 When @option{-fgcse-las} is enabled, the global common subexpression
5139 elimination pass eliminates redundant loads that come after stores to the
5140 same memory location (both partial and full redundancies).
5141
5142 Not enabled at any optimization level.
5143
5144 @item -fgcse-after-reload
5145 @opindex fgcse-after-reload
5146 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5147 pass is performed after reload.  The purpose of this pass is to cleanup
5148 redundant spilling.
5149
5150 @item -funsafe-loop-optimizations
5151 @opindex funsafe-loop-optimizations
5152 If given, the loop optimizer will assume that loop indices do not
5153 overflow, and that the loops with nontrivial exit condition are not
5154 infinite.  This enables a wider range of loop optimizations even if
5155 the loop optimizer itself cannot prove that these assumptions are valid.
5156 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5157 if it finds this kind of loop.
5158
5159 @item -fcrossjumping
5160 @opindex crossjumping
5161 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5162 resulting code may or may not perform better than without cross-jumping.
5163
5164 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5165
5166 @item -fif-conversion
5167 @opindex if-conversion
5168 Attempt to transform conditional jumps into branch-less equivalents.  This
5169 include use of conditional moves, min, max, set flags and abs instructions, and
5170 some tricks doable by standard arithmetics.  The use of conditional execution
5171 on chips where it is available is controlled by @code{if-conversion2}.
5172
5173 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5174
5175 @item -fif-conversion2
5176 @opindex if-conversion2
5177 Use conditional execution (where available) to transform conditional jumps into
5178 branch-less equivalents.
5179
5180 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5181
5182 @item -fdelete-null-pointer-checks
5183 @opindex fdelete-null-pointer-checks
5184 Use global dataflow analysis to identify and eliminate useless checks
5185 for null pointers.  The compiler assumes that dereferencing a null
5186 pointer would have halted the program.  If a pointer is checked after
5187 it has already been dereferenced, it cannot be null.
5188
5189 In some environments, this assumption is not true, and programs can
5190 safely dereference null pointers.  Use
5191 @option{-fno-delete-null-pointer-checks} to disable this optimization
5192 for programs which depend on that behavior.
5193
5194 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5195
5196 @item -fexpensive-optimizations
5197 @opindex fexpensive-optimizations
5198 Perform a number of minor optimizations that are relatively expensive.
5199
5200 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5201
5202 @item -foptimize-register-move
5203 @itemx -fregmove
5204 @opindex foptimize-register-move
5205 @opindex fregmove
5206 Attempt to reassign register numbers in move instructions and as
5207 operands of other simple instructions in order to maximize the amount of
5208 register tying.  This is especially helpful on machines with two-operand
5209 instructions.
5210
5211 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5212 optimization.
5213
5214 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5215
5216 @item -fdelayed-branch
5217 @opindex fdelayed-branch
5218 If supported for the target machine, attempt to reorder instructions
5219 to exploit instruction slots available after delayed branch
5220 instructions.
5221
5222 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5223
5224 @item -fschedule-insns
5225 @opindex fschedule-insns
5226 If supported for the target machine, attempt to reorder instructions to
5227 eliminate execution stalls due to required data being unavailable.  This
5228 helps machines that have slow floating point or memory load instructions
5229 by allowing other instructions to be issued until the result of the load
5230 or floating point instruction is required.
5231
5232 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5233
5234 @item -fschedule-insns2
5235 @opindex fschedule-insns2
5236 Similar to @option{-fschedule-insns}, but requests an additional pass of
5237 instruction scheduling after register allocation has been done.  This is
5238 especially useful on machines with a relatively small number of
5239 registers and where memory load instructions take more than one cycle.
5240
5241 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5242
5243 @item -fno-sched-interblock
5244 @opindex fno-sched-interblock
5245 Don't schedule instructions across basic blocks.  This is normally
5246 enabled by default when scheduling before register allocation, i.e.@:
5247 with @option{-fschedule-insns} or at @option{-O2} or higher.
5248
5249 @item -fno-sched-spec
5250 @opindex fno-sched-spec
5251 Don't allow speculative motion of non-load instructions.  This is normally
5252 enabled by default when scheduling before register allocation, i.e.@:
5253 with @option{-fschedule-insns} or at @option{-O2} or higher.
5254
5255 @item -fsched-spec-load
5256 @opindex fsched-spec-load
5257 Allow speculative motion of some load instructions.  This only makes
5258 sense when scheduling before register allocation, i.e.@: with
5259 @option{-fschedule-insns} or at @option{-O2} or higher.
5260
5261 @item -fsched-spec-load-dangerous
5262 @opindex fsched-spec-load-dangerous
5263 Allow speculative motion of more load instructions.  This only makes
5264 sense when scheduling before register allocation, i.e.@: with
5265 @option{-fschedule-insns} or at @option{-O2} or higher.
5266
5267 @item -fsched-stalled-insns=@var{n}
5268 @opindex fsched-stalled-insns
5269 Define how many insns (if any) can be moved prematurely from the queue
5270 of stalled insns into the ready list, during the second scheduling pass.
5271
5272 @item -fsched-stalled-insns-dep=@var{n}
5273 @opindex fsched-stalled-insns-dep
5274 Define how many insn groups (cycles) will be examined for a dependency
5275 on a stalled insn that is candidate for premature removal from the queue
5276 of stalled insns.  Has an effect only during the second scheduling pass,
5277 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5278
5279 @item -fsched2-use-superblocks
5280 @opindex fsched2-use-superblocks
5281 When scheduling after register allocation, do use superblock scheduling
5282 algorithm.  Superblock scheduling allows motion across basic block boundaries
5283 resulting on faster schedules.  This option is experimental, as not all machine
5284 descriptions used by GCC model the CPU closely enough to avoid unreliable
5285 results from the algorithm.
5286
5287 This only makes sense when scheduling after register allocation, i.e.@: with
5288 @option{-fschedule-insns2} or at @option{-O2} or higher.
5289
5290 @item -fsched2-use-traces
5291 @opindex fsched2-use-traces
5292 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5293 allocation and additionally perform code duplication in order to increase the
5294 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5295 trace formation.
5296
5297 This mode should produce faster but significantly longer programs.  Also
5298 without @option{-fbranch-probabilities} the traces constructed may not
5299 match the reality and hurt the performance.  This only makes
5300 sense when scheduling after register allocation, i.e.@: with
5301 @option{-fschedule-insns2} or at @option{-O2} or higher.
5302
5303 @item -fsee
5304 @opindex fsee
5305 Eliminates redundant extension instructions and move the non redundant
5306 ones to optimal placement using LCM.
5307
5308 @item -freschedule-modulo-scheduled-loops
5309 @opindex fscheduling-in-modulo-scheduled-loops
5310 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5311 we may want to prevent the later scheduling passes from changing its schedule, we use this
5312 option to control that.
5313
5314 @item -fcaller-saves
5315 @opindex fcaller-saves
5316 Enable values to be allocated in registers that will be clobbered by
5317 function calls, by emitting extra instructions to save and restore the
5318 registers around such calls.  Such allocation is done only when it
5319 seems to result in better code than would otherwise be produced.
5320
5321 This option is always enabled by default on certain machines, usually
5322 those which have no call-preserved registers to use instead.
5323
5324 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5325
5326 @item -ftree-pre
5327 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5328 enabled by default at @option{-O2} and @option{-O3}.
5329
5330 @item -ftree-fre
5331 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5332 between FRE and PRE is that FRE only considers expressions
5333 that are computed on all paths leading to the redundant computation.
5334 This analysis faster than PRE, though it exposes fewer redundancies.
5335 This flag is enabled by default at @option{-O} and higher.
5336
5337 @item -ftree-copy-prop
5338 Perform copy propagation on trees.  This pass eliminates unnecessary
5339 copy operations.  This flag is enabled by default at @option{-O} and
5340 higher.
5341
5342 @item -ftree-store-copy-prop
5343 Perform copy propagation of memory loads and stores.  This pass
5344 eliminates unnecessary copy operations in memory references
5345 (structures, global variables, arrays, etc).  This flag is enabled by
5346 default at @option{-O2} and higher.
5347
5348 @item -ftree-salias
5349 Perform structural alias analysis on trees.  This flag
5350 is enabled by default at @option{-O} and higher.
5351
5352 @item -fipa-pta
5353 Perform interprocedural pointer analysis.
5354
5355 @item -ftree-sink
5356 Perform forward store motion  on trees.  This flag is
5357 enabled by default at @option{-O} and higher.
5358
5359 @item -ftree-ccp
5360 Perform sparse conditional constant propagation (CCP) on trees.  This
5361 pass only operates on local scalar variables and is enabled by default
5362 at @option{-O} and higher.
5363
5364 @item -ftree-store-ccp
5365 Perform sparse conditional constant propagation (CCP) on trees.  This
5366 pass operates on both local scalar variables and memory stores and
5367 loads (global variables, structures, arrays, etc).  This flag is
5368 enabled by default at @option{-O2} and higher.
5369
5370 @item -ftree-dce
5371 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5372 default at @option{-O} and higher.
5373
5374 @item -ftree-dominator-opts
5375 Perform a variety of simple scalar cleanups (constant/copy
5376 propagation, redundancy elimination, range propagation and expression
5377 simplification) based on a dominator tree traversal.  This also
5378 performs jump threading (to reduce jumps to jumps). This flag is
5379 enabled by default at @option{-O} and higher.
5380
5381 @item -ftree-ch
5382 Perform loop header copying on trees.  This is beneficial since it increases
5383 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5384 is enabled by default at @option{-O} and higher.  It is not enabled
5385 for @option{-Os}, since it usually increases code size.
5386
5387 @item -ftree-loop-optimize
5388 Perform loop optimizations on trees.  This flag is enabled by default
5389 at @option{-O} and higher.
5390
5391 @item -ftree-loop-linear
5392 Perform linear loop transformations on tree.  This flag can improve cache
5393 performance and allow further loop optimizations to take place.
5394
5395 @item -ftree-loop-im
5396 Perform loop invariant motion on trees.  This pass moves only invariants that
5397 would be hard to handle at RTL level (function calls, operations that expand to
5398 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5399 operands of conditions that are invariant out of the loop, so that we can use
5400 just trivial invariantness analysis in loop unswitching.  The pass also includes
5401 store motion.
5402
5403 @item -ftree-loop-ivcanon
5404 Create a canonical counter for number of iterations in the loop for that
5405 determining number of iterations requires complicated analysis.  Later
5406 optimizations then may determine the number easily.  Useful especially
5407 in connection with unrolling.
5408
5409 @item -fivopts
5410 Perform induction variable optimizations (strength reduction, induction
5411 variable merging and induction variable elimination) on trees.
5412
5413 @item -ftree-sra
5414 Perform scalar replacement of aggregates.  This pass replaces structure
5415 references with scalars to prevent committing structures to memory too
5416 early.  This flag is enabled by default at @option{-O} and higher.
5417
5418 @item -ftree-copyrename
5419 Perform copy renaming on trees.  This pass attempts to rename compiler
5420 temporaries to other variables at copy locations, usually resulting in
5421 variable names which more closely resemble the original variables.  This flag
5422 is enabled by default at @option{-O} and higher.
5423
5424 @item -ftree-ter
5425 Perform temporary expression replacement during the SSA->normal phase.  Single
5426 use/single def temporaries are replaced at their use location with their
5427 defining expression.  This results in non-GIMPLE code, but gives the expanders
5428 much more complex trees to work on resulting in better RTL generation.  This is
5429 enabled by default at @option{-O} and higher.
5430
5431 @item -ftree-lrs
5432 Perform live range splitting during the SSA->normal phase.  Distinct live
5433 ranges of a variable are split into unique variables, allowing for better
5434 optimization later.  This is enabled by default at @option{-O} and higher.
5435
5436 @item -ftree-vectorize
5437 Perform loop vectorization on trees.
5438
5439 @item -ftree-vect-loop-version
5440 @opindex ftree-vect-loop-version
5441 Perform loop versioning when doing loop vectorization on trees.  When a loop
5442 appears to be vectorizable except that data alignment or data dependence cannot
5443 be determined at compile time then vectorized and non-vectorized versions of
5444 the loop are generated along with runtime checks for alignment or dependence
5445 to control which version is executed.  This option is enabled by default
5446 except at level @option{-Os} where it is disabled.
5447
5448 @item -ftree-vrp
5449 Perform Value Range Propagation on trees.  This is similar to the
5450 constant propagation pass, but instead of values, ranges of values are
5451 propagated.  This allows the optimizers to remove unnecessary range
5452 checks like array bound checks and null pointer checks.  This is
5453 enabled by default at @option{-O2} and higher.  Null pointer check
5454 elimination is only done if @option{-fdelete-null-pointer-checks} is
5455 enabled.
5456
5457 @item -ftracer
5458 @opindex ftracer
5459 Perform tail duplication to enlarge superblock size.  This transformation
5460 simplifies the control flow of the function allowing other optimizations to do
5461 better job.
5462
5463 @item -funroll-loops
5464 @opindex funroll-loops
5465 Unroll loops whose number of iterations can be determined at compile
5466 time or upon entry to the loop.  @option{-funroll-loops} implies
5467 @option{-frerun-cse-after-loop}.  This option makes code larger,
5468 and may or may not make it run faster.
5469
5470 @item -funroll-all-loops
5471 @opindex funroll-all-loops
5472 Unroll all loops, even if their number of iterations is uncertain when
5473 the loop is entered.  This usually makes programs run more slowly.
5474 @option{-funroll-all-loops} implies the same options as
5475 @option{-funroll-loops},
5476
5477 @item -fsplit-ivs-in-unroller
5478 @opindex fsplit-ivs-in-unroller
5479 Enables expressing of values of induction variables in later iterations
5480 of the unrolled loop using the value in the first iteration.  This breaks
5481 long dependency chains, thus improving efficiency of the scheduling passes.
5482
5483 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5484 same effect.  However in cases the loop body is more complicated than
5485 a single basic block, this is not reliable.  It also does not work at all
5486 on some of the architectures due to restrictions in the CSE pass.
5487
5488 This optimization is enabled by default.
5489
5490 @item -fvariable-expansion-in-unroller
5491 @opindex fvariable-expansion-in-unroller
5492 With this option, the compiler will create multiple copies of some
5493 local variables when unrolling a loop which can result in superior code.
5494
5495 @item -fprefetch-loop-arrays
5496 @opindex fprefetch-loop-arrays
5497 If supported by the target machine, generate instructions to prefetch
5498 memory to improve the performance of loops that access large arrays.
5499
5500 This option may generate better or worse code; results are highly
5501 dependent on the structure of loops within the source code.
5502
5503 Disabled at level @option{-Os}.
5504
5505 @item -fno-peephole
5506 @itemx -fno-peephole2
5507 @opindex fno-peephole
5508 @opindex fno-peephole2
5509 Disable any machine-specific peephole optimizations.  The difference
5510 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5511 are implemented in the compiler; some targets use one, some use the
5512 other, a few use both.
5513
5514 @option{-fpeephole} is enabled by default.
5515 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5516
5517 @item -fno-guess-branch-probability
5518 @opindex fno-guess-branch-probability
5519 Do not guess branch probabilities using heuristics.
5520
5521 GCC will use heuristics to guess branch probabilities if they are
5522 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5523 heuristics are based on the control flow graph.  If some branch probabilities
5524 are specified by @samp{__builtin_expect}, then the heuristics will be
5525 used to guess branch probabilities for the rest of the control flow graph,
5526 taking the @samp{__builtin_expect} info into account.  The interactions
5527 between the heuristics and @samp{__builtin_expect} can be complex, and in
5528 some cases, it may be useful to disable the heuristics so that the effects
5529 of @samp{__builtin_expect} are easier to understand.
5530
5531 The default is @option{-fguess-branch-probability} at levels
5532 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5533
5534 @item -freorder-blocks
5535 @opindex freorder-blocks
5536 Reorder basic blocks in the compiled function in order to reduce number of
5537 taken branches and improve code locality.
5538
5539 Enabled at levels @option{-O2}, @option{-O3}.
5540
5541 @item -freorder-blocks-and-partition
5542 @opindex freorder-blocks-and-partition
5543 In addition to reordering basic blocks in the compiled function, in order
5544 to reduce number of taken branches, partitions hot and cold basic blocks
5545 into separate sections of the assembly and .o files, to improve
5546 paging and cache locality performance.
5547
5548 This optimization is automatically turned off in the presence of
5549 exception handling, for linkonce sections, for functions with a user-defined
5550 section attribute and on any architecture that does not support named
5551 sections.
5552
5553 @item -freorder-functions
5554 @opindex freorder-functions
5555 Reorder functions in the object file in order to
5556 improve code locality.  This is implemented by using special
5557 subsections @code{.text.hot} for most frequently executed functions and
5558 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5559 the linker so object file format must support named sections and linker must
5560 place them in a reasonable way.
5561
5562 Also profile feedback must be available in to make this option effective.  See
5563 @option{-fprofile-arcs} for details.
5564
5565 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5566
5567 @item -fstrict-aliasing
5568 @opindex fstrict-aliasing
5569 Allows the compiler to assume the strictest aliasing rules applicable to
5570 the language being compiled.  For C (and C++), this activates
5571 optimizations based on the type of expressions.  In particular, an
5572 object of one type is assumed never to reside at the same address as an
5573 object of a different type, unless the types are almost the same.  For
5574 example, an @code{unsigned int} can alias an @code{int}, but not a
5575 @code{void*} or a @code{double}.  A character type may alias any other
5576 type.
5577
5578 Pay special attention to code like this:
5579 @smallexample
5580 union a_union @{
5581   int i;
5582   double d;
5583 @};
5584
5585 int f() @{
5586   a_union t;
5587   t.d = 3.0;
5588   return t.i;
5589 @}
5590 @end smallexample
5591 The practice of reading from a different union member than the one most
5592 recently written to (called ``type-punning'') is common.  Even with
5593 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5594 is accessed through the union type.  So, the code above will work as
5595 expected.  However, this code might not:
5596 @smallexample
5597 int f() @{
5598   a_union t;
5599   int* ip;
5600   t.d = 3.0;
5601   ip = &t.i;
5602   return *ip;
5603 @}
5604 @end smallexample
5605
5606 Every language that wishes to perform language-specific alias analysis
5607 should define a function that computes, given an @code{tree}
5608 node, an alias set for the node.  Nodes in different alias sets are not
5609 allowed to alias.  For an example, see the C front-end function
5610 @code{c_get_alias_set}.
5611
5612 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5613
5614 @item -fstrict-overflow
5615 @opindex fstrict-overflow
5616 Allow the compiler to assume strict signed overflow rules, depending
5617 on the language being compiled.  For C (and C++) this means that
5618 overflow when doing arithmetic with signed numbers is undefined, which
5619 means that the compiler may assume that it will not happen.  This
5620 permits various optimizations.  For example, the compiler will assume
5621 that an expression like @code{i + 10 > i} will always be true for
5622 signed @code{i}.  This assumption is only valid if signed overflow is
5623 undefined, as the expression is false if @code{i + 10} overflows when
5624 using twos complement arithmetic.  When this option is in effect any
5625 attempt to determine whether an operation on signed numbers will
5626 overflow must be written carefully to not actually involve overflow.
5627
5628 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5629 that signed overflow is fully defined: it wraps.  When
5630 @option{-fwrapv} is used, there is no difference between
5631 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5632 @option{-fwrapv} certain types of overflow are permitted.  For
5633 example, if the compiler gets an overflow when doing arithmetic on
5634 constants, the overflowed value can still be used with
5635 @option{-fwrapv}, but not otherwise.
5636
5637 The @option{-fstrict-overflow} option is enabled at levels
5638 @option{-O2}, @option{-O3}, @option{-Os}.
5639
5640 @item -falign-functions
5641 @itemx -falign-functions=@var{n}
5642 @opindex falign-functions
5643 Align the start of functions to the next power-of-two greater than
5644 @var{n}, skipping up to @var{n} bytes.  For instance,
5645 @option{-falign-functions=32} aligns functions to the next 32-byte
5646 boundary, but @option{-falign-functions=24} would align to the next
5647 32-byte boundary only if this can be done by skipping 23 bytes or less.
5648
5649 @option{-fno-align-functions} and @option{-falign-functions=1} are
5650 equivalent and mean that functions will not be aligned.
5651
5652 Some assemblers only support this flag when @var{n} is a power of two;
5653 in that case, it is rounded up.
5654
5655 If @var{n} is not specified or is zero, use a machine-dependent default.
5656
5657 Enabled at levels @option{-O2}, @option{-O3}.
5658
5659 @item -falign-labels
5660 @itemx -falign-labels=@var{n}
5661 @opindex falign-labels
5662 Align all branch targets to a power-of-two boundary, skipping up to
5663 @var{n} bytes like @option{-falign-functions}.  This option can easily
5664 make code slower, because it must insert dummy operations for when the
5665 branch target is reached in the usual flow of the code.
5666
5667 @option{-fno-align-labels} and @option{-falign-labels=1} are
5668 equivalent and mean that labels will not be aligned.
5669
5670 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5671 are greater than this value, then their values are used instead.
5672
5673 If @var{n} is not specified or is zero, use a machine-dependent default
5674 which is very likely to be @samp{1}, meaning no alignment.
5675
5676 Enabled at levels @option{-O2}, @option{-O3}.
5677
5678 @item -falign-loops
5679 @itemx -falign-loops=@var{n}
5680 @opindex falign-loops
5681 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5682 like @option{-falign-functions}.  The hope is that the loop will be
5683 executed many times, which will make up for any execution of the dummy
5684 operations.
5685
5686 @option{-fno-align-loops} and @option{-falign-loops=1} are
5687 equivalent and mean that loops will not be aligned.
5688
5689 If @var{n} is not specified or is zero, use a machine-dependent default.
5690
5691 Enabled at levels @option{-O2}, @option{-O3}.
5692
5693 @item -falign-jumps
5694 @itemx -falign-jumps=@var{n}
5695 @opindex falign-jumps
5696 Align branch targets to a power-of-two boundary, for branch targets
5697 where the targets can only be reached by jumping, skipping up to @var{n}
5698 bytes like @option{-falign-functions}.  In this case, no dummy operations
5699 need be executed.
5700
5701 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5702 equivalent and mean that loops will not be aligned.
5703
5704 If @var{n} is not specified or is zero, use a machine-dependent default.
5705
5706 Enabled at levels @option{-O2}, @option{-O3}.
5707
5708 @item -funit-at-a-time
5709 @opindex funit-at-a-time
5710 Parse the whole compilation unit before starting to produce code.
5711 This allows some extra optimizations to take place but consumes
5712 more memory (in general).  There are some compatibility issues
5713 with @emph{unit-at-a-time} mode:
5714 @itemize @bullet
5715 @item
5716 enabling @emph{unit-at-a-time} mode may change the order
5717 in which functions, variables, and top-level @code{asm} statements
5718 are emitted, and will likely break code relying on some particular
5719 ordering.  The majority of such top-level @code{asm} statements,
5720 though, can be replaced by @code{section} attributes.  The
5721 @option{fno-toplevel-reorder} option may be used to keep the ordering
5722 used in the input file, at the cost of some optimizations.
5723
5724 @item
5725 @emph{unit-at-a-time} mode removes unreferenced static variables
5726 and functions.  This may result in undefined references
5727 when an @code{asm} statement refers directly to variables or functions
5728 that are otherwise unused.  In that case either the variable/function
5729 shall be listed as an operand of the @code{asm} statement operand or,
5730 in the case of top-level @code{asm} statements the attribute @code{used}
5731 shall be used on the declaration.
5732
5733 @item
5734 Static functions now can use non-standard passing conventions that
5735 may break @code{asm} statements calling functions directly.  Again,
5736 attribute @code{used} will prevent this behavior.
5737 @end itemize
5738
5739 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5740 but this scheme may not be supported by future releases of GCC@.
5741
5742 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5743
5744 @item -fno-toplevel-reorder
5745 Do not reorder top-level functions, variables, and @code{asm}
5746 statements.  Output them in the same order that they appear in the
5747 input file.  When this option is used, unreferenced static variables
5748 will not be removed.  This option is intended to support existing code
5749 which relies on a particular ordering.  For new code, it is better to
5750 use attributes.
5751
5752 @item -fweb
5753 @opindex fweb
5754 Constructs webs as commonly used for register allocation purposes and assign
5755 each web individual pseudo register.  This allows the register allocation pass
5756 to operate on pseudos directly, but also strengthens several other optimization
5757 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5758 however, make debugging impossible, since variables will no longer stay in a
5759 ``home register''.
5760
5761 Enabled by default with @option{-funroll-loops}.
5762
5763 @item -fwhole-program
5764 @opindex fwhole-program
5765 Assume that the current compilation unit represents whole program being
5766 compiled.  All public functions and variables with the exception of @code{main}
5767 and those merged by attribute @code{externally_visible} become static functions
5768 and in a affect gets more aggressively optimized by interprocedural optimizers.
5769 While this option is equivalent to proper use of @code{static} keyword for
5770 programs consisting of single file, in combination with option
5771 @option{--combine} this flag can be used to compile most of smaller scale C
5772 programs since the functions and variables become local for the whole combined
5773 compilation unit, not for the single source file itself.
5774
5775
5776 @item -fno-cprop-registers
5777 @opindex fno-cprop-registers
5778 After register allocation and post-register allocation instruction splitting,
5779 we perform a copy-propagation pass to try to reduce scheduling dependencies
5780 and occasionally eliminate the copy.
5781
5782 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5783
5784 @item -fprofile-generate
5785 @opindex fprofile-generate
5786
5787 Enable options usually used for instrumenting application to produce
5788 profile useful for later recompilation with profile feedback based
5789 optimization.  You must use @option{-fprofile-generate} both when
5790 compiling and when linking your program.
5791
5792 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5793
5794 @item -fprofile-use
5795 @opindex fprofile-use
5796 Enable profile feedback directed optimizations, and optimizations
5797 generally profitable only with profile feedback available.
5798
5799 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5800 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
5801
5802 @end table
5803
5804 The following options control compiler behavior regarding floating
5805 point arithmetic.  These options trade off between speed and
5806 correctness.  All must be specifically enabled.
5807
5808 @table @gcctabopt
5809 @item -ffloat-store
5810 @opindex ffloat-store
5811 Do not store floating point variables in registers, and inhibit other
5812 options that might change whether a floating point value is taken from a
5813 register or memory.
5814
5815 @cindex floating point precision
5816 This option prevents undesirable excess precision on machines such as
5817 the 68000 where the floating registers (of the 68881) keep more
5818 precision than a @code{double} is supposed to have.  Similarly for the
5819 x86 architecture.  For most programs, the excess precision does only
5820 good, but a few programs rely on the precise definition of IEEE floating
5821 point.  Use @option{-ffloat-store} for such programs, after modifying
5822 them to store all pertinent intermediate computations into variables.
5823
5824 @item -ffast-math
5825 @opindex ffast-math
5826 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5827 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5828 @option{-fno-rounding-math}, @option{-fno-signaling-nans}
5829 and @option{fcx-limited-range}.
5830
5831 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5832
5833 This option should never be turned on by any @option{-O} option since
5834 it can result in incorrect output for programs which depend on
5835 an exact implementation of IEEE or ISO rules/specifications for
5836 math functions.
5837
5838 @item -fno-math-errno
5839 @opindex fno-math-errno
5840 Do not set ERRNO after calling math functions that are executed
5841 with a single instruction, e.g., sqrt.  A program that relies on
5842 IEEE exceptions for math error handling may want to use this flag
5843 for speed while maintaining IEEE arithmetic compatibility.
5844
5845 This option should never be turned on by any @option{-O} option since
5846 it can result in incorrect output for programs which depend on
5847 an exact implementation of IEEE or ISO rules/specifications for
5848 math functions.
5849
5850 The default is @option{-fmath-errno}.
5851
5852 On Darwin and FreeBSD systems, the math library never sets @code{errno}.
5853 There is therefore
5854 no reason for the compiler to consider the possibility that it might,
5855 and @option{-fno-math-errno} is the default.
5856
5857 @item -funsafe-math-optimizations
5858 @opindex funsafe-math-optimizations
5859 Allow optimizations for floating-point arithmetic that (a) assume
5860 that arguments and results are valid and (b) may violate IEEE or
5861 ANSI standards.  When used at link-time, it may include libraries
5862 or startup files that change the default FPU control word or other
5863 similar optimizations.
5864
5865 This option should never be turned on by any @option{-O} option since
5866 it can result in incorrect output for programs which depend on
5867 an exact implementation of IEEE or ISO rules/specifications for
5868 math functions.
5869
5870 The default is @option{-fno-unsafe-math-optimizations}.
5871
5872 @item -ffinite-math-only
5873 @opindex ffinite-math-only
5874 Allow optimizations for floating-point arithmetic that assume
5875 that arguments and results are not NaNs or +-Infs.
5876
5877 This option should never be turned on by any @option{-O} option since
5878 it can result in incorrect output for programs which depend on
5879 an exact implementation of IEEE or ISO rules/specifications.
5880
5881 The default is @option{-fno-finite-math-only}.
5882
5883 @item -fno-trapping-math
5884 @opindex fno-trapping-math
5885 Compile code assuming that floating-point operations cannot generate
5886 user-visible traps.  These traps include division by zero, overflow,
5887 underflow, inexact result and invalid operation.  This option implies
5888 @option{-fno-signaling-nans}.  Setting this option may allow faster
5889 code if one relies on ``non-stop'' IEEE arithmetic, for example.
5890
5891 This option should never be turned on by any @option{-O} option since
5892 it can result in incorrect output for programs which depend on
5893 an exact implementation of IEEE or ISO rules/specifications for
5894 math functions.
5895
5896 The default is @option{-ftrapping-math}.
5897
5898 @item -frounding-math
5899 @opindex frounding-math
5900 Disable transformations and optimizations that assume default floating
5901 point rounding behavior.  This is round-to-zero for all floating point
5902 to integer conversions, and round-to-nearest for all other arithmetic
5903 truncations.  This option should be specified for programs that change
5904 the FP rounding mode dynamically, or that may be executed with a
5905 non-default rounding mode.  This option disables constant folding of
5906 floating point expressions at compile-time (which may be affected by
5907 rounding mode) and arithmetic transformations that are unsafe in the
5908 presence of sign-dependent rounding modes.
5909
5910 The default is @option{-fno-rounding-math}.
5911
5912 This option is experimental and does not currently guarantee to
5913 disable all GCC optimizations that are affected by rounding mode.
5914 Future versions of GCC may provide finer control of this setting
5915 using C99's @code{FENV_ACCESS} pragma.  This command line option
5916 will be used to specify the default state for @code{FENV_ACCESS}.
5917
5918 @item -frtl-abstract-sequences
5919 @opindex frtl-abstract-sequences
5920 It is a size optimization method. This option is to find identical
5921 sequences of code, which can be turned into pseudo-procedures  and
5922 then  replace  all  occurrences with  calls to  the  newly created
5923 subroutine. It is kind of an opposite of @option{-finline-functions}.
5924 This optimization runs at RTL level.
5925
5926 @item -fsignaling-nans
5927 @opindex fsignaling-nans
5928 Compile code assuming that IEEE signaling NaNs may generate user-visible
5929 traps during floating-point operations.  Setting this option disables
5930 optimizations that may change the number of exceptions visible with
5931 signaling NaNs.  This option implies @option{-ftrapping-math}.
5932
5933 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
5934 be defined.
5935
5936 The default is @option{-fno-signaling-nans}.
5937
5938 This option is experimental and does not currently guarantee to
5939 disable all GCC optimizations that affect signaling NaN behavior.
5940
5941 @item -fsingle-precision-constant
5942 @opindex fsingle-precision-constant
5943 Treat floating point constant as single precision constant instead of
5944 implicitly converting it to double precision constant.
5945
5946 @item -fcx-limited-range
5947 @itemx -fno-cx-limited-range
5948 @opindex fcx-limited-range
5949 @opindex fno-cx-limited-range
5950 When enabled, this option states that a range reduction step is not
5951 needed when performing complex division.  The default is
5952 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
5953
5954 This option controls the default setting of the ISO C99 
5955 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
5956 all languages.
5957
5958 @end table
5959
5960 The following options control optimizations that may improve
5961 performance, but are not enabled by any @option{-O} options.  This
5962 section includes experimental options that may produce broken code.
5963
5964 @table @gcctabopt
5965 @item -fbranch-probabilities
5966 @opindex fbranch-probabilities
5967 After running a program compiled with @option{-fprofile-arcs}
5968 (@pxref{Debugging Options,, Options for Debugging Your Program or
5969 @command{gcc}}), you can compile it a second time using
5970 @option{-fbranch-probabilities}, to improve optimizations based on
5971 the number of times each branch was taken.  When the program
5972 compiled with @option{-fprofile-arcs} exits it saves arc execution
5973 counts to a file called @file{@var{sourcename}.gcda} for each source
5974 file  The information in this data file is very dependent on the
5975 structure of the generated code, so you must use the same source code
5976 and the same optimization options for both compilations.
5977
5978 With @option{-fbranch-probabilities}, GCC puts a
5979 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
5980 These can be used to improve optimization.  Currently, they are only
5981 used in one place: in @file{reorg.c}, instead of guessing which path a
5982 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
5983 exactly determine which path is taken more often.
5984
5985 @item -fprofile-values
5986 @opindex fprofile-values
5987 If combined with @option{-fprofile-arcs}, it adds code so that some
5988 data about values of expressions in the program is gathered.
5989
5990 With @option{-fbranch-probabilities}, it reads back the data gathered
5991 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
5992 notes to instructions for their later usage in optimizations.
5993
5994 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
5995
5996 @item -fvpt
5997 @opindex fvpt
5998 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
5999 a code to gather information about values of expressions.
6000
6001 With @option{-fbranch-probabilities}, it reads back the data gathered
6002 and actually performs the optimizations based on them.
6003 Currently the optimizations include specialization of division operation
6004 using the knowledge about the value of the denominator.
6005
6006 @item -frename-registers
6007 @opindex frename-registers
6008 Attempt to avoid false dependencies in scheduled code by making use
6009 of registers left over after register allocation.  This optimization
6010 will most benefit processors with lots of registers.  Depending on the
6011 debug information format adopted by the target, however, it can
6012 make debugging impossible, since variables will no longer stay in
6013 a ``home register''.
6014
6015 Enabled by default with @option{-funroll-loops}.
6016
6017 @item -ftracer
6018 @opindex ftracer
6019 Perform tail duplication to enlarge superblock size.  This transformation
6020 simplifies the control flow of the function allowing other optimizations to do
6021 better job.
6022
6023 Enabled with @option{-fprofile-use}.
6024
6025 @item -funroll-loops
6026 @opindex funroll-loops
6027 Unroll loops whose number of iterations can be determined at compile time or
6028 upon entry to the loop.  @option{-funroll-loops} implies
6029 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}. 
6030 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6031 small constant number of iterations).  This option makes code larger, and may
6032 or may not make it run faster.
6033
6034 Enabled with @option{-fprofile-use}.
6035
6036 @item -funroll-all-loops
6037 @opindex funroll-all-loops
6038 Unroll all loops, even if their number of iterations is uncertain when
6039 the loop is entered.  This usually makes programs run more slowly.
6040 @option{-funroll-all-loops} implies the same options as
6041 @option{-funroll-loops}.
6042
6043 @item -fpeel-loops
6044 @opindex fpeel-loops
6045 Peels the loops for that there is enough information that they do not
6046 roll much (from profile feedback).  It also turns on complete loop peeling
6047 (i.e.@: complete removal of loops with small constant number of iterations).
6048
6049 Enabled with @option{-fprofile-use}.
6050
6051 @item -fmove-loop-invariants
6052 @opindex fmove-loop-invariants
6053 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6054 at level @option{-O1}
6055
6056 @item -funswitch-loops
6057 @opindex funswitch-loops
6058 Move branches with loop invariant conditions out of the loop, with duplicates
6059 of the loop on both branches (modified according to result of the condition).
6060
6061 @item -ffunction-sections
6062 @itemx -fdata-sections
6063 @opindex ffunction-sections
6064 @opindex fdata-sections
6065 Place each function or data item into its own section in the output
6066 file if the target supports arbitrary sections.  The name of the
6067 function or the name of the data item determines the section's name
6068 in the output file.
6069
6070 Use these options on systems where the linker can perform optimizations
6071 to improve locality of reference in the instruction space.  Most systems
6072 using the ELF object format and SPARC processors running Solaris 2 have
6073 linkers with such optimizations.  AIX may have these optimizations in
6074 the future.
6075
6076 Only use these options when there are significant benefits from doing
6077 so.  When you specify these options, the assembler and linker will
6078 create larger object and executable files and will also be slower.
6079 You will not be able to use @code{gprof} on all systems if you
6080 specify this option and you may have problems with debugging if
6081 you specify both this option and @option{-g}.
6082
6083 @item -fbranch-target-load-optimize
6084 @opindex fbranch-target-load-optimize
6085 Perform branch target register load optimization before prologue / epilogue
6086 threading.
6087 The use of target registers can typically be exposed only during reload,
6088 thus hoisting loads out of loops and doing inter-block scheduling needs
6089 a separate optimization pass.
6090
6091 @item -fbranch-target-load-optimize2
6092 @opindex fbranch-target-load-optimize2
6093 Perform branch target register load optimization after prologue / epilogue
6094 threading.
6095
6096 @item -fbtr-bb-exclusive
6097 @opindex fbtr-bb-exclusive
6098 When performing branch target register load optimization, don't reuse
6099 branch target registers in within any basic block.
6100
6101 @item -fstack-protector
6102 Emit extra code to check for buffer overflows, such as stack smashing
6103 attacks.  This is done by adding a guard variable to functions with
6104 vulnerable objects.  This includes functions that call alloca, and
6105 functions with buffers larger than 8 bytes.  The guards are initialized
6106 when a function is entered and then checked when the function exits.
6107 If a guard check fails, an error message is printed and the program exits.
6108
6109 @item -fstack-protector-all
6110 Like @option{-fstack-protector} except that all functions are protected.
6111
6112 @item -fsection-anchors
6113 @opindex fsection-anchors
6114 Try to reduce the number of symbolic address calculations by using
6115 shared ``anchor'' symbols to address nearby objects.  This transformation
6116 can help to reduce the number of GOT entries and GOT accesses on some
6117 targets.
6118
6119 For example, the implementation of the following function @code{foo}:
6120
6121 @smallexample
6122 static int a, b, c;
6123 int foo (void) @{ return a + b + c; @}
6124 @end smallexample
6125
6126 would usually calculate the addresses of all three variables, but if you
6127 compile it with @option{-fsection-anchors}, it will access the variables
6128 from a common anchor point instead.  The effect is similar to the
6129 following pseudocode (which isn't valid C):
6130
6131 @smallexample
6132 int foo (void)
6133 @{
6134   register int *xr = &x;
6135   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6136 @}
6137 @end smallexample
6138
6139 Not all targets support this option.
6140
6141 @item --param @var{name}=@var{value}
6142 @opindex param
6143 In some places, GCC uses various constants to control the amount of
6144 optimization that is done.  For example, GCC will not inline functions
6145 that contain more that a certain number of instructions.  You can
6146 control some of these constants on the command-line using the
6147 @option{--param} option.
6148
6149 The names of specific parameters, and the meaning of the values, are
6150 tied to the internals of the compiler, and are subject to change
6151 without notice in future releases.
6152
6153 In each case, the @var{value} is an integer.  The allowable choices for
6154 @var{name} are given in the following table:
6155
6156 @table @gcctabopt
6157 @item salias-max-implicit-fields
6158 The maximum number of fields in a variable without direct
6159 structure accesses for which structure aliasing will consider trying 
6160 to track each field.  The default is 5
6161
6162 @item salias-max-array-elements
6163 The maximum number of elements an array can have and its elements
6164 still be tracked individually by structure aliasing. The default is 4
6165
6166 @item sra-max-structure-size
6167 The maximum structure size, in bytes, at which the scalar replacement
6168 of aggregates (SRA) optimization will perform block copies.  The
6169 default value, 0, implies that GCC will select the most appropriate
6170 size itself.
6171
6172 @item sra-field-structure-ratio
6173 The threshold ratio (as a percentage) between instantiated fields and
6174 the complete structure size.  We say that if the ratio of the number
6175 of bytes in instantiated fields to the number of bytes in the complete
6176 structure exceeds this parameter, then block copies are not used.  The
6177 default is 75.
6178
6179 @item max-crossjump-edges
6180 The maximum number of incoming edges to consider for crossjumping.
6181 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6182 the number of edges incoming to each block.  Increasing values mean
6183 more aggressive optimization, making the compile time increase with
6184 probably small improvement in executable size.
6185
6186 @item min-crossjump-insns
6187 The minimum number of instructions which must be matched at the end
6188 of two blocks before crossjumping will be performed on them.  This
6189 value is ignored in the case where all instructions in the block being
6190 crossjumped from are matched.  The default value is 5.
6191
6192 @item max-grow-copy-bb-insns
6193 The maximum code size expansion factor when copying basic blocks
6194 instead of jumping.  The expansion is relative to a jump instruction.
6195 The default value is 8.
6196
6197 @item max-goto-duplication-insns
6198 The maximum number of instructions to duplicate to a block that jumps
6199 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6200 passes, GCC factors computed gotos early in the compilation process,
6201 and unfactors them as late as possible.  Only computed jumps at the
6202 end of a basic blocks with no more than max-goto-duplication-insns are
6203 unfactored.  The default value is 8.
6204
6205 @item max-delay-slot-insn-search
6206 The maximum number of instructions to consider when looking for an
6207 instruction to fill a delay slot.  If more than this arbitrary number of
6208 instructions is searched, the time savings from filling the delay slot
6209 will be minimal so stop searching.  Increasing values mean more
6210 aggressive optimization, making the compile time increase with probably
6211 small improvement in executable run time.
6212
6213 @item max-delay-slot-live-search
6214 When trying to fill delay slots, the maximum number of instructions to
6215 consider when searching for a block with valid live register
6216 information.  Increasing this arbitrarily chosen value means more
6217 aggressive optimization, increasing the compile time.  This parameter
6218 should be removed when the delay slot code is rewritten to maintain the
6219 control-flow graph.
6220
6221 @item max-gcse-memory
6222 The approximate maximum amount of memory that will be allocated in
6223 order to perform the global common subexpression elimination
6224 optimization.  If more memory than specified is required, the
6225 optimization will not be done.
6226
6227 @item max-gcse-passes
6228 The maximum number of passes of GCSE to run.  The default is 1.
6229
6230 @item max-pending-list-length
6231 The maximum number of pending dependencies scheduling will allow
6232 before flushing the current state and starting over.  Large functions
6233 with few branches or calls can create excessively large lists which
6234 needlessly consume memory and resources.
6235
6236 @item max-inline-insns-single
6237 Several parameters control the tree inliner used in gcc.
6238 This number sets the maximum number of instructions (counted in GCC's
6239 internal representation) in a single function that the tree inliner
6240 will consider for inlining.  This only affects functions declared
6241 inline and methods implemented in a class declaration (C++).
6242 The default value is 450.
6243
6244 @item max-inline-insns-auto
6245 When you use @option{-finline-functions} (included in @option{-O3}),
6246 a lot of functions that would otherwise not be considered for inlining
6247 by the compiler will be investigated.  To those functions, a different
6248 (more restrictive) limit compared to functions declared inline can
6249 be applied.
6250 The default value is 90.
6251
6252 @item large-function-insns
6253 The limit specifying really large functions.  For functions larger than this
6254 limit after inlining inlining is constrained by
6255 @option{--param large-function-growth}.  This parameter is useful primarily
6256 to avoid extreme compilation time caused by non-linear algorithms used by the
6257 backend.
6258 This parameter is ignored when @option{-funit-at-a-time} is not used.
6259 The default value is 2700.
6260
6261 @item large-function-growth
6262 Specifies maximal growth of large function caused by inlining in percents.
6263 This parameter is ignored when @option{-funit-at-a-time} is not used.
6264 The default value is 100 which limits large function growth to 2.0 times
6265 the original size.
6266
6267 @item large-unit-insns
6268 The limit specifying large translation unit.  Growth caused by inlining of
6269 units larger than this limit is limited by @option{--param inline-unit-growth}.
6270 For small units this might be too tight (consider unit consisting of function A
6271 that is inline and B that just calls A three time.  If B is small relative to
6272 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6273 large units consisting of small inlininable functions however the overall unit
6274 growth limit is needed to avoid exponential explosion of code size.  Thus for
6275 smaller units, the size is increased to @option{--param large-unit-insns}
6276 before applying @option{--param inline-unit-growth}.  The default is 10000
6277
6278 @item inline-unit-growth
6279 Specifies maximal overall growth of the compilation unit caused by inlining.
6280 This parameter is ignored when @option{-funit-at-a-time} is not used.
6281 The default value is 50 which limits unit growth to 1.5 times the original
6282 size.
6283
6284 @item max-inline-insns-recursive
6285 @itemx max-inline-insns-recursive-auto
6286 Specifies maximum number of instructions out-of-line copy of self recursive inline
6287 function can grow into by performing recursive inlining.
6288
6289 For functions declared inline @option{--param max-inline-insns-recursive} is
6290 taken into account.  For function not declared inline, recursive inlining
6291 happens only when @option{-finline-functions} (included in @option{-O3}) is
6292 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6293 default value is 450.
6294
6295 @item max-inline-recursive-depth
6296 @itemx max-inline-recursive-depth-auto
6297 Specifies maximum recursion depth used by the recursive inlining.
6298
6299 For functions declared inline @option{--param max-inline-recursive-depth} is
6300 taken into account.  For function not declared inline, recursive inlining
6301 happens only when @option{-finline-functions} (included in @option{-O3}) is
6302 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6303 default value is 450.
6304
6305 @item min-inline-recursive-probability
6306 Recursive inlining is profitable only for function having deep recursion
6307 in average and can hurt for function having little recursion depth by
6308 increasing the prologue size or complexity of function body to other
6309 optimizers.
6310
6311 When profile feedback is available (see @option{-fprofile-generate}) the actual
6312 recursion depth can be guessed from probability that function will recurse via
6313 given call expression.  This parameter limits inlining only to call expression
6314 whose probability exceeds given threshold (in percents).  The default value is
6315 10.
6316
6317 @item inline-call-cost
6318 Specify cost of call instruction relative to simple arithmetics operations
6319 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6320 functions and at the same time increases size of leaf function that is believed to
6321 reduce function size by being inlined.  In effect it increases amount of
6322 inlining for code having large abstraction penalty (many functions that just
6323 pass the arguments to other functions) and decrease inlining for code with low
6324 abstraction penalty.  The default value is 16.
6325
6326 @item max-unrolled-insns
6327 The maximum number of instructions that a loop should have if that loop
6328 is unrolled, and if the loop is unrolled, it determines how many times
6329 the loop code is unrolled.
6330
6331 @item max-average-unrolled-insns
6332 The maximum number of instructions biased by probabilities of their execution
6333 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6334 it determines how many times the loop code is unrolled.
6335
6336 @item max-unroll-times
6337 The maximum number of unrollings of a single loop.
6338
6339 @item max-peeled-insns
6340 The maximum number of instructions that a loop should have if that loop
6341 is peeled, and if the loop is peeled, it determines how many times
6342 the loop code is peeled.
6343
6344 @item max-peel-times
6345 The maximum number of peelings of a single loop.
6346
6347 @item max-completely-peeled-insns
6348 The maximum number of insns of a completely peeled loop.
6349
6350 @item max-completely-peel-times
6351 The maximum number of iterations of a loop to be suitable for complete peeling.
6352
6353 @item max-unswitch-insns
6354 The maximum number of insns of an unswitched loop.
6355
6356 @item max-unswitch-level
6357 The maximum number of branches unswitched in a single loop.
6358
6359 @item lim-expensive
6360 The minimum cost of an expensive expression in the loop invariant motion.
6361
6362 @item iv-consider-all-candidates-bound
6363 Bound on number of candidates for induction variables below that
6364 all candidates are considered for each use in induction variable
6365 optimizations.  Only the most relevant candidates are considered
6366 if there are more candidates, to avoid quadratic time complexity.
6367
6368 @item iv-max-considered-uses
6369 The induction variable optimizations give up on loops that contain more
6370 induction variable uses.
6371
6372 @item iv-always-prune-cand-set-bound
6373 If number of candidates in the set is smaller than this value,
6374 we always try to remove unnecessary ivs from the set during its
6375 optimization when a new iv is added to the set.
6376
6377 @item scev-max-expr-size
6378 Bound on size of expressions used in the scalar evolutions analyzer.
6379 Large expressions slow the analyzer.
6380
6381 @item vect-max-version-checks
6382 The maximum number of runtime checks that can be performed when doing
6383 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6384 for more information.
6385
6386 @item max-iterations-to-track
6387
6388 The maximum number of iterations of a loop the brute force algorithm
6389 for analysis of # of iterations of the loop tries to evaluate.
6390
6391 @item hot-bb-count-fraction
6392 Select fraction of the maximal count of repetitions of basic block in program
6393 given basic block needs to have to be considered hot.
6394
6395 @item hot-bb-frequency-fraction
6396 Select fraction of the maximal frequency of executions of basic block in
6397 function given basic block needs to have to be considered hot
6398
6399 @item max-predicted-iterations
6400 The maximum number of loop iterations we predict statically.  This is useful
6401 in cases where function contain single loop with known bound and other loop
6402 with unknown.  We predict the known number of iterations correctly, while
6403 the unknown number of iterations average to roughly 10.  This means that the
6404 loop without bounds would appear artificially cold relative to the other one.
6405
6406 @item tracer-dynamic-coverage
6407 @itemx tracer-dynamic-coverage-feedback
6408
6409 This value is used to limit superblock formation once the given percentage of
6410 executed instructions is covered.  This limits unnecessary code size
6411 expansion.
6412
6413 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6414 feedback is available.  The real profiles (as opposed to statically estimated
6415 ones) are much less balanced allowing the threshold to be larger value.
6416
6417 @item tracer-max-code-growth
6418 Stop tail duplication once code growth has reached given percentage.  This is
6419 rather hokey argument, as most of the duplicates will be eliminated later in
6420 cross jumping, so it may be set to much higher values than is the desired code
6421 growth.
6422
6423 @item tracer-min-branch-ratio
6424
6425 Stop reverse growth when the reverse probability of best edge is less than this
6426 threshold (in percent).
6427
6428 @item tracer-min-branch-ratio
6429 @itemx tracer-min-branch-ratio-feedback
6430
6431 Stop forward growth if the best edge do have probability lower than this
6432 threshold.
6433
6434 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6435 compilation for profile feedback and one for compilation without.  The value
6436 for compilation with profile feedback needs to be more conservative (higher) in
6437 order to make tracer effective.
6438
6439 @item max-cse-path-length
6440
6441 Maximum number of basic blocks on path that cse considers.  The default is 10.
6442
6443 @item max-cse-insns
6444 The maximum instructions CSE process before flushing. The default is 1000.
6445
6446 @item global-var-threshold
6447
6448 Counts the number of function calls (@var{n}) and the number of
6449 call-clobbered variables (@var{v}).  If @var{n}x@var{v} is larger than this limit, a
6450 single artificial variable will be created to represent all the
6451 call-clobbered variables at function call sites.  This artificial
6452 variable will then be made to alias every call-clobbered variable.
6453 (done as @code{int * size_t} on the host machine; beware overflow).
6454
6455 @item max-aliased-vops
6456
6457 Maximum number of virtual operands allowed to represent aliases
6458 before triggering the alias grouping heuristic.  Alias grouping
6459 reduces compile times and memory consumption needed for aliasing at
6460 the expense of precision loss in alias information.
6461
6462 @item ggc-min-expand
6463
6464 GCC uses a garbage collector to manage its own memory allocation.  This
6465 parameter specifies the minimum percentage by which the garbage
6466 collector's heap should be allowed to expand between collections.
6467 Tuning this may improve compilation speed; it has no effect on code
6468 generation.
6469
6470 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6471 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6472 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6473 GCC is not able to calculate RAM on a particular platform, the lower
6474 bound of 30% is used.  Setting this parameter and
6475 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6476 every opportunity.  This is extremely slow, but can be useful for
6477 debugging.
6478
6479 @item ggc-min-heapsize
6480
6481 Minimum size of the garbage collector's heap before it begins bothering
6482 to collect garbage.  The first collection occurs after the heap expands
6483 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6484 tuning this may improve compilation speed, and has no effect on code
6485 generation.
6486
6487 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6488 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6489 with a lower bound of 4096 (four megabytes) and an upper bound of
6490 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6491 particular platform, the lower bound is used.  Setting this parameter
6492 very large effectively disables garbage collection.  Setting this
6493 parameter and @option{ggc-min-expand} to zero causes a full collection
6494 to occur at every opportunity.
6495
6496 @item max-reload-search-insns
6497 The maximum number of instruction reload should look backward for equivalent
6498 register.  Increasing values mean more aggressive optimization, making the
6499 compile time increase with probably slightly better performance.  The default
6500 value is 100.
6501
6502 @item max-cselib-memory-locations
6503 The maximum number of memory locations cselib should take into account.
6504 Increasing values mean more aggressive optimization, making the compile time
6505 increase with probably slightly better performance.  The default value is 500.
6506
6507 @item max-flow-memory-locations
6508 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6509 The default value is 100.
6510
6511 @item reorder-blocks-duplicate
6512 @itemx reorder-blocks-duplicate-feedback
6513
6514 Used by basic block reordering pass to decide whether to use unconditional
6515 branch or duplicate the code on its destination.  Code is duplicated when its
6516 estimated size is smaller than this value multiplied by the estimated size of
6517 unconditional jump in the hot spots of the program.
6518
6519 The @option{reorder-block-duplicate-feedback} is used only when profile
6520 feedback is available and may be set to higher values than
6521 @option{reorder-block-duplicate} since information about the hot spots is more
6522 accurate.
6523
6524 @item max-sched-ready-insns
6525 The maximum number of instructions ready to be issued the scheduler should
6526 consider at any given time during the first scheduling pass.  Increasing
6527 values mean more thorough searches, making the compilation time increase
6528 with probably little benefit.  The default value is 100.
6529
6530 @item max-sched-region-blocks
6531 The maximum number of blocks in a region to be considered for
6532 interblock scheduling.  The default value is 10.
6533
6534 @item max-sched-region-insns
6535 The maximum number of insns in a region to be considered for
6536 interblock scheduling.  The default value is 100.
6537
6538 @item min-spec-prob
6539 The minimum probability (in percents) of reaching a source block
6540 for interblock speculative scheduling.  The default value is 40.
6541
6542 @item max-sched-extend-regions-iters
6543 The maximum number of iterations through CFG to extend regions.
6544 0 - disable region extension,
6545 N - do at most N iterations.
6546 The default value is 0.
6547
6548 @item max-sched-insn-conflict-delay
6549 The maximum conflict delay for an insn to be considered for speculative motion.
6550 The default value is 3.
6551
6552 @item sched-spec-prob-cutoff
6553 The minimal probability of speculation success (in percents), so that
6554 speculative insn will be scheduled.
6555 The default value is 40.
6556
6557 @item max-last-value-rtl
6558
6559 The maximum size measured as number of RTLs that can be recorded in an expression
6560 in combiner for a pseudo register as last known value of that register.  The default
6561 is 10000.
6562
6563 @item integer-share-limit
6564 Small integer constants can use a shared data structure, reducing the
6565 compiler's memory usage and increasing its speed.  This sets the maximum
6566 value of a shared integer constant's.  The default value is 256.
6567
6568 @item min-virtual-mappings
6569 Specifies the minimum number of virtual mappings in the incremental
6570 SSA updater that should be registered to trigger the virtual mappings
6571 heuristic defined by virtual-mappings-ratio.  The default value is
6572 100.
6573
6574 @item virtual-mappings-ratio
6575 If the number of virtual mappings is virtual-mappings-ratio bigger
6576 than the number of virtual symbols to be updated, then the incremental
6577 SSA updater switches to a full update for those symbols.  The default
6578 ratio is 3.
6579
6580 @item ssp-buffer-size
6581 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6582 protection when @option{-fstack-protection} is used.
6583
6584 @item max-jump-thread-duplication-stmts
6585 Maximum number of statements allowed in a block that needs to be
6586 duplicated when threading jumps.
6587
6588 @item max-fields-for-field-sensitive
6589 Maximum number of fields in a structure we will treat in
6590 a field sensitive manner during pointer analysis.
6591
6592 @end table
6593 @end table
6594
6595 @node Preprocessor Options
6596 @section Options Controlling the Preprocessor
6597 @cindex preprocessor options
6598 @cindex options, preprocessor
6599
6600 These options control the C preprocessor, which is run on each C source
6601 file before actual compilation.
6602
6603 If you use the @option{-E} option, nothing is done except preprocessing.
6604 Some of these options make sense only together with @option{-E} because
6605 they cause the preprocessor output to be unsuitable for actual
6606 compilation.
6607
6608 @table @gcctabopt
6609 @opindex Wp
6610 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6611 and pass @var{option} directly through to the preprocessor.  If
6612 @var{option} contains commas, it is split into multiple options at the
6613 commas.  However, many options are modified, translated or interpreted
6614 by the compiler driver before being passed to the preprocessor, and
6615 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6616 interface is undocumented and subject to change, so whenever possible
6617 you should avoid using @option{-Wp} and let the driver handle the
6618 options instead.
6619
6620 @item -Xpreprocessor @var{option}
6621 @opindex preprocessor
6622 Pass @var{option} as an option to the preprocessor.  You can use this to
6623 supply system-specific preprocessor options which GCC does not know how to
6624 recognize.
6625
6626 If you want to pass an option that takes an argument, you must use
6627 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6628 @end table
6629
6630 @include cppopts.texi
6631
6632 @node Assembler Options
6633 @section Passing Options to the Assembler
6634
6635 @c prevent bad page break with this line
6636 You can pass options to the assembler.
6637
6638 @table @gcctabopt
6639 @item -Wa,@var{option}
6640 @opindex Wa
6641 Pass @var{option} as an option to the assembler.  If @var{option}
6642 contains commas, it is split into multiple options at the commas.
6643
6644 @item -Xassembler @var{option}
6645 @opindex Xassembler
6646 Pass @var{option} as an option to the assembler.  You can use this to
6647 supply system-specific assembler options which GCC does not know how to
6648 recognize.
6649
6650 If you want to pass an option that takes an argument, you must use
6651 @option{-Xassembler} twice, once for the option and once for the argument.
6652
6653 @end table
6654
6655 @node Link Options
6656 @section Options for Linking
6657 @cindex link options
6658 @cindex options, linking
6659
6660 These options come into play when the compiler links object files into
6661 an executable output file.  They are meaningless if the compiler is
6662 not doing a link step.
6663
6664 @table @gcctabopt
6665 @cindex file names
6666 @item @var{object-file-name}
6667 A file name that does not end in a special recognized suffix is
6668 considered to name an object file or library.  (Object files are
6669 distinguished from libraries by the linker according to the file
6670 contents.)  If linking is done, these object files are used as input
6671 to the linker.
6672
6673 @item -c
6674 @itemx -S
6675 @itemx -E
6676 @opindex c
6677 @opindex S
6678 @opindex E
6679 If any of these options is used, then the linker is not run, and
6680 object file names should not be used as arguments.  @xref{Overall
6681 Options}.
6682
6683 @cindex Libraries
6684 @item -l@var{library}
6685 @itemx -l @var{library}
6686 @opindex l
6687 Search the library named @var{library} when linking.  (The second
6688 alternative with the library as a separate argument is only for
6689 POSIX compliance and is not recommended.)
6690
6691 It makes a difference where in the command you write this option; the
6692 linker searches and processes libraries and object files in the order they
6693 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6694 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6695 to functions in @samp{z}, those functions may not be loaded.
6696
6697 The linker searches a standard list of directories for the library,
6698 which is actually a file named @file{lib@var{library}.a}.  The linker
6699 then uses this file as if it had been specified precisely by name.
6700
6701 The directories searched include several standard system directories
6702 plus any that you specify with @option{-L}.
6703
6704 Normally the files found this way are library files---archive files
6705 whose members are object files.  The linker handles an archive file by
6706 scanning through it for members which define symbols that have so far
6707 been referenced but not defined.  But if the file that is found is an
6708 ordinary object file, it is linked in the usual fashion.  The only
6709 difference between using an @option{-l} option and specifying a file name
6710 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6711 and searches several directories.
6712
6713 @item -lobjc
6714 @opindex lobjc
6715 You need this special case of the @option{-l} option in order to
6716 link an Objective-C or Objective-C++ program.
6717
6718 @item -nostartfiles
6719 @opindex nostartfiles
6720 Do not use the standard system startup files when linking.
6721 The standard system libraries are used normally, unless @option{-nostdlib}
6722 or @option{-nodefaultlibs} is used.
6723
6724 @item -nodefaultlibs
6725 @opindex nodefaultlibs
6726 Do not use the standard system libraries when linking.
6727 Only the libraries you specify will be passed to the linker.
6728 The standard startup files are used normally, unless @option{-nostartfiles}
6729 is used.  The compiler may generate calls to @code{memcmp},
6730 @code{memset}, @code{memcpy} and @code{memmove}.
6731 These entries are usually resolved by entries in
6732 libc.  These entry points should be supplied through some other
6733 mechanism when this option is specified.
6734
6735 @item -nostdlib
6736 @opindex nostdlib
6737 Do not use the standard system startup files or libraries when linking.
6738 No startup files and only the libraries you specify will be passed to
6739 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6740 @code{memcpy} and @code{memmove}.
6741 These entries are usually resolved by entries in
6742 libc.  These entry points should be supplied through some other
6743 mechanism when this option is specified.
6744
6745 @cindex @option{-lgcc}, use with @option{-nostdlib}
6746 @cindex @option{-nostdlib} and unresolved references
6747 @cindex unresolved references and @option{-nostdlib}
6748 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6749 @cindex @option{-nodefaultlibs} and unresolved references
6750 @cindex unresolved references and @option{-nodefaultlibs}
6751 One of the standard libraries bypassed by @option{-nostdlib} and
6752 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6753 that GCC uses to overcome shortcomings of particular machines, or special
6754 needs for some languages.
6755 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6756 Collection (GCC) Internals},
6757 for more discussion of @file{libgcc.a}.)
6758 In most cases, you need @file{libgcc.a} even when you want to avoid
6759 other standard libraries.  In other words, when you specify @option{-nostdlib}
6760 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6761 This ensures that you have no unresolved references to internal GCC
6762 library subroutines.  (For example, @samp{__main}, used to ensure C++
6763 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6764 GNU Compiler Collection (GCC) Internals}.)
6765
6766 @item -pie
6767 @opindex pie
6768 Produce a position independent executable on targets which support it.
6769 For predictable results, you must also specify the same set of options
6770 that were used to generate code (@option{-fpie}, @option{-fPIE},
6771 or model suboptions) when you specify this option.
6772
6773 @item -rdynamic
6774 @opindex rdynamic
6775 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6776 that support it. This instructs the linker to add all symbols, not
6777 only used ones, to the dynamic symbol table. This option is needed
6778 for some uses of @code{dlopen} or to allow obtaining backtraces
6779 from within a program.
6780
6781 @item -s
6782 @opindex s
6783 Remove all symbol table and relocation information from the executable.
6784
6785 @item -static
6786 @opindex static
6787 On systems that support dynamic linking, this prevents linking with the shared
6788 libraries.  On other systems, this option has no effect.
6789
6790 @item -shared
6791 @opindex shared
6792 Produce a shared object which can then be linked with other objects to
6793 form an executable.  Not all systems support this option.  For predictable
6794 results, you must also specify the same set of options that were used to
6795 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6796 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6797 needs to build supplementary stub code for constructors to work.  On
6798 multi-libbed systems, @samp{gcc -shared} must select the correct support
6799 libraries to link against.  Failing to supply the correct flags may lead
6800 to subtle defects.  Supplying them in cases where they are not necessary
6801 is innocuous.}
6802
6803 @item -shared-libgcc
6804 @itemx -static-libgcc
6805 @opindex shared-libgcc
6806 @opindex static-libgcc
6807 On systems that provide @file{libgcc} as a shared library, these options
6808 force the use of either the shared or static version respectively.
6809 If no shared version of @file{libgcc} was built when the compiler was
6810 configured, these options have no effect.
6811
6812 There are several situations in which an application should use the
6813 shared @file{libgcc} instead of the static version.  The most common
6814 of these is when the application wishes to throw and catch exceptions
6815 across different shared libraries.  In that case, each of the libraries
6816 as well as the application itself should use the shared @file{libgcc}.
6817
6818 Therefore, the G++ and GCJ drivers automatically add
6819 @option{-shared-libgcc} whenever you build a shared library or a main
6820 executable, because C++ and Java programs typically use exceptions, so
6821 this is the right thing to do.
6822
6823 If, instead, you use the GCC driver to create shared libraries, you may
6824 find that they will not always be linked with the shared @file{libgcc}.
6825 If GCC finds, at its configuration time, that you have a non-GNU linker
6826 or a GNU linker that does not support option @option{--eh-frame-hdr},
6827 it will link the shared version of @file{libgcc} into shared libraries
6828 by default.  Otherwise, it will take advantage of the linker and optimize
6829 away the linking with the shared version of @file{libgcc}, linking with
6830 the static version of libgcc by default.  This allows exceptions to
6831 propagate through such shared libraries, without incurring relocation
6832 costs at library load time.
6833
6834 However, if a library or main executable is supposed to throw or catch
6835 exceptions, you must link it using the G++ or GCJ driver, as appropriate
6836 for the languages used in the program, or using the option
6837 @option{-shared-libgcc}, such that it is linked with the shared
6838 @file{libgcc}.
6839
6840 @item -symbolic
6841 @opindex symbolic
6842 Bind references to global symbols when building a shared object.  Warn
6843 about any unresolved references (unless overridden by the link editor
6844 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
6845 this option.
6846
6847 @item -Xlinker @var{option}
6848 @opindex Xlinker
6849 Pass @var{option} as an option to the linker.  You can use this to
6850 supply system-specific linker options which GCC does not know how to
6851 recognize.
6852
6853 If you want to pass an option that takes an argument, you must use
6854 @option{-Xlinker} twice, once for the option and once for the argument.
6855 For example, to pass @option{-assert definitions}, you must write
6856 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
6857 @option{-Xlinker "-assert definitions"}, because this passes the entire
6858 string as a single argument, which is not what the linker expects.
6859
6860 @item -Wl,@var{option}
6861 @opindex Wl
6862 Pass @var{option} as an option to the linker.  If @var{option} contains
6863 commas, it is split into multiple options at the commas.
6864
6865 @item -u @var{symbol}
6866 @opindex u
6867 Pretend the symbol @var{symbol} is undefined, to force linking of
6868 library modules to define it.  You can use @option{-u} multiple times with
6869 different symbols to force loading of additional library modules.
6870 @end table
6871
6872 @node Directory Options
6873 @section Options for Directory Search
6874 @cindex directory options
6875 @cindex options, directory search
6876 @cindex search path
6877
6878 These options specify directories to search for header files, for
6879 libraries and for parts of the compiler:
6880
6881 @table @gcctabopt
6882 @item -I@var{dir}
6883 @opindex I
6884 Add the directory @var{dir} to the head of the list of directories to be
6885 searched for header files.  This can be used to override a system header
6886 file, substituting your own version, since these directories are
6887 searched before the system header file directories.  However, you should
6888 not use this option to add directories that contain vendor-supplied
6889 system header files (use @option{-isystem} for that).  If you use more than
6890 one @option{-I} option, the directories are scanned in left-to-right
6891 order; the standard system directories come after.
6892
6893 If a standard system include directory, or a directory specified with
6894 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
6895 option will be ignored.  The directory will still be searched but as a
6896 system directory at its normal position in the system include chain.
6897 This is to ensure that GCC's procedure to fix buggy system headers and
6898 the ordering for the include_next directive are not inadvertently changed.
6899 If you really need to change the search order for system directories,
6900 use the @option{-nostdinc} and/or @option{-isystem} options.
6901
6902 @item -iquote@var{dir}
6903 @opindex iquote
6904 Add the directory @var{dir} to the head of the list of directories to
6905 be searched for header files only for the case of @samp{#include
6906 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
6907 otherwise just like @option{-I}.
6908
6909 @item -L@var{dir}
6910 @opindex L
6911 Add directory @var{dir} to the list of directories to be searched
6912 for @option{-l}.
6913
6914 @item -B@var{prefix}
6915 @opindex B
6916 This option specifies where to find the executables, libraries,
6917 include files, and data files of the compiler itself.
6918
6919 The compiler driver program runs one or more of the subprograms
6920 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
6921 @var{prefix} as a prefix for each program it tries to run, both with and
6922 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
6923
6924 For each subprogram to be run, the compiler driver first tries the
6925 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
6926 was not specified, the driver tries two standard prefixes, which are
6927 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
6928 those results in a file name that is found, the unmodified program
6929 name is searched for using the directories specified in your
6930 @env{PATH} environment variable.
6931
6932 The compiler will check to see if the path provided by the @option{-B}
6933 refers to a directory, and if necessary it will add a directory
6934 separator character at the end of the path.
6935
6936 @option{-B} prefixes that effectively specify directory names also apply
6937 to libraries in the linker, because the compiler translates these
6938 options into @option{-L} options for the linker.  They also apply to
6939 includes files in the preprocessor, because the compiler translates these
6940 options into @option{-isystem} options for the preprocessor.  In this case,
6941 the compiler appends @samp{include} to the prefix.
6942
6943 The run-time support file @file{libgcc.a} can also be searched for using
6944 the @option{-B} prefix, if needed.  If it is not found there, the two
6945 standard prefixes above are tried, and that is all.  The file is left
6946 out of the link if it is not found by those means.
6947
6948 Another way to specify a prefix much like the @option{-B} prefix is to use
6949 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
6950 Variables}.
6951
6952 As a special kludge, if the path provided by @option{-B} is
6953 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
6954 9, then it will be replaced by @file{[dir/]include}.  This is to help
6955 with boot-strapping the compiler.
6956
6957 @item -specs=@var{file}
6958 @opindex specs
6959 Process @var{file} after the compiler reads in the standard @file{specs}
6960 file, in order to override the defaults that the @file{gcc} driver
6961 program uses when determining what switches to pass to @file{cc1},
6962 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
6963 @option{-specs=@var{file}} can be specified on the command line, and they
6964 are processed in order, from left to right.
6965
6966 @item --sysroot=@var{dir}
6967 @opindex sysroot
6968 Use @var{dir} as the logical root directory for headers and libraries.
6969 For example, if the compiler would normally search for headers in
6970 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
6971 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.  
6972
6973 If you use both this option and the @option{-isysroot} option, then
6974 the @option{--sysroot} option will apply to libraries, but the
6975 @option{-isysroot} option will apply to header files.
6976
6977 The GNU linker (beginning with version 2.16) has the necessary support
6978 for this option.  If your linker does not support this option, the
6979 header file aspect of @option{--sysroot} will still work, but the
6980 library aspect will not.
6981
6982 @item -I-
6983 @opindex I-
6984 This option has been deprecated.  Please use @option{-iquote} instead for
6985 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
6986 Any directories you specify with @option{-I} options before the @option{-I-}
6987 option are searched only for the case of @samp{#include "@var{file}"};
6988 they are not searched for @samp{#include <@var{file}>}.
6989
6990 If additional directories are specified with @option{-I} options after
6991 the @option{-I-}, these directories are searched for all @samp{#include}
6992 directives.  (Ordinarily @emph{all} @option{-I} directories are used
6993 this way.)
6994
6995 In addition, the @option{-I-} option inhibits the use of the current
6996 directory (where the current input file came from) as the first search
6997 directory for @samp{#include "@var{file}"}.  There is no way to
6998 override this effect of @option{-I-}.  With @option{-I.} you can specify
6999 searching the directory which was current when the compiler was
7000 invoked.  That is not exactly the same as what the preprocessor does
7001 by default, but it is often satisfactory.
7002
7003 @option{-I-} does not inhibit the use of the standard system directories
7004 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7005 independent.
7006 @end table
7007
7008 @c man end
7009
7010 @node Spec Files
7011 @section Specifying subprocesses and the switches to pass to them
7012 @cindex Spec Files
7013
7014 @command{gcc} is a driver program.  It performs its job by invoking a
7015 sequence of other programs to do the work of compiling, assembling and
7016 linking.  GCC interprets its command-line parameters and uses these to
7017 deduce which programs it should invoke, and which command-line options
7018 it ought to place on their command lines.  This behavior is controlled
7019 by @dfn{spec strings}.  In most cases there is one spec string for each
7020 program that GCC can invoke, but a few programs have multiple spec
7021 strings to control their behavior.  The spec strings built into GCC can
7022 be overridden by using the @option{-specs=} command-line switch to specify
7023 a spec file.
7024
7025 @dfn{Spec files} are plaintext files that are used to construct spec
7026 strings.  They consist of a sequence of directives separated by blank
7027 lines.  The type of directive is determined by the first non-whitespace
7028 character on the line and it can be one of the following:
7029
7030 @table @code
7031 @item %@var{command}
7032 Issues a @var{command} to the spec file processor.  The commands that can
7033 appear here are:
7034
7035 @table @code
7036 @item %include <@var{file}>
7037 @cindex %include
7038 Search for @var{file} and insert its text at the current point in the
7039 specs file.
7040
7041 @item %include_noerr <@var{file}>
7042 @cindex %include_noerr
7043 Just like @samp{%include}, but do not generate an error message if the include
7044 file cannot be found.
7045
7046 @item %rename @var{old_name} @var{new_name}
7047 @cindex %rename
7048 Rename the spec string @var{old_name} to @var{new_name}.
7049
7050 @end table
7051
7052 @item *[@var{spec_name}]:
7053 This tells the compiler to create, override or delete the named spec
7054 string.  All lines after this directive up to the next directive or
7055 blank line are considered to be the text for the spec string.  If this
7056 results in an empty string then the spec will be deleted.  (Or, if the
7057 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7058 does not currently exist a new spec will be created.  If the spec does
7059 exist then its contents will be overridden by the text of this
7060 directive, unless the first character of that text is the @samp{+}
7061 character, in which case the text will be appended to the spec.
7062
7063 @item [@var{suffix}]:
7064 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7065 and up to the next directive or blank line are considered to make up the
7066 spec string for the indicated suffix.  When the compiler encounters an
7067 input file with the named suffix, it will processes the spec string in
7068 order to work out how to compile that file.  For example:
7069
7070 @smallexample
7071 .ZZ:
7072 z-compile -input %i
7073 @end smallexample
7074
7075 This says that any input file whose name ends in @samp{.ZZ} should be
7076 passed to the program @samp{z-compile}, which should be invoked with the
7077 command-line switch @option{-input} and with the result of performing the
7078 @samp{%i} substitution.  (See below.)
7079
7080 As an alternative to providing a spec string, the text that follows a
7081 suffix directive can be one of the following:
7082
7083 @table @code
7084 @item @@@var{language}
7085 This says that the suffix is an alias for a known @var{language}.  This is
7086 similar to using the @option{-x} command-line switch to GCC to specify a
7087 language explicitly.  For example:
7088
7089 @smallexample
7090 .ZZ:
7091 @@c++
7092 @end smallexample
7093
7094 Says that .ZZ files are, in fact, C++ source files.
7095
7096 @item #@var{name}
7097 This causes an error messages saying:
7098
7099 @smallexample
7100 @var{name} compiler not installed on this system.
7101 @end smallexample
7102 @end table
7103
7104 GCC already has an extensive list of suffixes built into it.
7105 This directive will add an entry to the end of the list of suffixes, but
7106 since the list is searched from the end backwards, it is effectively
7107 possible to override earlier entries using this technique.
7108
7109 @end table
7110
7111 GCC has the following spec strings built into it.  Spec files can
7112 override these strings or create their own.  Note that individual
7113 targets can also add their own spec strings to this list.
7114
7115 @smallexample
7116 asm          Options to pass to the assembler
7117 asm_final    Options to pass to the assembler post-processor
7118 cpp          Options to pass to the C preprocessor
7119 cc1          Options to pass to the C compiler
7120 cc1plus      Options to pass to the C++ compiler
7121 endfile      Object files to include at the end of the link
7122 link         Options to pass to the linker
7123 lib          Libraries to include on the command line to the linker
7124 libgcc       Decides which GCC support library to pass to the linker
7125 linker       Sets the name of the linker
7126 predefines   Defines to be passed to the C preprocessor
7127 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7128              by default
7129 startfile    Object files to include at the start of the link
7130 @end smallexample
7131
7132 Here is a small example of a spec file:
7133
7134 @smallexample
7135 %rename lib                 old_lib
7136
7137 *lib:
7138 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7139 @end smallexample
7140
7141 This example renames the spec called @samp{lib} to @samp{old_lib} and
7142 then overrides the previous definition of @samp{lib} with a new one.
7143 The new definition adds in some extra command-line options before
7144 including the text of the old definition.
7145
7146 @dfn{Spec strings} are a list of command-line options to be passed to their
7147 corresponding program.  In addition, the spec strings can contain
7148 @samp{%}-prefixed sequences to substitute variable text or to
7149 conditionally insert text into the command line.  Using these constructs
7150 it is possible to generate quite complex command lines.
7151
7152 Here is a table of all defined @samp{%}-sequences for spec
7153 strings.  Note that spaces are not generated automatically around the
7154 results of expanding these sequences.  Therefore you can concatenate them
7155 together or combine them with constant text in a single argument.
7156
7157 @table @code
7158 @item %%
7159 Substitute one @samp{%} into the program name or argument.
7160
7161 @item %i
7162 Substitute the name of the input file being processed.
7163
7164 @item %b
7165 Substitute the basename of the input file being processed.
7166 This is the substring up to (and not including) the last period
7167 and not including the directory.
7168
7169 @item %B
7170 This is the same as @samp{%b}, but include the file suffix (text after
7171 the last period).
7172
7173 @item %d
7174 Marks the argument containing or following the @samp{%d} as a
7175 temporary file name, so that that file will be deleted if GCC exits
7176 successfully.  Unlike @samp{%g}, this contributes no text to the
7177 argument.
7178
7179 @item %g@var{suffix}
7180 Substitute a file name that has suffix @var{suffix} and is chosen
7181 once per compilation, and mark the argument in the same way as
7182 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7183 name is now chosen in a way that is hard to predict even when previously
7184 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7185 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7186 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7187 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7188 was simply substituted with a file name chosen once per compilation,
7189 without regard to any appended suffix (which was therefore treated
7190 just like ordinary text), making such attacks more likely to succeed.
7191
7192 @item %u@var{suffix}
7193 Like @samp{%g}, but generates a new temporary file name even if
7194 @samp{%u@var{suffix}} was already seen.
7195
7196 @item %U@var{suffix}
7197 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7198 new one if there is no such last file name.  In the absence of any
7199 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7200 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7201 would involve the generation of two distinct file names, one
7202 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7203 simply substituted with a file name chosen for the previous @samp{%u},
7204 without regard to any appended suffix.
7205
7206 @item %j@var{suffix}
7207 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7208 writable, and if save-temps is off; otherwise, substitute the name
7209 of a temporary file, just like @samp{%u}.  This temporary file is not
7210 meant for communication between processes, but rather as a junk
7211 disposal mechanism.
7212
7213 @item %|@var{suffix}
7214 @itemx %m@var{suffix}
7215 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7216 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7217 all.  These are the two most common ways to instruct a program that it
7218 should read from standard input or write to standard output.  If you
7219 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7220 construct: see for example @file{f/lang-specs.h}.
7221
7222 @item %.@var{SUFFIX}
7223 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7224 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7225 terminated by the next space or %.
7226
7227 @item %w
7228 Marks the argument containing or following the @samp{%w} as the
7229 designated output file of this compilation.  This puts the argument
7230 into the sequence of arguments that @samp{%o} will substitute later.
7231
7232 @item %o
7233 Substitutes the names of all the output files, with spaces
7234 automatically placed around them.  You should write spaces
7235 around the @samp{%o} as well or the results are undefined.
7236 @samp{%o} is for use in the specs for running the linker.
7237 Input files whose names have no recognized suffix are not compiled
7238 at all, but they are included among the output files, so they will
7239 be linked.
7240
7241 @item %O
7242 Substitutes the suffix for object files.  Note that this is
7243 handled specially when it immediately follows @samp{%g, %u, or %U},
7244 because of the need for those to form complete file names.  The
7245 handling is such that @samp{%O} is treated exactly as if it had already
7246 been substituted, except that @samp{%g, %u, and %U} do not currently
7247 support additional @var{suffix} characters following @samp{%O} as they would
7248 following, for example, @samp{.o}.
7249
7250 @item %p
7251 Substitutes the standard macro predefinitions for the
7252 current target machine.  Use this when running @code{cpp}.
7253
7254 @item %P
7255 Like @samp{%p}, but puts @samp{__} before and after the name of each
7256 predefined macro, except for macros that start with @samp{__} or with
7257 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7258 C@.
7259
7260 @item %I
7261 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7262 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7263 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7264 and @option{-imultilib} as necessary.
7265
7266 @item %s
7267 Current argument is the name of a library or startup file of some sort.
7268 Search for that file in a standard list of directories and substitute
7269 the full name found.
7270
7271 @item %e@var{str}
7272 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7273 Use this when inconsistent options are detected.
7274
7275 @item %(@var{name})
7276 Substitute the contents of spec string @var{name} at this point.
7277
7278 @item %[@var{name}]
7279 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7280
7281 @item %x@{@var{option}@}
7282 Accumulate an option for @samp{%X}.
7283
7284 @item %X
7285 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7286 spec string.
7287
7288 @item %Y
7289 Output the accumulated assembler options specified by @option{-Wa}.
7290
7291 @item %Z
7292 Output the accumulated preprocessor options specified by @option{-Wp}.
7293
7294 @item %a
7295 Process the @code{asm} spec.  This is used to compute the
7296 switches to be passed to the assembler.
7297
7298 @item %A
7299 Process the @code{asm_final} spec.  This is a spec string for
7300 passing switches to an assembler post-processor, if such a program is
7301 needed.
7302
7303 @item %l
7304 Process the @code{link} spec.  This is the spec for computing the
7305 command line passed to the linker.  Typically it will make use of the
7306 @samp{%L %G %S %D and %E} sequences.
7307
7308 @item %D
7309 Dump out a @option{-L} option for each directory that GCC believes might
7310 contain startup files.  If the target supports multilibs then the
7311 current multilib directory will be prepended to each of these paths.
7312
7313 @item %L
7314 Process the @code{lib} spec.  This is a spec string for deciding which
7315 libraries should be included on the command line to the linker.
7316
7317 @item %G
7318 Process the @code{libgcc} spec.  This is a spec string for deciding
7319 which GCC support library should be included on the command line to the linker.
7320
7321 @item %S
7322 Process the @code{startfile} spec.  This is a spec for deciding which
7323 object files should be the first ones passed to the linker.  Typically
7324 this might be a file named @file{crt0.o}.
7325
7326 @item %E
7327 Process the @code{endfile} spec.  This is a spec string that specifies
7328 the last object files that will be passed to the linker.
7329
7330 @item %C
7331 Process the @code{cpp} spec.  This is used to construct the arguments
7332 to be passed to the C preprocessor.
7333
7334 @item %1
7335 Process the @code{cc1} spec.  This is used to construct the options to be
7336 passed to the actual C compiler (@samp{cc1}).
7337
7338 @item %2
7339 Process the @code{cc1plus} spec.  This is used to construct the options to be
7340 passed to the actual C++ compiler (@samp{cc1plus}).
7341
7342 @item %*
7343 Substitute the variable part of a matched option.  See below.
7344 Note that each comma in the substituted string is replaced by
7345 a single space.
7346
7347 @item %<@code{S}
7348 Remove all occurrences of @code{-S} from the command line.  Note---this
7349 command is position dependent.  @samp{%} commands in the spec string
7350 before this one will see @code{-S}, @samp{%} commands in the spec string
7351 after this one will not.
7352
7353 @item %:@var{function}(@var{args})
7354 Call the named function @var{function}, passing it @var{args}.
7355 @var{args} is first processed as a nested spec string, then split
7356 into an argument vector in the usual fashion.  The function returns
7357 a string which is processed as if it had appeared literally as part
7358 of the current spec.
7359
7360 The following built-in spec functions are provided:
7361
7362 @table @code
7363 @item @code{if-exists}
7364 The @code{if-exists} spec function takes one argument, an absolute
7365 pathname to a file.  If the file exists, @code{if-exists} returns the
7366 pathname.  Here is a small example of its usage:
7367
7368 @smallexample
7369 *startfile:
7370 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7371 @end smallexample
7372
7373 @item @code{if-exists-else}
7374 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7375 spec function, except that it takes two arguments.  The first argument is
7376 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7377 returns the pathname.  If it does not exist, it returns the second argument.
7378 This way, @code{if-exists-else} can be used to select one file or another,
7379 based on the existence of the first.  Here is a small example of its usage:
7380
7381 @smallexample
7382 *startfile:
7383 crt0%O%s %:if-exists(crti%O%s) \
7384 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7385 @end smallexample
7386
7387 @item @code{replace-outfile}
7388 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7389 first argument in the outfiles array and replaces it with the second argument.  Here
7390 is a small example of its usage:
7391
7392 @smallexample
7393 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7394 @end smallexample
7395
7396 @end table
7397
7398 @item %@{@code{S}@}
7399 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7400 If that switch was not specified, this substitutes nothing.  Note that
7401 the leading dash is omitted when specifying this option, and it is
7402 automatically inserted if the substitution is performed.  Thus the spec
7403 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7404 and would output the command line option @option{-foo}.
7405
7406 @item %W@{@code{S}@}
7407 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7408 deleted on failure.
7409
7410 @item %@{@code{S}*@}
7411 Substitutes all the switches specified to GCC whose names start
7412 with @code{-S}, but which also take an argument.  This is used for
7413 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7414 GCC considers @option{-o foo} as being
7415 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7416 text, including the space.  Thus two arguments would be generated.
7417
7418 @item %@{@code{S}*&@code{T}*@}
7419 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7420 (the order of @code{S} and @code{T} in the spec is not significant).
7421 There can be any number of ampersand-separated variables; for each the
7422 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7423
7424 @item %@{@code{S}:@code{X}@}
7425 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7426
7427 @item %@{!@code{S}:@code{X}@}
7428 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7429
7430 @item %@{@code{S}*:@code{X}@}
7431 Substitutes @code{X} if one or more switches whose names start with
7432 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7433 once, no matter how many such switches appeared.  However, if @code{%*}
7434 appears somewhere in @code{X}, then @code{X} will be substituted once
7435 for each matching switch, with the @code{%*} replaced by the part of
7436 that switch that matched the @code{*}.
7437
7438 @item %@{.@code{S}:@code{X}@}
7439 Substitutes @code{X}, if processing a file with suffix @code{S}.
7440
7441 @item %@{!.@code{S}:@code{X}@}
7442 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7443
7444 @item %@{@code{S}|@code{P}:@code{X}@}
7445 Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@.
7446 This may be combined with @samp{!}, @samp{.}, and @code{*} sequences as well,
7447 although they have a stronger binding than the @samp{|}.  If @code{%*}
7448 appears in @code{X}, all of the alternatives must be starred, and only
7449 the first matching alternative is substituted.
7450
7451 For example, a spec string like this:
7452
7453 @smallexample
7454 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7455 @end smallexample
7456
7457 will output the following command-line options from the following input
7458 command-line options:
7459
7460 @smallexample
7461 fred.c        -foo -baz
7462 jim.d         -bar -boggle
7463 -d fred.c     -foo -baz -boggle
7464 -d jim.d      -bar -baz -boggle
7465 @end smallexample
7466
7467 @item %@{S:X; T:Y; :D@}
7468
7469 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7470 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7471 be as many clauses as you need.  This may be combined with @code{.},
7472 @code{!}, @code{|}, and @code{*} as needed.
7473
7474
7475 @end table
7476
7477 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7478 construct may contain other nested @samp{%} constructs or spaces, or
7479 even newlines.  They are processed as usual, as described above.
7480 Trailing white space in @code{X} is ignored.  White space may also
7481 appear anywhere on the left side of the colon in these constructs,
7482 except between @code{.} or @code{*} and the corresponding word.
7483
7484 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7485 handled specifically in these constructs.  If another value of
7486 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7487 @option{-W} switch is found later in the command line, the earlier
7488 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7489 just one letter, which passes all matching options.
7490
7491 The character @samp{|} at the beginning of the predicate text is used to
7492 indicate that a command should be piped to the following command, but
7493 only if @option{-pipe} is specified.
7494
7495 It is built into GCC which switches take arguments and which do not.
7496 (You might think it would be useful to generalize this to allow each
7497 compiler's spec to say which switches take arguments.  But this cannot
7498 be done in a consistent fashion.  GCC cannot even decide which input
7499 files have been specified without knowing which switches take arguments,
7500 and it must know which input files to compile in order to tell which
7501 compilers to run).
7502
7503 GCC also knows implicitly that arguments starting in @option{-l} are to be
7504 treated as compiler output files, and passed to the linker in their
7505 proper position among the other output files.
7506
7507 @c man begin OPTIONS
7508
7509 @node Target Options
7510 @section Specifying Target Machine and Compiler Version
7511 @cindex target options
7512 @cindex cross compiling
7513 @cindex specifying machine version
7514 @cindex specifying compiler version and target machine
7515 @cindex compiler version, specifying
7516 @cindex target machine, specifying
7517
7518 The usual way to run GCC is to run the executable called @file{gcc}, or
7519 @file{<machine>-gcc} when cross-compiling, or
7520 @file{<machine>-gcc-<version>} to run a version other than the one that
7521 was installed last.  Sometimes this is inconvenient, so GCC provides
7522 options that will switch to another cross-compiler or version.
7523
7524 @table @gcctabopt
7525 @item -b @var{machine}
7526 @opindex b
7527 The argument @var{machine} specifies the target machine for compilation.
7528
7529 The value to use for @var{machine} is the same as was specified as the
7530 machine type when configuring GCC as a cross-compiler.  For
7531 example, if a cross-compiler was configured with @samp{configure
7532 arm-elf}, meaning to compile for an arm processor with elf binaries,
7533 then you would specify @option{-b arm-elf} to run that cross compiler.
7534 Because there are other options beginning with @option{-b}, the
7535 configuration must contain a hyphen. 
7536
7537 @item -V @var{version}
7538 @opindex V
7539 The argument @var{version} specifies which version of GCC to run.
7540 This is useful when multiple versions are installed.  For example,
7541 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7542 @end table
7543
7544 The @option{-V} and @option{-b} options work by running the
7545 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7546 use them if you can just run that directly.
7547
7548 @node Submodel Options
7549 @section Hardware Models and Configurations
7550 @cindex submodel options
7551 @cindex specifying hardware config
7552 @cindex hardware models and configurations, specifying
7553 @cindex machine dependent options
7554
7555 Earlier we discussed the standard option @option{-b} which chooses among
7556 different installed compilers for completely different target
7557 machines, such as VAX vs.@: 68000 vs.@: 80386.
7558
7559 In addition, each of these target machine types can have its own
7560 special options, starting with @samp{-m}, to choose among various
7561 hardware models or configurations---for example, 68010 vs 68020,
7562 floating coprocessor or none.  A single installed version of the
7563 compiler can compile for any model or configuration, according to the
7564 options specified.
7565
7566 Some configurations of the compiler also support additional special
7567 options, usually for compatibility with other compilers on the same
7568 platform.
7569
7570 @c This list is ordered alphanumerically by subsection name.
7571 @c It should be the same order and spelling as these options are listed
7572 @c in Machine Dependent Options
7573
7574 @menu
7575 * ARC Options::
7576 * ARM Options::
7577 * AVR Options::
7578 * Blackfin Options::
7579 * CRIS Options::
7580 * CRX Options::
7581 * Darwin Options::
7582 * DEC Alpha Options::
7583 * DEC Alpha/VMS Options::
7584 * FRV Options::
7585 * GNU/Linux Options::
7586 * H8/300 Options::
7587 * HPPA Options::
7588 * i386 and x86-64 Options::
7589 * IA-64 Options::
7590 * M32C Options::
7591 * M32R/D Options::
7592 * M680x0 Options::
7593 * M68hc1x Options::
7594 * MCore Options::
7595 * MIPS Options::
7596 * MMIX Options::
7597 * MN10300 Options::
7598 * MT Options::
7599 * PDP-11 Options::
7600 * PowerPC Options::
7601 * RS/6000 and PowerPC Options::
7602 * S/390 and zSeries Options::
7603 * Score Options::
7604 * SH Options::
7605 * SPARC Options::
7606 * System V Options::
7607 * TMS320C3x/C4x Options::
7608 * V850 Options::
7609 * VAX Options::
7610 * x86-64 Options::
7611 * Xstormy16 Options::
7612 * Xtensa Options::
7613 * zSeries Options::
7614 @end menu
7615
7616 @node ARC Options
7617 @subsection ARC Options
7618 @cindex ARC Options
7619
7620 These options are defined for ARC implementations:
7621
7622 @table @gcctabopt
7623 @item -EL
7624 @opindex EL
7625 Compile code for little endian mode.  This is the default.
7626
7627 @item -EB
7628 @opindex EB
7629 Compile code for big endian mode.
7630
7631 @item -mmangle-cpu
7632 @opindex mmangle-cpu
7633 Prepend the name of the cpu to all public symbol names.
7634 In multiple-processor systems, there are many ARC variants with different
7635 instruction and register set characteristics.  This flag prevents code
7636 compiled for one cpu to be linked with code compiled for another.
7637 No facility exists for handling variants that are ``almost identical''.
7638 This is an all or nothing option.
7639
7640 @item -mcpu=@var{cpu}
7641 @opindex mcpu
7642 Compile code for ARC variant @var{cpu}.
7643 Which variants are supported depend on the configuration.
7644 All variants support @option{-mcpu=base}, this is the default.
7645
7646 @item -mtext=@var{text-section}
7647 @itemx -mdata=@var{data-section}
7648 @itemx -mrodata=@var{readonly-data-section}
7649 @opindex mtext
7650 @opindex mdata
7651 @opindex mrodata
7652 Put functions, data, and readonly data in @var{text-section},
7653 @var{data-section}, and @var{readonly-data-section} respectively
7654 by default.  This can be overridden with the @code{section} attribute.
7655 @xref{Variable Attributes}.
7656
7657 @end table
7658
7659 @node ARM Options
7660 @subsection ARM Options
7661 @cindex ARM options
7662
7663 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7664 architectures:
7665
7666 @table @gcctabopt
7667 @item -mabi=@var{name}
7668 @opindex mabi
7669 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7670 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
7671
7672 @item -mapcs-frame
7673 @opindex mapcs-frame
7674 Generate a stack frame that is compliant with the ARM Procedure Call
7675 Standard for all functions, even if this is not strictly necessary for
7676 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7677 with this option will cause the stack frames not to be generated for
7678 leaf functions.  The default is @option{-mno-apcs-frame}.
7679
7680 @item -mapcs
7681 @opindex mapcs
7682 This is a synonym for @option{-mapcs-frame}.
7683
7684 @ignore
7685 @c not currently implemented
7686 @item -mapcs-stack-check
7687 @opindex mapcs-stack-check
7688 Generate code to check the amount of stack space available upon entry to
7689 every function (that actually uses some stack space).  If there is
7690 insufficient space available then either the function
7691 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7692 called, depending upon the amount of stack space required.  The run time
7693 system is required to provide these functions.  The default is
7694 @option{-mno-apcs-stack-check}, since this produces smaller code.
7695
7696 @c not currently implemented
7697 @item -mapcs-float
7698 @opindex mapcs-float
7699 Pass floating point arguments using the float point registers.  This is
7700 one of the variants of the APCS@.  This option is recommended if the
7701 target hardware has a floating point unit or if a lot of floating point
7702 arithmetic is going to be performed by the code.  The default is
7703 @option{-mno-apcs-float}, since integer only code is slightly increased in
7704 size if @option{-mapcs-float} is used.
7705
7706 @c not currently implemented
7707 @item -mapcs-reentrant
7708 @opindex mapcs-reentrant
7709 Generate reentrant, position independent code.  The default is
7710 @option{-mno-apcs-reentrant}.
7711 @end ignore
7712
7713 @item -mthumb-interwork
7714 @opindex mthumb-interwork
7715 Generate code which supports calling between the ARM and Thumb
7716 instruction sets.  Without this option the two instruction sets cannot
7717 be reliably used inside one program.  The default is
7718 @option{-mno-thumb-interwork}, since slightly larger code is generated
7719 when @option{-mthumb-interwork} is specified.
7720
7721 @item -mno-sched-prolog
7722 @opindex mno-sched-prolog
7723 Prevent the reordering of instructions in the function prolog, or the
7724 merging of those instruction with the instructions in the function's
7725 body.  This means that all functions will start with a recognizable set
7726 of instructions (or in fact one of a choice from a small set of
7727 different function prologues), and this information can be used to
7728 locate the start if functions inside an executable piece of code.  The
7729 default is @option{-msched-prolog}.
7730
7731 @item -mhard-float
7732 @opindex mhard-float
7733 Generate output containing floating point instructions.  This is the
7734 default.
7735
7736 @item -msoft-float
7737 @opindex msoft-float
7738 Generate output containing library calls for floating point.
7739 @strong{Warning:} the requisite libraries are not available for all ARM
7740 targets.  Normally the facilities of the machine's usual C compiler are
7741 used, but this cannot be done directly in cross-compilation.  You must make
7742 your own arrangements to provide suitable library functions for
7743 cross-compilation.
7744
7745 @option{-msoft-float} changes the calling convention in the output file;
7746 therefore, it is only useful if you compile @emph{all} of a program with
7747 this option.  In particular, you need to compile @file{libgcc.a}, the
7748 library that comes with GCC, with @option{-msoft-float} in order for
7749 this to work.
7750
7751 @item -mfloat-abi=@var{name}
7752 @opindex mfloat-abi
7753 Specifies which ABI to use for floating point values.  Permissible values
7754 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7755
7756 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7757 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7758 of floating point instructions, but still uses the soft-float calling
7759 conventions.
7760
7761 @item -mlittle-endian
7762 @opindex mlittle-endian
7763 Generate code for a processor running in little-endian mode.  This is
7764 the default for all standard configurations.
7765
7766 @item -mbig-endian
7767 @opindex mbig-endian
7768 Generate code for a processor running in big-endian mode; the default is
7769 to compile code for a little-endian processor.
7770
7771 @item -mwords-little-endian
7772 @opindex mwords-little-endian
7773 This option only applies when generating code for big-endian processors.
7774 Generate code for a little-endian word order but a big-endian byte
7775 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7776 option should only be used if you require compatibility with code for
7777 big-endian ARM processors generated by versions of the compiler prior to
7778 2.8.
7779
7780 @item -mcpu=@var{name}
7781 @opindex mcpu
7782 This specifies the name of the target ARM processor.  GCC uses this name
7783 to determine what kind of instructions it can emit when generating
7784 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7785 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7786 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7787 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7788 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7789 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7790 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7791 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7792 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7793 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7794 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7795 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7796 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7797 @samp{arm1176jz-s}, @samp{arm1176jzf-s}, @samp{xscale}, @samp{iwmmxt},
7798 @samp{ep9312}.
7799
7800 @itemx -mtune=@var{name}
7801 @opindex mtune
7802 This option is very similar to the @option{-mcpu=} option, except that
7803 instead of specifying the actual target processor type, and hence
7804 restricting which instructions can be used, it specifies that GCC should
7805 tune the performance of the code as if the target were of the type
7806 specified in this option, but still choosing the instructions that it
7807 will generate based on the cpu specified by a @option{-mcpu=} option.
7808 For some ARM implementations better performance can be obtained by using
7809 this option.
7810
7811 @item -march=@var{name}
7812 @opindex march
7813 This specifies the name of the target ARM architecture.  GCC uses this
7814 name to determine what kind of instructions it can emit when generating
7815 assembly code.  This option can be used in conjunction with or instead
7816 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
7817 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
7818 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
7819 @samp{iwmmxt}, @samp{ep9312}.
7820
7821 @item -mfpu=@var{name}
7822 @itemx -mfpe=@var{number}
7823 @itemx -mfp=@var{number}
7824 @opindex mfpu
7825 @opindex mfpe
7826 @opindex mfp
7827 This specifies what floating point hardware (or hardware emulation) is
7828 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
7829 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
7830 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
7831 with older versions of GCC@.
7832
7833 If @option{-msoft-float} is specified this specifies the format of
7834 floating point values.
7835
7836 @item -mstructure-size-boundary=@var{n}
7837 @opindex mstructure-size-boundary
7838 The size of all structures and unions will be rounded up to a multiple
7839 of the number of bits set by this option.  Permissible values are 8, 32
7840 and 64.  The default value varies for different toolchains.  For the COFF
7841 targeted toolchain the default value is 8.  A value of 64 is only allowed
7842 if the underlying ABI supports it.
7843
7844 Specifying the larger number can produce faster, more efficient code, but
7845 can also increase the size of the program.  Different values are potentially
7846 incompatible.  Code compiled with one value cannot necessarily expect to
7847 work with code or libraries compiled with another value, if they exchange
7848 information using structures or unions.
7849
7850 @item -mabort-on-noreturn
7851 @opindex mabort-on-noreturn
7852 Generate a call to the function @code{abort} at the end of a
7853 @code{noreturn} function.  It will be executed if the function tries to
7854 return.
7855
7856 @item -mlong-calls
7857 @itemx -mno-long-calls
7858 @opindex mlong-calls
7859 @opindex mno-long-calls
7860 Tells the compiler to perform function calls by first loading the
7861 address of the function into a register and then performing a subroutine
7862 call on this register.  This switch is needed if the target function
7863 will lie outside of the 64 megabyte addressing range of the offset based
7864 version of subroutine call instruction.
7865
7866 Even if this switch is enabled, not all function calls will be turned
7867 into long calls.  The heuristic is that static functions, functions
7868 which have the @samp{short-call} attribute, functions that are inside
7869 the scope of a @samp{#pragma no_long_calls} directive and functions whose
7870 definitions have already been compiled within the current compilation
7871 unit, will not be turned into long calls.  The exception to this rule is
7872 that weak function definitions, functions with the @samp{long-call}
7873 attribute or the @samp{section} attribute, and functions that are within
7874 the scope of a @samp{#pragma long_calls} directive, will always be
7875 turned into long calls.
7876
7877 This feature is not enabled by default.  Specifying
7878 @option{-mno-long-calls} will restore the default behavior, as will
7879 placing the function calls within the scope of a @samp{#pragma
7880 long_calls_off} directive.  Note these switches have no effect on how
7881 the compiler generates code to handle function calls via function
7882 pointers.
7883
7884 @item -mnop-fun-dllimport
7885 @opindex mnop-fun-dllimport
7886 Disable support for the @code{dllimport} attribute.
7887
7888 @item -msingle-pic-base
7889 @opindex msingle-pic-base
7890 Treat the register used for PIC addressing as read-only, rather than
7891 loading it in the prologue for each function.  The run-time system is
7892 responsible for initializing this register with an appropriate value
7893 before execution begins.
7894
7895 @item -mpic-register=@var{reg}
7896 @opindex mpic-register
7897 Specify the register to be used for PIC addressing.  The default is R10
7898 unless stack-checking is enabled, when R9 is used.
7899
7900 @item -mcirrus-fix-invalid-insns
7901 @opindex mcirrus-fix-invalid-insns
7902 @opindex mno-cirrus-fix-invalid-insns
7903 Insert NOPs into the instruction stream to in order to work around
7904 problems with invalid Maverick instruction combinations.  This option
7905 is only valid if the @option{-mcpu=ep9312} option has been used to
7906 enable generation of instructions for the Cirrus Maverick floating
7907 point co-processor.  This option is not enabled by default, since the
7908 problem is only present in older Maverick implementations.  The default
7909 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
7910 switch.
7911
7912 @item -mpoke-function-name
7913 @opindex mpoke-function-name
7914 Write the name of each function into the text section, directly
7915 preceding the function prologue.  The generated code is similar to this:
7916
7917 @smallexample
7918      t0
7919          .ascii "arm_poke_function_name", 0
7920          .align
7921      t1
7922          .word 0xff000000 + (t1 - t0)
7923      arm_poke_function_name
7924          mov     ip, sp
7925          stmfd   sp!, @{fp, ip, lr, pc@}
7926          sub     fp, ip, #4
7927 @end smallexample
7928
7929 When performing a stack backtrace, code can inspect the value of
7930 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
7931 location @code{pc - 12} and the top 8 bits are set, then we know that
7932 there is a function name embedded immediately preceding this location
7933 and has length @code{((pc[-3]) & 0xff000000)}.
7934
7935 @item -mthumb
7936 @opindex mthumb
7937 Generate code for the 16-bit Thumb instruction set.  The default is to
7938 use the 32-bit ARM instruction set.
7939
7940 @item -mtpcs-frame
7941 @opindex mtpcs-frame
7942 Generate a stack frame that is compliant with the Thumb Procedure Call
7943 Standard for all non-leaf functions.  (A leaf function is one that does
7944 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
7945
7946 @item -mtpcs-leaf-frame
7947 @opindex mtpcs-leaf-frame
7948 Generate a stack frame that is compliant with the Thumb Procedure Call
7949 Standard for all leaf functions.  (A leaf function is one that does
7950 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
7951
7952 @item -mcallee-super-interworking
7953 @opindex mcallee-super-interworking
7954 Gives all externally visible functions in the file being compiled an ARM
7955 instruction set header which switches to Thumb mode before executing the
7956 rest of the function.  This allows these functions to be called from
7957 non-interworking code.
7958
7959 @item -mcaller-super-interworking
7960 @opindex mcaller-super-interworking
7961 Allows calls via function pointers (including virtual functions) to
7962 execute correctly regardless of whether the target code has been
7963 compiled for interworking or not.  There is a small overhead in the cost
7964 of executing a function pointer if this option is enabled.
7965
7966 @item -mtp=@var{name}
7967 @opindex mtp
7968 Specify the access model for the thread local storage pointer.  The valid
7969 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
7970 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
7971 (supported in the arm6k architecture), and @option{auto}, which uses the
7972 best available method for the selected processor.  The default setting is
7973 @option{auto}.
7974
7975 @end table
7976
7977 @node AVR Options
7978 @subsection AVR Options
7979 @cindex AVR Options
7980
7981 These options are defined for AVR implementations:
7982
7983 @table @gcctabopt
7984 @item -mmcu=@var{mcu}
7985 @opindex mmcu
7986 Specify ATMEL AVR instruction set or MCU type.
7987
7988 Instruction set avr1 is for the minimal AVR core, not supported by the C
7989 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
7990 attiny11, attiny12, attiny15, attiny28).
7991
7992 Instruction set avr2 (default) is for the classic AVR core with up to
7993 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
7994 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
7995 at90c8534, at90s8535).
7996
7997 Instruction set avr3 is for the classic AVR core with up to 128K program
7998 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
7999
8000 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8001 memory space (MCU types: atmega8, atmega83, atmega85).
8002
8003 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8004 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8005 atmega64, atmega128, at43usb355, at94k).
8006
8007 @item -msize
8008 @opindex msize
8009 Output instruction sizes to the asm file.
8010
8011 @item -minit-stack=@var{N}
8012 @opindex minit-stack
8013 Specify the initial stack address, which may be a symbol or numeric value,
8014 @samp{__stack} is the default.
8015
8016 @item -mno-interrupts
8017 @opindex mno-interrupts
8018 Generated code is not compatible with hardware interrupts.
8019 Code size will be smaller.
8020
8021 @item -mcall-prologues
8022 @opindex mcall-prologues
8023 Functions prologues/epilogues expanded as call to appropriate
8024 subroutines.  Code size will be smaller.
8025
8026 @item -mno-tablejump
8027 @opindex mno-tablejump
8028 Do not generate tablejump insns which sometimes increase code size.
8029
8030 @item -mtiny-stack
8031 @opindex mtiny-stack
8032 Change only the low 8 bits of the stack pointer.
8033
8034 @item -mint8
8035 @opindex mint8
8036 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8037 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8038 and long long will be 4 bytes.  Please note that this option does not
8039 comply to the C standards, but it will provide you with smaller code
8040 size.
8041 @end table
8042
8043 @node Blackfin Options
8044 @subsection Blackfin Options
8045 @cindex Blackfin Options
8046
8047 @table @gcctabopt
8048 @item -momit-leaf-frame-pointer
8049 @opindex momit-leaf-frame-pointer
8050 Don't keep the frame pointer in a register for leaf functions.  This
8051 avoids the instructions to save, set up and restore frame pointers and
8052 makes an extra register available in leaf functions.  The option
8053 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8054 which might make debugging harder.
8055
8056 @item -mspecld-anomaly
8057 @opindex mspecld-anomaly
8058 When enabled, the compiler will ensure that the generated code does not
8059 contain speculative loads after jump instructions.  This option is enabled
8060 by default.
8061
8062 @item -mno-specld-anomaly
8063 @opindex mno-specld-anomaly
8064 Don't generate extra code to prevent speculative loads from occurring.
8065
8066 @item -mcsync-anomaly
8067 @opindex mcsync-anomaly
8068 When enabled, the compiler will ensure that the generated code does not
8069 contain CSYNC or SSYNC instructions too soon after conditional branches.
8070 This option is enabled by default.
8071
8072 @item -mno-csync-anomaly
8073 @opindex mno-csync-anomaly
8074 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8075 occurring too soon after a conditional branch.
8076
8077 @item -mlow-64k
8078 @opindex mlow-64k
8079 When enabled, the compiler is free to take advantage of the knowledge that
8080 the entire program fits into the low 64k of memory.
8081
8082 @item -mno-low-64k
8083 @opindex mno-low-64k
8084 Assume that the program is arbitrarily large.  This is the default.
8085
8086 @item -mid-shared-library
8087 @opindex mid-shared-library
8088 Generate code that supports shared libraries via the library ID method.
8089 This allows for execute in place and shared libraries in an environment
8090 without virtual memory management.  This option implies @option{-fPIC}.
8091
8092 @item -mno-id-shared-library
8093 @opindex mno-id-shared-library
8094 Generate code that doesn't assume ID based shared libraries are being used.
8095 This is the default.
8096
8097 @item -mshared-library-id=n
8098 @opindex mshared-library-id
8099 Specified the identification number of the ID based shared library being
8100 compiled.  Specifying a value of 0 will generate more compact code, specifying
8101 other values will force the allocation of that number to the current
8102 library but is no more space or time efficient than omitting this option.
8103
8104 @item -mlong-calls
8105 @itemx -mno-long-calls
8106 @opindex mlong-calls
8107 @opindex mno-long-calls
8108 Tells the compiler to perform function calls by first loading the
8109 address of the function into a register and then performing a subroutine
8110 call on this register.  This switch is needed if the target function
8111 will lie outside of the 24 bit addressing range of the offset based
8112 version of subroutine call instruction.
8113
8114 This feature is not enabled by default.  Specifying
8115 @option{-mno-long-calls} will restore the default behavior.  Note these
8116 switches have no effect on how the compiler generates code to handle
8117 function calls via function pointers.
8118 @end table
8119
8120 @node CRIS Options
8121 @subsection CRIS Options
8122 @cindex CRIS Options
8123
8124 These options are defined specifically for the CRIS ports.
8125
8126 @table @gcctabopt
8127 @item -march=@var{architecture-type}
8128 @itemx -mcpu=@var{architecture-type}
8129 @opindex march
8130 @opindex mcpu
8131 Generate code for the specified architecture.  The choices for
8132 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8133 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8134 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8135 @samp{v10}.
8136
8137 @item -mtune=@var{architecture-type}
8138 @opindex mtune
8139 Tune to @var{architecture-type} everything applicable about the generated
8140 code, except for the ABI and the set of available instructions.  The
8141 choices for @var{architecture-type} are the same as for
8142 @option{-march=@var{architecture-type}}.
8143
8144 @item -mmax-stack-frame=@var{n}
8145 @opindex mmax-stack-frame
8146 Warn when the stack frame of a function exceeds @var{n} bytes.
8147
8148 @item -melinux-stacksize=@var{n}
8149 @opindex melinux-stacksize
8150 Only available with the @samp{cris-axis-aout} target.  Arranges for
8151 indications in the program to the kernel loader that the stack of the
8152 program should be set to @var{n} bytes.
8153
8154 @item -metrax4
8155 @itemx -metrax100
8156 @opindex metrax4
8157 @opindex metrax100
8158 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8159 @option{-march=v3} and @option{-march=v8} respectively.
8160
8161 @item -mmul-bug-workaround
8162 @itemx -mno-mul-bug-workaround
8163 @opindex mmul-bug-workaround
8164 @opindex mno-mul-bug-workaround
8165 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8166 models where it applies.  This option is active by default.
8167
8168 @item -mpdebug
8169 @opindex mpdebug
8170 Enable CRIS-specific verbose debug-related information in the assembly
8171 code.  This option also has the effect to turn off the @samp{#NO_APP}
8172 formatted-code indicator to the assembler at the beginning of the
8173 assembly file.
8174
8175 @item -mcc-init
8176 @opindex mcc-init
8177 Do not use condition-code results from previous instruction; always emit
8178 compare and test instructions before use of condition codes.
8179
8180 @item -mno-side-effects
8181 @opindex mno-side-effects
8182 Do not emit instructions with side-effects in addressing modes other than
8183 post-increment.
8184
8185 @item -mstack-align
8186 @itemx -mno-stack-align
8187 @itemx -mdata-align
8188 @itemx -mno-data-align
8189 @itemx -mconst-align
8190 @itemx -mno-const-align
8191 @opindex mstack-align
8192 @opindex mno-stack-align
8193 @opindex mdata-align
8194 @opindex mno-data-align
8195 @opindex mconst-align
8196 @opindex mno-const-align
8197 These options (no-options) arranges (eliminate arrangements) for the
8198 stack-frame, individual data and constants to be aligned for the maximum
8199 single data access size for the chosen CPU model.  The default is to
8200 arrange for 32-bit alignment.  ABI details such as structure layout are
8201 not affected by these options.
8202
8203 @item -m32-bit
8204 @itemx -m16-bit
8205 @itemx -m8-bit
8206 @opindex m32-bit
8207 @opindex m16-bit
8208 @opindex m8-bit
8209 Similar to the stack- data- and const-align options above, these options
8210 arrange for stack-frame, writable data and constants to all be 32-bit,
8211 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8212
8213 @item -mno-prologue-epilogue
8214 @itemx -mprologue-epilogue
8215 @opindex mno-prologue-epilogue
8216 @opindex mprologue-epilogue
8217 With @option{-mno-prologue-epilogue}, the normal function prologue and
8218 epilogue that sets up the stack-frame are omitted and no return
8219 instructions or return sequences are generated in the code.  Use this
8220 option only together with visual inspection of the compiled code: no
8221 warnings or errors are generated when call-saved registers must be saved,
8222 or storage for local variable needs to be allocated.
8223
8224 @item -mno-gotplt
8225 @itemx -mgotplt
8226 @opindex mno-gotplt
8227 @opindex mgotplt
8228 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8229 instruction sequences that load addresses for functions from the PLT part
8230 of the GOT rather than (traditional on other architectures) calls to the
8231 PLT@.  The default is @option{-mgotplt}.
8232
8233 @item -maout
8234 @opindex maout
8235 Legacy no-op option only recognized with the cris-axis-aout target.
8236
8237 @item -melf
8238 @opindex melf
8239 Legacy no-op option only recognized with the cris-axis-elf and
8240 cris-axis-linux-gnu targets.
8241
8242 @item -melinux
8243 @opindex melinux
8244 Only recognized with the cris-axis-aout target, where it selects a
8245 GNU/linux-like multilib, include files and instruction set for
8246 @option{-march=v8}.
8247
8248 @item -mlinux
8249 @opindex mlinux
8250 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8251
8252 @item -sim
8253 @opindex sim
8254 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8255 to link with input-output functions from a simulator library.  Code,
8256 initialized data and zero-initialized data are allocated consecutively.
8257
8258 @item -sim2
8259 @opindex sim2
8260 Like @option{-sim}, but pass linker options to locate initialized data at
8261 0x40000000 and zero-initialized data at 0x80000000.
8262 @end table
8263
8264 @node CRX Options
8265 @subsection CRX Options
8266 @cindex CRX Options
8267
8268 These options are defined specifically for the CRX ports.
8269
8270 @table @gcctabopt
8271
8272 @item -mmac
8273 @opindex mmac
8274 Enable the use of multiply-accumulate instructions. Disabled by default.
8275
8276 @item -mpush-args
8277 @opindex mpush-args
8278 Push instructions will be used to pass outgoing arguments when functions
8279 are called. Enabled by default.
8280 @end table
8281
8282 @node Darwin Options
8283 @subsection Darwin Options
8284 @cindex Darwin options
8285
8286 These options are defined for all architectures running the Darwin operating
8287 system.
8288
8289 FSF GCC on Darwin does not create ``fat'' object files; it will create
8290 an object file for the single architecture that it was built to
8291 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8292 @option{-arch} options are used; it does so by running the compiler or
8293 linker multiple times and joining the results together with
8294 @file{lipo}.
8295
8296 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8297 @samp{i686}) is determined by the flags that specify the ISA
8298 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8299 @option{-force_cpusubtype_ALL} option can be used to override this.
8300
8301 The Darwin tools vary in their behavior when presented with an ISA
8302 mismatch.  The assembler, @file{as}, will only permit instructions to
8303 be used that are valid for the subtype of the file it is generating,
8304 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8305 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8306 and print an error if asked to create a shared library with a less
8307 restrictive subtype than its input files (for instance, trying to put
8308 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8309 for executables, @file{ld}, will quietly give the executable the most
8310 restrictive subtype of any of its input files.
8311
8312 @table @gcctabopt
8313 @item -F@var{dir}
8314 @opindex F
8315 Add the framework directory @var{dir} to the head of the list of
8316 directories to be searched for header files.  These directories are
8317 interleaved with those specified by @option{-I} options and are
8318 scanned in a left-to-right order.
8319
8320 A framework directory is a directory with frameworks in it.  A
8321 framework is a directory with a @samp{"Headers"} and/or
8322 @samp{"PrivateHeaders"} directory contained directly in it that ends
8323 in @samp{".framework"}.  The name of a framework is the name of this
8324 directory excluding the @samp{".framework"}.  Headers associated with
8325 the framework are found in one of those two directories, with
8326 @samp{"Headers"} being searched first.  A subframework is a framework
8327 directory that is in a framework's @samp{"Frameworks"} directory.
8328 Includes of subframework headers can only appear in a header of a
8329 framework that contains the subframework, or in a sibling subframework
8330 header.  Two subframeworks are siblings if they occur in the same
8331 framework.  A subframework should not have the same name as a
8332 framework, a warning will be issued if this is violated.  Currently a
8333 subframework cannot have subframeworks, in the future, the mechanism
8334 may be extended to support this.  The standard frameworks can be found
8335 in @samp{"/System/Library/Frameworks"} and
8336 @samp{"/Library/Frameworks"}.  An example include looks like
8337 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8338 the name of the framework and header.h is found in the
8339 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8340
8341 @item -gused
8342 @opindex gused
8343 Emit debugging information for symbols that are used.  For STABS
8344 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8345 This is by default ON@.
8346
8347 @item -gfull
8348 @opindex gfull
8349 Emit debugging information for all symbols and types.
8350
8351 @item -mmacosx-version-min=@var{version}
8352 The earliest version of MacOS X that this executable will run on
8353 is @var{version}.  Typical values of @var{version} include @code{10.1},
8354 @code{10.2}, and @code{10.3.9}.
8355
8356 The default for this option is to make choices that seem to be most
8357 useful.  
8358
8359 @item -mkernel
8360 @opindex mkernel
8361 Enable kernel development mode.  The @option{-mkernel} option sets
8362 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8363 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8364 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8365 applicable.  This mode also sets @option{-mno-altivec},
8366 @option{-msoft-float}, @option{-fno-builtin} and
8367 @option{-mlong-branch} for PowerPC targets.
8368
8369 @item -mone-byte-bool
8370 @opindex mone-byte-bool
8371 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8372 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8373 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8374 option has no effect on x86.
8375
8376 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8377 to generate code that is not binary compatible with code generated
8378 without that switch.  Using this switch may require recompiling all
8379 other modules in a program, including system libraries.  Use this
8380 switch to conform to a non-default data model.
8381
8382 @item -mfix-and-continue
8383 @itemx -ffix-and-continue
8384 @itemx -findirect-data
8385 @opindex mfix-and-continue
8386 @opindex ffix-and-continue
8387 @opindex findirect-data
8388 Generate code suitable for fast turn around development.  Needed to
8389 enable gdb to dynamically load @code{.o} files into already running
8390 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8391 are provided for backwards compatibility.
8392
8393 @item -all_load
8394 @opindex all_load
8395 Loads all members of static archive libraries.
8396 See man ld(1) for more information.
8397
8398 @item -arch_errors_fatal
8399 @opindex arch_errors_fatal
8400 Cause the errors having to do with files that have the wrong architecture
8401 to be fatal.
8402
8403 @item -bind_at_load
8404 @opindex bind_at_load
8405 Causes the output file to be marked such that the dynamic linker will
8406 bind all undefined references when the file is loaded or launched.
8407
8408 @item -bundle
8409 @opindex bundle
8410 Produce a Mach-o bundle format file.
8411 See man ld(1) for more information.
8412
8413 @item -bundle_loader @var{executable}
8414 @opindex bundle_loader
8415 This option specifies the @var{executable} that will be loading the build
8416 output file being linked.  See man ld(1) for more information.
8417
8418 @item -dynamiclib
8419 @opindex dynamiclib
8420 When passed this option, GCC will produce a dynamic library instead of
8421 an executable when linking, using the Darwin @file{libtool} command.
8422
8423 @item -force_cpusubtype_ALL
8424 @opindex force_cpusubtype_ALL
8425 This causes GCC's output file to have the @var{ALL} subtype, instead of
8426 one controlled by the @option{-mcpu} or @option{-march} option.
8427
8428 @item -allowable_client  @var{client_name}
8429 @itemx -client_name
8430 @itemx -compatibility_version
8431 @itemx -current_version
8432 @itemx -dead_strip
8433 @itemx -dependency-file
8434 @itemx -dylib_file
8435 @itemx -dylinker_install_name
8436 @itemx -dynamic
8437 @itemx -exported_symbols_list
8438 @itemx -filelist
8439 @itemx -flat_namespace
8440 @itemx -force_flat_namespace
8441 @itemx -headerpad_max_install_names
8442 @itemx -image_base
8443 @itemx -init
8444 @itemx -install_name
8445 @itemx -keep_private_externs
8446 @itemx -multi_module
8447 @itemx -multiply_defined
8448 @itemx -multiply_defined_unused
8449 @itemx -noall_load
8450 @itemx -no_dead_strip_inits_and_terms
8451 @itemx -nofixprebinding
8452 @itemx -nomultidefs
8453 @itemx -noprebind
8454 @itemx -noseglinkedit
8455 @itemx -pagezero_size
8456 @itemx -prebind
8457 @itemx -prebind_all_twolevel_modules
8458 @itemx -private_bundle
8459 @itemx -read_only_relocs
8460 @itemx -sectalign
8461 @itemx -sectobjectsymbols
8462 @itemx -whyload
8463 @itemx -seg1addr
8464 @itemx -sectcreate
8465 @itemx -sectobjectsymbols
8466 @itemx -sectorder
8467 @itemx -segaddr
8468 @itemx -segs_read_only_addr
8469 @itemx -segs_read_write_addr
8470 @itemx -seg_addr_table
8471 @itemx -seg_addr_table_filename
8472 @itemx -seglinkedit
8473 @itemx -segprot
8474 @itemx -segs_read_only_addr
8475 @itemx -segs_read_write_addr
8476 @itemx -single_module
8477 @itemx -static
8478 @itemx -sub_library
8479 @itemx -sub_umbrella
8480 @itemx -twolevel_namespace
8481 @itemx -umbrella
8482 @itemx -undefined
8483 @itemx -unexported_symbols_list
8484 @itemx -weak_reference_mismatches
8485 @itemx -whatsloaded
8486
8487 @opindex allowable_client
8488 @opindex client_name
8489 @opindex compatibility_version
8490 @opindex current_version
8491 @opindex dead_strip
8492 @opindex dependency-file
8493 @opindex dylib_file
8494 @opindex dylinker_install_name
8495 @opindex dynamic
8496 @opindex exported_symbols_list
8497 @opindex filelist
8498 @opindex flat_namespace
8499 @opindex force_flat_namespace
8500 @opindex headerpad_max_install_names
8501 @opindex image_base
8502 @opindex init
8503 @opindex install_name
8504 @opindex keep_private_externs
8505 @opindex multi_module
8506 @opindex multiply_defined
8507 @opindex multiply_defined_unused
8508 @opindex noall_load
8509 @opindex no_dead_strip_inits_and_terms
8510 @opindex nofixprebinding
8511 @opindex nomultidefs
8512 @opindex noprebind
8513 @opindex noseglinkedit
8514 @opindex pagezero_size
8515 @opindex prebind
8516 @opindex prebind_all_twolevel_modules
8517 @opindex private_bundle
8518 @opindex read_only_relocs
8519 @opindex sectalign
8520 @opindex sectobjectsymbols
8521 @opindex whyload
8522 @opindex seg1addr
8523 @opindex sectcreate
8524 @opindex sectobjectsymbols
8525 @opindex sectorder
8526 @opindex segaddr
8527 @opindex segs_read_only_addr
8528 @opindex segs_read_write_addr
8529 @opindex seg_addr_table
8530 @opindex seg_addr_table_filename
8531 @opindex seglinkedit
8532 @opindex segprot
8533 @opindex segs_read_only_addr
8534 @opindex segs_read_write_addr
8535 @opindex single_module
8536 @opindex static
8537 @opindex sub_library
8538 @opindex sub_umbrella
8539 @opindex twolevel_namespace
8540 @opindex umbrella
8541 @opindex undefined
8542 @opindex unexported_symbols_list
8543 @opindex weak_reference_mismatches
8544 @opindex whatsloaded
8545
8546 These options are passed to the Darwin linker.  The Darwin linker man page
8547 describes them in detail.
8548 @end table
8549
8550 @node DEC Alpha Options
8551 @subsection DEC Alpha Options
8552
8553 These @samp{-m} options are defined for the DEC Alpha implementations:
8554
8555 @table @gcctabopt
8556 @item -mno-soft-float
8557 @itemx -msoft-float
8558 @opindex mno-soft-float
8559 @opindex msoft-float
8560 Use (do not use) the hardware floating-point instructions for
8561 floating-point operations.  When @option{-msoft-float} is specified,
8562 functions in @file{libgcc.a} will be used to perform floating-point
8563 operations.  Unless they are replaced by routines that emulate the
8564 floating-point operations, or compiled in such a way as to call such
8565 emulations routines, these routines will issue floating-point
8566 operations.   If you are compiling for an Alpha without floating-point
8567 operations, you must ensure that the library is built so as not to call
8568 them.
8569
8570 Note that Alpha implementations without floating-point operations are
8571 required to have floating-point registers.
8572
8573 @item -mfp-reg
8574 @itemx -mno-fp-regs
8575 @opindex mfp-reg
8576 @opindex mno-fp-regs
8577 Generate code that uses (does not use) the floating-point register set.
8578 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8579 register set is not used, floating point operands are passed in integer
8580 registers as if they were integers and floating-point results are passed
8581 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8582 so any function with a floating-point argument or return value called by code
8583 compiled with @option{-mno-fp-regs} must also be compiled with that
8584 option.
8585
8586 A typical use of this option is building a kernel that does not use,
8587 and hence need not save and restore, any floating-point registers.
8588
8589 @item -mieee
8590 @opindex mieee
8591 The Alpha architecture implements floating-point hardware optimized for
8592 maximum performance.  It is mostly compliant with the IEEE floating
8593 point standard.  However, for full compliance, software assistance is
8594 required.  This option generates code fully IEEE compliant code
8595 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8596 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8597 defined during compilation.  The resulting code is less efficient but is
8598 able to correctly support denormalized numbers and exceptional IEEE
8599 values such as not-a-number and plus/minus infinity.  Other Alpha
8600 compilers call this option @option{-ieee_with_no_inexact}.
8601
8602 @item -mieee-with-inexact
8603 @opindex mieee-with-inexact
8604 This is like @option{-mieee} except the generated code also maintains
8605 the IEEE @var{inexact-flag}.  Turning on this option causes the
8606 generated code to implement fully-compliant IEEE math.  In addition to
8607 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8608 macro.  On some Alpha implementations the resulting code may execute
8609 significantly slower than the code generated by default.  Since there is
8610 very little code that depends on the @var{inexact-flag}, you should
8611 normally not specify this option.  Other Alpha compilers call this
8612 option @option{-ieee_with_inexact}.
8613
8614 @item -mfp-trap-mode=@var{trap-mode}
8615 @opindex mfp-trap-mode
8616 This option controls what floating-point related traps are enabled.
8617 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8618 The trap mode can be set to one of four values:
8619
8620 @table @samp
8621 @item n
8622 This is the default (normal) setting.  The only traps that are enabled
8623 are the ones that cannot be disabled in software (e.g., division by zero
8624 trap).
8625
8626 @item u
8627 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8628 as well.
8629
8630 @item su
8631 Like @samp{u}, but the instructions are marked to be safe for software
8632 completion (see Alpha architecture manual for details).
8633
8634 @item sui
8635 Like @samp{su}, but inexact traps are enabled as well.
8636 @end table
8637
8638 @item -mfp-rounding-mode=@var{rounding-mode}
8639 @opindex mfp-rounding-mode
8640 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8641 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8642 of:
8643
8644 @table @samp
8645 @item n
8646 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8647 the nearest machine number or towards the even machine number in case
8648 of a tie.
8649
8650 @item m
8651 Round towards minus infinity.
8652
8653 @item c
8654 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8655
8656 @item d
8657 Dynamic rounding mode.  A field in the floating point control register
8658 (@var{fpcr}, see Alpha architecture reference manual) controls the
8659 rounding mode in effect.  The C library initializes this register for
8660 rounding towards plus infinity.  Thus, unless your program modifies the
8661 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8662 @end table
8663
8664 @item -mtrap-precision=@var{trap-precision}
8665 @opindex mtrap-precision
8666 In the Alpha architecture, floating point traps are imprecise.  This
8667 means without software assistance it is impossible to recover from a
8668 floating trap and program execution normally needs to be terminated.
8669 GCC can generate code that can assist operating system trap handlers
8670 in determining the exact location that caused a floating point trap.
8671 Depending on the requirements of an application, different levels of
8672 precisions can be selected:
8673
8674 @table @samp
8675 @item p
8676 Program precision.  This option is the default and means a trap handler
8677 can only identify which program caused a floating point exception.
8678
8679 @item f
8680 Function precision.  The trap handler can determine the function that
8681 caused a floating point exception.
8682
8683 @item i
8684 Instruction precision.  The trap handler can determine the exact
8685 instruction that caused a floating point exception.
8686 @end table
8687
8688 Other Alpha compilers provide the equivalent options called
8689 @option{-scope_safe} and @option{-resumption_safe}.
8690
8691 @item -mieee-conformant
8692 @opindex mieee-conformant
8693 This option marks the generated code as IEEE conformant.  You must not
8694 use this option unless you also specify @option{-mtrap-precision=i} and either
8695 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8696 is to emit the line @samp{.eflag 48} in the function prologue of the
8697 generated assembly file.  Under DEC Unix, this has the effect that
8698 IEEE-conformant math library routines will be linked in.
8699
8700 @item -mbuild-constants
8701 @opindex mbuild-constants
8702 Normally GCC examines a 32- or 64-bit integer constant to
8703 see if it can construct it from smaller constants in two or three
8704 instructions.  If it cannot, it will output the constant as a literal and
8705 generate code to load it from the data segment at runtime.
8706
8707 Use this option to require GCC to construct @emph{all} integer constants
8708 using code, even if it takes more instructions (the maximum is six).
8709
8710 You would typically use this option to build a shared library dynamic
8711 loader.  Itself a shared library, it must relocate itself in memory
8712 before it can find the variables and constants in its own data segment.
8713
8714 @item -malpha-as
8715 @itemx -mgas
8716 @opindex malpha-as
8717 @opindex mgas
8718 Select whether to generate code to be assembled by the vendor-supplied
8719 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8720
8721 @item -mbwx
8722 @itemx -mno-bwx
8723 @itemx -mcix
8724 @itemx -mno-cix
8725 @itemx -mfix
8726 @itemx -mno-fix
8727 @itemx -mmax
8728 @itemx -mno-max
8729 @opindex mbwx
8730 @opindex mno-bwx
8731 @opindex mcix
8732 @opindex mno-cix
8733 @opindex mfix
8734 @opindex mno-fix
8735 @opindex mmax
8736 @opindex mno-max
8737 Indicate whether GCC should generate code to use the optional BWX,
8738 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8739 sets supported by the CPU type specified via @option{-mcpu=} option or that
8740 of the CPU on which GCC was built if none was specified.
8741
8742 @item -mfloat-vax
8743 @itemx -mfloat-ieee
8744 @opindex mfloat-vax
8745 @opindex mfloat-ieee
8746 Generate code that uses (does not use) VAX F and G floating point
8747 arithmetic instead of IEEE single and double precision.
8748
8749 @item -mexplicit-relocs
8750 @itemx -mno-explicit-relocs
8751 @opindex mexplicit-relocs
8752 @opindex mno-explicit-relocs
8753 Older Alpha assemblers provided no way to generate symbol relocations
8754 except via assembler macros.  Use of these macros does not allow
8755 optimal instruction scheduling.  GNU binutils as of version 2.12
8756 supports a new syntax that allows the compiler to explicitly mark
8757 which relocations should apply to which instructions.  This option
8758 is mostly useful for debugging, as GCC detects the capabilities of
8759 the assembler when it is built and sets the default accordingly.
8760
8761 @item -msmall-data
8762 @itemx -mlarge-data
8763 @opindex msmall-data
8764 @opindex mlarge-data
8765 When @option{-mexplicit-relocs} is in effect, static data is
8766 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
8767 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
8768 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
8769 16-bit relocations off of the @code{$gp} register.  This limits the
8770 size of the small data area to 64KB, but allows the variables to be
8771 directly accessed via a single instruction.
8772
8773 The default is @option{-mlarge-data}.  With this option the data area
8774 is limited to just below 2GB@.  Programs that require more than 2GB of
8775 data must use @code{malloc} or @code{mmap} to allocate the data in the
8776 heap instead of in the program's data segment.
8777
8778 When generating code for shared libraries, @option{-fpic} implies
8779 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
8780
8781 @item -msmall-text
8782 @itemx -mlarge-text
8783 @opindex msmall-text
8784 @opindex mlarge-text
8785 When @option{-msmall-text} is used, the compiler assumes that the
8786 code of the entire program (or shared library) fits in 4MB, and is
8787 thus reachable with a branch instruction.  When @option{-msmall-data}
8788 is used, the compiler can assume that all local symbols share the
8789 same @code{$gp} value, and thus reduce the number of instructions
8790 required for a function call from 4 to 1.
8791
8792 The default is @option{-mlarge-text}.
8793
8794 @item -mcpu=@var{cpu_type}
8795 @opindex mcpu
8796 Set the instruction set and instruction scheduling parameters for
8797 machine type @var{cpu_type}.  You can specify either the @samp{EV}
8798 style name or the corresponding chip number.  GCC supports scheduling
8799 parameters for the EV4, EV5 and EV6 family of processors and will
8800 choose the default values for the instruction set from the processor
8801 you specify.  If you do not specify a processor type, GCC will default
8802 to the processor on which the compiler was built.
8803
8804 Supported values for @var{cpu_type} are
8805
8806 @table @samp
8807 @item ev4
8808 @itemx ev45
8809 @itemx 21064
8810 Schedules as an EV4 and has no instruction set extensions.
8811
8812 @item ev5
8813 @itemx 21164
8814 Schedules as an EV5 and has no instruction set extensions.
8815
8816 @item ev56
8817 @itemx 21164a
8818 Schedules as an EV5 and supports the BWX extension.
8819
8820 @item pca56
8821 @itemx 21164pc
8822 @itemx 21164PC
8823 Schedules as an EV5 and supports the BWX and MAX extensions.
8824
8825 @item ev6
8826 @itemx 21264
8827 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
8828
8829 @item ev67
8830 @itemx 21264a
8831 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
8832 @end table
8833
8834 @item -mtune=@var{cpu_type}
8835 @opindex mtune
8836 Set only the instruction scheduling parameters for machine type
8837 @var{cpu_type}.  The instruction set is not changed.
8838
8839 @item -mmemory-latency=@var{time}
8840 @opindex mmemory-latency
8841 Sets the latency the scheduler should assume for typical memory
8842 references as seen by the application.  This number is highly
8843 dependent on the memory access patterns used by the application
8844 and the size of the external cache on the machine.
8845
8846 Valid options for @var{time} are
8847
8848 @table @samp
8849 @item @var{number}
8850 A decimal number representing clock cycles.
8851
8852 @item L1
8853 @itemx L2
8854 @itemx L3
8855 @itemx main
8856 The compiler contains estimates of the number of clock cycles for
8857 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
8858 (also called Dcache, Scache, and Bcache), as well as to main memory.
8859 Note that L3 is only valid for EV5.
8860
8861 @end table
8862 @end table
8863
8864 @node DEC Alpha/VMS Options
8865 @subsection DEC Alpha/VMS Options
8866
8867 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
8868
8869 @table @gcctabopt
8870 @item -mvms-return-codes
8871 @opindex mvms-return-codes
8872 Return VMS condition codes from main.  The default is to return POSIX
8873 style condition (e.g.@ error) codes.
8874 @end table
8875
8876 @node FRV Options
8877 @subsection FRV Options
8878 @cindex FRV Options
8879
8880 @table @gcctabopt
8881 @item -mgpr-32
8882 @opindex mgpr-32
8883
8884 Only use the first 32 general purpose registers.
8885
8886 @item -mgpr-64
8887 @opindex mgpr-64
8888
8889 Use all 64 general purpose registers.
8890
8891 @item -mfpr-32
8892 @opindex mfpr-32
8893
8894 Use only the first 32 floating point registers.
8895
8896 @item -mfpr-64
8897 @opindex mfpr-64
8898
8899 Use all 64 floating point registers
8900
8901 @item -mhard-float
8902 @opindex mhard-float
8903
8904 Use hardware instructions for floating point operations.
8905
8906 @item -msoft-float
8907 @opindex msoft-float
8908
8909 Use library routines for floating point operations.
8910
8911 @item -malloc-cc
8912 @opindex malloc-cc
8913
8914 Dynamically allocate condition code registers.
8915
8916 @item -mfixed-cc
8917 @opindex mfixed-cc
8918
8919 Do not try to dynamically allocate condition code registers, only
8920 use @code{icc0} and @code{fcc0}.
8921
8922 @item -mdword
8923 @opindex mdword
8924
8925 Change ABI to use double word insns.
8926
8927 @item -mno-dword
8928 @opindex mno-dword
8929
8930 Do not use double word instructions.
8931
8932 @item -mdouble
8933 @opindex mdouble
8934
8935 Use floating point double instructions.
8936
8937 @item -mno-double
8938 @opindex mno-double
8939
8940 Do not use floating point double instructions.
8941
8942 @item -mmedia
8943 @opindex mmedia
8944
8945 Use media instructions.
8946
8947 @item -mno-media
8948 @opindex mno-media
8949
8950 Do not use media instructions.
8951
8952 @item -mmuladd
8953 @opindex mmuladd
8954
8955 Use multiply and add/subtract instructions.
8956
8957 @item -mno-muladd
8958 @opindex mno-muladd
8959
8960 Do not use multiply and add/subtract instructions.
8961
8962 @item -mfdpic
8963 @opindex mfdpic
8964
8965 Select the FDPIC ABI, that uses function descriptors to represent
8966 pointers to functions.  Without any PIC/PIE-related options, it
8967 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
8968 assumes GOT entries and small data are within a 12-bit range from the
8969 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
8970 are computed with 32 bits.
8971
8972 @item -minline-plt
8973 @opindex minline-plt
8974
8975 Enable inlining of PLT entries in function calls to functions that are
8976 not known to bind locally.  It has no effect without @option{-mfdpic}.
8977 It's enabled by default if optimizing for speed and compiling for
8978 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
8979 optimization option such as @option{-O3} or above is present in the
8980 command line.
8981
8982 @item -mTLS
8983 @opindex TLS
8984
8985 Assume a large TLS segment when generating thread-local code.
8986
8987 @item -mtls
8988 @opindex tls
8989
8990 Do not assume a large TLS segment when generating thread-local code.
8991
8992 @item -mgprel-ro
8993 @opindex mgprel-ro
8994
8995 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
8996 that is known to be in read-only sections.  It's enabled by default,
8997 except for @option{-fpic} or @option{-fpie}: even though it may help
8998 make the global offset table smaller, it trades 1 instruction for 4.
8999 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9000 one of which may be shared by multiple symbols, and it avoids the need
9001 for a GOT entry for the referenced symbol, so it's more likely to be a
9002 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9003
9004 @item -multilib-library-pic
9005 @opindex multilib-library-pic
9006
9007 Link with the (library, not FD) pic libraries.  It's implied by
9008 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9009 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9010 it explicitly.
9011
9012 @item -mlinked-fp
9013 @opindex mlinked-fp
9014
9015 Follow the EABI requirement of always creating a frame pointer whenever
9016 a stack frame is allocated.  This option is enabled by default and can
9017 be disabled with @option{-mno-linked-fp}.
9018
9019 @item -mlong-calls
9020 @opindex mlong-calls
9021
9022 Use indirect addressing to call functions outside the current
9023 compilation unit.  This allows the functions to be placed anywhere
9024 within the 32-bit address space.
9025
9026 @item -malign-labels
9027 @opindex malign-labels
9028
9029 Try to align labels to an 8-byte boundary by inserting nops into the
9030 previous packet.  This option only has an effect when VLIW packing
9031 is enabled.  It doesn't create new packets; it merely adds nops to
9032 existing ones.
9033
9034 @item -mlibrary-pic
9035 @opindex mlibrary-pic
9036
9037 Generate position-independent EABI code.
9038
9039 @item -macc-4
9040 @opindex macc-4
9041
9042 Use only the first four media accumulator registers.
9043
9044 @item -macc-8
9045 @opindex macc-8
9046
9047 Use all eight media accumulator registers.
9048
9049 @item -mpack
9050 @opindex mpack
9051
9052 Pack VLIW instructions.
9053
9054 @item -mno-pack
9055 @opindex mno-pack
9056
9057 Do not pack VLIW instructions.
9058
9059 @item -mno-eflags
9060 @opindex mno-eflags
9061
9062 Do not mark ABI switches in e_flags.
9063
9064 @item -mcond-move
9065 @opindex mcond-move
9066
9067 Enable the use of conditional-move instructions (default).
9068
9069 This switch is mainly for debugging the compiler and will likely be removed
9070 in a future version.
9071
9072 @item -mno-cond-move
9073 @opindex mno-cond-move
9074
9075 Disable the use of conditional-move instructions.
9076
9077 This switch is mainly for debugging the compiler and will likely be removed
9078 in a future version.
9079
9080 @item -mscc
9081 @opindex mscc
9082
9083 Enable the use of conditional set instructions (default).
9084
9085 This switch is mainly for debugging the compiler and will likely be removed
9086 in a future version.
9087
9088 @item -mno-scc
9089 @opindex mno-scc
9090
9091 Disable the use of conditional set instructions.
9092
9093 This switch is mainly for debugging the compiler and will likely be removed
9094 in a future version.
9095
9096 @item -mcond-exec
9097 @opindex mcond-exec
9098
9099 Enable the use of conditional execution (default).
9100
9101 This switch is mainly for debugging the compiler and will likely be removed
9102 in a future version.
9103
9104 @item -mno-cond-exec
9105 @opindex mno-cond-exec
9106
9107 Disable the use of conditional execution.
9108
9109 This switch is mainly for debugging the compiler and will likely be removed
9110 in a future version.
9111
9112 @item -mvliw-branch
9113 @opindex mvliw-branch
9114
9115 Run a pass to pack branches into VLIW instructions (default).
9116
9117 This switch is mainly for debugging the compiler and will likely be removed
9118 in a future version.
9119
9120 @item -mno-vliw-branch
9121 @opindex mno-vliw-branch
9122
9123 Do not run a pass to pack branches into VLIW instructions.
9124
9125 This switch is mainly for debugging the compiler and will likely be removed
9126 in a future version.
9127
9128 @item -mmulti-cond-exec
9129 @opindex mmulti-cond-exec
9130
9131 Enable optimization of @code{&&} and @code{||} in conditional execution
9132 (default).
9133
9134 This switch is mainly for debugging the compiler and will likely be removed
9135 in a future version.
9136
9137 @item -mno-multi-cond-exec
9138 @opindex mno-multi-cond-exec
9139
9140 Disable optimization of @code{&&} and @code{||} in conditional execution.
9141
9142 This switch is mainly for debugging the compiler and will likely be removed
9143 in a future version.
9144
9145 @item -mnested-cond-exec
9146 @opindex mnested-cond-exec
9147
9148 Enable nested conditional execution optimizations (default).
9149
9150 This switch is mainly for debugging the compiler and will likely be removed
9151 in a future version.
9152
9153 @item -mno-nested-cond-exec
9154 @opindex mno-nested-cond-exec
9155
9156 Disable nested conditional execution optimizations.
9157
9158 This switch is mainly for debugging the compiler and will likely be removed
9159 in a future version.
9160
9161 @item -moptimize-membar
9162 @opindex moptimize-membar
9163
9164 This switch removes redundant @code{membar} instructions from the
9165 compiler generated code.  It is enabled by default.
9166
9167 @item -mno-optimize-membar
9168 @opindex mno-optimize-membar
9169
9170 This switch disables the automatic removal of redundant @code{membar}
9171 instructions from the generated code.
9172
9173 @item -mtomcat-stats
9174 @opindex mtomcat-stats
9175
9176 Cause gas to print out tomcat statistics.
9177
9178 @item -mcpu=@var{cpu}
9179 @opindex mcpu
9180
9181 Select the processor type for which to generate code.  Possible values are
9182 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9183 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9184
9185 @end table
9186
9187 @node GNU/Linux Options
9188 @subsection GNU/Linux Options
9189
9190 These @samp{-m} options are defined for GNU/Linux targets:
9191
9192 @table @gcctabopt
9193 @item -mglibc
9194 @opindex mglibc
9195 Use the GNU C library instead of uClibc.  This is the default except
9196 on @samp{*-*-linux-*uclibc*} targets.
9197
9198 @item -muclibc
9199 @opindex muclibc
9200 Use uClibc instead of the GNU C library.  This is the default on
9201 @samp{*-*-linux-*uclibc*} targets.
9202 @end table
9203
9204 @node H8/300 Options
9205 @subsection H8/300 Options
9206
9207 These @samp{-m} options are defined for the H8/300 implementations:
9208
9209 @table @gcctabopt
9210 @item -mrelax
9211 @opindex mrelax
9212 Shorten some address references at link time, when possible; uses the
9213 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9214 ld, Using ld}, for a fuller description.
9215
9216 @item -mh
9217 @opindex mh
9218 Generate code for the H8/300H@.
9219
9220 @item -ms
9221 @opindex ms
9222 Generate code for the H8S@.
9223
9224 @item -mn
9225 @opindex mn
9226 Generate code for the H8S and H8/300H in the normal mode.  This switch
9227 must be used either with @option{-mh} or @option{-ms}.
9228
9229 @item -ms2600
9230 @opindex ms2600
9231 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9232
9233 @item -mint32
9234 @opindex mint32
9235 Make @code{int} data 32 bits by default.
9236
9237 @item -malign-300
9238 @opindex malign-300
9239 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9240 The default for the H8/300H and H8S is to align longs and floats on 4
9241 byte boundaries.
9242 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9243 This option has no effect on the H8/300.
9244 @end table
9245
9246 @node HPPA Options
9247 @subsection HPPA Options
9248 @cindex HPPA Options
9249
9250 These @samp{-m} options are defined for the HPPA family of computers:
9251
9252 @table @gcctabopt
9253 @item -march=@var{architecture-type}
9254 @opindex march
9255 Generate code for the specified architecture.  The choices for
9256 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9257 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9258 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9259 architecture option for your machine.  Code compiled for lower numbered
9260 architectures will run on higher numbered architectures, but not the
9261 other way around.
9262
9263 @item -mpa-risc-1-0
9264 @itemx -mpa-risc-1-1
9265 @itemx -mpa-risc-2-0
9266 @opindex mpa-risc-1-0
9267 @opindex mpa-risc-1-1
9268 @opindex mpa-risc-2-0
9269 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9270
9271 @item -mbig-switch
9272 @opindex mbig-switch
9273 Generate code suitable for big switch tables.  Use this option only if
9274 the assembler/linker complain about out of range branches within a switch
9275 table.
9276
9277 @item -mjump-in-delay
9278 @opindex mjump-in-delay
9279 Fill delay slots of function calls with unconditional jump instructions
9280 by modifying the return pointer for the function call to be the target
9281 of the conditional jump.
9282
9283 @item -mdisable-fpregs
9284 @opindex mdisable-fpregs
9285 Prevent floating point registers from being used in any manner.  This is
9286 necessary for compiling kernels which perform lazy context switching of
9287 floating point registers.  If you use this option and attempt to perform
9288 floating point operations, the compiler will abort.
9289
9290 @item -mdisable-indexing
9291 @opindex mdisable-indexing
9292 Prevent the compiler from using indexing address modes.  This avoids some
9293 rather obscure problems when compiling MIG generated code under MACH@.
9294
9295 @item -mno-space-regs
9296 @opindex mno-space-regs
9297 Generate code that assumes the target has no space registers.  This allows
9298 GCC to generate faster indirect calls and use unscaled index address modes.
9299
9300 Such code is suitable for level 0 PA systems and kernels.
9301
9302 @item -mfast-indirect-calls
9303 @opindex mfast-indirect-calls
9304 Generate code that assumes calls never cross space boundaries.  This
9305 allows GCC to emit code which performs faster indirect calls.
9306
9307 This option will not work in the presence of shared libraries or nested
9308 functions.
9309
9310 @item -mfixed-range=@var{register-range}
9311 @opindex mfixed-range
9312 Generate code treating the given register range as fixed registers.
9313 A fixed register is one that the register allocator can not use.  This is
9314 useful when compiling kernel code.  A register range is specified as
9315 two registers separated by a dash.  Multiple register ranges can be
9316 specified separated by a comma.
9317
9318 @item -mlong-load-store
9319 @opindex mlong-load-store
9320 Generate 3-instruction load and store sequences as sometimes required by
9321 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9322 the HP compilers.
9323
9324 @item -mportable-runtime
9325 @opindex mportable-runtime
9326 Use the portable calling conventions proposed by HP for ELF systems.
9327
9328 @item -mgas
9329 @opindex mgas
9330 Enable the use of assembler directives only GAS understands.
9331
9332 @item -mschedule=@var{cpu-type}
9333 @opindex mschedule
9334 Schedule code according to the constraints for the machine type
9335 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9336 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9337 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9338 proper scheduling option for your machine.  The default scheduling is
9339 @samp{8000}.
9340
9341 @item -mlinker-opt
9342 @opindex mlinker-opt
9343 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9344 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9345 linkers in which they give bogus error messages when linking some programs.
9346
9347 @item -msoft-float
9348 @opindex msoft-float
9349 Generate output containing library calls for floating point.
9350 @strong{Warning:} the requisite libraries are not available for all HPPA
9351 targets.  Normally the facilities of the machine's usual C compiler are
9352 used, but this cannot be done directly in cross-compilation.  You must make
9353 your own arrangements to provide suitable library functions for
9354 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9355 does provide software floating point support.
9356
9357 @option{-msoft-float} changes the calling convention in the output file;
9358 therefore, it is only useful if you compile @emph{all} of a program with
9359 this option.  In particular, you need to compile @file{libgcc.a}, the
9360 library that comes with GCC, with @option{-msoft-float} in order for
9361 this to work.
9362
9363 @item -msio
9364 @opindex msio
9365 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9366 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9367 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9368 options are available under HP-UX and HI-UX@.
9369
9370 @item -mgnu-ld
9371 @opindex gnu-ld
9372 Use GNU ld specific options.  This passes @option{-shared} to ld when
9373 building a shared library.  It is the default when GCC is configured,
9374 explicitly or implicitly, with the GNU linker.  This option does not
9375 have any affect on which ld is called, it only changes what parameters
9376 are passed to that ld.  The ld that is called is determined by the
9377 @option{--with-ld} configure option, GCC's program search path, and
9378 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9379 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9380 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9381
9382 @item -mhp-ld
9383 @opindex hp-ld
9384 Use HP ld specific options.  This passes @option{-b} to ld when building
9385 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9386 links.  It is the default when GCC is configured, explicitly or
9387 implicitly, with the HP linker.  This option does not have any affect on
9388 which ld is called, it only changes what parameters are passed to that
9389 ld.  The ld that is called is determined by the @option{--with-ld}
9390 configure option, GCC's program search path, and finally by the user's
9391 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9392 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9393 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9394
9395 @item -mlong-calls
9396 @opindex mno-long-calls
9397 Generate code that uses long call sequences.  This ensures that a call
9398 is always able to reach linker generated stubs.  The default is to generate
9399 long calls only when the distance from the call site to the beginning
9400 of the function or translation unit, as the case may be, exceeds a
9401 predefined limit set by the branch type being used.  The limits for
9402 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9403 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9404 240,000 bytes.
9405
9406 Distances are measured from the beginning of functions when using the
9407 @option{-ffunction-sections} option, or when using the @option{-mgas}
9408 and @option{-mno-portable-runtime} options together under HP-UX with
9409 the SOM linker.
9410
9411 It is normally not desirable to use this option as it will degrade
9412 performance.  However, it may be useful in large applications,
9413 particularly when partial linking is used to build the application.
9414
9415 The types of long calls used depends on the capabilities of the
9416 assembler and linker, and the type of code being generated.  The
9417 impact on systems that support long absolute calls, and long pic
9418 symbol-difference or pc-relative calls should be relatively small.
9419 However, an indirect call is used on 32-bit ELF systems in pic code
9420 and it is quite long.
9421
9422 @item -munix=@var{unix-std}
9423 @opindex march
9424 Generate compiler predefines and select a startfile for the specified
9425 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9426 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9427 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9428 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9429 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9430 and later.
9431
9432 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9433 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9434 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9435 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9436 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9437 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9438
9439 It is @emph{important} to note that this option changes the interfaces
9440 for various library routines.  It also affects the operational behavior
9441 of the C library.  Thus, @emph{extreme} care is needed in using this
9442 option.
9443
9444 Library code that is intended to operate with more than one UNIX
9445 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9446 as appropriate.  Most GNU software doesn't provide this capability.
9447
9448 @item -nolibdld
9449 @opindex nolibdld
9450 Suppress the generation of link options to search libdld.sl when the
9451 @option{-static} option is specified on HP-UX 10 and later.
9452
9453 @item -static
9454 @opindex static
9455 The HP-UX implementation of setlocale in libc has a dependency on
9456 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9457 when the @option{-static} option is specified, special link options
9458 are needed to resolve this dependency.
9459
9460 On HP-UX 10 and later, the GCC driver adds the necessary options to
9461 link with libdld.sl when the @option{-static} option is specified.
9462 This causes the resulting binary to be dynamic.  On the 64-bit port,
9463 the linkers generate dynamic binaries by default in any case.  The
9464 @option{-nolibdld} option can be used to prevent the GCC driver from
9465 adding these link options.
9466
9467 @item -threads
9468 @opindex threads
9469 Add support for multithreading with the @dfn{dce thread} library
9470 under HP-UX@.  This option sets flags for both the preprocessor and
9471 linker.
9472 @end table
9473
9474 @node i386 and x86-64 Options
9475 @subsection Intel 386 and AMD x86-64 Options
9476 @cindex i386 Options
9477 @cindex x86-64 Options
9478 @cindex Intel 386 Options
9479 @cindex AMD x86-64 Options
9480
9481 These @samp{-m} options are defined for the i386 and x86-64 family of
9482 computers:
9483
9484 @table @gcctabopt
9485 @item -mtune=@var{cpu-type}
9486 @opindex mtune
9487 Tune to @var{cpu-type} everything applicable about the generated code, except
9488 for the ABI and the set of available instructions.  The choices for
9489 @var{cpu-type} are:
9490 @table @emph
9491 @item generic
9492 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9493 If you know the CPU on which your code will run, then you should use
9494 the corresponding @option{-mtune} option instead of
9495 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9496 of your application will have, then you should use this option.
9497
9498 As new processors are deployed in the marketplace, the behavior of this
9499 option will change.  Therefore, if you upgrade to a newer version of
9500 GCC, the code generated option will change to reflect the processors
9501 that were most common when that version of GCC was released.
9502
9503 There is no @option{-march=generic} option because @option{-march}
9504 indicates the instruction set the compiler can use, and there is no
9505 generic instruction set applicable to all processors.  In contrast,
9506 @option{-mtune} indicates the processor (or, in this case, collection of
9507 processors) for which the code is optimized.
9508 @item native
9509 This selects the CPU to tune for at compilation time by determining
9510 the processor type of the compiling machine.  Using @option{-mtune=native}
9511 will produce code optimized for the local machine under the constraints
9512 of the selected instruction set.  Using @option{-march=native} will
9513 enable all instruction subsets supported by the local machine (hence
9514 the result might not run on different machines).
9515 @item i386
9516 Original Intel's i386 CPU@.
9517 @item i486
9518 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9519 @item i586, pentium
9520 Intel Pentium CPU with no MMX support.
9521 @item pentium-mmx
9522 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9523 @item pentiumpro
9524 Intel PentiumPro CPU@.
9525 @item i686
9526 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9527 instruction set will be used, so the code will run on all i686 family chips.
9528 @item pentium2
9529 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9530 @item pentium3, pentium3m
9531 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9532 support.
9533 @item pentium-m
9534 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9535 support.  Used by Centrino notebooks.
9536 @item pentium4, pentium4m
9537 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9538 @item prescott
9539 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9540 set support.
9541 @item nocona
9542 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9543 SSE2 and SSE3 instruction set support.
9544 @item core2
9545 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9546 instruction set support.
9547 @item k6
9548 AMD K6 CPU with MMX instruction set support.
9549 @item k6-2, k6-3
9550 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9551 @item athlon, athlon-tbird
9552 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9553 support.
9554 @item athlon-4, athlon-xp, athlon-mp
9555 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9556 instruction set support.
9557 @item k8, opteron, athlon64, athlon-fx
9558 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9559 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9560 @item k8-sse3, opteron-sse3, athlon64-sse3
9561 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
9562 @item amdfam10, barcelona
9563 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
9564 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
9565 instruction set extensions.)
9566 @item winchip-c6
9567 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9568 set support.
9569 @item winchip2
9570 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9571 instruction set support.
9572 @item c3
9573 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9574 implemented for this chip.)
9575 @item c3-2
9576 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9577 implemented for this chip.)
9578 @item geode
9579 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9580 @end table
9581
9582 While picking a specific @var{cpu-type} will schedule things appropriately
9583 for that particular chip, the compiler will not generate any code that
9584 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9585 being used.
9586
9587 @item -march=@var{cpu-type}
9588 @opindex march
9589 Generate instructions for the machine type @var{cpu-type}.  The choices
9590 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9591 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9592
9593 @item -mcpu=@var{cpu-type}
9594 @opindex mcpu
9595 A deprecated synonym for @option{-mtune}.
9596
9597 @item -m386
9598 @itemx -m486
9599 @itemx -mpentium
9600 @itemx -mpentiumpro
9601 @opindex m386
9602 @opindex m486
9603 @opindex mpentium
9604 @opindex mpentiumpro
9605 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9606 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9607 These synonyms are deprecated.
9608
9609 @item -mfpmath=@var{unit}
9610 @opindex march
9611 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9612 for @var{unit} are:
9613
9614 @table @samp
9615 @item 387
9616 Use the standard 387 floating point coprocessor present majority of chips and
9617 emulated otherwise.  Code compiled with this option will run almost everywhere.
9618 The temporary results are computed in 80bit precision instead of precision
9619 specified by the type resulting in slightly different results compared to most
9620 of other chips.  See @option{-ffloat-store} for more detailed description.
9621
9622 This is the default choice for i386 compiler.
9623
9624 @item sse
9625 Use scalar floating point instructions present in the SSE instruction set.
9626 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9627 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9628 instruction set supports only single precision arithmetics, thus the double and
9629 extended precision arithmetics is still done using 387.  Later version, present
9630 only in Pentium4 and the future AMD x86-64 chips supports double precision
9631 arithmetics too.
9632
9633 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9634 or @option{-msse2} switches to enable SSE extensions and make this option
9635 effective.  For the x86-64 compiler, these extensions are enabled by default.
9636
9637 The resulting code should be considerably faster in the majority of cases and avoid
9638 the numerical instability problems of 387 code, but may break some existing
9639 code that expects temporaries to be 80bit.
9640
9641 This is the default choice for the x86-64 compiler.
9642
9643 @item sse,387
9644 Attempt to utilize both instruction sets at once.  This effectively double the
9645 amount of available registers and on chips with separate execution units for
9646 387 and SSE the execution resources too.  Use this option with care, as it is
9647 still experimental, because the GCC register allocator does not model separate
9648 functional units well resulting in instable performance.
9649 @end table
9650
9651 @item -masm=@var{dialect}
9652 @opindex masm=@var{dialect}
9653 Output asm instructions using selected @var{dialect}.  Supported
9654 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9655 not support @samp{intel}.
9656
9657 @item -mieee-fp
9658 @itemx -mno-ieee-fp
9659 @opindex mieee-fp
9660 @opindex mno-ieee-fp
9661 Control whether or not the compiler uses IEEE floating point
9662 comparisons.  These handle correctly the case where the result of a
9663 comparison is unordered.
9664
9665 @item -msoft-float
9666 @opindex msoft-float
9667 Generate output containing library calls for floating point.
9668 @strong{Warning:} the requisite libraries are not part of GCC@.
9669 Normally the facilities of the machine's usual C compiler are used, but
9670 this can't be done directly in cross-compilation.  You must make your
9671 own arrangements to provide suitable library functions for
9672 cross-compilation.
9673
9674 On machines where a function returns floating point results in the 80387
9675 register stack, some floating point opcodes may be emitted even if
9676 @option{-msoft-float} is used.
9677
9678 @item -mno-fp-ret-in-387
9679 @opindex mno-fp-ret-in-387
9680 Do not use the FPU registers for return values of functions.
9681
9682 The usual calling convention has functions return values of types
9683 @code{float} and @code{double} in an FPU register, even if there
9684 is no FPU@.  The idea is that the operating system should emulate
9685 an FPU@.
9686
9687 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9688 in ordinary CPU registers instead.
9689
9690 @item -mno-fancy-math-387
9691 @opindex mno-fancy-math-387
9692 Some 387 emulators do not support the @code{sin}, @code{cos} and
9693 @code{sqrt} instructions for the 387.  Specify this option to avoid
9694 generating those instructions.  This option is the default on
9695 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9696 indicates that the target cpu will always have an FPU and so the
9697 instruction will not need emulation.  As of revision 2.6.1, these
9698 instructions are not generated unless you also use the
9699 @option{-funsafe-math-optimizations} switch.
9700
9701 @item -malign-double
9702 @itemx -mno-align-double
9703 @opindex malign-double
9704 @opindex mno-align-double
9705 Control whether GCC aligns @code{double}, @code{long double}, and
9706 @code{long long} variables on a two word boundary or a one word
9707 boundary.  Aligning @code{double} variables on a two word boundary will
9708 produce code that runs somewhat faster on a @samp{Pentium} at the
9709 expense of more memory.
9710
9711 On x86-64, @option{-malign-double} is enabled by default.
9712
9713 @strong{Warning:} if you use the @option{-malign-double} switch,
9714 structures containing the above types will be aligned differently than
9715 the published application binary interface specifications for the 386
9716 and will not be binary compatible with structures in code compiled
9717 without that switch.
9718
9719 @item -m96bit-long-double
9720 @itemx -m128bit-long-double
9721 @opindex m96bit-long-double
9722 @opindex m128bit-long-double
9723 These switches control the size of @code{long double} type.  The i386
9724 application binary interface specifies the size to be 96 bits,
9725 so @option{-m96bit-long-double} is the default in 32 bit mode.
9726
9727 Modern architectures (Pentium and newer) would prefer @code{long double}
9728 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9729 conforming to the ABI, this would not be possible.  So specifying a
9730 @option{-m128bit-long-double} will align @code{long double}
9731 to a 16 byte boundary by padding the @code{long double} with an additional
9732 32 bit zero.
9733
9734 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9735 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9736
9737 Notice that neither of these options enable any extra precision over the x87
9738 standard of 80 bits for a @code{long double}.
9739
9740 @strong{Warning:} if you override the default value for your target ABI, the
9741 structures and arrays containing @code{long double} variables will change
9742 their size as well as function calling convention for function taking
9743 @code{long double} will be modified.  Hence they will not be binary
9744 compatible with arrays or structures in code compiled without that switch.
9745
9746 @item -mmlarge-data-threshold=@var{number}
9747 @opindex mlarge-data-threshold=@var{number}
9748 When @option{-mcmodel=medium} is specified, the data greater than
9749 @var{threshold} are placed in large data section.  This value must be the
9750 same across all object linked into the binary and defaults to 65535.
9751
9752 @item -msvr3-shlib
9753 @itemx -mno-svr3-shlib
9754 @opindex msvr3-shlib
9755 @opindex mno-svr3-shlib
9756 Control whether GCC places uninitialized local variables into the
9757 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9758 into @code{bss}.  These options are meaningful only on System V Release 3.
9759
9760 @item -mrtd
9761 @opindex mrtd
9762 Use a different function-calling convention, in which functions that
9763 take a fixed number of arguments return with the @code{ret} @var{num}
9764 instruction, which pops their arguments while returning.  This saves one
9765 instruction in the caller since there is no need to pop the arguments
9766 there.
9767
9768 You can specify that an individual function is called with this calling
9769 sequence with the function attribute @samp{stdcall}.  You can also
9770 override the @option{-mrtd} option by using the function attribute
9771 @samp{cdecl}.  @xref{Function Attributes}.
9772
9773 @strong{Warning:} this calling convention is incompatible with the one
9774 normally used on Unix, so you cannot use it if you need to call
9775 libraries compiled with the Unix compiler.
9776
9777 Also, you must provide function prototypes for all functions that
9778 take variable numbers of arguments (including @code{printf});
9779 otherwise incorrect code will be generated for calls to those
9780 functions.
9781
9782 In addition, seriously incorrect code will result if you call a
9783 function with too many arguments.  (Normally, extra arguments are
9784 harmlessly ignored.)
9785
9786 @item -mregparm=@var{num}
9787 @opindex mregparm
9788 Control how many registers are used to pass integer arguments.  By
9789 default, no registers are used to pass arguments, and at most 3
9790 registers can be used.  You can control this behavior for a specific
9791 function by using the function attribute @samp{regparm}.
9792 @xref{Function Attributes}.
9793
9794 @strong{Warning:} if you use this switch, and
9795 @var{num} is nonzero, then you must build all modules with the same
9796 value, including any libraries.  This includes the system libraries and
9797 startup modules.
9798
9799 @item -msseregparm
9800 @opindex msseregparm
9801 Use SSE register passing conventions for float and double arguments
9802 and return values.  You can control this behavior for a specific
9803 function by using the function attribute @samp{sseregparm}.
9804 @xref{Function Attributes}.
9805
9806 @strong{Warning:} if you use this switch then you must build all
9807 modules with the same value, including any libraries.  This includes
9808 the system libraries and startup modules.
9809
9810 @item -mstackrealign
9811 @opindex mstackrealign
9812 Realign the stack at entry.  On the Intel x86, the
9813 @option{-mstackrealign} option will generate an alternate prologue and
9814 epilogue that realigns the runtime stack.  This supports mixing legacy
9815 codes that keep a 4-byte aligned stack with modern codes that keep a
9816 16-byte stack for SSE compatibility.  The alternate prologue and
9817 epilogue are slower and bigger than the regular ones, and the
9818 alternate prologue requires an extra scratch register; this lowers the
9819 number of registers available if used in conjunction with the
9820 @code{regparm} attribute.  The @option{-mstackrealign} option is
9821 incompatible with the nested function prologue; this is considered a
9822 hard error.  See also the attribute @code{force_align_arg_pointer},
9823 applicable to individual functions.
9824
9825 @item -mpreferred-stack-boundary=@var{num}
9826 @opindex mpreferred-stack-boundary
9827 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
9828 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
9829 the default is 4 (16 bytes or 128 bits).
9830
9831 On Pentium and PentiumPro, @code{double} and @code{long double} values
9832 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
9833 suffer significant run time performance penalties.  On Pentium III, the
9834 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
9835 properly if it is not 16 byte aligned.
9836
9837 To ensure proper alignment of this values on the stack, the stack boundary
9838 must be as aligned as that required by any value stored on the stack.
9839 Further, every function must be generated such that it keeps the stack
9840 aligned.  Thus calling a function compiled with a higher preferred
9841 stack boundary from a function compiled with a lower preferred stack
9842 boundary will most likely misalign the stack.  It is recommended that
9843 libraries that use callbacks always use the default setting.
9844
9845 This extra alignment does consume extra stack space, and generally
9846 increases code size.  Code that is sensitive to stack space usage, such
9847 as embedded systems and operating system kernels, may want to reduce the
9848 preferred alignment to @option{-mpreferred-stack-boundary=2}.
9849
9850 @item -mmmx
9851 @itemx -mno-mmx
9852 @item -msse
9853 @itemx -mno-sse
9854 @item -msse2
9855 @itemx -mno-sse2
9856 @item -msse3
9857 @itemx -mno-sse3
9858 @item -mssse3
9859 @itemx -mno-ssse3
9860 @item -msse4a
9861 @item -mno-sse4a
9862 @item -m3dnow
9863 @itemx -mno-3dnow
9864 @item -mpopcnt
9865 @itemx -mno-popcnt
9866 @item -mabm
9867 @itemx -mno-abm
9868 @opindex mmmx
9869 @opindex mno-mmx
9870 @opindex msse
9871 @opindex mno-sse
9872 @opindex m3dnow
9873 @opindex mno-3dnow
9874 These switches enable or disable the use of instructions in the MMX,
9875 SSE, SSE2, SSE3, SSSE3, SSE4A, ABM or 3DNow! extended instruction sets.
9876 These extensions are also available as built-in functions: see
9877 @ref{X86 Built-in Functions}, for details of the functions enabled and
9878 disabled by these switches.
9879
9880 To have SSE/SSE2 instructions generated automatically from floating-point
9881 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
9882
9883 These options will enable GCC to use these extended instructions in
9884 generated code, even without @option{-mfpmath=sse}.  Applications which
9885 perform runtime CPU detection must compile separate files for each
9886 supported architecture, using the appropriate flags.  In particular,
9887 the file containing the CPU detection code should be compiled without
9888 these options.
9889
9890 @item -mpush-args
9891 @itemx -mno-push-args
9892 @opindex mpush-args
9893 @opindex mno-push-args
9894 Use PUSH operations to store outgoing parameters.  This method is shorter
9895 and usually equally fast as method using SUB/MOV operations and is enabled
9896 by default.  In some cases disabling it may improve performance because of
9897 improved scheduling and reduced dependencies.
9898
9899 @item -maccumulate-outgoing-args
9900 @opindex maccumulate-outgoing-args
9901 If enabled, the maximum amount of space required for outgoing arguments will be
9902 computed in the function prologue.  This is faster on most modern CPUs
9903 because of reduced dependencies, improved scheduling and reduced stack usage
9904 when preferred stack boundary is not equal to 2.  The drawback is a notable
9905 increase in code size.  This switch implies @option{-mno-push-args}.
9906
9907 @item -mthreads
9908 @opindex mthreads
9909 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
9910 on thread-safe exception handling must compile and link all code with the
9911 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
9912 @option{-D_MT}; when linking, it links in a special thread helper library
9913 @option{-lmingwthrd} which cleans up per thread exception handling data.
9914
9915 @item -mno-align-stringops
9916 @opindex mno-align-stringops
9917 Do not align destination of inlined string operations.  This switch reduces
9918 code size and improves performance in case the destination is already aligned,
9919 but GCC doesn't know about it.
9920
9921 @item -minline-all-stringops
9922 @opindex minline-all-stringops
9923 By default GCC inlines string operations only when destination is known to be
9924 aligned at least to 4 byte boundary.  This enables more inlining, increase code
9925 size, but may improve performance of code that depends on fast memcpy, strlen
9926 and memset for short lengths.
9927
9928 @item -momit-leaf-frame-pointer
9929 @opindex momit-leaf-frame-pointer
9930 Don't keep the frame pointer in a register for leaf functions.  This
9931 avoids the instructions to save, set up and restore frame pointers and
9932 makes an extra register available in leaf functions.  The option
9933 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9934 which might make debugging harder.
9935
9936 @item -mtls-direct-seg-refs
9937 @itemx -mno-tls-direct-seg-refs
9938 @opindex mtls-direct-seg-refs
9939 Controls whether TLS variables may be accessed with offsets from the
9940 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
9941 or whether the thread base pointer must be added.  Whether or not this
9942 is legal depends on the operating system, and whether it maps the
9943 segment to cover the entire TLS area.
9944
9945 For systems that use GNU libc, the default is on.
9946 @end table
9947
9948 These @samp{-m} switches are supported in addition to the above
9949 on AMD x86-64 processors in 64-bit environments.
9950
9951 @table @gcctabopt
9952 @item -m32
9953 @itemx -m64
9954 @opindex m32
9955 @opindex m64
9956 Generate code for a 32-bit or 64-bit environment.
9957 The 32-bit environment sets int, long and pointer to 32 bits and
9958 generates code that runs on any i386 system.
9959 The 64-bit environment sets int to 32 bits and long and pointer
9960 to 64 bits and generates code for AMD's x86-64 architecture. For
9961 darwin only the -m64 option turns off the @option{-fno-pic} and
9962 @option{-mdynamic-no-pic} options.
9963
9964 @item -mno-red-zone
9965 @opindex no-red-zone
9966 Do not use a so called red zone for x86-64 code.  The red zone is mandated
9967 by the x86-64 ABI, it is a 128-byte area beyond the location of the
9968 stack pointer that will not be modified by signal or interrupt handlers
9969 and therefore can be used for temporary data without adjusting the stack
9970 pointer.  The flag @option{-mno-red-zone} disables this red zone.
9971
9972 @item -mcmodel=small
9973 @opindex mcmodel=small
9974 Generate code for the small code model: the program and its symbols must
9975 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
9976 Programs can be statically or dynamically linked.  This is the default
9977 code model.
9978
9979 @item -mcmodel=kernel
9980 @opindex mcmodel=kernel
9981 Generate code for the kernel code model.  The kernel runs in the
9982 negative 2 GB of the address space.
9983 This model has to be used for Linux kernel code.
9984
9985 @item -mcmodel=medium
9986 @opindex mcmodel=medium
9987 Generate code for the medium model: The program is linked in the lower 2
9988 GB of the address space but symbols can be located anywhere in the
9989 address space.  Programs can be statically or dynamically linked, but
9990 building of shared libraries are not supported with the medium model.
9991
9992 @item -mcmodel=large
9993 @opindex mcmodel=large
9994 Generate code for the large model: This model makes no assumptions
9995 about addresses and sizes of sections.  Currently GCC does not implement
9996 this model.
9997 @end table
9998
9999 @node IA-64 Options
10000 @subsection IA-64 Options
10001 @cindex IA-64 Options
10002
10003 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10004
10005 @table @gcctabopt
10006 @item -mbig-endian
10007 @opindex mbig-endian
10008 Generate code for a big endian target.  This is the default for HP-UX@.
10009
10010 @item -mlittle-endian
10011 @opindex mlittle-endian
10012 Generate code for a little endian target.  This is the default for AIX5
10013 and GNU/Linux.
10014
10015 @item -mgnu-as
10016 @itemx -mno-gnu-as
10017 @opindex mgnu-as
10018 @opindex mno-gnu-as
10019 Generate (or don't) code for the GNU assembler.  This is the default.
10020 @c Also, this is the default if the configure option @option{--with-gnu-as}
10021 @c is used.
10022
10023 @item -mgnu-ld
10024 @itemx -mno-gnu-ld
10025 @opindex mgnu-ld
10026 @opindex mno-gnu-ld
10027 Generate (or don't) code for the GNU linker.  This is the default.
10028 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10029 @c is used.
10030
10031 @item -mno-pic
10032 @opindex mno-pic
10033 Generate code that does not use a global pointer register.  The result
10034 is not position independent code, and violates the IA-64 ABI@.
10035
10036 @item -mvolatile-asm-stop
10037 @itemx -mno-volatile-asm-stop
10038 @opindex mvolatile-asm-stop
10039 @opindex mno-volatile-asm-stop
10040 Generate (or don't) a stop bit immediately before and after volatile asm
10041 statements.
10042
10043 @item -mregister-names
10044 @itemx -mno-register-names
10045 @opindex mregister-names
10046 @opindex mno-register-names
10047 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10048 the stacked registers.  This may make assembler output more readable.
10049
10050 @item -mno-sdata
10051 @itemx -msdata
10052 @opindex mno-sdata
10053 @opindex msdata
10054 Disable (or enable) optimizations that use the small data section.  This may
10055 be useful for working around optimizer bugs.
10056
10057 @item -mconstant-gp
10058 @opindex mconstant-gp
10059 Generate code that uses a single constant global pointer value.  This is
10060 useful when compiling kernel code.
10061
10062 @item -mauto-pic
10063 @opindex mauto-pic
10064 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10065 This is useful when compiling firmware code.
10066
10067 @item -minline-float-divide-min-latency
10068 @opindex minline-float-divide-min-latency
10069 Generate code for inline divides of floating point values
10070 using the minimum latency algorithm.
10071
10072 @item -minline-float-divide-max-throughput
10073 @opindex minline-float-divide-max-throughput
10074 Generate code for inline divides of floating point values
10075 using the maximum throughput algorithm.
10076
10077 @item -minline-int-divide-min-latency
10078 @opindex minline-int-divide-min-latency
10079 Generate code for inline divides of integer values
10080 using the minimum latency algorithm.
10081
10082 @item -minline-int-divide-max-throughput
10083 @opindex minline-int-divide-max-throughput
10084 Generate code for inline divides of integer values
10085 using the maximum throughput algorithm.
10086
10087 @item -minline-sqrt-min-latency
10088 @opindex minline-sqrt-min-latency
10089 Generate code for inline square roots
10090 using the minimum latency algorithm.
10091
10092 @item -minline-sqrt-max-throughput
10093 @opindex minline-sqrt-max-throughput
10094 Generate code for inline square roots
10095 using the maximum throughput algorithm.
10096
10097 @item -mno-dwarf2-asm
10098 @itemx -mdwarf2-asm
10099 @opindex mno-dwarf2-asm
10100 @opindex mdwarf2-asm
10101 Don't (or do) generate assembler code for the DWARF2 line number debugging
10102 info.  This may be useful when not using the GNU assembler.
10103
10104 @item -mearly-stop-bits
10105 @itemx -mno-early-stop-bits
10106 @opindex mearly-stop-bits
10107 @opindex mno-early-stop-bits
10108 Allow stop bits to be placed earlier than immediately preceding the
10109 instruction that triggered the stop bit.  This can improve instruction
10110 scheduling, but does not always do so.
10111
10112 @item -mfixed-range=@var{register-range}
10113 @opindex mfixed-range
10114 Generate code treating the given register range as fixed registers.
10115 A fixed register is one that the register allocator can not use.  This is
10116 useful when compiling kernel code.  A register range is specified as
10117 two registers separated by a dash.  Multiple register ranges can be
10118 specified separated by a comma.
10119
10120 @item -mtls-size=@var{tls-size}
10121 @opindex mtls-size
10122 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10123 64.
10124
10125 @item -mtune=@var{cpu-type}
10126 @opindex mtune
10127 Tune the instruction scheduling for a particular CPU, Valid values are
10128 itanium, itanium1, merced, itanium2, and mckinley.
10129
10130 @item -mt
10131 @itemx -pthread
10132 @opindex mt
10133 @opindex pthread
10134 Add support for multithreading using the POSIX threads library.  This
10135 option sets flags for both the preprocessor and linker.  It does
10136 not affect the thread safety of object code produced by the compiler or
10137 that of libraries supplied with it.  These are HP-UX specific flags.
10138
10139 @item -milp32
10140 @itemx -mlp64
10141 @opindex milp32
10142 @opindex mlp64
10143 Generate code for a 32-bit or 64-bit environment.
10144 The 32-bit environment sets int, long and pointer to 32 bits.
10145 The 64-bit environment sets int to 32 bits and long and pointer
10146 to 64 bits.  These are HP-UX specific flags.
10147
10148 @item -mno-sched-br-data-spec
10149 @itemx -msched-br-data-spec
10150 @opindex mno-sched-br-data-spec
10151 @opindex msched-br-data-spec
10152 (Dis/En)able data speculative scheduling before reload.
10153 This will result in generation of the ld.a instructions and
10154 the corresponding check instructions (ld.c / chk.a).
10155 The default is 'disable'.
10156
10157 @item -msched-ar-data-spec
10158 @itemx -mno-sched-ar-data-spec
10159 @opindex msched-ar-data-spec
10160 @opindex mno-sched-ar-data-spec
10161 (En/Dis)able data speculative scheduling after reload.
10162 This will result in generation of the ld.a instructions and
10163 the corresponding check instructions (ld.c / chk.a).
10164 The default is 'enable'.
10165
10166 @item -mno-sched-control-spec
10167 @itemx -msched-control-spec
10168 @opindex mno-sched-control-spec
10169 @opindex msched-control-spec
10170 (Dis/En)able control speculative scheduling.  This feature is
10171 available only during region scheduling (i.e. before reload).
10172 This will result in generation of the ld.s instructions and
10173 the corresponding check instructions chk.s .
10174 The default is 'disable'.
10175
10176 @item -msched-br-in-data-spec
10177 @itemx -mno-sched-br-in-data-spec
10178 @opindex msched-br-in-data-spec
10179 @opindex mno-sched-br-in-data-spec
10180 (En/Dis)able speculative scheduling of the instructions that
10181 are dependent on the data speculative loads before reload.
10182 This is effective only with @option{-msched-br-data-spec} enabled.
10183 The default is 'enable'.
10184
10185 @item -msched-ar-in-data-spec
10186 @itemx -mno-sched-ar-in-data-spec
10187 @opindex msched-ar-in-data-spec
10188 @opindex mno-sched-ar-in-data-spec
10189 (En/Dis)able speculative scheduling of the instructions that
10190 are dependent on the data speculative loads after reload.
10191 This is effective only with @option{-msched-ar-data-spec} enabled.
10192 The default is 'enable'.
10193
10194 @item -msched-in-control-spec
10195 @itemx -mno-sched-in-control-spec
10196 @opindex msched-in-control-spec
10197 @opindex mno-sched-in-control-spec
10198 (En/Dis)able speculative scheduling of the instructions that
10199 are dependent on the control speculative loads.
10200 This is effective only with @option{-msched-control-spec} enabled.
10201 The default is 'enable'.
10202
10203 @item -msched-ldc
10204 @itemx -mno-sched-ldc
10205 @opindex msched-ldc
10206 @opindex mno-sched-ldc
10207 (En/Dis)able use of simple data speculation checks ld.c .
10208 If disabled, only chk.a instructions will be emitted to check
10209 data speculative loads.
10210 The default is 'enable'.
10211
10212 @item -mno-sched-control-ldc
10213 @itemx -msched-control-ldc
10214 @opindex mno-sched-control-ldc
10215 @opindex msched-control-ldc 
10216 (Dis/En)able use of ld.c instructions to check control speculative loads.
10217 If enabled, in case of control speculative load with no speculatively
10218 scheduled dependent instructions this load will be emitted as ld.sa and
10219 ld.c will be used to check it.
10220 The default is 'disable'.
10221
10222 @item -mno-sched-spec-verbose
10223 @itemx -msched-spec-verbose
10224 @opindex mno-sched-spec-verbose
10225 @opindex msched-spec-verbose
10226 (Dis/En)able printing of the information about speculative motions.
10227
10228 @item -mno-sched-prefer-non-data-spec-insns
10229 @itemx -msched-prefer-non-data-spec-insns
10230 @opindex mno-sched-prefer-non-data-spec-insns
10231 @opindex msched-prefer-non-data-spec-insns
10232 If enabled, data speculative instructions will be chosen for schedule
10233 only if there are no other choices at the moment.  This will make
10234 the use of the data speculation much more conservative.
10235 The default is 'disable'.
10236
10237 @item -mno-sched-prefer-non-control-spec-insns
10238 @itemx -msched-prefer-non-control-spec-insns
10239 @opindex mno-sched-prefer-non-control-spec-insns
10240 @opindex msched-prefer-non-control-spec-insns
10241 If enabled, control speculative instructions will be chosen for schedule
10242 only if there are no other choices at the moment.  This will make
10243 the use of the control speculation much more conservative.
10244 The default is 'disable'.
10245
10246 @item -mno-sched-count-spec-in-critical-path
10247 @itemx -msched-count-spec-in-critical-path
10248 @opindex mno-sched-count-spec-in-critical-path
10249 @opindex msched-count-spec-in-critical-path
10250 If enabled, speculative dependencies will be considered during
10251 computation of the instructions priorities.  This will make the use of the
10252 speculation a bit more conservative.
10253 The default is 'disable'.
10254
10255 @end table
10256
10257 @node M32C Options
10258 @subsection M32C Options
10259 @cindex M32C options
10260
10261 @table @gcctabopt
10262 @item -mcpu=@var{name}
10263 @opindex mcpu=
10264 Select the CPU for which code is generated.  @var{name} may be one of
10265 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10266 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10267 the M32C/80 series.
10268
10269 @item -msim
10270 @opindex msim
10271 Specifies that the program will be run on the simulator.  This causes
10272 an alternate runtime library to be linked in which supports, for
10273 example, file I/O.  You must not use this option when generating
10274 programs that will run on real hardware; you must provide your own
10275 runtime library for whatever I/O functions are needed.
10276
10277 @item -memregs=@var{number}
10278 @opindex memregs=
10279 Specifies the number of memory-based pseudo-registers GCC will use
10280 during code generation.  These pseudo-registers will be used like real
10281 registers, so there is a tradeoff between GCC's ability to fit the
10282 code into available registers, and the performance penalty of using
10283 memory instead of registers.  Note that all modules in a program must
10284 be compiled with the same value for this option.  Because of that, you
10285 must not use this option with the default runtime libraries gcc
10286 builds.
10287
10288 @end table
10289
10290 @node M32R/D Options
10291 @subsection M32R/D Options
10292 @cindex M32R/D options
10293
10294 These @option{-m} options are defined for Renesas M32R/D architectures:
10295
10296 @table @gcctabopt
10297 @item -m32r2
10298 @opindex m32r2
10299 Generate code for the M32R/2@.
10300
10301 @item -m32rx
10302 @opindex m32rx
10303 Generate code for the M32R/X@.
10304
10305 @item -m32r
10306 @opindex m32r
10307 Generate code for the M32R@.  This is the default.
10308
10309 @item -mmodel=small
10310 @opindex mmodel=small
10311 Assume all objects live in the lower 16MB of memory (so that their addresses
10312 can be loaded with the @code{ld24} instruction), and assume all subroutines
10313 are reachable with the @code{bl} instruction.
10314 This is the default.
10315
10316 The addressability of a particular object can be set with the
10317 @code{model} attribute.
10318
10319 @item -mmodel=medium
10320 @opindex mmodel=medium
10321 Assume objects may be anywhere in the 32-bit address space (the compiler
10322 will generate @code{seth/add3} instructions to load their addresses), and
10323 assume all subroutines are reachable with the @code{bl} instruction.
10324
10325 @item -mmodel=large
10326 @opindex mmodel=large
10327 Assume objects may be anywhere in the 32-bit address space (the compiler
10328 will generate @code{seth/add3} instructions to load their addresses), and
10329 assume subroutines may not be reachable with the @code{bl} instruction
10330 (the compiler will generate the much slower @code{seth/add3/jl}
10331 instruction sequence).
10332
10333 @item -msdata=none
10334 @opindex msdata=none
10335 Disable use of the small data area.  Variables will be put into
10336 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10337 @code{section} attribute has been specified).
10338 This is the default.
10339
10340 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10341 Objects may be explicitly put in the small data area with the
10342 @code{section} attribute using one of these sections.
10343
10344 @item -msdata=sdata
10345 @opindex msdata=sdata
10346 Put small global and static data in the small data area, but do not
10347 generate special code to reference them.
10348
10349 @item -msdata=use
10350 @opindex msdata=use
10351 Put small global and static data in the small data area, and generate
10352 special instructions to reference them.
10353
10354 @item -G @var{num}
10355 @opindex G
10356 @cindex smaller data references
10357 Put global and static objects less than or equal to @var{num} bytes
10358 into the small data or bss sections instead of the normal data or bss
10359 sections.  The default value of @var{num} is 8.
10360 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10361 for this option to have any effect.
10362
10363 All modules should be compiled with the same @option{-G @var{num}} value.
10364 Compiling with different values of @var{num} may or may not work; if it
10365 doesn't the linker will give an error message---incorrect code will not be
10366 generated.
10367
10368 @item -mdebug
10369 @opindex mdebug
10370 Makes the M32R specific code in the compiler display some statistics
10371 that might help in debugging programs.
10372
10373 @item -malign-loops
10374 @opindex malign-loops
10375 Align all loops to a 32-byte boundary.
10376
10377 @item -mno-align-loops
10378 @opindex mno-align-loops
10379 Do not enforce a 32-byte alignment for loops.  This is the default.
10380
10381 @item -missue-rate=@var{number}
10382 @opindex missue-rate=@var{number}
10383 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10384 or 2.
10385
10386 @item -mbranch-cost=@var{number}
10387 @opindex mbranch-cost=@var{number}
10388 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10389 preferred over conditional code, if it is 2, then the opposite will
10390 apply.
10391
10392 @item -mflush-trap=@var{number}
10393 @opindex mflush-trap=@var{number}
10394 Specifies the trap number to use to flush the cache.  The default is
10395 12.  Valid numbers are between 0 and 15 inclusive.
10396
10397 @item -mno-flush-trap
10398 @opindex mno-flush-trap
10399 Specifies that the cache cannot be flushed by using a trap.
10400
10401 @item -mflush-func=@var{name}
10402 @opindex mflush-func=@var{name}
10403 Specifies the name of the operating system function to call to flush
10404 the cache.  The default is @emph{_flush_cache}, but a function call
10405 will only be used if a trap is not available.
10406
10407 @item -mno-flush-func
10408 @opindex mno-flush-func
10409 Indicates that there is no OS function for flushing the cache.
10410
10411 @end table
10412
10413 @node M680x0 Options
10414 @subsection M680x0 Options
10415 @cindex M680x0 options
10416
10417 These are the @samp{-m} options defined for the 68000 series.  The default
10418 values for these options depends on which style of 68000 was selected when
10419 the compiler was configured; the defaults for the most common choices are
10420 given below.
10421
10422 @table @gcctabopt
10423 @item -m68000
10424 @itemx -mc68000
10425 @opindex m68000
10426 @opindex mc68000
10427 Generate output for a 68000.  This is the default
10428 when the compiler is configured for 68000-based systems.
10429
10430 Use this option for microcontrollers with a 68000 or EC000 core,
10431 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10432
10433 @item -m68020
10434 @itemx -mc68020
10435 @opindex m68020
10436 @opindex mc68020
10437 Generate output for a 68020.  This is the default
10438 when the compiler is configured for 68020-based systems.
10439
10440 @item -m68881
10441 @opindex m68881
10442 Generate output containing 68881 instructions for floating point.
10443 This is the default for most 68020 systems unless @option{--nfp} was
10444 specified when the compiler was configured.
10445
10446 @item -m68030
10447 @opindex m68030
10448 Generate output for a 68030.  This is the default when the compiler is
10449 configured for 68030-based systems.
10450
10451 @item -m68040
10452 @opindex m68040
10453 Generate output for a 68040.  This is the default when the compiler is
10454 configured for 68040-based systems.
10455
10456 This option inhibits the use of 68881/68882 instructions that have to be
10457 emulated by software on the 68040.  Use this option if your 68040 does not
10458 have code to emulate those instructions.
10459
10460 @item -m68060
10461 @opindex m68060
10462 Generate output for a 68060.  This is the default when the compiler is
10463 configured for 68060-based systems.
10464
10465 This option inhibits the use of 68020 and 68881/68882 instructions that
10466 have to be emulated by software on the 68060.  Use this option if your 68060
10467 does not have code to emulate those instructions.
10468
10469 @item -mcpu32
10470 @opindex mcpu32
10471 Generate output for a CPU32.  This is the default
10472 when the compiler is configured for CPU32-based systems.
10473
10474 Use this option for microcontrollers with a
10475 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
10476 68336, 68340, 68341, 68349 and 68360.
10477
10478 @item -m5200
10479 @opindex m5200
10480 Generate output for a 520X ``coldfire'' family cpu.  This is the default
10481 when the compiler is configured for 520X-based systems.
10482
10483 Use this option for microcontroller with a 5200 core, including
10484 the MCF5202, MCF5203, MCF5204 and MCF5202.
10485
10486 @item -mcfv4e
10487 @opindex mcfv4e
10488 Generate output for a ColdFire V4e family cpu (e.g.@: 547x/548x).
10489 This includes use of hardware floating point instructions.
10490
10491 @item -m68020-40
10492 @opindex m68020-40
10493 Generate output for a 68040, without using any of the new instructions.
10494 This results in code which can run relatively efficiently on either a
10495 68020/68881 or a 68030 or a 68040.  The generated code does use the
10496 68881 instructions that are emulated on the 68040.
10497
10498 @item -m68020-60
10499 @opindex m68020-60
10500 Generate output for a 68060, without using any of the new instructions.
10501 This results in code which can run relatively efficiently on either a
10502 68020/68881 or a 68030 or a 68040.  The generated code does use the
10503 68881 instructions that are emulated on the 68060.
10504
10505 @item -msoft-float
10506 @opindex msoft-float
10507 Generate output containing library calls for floating point.
10508 @strong{Warning:} the requisite libraries are not available for all m68k
10509 targets.  Normally the facilities of the machine's usual C compiler are
10510 used, but this can't be done directly in cross-compilation.  You must
10511 make your own arrangements to provide suitable library functions for
10512 cross-compilation.  The embedded targets @samp{m68k-*-aout} and
10513 @samp{m68k-*-coff} do provide software floating point support.
10514
10515 @item -mshort
10516 @opindex mshort
10517 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10518 Additionally, parameters passed on the stack are also aligned to a
10519 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10520
10521 @item -mnobitfield
10522 @opindex mnobitfield
10523 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10524 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10525
10526 @item -mbitfield
10527 @opindex mbitfield
10528 Do use the bit-field instructions.  The @option{-m68020} option implies
10529 @option{-mbitfield}.  This is the default if you use a configuration
10530 designed for a 68020.
10531
10532 @item -mrtd
10533 @opindex mrtd
10534 Use a different function-calling convention, in which functions
10535 that take a fixed number of arguments return with the @code{rtd}
10536 instruction, which pops their arguments while returning.  This
10537 saves one instruction in the caller since there is no need to pop
10538 the arguments there.
10539
10540 This calling convention is incompatible with the one normally
10541 used on Unix, so you cannot use it if you need to call libraries
10542 compiled with the Unix compiler.
10543
10544 Also, you must provide function prototypes for all functions that
10545 take variable numbers of arguments (including @code{printf});
10546 otherwise incorrect code will be generated for calls to those
10547 functions.
10548
10549 In addition, seriously incorrect code will result if you call a
10550 function with too many arguments.  (Normally, extra arguments are
10551 harmlessly ignored.)
10552
10553 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10554 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10555
10556 @item -malign-int
10557 @itemx -mno-align-int
10558 @opindex malign-int
10559 @opindex mno-align-int
10560 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10561 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10562 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10563 Aligning variables on 32-bit boundaries produces code that runs somewhat
10564 faster on processors with 32-bit busses at the expense of more memory.
10565
10566 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
10567 align structures containing the above types  differently than
10568 most published application binary interface specifications for the m68k.
10569
10570 @item -mpcrel
10571 @opindex mpcrel
10572 Use the pc-relative addressing mode of the 68000 directly, instead of
10573 using a global offset table.  At present, this option implies @option{-fpic},
10574 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
10575 not presently supported with @option{-mpcrel}, though this could be supported for
10576 68020 and higher processors.
10577
10578 @item -mno-strict-align
10579 @itemx -mstrict-align
10580 @opindex mno-strict-align
10581 @opindex mstrict-align
10582 Do not (do) assume that unaligned memory references will be handled by
10583 the system.
10584
10585 @item -msep-data
10586 Generate code that allows the data segment to be located in a different
10587 area of memory from the text segment.  This allows for execute in place in
10588 an environment without virtual memory management.  This option implies
10589 @option{-fPIC}.
10590
10591 @item -mno-sep-data
10592 Generate code that assumes that the data segment follows the text segment.
10593 This is the default.
10594
10595 @item -mid-shared-library
10596 Generate code that supports shared libraries via the library ID method.
10597 This allows for execute in place and shared libraries in an environment
10598 without virtual memory management.  This option implies @option{-fPIC}.
10599
10600 @item -mno-id-shared-library
10601 Generate code that doesn't assume ID based shared libraries are being used.
10602 This is the default.
10603
10604 @item -mshared-library-id=n
10605 Specified the identification number of the ID based shared library being
10606 compiled.  Specifying a value of 0 will generate more compact code, specifying
10607 other values will force the allocation of that number to the current
10608 library but is no more space or time efficient than omitting this option.
10609
10610 @end table
10611
10612 @node M68hc1x Options
10613 @subsection M68hc1x Options
10614 @cindex M68hc1x options
10615
10616 These are the @samp{-m} options defined for the 68hc11 and 68hc12
10617 microcontrollers.  The default values for these options depends on
10618 which style of microcontroller was selected when the compiler was configured;
10619 the defaults for the most common choices are given below.
10620
10621 @table @gcctabopt
10622 @item -m6811
10623 @itemx -m68hc11
10624 @opindex m6811
10625 @opindex m68hc11
10626 Generate output for a 68HC11.  This is the default
10627 when the compiler is configured for 68HC11-based systems.
10628
10629 @item -m6812
10630 @itemx -m68hc12
10631 @opindex m6812
10632 @opindex m68hc12
10633 Generate output for a 68HC12.  This is the default
10634 when the compiler is configured for 68HC12-based systems.
10635
10636 @item -m68S12
10637 @itemx -m68hcs12
10638 @opindex m68S12
10639 @opindex m68hcs12
10640 Generate output for a 68HCS12.
10641
10642 @item -mauto-incdec
10643 @opindex mauto-incdec
10644 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
10645 addressing modes.
10646
10647 @item -minmax
10648 @itemx -nominmax
10649 @opindex minmax
10650 @opindex mnominmax
10651 Enable the use of 68HC12 min and max instructions.
10652
10653 @item -mlong-calls
10654 @itemx -mno-long-calls
10655 @opindex mlong-calls
10656 @opindex mno-long-calls
10657 Treat all calls as being far away (near).  If calls are assumed to be
10658 far away, the compiler will use the @code{call} instruction to
10659 call a function and the @code{rtc} instruction for returning.
10660
10661 @item -mshort
10662 @opindex mshort
10663 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10664
10665 @item -msoft-reg-count=@var{count}
10666 @opindex msoft-reg-count
10667 Specify the number of pseudo-soft registers which are used for the
10668 code generation.  The maximum number is 32.  Using more pseudo-soft
10669 register may or may not result in better code depending on the program.
10670 The default is 4 for 68HC11 and 2 for 68HC12.
10671
10672 @end table
10673
10674 @node MCore Options
10675 @subsection MCore Options
10676 @cindex MCore options
10677
10678 These are the @samp{-m} options defined for the Motorola M*Core
10679 processors.
10680
10681 @table @gcctabopt
10682
10683 @item -mhardlit
10684 @itemx -mno-hardlit
10685 @opindex mhardlit
10686 @opindex mno-hardlit
10687 Inline constants into the code stream if it can be done in two
10688 instructions or less.
10689
10690 @item -mdiv
10691 @itemx -mno-div
10692 @opindex mdiv
10693 @opindex mno-div
10694 Use the divide instruction.  (Enabled by default).
10695
10696 @item -mrelax-immediate
10697 @itemx -mno-relax-immediate
10698 @opindex mrelax-immediate
10699 @opindex mno-relax-immediate
10700 Allow arbitrary sized immediates in bit operations.
10701
10702 @item -mwide-bitfields
10703 @itemx -mno-wide-bitfields
10704 @opindex mwide-bitfields
10705 @opindex mno-wide-bitfields
10706 Always treat bit-fields as int-sized.
10707
10708 @item -m4byte-functions
10709 @itemx -mno-4byte-functions
10710 @opindex m4byte-functions
10711 @opindex mno-4byte-functions
10712 Force all functions to be aligned to a four byte boundary.
10713
10714 @item -mcallgraph-data
10715 @itemx -mno-callgraph-data
10716 @opindex mcallgraph-data
10717 @opindex mno-callgraph-data
10718 Emit callgraph information.
10719
10720 @item -mslow-bytes
10721 @itemx -mno-slow-bytes
10722 @opindex mslow-bytes
10723 @opindex mno-slow-bytes
10724 Prefer word access when reading byte quantities.
10725
10726 @item -mlittle-endian
10727 @itemx -mbig-endian
10728 @opindex mlittle-endian
10729 @opindex mbig-endian
10730 Generate code for a little endian target.
10731
10732 @item -m210
10733 @itemx -m340
10734 @opindex m210
10735 @opindex m340
10736 Generate code for the 210 processor.
10737 @end table
10738
10739 @node MIPS Options
10740 @subsection MIPS Options
10741 @cindex MIPS options
10742
10743 @table @gcctabopt
10744
10745 @item -EB
10746 @opindex EB
10747 Generate big-endian code.
10748
10749 @item -EL
10750 @opindex EL
10751 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
10752 configurations.
10753
10754 @item -march=@var{arch}
10755 @opindex march
10756 Generate code that will run on @var{arch}, which can be the name of a
10757 generic MIPS ISA, or the name of a particular processor.
10758 The ISA names are:
10759 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
10760 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
10761 The processor names are:
10762 @samp{4kc}, @samp{4km}, @samp{4kp},
10763 @samp{5kc}, @samp{5kf},
10764 @samp{20kc},
10765 @samp{24k}, @samp{24kc}, @samp{24kf}, @samp{24kx},
10766 @samp{m4k},
10767 @samp{orion},
10768 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
10769 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
10770 @samp{rm7000}, @samp{rm9000},
10771 @samp{sb1},
10772 @samp{sr71000},
10773 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
10774 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
10775 The special value @samp{from-abi} selects the
10776 most compatible architecture for the selected ABI (that is,
10777 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
10778
10779 In processor names, a final @samp{000} can be abbreviated as @samp{k}
10780 (for example, @samp{-march=r2k}).  Prefixes are optional, and
10781 @samp{vr} may be written @samp{r}.
10782
10783 GCC defines two macros based on the value of this option.  The first
10784 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
10785 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
10786 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
10787 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
10788 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
10789
10790 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
10791 above.  In other words, it will have the full prefix and will not
10792 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
10793 the macro names the resolved architecture (either @samp{"mips1"} or
10794 @samp{"mips3"}).  It names the default architecture when no
10795 @option{-march} option is given.
10796
10797 @item -mtune=@var{arch}
10798 @opindex mtune
10799 Optimize for @var{arch}.  Among other things, this option controls
10800 the way instructions are scheduled, and the perceived cost of arithmetic
10801 operations.  The list of @var{arch} values is the same as for
10802 @option{-march}.
10803
10804 When this option is not used, GCC will optimize for the processor
10805 specified by @option{-march}.  By using @option{-march} and
10806 @option{-mtune} together, it is possible to generate code that will
10807 run on a family of processors, but optimize the code for one
10808 particular member of that family.
10809
10810 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
10811 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
10812 @samp{-march} ones described above.
10813
10814 @item -mips1
10815 @opindex mips1
10816 Equivalent to @samp{-march=mips1}.
10817
10818 @item -mips2
10819 @opindex mips2
10820 Equivalent to @samp{-march=mips2}.
10821
10822 @item -mips3
10823 @opindex mips3
10824 Equivalent to @samp{-march=mips3}.
10825
10826 @item -mips4
10827 @opindex mips4
10828 Equivalent to @samp{-march=mips4}.
10829
10830 @item -mips32
10831 @opindex mips32
10832 Equivalent to @samp{-march=mips32}.
10833
10834 @item -mips32r2
10835 @opindex mips32r2
10836 Equivalent to @samp{-march=mips32r2}.
10837
10838 @item -mips64
10839 @opindex mips64
10840 Equivalent to @samp{-march=mips64}.
10841
10842 @item -mips16
10843 @itemx -mno-mips16
10844 @opindex mips16
10845 @opindex mno-mips16
10846 Generate (do not generate) MIPS16 code.  If GCC is targetting a
10847 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
10848
10849 @item -mabi=32
10850 @itemx -mabi=o64
10851 @itemx -mabi=n32
10852 @itemx -mabi=64
10853 @itemx -mabi=eabi
10854 @opindex mabi=32
10855 @opindex mabi=o64
10856 @opindex mabi=n32
10857 @opindex mabi=64
10858 @opindex mabi=eabi
10859 Generate code for the given ABI@.
10860
10861 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
10862 generates 64-bit code when you select a 64-bit architecture, but you
10863 can use @option{-mgp32} to get 32-bit code instead.
10864
10865 For information about the O64 ABI, see
10866 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
10867
10868 @item -mabicalls
10869 @itemx -mno-abicalls
10870 @opindex mabicalls
10871 @opindex mno-abicalls
10872 Generate (do not generate) code that is suitable for SVR4-style
10873 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
10874 systems.
10875
10876 @item -mshared
10877 @itemx -mno-shared
10878 Generate (do not generate) code that is fully position-independent,
10879 and that can therefore be linked into shared libraries.  This option
10880 only affects @option{-mabicalls}.
10881
10882 All @option{-mabicalls} code has traditionally been position-independent,
10883 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
10884 as an extension, the GNU toolchain allows executables to use absolute
10885 accesses for locally-binding symbols.  It can also use shorter GP
10886 initialization sequences and generate direct calls to locally-defined
10887 functions.  This mode is selected by @option{-mno-shared}.
10888
10889 @option{-mno-shared} depends on binutils 2.16 or higher and generates
10890 objects that can only be linked by the GNU linker.  However, the option
10891 does not affect the ABI of the final executable; it only affects the ABI
10892 of relocatable objects.  Using @option{-mno-shared} will generally make
10893 executables both smaller and quicker.
10894
10895 @option{-mshared} is the default.
10896
10897 @item -mxgot
10898 @itemx -mno-xgot
10899 @opindex mxgot
10900 @opindex mno-xgot
10901 Lift (do not lift) the usual restrictions on the size of the global
10902 offset table.
10903
10904 GCC normally uses a single instruction to load values from the GOT@.
10905 While this is relatively efficient, it will only work if the GOT
10906 is smaller than about 64k.  Anything larger will cause the linker
10907 to report an error such as:
10908
10909 @cindex relocation truncated to fit (MIPS)
10910 @smallexample
10911 relocation truncated to fit: R_MIPS_GOT16 foobar
10912 @end smallexample
10913
10914 If this happens, you should recompile your code with @option{-mxgot}.
10915 It should then work with very large GOTs, although it will also be
10916 less efficient, since it will take three instructions to fetch the
10917 value of a global symbol.
10918
10919 Note that some linkers can create multiple GOTs.  If you have such a
10920 linker, you should only need to use @option{-mxgot} when a single object
10921 file accesses more than 64k's worth of GOT entries.  Very few do.
10922
10923 These options have no effect unless GCC is generating position
10924 independent code.
10925
10926 @item -mgp32
10927 @opindex mgp32
10928 Assume that general-purpose registers are 32 bits wide.
10929
10930 @item -mgp64
10931 @opindex mgp64
10932 Assume that general-purpose registers are 64 bits wide.
10933
10934 @item -mfp32
10935 @opindex mfp32
10936 Assume that floating-point registers are 32 bits wide.
10937
10938 @item -mfp64
10939 @opindex mfp64
10940 Assume that floating-point registers are 64 bits wide.
10941
10942 @item -mhard-float
10943 @opindex mhard-float
10944 Use floating-point coprocessor instructions.
10945
10946 @item -msoft-float
10947 @opindex msoft-float
10948 Do not use floating-point coprocessor instructions.  Implement
10949 floating-point calculations using library calls instead.
10950
10951 @item -msingle-float
10952 @opindex msingle-float
10953 Assume that the floating-point coprocessor only supports single-precision
10954 operations.
10955
10956 @itemx -mdouble-float
10957 @opindex mdouble-float
10958 Assume that the floating-point coprocessor supports double-precision
10959 operations.  This is the default.
10960
10961 @itemx -mdsp
10962 @itemx -mno-dsp
10963 @opindex mdsp
10964 @opindex mno-dsp
10965 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
10966
10967 @itemx -mpaired-single
10968 @itemx -mno-paired-single
10969 @opindex mpaired-single
10970 @opindex mno-paired-single
10971 Use (do not use) paired-single floating-point instructions.
10972 @xref{MIPS Paired-Single Support}.  This option can only be used
10973 when generating 64-bit code and requires hardware floating-point
10974 support to be enabled.
10975
10976 @itemx -mips3d
10977 @itemx -mno-mips3d
10978 @opindex mips3d
10979 @opindex mno-mips3d
10980 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
10981 The option @option{-mips3d} implies @option{-mpaired-single}.
10982
10983 @item -mlong64
10984 @opindex mlong64
10985 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
10986 an explanation of the default and the way that the pointer size is
10987 determined.
10988
10989 @item -mlong32
10990 @opindex mlong32
10991 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
10992
10993 The default size of @code{int}s, @code{long}s and pointers depends on
10994 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
10995 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
10996 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
10997 or the same size as integer registers, whichever is smaller.
10998
10999 @item -msym32
11000 @itemx -mno-sym32
11001 @opindex msym32
11002 @opindex mno-sym32
11003 Assume (do not assume) that all symbols have 32-bit values, regardless
11004 of the selected ABI@.  This option is useful in combination with
11005 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11006 to generate shorter and faster references to symbolic addresses.
11007
11008 @item -G @var{num}
11009 @opindex G
11010 @cindex smaller data references (MIPS)
11011 @cindex gp-relative references (MIPS)
11012 Put global and static items less than or equal to @var{num} bytes into
11013 the small data or bss section instead of the normal data or bss section.
11014 This allows the data to be accessed using a single instruction.
11015
11016 All modules should be compiled with the same @option{-G @var{num}}
11017 value.
11018
11019 @item -membedded-data
11020 @itemx -mno-embedded-data
11021 @opindex membedded-data
11022 @opindex mno-embedded-data
11023 Allocate variables to the read-only data section first if possible, then
11024 next in the small data section if possible, otherwise in data.  This gives
11025 slightly slower code than the default, but reduces the amount of RAM required
11026 when executing, and thus may be preferred for some embedded systems.
11027
11028 @item -muninit-const-in-rodata
11029 @itemx -mno-uninit-const-in-rodata
11030 @opindex muninit-const-in-rodata
11031 @opindex mno-uninit-const-in-rodata
11032 Put uninitialized @code{const} variables in the read-only data section.
11033 This option is only meaningful in conjunction with @option{-membedded-data}.
11034
11035 @item -msplit-addresses
11036 @itemx -mno-split-addresses
11037 @opindex msplit-addresses
11038 @opindex mno-split-addresses
11039 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
11040 relocation operators.  This option has been superseded by
11041 @option{-mexplicit-relocs} but is retained for backwards compatibility.
11042
11043 @item -mexplicit-relocs
11044 @itemx -mno-explicit-relocs
11045 @opindex mexplicit-relocs
11046 @opindex mno-explicit-relocs
11047 Use (do not use) assembler relocation operators when dealing with symbolic
11048 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
11049 is to use assembler macros instead.
11050
11051 @option{-mexplicit-relocs} is the default if GCC was configured
11052 to use an assembler that supports relocation operators.
11053
11054 @item -mcheck-zero-division
11055 @itemx -mno-check-zero-division
11056 @opindex mcheck-zero-division
11057 @opindex mno-check-zero-division
11058 Trap (do not trap) on integer division by zero.  The default is
11059 @option{-mcheck-zero-division}.
11060
11061 @item -mdivide-traps
11062 @itemx -mdivide-breaks
11063 @opindex mdivide-traps
11064 @opindex mdivide-breaks
11065 MIPS systems check for division by zero by generating either a
11066 conditional trap or a break instruction.  Using traps results in
11067 smaller code, but is only supported on MIPS II and later.  Also, some
11068 versions of the Linux kernel have a bug that prevents trap from
11069 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
11070 allow conditional traps on architectures that support them and
11071 @option{-mdivide-breaks} to force the use of breaks.
11072
11073 The default is usually @option{-mdivide-traps}, but this can be
11074 overridden at configure time using @option{--with-divide=breaks}.
11075 Divide-by-zero checks can be completely disabled using
11076 @option{-mno-check-zero-division}.
11077
11078 @item -mmemcpy
11079 @itemx -mno-memcpy
11080 @opindex mmemcpy
11081 @opindex mno-memcpy
11082 Force (do not force) the use of @code{memcpy()} for non-trivial block
11083 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
11084 most constant-sized copies.
11085
11086 @item -mlong-calls
11087 @itemx -mno-long-calls
11088 @opindex mlong-calls
11089 @opindex mno-long-calls
11090 Disable (do not disable) use of the @code{jal} instruction.  Calling
11091 functions using @code{jal} is more efficient but requires the caller
11092 and callee to be in the same 256 megabyte segment.
11093
11094 This option has no effect on abicalls code.  The default is
11095 @option{-mno-long-calls}.
11096
11097 @item -mmad
11098 @itemx -mno-mad
11099 @opindex mmad
11100 @opindex mno-mad
11101 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
11102 instructions, as provided by the R4650 ISA@.
11103
11104 @item -mfused-madd
11105 @itemx -mno-fused-madd
11106 @opindex mfused-madd
11107 @opindex mno-fused-madd
11108 Enable (disable) use of the floating point multiply-accumulate
11109 instructions, when they are available.  The default is
11110 @option{-mfused-madd}.
11111
11112 When multiply-accumulate instructions are used, the intermediate
11113 product is calculated to infinite precision and is not subject to
11114 the FCSR Flush to Zero bit.  This may be undesirable in some
11115 circumstances.
11116
11117 @item -nocpp
11118 @opindex nocpp
11119 Tell the MIPS assembler to not run its preprocessor over user
11120 assembler files (with a @samp{.s} suffix) when assembling them.
11121
11122 @item -mfix-r4000
11123 @itemx -mno-fix-r4000
11124 @opindex mfix-r4000
11125 @opindex mno-fix-r4000
11126 Work around certain R4000 CPU errata:
11127 @itemize @minus
11128 @item
11129 A double-word or a variable shift may give an incorrect result if executed
11130 immediately after starting an integer division.
11131 @item
11132 A double-word or a variable shift may give an incorrect result if executed
11133 while an integer multiplication is in progress.
11134 @item
11135 An integer division may give an incorrect result if started in a delay slot
11136 of a taken branch or a jump.
11137 @end itemize
11138
11139 @item -mfix-r4400
11140 @itemx -mno-fix-r4400
11141 @opindex mfix-r4400
11142 @opindex mno-fix-r4400
11143 Work around certain R4400 CPU errata:
11144 @itemize @minus
11145 @item
11146 A double-word or a variable shift may give an incorrect result if executed
11147 immediately after starting an integer division.
11148 @end itemize
11149
11150 @item -mfix-vr4120
11151 @itemx -mno-fix-vr4120
11152 @opindex mfix-vr4120
11153 Work around certain VR4120 errata:
11154 @itemize @minus
11155 @item
11156 @code{dmultu} does not always produce the correct result.
11157 @item
11158 @code{div} and @code{ddiv} do not always produce the correct result if one
11159 of the operands is negative.
11160 @end itemize
11161 The workarounds for the division errata rely on special functions in
11162 @file{libgcc.a}.  At present, these functions are only provided by
11163 the @code{mips64vr*-elf} configurations.
11164
11165 Other VR4120 errata require a nop to be inserted between certain pairs of
11166 instructions.  These errata are handled by the assembler, not by GCC itself.
11167
11168 @item -mfix-vr4130
11169 @opindex mfix-vr4130
11170 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11171 workarounds are implemented by the assembler rather than by GCC,
11172 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11173 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11174 instructions are available instead.
11175
11176 @item -mfix-sb1
11177 @itemx -mno-fix-sb1
11178 @opindex mfix-sb1
11179 Work around certain SB-1 CPU core errata.
11180 (This flag currently works around the SB-1 revision 2
11181 ``F1'' and ``F2'' floating point errata.)
11182
11183 @item -mflush-func=@var{func}
11184 @itemx -mno-flush-func
11185 @opindex mflush-func
11186 Specifies the function to call to flush the I and D caches, or to not
11187 call any such function.  If called, the function must take the same
11188 arguments as the common @code{_flush_func()}, that is, the address of the
11189 memory range for which the cache is being flushed, the size of the
11190 memory range, and the number 3 (to flush both caches).  The default
11191 depends on the target GCC was configured for, but commonly is either
11192 @samp{_flush_func} or @samp{__cpu_flush}.
11193
11194 @item -mbranch-likely
11195 @itemx -mno-branch-likely
11196 @opindex mbranch-likely
11197 @opindex mno-branch-likely
11198 Enable or disable use of Branch Likely instructions, regardless of the
11199 default for the selected architecture.  By default, Branch Likely
11200 instructions may be generated if they are supported by the selected
11201 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11202 and processors which implement those architectures; for those, Branch
11203 Likely instructions will not be generated by default because the MIPS32
11204 and MIPS64 architectures specifically deprecate their use.
11205
11206 @item -mfp-exceptions
11207 @itemx -mno-fp-exceptions
11208 @opindex mfp-exceptions
11209 Specifies whether FP exceptions are enabled.  This affects how we schedule
11210 FP instructions for some processors.  The default is that FP exceptions are
11211 enabled.
11212
11213 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11214 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11215 FP pipe.
11216
11217 @item -mvr4130-align
11218 @itemx -mno-vr4130-align
11219 @opindex mvr4130-align
11220 The VR4130 pipeline is two-way superscalar, but can only issue two
11221 instructions together if the first one is 8-byte aligned.  When this
11222 option is enabled, GCC will align pairs of instructions that it
11223 thinks should execute in parallel.
11224
11225 This option only has an effect when optimizing for the VR4130.
11226 It normally makes code faster, but at the expense of making it bigger.
11227 It is enabled by default at optimization level @option{-O3}.
11228 @end table
11229
11230 @node MMIX Options
11231 @subsection MMIX Options
11232 @cindex MMIX Options
11233
11234 These options are defined for the MMIX:
11235
11236 @table @gcctabopt
11237 @item -mlibfuncs
11238 @itemx -mno-libfuncs
11239 @opindex mlibfuncs
11240 @opindex mno-libfuncs
11241 Specify that intrinsic library functions are being compiled, passing all
11242 values in registers, no matter the size.
11243
11244 @item -mepsilon
11245 @itemx -mno-epsilon
11246 @opindex mepsilon
11247 @opindex mno-epsilon
11248 Generate floating-point comparison instructions that compare with respect
11249 to the @code{rE} epsilon register.
11250
11251 @item -mabi=mmixware
11252 @itemx -mabi=gnu
11253 @opindex mabi-mmixware
11254 @opindex mabi=gnu
11255 Generate code that passes function parameters and return values that (in
11256 the called function) are seen as registers @code{$0} and up, as opposed to
11257 the GNU ABI which uses global registers @code{$231} and up.
11258
11259 @item -mzero-extend
11260 @itemx -mno-zero-extend
11261 @opindex mzero-extend
11262 @opindex mno-zero-extend
11263 When reading data from memory in sizes shorter than 64 bits, use (do not
11264 use) zero-extending load instructions by default, rather than
11265 sign-extending ones.
11266
11267 @item -mknuthdiv
11268 @itemx -mno-knuthdiv
11269 @opindex mknuthdiv
11270 @opindex mno-knuthdiv
11271 Make the result of a division yielding a remainder have the same sign as
11272 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11273 remainder follows the sign of the dividend.  Both methods are
11274 arithmetically valid, the latter being almost exclusively used.
11275
11276 @item -mtoplevel-symbols
11277 @itemx -mno-toplevel-symbols
11278 @opindex mtoplevel-symbols
11279 @opindex mno-toplevel-symbols
11280 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11281 code can be used with the @code{PREFIX} assembly directive.
11282
11283 @item -melf
11284 @opindex melf
11285 Generate an executable in the ELF format, rather than the default
11286 @samp{mmo} format used by the @command{mmix} simulator.
11287
11288 @item -mbranch-predict
11289 @itemx -mno-branch-predict
11290 @opindex mbranch-predict
11291 @opindex mno-branch-predict
11292 Use (do not use) the probable-branch instructions, when static branch
11293 prediction indicates a probable branch.
11294
11295 @item -mbase-addresses
11296 @itemx -mno-base-addresses
11297 @opindex mbase-addresses
11298 @opindex mno-base-addresses
11299 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11300 base address automatically generates a request (handled by the assembler
11301 and the linker) for a constant to be set up in a global register.  The
11302 register is used for one or more base address requests within the range 0
11303 to 255 from the value held in the register.  The generally leads to short
11304 and fast code, but the number of different data items that can be
11305 addressed is limited.  This means that a program that uses lots of static
11306 data may require @option{-mno-base-addresses}.
11307
11308 @item -msingle-exit
11309 @itemx -mno-single-exit
11310 @opindex msingle-exit
11311 @opindex mno-single-exit
11312 Force (do not force) generated code to have a single exit point in each
11313 function.
11314 @end table
11315
11316 @node MN10300 Options
11317 @subsection MN10300 Options
11318 @cindex MN10300 options
11319
11320 These @option{-m} options are defined for Matsushita MN10300 architectures:
11321
11322 @table @gcctabopt
11323 @item -mmult-bug
11324 @opindex mmult-bug
11325 Generate code to avoid bugs in the multiply instructions for the MN10300
11326 processors.  This is the default.
11327
11328 @item -mno-mult-bug
11329 @opindex mno-mult-bug
11330 Do not generate code to avoid bugs in the multiply instructions for the
11331 MN10300 processors.
11332
11333 @item -mam33
11334 @opindex mam33
11335 Generate code which uses features specific to the AM33 processor.
11336
11337 @item -mno-am33
11338 @opindex mno-am33
11339 Do not generate code which uses features specific to the AM33 processor.  This
11340 is the default.
11341
11342 @item -mreturn-pointer-on-d0
11343 @opindex mreturn-pointer-on-d0
11344 When generating a function which returns a pointer, return the pointer
11345 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11346 only in a0, and attempts to call such functions without a prototype
11347 would result in errors.  Note that this option is on by default; use
11348 @option{-mno-return-pointer-on-d0} to disable it.
11349
11350 @item -mno-crt0
11351 @opindex mno-crt0
11352 Do not link in the C run-time initialization object file.
11353
11354 @item -mrelax
11355 @opindex mrelax
11356 Indicate to the linker that it should perform a relaxation optimization pass
11357 to shorten branches, calls and absolute memory addresses.  This option only
11358 has an effect when used on the command line for the final link step.
11359
11360 This option makes symbolic debugging impossible.
11361 @end table
11362
11363 @node MT Options
11364 @subsection MT Options
11365 @cindex MT options
11366
11367 These @option{-m} options are defined for Morpho MT architectures:
11368
11369 @table @gcctabopt
11370
11371 @item -march=@var{cpu-type}
11372 @opindex march
11373 Generate code that will run on @var{cpu-type}, which is the name of a system
11374 representing a certain processor type.  Possible values for
11375 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
11376 @samp{ms1-16-003} and @samp{ms2}.
11377
11378 When this option is not used, the default is @option{-march=ms1-16-002}.
11379
11380 @item -mbacc
11381 @opindex mbacc
11382 Use byte loads and stores when generating code.
11383
11384 @item -mno-bacc
11385 @opindex mno-bacc
11386 Do not use byte loads and stores when generating code.
11387
11388 @item -msim
11389 @opindex msim
11390 Use simulator runtime
11391
11392 @item -mno-crt0
11393 @opindex mno-crt0
11394 Do not link in the C run-time initialization object file
11395 @file{crti.o}.  Other run-time initialization and termination files
11396 such as @file{startup.o} and @file{exit.o} are still included on the
11397 linker command line.
11398
11399 @end table
11400
11401 @node PDP-11 Options
11402 @subsection PDP-11 Options
11403 @cindex PDP-11 Options
11404
11405 These options are defined for the PDP-11:
11406
11407 @table @gcctabopt
11408 @item -mfpu
11409 @opindex mfpu
11410 Use hardware FPP floating point.  This is the default.  (FIS floating
11411 point on the PDP-11/40 is not supported.)
11412
11413 @item -msoft-float
11414 @opindex msoft-float
11415 Do not use hardware floating point.
11416
11417 @item -mac0
11418 @opindex mac0
11419 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
11420
11421 @item -mno-ac0
11422 @opindex mno-ac0
11423 Return floating-point results in memory.  This is the default.
11424
11425 @item -m40
11426 @opindex m40
11427 Generate code for a PDP-11/40.
11428
11429 @item -m45
11430 @opindex m45
11431 Generate code for a PDP-11/45.  This is the default.
11432
11433 @item -m10
11434 @opindex m10
11435 Generate code for a PDP-11/10.
11436
11437 @item -mbcopy-builtin
11438 @opindex bcopy-builtin
11439 Use inline @code{movmemhi} patterns for copying memory.  This is the
11440 default.
11441
11442 @item -mbcopy
11443 @opindex mbcopy
11444 Do not use inline @code{movmemhi} patterns for copying memory.
11445
11446 @item -mint16
11447 @itemx -mno-int32
11448 @opindex mint16
11449 @opindex mno-int32
11450 Use 16-bit @code{int}.  This is the default.
11451
11452 @item -mint32
11453 @itemx -mno-int16
11454 @opindex mint32
11455 @opindex mno-int16
11456 Use 32-bit @code{int}.
11457
11458 @item -mfloat64
11459 @itemx -mno-float32
11460 @opindex mfloat64
11461 @opindex mno-float32
11462 Use 64-bit @code{float}.  This is the default.
11463
11464 @item -mfloat32
11465 @itemx -mno-float64
11466 @opindex mfloat32
11467 @opindex mno-float64
11468 Use 32-bit @code{float}.
11469
11470 @item -mabshi
11471 @opindex mabshi
11472 Use @code{abshi2} pattern.  This is the default.
11473
11474 @item -mno-abshi
11475 @opindex mno-abshi
11476 Do not use @code{abshi2} pattern.
11477
11478 @item -mbranch-expensive
11479 @opindex mbranch-expensive
11480 Pretend that branches are expensive.  This is for experimenting with
11481 code generation only.
11482
11483 @item -mbranch-cheap
11484 @opindex mbranch-cheap
11485 Do not pretend that branches are expensive.  This is the default.
11486
11487 @item -msplit
11488 @opindex msplit
11489 Generate code for a system with split I&D@.
11490
11491 @item -mno-split
11492 @opindex mno-split
11493 Generate code for a system without split I&D@.  This is the default.
11494
11495 @item -munix-asm
11496 @opindex munix-asm
11497 Use Unix assembler syntax.  This is the default when configured for
11498 @samp{pdp11-*-bsd}.
11499
11500 @item -mdec-asm
11501 @opindex mdec-asm
11502 Use DEC assembler syntax.  This is the default when configured for any
11503 PDP-11 target other than @samp{pdp11-*-bsd}.
11504 @end table
11505
11506 @node PowerPC Options
11507 @subsection PowerPC Options
11508 @cindex PowerPC options
11509
11510 These are listed under @xref{RS/6000 and PowerPC Options}.
11511
11512 @node RS/6000 and PowerPC Options
11513 @subsection IBM RS/6000 and PowerPC Options
11514 @cindex RS/6000 and PowerPC Options
11515 @cindex IBM RS/6000 and PowerPC Options
11516
11517 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11518 @table @gcctabopt
11519 @item -mpower
11520 @itemx -mno-power
11521 @itemx -mpower2
11522 @itemx -mno-power2
11523 @itemx -mpowerpc
11524 @itemx -mno-powerpc
11525 @itemx -mpowerpc-gpopt
11526 @itemx -mno-powerpc-gpopt
11527 @itemx -mpowerpc-gfxopt
11528 @itemx -mno-powerpc-gfxopt
11529 @itemx -mpowerpc64
11530 @itemx -mno-powerpc64
11531 @itemx -mmfcrf
11532 @itemx -mno-mfcrf
11533 @itemx -mpopcntb
11534 @itemx -mno-popcntb
11535 @itemx -mfprnd
11536 @itemx -mno-fprnd
11537 @opindex mpower
11538 @opindex mno-power
11539 @opindex mpower2
11540 @opindex mno-power2
11541 @opindex mpowerpc
11542 @opindex mno-powerpc
11543 @opindex mpowerpc-gpopt
11544 @opindex mno-powerpc-gpopt
11545 @opindex mpowerpc-gfxopt
11546 @opindex mno-powerpc-gfxopt
11547 @opindex mpowerpc64
11548 @opindex mno-powerpc64
11549 @opindex mmfcrf
11550 @opindex mno-mfcrf
11551 @opindex mpopcntb
11552 @opindex mno-popcntb
11553 @opindex mfprnd
11554 @opindex mno-fprnd
11555 GCC supports two related instruction set architectures for the
11556 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
11557 instructions supported by the @samp{rios} chip set used in the original
11558 RS/6000 systems and the @dfn{PowerPC} instruction set is the
11559 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
11560 the IBM 4xx, 6xx, and follow-on microprocessors.
11561
11562 Neither architecture is a subset of the other.  However there is a
11563 large common subset of instructions supported by both.  An MQ
11564 register is included in processors supporting the POWER architecture.
11565
11566 You use these options to specify which instructions are available on the
11567 processor you are using.  The default value of these options is
11568 determined when configuring GCC@.  Specifying the
11569 @option{-mcpu=@var{cpu_type}} overrides the specification of these
11570 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
11571 rather than the options listed above.
11572
11573 The @option{-mpower} option allows GCC to generate instructions that
11574 are found only in the POWER architecture and to use the MQ register.
11575 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
11576 to generate instructions that are present in the POWER2 architecture but
11577 not the original POWER architecture.
11578
11579 The @option{-mpowerpc} option allows GCC to generate instructions that
11580 are found only in the 32-bit subset of the PowerPC architecture.
11581 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
11582 GCC to use the optional PowerPC architecture instructions in the
11583 General Purpose group, including floating-point square root.  Specifying
11584 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
11585 use the optional PowerPC architecture instructions in the Graphics
11586 group, including floating-point select.
11587
11588 The @option{-mmfcrf} option allows GCC to generate the move from
11589 condition register field instruction implemented on the POWER4
11590 processor and other processors that support the PowerPC V2.01
11591 architecture.
11592 The @option{-mpopcntb} option allows GCC to generate the popcount and
11593 double precision FP reciprocal estimate instruction implemented on the
11594 POWER5 processor and other processors that support the PowerPC V2.02
11595 architecture.
11596 The @option{-mfprnd} option allows GCC to generate the FP round to
11597 integer instructions implemented on the POWER5+ processor and other
11598 processors that support the PowerPC V2.03 architecture.
11599
11600 The @option{-mpowerpc64} option allows GCC to generate the additional
11601 64-bit instructions that are found in the full PowerPC64 architecture
11602 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
11603 @option{-mno-powerpc64}.
11604
11605 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
11606 will use only the instructions in the common subset of both
11607 architectures plus some special AIX common-mode calls, and will not use
11608 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
11609 permits GCC to use any instruction from either architecture and to
11610 allow use of the MQ register; specify this for the Motorola MPC601.
11611
11612 @item -mnew-mnemonics
11613 @itemx -mold-mnemonics
11614 @opindex mnew-mnemonics
11615 @opindex mold-mnemonics
11616 Select which mnemonics to use in the generated assembler code.  With
11617 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
11618 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
11619 assembler mnemonics defined for the POWER architecture.  Instructions
11620 defined in only one architecture have only one mnemonic; GCC uses that
11621 mnemonic irrespective of which of these options is specified.
11622
11623 GCC defaults to the mnemonics appropriate for the architecture in
11624 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
11625 value of these option.  Unless you are building a cross-compiler, you
11626 should normally not specify either @option{-mnew-mnemonics} or
11627 @option{-mold-mnemonics}, but should instead accept the default.
11628
11629 @item -mcpu=@var{cpu_type}
11630 @opindex mcpu
11631 Set architecture type, register usage, choice of mnemonics, and
11632 instruction scheduling parameters for machine type @var{cpu_type}.
11633 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
11634 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
11635 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
11636 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
11637 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
11638 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
11639 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
11640 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
11641 @samp{common}, @samp{powerpc}, @samp{powerpc64},
11642 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
11643
11644 @option{-mcpu=common} selects a completely generic processor.  Code
11645 generated under this option will run on any POWER or PowerPC processor.
11646 GCC will use only the instructions in the common subset of both
11647 architectures, and will not use the MQ register.  GCC assumes a generic
11648 processor model for scheduling purposes.
11649
11650 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
11651 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
11652 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
11653 types, with an appropriate, generic processor model assumed for
11654 scheduling purposes.
11655
11656 The other options specify a specific processor.  Code generated under
11657 those options will run best on that processor, and may not run at all on
11658 others.
11659
11660 The @option{-mcpu} options automatically enable or disable the
11661 following options: @option{-maltivec}, @option{-mfprnd},
11662 @option{-mhard-float}, @option{-mmfcrf}, @option{-mmultiple},
11663 @option{-mnew-mnemonics}, @option{-mpopcntb}, @option{-mpower},
11664 @option{-mpower2}, @option{-mpowerpc64}, @option{-mpowerpc-gpopt},
11665 @option{-mpowerpc-gfxopt}, @option{-mstring}, @option{-mmulhw}, @option{-mdlmzb}.
11666 The particular options
11667 set for any particular CPU will vary between compiler versions,
11668 depending on what setting seems to produce optimal code for that CPU;
11669 it doesn't necessarily reflect the actual hardware's capabilities.  If
11670 you wish to set an individual option to a particular value, you may
11671 specify it after the @option{-mcpu} option, like @samp{-mcpu=970
11672 -mno-altivec}.
11673
11674 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
11675 not enabled or disabled by the @option{-mcpu} option at present because
11676 AIX does not have full support for these options.  You may still
11677 enable or disable them individually if you're sure it'll work in your
11678 environment.
11679
11680 @item -mtune=@var{cpu_type}
11681 @opindex mtune
11682 Set the instruction scheduling parameters for machine type
11683 @var{cpu_type}, but do not set the architecture type, register usage, or
11684 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
11685 values for @var{cpu_type} are used for @option{-mtune} as for
11686 @option{-mcpu}.  If both are specified, the code generated will use the
11687 architecture, registers, and mnemonics set by @option{-mcpu}, but the
11688 scheduling parameters set by @option{-mtune}.
11689
11690 @item -mswdiv
11691 @itemx -mno-swdiv
11692 @opindex mswdiv
11693 @opindex mno-swdiv
11694 Generate code to compute division as reciprocal estimate and iterative
11695 refinement, creating opportunities for increased throughput.  This
11696 feature requires: optional PowerPC Graphics instruction set for single
11697 precision and FRE instruction for double precision, assuming divides
11698 cannot generate user-visible traps, and the domain values not include
11699 Infinities, denormals or zero denominator.
11700
11701 @item -maltivec
11702 @itemx -mno-altivec
11703 @opindex maltivec
11704 @opindex mno-altivec
11705 Generate code that uses (does not use) AltiVec instructions, and also
11706 enable the use of built-in functions that allow more direct access to
11707 the AltiVec instruction set.  You may also need to set
11708 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
11709 enhancements.
11710
11711 @item -mvrsave
11712 @item -mno-vrsave
11713 @opindex mvrsave
11714 @opindex mno-vrsave
11715 Generate VRSAVE instructions when generating AltiVec code.
11716
11717 @item -msecure-plt
11718 @opindex msecure-plt
11719 Generate code that allows ld and ld.so to build executables and shared
11720 libraries with non-exec .plt and .got sections.  This is a PowerPC
11721 32-bit SYSV ABI option.
11722
11723 @item -mbss-plt
11724 @opindex mbss-plt
11725 Generate code that uses a BSS .plt section that ld.so fills in, and
11726 requires .plt and .got sections that are both writable and executable.
11727 This is a PowerPC 32-bit SYSV ABI option.
11728
11729 @item -misel
11730 @itemx -mno-isel
11731 @opindex misel
11732 @opindex mno-isel
11733 This switch enables or disables the generation of ISEL instructions.
11734
11735 @item -misel=@var{yes/no}
11736 This switch has been deprecated.  Use @option{-misel} and
11737 @option{-mno-isel} instead.
11738
11739 @item -mspe
11740 @itemx -mno-spe
11741 @opindex mspe
11742 @opindex mno-spe
11743 This switch enables or disables the generation of SPE simd
11744 instructions.
11745
11746 @item -mspe=@var{yes/no}
11747 This option has been deprecated.  Use @option{-mspe} and
11748 @option{-mno-spe} instead.
11749
11750 @item -mfloat-gprs=@var{yes/single/double/no}
11751 @itemx -mfloat-gprs
11752 @opindex mfloat-gprs
11753 This switch enables or disables the generation of floating point
11754 operations on the general purpose registers for architectures that
11755 support it.
11756
11757 The argument @var{yes} or @var{single} enables the use of
11758 single-precision floating point operations.
11759
11760 The argument @var{double} enables the use of single and
11761 double-precision floating point operations.
11762
11763 The argument @var{no} disables floating point operations on the
11764 general purpose registers.
11765
11766 This option is currently only available on the MPC854x.
11767
11768 @item -m32
11769 @itemx -m64
11770 @opindex m32
11771 @opindex m64
11772 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
11773 targets (including GNU/Linux).  The 32-bit environment sets int, long
11774 and pointer to 32 bits and generates code that runs on any PowerPC
11775 variant.  The 64-bit environment sets int to 32 bits and long and
11776 pointer to 64 bits, and generates code for PowerPC64, as for
11777 @option{-mpowerpc64}.
11778
11779 @item -mfull-toc
11780 @itemx -mno-fp-in-toc
11781 @itemx -mno-sum-in-toc
11782 @itemx -mminimal-toc
11783 @opindex mfull-toc
11784 @opindex mno-fp-in-toc
11785 @opindex mno-sum-in-toc
11786 @opindex mminimal-toc
11787 Modify generation of the TOC (Table Of Contents), which is created for
11788 every executable file.  The @option{-mfull-toc} option is selected by
11789 default.  In that case, GCC will allocate at least one TOC entry for
11790 each unique non-automatic variable reference in your program.  GCC
11791 will also place floating-point constants in the TOC@.  However, only
11792 16,384 entries are available in the TOC@.
11793
11794 If you receive a linker error message that saying you have overflowed
11795 the available TOC space, you can reduce the amount of TOC space used
11796 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
11797 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
11798 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
11799 generate code to calculate the sum of an address and a constant at
11800 run-time instead of putting that sum into the TOC@.  You may specify one
11801 or both of these options.  Each causes GCC to produce very slightly
11802 slower and larger code at the expense of conserving TOC space.
11803
11804 If you still run out of space in the TOC even when you specify both of
11805 these options, specify @option{-mminimal-toc} instead.  This option causes
11806 GCC to make only one TOC entry for every file.  When you specify this
11807 option, GCC will produce code that is slower and larger but which
11808 uses extremely little TOC space.  You may wish to use this option
11809 only on files that contain less frequently executed code.
11810
11811 @item -maix64
11812 @itemx -maix32
11813 @opindex maix64
11814 @opindex maix32
11815 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
11816 @code{long} type, and the infrastructure needed to support them.
11817 Specifying @option{-maix64} implies @option{-mpowerpc64} and
11818 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
11819 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
11820
11821 @item -mxl-compat
11822 @itemx -mno-xl-compat
11823 @opindex mxl-compat
11824 @opindex mno-xl-compat
11825 Produce code that conforms more closely to IBM XL compiler semantics
11826 when using AIX-compatible ABI.  Pass floating-point arguments to
11827 prototyped functions beyond the register save area (RSA) on the stack
11828 in addition to argument FPRs.  Do not assume that most significant
11829 double in 128-bit long double value is properly rounded when comparing
11830 values and converting to double.  Use XL symbol names for long double
11831 support routines.
11832
11833 The AIX calling convention was extended but not initially documented to
11834 handle an obscure K&R C case of calling a function that takes the
11835 address of its arguments with fewer arguments than declared.  IBM XL
11836 compilers access floating point arguments which do not fit in the
11837 RSA from the stack when a subroutine is compiled without
11838 optimization.  Because always storing floating-point arguments on the
11839 stack is inefficient and rarely needed, this option is not enabled by
11840 default and only is necessary when calling subroutines compiled by IBM
11841 XL compilers without optimization.
11842
11843 @item -mpe
11844 @opindex mpe
11845 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
11846 application written to use message passing with special startup code to
11847 enable the application to run.  The system must have PE installed in the
11848 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
11849 must be overridden with the @option{-specs=} option to specify the
11850 appropriate directory location.  The Parallel Environment does not
11851 support threads, so the @option{-mpe} option and the @option{-pthread}
11852 option are incompatible.
11853
11854 @item -malign-natural
11855 @itemx -malign-power
11856 @opindex malign-natural
11857 @opindex malign-power
11858 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
11859 @option{-malign-natural} overrides the ABI-defined alignment of larger
11860 types, such as floating-point doubles, on their natural size-based boundary.
11861 The option @option{-malign-power} instructs GCC to follow the ABI-specified
11862 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
11863
11864 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
11865 is not supported.
11866
11867 @item -msoft-float
11868 @itemx -mhard-float
11869 @opindex msoft-float
11870 @opindex mhard-float
11871 Generate code that does not use (uses) the floating-point register set.
11872 Software floating point emulation is provided if you use the
11873 @option{-msoft-float} option, and pass the option to GCC when linking.
11874
11875 @item -mmultiple
11876 @itemx -mno-multiple
11877 @opindex mmultiple
11878 @opindex mno-multiple
11879 Generate code that uses (does not use) the load multiple word
11880 instructions and the store multiple word instructions.  These
11881 instructions are generated by default on POWER systems, and not
11882 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
11883 endian PowerPC systems, since those instructions do not work when the
11884 processor is in little endian mode.  The exceptions are PPC740 and
11885 PPC750 which permit the instructions usage in little endian mode.
11886
11887 @item -mstring
11888 @itemx -mno-string
11889 @opindex mstring
11890 @opindex mno-string
11891 Generate code that uses (does not use) the load string instructions
11892 and the store string word instructions to save multiple registers and
11893 do small block moves.  These instructions are generated by default on
11894 POWER systems, and not generated on PowerPC systems.  Do not use
11895 @option{-mstring} on little endian PowerPC systems, since those
11896 instructions do not work when the processor is in little endian mode.
11897 The exceptions are PPC740 and PPC750 which permit the instructions
11898 usage in little endian mode.
11899
11900 @item -mupdate
11901 @itemx -mno-update
11902 @opindex mupdate
11903 @opindex mno-update
11904 Generate code that uses (does not use) the load or store instructions
11905 that update the base register to the address of the calculated memory
11906 location.  These instructions are generated by default.  If you use
11907 @option{-mno-update}, there is a small window between the time that the
11908 stack pointer is updated and the address of the previous frame is
11909 stored, which means code that walks the stack frame across interrupts or
11910 signals may get corrupted data.
11911
11912 @item -mfused-madd
11913 @itemx -mno-fused-madd
11914 @opindex mfused-madd
11915 @opindex mno-fused-madd
11916 Generate code that uses (does not use) the floating point multiply and
11917 accumulate instructions.  These instructions are generated by default if
11918 hardware floating is used.
11919
11920 @item -mmulhw
11921 @itemx -mno-mulhw
11922 @opindex mmulhw
11923 @opindex mno-mulhw
11924 Generate code that uses (does not use) the half-word multiply and
11925 multiply-accumulate instructions on the IBM 405 and 440 processors.
11926 These instructions are generated by default when targetting those
11927 processors.
11928
11929 @item -mdlmzb
11930 @itemx -mno-dlmzb
11931 @opindex mdlmzb
11932 @opindex mno-dlmzb
11933 Generate code that uses (does not use) the string-search @samp{dlmzb}
11934 instruction on the IBM 405 and 440 processors.  This instruction is
11935 generated by default when targetting those processors.
11936
11937 @item -mno-bit-align
11938 @itemx -mbit-align
11939 @opindex mno-bit-align
11940 @opindex mbit-align
11941 On System V.4 and embedded PowerPC systems do not (do) force structures
11942 and unions that contain bit-fields to be aligned to the base type of the
11943 bit-field.
11944
11945 For example, by default a structure containing nothing but 8
11946 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
11947 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
11948 the structure would be aligned to a 1 byte boundary and be one byte in
11949 size.
11950
11951 @item -mno-strict-align
11952 @itemx -mstrict-align
11953 @opindex mno-strict-align
11954 @opindex mstrict-align
11955 On System V.4 and embedded PowerPC systems do not (do) assume that
11956 unaligned memory references will be handled by the system.
11957
11958 @item -mrelocatable
11959 @itemx -mno-relocatable
11960 @opindex mrelocatable
11961 @opindex mno-relocatable
11962 On embedded PowerPC systems generate code that allows (does not allow)
11963 the program to be relocated to a different address at runtime.  If you
11964 use @option{-mrelocatable} on any module, all objects linked together must
11965 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
11966
11967 @item -mrelocatable-lib
11968 @itemx -mno-relocatable-lib
11969 @opindex mrelocatable-lib
11970 @opindex mno-relocatable-lib
11971 On embedded PowerPC systems generate code that allows (does not allow)
11972 the program to be relocated to a different address at runtime.  Modules
11973 compiled with @option{-mrelocatable-lib} can be linked with either modules
11974 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
11975 with modules compiled with the @option{-mrelocatable} options.
11976
11977 @item -mno-toc
11978 @itemx -mtoc
11979 @opindex mno-toc
11980 @opindex mtoc
11981 On System V.4 and embedded PowerPC systems do not (do) assume that
11982 register 2 contains a pointer to a global area pointing to the addresses
11983 used in the program.
11984
11985 @item -mlittle
11986 @itemx -mlittle-endian
11987 @opindex mlittle
11988 @opindex mlittle-endian
11989 On System V.4 and embedded PowerPC systems compile code for the
11990 processor in little endian mode.  The @option{-mlittle-endian} option is
11991 the same as @option{-mlittle}.
11992
11993 @item -mbig
11994 @itemx -mbig-endian
11995 @opindex mbig
11996 @opindex mbig-endian
11997 On System V.4 and embedded PowerPC systems compile code for the
11998 processor in big endian mode.  The @option{-mbig-endian} option is
11999 the same as @option{-mbig}.
12000
12001 @item -mdynamic-no-pic
12002 @opindex mdynamic-no-pic
12003 On Darwin and Mac OS X systems, compile code so that it is not
12004 relocatable, but that its external references are relocatable.  The
12005 resulting code is suitable for applications, but not shared
12006 libraries.
12007
12008 @item -mprioritize-restricted-insns=@var{priority}
12009 @opindex mprioritize-restricted-insns
12010 This option controls the priority that is assigned to
12011 dispatch-slot restricted instructions during the second scheduling
12012 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
12013 @var{no/highest/second-highest} priority to dispatch slot restricted
12014 instructions.
12015
12016 @item -msched-costly-dep=@var{dependence_type}
12017 @opindex msched-costly-dep
12018 This option controls which dependences are considered costly
12019 by the target during instruction scheduling.  The argument
12020 @var{dependence_type} takes one of the following values:
12021 @var{no}: no dependence is costly,
12022 @var{all}: all dependences are costly,
12023 @var{true_store_to_load}: a true dependence from store to load is costly,
12024 @var{store_to_load}: any dependence from store to load is costly,
12025 @var{number}: any dependence which latency >= @var{number} is costly.
12026
12027 @item -minsert-sched-nops=@var{scheme}
12028 @opindex minsert-sched-nops
12029 This option controls which nop insertion scheme will be used during
12030 the second scheduling pass.  The argument @var{scheme} takes one of the
12031 following values:
12032 @var{no}: Don't insert nops.
12033 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
12034 according to the scheduler's grouping.
12035 @var{regroup_exact}: Insert nops to force costly dependent insns into
12036 separate groups.  Insert exactly as many nops as needed to force an insn
12037 to a new group, according to the estimated processor grouping.
12038 @var{number}: Insert nops to force costly dependent insns into
12039 separate groups.  Insert @var{number} nops to force an insn to a new group.
12040
12041 @item -mcall-sysv
12042 @opindex mcall-sysv
12043 On System V.4 and embedded PowerPC systems compile code using calling
12044 conventions that adheres to the March 1995 draft of the System V
12045 Application Binary Interface, PowerPC processor supplement.  This is the
12046 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
12047
12048 @item -mcall-sysv-eabi
12049 @opindex mcall-sysv-eabi
12050 Specify both @option{-mcall-sysv} and @option{-meabi} options.
12051
12052 @item -mcall-sysv-noeabi
12053 @opindex mcall-sysv-noeabi
12054 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
12055
12056 @item -mcall-solaris
12057 @opindex mcall-solaris
12058 On System V.4 and embedded PowerPC systems compile code for the Solaris
12059 operating system.
12060
12061 @item -mcall-linux
12062 @opindex mcall-linux
12063 On System V.4 and embedded PowerPC systems compile code for the
12064 Linux-based GNU system.
12065
12066 @item -mcall-gnu
12067 @opindex mcall-gnu
12068 On System V.4 and embedded PowerPC systems compile code for the
12069 Hurd-based GNU system.
12070
12071 @item -mcall-netbsd
12072 @opindex mcall-netbsd
12073 On System V.4 and embedded PowerPC systems compile code for the
12074 NetBSD operating system.
12075
12076 @item -maix-struct-return
12077 @opindex maix-struct-return
12078 Return all structures in memory (as specified by the AIX ABI)@.
12079
12080 @item -msvr4-struct-return
12081 @opindex msvr4-struct-return
12082 Return structures smaller than 8 bytes in registers (as specified by the
12083 SVR4 ABI)@.
12084
12085 @item -mabi=@var{abi-type}
12086 @opindex mabi
12087 Extend the current ABI with a particular extension, or remove such extension.
12088 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
12089 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
12090
12091 @item -mabi=spe
12092 @opindex mabi=spe
12093 Extend the current ABI with SPE ABI extensions.  This does not change
12094 the default ABI, instead it adds the SPE ABI extensions to the current
12095 ABI@.
12096
12097 @item -mabi=no-spe
12098 @opindex mabi=no-spe
12099 Disable Booke SPE ABI extensions for the current ABI@.
12100
12101 @item -mabi=ibmlongdouble
12102 @opindex mabi=ibmlongdouble
12103 Change the current ABI to use IBM extended precision long double.
12104 This is a PowerPC 32-bit SYSV ABI option.
12105
12106 @item -mabi=ieeelongdouble
12107 @opindex mabi=ieeelongdouble
12108 Change the current ABI to use IEEE extended precision long double.
12109 This is a PowerPC 32-bit Linux ABI option.
12110
12111 @item -mprototype
12112 @itemx -mno-prototype
12113 @opindex mprototype
12114 @opindex mno-prototype
12115 On System V.4 and embedded PowerPC systems assume that all calls to
12116 variable argument functions are properly prototyped.  Otherwise, the
12117 compiler must insert an instruction before every non prototyped call to
12118 set or clear bit 6 of the condition code register (@var{CR}) to
12119 indicate whether floating point values were passed in the floating point
12120 registers in case the function takes a variable arguments.  With
12121 @option{-mprototype}, only calls to prototyped variable argument functions
12122 will set or clear the bit.
12123
12124 @item -msim
12125 @opindex msim
12126 On embedded PowerPC systems, assume that the startup module is called
12127 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12128 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12129 configurations.
12130
12131 @item -mmvme
12132 @opindex mmvme
12133 On embedded PowerPC systems, assume that the startup module is called
12134 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12135 @file{libc.a}.
12136
12137 @item -mads
12138 @opindex mads
12139 On embedded PowerPC systems, assume that the startup module is called
12140 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12141 @file{libc.a}.
12142
12143 @item -myellowknife
12144 @opindex myellowknife
12145 On embedded PowerPC systems, assume that the startup module is called
12146 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12147 @file{libc.a}.
12148
12149 @item -mvxworks
12150 @opindex mvxworks
12151 On System V.4 and embedded PowerPC systems, specify that you are
12152 compiling for a VxWorks system.
12153
12154 @item -mwindiss
12155 @opindex mwindiss
12156 Specify that you are compiling for the WindISS simulation environment.
12157
12158 @item -memb
12159 @opindex memb
12160 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12161 header to indicate that @samp{eabi} extended relocations are used.
12162
12163 @item -meabi
12164 @itemx -mno-eabi
12165 @opindex meabi
12166 @opindex mno-eabi
12167 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12168 Embedded Applications Binary Interface (eabi) which is a set of
12169 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12170 means that the stack is aligned to an 8 byte boundary, a function
12171 @code{__eabi} is called to from @code{main} to set up the eabi
12172 environment, and the @option{-msdata} option can use both @code{r2} and
12173 @code{r13} to point to two separate small data areas.  Selecting
12174 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12175 do not call an initialization function from @code{main}, and the
12176 @option{-msdata} option will only use @code{r13} to point to a single
12177 small data area.  The @option{-meabi} option is on by default if you
12178 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12179
12180 @item -msdata=eabi
12181 @opindex msdata=eabi
12182 On System V.4 and embedded PowerPC systems, put small initialized
12183 @code{const} global and static data in the @samp{.sdata2} section, which
12184 is pointed to by register @code{r2}.  Put small initialized
12185 non-@code{const} global and static data in the @samp{.sdata} section,
12186 which is pointed to by register @code{r13}.  Put small uninitialized
12187 global and static data in the @samp{.sbss} section, which is adjacent to
12188 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12189 incompatible with the @option{-mrelocatable} option.  The
12190 @option{-msdata=eabi} option also sets the @option{-memb} option.
12191
12192 @item -msdata=sysv
12193 @opindex msdata=sysv
12194 On System V.4 and embedded PowerPC systems, put small global and static
12195 data in the @samp{.sdata} section, which is pointed to by register
12196 @code{r13}.  Put small uninitialized global and static data in the
12197 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12198 The @option{-msdata=sysv} option is incompatible with the
12199 @option{-mrelocatable} option.
12200
12201 @item -msdata=default
12202 @itemx -msdata
12203 @opindex msdata=default
12204 @opindex msdata
12205 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12206 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12207 same as @option{-msdata=sysv}.
12208
12209 @item -msdata-data
12210 @opindex msdata-data
12211 On System V.4 and embedded PowerPC systems, put small global
12212 data in the @samp{.sdata} section.  Put small uninitialized global
12213 data in the @samp{.sbss} section.  Do not use register @code{r13}
12214 to address small data however.  This is the default behavior unless
12215 other @option{-msdata} options are used.
12216
12217 @item -msdata=none
12218 @itemx -mno-sdata
12219 @opindex msdata=none
12220 @opindex mno-sdata
12221 On embedded PowerPC systems, put all initialized global and static data
12222 in the @samp{.data} section, and all uninitialized data in the
12223 @samp{.bss} section.
12224
12225 @item -G @var{num}
12226 @opindex G
12227 @cindex smaller data references (PowerPC)
12228 @cindex .sdata/.sdata2 references (PowerPC)
12229 On embedded PowerPC systems, put global and static items less than or
12230 equal to @var{num} bytes into the small data or bss sections instead of
12231 the normal data or bss section.  By default, @var{num} is 8.  The
12232 @option{-G @var{num}} switch is also passed to the linker.
12233 All modules should be compiled with the same @option{-G @var{num}} value.
12234
12235 @item -mregnames
12236 @itemx -mno-regnames
12237 @opindex mregnames
12238 @opindex mno-regnames
12239 On System V.4 and embedded PowerPC systems do (do not) emit register
12240 names in the assembly language output using symbolic forms.
12241
12242 @item -mlongcall
12243 @itemx -mno-longcall
12244 @opindex mlongcall
12245 @opindex mno-longcall
12246 By default assume that all calls are far away so that a longer more
12247 expensive calling sequence is required.  This is required for calls
12248 further than 32 megabytes (33,554,432 bytes) from the current location.
12249 A short call will be generated if the compiler knows
12250 the call cannot be that far away.  This setting can be overridden by
12251 the @code{shortcall} function attribute, or by @code{#pragma
12252 longcall(0)}.
12253
12254 Some linkers are capable of detecting out-of-range calls and generating
12255 glue code on the fly.  On these systems, long calls are unnecessary and
12256 generate slower code.  As of this writing, the AIX linker can do this,
12257 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12258 to the GNU linker for 32-bit PowerPC systems as well.
12259
12260 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12261 callee, L42'', plus a ``branch island'' (glue code).  The two target
12262 addresses represent the callee and the ``branch island''.  The
12263 Darwin/PPC linker will prefer the first address and generate a ``bl
12264 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12265 otherwise, the linker will generate ``bl L42'' to call the ``branch
12266 island''.  The ``branch island'' is appended to the body of the
12267 calling function; it computes the full 32-bit address of the callee
12268 and jumps to it.
12269
12270 On Mach-O (Darwin) systems, this option directs the compiler emit to
12271 the glue for every direct call, and the Darwin linker decides whether
12272 to use or discard it.
12273
12274 In the future, we may cause GCC to ignore all longcall specifications
12275 when the linker is known to generate glue.
12276
12277 @item -pthread
12278 @opindex pthread
12279 Adds support for multithreading with the @dfn{pthreads} library.
12280 This option sets flags for both the preprocessor and linker.
12281
12282 @end table
12283
12284 @node S/390 and zSeries Options
12285 @subsection S/390 and zSeries Options
12286 @cindex S/390 and zSeries Options
12287
12288 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12289
12290 @table @gcctabopt
12291 @item -mhard-float
12292 @itemx -msoft-float
12293 @opindex mhard-float
12294 @opindex msoft-float
12295 Use (do not use) the hardware floating-point instructions and registers
12296 for floating-point operations.  When @option{-msoft-float} is specified,
12297 functions in @file{libgcc.a} will be used to perform floating-point
12298 operations.  When @option{-mhard-float} is specified, the compiler
12299 generates IEEE floating-point instructions.  This is the default.
12300
12301 @item -mlong-double-64
12302 @itemx -mlong-double-128
12303 @opindex mlong-double-64
12304 @opindex mlong-double-128
12305 These switches control the size of @code{long double} type. A size
12306 of 64bit makes the @code{long double} type equivalent to the @code{double}
12307 type. This is the default.
12308
12309 @item -mbackchain
12310 @itemx -mno-backchain
12311 @opindex mbackchain
12312 @opindex mno-backchain
12313 Store (do not store) the address of the caller's frame as backchain pointer
12314 into the callee's stack frame.
12315 A backchain may be needed to allow debugging using tools that do not understand
12316 DWARF-2 call frame information.
12317 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12318 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12319 the backchain is placed into the topmost word of the 96/160 byte register
12320 save area.
12321
12322 In general, code compiled with @option{-mbackchain} is call-compatible with
12323 code compiled with @option{-mmo-backchain}; however, use of the backchain
12324 for debugging purposes usually requires that the whole binary is built with
12325 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12326 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12327 to build a linux kernel use @option{-msoft-float}.
12328
12329 The default is to not maintain the backchain.
12330
12331 @item -mpacked-stack
12332 @item -mno-packed-stack
12333 @opindex mpacked-stack
12334 @opindex mno-packed-stack
12335 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12336 specified, the compiler uses the all fields of the 96/160 byte register save
12337 area only for their default purpose; unused fields still take up stack space.
12338 When @option{-mpacked-stack} is specified, register save slots are densely
12339 packed at the top of the register save area; unused space is reused for other
12340 purposes, allowing for more efficient use of the available stack space.
12341 However, when @option{-mbackchain} is also in effect, the topmost word of
12342 the save area is always used to store the backchain, and the return address
12343 register is always saved two words below the backchain.
12344
12345 As long as the stack frame backchain is not used, code generated with
12346 @option{-mpacked-stack} is call-compatible with code generated with
12347 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
12348 S/390 or zSeries generated code that uses the stack frame backchain at run
12349 time, not just for debugging purposes.  Such code is not call-compatible
12350 with code compiled with @option{-mpacked-stack}.  Also, note that the
12351 combination of @option{-mbackchain},
12352 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12353 to build a linux kernel use @option{-msoft-float}.
12354
12355 The default is to not use the packed stack layout.
12356
12357 @item -msmall-exec
12358 @itemx -mno-small-exec
12359 @opindex msmall-exec
12360 @opindex mno-small-exec
12361 Generate (or do not generate) code using the @code{bras} instruction
12362 to do subroutine calls.
12363 This only works reliably if the total executable size does not
12364 exceed 64k.  The default is to use the @code{basr} instruction instead,
12365 which does not have this limitation.
12366
12367 @item -m64
12368 @itemx -m31
12369 @opindex m64
12370 @opindex m31
12371 When @option{-m31} is specified, generate code compliant to the
12372 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
12373 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
12374 particular to generate 64-bit instructions.  For the @samp{s390}
12375 targets, the default is @option{-m31}, while the @samp{s390x}
12376 targets default to @option{-m64}.
12377
12378 @item -mzarch
12379 @itemx -mesa
12380 @opindex mzarch
12381 @opindex mesa
12382 When @option{-mzarch} is specified, generate code using the
12383 instructions available on z/Architecture.
12384 When @option{-mesa} is specified, generate code using the
12385 instructions available on ESA/390.  Note that @option{-mesa} is
12386 not possible with @option{-m64}.
12387 When generating code compliant to the GNU/Linux for S/390 ABI,
12388 the default is @option{-mesa}.  When generating code compliant
12389 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
12390
12391 @item -mmvcle
12392 @itemx -mno-mvcle
12393 @opindex mmvcle
12394 @opindex mno-mvcle
12395 Generate (or do not generate) code using the @code{mvcle} instruction
12396 to perform block moves.  When @option{-mno-mvcle} is specified,
12397 use a @code{mvc} loop instead.  This is the default unless optimizing for
12398 size.
12399
12400 @item -mdebug
12401 @itemx -mno-debug
12402 @opindex mdebug
12403 @opindex mno-debug
12404 Print (or do not print) additional debug information when compiling.
12405 The default is to not print debug information.
12406
12407 @item -march=@var{cpu-type}
12408 @opindex march
12409 Generate code that will run on @var{cpu-type}, which is the name of a system
12410 representing a certain processor type.  Possible values for
12411 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
12412 When generating code using the instructions available on z/Architecture,
12413 the default is @option{-march=z900}.  Otherwise, the default is
12414 @option{-march=g5}.
12415
12416 @item -mtune=@var{cpu-type}
12417 @opindex mtune
12418 Tune to @var{cpu-type} everything applicable about the generated code,
12419 except for the ABI and the set of available instructions.
12420 The list of @var{cpu-type} values is the same as for @option{-march}.
12421 The default is the value used for @option{-march}.
12422
12423 @item -mtpf-trace
12424 @itemx -mno-tpf-trace
12425 @opindex mtpf-trace
12426 @opindex mno-tpf-trace
12427 Generate code that adds (does not add) in TPF OS specific branches to trace
12428 routines in the operating system.  This option is off by default, even
12429 when compiling for the TPF OS@.
12430
12431 @item -mfused-madd
12432 @itemx -mno-fused-madd
12433 @opindex mfused-madd
12434 @opindex mno-fused-madd
12435 Generate code that uses (does not use) the floating point multiply and
12436 accumulate instructions.  These instructions are generated by default if
12437 hardware floating point is used.
12438
12439 @item -mwarn-framesize=@var{framesize}
12440 @opindex mwarn-framesize
12441 Emit a warning if the current function exceeds the given frame size.  Because
12442 this is a compile time check it doesn't need to be a real problem when the program
12443 runs.  It is intended to identify functions which most probably cause
12444 a stack overflow.  It is useful to be used in an environment with limited stack
12445 size e.g.@: the linux kernel.
12446
12447 @item -mwarn-dynamicstack
12448 @opindex mwarn-dynamicstack
12449 Emit a warning if the function calls alloca or uses dynamically
12450 sized arrays.  This is generally a bad idea with a limited stack size.
12451
12452 @item -mstack-guard=@var{stack-guard}
12453 @item -mstack-size=@var{stack-size}
12454 @opindex mstack-guard
12455 @opindex mstack-size
12456 These arguments always have to be used in conjunction.  If they are present the s390
12457 back end emits additional instructions in the function prologue which trigger a trap
12458 if the stack size is @var{stack-guard} bytes above the @var{stack-size}
12459 (remember that the stack on s390 grows downward).  These options are intended to
12460 be used to help debugging stack overflow problems.  The additionally emitted code
12461 causes only little overhead and hence can also be used in production like systems
12462 without greater performance degradation.  The given values have to be exact
12463 powers of 2 and @var{stack-size} has to be greater than @var{stack-guard} without
12464 exceeding 64k.
12465 In order to be efficient the extra code makes the assumption that the stack starts
12466 at an address aligned to the value given by @var{stack-size}.
12467 @end table
12468
12469 @node Score Options
12470 @subsection Score Options
12471 @cindex Score Options
12472
12473 These options are defined for Score implementations:
12474
12475 @table @gcctabopt
12476 @item -meb
12477 @opindex meb
12478 Compile code for big endian mode.  This is the default.
12479
12480 @item -mel
12481 @opindex mel
12482 Compile code for little endian mode. 
12483
12484 @item -mnhwloop
12485 @opindex mnhwloop
12486 Disable generate bcnz instruction.
12487
12488 @item -muls
12489 @opindex muls
12490 Enable generate unaligned load and store instruction.
12491
12492 @item -mmac
12493 @opindex mmac
12494 Enable the use of multiply-accumulate instructions. Disabled by default. 
12495
12496 @item -mscore5
12497 @opindex mscore5
12498 Specify the SCORE5 as the target architecture.
12499
12500 @item -mscore5u
12501 @opindex mscore5u
12502 Specify the SCORE5U of the target architecture.
12503
12504 @item -mscore7
12505 @opindex mscore7
12506 Specify the SCORE7 as the target architecture. This is the default.
12507
12508 @item -mscore7d
12509 @opindex mscore7d
12510 Specify the SCORE7D as the target architecture.
12511 @end table
12512
12513 @node SH Options
12514 @subsection SH Options
12515
12516 These @samp{-m} options are defined for the SH implementations:
12517
12518 @table @gcctabopt
12519 @item -m1
12520 @opindex m1
12521 Generate code for the SH1.
12522
12523 @item -m2
12524 @opindex m2
12525 Generate code for the SH2.
12526
12527 @item -m2e
12528 Generate code for the SH2e.
12529
12530 @item -m3
12531 @opindex m3
12532 Generate code for the SH3.
12533
12534 @item -m3e
12535 @opindex m3e
12536 Generate code for the SH3e.
12537
12538 @item -m4-nofpu
12539 @opindex m4-nofpu
12540 Generate code for the SH4 without a floating-point unit.
12541
12542 @item -m4-single-only
12543 @opindex m4-single-only
12544 Generate code for the SH4 with a floating-point unit that only
12545 supports single-precision arithmetic.
12546
12547 @item -m4-single
12548 @opindex m4-single
12549 Generate code for the SH4 assuming the floating-point unit is in
12550 single-precision mode by default.
12551
12552 @item -m4
12553 @opindex m4
12554 Generate code for the SH4.
12555
12556 @item -m4a-nofpu
12557 @opindex m4a-nofpu
12558 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
12559 floating-point unit is not used.
12560
12561 @item -m4a-single-only
12562 @opindex m4a-single-only
12563 Generate code for the SH4a, in such a way that no double-precision
12564 floating point operations are used.
12565
12566 @item -m4a-single
12567 @opindex m4a-single
12568 Generate code for the SH4a assuming the floating-point unit is in
12569 single-precision mode by default.
12570
12571 @item -m4a
12572 @opindex m4a
12573 Generate code for the SH4a.
12574
12575 @item -m4al
12576 @opindex m4al
12577 Same as @option{-m4a-nofpu}, except that it implicitly passes
12578 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
12579 instructions at the moment.
12580
12581 @item -mb
12582 @opindex mb
12583 Compile code for the processor in big endian mode.
12584
12585 @item -ml
12586 @opindex ml
12587 Compile code for the processor in little endian mode.
12588
12589 @item -mdalign
12590 @opindex mdalign
12591 Align doubles at 64-bit boundaries.  Note that this changes the calling
12592 conventions, and thus some functions from the standard C library will
12593 not work unless you recompile it first with @option{-mdalign}.
12594
12595 @item -mrelax
12596 @opindex mrelax
12597 Shorten some address references at link time, when possible; uses the
12598 linker option @option{-relax}.
12599
12600 @item -mbigtable
12601 @opindex mbigtable
12602 Use 32-bit offsets in @code{switch} tables.  The default is to use
12603 16-bit offsets.
12604
12605 @item -mfmovd
12606 @opindex mfmovd
12607 Enable the use of the instruction @code{fmovd}.
12608
12609 @item -mhitachi
12610 @opindex mhitachi
12611 Comply with the calling conventions defined by Renesas.
12612
12613 @item -mrenesas
12614 @opindex mhitachi
12615 Comply with the calling conventions defined by Renesas.
12616
12617 @item -mno-renesas
12618 @opindex mhitachi
12619 Comply with the calling conventions defined for GCC before the Renesas
12620 conventions were available.  This option is the default for all
12621 targets of the SH toolchain except for @samp{sh-symbianelf}.
12622
12623 @item -mnomacsave
12624 @opindex mnomacsave
12625 Mark the @code{MAC} register as call-clobbered, even if
12626 @option{-mhitachi} is given.
12627
12628 @item -mieee
12629 @opindex mieee
12630 Increase IEEE-compliance of floating-point code.
12631 At the moment, this is equivalent to @option{-fno-finite-math-only}.
12632 When generating 16 bit SH opcodes, getting IEEE-conforming results for
12633 comparisons of NANs / infinities incurs extra overhead in every
12634 floating point comparison, therefore the default is set to
12635 @option{-ffinite-math-only}.
12636
12637 @item -misize
12638 @opindex misize
12639 Dump instruction size and location in the assembly code.
12640
12641 @item -mpadstruct
12642 @opindex mpadstruct
12643 This option is deprecated.  It pads structures to multiple of 4 bytes,
12644 which is incompatible with the SH ABI@.
12645
12646 @item -mspace
12647 @opindex mspace
12648 Optimize for space instead of speed.  Implied by @option{-Os}.
12649
12650 @item -mprefergot
12651 @opindex mprefergot
12652 When generating position-independent code, emit function calls using
12653 the Global Offset Table instead of the Procedure Linkage Table.
12654
12655 @item -musermode
12656 @opindex musermode
12657 Generate a library function call to invalidate instruction cache
12658 entries, after fixing up a trampoline.  This library function call
12659 doesn't assume it can write to the whole memory address space.  This
12660 is the default when the target is @code{sh-*-linux*}.
12661
12662 @item -multcost=@var{number}
12663 @opindex multcost=@var{number}
12664 Set the cost to assume for a multiply insn.
12665
12666 @item -mdiv=@var{strategy}
12667 @opindex mdiv=@var{strategy}
12668 Set the division strategy to use for SHmedia code.  @var{strategy} must be
12669 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
12670 inv:call2, inv:fp .
12671 "fp" performs the operation in floating point.  This has a very high latency,
12672 but needs only a few instructions, so it might be a good choice if
12673 your code has enough easily exploitable ILP to allow the compiler to
12674 schedule the floating point instructions together with other instructions.
12675 Division by zero causes a floating point exception.
12676 "inv" uses integer operations to calculate the inverse of the divisor,
12677 and then multiplies the dividend with the inverse.  This strategy allows
12678 cse and hoisting of the inverse calculation.  Division by zero calculates
12679 an unspecified result, but does not trap.
12680 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
12681 have been found, or if the entire operation has been hoisted to the same
12682 place, the last stages of the inverse calculation are intertwined with the
12683 final multiply to reduce the overall latency, at the expense of using a few
12684 more instructions, and thus offering fewer scheduling opportunities with
12685 other code.
12686 "call" calls a library function that usually implements the inv:minlat
12687 strategy.
12688 This gives high code density for m5-*media-nofpu compilations.
12689 "call2" uses a different entry point of the same library function, where it
12690 assumes that a pointer to a lookup table has already been set up, which
12691 exposes the pointer load to cse / code hoisting optimizations.
12692 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
12693 code generation, but if the code stays unoptimized, revert to the "call",
12694 "call2", or "fp" strategies, respectively.  Note that the
12695 potentially-trapping side effect of division by zero is carried by a
12696 separate instruction, so it is possible that all the integer instructions
12697 are hoisted out, but the marker for the side effect stays where it is.
12698 A recombination to fp operations or a call is not possible in that case.
12699 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
12700 that the inverse calculation was nor separated from the multiply, they speed
12701 up division where the dividend fits into 20 bits (plus sign where applicable),
12702 by inserting a test to skip a number of operations in this case; this test
12703 slows down the case of larger dividends.  inv20u assumes the case of a such
12704 a small dividend to be unlikely, and inv20l assumes it to be likely.
12705
12706 @item -mdivsi3_libfunc=@var{name}
12707 @opindex mdivsi3_libfunc=@var{name}
12708 Set the name of the library function used for 32 bit signed division to
12709 @var{name}.  This only affect the name used in the call and inv:call
12710 division strategies, and the compiler will still expect the same
12711 sets of input/output/clobbered registers as if this option was not present.
12712
12713 @item -madjust-unroll
12714 @opindex madjust-unroll
12715 Throttle unrolling to avoid thrashing target registers.
12716 This option only has an effect if the gcc code base supports the
12717 TARGET_ADJUST_UNROLL_MAX target hook.
12718
12719 @item -mindexed-addressing
12720 @opindex mindexed-addressing
12721 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
12722 This is only safe if the hardware and/or OS implement 32 bit wrap-around
12723 semantics for the indexed addressing mode.  The architecture allows the
12724 implementation of processors with 64 bit MMU, which the OS could use to
12725 get 32 bit addressing, but since no current hardware implementation supports
12726 this or any other way to make the indexed addressing mode safe to use in
12727 the 32 bit ABI, the default is -mno-indexed-addressing.
12728
12729 @item -mgettrcost=@var{number}
12730 @opindex mgettrcost=@var{number}
12731 Set the cost assumed for the gettr instruction to @var{number}.
12732 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
12733
12734 @item -mpt-fixed
12735 @opindex mpt-fixed
12736 Assume pt* instructions won't trap.  This will generally generate better
12737 scheduled code, but is unsafe on current hardware.  The current architecture
12738 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
12739 This has the unintentional effect of making it unsafe to schedule ptabs /
12740 ptrel before a branch, or hoist it out of a loop.  For example,
12741 __do_global_ctors, a part of libgcc that runs constructors at program
12742 startup, calls functions in a list which is delimited by -1.  With the
12743 -mpt-fixed option, the ptabs will be done before testing against -1.
12744 That means that all the constructors will be run a bit quicker, but when
12745 the loop comes to the end of the list, the program crashes because ptabs
12746 loads -1 into a target register.  Since this option is unsafe for any
12747 hardware implementing the current architecture specification, the default
12748 is -mno-pt-fixed.  Unless the user specifies a specific cost with
12749 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
12750 this deters register allocation using target registers for storing
12751 ordinary integers.
12752
12753 @item -minvalid-symbols
12754 @opindex minvalid-symbols
12755 Assume symbols might be invalid.  Ordinary function symbols generated by
12756 the compiler will always be valid to load with movi/shori/ptabs or
12757 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
12758 to generate symbols that will cause ptabs / ptrel to trap.
12759 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
12760 It will then prevent cross-basic-block cse, hoisting and most scheduling
12761 of symbol loads.  The default is @option{-mno-invalid-symbols}.
12762 @end table
12763
12764 @node SPARC Options
12765 @subsection SPARC Options
12766 @cindex SPARC options
12767
12768 These @samp{-m} options are supported on the SPARC:
12769
12770 @table @gcctabopt
12771 @item -mno-app-regs
12772 @itemx -mapp-regs
12773 @opindex mno-app-regs
12774 @opindex mapp-regs
12775 Specify @option{-mapp-regs} to generate output using the global registers
12776 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
12777 is the default.
12778
12779 To be fully SVR4 ABI compliant at the cost of some performance loss,
12780 specify @option{-mno-app-regs}.  You should compile libraries and system
12781 software with this option.
12782
12783 @item -mfpu
12784 @itemx -mhard-float
12785 @opindex mfpu
12786 @opindex mhard-float
12787 Generate output containing floating point instructions.  This is the
12788 default.
12789
12790 @item -mno-fpu
12791 @itemx -msoft-float
12792 @opindex mno-fpu
12793 @opindex msoft-float
12794 Generate output containing library calls for floating point.
12795 @strong{Warning:} the requisite libraries are not available for all SPARC
12796 targets.  Normally the facilities of the machine's usual C compiler are
12797 used, but this cannot be done directly in cross-compilation.  You must make
12798 your own arrangements to provide suitable library functions for
12799 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
12800 @samp{sparclite-*-*} do provide software floating point support.
12801
12802 @option{-msoft-float} changes the calling convention in the output file;
12803 therefore, it is only useful if you compile @emph{all} of a program with
12804 this option.  In particular, you need to compile @file{libgcc.a}, the
12805 library that comes with GCC, with @option{-msoft-float} in order for
12806 this to work.
12807
12808 @item -mhard-quad-float
12809 @opindex mhard-quad-float
12810 Generate output containing quad-word (long double) floating point
12811 instructions.
12812
12813 @item -msoft-quad-float
12814 @opindex msoft-quad-float
12815 Generate output containing library calls for quad-word (long double)
12816 floating point instructions.  The functions called are those specified
12817 in the SPARC ABI@.  This is the default.
12818
12819 As of this writing, there are no SPARC implementations that have hardware
12820 support for the quad-word floating point instructions.  They all invoke
12821 a trap handler for one of these instructions, and then the trap handler
12822 emulates the effect of the instruction.  Because of the trap handler overhead,
12823 this is much slower than calling the ABI library routines.  Thus the
12824 @option{-msoft-quad-float} option is the default.
12825
12826 @item -mno-unaligned-doubles
12827 @itemx -munaligned-doubles
12828 @opindex mno-unaligned-doubles
12829 @opindex munaligned-doubles
12830 Assume that doubles have 8 byte alignment.  This is the default.
12831
12832 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
12833 alignment only if they are contained in another type, or if they have an
12834 absolute address.  Otherwise, it assumes they have 4 byte alignment.
12835 Specifying this option avoids some rare compatibility problems with code
12836 generated by other compilers.  It is not the default because it results
12837 in a performance loss, especially for floating point code.
12838
12839 @item -mno-faster-structs
12840 @itemx -mfaster-structs
12841 @opindex mno-faster-structs
12842 @opindex mfaster-structs
12843 With @option{-mfaster-structs}, the compiler assumes that structures
12844 should have 8 byte alignment.  This enables the use of pairs of
12845 @code{ldd} and @code{std} instructions for copies in structure
12846 assignment, in place of twice as many @code{ld} and @code{st} pairs.
12847 However, the use of this changed alignment directly violates the SPARC
12848 ABI@.  Thus, it's intended only for use on targets where the developer
12849 acknowledges that their resulting code will not be directly in line with
12850 the rules of the ABI@.
12851
12852 @item -mimpure-text
12853 @opindex mimpure-text
12854 @option{-mimpure-text}, used in addition to @option{-shared}, tells
12855 the compiler to not pass @option{-z text} to the linker when linking a
12856 shared object.  Using this option, you can link position-dependent
12857 code into a shared object.
12858
12859 @option{-mimpure-text} suppresses the ``relocations remain against
12860 allocatable but non-writable sections'' linker error message.
12861 However, the necessary relocations will trigger copy-on-write, and the
12862 shared object is not actually shared across processes.  Instead of
12863 using @option{-mimpure-text}, you should compile all source code with
12864 @option{-fpic} or @option{-fPIC}.
12865
12866 This option is only available on SunOS and Solaris.
12867
12868 @item -mcpu=@var{cpu_type}
12869 @opindex mcpu
12870 Set the instruction set, register set, and instruction scheduling parameters
12871 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
12872 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
12873 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
12874 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
12875 @samp{ultrasparc3}, and @samp{niagara}.
12876
12877 Default instruction scheduling parameters are used for values that select
12878 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
12879 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
12880
12881 Here is a list of each supported architecture and their supported
12882 implementations.
12883
12884 @smallexample
12885     v7:             cypress
12886     v8:             supersparc, hypersparc
12887     sparclite:      f930, f934, sparclite86x
12888     sparclet:       tsc701
12889     v9:             ultrasparc, ultrasparc3, niagara
12890 @end smallexample
12891
12892 By default (unless configured otherwise), GCC generates code for the V7
12893 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
12894 additionally optimizes it for the Cypress CY7C602 chip, as used in the
12895 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
12896 SPARCStation 1, 2, IPX etc.
12897
12898 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
12899 architecture.  The only difference from V7 code is that the compiler emits
12900 the integer multiply and integer divide instructions which exist in SPARC-V8
12901 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
12902 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
12903 2000 series.
12904
12905 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
12906 the SPARC architecture.  This adds the integer multiply, integer divide step
12907 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
12908 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
12909 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
12910 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
12911 MB86934 chip, which is the more recent SPARClite with FPU@.
12912
12913 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
12914 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
12915 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
12916 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
12917 optimizes it for the TEMIC SPARClet chip.
12918
12919 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
12920 architecture.  This adds 64-bit integer and floating-point move instructions,
12921 3 additional floating-point condition code registers and conditional move
12922 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
12923 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
12924 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
12925 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
12926 @option{-mcpu=niagara}, the compiler additionally optimizes it for
12927 Sun UltraSPARC T1 chips.
12928
12929 @item -mtune=@var{cpu_type}
12930 @opindex mtune
12931 Set the instruction scheduling parameters for machine type
12932 @var{cpu_type}, but do not set the instruction set or register set that the
12933 option @option{-mcpu=@var{cpu_type}} would.
12934
12935 The same values for @option{-mcpu=@var{cpu_type}} can be used for
12936 @option{-mtune=@var{cpu_type}}, but the only useful values are those
12937 that select a particular cpu implementation.  Those are @samp{cypress},
12938 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
12939 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
12940 @samp{ultrasparc3}, and @samp{niagara}.
12941
12942 @item -mv8plus
12943 @itemx -mno-v8plus
12944 @opindex mv8plus
12945 @opindex mno-v8plus
12946 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
12947 difference from the V8 ABI is that the global and out registers are
12948 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
12949 mode for all SPARC-V9 processors.
12950
12951 @item -mvis
12952 @itemx -mno-vis
12953 @opindex mvis
12954 @opindex mno-vis
12955 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
12956 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
12957 @end table
12958
12959 These @samp{-m} options are supported in addition to the above
12960 on SPARC-V9 processors in 64-bit environments:
12961
12962 @table @gcctabopt
12963 @item -mlittle-endian
12964 @opindex mlittle-endian
12965 Generate code for a processor running in little-endian mode.  It is only
12966 available for a few configurations and most notably not on Solaris and Linux.
12967
12968 @item -m32
12969 @itemx -m64
12970 @opindex m32
12971 @opindex m64
12972 Generate code for a 32-bit or 64-bit environment.
12973 The 32-bit environment sets int, long and pointer to 32 bits.
12974 The 64-bit environment sets int to 32 bits and long and pointer
12975 to 64 bits.
12976
12977 @item -mcmodel=medlow
12978 @opindex mcmodel=medlow
12979 Generate code for the Medium/Low code model: 64-bit addresses, programs
12980 must be linked in the low 32 bits of memory.  Programs can be statically
12981 or dynamically linked.
12982
12983 @item -mcmodel=medmid
12984 @opindex mcmodel=medmid
12985 Generate code for the Medium/Middle code model: 64-bit addresses, programs
12986 must be linked in the low 44 bits of memory, the text and data segments must
12987 be less than 2GB in size and the data segment must be located within 2GB of
12988 the text segment.
12989
12990 @item -mcmodel=medany
12991 @opindex mcmodel=medany
12992 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
12993 may be linked anywhere in memory, the text and data segments must be less
12994 than 2GB in size and the data segment must be located within 2GB of the
12995 text segment.
12996
12997 @item -mcmodel=embmedany
12998 @opindex mcmodel=embmedany
12999 Generate code for the Medium/Anywhere code model for embedded systems:
13000 64-bit addresses, the text and data segments must be less than 2GB in
13001 size, both starting anywhere in memory (determined at link time).  The
13002 global register %g4 points to the base of the data segment.  Programs
13003 are statically linked and PIC is not supported.
13004
13005 @item -mstack-bias
13006 @itemx -mno-stack-bias
13007 @opindex mstack-bias
13008 @opindex mno-stack-bias
13009 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
13010 frame pointer if present, are offset by @minus{}2047 which must be added back
13011 when making stack frame references.  This is the default in 64-bit mode.
13012 Otherwise, assume no such offset is present.
13013 @end table
13014
13015 These switches are supported in addition to the above on Solaris:
13016
13017 @table @gcctabopt
13018 @item -threads
13019 @opindex threads
13020 Add support for multithreading using the Solaris threads library.  This
13021 option sets flags for both the preprocessor and linker.  This option does
13022 not affect the thread safety of object code produced by the compiler or
13023 that of libraries supplied with it.
13024
13025 @item -pthreads
13026 @opindex pthreads
13027 Add support for multithreading using the POSIX threads library.  This
13028 option sets flags for both the preprocessor and linker.  This option does
13029 not affect the thread safety of object code produced  by the compiler or
13030 that of libraries supplied with it.
13031
13032 @item -pthread
13033 @opindex pthread
13034 This is a synonym for @option{-pthreads}.
13035 @end table
13036
13037 @node System V Options
13038 @subsection Options for System V
13039
13040 These additional options are available on System V Release 4 for
13041 compatibility with other compilers on those systems:
13042
13043 @table @gcctabopt
13044 @item -G
13045 @opindex G
13046 Create a shared object.
13047 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13048
13049 @item -Qy
13050 @opindex Qy
13051 Identify the versions of each tool used by the compiler, in a
13052 @code{.ident} assembler directive in the output.
13053
13054 @item -Qn
13055 @opindex Qn
13056 Refrain from adding @code{.ident} directives to the output file (this is
13057 the default).
13058
13059 @item -YP,@var{dirs}
13060 @opindex YP
13061 Search the directories @var{dirs}, and no others, for libraries
13062 specified with @option{-l}.
13063
13064 @item -Ym,@var{dir}
13065 @opindex Ym
13066 Look in the directory @var{dir} to find the M4 preprocessor.
13067 The assembler uses this option.
13068 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13069 @c the generic assembler that comes with Solaris takes just -Ym.
13070 @end table
13071
13072 @node TMS320C3x/C4x Options
13073 @subsection TMS320C3x/C4x Options
13074 @cindex TMS320C3x/C4x Options
13075
13076 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
13077
13078 @table @gcctabopt
13079
13080 @item -mcpu=@var{cpu_type}
13081 @opindex mcpu
13082 Set the instruction set, register set, and instruction scheduling
13083 parameters for machine type @var{cpu_type}.  Supported values for
13084 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
13085 @samp{c44}.  The default is @samp{c40} to generate code for the
13086 TMS320C40.
13087
13088 @item -mbig-memory
13089 @itemx -mbig
13090 @itemx -msmall-memory
13091 @itemx -msmall
13092 @opindex mbig-memory
13093 @opindex mbig
13094 @opindex msmall-memory
13095 @opindex msmall
13096 Generates code for the big or small memory model.  The small memory
13097 model assumed that all data fits into one 64K word page.  At run-time
13098 the data page (DP) register must be set to point to the 64K page
13099 containing the .bss and .data program sections.  The big memory model is
13100 the default and requires reloading of the DP register for every direct
13101 memory access.
13102
13103 @item -mbk
13104 @itemx -mno-bk
13105 @opindex mbk
13106 @opindex mno-bk
13107 Allow (disallow) allocation of general integer operands into the block
13108 count register BK@.
13109
13110 @item -mdb
13111 @itemx -mno-db
13112 @opindex mdb
13113 @opindex mno-db
13114 Enable (disable) generation of code using decrement and branch,
13115 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13116 on the safe side, this is disabled for the C3x, since the maximum
13117 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13118 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13119 that it can utilize the decrement and branch instruction, but will give
13120 up if there is more than one memory reference in the loop.  Thus a loop
13121 where the loop counter is decremented can generate slightly more
13122 efficient code, in cases where the RPTB instruction cannot be utilized.
13123
13124 @item -mdp-isr-reload
13125 @itemx -mparanoid
13126 @opindex mdp-isr-reload
13127 @opindex mparanoid
13128 Force the DP register to be saved on entry to an interrupt service
13129 routine (ISR), reloaded to point to the data section, and restored on
13130 exit from the ISR@.  This should not be required unless someone has
13131 violated the small memory model by modifying the DP register, say within
13132 an object library.
13133
13134 @item -mmpyi
13135 @itemx -mno-mpyi
13136 @opindex mmpyi
13137 @opindex mno-mpyi
13138 For the C3x use the 24-bit MPYI instruction for integer multiplies
13139 instead of a library call to guarantee 32-bit results.  Note that if one
13140 of the operands is a constant, then the multiplication will be performed
13141 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13142 then squaring operations are performed inline instead of a library call.
13143
13144 @item -mfast-fix
13145 @itemx -mno-fast-fix
13146 @opindex mfast-fix
13147 @opindex mno-fast-fix
13148 The C3x/C4x FIX instruction to convert a floating point value to an
13149 integer value chooses the nearest integer less than or equal to the
13150 floating point value rather than to the nearest integer.  Thus if the
13151 floating point number is negative, the result will be incorrectly
13152 truncated an additional code is necessary to detect and correct this
13153 case.  This option can be used to disable generation of the additional
13154 code required to correct the result.
13155
13156 @item -mrptb
13157 @itemx -mno-rptb
13158 @opindex mrptb
13159 @opindex mno-rptb
13160 Enable (disable) generation of repeat block sequences using the RPTB
13161 instruction for zero overhead looping.  The RPTB construct is only used
13162 for innermost loops that do not call functions or jump across the loop
13163 boundaries.  There is no advantage having nested RPTB loops due to the
13164 overhead required to save and restore the RC, RS, and RE registers.
13165 This is enabled by default with @option{-O2}.
13166
13167 @item -mrpts=@var{count}
13168 @itemx -mno-rpts
13169 @opindex mrpts
13170 @opindex mno-rpts
13171 Enable (disable) the use of the single instruction repeat instruction
13172 RPTS@.  If a repeat block contains a single instruction, and the loop
13173 count can be guaranteed to be less than the value @var{count}, GCC will
13174 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13175 then a RPTS will be emitted even if the loop count cannot be determined
13176 at compile time.  Note that the repeated instruction following RPTS does
13177 not have to be reloaded from memory each iteration, thus freeing up the
13178 CPU buses for operands.  However, since interrupts are blocked by this
13179 instruction, it is disabled by default.
13180
13181 @item -mloop-unsigned
13182 @itemx -mno-loop-unsigned
13183 @opindex mloop-unsigned
13184 @opindex mno-loop-unsigned
13185 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13186 is @math{2^{31} + 1} since these instructions test if the iteration count is
13187 negative to terminate the loop.  If the iteration count is unsigned
13188 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13189 exceeded.  This switch allows an unsigned iteration count.
13190
13191 @item -mti
13192 @opindex mti
13193 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13194 with.  This also enforces compatibility with the API employed by the TI
13195 C3x C compiler.  For example, long doubles are passed as structures
13196 rather than in floating point registers.
13197
13198 @item -mregparm
13199 @itemx -mmemparm
13200 @opindex mregparm
13201 @opindex mmemparm
13202 Generate code that uses registers (stack) for passing arguments to functions.
13203 By default, arguments are passed in registers where possible rather
13204 than by pushing arguments on to the stack.
13205
13206 @item -mparallel-insns
13207 @itemx -mno-parallel-insns
13208 @opindex mparallel-insns
13209 @opindex mno-parallel-insns
13210 Allow the generation of parallel instructions.  This is enabled by
13211 default with @option{-O2}.
13212
13213 @item -mparallel-mpy
13214 @itemx -mno-parallel-mpy
13215 @opindex mparallel-mpy
13216 @opindex mno-parallel-mpy
13217 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13218 provided @option{-mparallel-insns} is also specified.  These instructions have
13219 tight register constraints which can pessimize the code generation
13220 of large functions.
13221
13222 @end table
13223
13224 @node V850 Options
13225 @subsection V850 Options
13226 @cindex V850 Options
13227
13228 These @samp{-m} options are defined for V850 implementations:
13229
13230 @table @gcctabopt
13231 @item -mlong-calls
13232 @itemx -mno-long-calls
13233 @opindex mlong-calls
13234 @opindex mno-long-calls
13235 Treat all calls as being far away (near).  If calls are assumed to be
13236 far away, the compiler will always load the functions address up into a
13237 register, and call indirect through the pointer.
13238
13239 @item -mno-ep
13240 @itemx -mep
13241 @opindex mno-ep
13242 @opindex mep
13243 Do not optimize (do optimize) basic blocks that use the same index
13244 pointer 4 or more times to copy pointer into the @code{ep} register, and
13245 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13246 option is on by default if you optimize.
13247
13248 @item -mno-prolog-function
13249 @itemx -mprolog-function
13250 @opindex mno-prolog-function
13251 @opindex mprolog-function
13252 Do not use (do use) external functions to save and restore registers
13253 at the prologue and epilogue of a function.  The external functions
13254 are slower, but use less code space if more than one function saves
13255 the same number of registers.  The @option{-mprolog-function} option
13256 is on by default if you optimize.
13257
13258 @item -mspace
13259 @opindex mspace
13260 Try to make the code as small as possible.  At present, this just turns
13261 on the @option{-mep} and @option{-mprolog-function} options.
13262
13263 @item -mtda=@var{n}
13264 @opindex mtda
13265 Put static or global variables whose size is @var{n} bytes or less into
13266 the tiny data area that register @code{ep} points to.  The tiny data
13267 area can hold up to 256 bytes in total (128 bytes for byte references).
13268
13269 @item -msda=@var{n}
13270 @opindex msda
13271 Put static or global variables whose size is @var{n} bytes or less into
13272 the small data area that register @code{gp} points to.  The small data
13273 area can hold up to 64 kilobytes.
13274
13275 @item -mzda=@var{n}
13276 @opindex mzda
13277 Put static or global variables whose size is @var{n} bytes or less into
13278 the first 32 kilobytes of memory.
13279
13280 @item -mv850
13281 @opindex mv850
13282 Specify that the target processor is the V850.
13283
13284 @item -mbig-switch
13285 @opindex mbig-switch
13286 Generate code suitable for big switch tables.  Use this option only if
13287 the assembler/linker complain about out of range branches within a switch
13288 table.
13289
13290 @item -mapp-regs
13291 @opindex mapp-regs
13292 This option will cause r2 and r5 to be used in the code generated by
13293 the compiler.  This setting is the default.
13294
13295 @item -mno-app-regs
13296 @opindex mno-app-regs
13297 This option will cause r2 and r5 to be treated as fixed registers.
13298
13299 @item -mv850e1
13300 @opindex mv850e1
13301 Specify that the target processor is the V850E1.  The preprocessor
13302 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
13303 this option is used.
13304
13305 @item -mv850e
13306 @opindex mv850e
13307 Specify that the target processor is the V850E@.  The preprocessor
13308 constant @samp{__v850e__} will be defined if this option is used.
13309
13310 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
13311 are defined then a default target processor will be chosen and the
13312 relevant @samp{__v850*__} preprocessor constant will be defined.
13313
13314 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
13315 defined, regardless of which processor variant is the target.
13316
13317 @item -mdisable-callt
13318 @opindex mdisable-callt
13319 This option will suppress generation of the CALLT instruction for the
13320 v850e and v850e1 flavors of the v850 architecture.  The default is
13321 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
13322
13323 @end table
13324
13325 @node VAX Options
13326 @subsection VAX Options
13327 @cindex VAX options
13328
13329 These @samp{-m} options are defined for the VAX:
13330
13331 @table @gcctabopt
13332 @item -munix
13333 @opindex munix
13334 Do not output certain jump instructions (@code{aobleq} and so on)
13335 that the Unix assembler for the VAX cannot handle across long
13336 ranges.
13337
13338 @item -mgnu
13339 @opindex mgnu
13340 Do output those jump instructions, on the assumption that you
13341 will assemble with the GNU assembler.
13342
13343 @item -mg
13344 @opindex mg
13345 Output code for g-format floating point numbers instead of d-format.
13346 @end table
13347
13348 @node x86-64 Options
13349 @subsection x86-64 Options
13350 @cindex x86-64 options
13351
13352 These are listed under @xref{i386 and x86-64 Options}.
13353
13354 @node Xstormy16 Options
13355 @subsection Xstormy16 Options
13356 @cindex Xstormy16 Options
13357
13358 These options are defined for Xstormy16:
13359
13360 @table @gcctabopt
13361 @item -msim
13362 @opindex msim
13363 Choose startup files and linker script suitable for the simulator.
13364 @end table
13365
13366 @node Xtensa Options
13367 @subsection Xtensa Options
13368 @cindex Xtensa Options
13369
13370 These options are supported for Xtensa targets:
13371
13372 @table @gcctabopt
13373 @item -mconst16
13374 @itemx -mno-const16
13375 @opindex mconst16
13376 @opindex mno-const16
13377 Enable or disable use of @code{CONST16} instructions for loading
13378 constant values.  The @code{CONST16} instruction is currently not a
13379 standard option from Tensilica.  When enabled, @code{CONST16}
13380 instructions are always used in place of the standard @code{L32R}
13381 instructions.  The use of @code{CONST16} is enabled by default only if
13382 the @code{L32R} instruction is not available.
13383
13384 @item -mfused-madd
13385 @itemx -mno-fused-madd
13386 @opindex mfused-madd
13387 @opindex mno-fused-madd
13388 Enable or disable use of fused multiply/add and multiply/subtract
13389 instructions in the floating-point option.  This has no effect if the
13390 floating-point option is not also enabled.  Disabling fused multiply/add
13391 and multiply/subtract instructions forces the compiler to use separate
13392 instructions for the multiply and add/subtract operations.  This may be
13393 desirable in some cases where strict IEEE 754-compliant results are
13394 required: the fused multiply add/subtract instructions do not round the
13395 intermediate result, thereby producing results with @emph{more} bits of
13396 precision than specified by the IEEE standard.  Disabling fused multiply
13397 add/subtract instructions also ensures that the program output is not
13398 sensitive to the compiler's ability to combine multiply and add/subtract
13399 operations.
13400
13401 @item -mtext-section-literals
13402 @itemx -mno-text-section-literals
13403 @opindex mtext-section-literals
13404 @opindex mno-text-section-literals
13405 Control the treatment of literal pools.  The default is
13406 @option{-mno-text-section-literals}, which places literals in a separate
13407 section in the output file.  This allows the literal pool to be placed
13408 in a data RAM/ROM, and it also allows the linker to combine literal
13409 pools from separate object files to remove redundant literals and
13410 improve code size.  With @option{-mtext-section-literals}, the literals
13411 are interspersed in the text section in order to keep them as close as
13412 possible to their references.  This may be necessary for large assembly
13413 files.
13414
13415 @item -mtarget-align
13416 @itemx -mno-target-align
13417 @opindex mtarget-align
13418 @opindex mno-target-align
13419 When this option is enabled, GCC instructs the assembler to
13420 automatically align instructions to reduce branch penalties at the
13421 expense of some code density.  The assembler attempts to widen density
13422 instructions to align branch targets and the instructions following call
13423 instructions.  If there are not enough preceding safe density
13424 instructions to align a target, no widening will be performed.  The
13425 default is @option{-mtarget-align}.  These options do not affect the
13426 treatment of auto-aligned instructions like @code{LOOP}, which the
13427 assembler will always align, either by widening density instructions or
13428 by inserting no-op instructions.
13429
13430 @item -mlongcalls
13431 @itemx -mno-longcalls
13432 @opindex mlongcalls
13433 @opindex mno-longcalls
13434 When this option is enabled, GCC instructs the assembler to translate
13435 direct calls to indirect calls unless it can determine that the target
13436 of a direct call is in the range allowed by the call instruction.  This
13437 translation typically occurs for calls to functions in other source
13438 files.  Specifically, the assembler translates a direct @code{CALL}
13439 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
13440 The default is @option{-mno-longcalls}.  This option should be used in
13441 programs where the call target can potentially be out of range.  This
13442 option is implemented in the assembler, not the compiler, so the
13443 assembly code generated by GCC will still show direct call
13444 instructions---look at the disassembled object code to see the actual
13445 instructions.  Note that the assembler will use an indirect call for
13446 every cross-file call, not just those that really will be out of range.
13447 @end table
13448
13449 @node zSeries Options
13450 @subsection zSeries Options
13451 @cindex zSeries options
13452
13453 These are listed under @xref{S/390 and zSeries Options}.
13454
13455 @node Code Gen Options
13456 @section Options for Code Generation Conventions
13457 @cindex code generation conventions
13458 @cindex options, code generation
13459 @cindex run-time options
13460
13461 These machine-independent options control the interface conventions
13462 used in code generation.
13463
13464 Most of them have both positive and negative forms; the negative form
13465 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
13466 one of the forms is listed---the one which is not the default.  You
13467 can figure out the other form by either removing @samp{no-} or adding
13468 it.
13469
13470 @table @gcctabopt
13471 @item -fbounds-check
13472 @opindex fbounds-check
13473 For front-ends that support it, generate additional code to check that
13474 indices used to access arrays are within the declared range.  This is
13475 currently only supported by the Java and Fortran front-ends, where
13476 this option defaults to true and false respectively.
13477
13478 @item -ftrapv
13479 @opindex ftrapv
13480 This option generates traps for signed overflow on addition, subtraction,
13481 multiplication operations.
13482
13483 @item -fwrapv
13484 @opindex fwrapv
13485 This option instructs the compiler to assume that signed arithmetic
13486 overflow of addition, subtraction and multiplication wraps around
13487 using twos-complement representation.  This flag enables some optimizations
13488 and disables others.  This option is enabled by default for the Java
13489 front-end, as required by the Java language specification.
13490
13491 @item -fexceptions
13492 @opindex fexceptions
13493 Enable exception handling.  Generates extra code needed to propagate
13494 exceptions.  For some targets, this implies GCC will generate frame
13495 unwind information for all functions, which can produce significant data
13496 size overhead, although it does not affect execution.  If you do not
13497 specify this option, GCC will enable it by default for languages like
13498 C++ which normally require exception handling, and disable it for
13499 languages like C that do not normally require it.  However, you may need
13500 to enable this option when compiling C code that needs to interoperate
13501 properly with exception handlers written in C++.  You may also wish to
13502 disable this option if you are compiling older C++ programs that don't
13503 use exception handling.
13504
13505 @item -fnon-call-exceptions
13506 @opindex fnon-call-exceptions
13507 Generate code that allows trapping instructions to throw exceptions.
13508 Note that this requires platform-specific runtime support that does
13509 not exist everywhere.  Moreover, it only allows @emph{trapping}
13510 instructions to throw exceptions, i.e.@: memory references or floating
13511 point instructions.  It does not allow exceptions to be thrown from
13512 arbitrary signal handlers such as @code{SIGALRM}.
13513
13514 @item -funwind-tables
13515 @opindex funwind-tables
13516 Similar to @option{-fexceptions}, except that it will just generate any needed
13517 static data, but will not affect the generated code in any other way.
13518 You will normally not enable this option; instead, a language processor
13519 that needs this handling would enable it on your behalf.
13520
13521 @item -fasynchronous-unwind-tables
13522 @opindex fasynchronous-unwind-tables
13523 Generate unwind table in dwarf2 format, if supported by target machine.  The
13524 table is exact at each instruction boundary, so it can be used for stack
13525 unwinding from asynchronous events (such as debugger or garbage collector).
13526
13527 @item -fpcc-struct-return
13528 @opindex fpcc-struct-return
13529 Return ``short'' @code{struct} and @code{union} values in memory like
13530 longer ones, rather than in registers.  This convention is less
13531 efficient, but it has the advantage of allowing intercallability between
13532 GCC-compiled files and files compiled with other compilers, particularly
13533 the Portable C Compiler (pcc).
13534
13535 The precise convention for returning structures in memory depends
13536 on the target configuration macros.
13537
13538 Short structures and unions are those whose size and alignment match
13539 that of some integer type.
13540
13541 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13542 switch is not binary compatible with code compiled with the
13543 @option{-freg-struct-return} switch.
13544 Use it to conform to a non-default application binary interface.
13545
13546 @item -freg-struct-return
13547 @opindex freg-struct-return
13548 Return @code{struct} and @code{union} values in registers when possible.
13549 This is more efficient for small structures than
13550 @option{-fpcc-struct-return}.
13551
13552 If you specify neither @option{-fpcc-struct-return} nor
13553 @option{-freg-struct-return}, GCC defaults to whichever convention is
13554 standard for the target.  If there is no standard convention, GCC
13555 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
13556 the principal compiler.  In those cases, we can choose the standard, and
13557 we chose the more efficient register return alternative.
13558
13559 @strong{Warning:} code compiled with the @option{-freg-struct-return}
13560 switch is not binary compatible with code compiled with the
13561 @option{-fpcc-struct-return} switch.
13562 Use it to conform to a non-default application binary interface.
13563
13564 @item -fshort-enums
13565 @opindex fshort-enums
13566 Allocate to an @code{enum} type only as many bytes as it needs for the
13567 declared range of possible values.  Specifically, the @code{enum} type
13568 will be equivalent to the smallest integer type which has enough room.
13569
13570 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
13571 code that is not binary compatible with code generated without that switch.
13572 Use it to conform to a non-default application binary interface.
13573
13574 @item -fshort-double
13575 @opindex fshort-double
13576 Use the same size for @code{double} as for @code{float}.
13577
13578 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
13579 code that is not binary compatible with code generated without that switch.
13580 Use it to conform to a non-default application binary interface.
13581
13582 @item -fshort-wchar
13583 @opindex fshort-wchar
13584 Override the underlying type for @samp{wchar_t} to be @samp{short
13585 unsigned int} instead of the default for the target.  This option is
13586 useful for building programs to run under WINE@.
13587
13588 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
13589 code that is not binary compatible with code generated without that switch.
13590 Use it to conform to a non-default application binary interface.
13591
13592 @item -fno-common
13593 @opindex fno-common
13594 In C, allocate even uninitialized global variables in the data section of the
13595 object file, rather than generating them as common blocks.  This has the
13596 effect that if the same variable is declared (without @code{extern}) in
13597 two different compilations, you will get an error when you link them.
13598 The only reason this might be useful is if you wish to verify that the
13599 program will work on other systems which always work this way.
13600
13601 @item -fno-ident
13602 @opindex fno-ident
13603 Ignore the @samp{#ident} directive.
13604
13605 @item -finhibit-size-directive
13606 @opindex finhibit-size-directive
13607 Don't output a @code{.size} assembler directive, or anything else that
13608 would cause trouble if the function is split in the middle, and the
13609 two halves are placed at locations far apart in memory.  This option is
13610 used when compiling @file{crtstuff.c}; you should not need to use it
13611 for anything else.
13612
13613 @item -fverbose-asm
13614 @opindex fverbose-asm
13615 Put extra commentary information in the generated assembly code to
13616 make it more readable.  This option is generally only of use to those
13617 who actually need to read the generated assembly code (perhaps while
13618 debugging the compiler itself).
13619
13620 @option{-fno-verbose-asm}, the default, causes the
13621 extra information to be omitted and is useful when comparing two assembler
13622 files.
13623
13624 @item -fpic
13625 @opindex fpic
13626 @cindex global offset table
13627 @cindex PIC
13628 Generate position-independent code (PIC) suitable for use in a shared
13629 library, if supported for the target machine.  Such code accesses all
13630 constant addresses through a global offset table (GOT)@.  The dynamic
13631 loader resolves the GOT entries when the program starts (the dynamic
13632 loader is not part of GCC; it is part of the operating system).  If
13633 the GOT size for the linked executable exceeds a machine-specific
13634 maximum size, you get an error message from the linker indicating that
13635 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
13636 instead.  (These maximums are 8k on the SPARC and 32k
13637 on the m68k and RS/6000.  The 386 has no such limit.)
13638
13639 Position-independent code requires special support, and therefore works
13640 only on certain machines.  For the 386, GCC supports PIC for System V
13641 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
13642 position-independent.
13643
13644 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13645 are defined to 1.
13646
13647 @item -fPIC
13648 @opindex fPIC
13649 If supported for the target machine, emit position-independent code,
13650 suitable for dynamic linking and avoiding any limit on the size of the
13651 global offset table.  This option makes a difference on the m68k,
13652 PowerPC and SPARC@.
13653
13654 Position-independent code requires special support, and therefore works
13655 only on certain machines.
13656
13657 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13658 are defined to 2.
13659
13660 @item -fpie
13661 @itemx -fPIE
13662 @opindex fpie
13663 @opindex fPIE
13664 These options are similar to @option{-fpic} and @option{-fPIC}, but
13665 generated position independent code can be only linked into executables.
13666 Usually these options are used when @option{-pie} GCC option will be
13667 used during linking.
13668
13669 @item -fno-jump-tables
13670 @opindex fno-jump-tables
13671 Do not use jump tables for switch statements even where it would be
13672 more efficient than other code generation strategies.  This option is
13673 of use in conjunction with @option{-fpic} or @option{-fPIC} for
13674 building code which forms part of a dynamic linker and cannot
13675 reference the address of a jump table.  On some targets, jump tables
13676 do not require a GOT and this option is not needed.
13677
13678 @item -ffixed-@var{reg}
13679 @opindex ffixed
13680 Treat the register named @var{reg} as a fixed register; generated code
13681 should never refer to it (except perhaps as a stack pointer, frame
13682 pointer or in some other fixed role).
13683
13684 @var{reg} must be the name of a register.  The register names accepted
13685 are machine-specific and are defined in the @code{REGISTER_NAMES}
13686 macro in the machine description macro file.
13687
13688 This flag does not have a negative form, because it specifies a
13689 three-way choice.
13690
13691 @item -fcall-used-@var{reg}
13692 @opindex fcall-used
13693 Treat the register named @var{reg} as an allocable register that is
13694 clobbered by function calls.  It may be allocated for temporaries or
13695 variables that do not live across a call.  Functions compiled this way
13696 will not save and restore the register @var{reg}.
13697
13698 It is an error to used this flag with the frame pointer or stack pointer.
13699 Use of this flag for other registers that have fixed pervasive roles in
13700 the machine's execution model will produce disastrous results.
13701
13702 This flag does not have a negative form, because it specifies a
13703 three-way choice.
13704
13705 @item -fcall-saved-@var{reg}
13706 @opindex fcall-saved
13707 Treat the register named @var{reg} as an allocable register saved by
13708 functions.  It may be allocated even for temporaries or variables that
13709 live across a call.  Functions compiled this way will save and restore
13710 the register @var{reg} if they use it.
13711
13712 It is an error to used this flag with the frame pointer or stack pointer.
13713 Use of this flag for other registers that have fixed pervasive roles in
13714 the machine's execution model will produce disastrous results.
13715
13716 A different sort of disaster will result from the use of this flag for
13717 a register in which function values may be returned.
13718
13719 This flag does not have a negative form, because it specifies a
13720 three-way choice.
13721
13722 @item -fpack-struct[=@var{n}]
13723 @opindex fpack-struct
13724 Without a value specified, pack all structure members together without
13725 holes.  When a value is specified (which must be a small power of two), pack
13726 structure members according to this value, representing the maximum
13727 alignment (that is, objects with default alignment requirements larger than
13728 this will be output potentially unaligned at the next fitting location.
13729
13730 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
13731 code that is not binary compatible with code generated without that switch.
13732 Additionally, it makes the code suboptimal.
13733 Use it to conform to a non-default application binary interface.
13734
13735 @item -finstrument-functions
13736 @opindex finstrument-functions
13737 Generate instrumentation calls for entry and exit to functions.  Just
13738 after function entry and just before function exit, the following
13739 profiling functions will be called with the address of the current
13740 function and its call site.  (On some platforms,
13741 @code{__builtin_return_address} does not work beyond the current
13742 function, so the call site information may not be available to the
13743 profiling functions otherwise.)
13744
13745 @smallexample
13746 void __cyg_profile_func_enter (void *this_fn,
13747                                void *call_site);
13748 void __cyg_profile_func_exit  (void *this_fn,
13749                                void *call_site);
13750 @end smallexample
13751
13752 The first argument is the address of the start of the current function,
13753 which may be looked up exactly in the symbol table.
13754
13755 This instrumentation is also done for functions expanded inline in other
13756 functions.  The profiling calls will indicate where, conceptually, the
13757 inline function is entered and exited.  This means that addressable
13758 versions of such functions must be available.  If all your uses of a
13759 function are expanded inline, this may mean an additional expansion of
13760 code size.  If you use @samp{extern inline} in your C code, an
13761 addressable version of such functions must be provided.  (This is
13762 normally the case anyways, but if you get lucky and the optimizer always
13763 expands the functions inline, you might have gotten away without
13764 providing static copies.)
13765
13766 A function may be given the attribute @code{no_instrument_function}, in
13767 which case this instrumentation will not be done.  This can be used, for
13768 example, for the profiling functions listed above, high-priority
13769 interrupt routines, and any functions from which the profiling functions
13770 cannot safely be called (perhaps signal handlers, if the profiling
13771 routines generate output or allocate memory).
13772
13773 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
13774 @opindex finstrument-functions-exclude-file-list
13775
13776 Set the list of functions that are excluded from instrumentation (see
13777 the description of @code{-finstrument-functions}).  If the file that
13778 contains a function definition matches with one of @var{file}, then
13779 that function is not instrumented.  The match is done on substrings:
13780 if the @var{file} parameter is a substring of the file name, it is
13781 considered to be a match.
13782
13783 For example,
13784 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
13785 will exclude any inline function defined in files whose pathnames
13786 contain @code{/bits/stl} or @code{include/sys}.
13787
13788 If, for some reason, you want to include letter @code{','} in one of
13789 @var{sym}, write @code{'\,'}. For example,
13790 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
13791 (note the single quote surrounding the option).
13792
13793 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
13794 @opindex finstrument-functions-exclude-function-list
13795
13796 This is similar to @code{-finstrument-functions-exclude-file-list},
13797 but this option sets the list of function names to be excluded from
13798 instrumentation.  The function name to be matched is its user-visible
13799 name, such as @code{vector<int> blah(const vector<int> &)}, not the
13800 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
13801 match is done on substrings: if the @var{sym} parameter is a substring
13802 of the function name, it is considered to be a match.
13803
13804 @item -fstack-check
13805 @opindex fstack-check
13806 Generate code to verify that you do not go beyond the boundary of the
13807 stack.  You should specify this flag if you are running in an
13808 environment with multiple threads, but only rarely need to specify it in
13809 a single-threaded environment since stack overflow is automatically
13810 detected on nearly all systems if there is only one stack.
13811
13812 Note that this switch does not actually cause checking to be done; the
13813 operating system must do that.  The switch causes generation of code
13814 to ensure that the operating system sees the stack being extended.
13815
13816 @item -fstack-limit-register=@var{reg}
13817 @itemx -fstack-limit-symbol=@var{sym}
13818 @itemx -fno-stack-limit
13819 @opindex fstack-limit-register
13820 @opindex fstack-limit-symbol
13821 @opindex fno-stack-limit
13822 Generate code to ensure that the stack does not grow beyond a certain value,
13823 either the value of a register or the address of a symbol.  If the stack
13824 would grow beyond the value, a signal is raised.  For most targets,
13825 the signal is raised before the stack overruns the boundary, so
13826 it is possible to catch the signal without taking special precautions.
13827
13828 For instance, if the stack starts at absolute address @samp{0x80000000}
13829 and grows downwards, you can use the flags
13830 @option{-fstack-limit-symbol=__stack_limit} and
13831 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
13832 of 128KB@.  Note that this may only work with the GNU linker.
13833
13834 @cindex aliasing of parameters
13835 @cindex parameters, aliased
13836 @item -fargument-alias
13837 @itemx -fargument-noalias
13838 @itemx -fargument-noalias-global
13839 @itemx -fargument-noalias-anything
13840 @opindex fargument-alias
13841 @opindex fargument-noalias
13842 @opindex fargument-noalias-global
13843 @opindex fargument-noalias-anything
13844 Specify the possible relationships among parameters and between
13845 parameters and global data.
13846
13847 @option{-fargument-alias} specifies that arguments (parameters) may
13848 alias each other and may alias global storage.@*
13849 @option{-fargument-noalias} specifies that arguments do not alias
13850 each other, but may alias global storage.@*
13851 @option{-fargument-noalias-global} specifies that arguments do not
13852 alias each other and do not alias global storage.
13853 @option{-fargument-noalias-anything} specifies that arguments do not
13854 alias any other storage.
13855
13856 Each language will automatically use whatever option is required by
13857 the language standard.  You should not need to use these options yourself.
13858
13859 @item -fleading-underscore
13860 @opindex fleading-underscore
13861 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
13862 change the way C symbols are represented in the object file.  One use
13863 is to help link with legacy assembly code.
13864
13865 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
13866 generate code that is not binary compatible with code generated without that
13867 switch.  Use it to conform to a non-default application binary interface.
13868 Not all targets provide complete support for this switch.
13869
13870 @item -ftls-model=@var{model}
13871 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
13872 The @var{model} argument should be one of @code{global-dynamic},
13873 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
13874
13875 The default without @option{-fpic} is @code{initial-exec}; with
13876 @option{-fpic} the default is @code{global-dynamic}.
13877
13878 @item -fvisibility=@var{default|internal|hidden|protected}
13879 @opindex fvisibility
13880 Set the default ELF image symbol visibility to the specified option---all
13881 symbols will be marked with this unless overridden within the code.
13882 Using this feature can very substantially improve linking and
13883 load times of shared object libraries, produce more optimized
13884 code, provide near-perfect API export and prevent symbol clashes.
13885 It is @strong{strongly} recommended that you use this in any shared objects
13886 you distribute.
13887
13888 Despite the nomenclature, @code{default} always means public ie;
13889 available to be linked against from outside the shared object.
13890 @code{protected} and @code{internal} are pretty useless in real-world
13891 usage so the only other commonly used option will be @code{hidden}.
13892 The default if @option{-fvisibility} isn't specified is
13893 @code{default}, i.e., make every
13894 symbol public---this causes the same behavior as previous versions of
13895 GCC@.
13896
13897 A good explanation of the benefits offered by ensuring ELF
13898 symbols have the correct visibility is given by ``How To Write
13899 Shared Libraries'' by Ulrich Drepper (which can be found at
13900 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
13901 solution made possible by this option to marking things hidden when
13902 the default is public is to make the default hidden and mark things
13903 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
13904 and @code{__attribute__ ((visibility("default")))} instead of
13905 @code{__declspec(dllexport)} you get almost identical semantics with
13906 identical syntax.  This is a great boon to those working with
13907 cross-platform projects.
13908
13909 For those adding visibility support to existing code, you may find
13910 @samp{#pragma GCC visibility} of use.  This works by you enclosing
13911 the declarations you wish to set visibility for with (for example)
13912 @samp{#pragma GCC visibility push(hidden)} and
13913 @samp{#pragma GCC visibility pop}.
13914 Bear in mind that symbol visibility should be viewed @strong{as
13915 part of the API interface contract} and thus all new code should
13916 always specify visibility when it is not the default ie; declarations
13917 only for use within the local DSO should @strong{always} be marked explicitly
13918 as hidden as so to avoid PLT indirection overheads---making this
13919 abundantly clear also aids readability and self-documentation of the code.
13920 Note that due to ISO C++ specification requirements, operator new and
13921 operator delete must always be of default visibility.
13922
13923 Be aware that headers from outside your project, in particular system
13924 headers and headers from any other library you use, may not be
13925 expecting to be compiled with visibility other than the default.  You
13926 may need to explicitly say @samp{#pragma GCC visibility push(default)}
13927 before including any such headers.
13928
13929 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
13930 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
13931 no modifications.  However, this means that calls to @samp{extern}
13932 functions with no explicit visibility will use the PLT, so it is more
13933 effective to use @samp{__attribute ((visibility))} and/or
13934 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
13935 declarations should be treated as hidden.
13936
13937 Note that @samp{-fvisibility} does affect C++ vague linkage
13938 entities. This means that, for instance, an exception class that will
13939 be thrown between DSOs must be explicitly marked with default
13940 visibility so that the @samp{type_info} nodes will be unified between
13941 the DSOs.
13942
13943 An overview of these techniques, their benefits and how to use them
13944 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
13945
13946 @end table
13947
13948 @c man end
13949
13950 @node Environment Variables
13951 @section Environment Variables Affecting GCC
13952 @cindex environment variables
13953
13954 @c man begin ENVIRONMENT
13955 This section describes several environment variables that affect how GCC
13956 operates.  Some of them work by specifying directories or prefixes to use
13957 when searching for various kinds of files.  Some are used to specify other
13958 aspects of the compilation environment.
13959
13960 Note that you can also specify places to search using options such as
13961 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
13962 take precedence over places specified using environment variables, which
13963 in turn take precedence over those specified by the configuration of GCC@.
13964 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
13965 GNU Compiler Collection (GCC) Internals}.
13966
13967 @table @env
13968 @item LANG
13969 @itemx LC_CTYPE
13970 @c @itemx LC_COLLATE
13971 @itemx LC_MESSAGES
13972 @c @itemx LC_MONETARY
13973 @c @itemx LC_NUMERIC
13974 @c @itemx LC_TIME
13975 @itemx LC_ALL
13976 @findex LANG
13977 @findex LC_CTYPE
13978 @c @findex LC_COLLATE
13979 @findex LC_MESSAGES
13980 @c @findex LC_MONETARY
13981 @c @findex LC_NUMERIC
13982 @c @findex LC_TIME
13983 @findex LC_ALL
13984 @cindex locale
13985 These environment variables control the way that GCC uses
13986 localization information that allow GCC to work with different
13987 national conventions.  GCC inspects the locale categories
13988 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
13989 so.  These locale categories can be set to any value supported by your
13990 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
13991 Kingdom encoded in UTF-8.
13992
13993 The @env{LC_CTYPE} environment variable specifies character
13994 classification.  GCC uses it to determine the character boundaries in
13995 a string; this is needed for some multibyte encodings that contain quote
13996 and escape characters that would otherwise be interpreted as a string
13997 end or escape.
13998
13999 The @env{LC_MESSAGES} environment variable specifies the language to
14000 use in diagnostic messages.
14001
14002 If the @env{LC_ALL} environment variable is set, it overrides the value
14003 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
14004 and @env{LC_MESSAGES} default to the value of the @env{LANG}
14005 environment variable.  If none of these variables are set, GCC
14006 defaults to traditional C English behavior.
14007
14008 @item TMPDIR
14009 @findex TMPDIR
14010 If @env{TMPDIR} is set, it specifies the directory to use for temporary
14011 files.  GCC uses temporary files to hold the output of one stage of
14012 compilation which is to be used as input to the next stage: for example,
14013 the output of the preprocessor, which is the input to the compiler
14014 proper.
14015
14016 @item GCC_EXEC_PREFIX
14017 @findex GCC_EXEC_PREFIX
14018 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
14019 names of the subprograms executed by the compiler.  No slash is added
14020 when this prefix is combined with the name of a subprogram, but you can
14021 specify a prefix that ends with a slash if you wish.
14022
14023 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
14024 an appropriate prefix to use based on the pathname it was invoked with.
14025
14026 If GCC cannot find the subprogram using the specified prefix, it
14027 tries looking in the usual places for the subprogram.
14028
14029 The default value of @env{GCC_EXEC_PREFIX} is
14030 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the value
14031 of @code{prefix} when you ran the @file{configure} script.
14032
14033 Other prefixes specified with @option{-B} take precedence over this prefix.
14034
14035 This prefix is also used for finding files such as @file{crt0.o} that are
14036 used for linking.
14037
14038 In addition, the prefix is used in an unusual way in finding the
14039 directories to search for header files.  For each of the standard
14040 directories whose name normally begins with @samp{/usr/local/lib/gcc}
14041 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
14042 replacing that beginning with the specified prefix to produce an
14043 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
14044 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
14045 These alternate directories are searched first; the standard directories
14046 come next.
14047
14048 @item COMPILER_PATH
14049 @findex COMPILER_PATH
14050 The value of @env{COMPILER_PATH} is a colon-separated list of
14051 directories, much like @env{PATH}.  GCC tries the directories thus
14052 specified when searching for subprograms, if it can't find the
14053 subprograms using @env{GCC_EXEC_PREFIX}.
14054
14055 @item LIBRARY_PATH
14056 @findex LIBRARY_PATH
14057 The value of @env{LIBRARY_PATH} is a colon-separated list of
14058 directories, much like @env{PATH}.  When configured as a native compiler,
14059 GCC tries the directories thus specified when searching for special
14060 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
14061 using GCC also uses these directories when searching for ordinary
14062 libraries for the @option{-l} option (but directories specified with
14063 @option{-L} come first).
14064
14065 @item LANG
14066 @findex LANG
14067 @cindex locale definition
14068 This variable is used to pass locale information to the compiler.  One way in
14069 which this information is used is to determine the character set to be used
14070 when character literals, string literals and comments are parsed in C and C++.
14071 When the compiler is configured to allow multibyte characters,
14072 the following values for @env{LANG} are recognized:
14073
14074 @table @samp
14075 @item C-JIS
14076 Recognize JIS characters.
14077 @item C-SJIS
14078 Recognize SJIS characters.
14079 @item C-EUCJP
14080 Recognize EUCJP characters.
14081 @end table
14082
14083 If @env{LANG} is not defined, or if it has some other value, then the
14084 compiler will use mblen and mbtowc as defined by the default locale to
14085 recognize and translate multibyte characters.
14086 @end table
14087
14088 @noindent
14089 Some additional environments variables affect the behavior of the
14090 preprocessor.
14091
14092 @include cppenv.texi
14093
14094 @c man end
14095
14096 @node Precompiled Headers
14097 @section Using Precompiled Headers
14098 @cindex precompiled headers
14099 @cindex speed of compilation
14100
14101 Often large projects have many header files that are included in every
14102 source file.  The time the compiler takes to process these header files
14103 over and over again can account for nearly all of the time required to
14104 build the project.  To make builds faster, GCC allows users to
14105 `precompile' a header file; then, if builds can use the precompiled
14106 header file they will be much faster.
14107
14108 To create a precompiled header file, simply compile it as you would any
14109 other file, if necessary using the @option{-x} option to make the driver
14110 treat it as a C or C++ header file.  You will probably want to use a
14111 tool like @command{make} to keep the precompiled header up-to-date when
14112 the headers it contains change.
14113
14114 A precompiled header file will be searched for when @code{#include} is
14115 seen in the compilation.  As it searches for the included file
14116 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
14117 compiler looks for a precompiled header in each directory just before it
14118 looks for the include file in that directory.  The name searched for is
14119 the name specified in the @code{#include} with @samp{.gch} appended.  If
14120 the precompiled header file can't be used, it is ignored.
14121
14122 For instance, if you have @code{#include "all.h"}, and you have
14123 @file{all.h.gch} in the same directory as @file{all.h}, then the
14124 precompiled header file will be used if possible, and the original
14125 header will be used otherwise.
14126
14127 Alternatively, you might decide to put the precompiled header file in a
14128 directory and use @option{-I} to ensure that directory is searched
14129 before (or instead of) the directory containing the original header.
14130 Then, if you want to check that the precompiled header file is always
14131 used, you can put a file of the same name as the original header in this
14132 directory containing an @code{#error} command.
14133
14134 This also works with @option{-include}.  So yet another way to use
14135 precompiled headers, good for projects not designed with precompiled
14136 header files in mind, is to simply take most of the header files used by
14137 a project, include them from another header file, precompile that header
14138 file, and @option{-include} the precompiled header.  If the header files
14139 have guards against multiple inclusion, they will be skipped because
14140 they've already been included (in the precompiled header).
14141
14142 If you need to precompile the same header file for different
14143 languages, targets, or compiler options, you can instead make a
14144 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14145 header in the directory, perhaps using @option{-o}.  It doesn't matter
14146 what you call the files in the directory, every precompiled header in
14147 the directory will be considered.  The first precompiled header
14148 encountered in the directory that is valid for this compilation will
14149 be used; they're searched in no particular order.
14150
14151 There are many other possibilities, limited only by your imagination,
14152 good sense, and the constraints of your build system.
14153
14154 A precompiled header file can be used only when these conditions apply:
14155
14156 @itemize
14157 @item
14158 Only one precompiled header can be used in a particular compilation.
14159
14160 @item
14161 A precompiled header can't be used once the first C token is seen.  You
14162 can have preprocessor directives before a precompiled header; you can
14163 even include a precompiled header from inside another header, so long as
14164 there are no C tokens before the @code{#include}.
14165
14166 @item
14167 The precompiled header file must be produced for the same language as
14168 the current compilation.  You can't use a C precompiled header for a C++
14169 compilation.
14170
14171 @item
14172 The precompiled header file must have been produced by the same compiler
14173 binary as the current compilation is using.
14174
14175 @item
14176 Any macros defined before the precompiled header is included must
14177 either be defined in the same way as when the precompiled header was
14178 generated, or must not affect the precompiled header, which usually
14179 means that they don't appear in the precompiled header at all.
14180
14181 The @option{-D} option is one way to define a macro before a
14182 precompiled header is included; using a @code{#define} can also do it.
14183 There are also some options that define macros implicitly, like
14184 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14185 defined this way.
14186
14187 @item If debugging information is output when using the precompiled
14188 header, using @option{-g} or similar, the same kind of debugging information
14189 must have been output when building the precompiled header.  However,
14190 a precompiled header built using @option{-g} can be used in a compilation
14191 when no debugging information is being output.
14192
14193 @item The same @option{-m} options must generally be used when building
14194 and using the precompiled header.  @xref{Submodel Options},
14195 for any cases where this rule is relaxed.
14196
14197 @item Each of the following options must be the same when building and using
14198 the precompiled header:
14199
14200 @gccoptlist{-fexceptions -funit-at-a-time}
14201
14202 @item
14203 Some other command-line options starting with @option{-f},
14204 @option{-p}, or @option{-O} must be defined in the same way as when
14205 the precompiled header was generated.  At present, it's not clear
14206 which options are safe to change and which are not; the safest choice
14207 is to use exactly the same options when generating and using the
14208 precompiled header.  The following are known to be safe:
14209
14210 @gccoptlist{-fmessage-length= -fpreprocessed
14211 -fsched-interblock -fsched-spec -fsched-spec-load -fsched-spec-load-dangerous
14212 -fsched-verbose=<number> -fschedule-insns -fvisibility=
14213 -pedantic-errors}
14214
14215 @end itemize
14216
14217 For all of these except the last, the compiler will automatically
14218 ignore the precompiled header if the conditions aren't met.  If you
14219 find an option combination that doesn't work and doesn't cause the
14220 precompiled header to be ignored, please consider filing a bug report,
14221 see @ref{Bugs}.
14222
14223 If you do use differing options when generating and using the
14224 precompiled header, the actual behavior will be a mixture of the
14225 behavior for the options.  For instance, if you use @option{-g} to
14226 generate the precompiled header but not when using it, you may or may
14227 not get debugging information for routines in the precompiled header.
14228
14229 @node Running Protoize
14230 @section Running Protoize
14231
14232 The program @code{protoize} is an optional part of GCC@.  You can use
14233 it to add prototypes to a program, thus converting the program to ISO
14234 C in one respect.  The companion program @code{unprotoize} does the
14235 reverse: it removes argument types from any prototypes that are found.
14236
14237 When you run these programs, you must specify a set of source files as
14238 command line arguments.  The conversion programs start out by compiling
14239 these files to see what functions they define.  The information gathered
14240 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
14241
14242 After scanning comes actual conversion.  The specified files are all
14243 eligible to be converted; any files they include (whether sources or
14244 just headers) are eligible as well.
14245
14246 But not all the eligible files are converted.  By default,
14247 @code{protoize} and @code{unprotoize} convert only source and header
14248 files in the current directory.  You can specify additional directories
14249 whose files should be converted with the @option{-d @var{directory}}
14250 option.  You can also specify particular files to exclude with the
14251 @option{-x @var{file}} option.  A file is converted if it is eligible, its
14252 directory name matches one of the specified directory names, and its
14253 name within the directory has not been excluded.
14254
14255 Basic conversion with @code{protoize} consists of rewriting most
14256 function definitions and function declarations to specify the types of
14257 the arguments.  The only ones not rewritten are those for varargs
14258 functions.
14259
14260 @code{protoize} optionally inserts prototype declarations at the
14261 beginning of the source file, to make them available for any calls that
14262 precede the function's definition.  Or it can insert prototype
14263 declarations with block scope in the blocks where undeclared functions
14264 are called.
14265
14266 Basic conversion with @code{unprotoize} consists of rewriting most
14267 function declarations to remove any argument types, and rewriting
14268 function definitions to the old-style pre-ISO form.
14269
14270 Both conversion programs print a warning for any function declaration or
14271 definition that they can't convert.  You can suppress these warnings
14272 with @option{-q}.
14273
14274 The output from @code{protoize} or @code{unprotoize} replaces the
14275 original source file.  The original file is renamed to a name ending
14276 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
14277 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
14278 for DOS) file already exists, then the source file is simply discarded.
14279
14280 @code{protoize} and @code{unprotoize} both depend on GCC itself to
14281 scan the program and collect information about the functions it uses.
14282 So neither of these programs will work until GCC is installed.
14283
14284 Here is a table of the options you can use with @code{protoize} and
14285 @code{unprotoize}.  Each option works with both programs unless
14286 otherwise stated.
14287
14288 @table @code
14289 @item -B @var{directory}
14290 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
14291 usual directory (normally @file{/usr/local/lib}).  This file contains
14292 prototype information about standard system functions.  This option
14293 applies only to @code{protoize}.
14294
14295 @item -c @var{compilation-options}
14296 Use @var{compilation-options} as the options when running @command{gcc} to
14297 produce the @samp{.X} files.  The special option @option{-aux-info} is
14298 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
14299
14300 Note that the compilation options must be given as a single argument to
14301 @code{protoize} or @code{unprotoize}.  If you want to specify several
14302 @command{gcc} options, you must quote the entire set of compilation options
14303 to make them a single word in the shell.
14304
14305 There are certain @command{gcc} arguments that you cannot use, because they
14306 would produce the wrong kind of output.  These include @option{-g},
14307 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
14308 the @var{compilation-options}, they are ignored.
14309
14310 @item -C
14311 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
14312 systems) instead of @samp{.c}.  This is convenient if you are converting
14313 a C program to C++.  This option applies only to @code{protoize}.
14314
14315 @item -g
14316 Add explicit global declarations.  This means inserting explicit
14317 declarations at the beginning of each source file for each function
14318 that is called in the file and was not declared.  These declarations
14319 precede the first function definition that contains a call to an
14320 undeclared function.  This option applies only to @code{protoize}.
14321
14322 @item -i @var{string}
14323 Indent old-style parameter declarations with the string @var{string}.
14324 This option applies only to @code{protoize}.
14325
14326 @code{unprotoize} converts prototyped function definitions to old-style
14327 function definitions, where the arguments are declared between the
14328 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
14329 uses five spaces as the indentation.  If you want to indent with just
14330 one space instead, use @option{-i " "}.
14331
14332 @item -k
14333 Keep the @samp{.X} files.  Normally, they are deleted after conversion
14334 is finished.
14335
14336 @item -l
14337 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
14338 a prototype declaration for each function in each block which calls the
14339 function without any declaration.  This option applies only to
14340 @code{protoize}.
14341
14342 @item -n
14343 Make no real changes.  This mode just prints information about the conversions
14344 that would have been done without @option{-n}.
14345
14346 @item -N
14347 Make no @samp{.save} files.  The original files are simply deleted.
14348 Use this option with caution.
14349
14350 @item -p @var{program}
14351 Use the program @var{program} as the compiler.  Normally, the name
14352 @file{gcc} is used.
14353
14354 @item -q
14355 Work quietly.  Most warnings are suppressed.
14356
14357 @item -v
14358 Print the version number, just like @option{-v} for @command{gcc}.
14359 @end table
14360
14361 If you need special compiler options to compile one of your program's
14362 source files, then you should generate that file's @samp{.X} file
14363 specially, by running @command{gcc} on that source file with the
14364 appropriate options and the option @option{-aux-info}.  Then run
14365 @code{protoize} on the entire set of files.  @code{protoize} will use
14366 the existing @samp{.X} file because it is newer than the source file.
14367 For example:
14368
14369 @smallexample
14370 gcc -Dfoo=bar file1.c -aux-info file1.X
14371 protoize *.c
14372 @end smallexample
14373
14374 @noindent
14375 You need to include the special files along with the rest in the
14376 @code{protoize} command, even though their @samp{.X} files already
14377 exist, because otherwise they won't get converted.
14378
14379 @xref{Protoize Caveats}, for more information on how to use
14380 @code{protoize} successfully.
14381