OSDN Git Service

* doc/contrib.texi: Mention crx.
[pf3gnuchains/gcc-fork.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005 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 COPYRIGHT
8 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
9 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
10
11 Permission is granted to copy, distribute and/or modify this document
12 under the terms of the GNU Free Documentation License, Version 1.2 or
13 any later version published by the Free Software Foundation; with the
14 Invariant Sections being ``GNU General Public License'' and ``Funding
15 Free Software'', the Front-Cover texts being (a) (see below), and with
16 the Back-Cover Texts being (b) (see below).  A copy of the license is
17 included in the gfdl(7) man page.
18
19 (a) The FSF's Front-Cover Text is:
20
21      A GNU Manual
22
23 (b) The FSF's Back-Cover Text is:
24
25      You have freedom to copy and modify this GNU Manual, like GNU
26      software.  Copies published by the Free Software Foundation raise
27      funds for GNU development.
28 @c man end
29 @c Set file name and title for the man page.
30 @setfilename gcc
31 @settitle GNU project C and C++ compiler
32 @c man begin SYNOPSIS
33 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
34     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
35     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
36     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
37     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
38     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
39     [@option{-o} @var{outfile}] @var{infile}@dots{}
40
41 Only the most useful options are listed here; see below for the
42 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
43 @c man end
44 @c man begin SEEALSO
45 gpl(7), gfdl(7), fsf-funding(7),
46 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
47 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
48 @file{ld}, @file{binutils} and @file{gdb}.
49 @c man end
50 @c man begin BUGS
51 For instructions on reporting bugs, see
52 @w{@uref{http://gcc.gnu.org/bugs.html}}.
53 @c man end
54 @c man begin AUTHOR
55 See the Info entry for @command{gcc}, or
56 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
57 for contributors to GCC@.
58 @c man end
59 @end ignore
60
61 @node Invoking GCC
62 @chapter GCC Command Options
63 @cindex GCC command options
64 @cindex command options
65 @cindex options, GCC command
66
67 @c man begin DESCRIPTION
68 When you invoke GCC, it normally does preprocessing, compilation,
69 assembly and linking.  The ``overall options'' allow you to stop this
70 process at an intermediate stage.  For example, the @option{-c} option
71 says not to run the linker.  Then the output consists of object files
72 output by the assembler.
73
74 Other options are passed on to one stage of processing.  Some options
75 control the preprocessor and others the compiler itself.  Yet other
76 options control the assembler and linker; most of these are not
77 documented here, since you rarely need to use any of them.
78
79 @cindex C compilation options
80 Most of the command line options that you can use with GCC are useful
81 for C programs; when an option is only useful with another language
82 (usually C++), the explanation says so explicitly.  If the description
83 for a particular option does not mention a source language, you can use
84 that option with all supported languages.
85
86 @cindex C++ compilation options
87 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
88 options for compiling C++ programs.
89
90 @cindex grouping options
91 @cindex options, grouping
92 The @command{gcc} program accepts options and file names as operands.  Many
93 options have multi-letter names; therefore multiple single-letter options
94 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
95 -r}}.
96
97 @cindex order of options
98 @cindex options, order
99 You can mix options and other arguments.  For the most part, the order
100 you use doesn't matter.  Order does matter when you use several options
101 of the same kind; for example, if you specify @option{-L} more than once,
102 the directories are searched in the order specified.
103
104 Many options have long names starting with @samp{-f} or with
105 @samp{-W}---for example, 
106 @option{-fstrength-reduce}, @option{-Wformat} and so on.  Most of
107 these have both positive and negative forms; the negative form of
108 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
109 only one of these two forms, whichever one is not the default.
110
111 @c man end
112
113 @xref{Option Index}, for an index to GCC's options.
114
115 @menu
116 * Option Summary::      Brief list of all options, without explanations.
117 * Overall Options::     Controlling the kind of output:
118                         an executable, object files, assembler files,
119                         or preprocessed source.
120 * Invoking G++::        Compiling C++ programs.
121 * C Dialect Options::   Controlling the variant of C language compiled.
122 * C++ Dialect Options:: Variations on C++.
123 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
124                         and Objective-C++.
125 * Language Independent Options:: Controlling how diagnostics should be
126                         formatted.
127 * Warning Options::     How picky should the compiler be?
128 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
129 * Optimize Options::    How much optimization?
130 * Preprocessor Options:: Controlling header files and macro definitions.
131                          Also, getting dependency information for Make.
132 * Assembler Options::   Passing options to the assembler.
133 * Link Options::        Specifying libraries and so on.
134 * Directory Options::   Where to find header files and libraries.
135                         Where to find the compiler executable files.
136 * Spec Files::          How to pass switches to sub-processes.
137 * Target Options::      Running a cross-compiler, or an old version of GCC.
138 * Submodel Options::    Specifying minor hardware or convention variations,
139                         such as 68010 vs 68020.
140 * Code Gen Options::    Specifying conventions for function calls, data layout
141                         and register usage.
142 * Environment Variables:: Env vars that affect GCC.
143 * Precompiled Headers:: Compiling a header once, and using it many times.
144 * Running Protoize::    Automatically adding or removing function prototypes.
145 @end menu
146
147 @c man begin OPTIONS
148
149 @node Option Summary
150 @section Option Summary
151
152 Here is a summary of all the options, grouped by type.  Explanations are
153 in the following sections.
154
155 @table @emph
156 @item Overall Options
157 @xref{Overall Options,,Options Controlling the Kind of Output}.
158 @gccoptlist{-c  -S  -E  -o @var{file}  -combine -pipe  -pass-exit-codes  @gol
159 -x @var{language}  -v  -###  --help  --target-help  --version}
160
161 @item C Language Options
162 @xref{C Dialect Options,,Options Controlling C Dialect}.
163 @gccoptlist{-ansi  -std=@var{standard}  -aux-info @var{filename} @gol
164 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
165 -fhosted  -ffreestanding  -fms-extensions @gol
166 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
167 -fallow-single-precision  -fcond-mismatch @gol
168 -fsigned-bitfields  -fsigned-char @gol
169 -funsigned-bitfields  -funsigned-char}
170
171 @item C++ Language Options
172 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
173 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
174 -fconserve-space  -fno-const-strings @gol
175 -fno-elide-constructors @gol
176 -fno-enforce-eh-specs @gol
177 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
178 -fno-implicit-templates @gol
179 -fno-implicit-inline-templates @gol
180 -fno-implement-inlines  -fms-extensions @gol
181 -fno-nonansi-builtins  -fno-operator-names @gol
182 -fno-optional-diags  -fpermissive @gol
183 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
184 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
185 -fno-default-inline  -fvisibility-inlines-hidden @gol
186 -Wabi  -Wctor-dtor-privacy @gol
187 -Wnon-virtual-dtor  -Wreorder @gol
188 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
189 -Wno-non-template-friend  -Wold-style-cast @gol
190 -Woverloaded-virtual  -Wno-pmf-conversions @gol
191 -Wsign-promo}
192
193 @item Objective-C and Objective-C++ Language Options
194 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
195 Objective-C and Objective-C++ Dialects}.
196 @gccoptlist{
197 -fconstant-string-class=@var{class-name} @gol
198 -fgnu-runtime  -fnext-runtime @gol
199 -fno-nil-receivers @gol
200 -fobjc-call-cxx-cdtors @gol
201 -fobjc-direct-dispatch @gol
202 -fobjc-exceptions @gol
203 -fobjc-gc @gol
204 -freplace-objc-classes @gol
205 -fzero-link @gol
206 -gen-decls @gol
207 -Wassign-intercept @gol
208 -Wno-protocol  -Wselector @gol
209 -Wstrict-selector-match @gol
210 -Wundeclared-selector}
211
212 @item Language Independent Options
213 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
214 @gccoptlist{-fmessage-length=@var{n}  @gol
215 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}} @gol
216 -fdiagnostics-show-options
217
218 @item Warning Options
219 @xref{Warning Options,,Options to Request or Suppress Warnings}.
220 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
221 -w  -Wextra  -Wall  -Waggregate-return -Wno-attributes @gol
222 -Wc++-compat -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment @gol
223 -Wconversion  -Wno-deprecated-declarations @gol
224 -Wdisabled-optimization  -Wno-div-by-zero  -Wno-endif-labels @gol
225 -Werror  -Werror-implicit-function-declaration @gol
226 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
227 -Wno-format-extra-args -Wformat-nonliteral @gol
228 -Wformat-security  -Wformat-y2k @gol
229 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
230 -Wimport  -Wno-import  -Winit-self  -Winline @gol
231 -Wno-int-to-pointer-cast @gol
232 -Wno-invalid-offsetof  -Winvalid-pch @gol
233 -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations  -Wlong-long @gol
234 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
235 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
236 -Wmissing-noreturn @gol
237 -Wno-multichar  -Wnonnull  -Wpacked  -Wpadded @gol
238 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
239 -Wredundant-decls @gol
240 -Wreturn-type  -Wsequence-point  -Wshadow @gol
241 -Wsign-compare  -Wstrict-aliasing -Wstrict-aliasing=2 @gol
242 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
243 -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
244 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
245 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
246 -Wunused-value  -Wunused-variable  -Wwrite-strings @gol
247 -Wvariadic-macros}
248
249 @item C-only Warning Options
250 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
251 -Wmissing-prototypes  -Wnested-externs  -Wold-style-definition @gol
252 -Wstrict-prototypes  -Wtraditional @gol
253 -Wdeclaration-after-statement -Wno-pointer-sign}
254
255 @item Debugging Options
256 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
257 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
258 -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
259 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
260 -fdump-ipa-all -fdump-ipa-cgraph @gol
261 -fdump-tree-all @gol
262 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
263 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
264 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
265 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
266 -fdump-tree-ch @gol
267 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
268 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
269 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
270 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
271 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
272 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
273 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
274 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
275 -fdump-tree-nrv -fdump-tree-vect @gol
276 -fdump-tree-sink @gol
277 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
278 -fdump-tree-salias @gol
279 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
280 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
281 -ftree-vectorizer-verbose=@var{n} @gol
282 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
283 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
284 -feliminate-unused-debug-symbols -fmem-report -fprofile-arcs @gol
285 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
286 -ftest-coverage  -ftime-report -fvar-tracking @gol
287 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
288 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
289 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
290 -print-multi-directory  -print-multi-lib @gol
291 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
292 -save-temps  -time}
293
294 @item Optimization Options
295 @xref{Optimize Options,,Options that Control Optimization}.
296 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
297 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
298 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
299 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
300 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
301 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
302 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
303 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
304 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
305 -fforce-addr  -ffunction-sections @gol
306 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
307 -floop-optimize -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
308 -finline-functions  -finline-limit=@var{n}  -fkeep-inline-functions @gol
309 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
310 -fmodulo-sched -fno-branch-count-reg @gol
311 -fno-default-inline  -fno-defer-pop -floop-optimize2 -fmove-loop-invariants @gol
312 -fno-function-cse  -fno-guess-branch-probability @gol
313 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
314 -funsafe-math-optimizations  -funsafe-loop-optimizations  -ffinite-math-only @gol
315 -fno-trapping-math  -fno-zero-initialized-in-bss @gol
316 -fomit-frame-pointer  -foptimize-register-move @gol
317 -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
318 -fprofile-generate -fprofile-use @gol
319 -fregmove  -frename-registers @gol
320 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
321 -frerun-cse-after-loop  -frerun-loop-opt @gol
322 -frounding-math -fschedule-insns  -fschedule-insns2 @gol
323 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
324 -fsched-spec-load-dangerous  @gol
325 -fsched-stalled-insns=@var{n} -sched-stalled-insns-dep=@var{n} @gol
326 -fsched2-use-superblocks @gol
327 -fsched2-use-traces -freschedule-modulo-scheduled-loops @gol
328 -fsignaling-nans -fsingle-precision-constant  @gol
329 -fstrength-reduce  -fstrict-aliasing  -ftracer  -fthread-jumps @gol
330 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
331 -fsplit-ivs-in-unroller -funswitch-loops @gol
332 -fvariable-expansion-in-unroller @gol
333 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
334 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
335 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
336 -ftree-ch -ftree-sra -ftree-ter -ftree-lrs -ftree-fre -ftree-vectorize @gol
337 -ftree-salias -fweb @gol
338 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
339 --param @var{name}=@var{value}
340 -O  -O0  -O1  -O2  -O3  -Os}
341
342 @item Preprocessor Options
343 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
344 @gccoptlist{-A@var{question}=@var{answer} @gol
345 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
346 -C  -dD  -dI  -dM  -dN @gol
347 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
348 -idirafter @var{dir} @gol
349 -include @var{file}  -imacros @var{file} @gol
350 -iprefix @var{file}  -iwithprefix @var{dir} @gol
351 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
352 -isysroot @var{dir} @gol
353 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
354 -P  -fworking-directory  -remap @gol
355 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
356 -Xpreprocessor @var{option}}
357
358 @item Assembler Option
359 @xref{Assembler Options,,Passing Options to the Assembler}.
360 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
361
362 @item Linker Options
363 @xref{Link Options,,Options for Linking}.
364 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
365 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
366 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
367 -Wl,@var{option}  -Xlinker @var{option} @gol
368 -u @var{symbol}}
369
370 @item Directory Options
371 @xref{Directory Options,,Options for Directory Search}.
372 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
373 -specs=@var{file}  -I- --sysroot=@var{dir}}
374
375 @item Target Options
376 @c I wrote this xref this way to avoid overfull hbox. -- rms
377 @xref{Target Options}.
378 @gccoptlist{-V @var{version}  -b @var{machine}}
379
380 @item Machine Dependent Options
381 @xref{Submodel Options,,Hardware Models and Configurations}.
382 @c This list is ordered alphanumerically by subsection name.
383 @c Try and put the significant identifier (CPU or system) first,
384 @c so users have a clue at guessing where the ones they want will be.
385
386 @emph{ARC Options}
387 @gccoptlist{-EB  -EL @gol
388 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
389 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
390
391 @emph{ARM Options}
392 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
393 -mabi=@var{name} @gol
394 -mapcs-stack-check  -mno-apcs-stack-check @gol
395 -mapcs-float  -mno-apcs-float @gol
396 -mapcs-reentrant  -mno-apcs-reentrant @gol
397 -msched-prolog  -mno-sched-prolog @gol
398 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
399 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
400 -mthumb-interwork  -mno-thumb-interwork @gol
401 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
402 -mstructure-size-boundary=@var{n} @gol
403 -mabort-on-noreturn @gol
404 -mlong-calls  -mno-long-calls @gol
405 -msingle-pic-base  -mno-single-pic-base @gol
406 -mpic-register=@var{reg} @gol
407 -mnop-fun-dllimport @gol
408 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
409 -mpoke-function-name @gol
410 -mthumb  -marm @gol
411 -mtpcs-frame  -mtpcs-leaf-frame @gol
412 -mcaller-super-interworking  -mcallee-super-interworking}
413
414 @emph{AVR Options}
415 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
416 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
417
418 @emph{Blackfin Options}
419 @gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol
420 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly @gol
421 -mlow-64k -mno-low64k -mid-shared-library @gol
422 -mno-id-shared-library -mshared-library-id=@var{n} @gol
423 -mlong-calls  -mno-long-calls}
424
425 @emph{CRIS Options}
426 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
427 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
428 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
429 -mstack-align  -mdata-align  -mconst-align @gol
430 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
431 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
432 -mmul-bug-workaround  -mno-mul-bug-workaround}
433
434 @emph{CRX Options}
435 @gccoptlist{-mmac -mpush-args}
436
437 @emph{Darwin Options}
438 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
439 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
440 -client_name  -compatibility_version  -current_version @gol
441 -dead_strip @gol
442 -dependency-file  -dylib_file  -dylinker_install_name @gol
443 -dynamic  -dynamiclib  -exported_symbols_list @gol
444 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
445 -force_flat_namespace  -headerpad_max_install_names @gol
446 -image_base  -init  -install_name  -keep_private_externs @gol
447 -multi_module  -multiply_defined  -multiply_defined_unused @gol
448 -noall_load   -no_dead_strip_inits_and_terms @gol
449 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
450 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
451 -private_bundle  -read_only_relocs  -sectalign @gol
452 -sectobjectsymbols  -whyload  -seg1addr @gol
453 -sectcreate  -sectobjectsymbols  -sectorder @gol
454 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
455 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
456 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
457 -single_module  -static  -sub_library  -sub_umbrella @gol
458 -twolevel_namespace  -umbrella  -undefined @gol
459 -unexported_symbols_list  -weak_reference_mismatches @gol
460 -whatsloaded -F -gused -gfull -mmacosx-min-version=@var{version} @gol
461 -mone-byte-bool}
462
463 @emph{DEC Alpha Options}
464 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
465 -mieee  -mieee-with-inexact  -mieee-conformant @gol
466 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
467 -mtrap-precision=@var{mode}  -mbuild-constants @gol
468 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
469 -mbwx  -mmax  -mfix  -mcix @gol
470 -mfloat-vax  -mfloat-ieee @gol
471 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
472 -msmall-text  -mlarge-text @gol
473 -mmemory-latency=@var{time}}
474
475 @emph{DEC Alpha/VMS Options}
476 @gccoptlist{-mvms-return-codes}
477
478 @emph{FRV Options}
479 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
480 -mhard-float  -msoft-float @gol
481 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
482 -mdouble  -mno-double @gol
483 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
484 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
485 -mlinked-fp  -mlong-calls  -malign-labels @gol
486 -mlibrary-pic  -macc-4  -macc-8 @gol
487 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
488 -moptimize-membar -mno-optimize-membar @gol
489 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
490 -mvliw-branch  -mno-vliw-branch @gol
491 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
492 -mno-nested-cond-exec  -mtomcat-stats @gol
493 -mTLS -mtls @gol
494 -mcpu=@var{cpu}}
495
496 @emph{H8/300 Options}
497 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
498
499 @emph{HPPA Options}
500 @gccoptlist{-march=@var{architecture-type} @gol
501 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
502 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
503 -mfixed-range=@var{register-range} @gol
504 -mjump-in-delay -mlinker-opt -mlong-calls @gol
505 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
506 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
507 -mno-jump-in-delay  -mno-long-load-store @gol
508 -mno-portable-runtime  -mno-soft-float @gol
509 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
510 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
511 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
512 -munix=@var{unix-std}  -nolibdld  -static  -threads}
513
514 @emph{i386 and x86-64 Options}
515 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
516 -mfpmath=@var{unit} @gol
517 -masm=@var{dialect}  -mno-fancy-math-387 @gol
518 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
519 -mno-wide-multiply  -mrtd  -malign-double @gol
520 -mpreferred-stack-boundary=@var{num} @gol
521 -mmmx  -msse  -msse2 -msse3 -m3dnow @gol
522 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
523 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
524 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
525 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
526 -mcmodel=@var{code-model} @gol
527 -m32  -m64 -mlarge-data-threshold=@var{num}}
528
529 @emph{IA-64 Options}
530 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
531 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
532 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
533 -minline-float-divide-max-throughput @gol
534 -minline-int-divide-min-latency @gol
535 -minline-int-divide-max-throughput  @gol
536 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
537 -mno-dwarf2-asm -mearly-stop-bits @gol
538 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
539 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64}
540
541 @emph{M32R/D Options}
542 @gccoptlist{-m32r2 -m32rx -m32r @gol
543 -mdebug @gol
544 -malign-loops -mno-align-loops @gol
545 -missue-rate=@var{number} @gol
546 -mbranch-cost=@var{number} @gol
547 -mmodel=@var{code-size-model-type} @gol
548 -msdata=@var{sdata-type} @gol
549 -mno-flush-func -mflush-func=@var{name} @gol
550 -mno-flush-trap -mflush-trap=@var{number} @gol
551 -G @var{num}}
552
553 @emph{M32C Options}
554 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
555
556 @emph{M680x0 Options}
557 @gccoptlist{-m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
558 -m68060  -mcpu32  -m5200  -m68881  -mbitfield  -mc68000  -mc68020   @gol
559 -mnobitfield  -mrtd  -mshort  -msoft-float  -mpcrel @gol
560 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
561 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
562
563 @emph{M68hc1x Options}
564 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
565 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
566 -msoft-reg-count=@var{count}}
567
568 @emph{MCore Options}
569 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
570 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
571 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
572 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
573 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
574
575 @emph{MIPS Options}
576 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
577 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
578 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
579 -mxgot  -mno-xgot  -mgp32  -mgp64  -mfp32  -mfp64 @gol
580 -mhard-float  -msoft-float  -msingle-float  -mdouble-float @gol
581 -mdsp  -mpaired-single  -mips3d @gol
582 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
583 -G@var{num}  -membedded-data  -mno-embedded-data @gol
584 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
585 -msplit-addresses  -mno-split-addresses  @gol
586 -mexplicit-relocs  -mno-explicit-relocs  @gol
587 -mcheck-zero-division  -mno-check-zero-division @gol
588 -mdivide-traps  -mdivide-breaks @gol
589 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
590 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
591 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
592 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130 @gol
593 -mfix-sb1  -mno-fix-sb1 @gol
594 -mflush-func=@var{func}  -mno-flush-func @gol
595 -mbranch-likely  -mno-branch-likely @gol
596 -mfp-exceptions -mno-fp-exceptions @gol
597 -mvr4130-align -mno-vr4130-align}
598
599 @emph{MMIX Options}
600 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
601 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
602 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
603 -mno-base-addresses  -msingle-exit  -mno-single-exit}
604
605 @emph{MN10300 Options}
606 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
607 -mam33  -mno-am33 @gol
608 -mam33-2  -mno-am33-2 @gol
609 -mno-crt0  -mrelax}
610
611 @emph{PDP-11 Options}
612 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
613 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
614 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
615 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
616 -mbranch-expensive  -mbranch-cheap @gol
617 -msplit  -mno-split  -munix-asm  -mdec-asm}
618
619 @emph{PowerPC Options}
620 See RS/6000 and PowerPC Options.
621
622 @emph{RS/6000 and PowerPC Options}
623 @gccoptlist{-mcpu=@var{cpu-type} @gol
624 -mtune=@var{cpu-type} @gol
625 -mpower  -mno-power  -mpower2  -mno-power2 @gol
626 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
627 -maltivec  -mno-altivec @gol
628 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
629 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
630 -mnew-mnemonics  -mold-mnemonics @gol
631 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
632 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
633 -malign-power  -malign-natural @gol
634 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
635 -mstring  -mno-string  -mupdate  -mno-update @gol
636 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
637 -mstrict-align  -mno-strict-align  -mrelocatable @gol
638 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
639 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
640 -mdynamic-no-pic  -maltivec  -mswdiv @gol
641 -mprioritize-restricted-insns=@var{priority} @gol
642 -msched-costly-dep=@var{dependence_type} @gol
643 -minsert-sched-nops=@var{scheme} @gol
644 -mcall-sysv  -mcall-netbsd @gol
645 -maix-struct-return  -msvr4-struct-return @gol
646 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
647 -misel -mno-isel @gol
648 -misel=yes  -misel=no @gol
649 -mspe -mno-spe @gol
650 -mspe=yes  -mspe=no @gol
651 -mvrsave -mno-vrsave @gol
652 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
653 -mprototype  -mno-prototype @gol
654 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
655 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
656
657 @emph{S/390 and zSeries Options}
658 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
659 -mhard-float  -msoft-float  -mbackchain  -mno-backchain @gol
660 -mpacked-stack  -mno-packed-stack @gol
661 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
662 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
663 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
664 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
665
666 @emph{SH Options}
667 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
668 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
669 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
670 -m5-64media  -m5-64media-nofpu @gol
671 -m5-32media  -m5-32media-nofpu @gol
672 -m5-compact  -m5-compact-nofpu @gol
673 -mb  -ml  -mdalign  -mrelax @gol
674 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
675 -mieee  -misize  -mpadstruct  -mspace @gol
676 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
677 -mdivsi3_libfunc=@var{name}  @gol
678 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
679  -minvalid-symbols}
680
681 @emph{SPARC Options}
682 @gccoptlist{-mcpu=@var{cpu-type} @gol
683 -mtune=@var{cpu-type} @gol
684 -mcmodel=@var{code-model} @gol
685 -m32  -m64  -mapp-regs  -mno-app-regs @gol
686 -mfaster-structs  -mno-faster-structs @gol
687 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
688 -mhard-quad-float  -msoft-quad-float @gol
689 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
690 -mstack-bias  -mno-stack-bias @gol
691 -munaligned-doubles  -mno-unaligned-doubles @gol
692 -mv8plus  -mno-v8plus  -mvis  -mno-vis
693 -threads -pthreads}
694
695 @emph{System V Options}
696 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
697
698 @emph{TMS320C3x/C4x Options}
699 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
700 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
701 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
702 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
703
704 @emph{V850 Options}
705 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
706 -mprolog-function  -mno-prolog-function  -mspace @gol
707 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
708 -mapp-regs  -mno-app-regs @gol
709 -mdisable-callt  -mno-disable-callt @gol
710 -mv850e1 @gol
711 -mv850e @gol
712 -mv850  -mbig-switch}
713
714 @emph{VAX Options}
715 @gccoptlist{-mg  -mgnu  -munix}
716
717 @emph{x86-64 Options}
718 See i386 and x86-64 Options.
719
720 @emph{Xstormy16 Options}
721 @gccoptlist{-msim}
722
723 @emph{Xtensa Options}
724 @gccoptlist{-mconst16 -mno-const16 @gol
725 -mfused-madd  -mno-fused-madd @gol
726 -mtext-section-literals  -mno-text-section-literals @gol
727 -mtarget-align  -mno-target-align @gol
728 -mlongcalls  -mno-longcalls}
729
730 @emph{zSeries Options}
731 See S/390 and zSeries Options.
732
733 @item Code Generation Options
734 @xref{Code Gen Options,,Options for Code Generation Conventions}.
735 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
736 -ffixed-@var{reg}  -fexceptions @gol
737 -fnon-call-exceptions  -funwind-tables @gol
738 -fasynchronous-unwind-tables @gol
739 -finhibit-size-directive  -finstrument-functions @gol
740 -fno-common  -fno-ident @gol
741 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
742 -fno-jump-tables @gol
743 -freg-struct-return  -fshared-data  -fshort-enums @gol
744 -fshort-double  -fshort-wchar @gol
745 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
746 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
747 -fargument-alias  -fargument-noalias @gol
748 -fargument-noalias-global  -fleading-underscore @gol
749 -ftls-model=@var{model} @gol
750 -ftrapv  -fwrapv  -fbounds-check @gol
751 -fvisibility}
752 @end table
753
754 @menu
755 * Overall Options::     Controlling the kind of output:
756                         an executable, object files, assembler files,
757                         or preprocessed source.
758 * C Dialect Options::   Controlling the variant of C language compiled.
759 * C++ Dialect Options:: Variations on C++.
760 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
761                         and Objective-C++.
762 * Language Independent Options:: Controlling how diagnostics should be
763                         formatted.
764 * Warning Options::     How picky should the compiler be?
765 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
766 * Optimize Options::    How much optimization?
767 * Preprocessor Options:: Controlling header files and macro definitions.
768                          Also, getting dependency information for Make.
769 * Assembler Options::   Passing options to the assembler.
770 * Link Options::        Specifying libraries and so on.
771 * Directory Options::   Where to find header files and libraries.
772                         Where to find the compiler executable files.
773 * Spec Files::          How to pass switches to sub-processes.
774 * Target Options::      Running a cross-compiler, or an old version of GCC.
775 @end menu
776
777 @node Overall Options
778 @section Options Controlling the Kind of Output
779
780 Compilation can involve up to four stages: preprocessing, compilation
781 proper, assembly and linking, always in that order.  GCC is capable of
782 preprocessing and compiling several files either into several
783 assembler input files, or into one assembler input file; then each
784 assembler input file produces an object file, and linking combines all
785 the object files (those newly compiled, and those specified as input)
786 into an executable file.
787
788 @cindex file name suffix
789 For any given input file, the file name suffix determines what kind of
790 compilation is done:
791
792 @table @gcctabopt
793 @item @var{file}.c
794 C source code which must be preprocessed.
795
796 @item @var{file}.i
797 C source code which should not be preprocessed.
798
799 @item @var{file}.ii
800 C++ source code which should not be preprocessed.
801
802 @item @var{file}.m
803 Objective-C source code.  Note that you must link with the @file{libobjc}
804 library to make an Objective-C program work.
805
806 @item @var{file}.mi
807 Objective-C source code which should not be preprocessed.
808
809 @item @var{file}.mm
810 @itemx @var{file}.M
811 Objective-C++ source code.  Note that you must link with the @file{libobjc}
812 library to make an Objective-C++ program work.  Note that @samp{.M} refers
813 to a literal capital M@.
814
815 @item @var{file}.mii
816 Objective-C++ source code which should not be preprocessed.
817
818 @item @var{file}.h
819 C, C++, Objective-C or Objective-C++ header file to be turned into a
820 precompiled header.
821
822 @item @var{file}.cc
823 @itemx @var{file}.cp
824 @itemx @var{file}.cxx
825 @itemx @var{file}.cpp
826 @itemx @var{file}.CPP
827 @itemx @var{file}.c++
828 @itemx @var{file}.C
829 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
830 the last two letters must both be literally @samp{x}.  Likewise,
831 @samp{.C} refers to a literal capital C@.
832
833 @item @var{file}.mm
834 @itemx @var{file}.M
835 Objective-C++ source code which must be preprocessed.
836
837 @item @var{file}.mii
838 Objective-C++ source code which should not be preprocessed.
839
840 @item @var{file}.hh
841 @itemx @var{file}.H
842 C++ header file to be turned into a precompiled header.
843
844 @item @var{file}.f
845 @itemx @var{file}.for
846 @itemx @var{file}.FOR
847 Fortran source code which should not be preprocessed.
848
849 @item @var{file}.F
850 @itemx @var{file}.fpp
851 @itemx @var{file}.FPP
852 Fortran source code which must be preprocessed (with the traditional
853 preprocessor).
854
855 @item @var{file}.r
856 Fortran source code which must be preprocessed with a RATFOR
857 preprocessor (not included with GCC)@.
858
859 @item @var{file}.f90
860 @itemx @var{file}.f95
861 Fortran 90/95 source code which should not be preprocessed.
862
863 @item @var{file}.F90
864 @itemx @var{file}.F95
865 Fortran 90/95 source code which must be preprocessed (with the
866 traditional preprocessor).
867
868 @c FIXME: Descriptions of Java file types.
869 @c @var{file}.java
870 @c @var{file}.class
871 @c @var{file}.zip
872 @c @var{file}.jar
873
874 @item @var{file}.ads
875 Ada source code file which contains a library unit declaration (a
876 declaration of a package, subprogram, or generic, or a generic
877 instantiation), or a library unit renaming declaration (a package,
878 generic, or subprogram renaming declaration).  Such files are also
879 called @dfn{specs}.
880
881 @itemx @var{file}.adb
882 Ada source code file containing a library unit body (a subprogram or
883 package body).  Such files are also called @dfn{bodies}.
884
885 @c GCC also knows about some suffixes for languages not yet included:
886 @c Pascal:
887 @c @var{file}.p
888 @c @var{file}.pas
889
890 @item @var{file}.s
891 Assembler code.
892
893 @item @var{file}.S
894 Assembler code which must be preprocessed.
895
896 @item @var{other}
897 An object file to be fed straight into linking.
898 Any file name with no recognized suffix is treated this way.
899 @end table
900
901 @opindex x
902 You can specify the input language explicitly with the @option{-x} option:
903
904 @table @gcctabopt
905 @item -x @var{language}
906 Specify explicitly the @var{language} for the following input files
907 (rather than letting the compiler choose a default based on the file
908 name suffix).  This option applies to all following input files until
909 the next @option{-x} option.  Possible values for @var{language} are:
910 @smallexample
911 c  c-header  c-cpp-output
912 c++  c++-header  c++-cpp-output
913 objective-c  objective-c-header  objective-c-cpp-output
914 objective-c++ objective-c++-header objective-c++-cpp-output
915 assembler  assembler-with-cpp
916 ada
917 f77  f77-cpp-input  ratfor
918 f95
919 java
920 treelang
921 @end smallexample
922
923 @item -x none
924 Turn off any specification of a language, so that subsequent files are
925 handled according to their file name suffixes (as they are if @option{-x}
926 has not been used at all).
927
928 @item -pass-exit-codes
929 @opindex pass-exit-codes
930 Normally the @command{gcc} program will exit with the code of 1 if any
931 phase of the compiler returns a non-success return code.  If you specify
932 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
933 numerically highest error produced by any phase that returned an error
934 indication.
935 @end table
936
937 If you only want some of the stages of compilation, you can use
938 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
939 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
940 @command{gcc} is to stop.  Note that some combinations (for example,
941 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
942
943 @table @gcctabopt
944 @item -c
945 @opindex c
946 Compile or assemble the source files, but do not link.  The linking
947 stage simply is not done.  The ultimate output is in the form of an
948 object file for each source file.
949
950 By default, the object file name for a source file is made by replacing
951 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
952
953 Unrecognized input files, not requiring compilation or assembly, are
954 ignored.
955
956 @item -S
957 @opindex S
958 Stop after the stage of compilation proper; do not assemble.  The output
959 is in the form of an assembler code file for each non-assembler input
960 file specified.
961
962 By default, the assembler file name for a source file is made by
963 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
964
965 Input files that don't require compilation are ignored.
966
967 @item -E
968 @opindex E
969 Stop after the preprocessing stage; do not run the compiler proper.  The
970 output is in the form of preprocessed source code, which is sent to the
971 standard output.
972
973 Input files which don't require preprocessing are ignored.
974
975 @cindex output file option
976 @item -o @var{file}
977 @opindex o
978 Place output in file @var{file}.  This applies regardless to whatever
979 sort of output is being produced, whether it be an executable file,
980 an object file, an assembler file or preprocessed C code.
981
982 If @option{-o} is not specified, the default is to put an executable
983 file in @file{a.out}, the object file for
984 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
985 assembler file in @file{@var{source}.s}, a precompiled header file in
986 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
987 standard output.
988
989 @item -v
990 @opindex v
991 Print (on standard error output) the commands executed to run the stages
992 of compilation.  Also print the version number of the compiler driver
993 program and of the preprocessor and the compiler proper.
994
995 @item -###
996 @opindex ###
997 Like @option{-v} except the commands are not executed and all command
998 arguments are quoted.  This is useful for shell scripts to capture the
999 driver-generated command lines.
1000
1001 @item -pipe
1002 @opindex pipe
1003 Use pipes rather than temporary files for communication between the
1004 various stages of compilation.  This fails to work on some systems where
1005 the assembler is unable to read from a pipe; but the GNU assembler has
1006 no trouble.
1007
1008 @item -combine
1009 @opindex combine
1010 If you are compiling multiple source files, this option tells the driver
1011 to pass all the source files to the compiler at once (for those
1012 languages for which the compiler can handle this).  This will allow
1013 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1014 language for which this is supported is C@.  If you pass source files for
1015 multiple languages to the driver, using this option, the driver will invoke
1016 the compiler(s) that support IMA once each, passing each compiler all the
1017 source files appropriate for it.  For those languages that do not support
1018 IMA this option will be ignored, and the compiler will be invoked once for
1019 each source file in that language.  If you use this option in conjunction
1020 with @option{-save-temps}, the compiler will generate multiple
1021 pre-processed files
1022 (one for each source file), but only one (combined) @file{.o} or
1023 @file{.s} file.
1024
1025 @item --help
1026 @opindex help
1027 Print (on the standard output) a description of the command line options
1028 understood by @command{gcc}.  If the @option{-v} option is also specified
1029 then @option{--help} will also be passed on to the various processes
1030 invoked by @command{gcc}, so that they can display the command line options
1031 they accept.  If the @option{-Wextra} option is also specified then command
1032 line options which have no documentation associated with them will also
1033 be displayed.
1034
1035 @item --target-help
1036 @opindex target-help
1037 Print (on the standard output) a description of target specific command
1038 line options for each tool.
1039
1040 @item --version
1041 @opindex version
1042 Display the version number and copyrights of the invoked GCC@.
1043 @end table
1044
1045 @node Invoking G++
1046 @section Compiling C++ Programs
1047
1048 @cindex suffixes for C++ source
1049 @cindex C++ source file suffixes
1050 C++ source files conventionally use one of the suffixes @samp{.C},
1051 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1052 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1053 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1054 files with these names and compiles them as C++ programs even if you
1055 call the compiler the same way as for compiling C programs (usually
1056 with the name @command{gcc}).
1057
1058 @findex g++
1059 @findex c++
1060 However, C++ programs often require class libraries as well as a
1061 compiler that understands the C++ language---and under some
1062 circumstances, you might want to compile programs or header files from
1063 standard input, or otherwise without a suffix that flags them as C++
1064 programs.  You might also like to precompile a C header file with a
1065 @samp{.h} extension to be used in C++ compilations.  @command{g++} is a
1066 program that calls GCC with the default language set to C++, and
1067 automatically specifies linking against the C++ library.  On many
1068 systems, @command{g++} is also installed with the name @command{c++}.
1069
1070 @cindex invoking @command{g++}
1071 When you compile C++ programs, you may specify many of the same
1072 command-line options that you use for compiling programs in any
1073 language; or command-line options meaningful for C and related
1074 languages; or options that are meaningful only for C++ programs.
1075 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1076 explanations of options for languages related to C@.
1077 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1078 explanations of options that are meaningful only for C++ programs.
1079
1080 @node C Dialect Options
1081 @section Options Controlling C Dialect
1082 @cindex dialect options
1083 @cindex language dialect options
1084 @cindex options, dialect
1085
1086 The following options control the dialect of C (or languages derived
1087 from C, such as C++, Objective-C and Objective-C++) that the compiler
1088 accepts:
1089
1090 @table @gcctabopt
1091 @cindex ANSI support
1092 @cindex ISO support
1093 @item -ansi
1094 @opindex ansi
1095 In C mode, support all ISO C90 programs.  In C++ mode,
1096 remove GNU extensions that conflict with ISO C++.
1097
1098 This turns off certain features of GCC that are incompatible with ISO
1099 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1100 such as the @code{asm} and @code{typeof} keywords, and
1101 predefined macros such as @code{unix} and @code{vax} that identify the
1102 type of system you are using.  It also enables the undesirable and
1103 rarely used ISO trigraph feature.  For the C compiler,
1104 it disables recognition of C++ style @samp{//} comments as well as
1105 the @code{inline} keyword.
1106
1107 The alternate keywords @code{__asm__}, @code{__extension__},
1108 @code{__inline__} and @code{__typeof__} continue to work despite
1109 @option{-ansi}.  You would not want to use them in an ISO C program, of
1110 course, but it is useful to put them in header files that might be included
1111 in compilations done with @option{-ansi}.  Alternate predefined macros
1112 such as @code{__unix__} and @code{__vax__} are also available, with or
1113 without @option{-ansi}.
1114
1115 The @option{-ansi} option does not cause non-ISO programs to be
1116 rejected gratuitously.  For that, @option{-pedantic} is required in
1117 addition to @option{-ansi}.  @xref{Warning Options}.
1118
1119 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1120 option is used.  Some header files may notice this macro and refrain
1121 from declaring certain functions or defining certain macros that the
1122 ISO standard doesn't call for; this is to avoid interfering with any
1123 programs that might use these names for other things.
1124
1125 Functions which would normally be built in but do not have semantics
1126 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1127 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1128 built-in functions provided by GCC}, for details of the functions
1129 affected.
1130
1131 @item -std=
1132 @opindex std
1133 Determine the language standard.  This option is currently only
1134 supported when compiling C or C++.  A value for this option must be
1135 provided; possible values are
1136
1137 @table @samp
1138 @item c89
1139 @itemx iso9899:1990
1140 ISO C90 (same as @option{-ansi}).
1141
1142 @item iso9899:199409
1143 ISO C90 as modified in amendment 1.
1144
1145 @item c99
1146 @itemx c9x
1147 @itemx iso9899:1999
1148 @itemx iso9899:199x
1149 ISO C99.  Note that this standard is not yet fully supported; see
1150 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1151 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1152
1153 @item gnu89
1154 Default, ISO C90 plus GNU extensions (including some C99 features).
1155
1156 @item gnu99
1157 @itemx gnu9x
1158 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1159 this will become the default.  The name @samp{gnu9x} is deprecated.
1160
1161 @item c++98
1162 The 1998 ISO C++ standard plus amendments.
1163
1164 @item gnu++98
1165 The same as @option{-std=c++98} plus GNU extensions.  This is the
1166 default for C++ code.
1167 @end table
1168
1169 Even when this option is not specified, you can still use some of the
1170 features of newer standards in so far as they do not conflict with
1171 previous C standards.  For example, you may use @code{__restrict__} even
1172 when @option{-std=c99} is not specified.
1173
1174 The @option{-std} options specifying some version of ISO C have the same
1175 effects as @option{-ansi}, except that features that were not in ISO C90
1176 but are in the specified version (for example, @samp{//} comments and
1177 the @code{inline} keyword in ISO C99) are not disabled.
1178
1179 @xref{Standards,,Language Standards Supported by GCC}, for details of
1180 these standard versions.
1181
1182 @item -aux-info @var{filename}
1183 @opindex aux-info
1184 Output to the given filename prototyped declarations for all functions
1185 declared and/or defined in a translation unit, including those in header
1186 files.  This option is silently ignored in any language other than C@.
1187
1188 Besides declarations, the file indicates, in comments, the origin of
1189 each declaration (source file and line), whether the declaration was
1190 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1191 @samp{O} for old, respectively, in the first character after the line
1192 number and the colon), and whether it came from a declaration or a
1193 definition (@samp{C} or @samp{F}, respectively, in the following
1194 character).  In the case of function definitions, a K&R-style list of
1195 arguments followed by their declarations is also provided, inside
1196 comments, after the declaration.
1197
1198 @item -fno-asm
1199 @opindex fno-asm
1200 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1201 keyword, so that code can use these words as identifiers.  You can use
1202 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1203 instead.  @option{-ansi} implies @option{-fno-asm}.
1204
1205 In C++, this switch only affects the @code{typeof} keyword, since
1206 @code{asm} and @code{inline} are standard keywords.  You may want to
1207 use the @option{-fno-gnu-keywords} flag instead, which has the same
1208 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1209 switch only affects the @code{asm} and @code{typeof} keywords, since
1210 @code{inline} is a standard keyword in ISO C99.
1211
1212 @item -fno-builtin
1213 @itemx -fno-builtin-@var{function}
1214 @opindex fno-builtin
1215 @cindex built-in functions
1216 Don't recognize built-in functions that do not begin with
1217 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1218 functions provided by GCC}, for details of the functions affected,
1219 including those which are not built-in functions when @option{-ansi} or
1220 @option{-std} options for strict ISO C conformance are used because they
1221 do not have an ISO standard meaning.
1222
1223 GCC normally generates special code to handle certain built-in functions
1224 more efficiently; for instance, calls to @code{alloca} may become single
1225 instructions that adjust the stack directly, and calls to @code{memcpy}
1226 may become inline copy loops.  The resulting code is often both smaller
1227 and faster, but since the function calls no longer appear as such, you
1228 cannot set a breakpoint on those calls, nor can you change the behavior
1229 of the functions by linking with a different library.  In addition,
1230 when a function is recognized as a built-in function, GCC may use
1231 information about that function to warn about problems with calls to
1232 that function, or to generate more efficient code, even if the
1233 resulting code still contains calls to that function.  For example,
1234 warnings are given with @option{-Wformat} for bad calls to
1235 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1236 known not to modify global memory.
1237
1238 With the @option{-fno-builtin-@var{function}} option
1239 only the built-in function @var{function} is
1240 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1241 function is named this is not built-in in this version of GCC, this
1242 option is ignored.  There is no corresponding
1243 @option{-fbuiltin-@var{function}} option; if you wish to enable
1244 built-in functions selectively when using @option{-fno-builtin} or
1245 @option{-ffreestanding}, you may define macros such as:
1246
1247 @smallexample
1248 #define abs(n)          __builtin_abs ((n))
1249 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1250 @end smallexample
1251
1252 @item -fhosted
1253 @opindex fhosted
1254 @cindex hosted environment
1255
1256 Assert that compilation takes place in a hosted environment.  This implies
1257 @option{-fbuiltin}.  A hosted environment is one in which the
1258 entire standard library is available, and in which @code{main} has a return
1259 type of @code{int}.  Examples are nearly everything except a kernel.
1260 This is equivalent to @option{-fno-freestanding}.
1261
1262 @item -ffreestanding
1263 @opindex ffreestanding
1264 @cindex hosted environment
1265
1266 Assert that compilation takes place in a freestanding environment.  This
1267 implies @option{-fno-builtin}.  A freestanding environment
1268 is one in which the standard library may not exist, and program startup may
1269 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1270 This is equivalent to @option{-fno-hosted}.
1271
1272 @xref{Standards,,Language Standards Supported by GCC}, for details of
1273 freestanding and hosted environments.
1274
1275 @item -fms-extensions
1276 @opindex fms-extensions
1277 Accept some non-standard constructs used in Microsoft header files.
1278
1279 Some cases of unnamed fields in structures and unions are only
1280 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1281 fields within structs/unions}, for details.
1282
1283 @item -trigraphs
1284 @opindex trigraphs
1285 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1286 options for strict ISO C conformance) implies @option{-trigraphs}.
1287
1288 @item -no-integrated-cpp
1289 @opindex no-integrated-cpp
1290 Performs a compilation in two passes: preprocessing and compiling.  This
1291 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1292 @option{-B} option.  The user supplied compilation step can then add in
1293 an additional preprocessing step after normal preprocessing but before
1294 compiling.  The default is to use the integrated cpp (internal cpp)
1295
1296 The semantics of this option will change if "cc1", "cc1plus", and
1297 "cc1obj" are merged.
1298
1299 @cindex traditional C language
1300 @cindex C language, traditional
1301 @item -traditional
1302 @itemx -traditional-cpp
1303 @opindex traditional-cpp
1304 @opindex traditional
1305 Formerly, these options caused GCC to attempt to emulate a pre-standard
1306 C compiler.  They are now only supported with the @option{-E} switch.
1307 The preprocessor continues to support a pre-standard mode.  See the GNU
1308 CPP manual for details.
1309
1310 @item -fcond-mismatch
1311 @opindex fcond-mismatch
1312 Allow conditional expressions with mismatched types in the second and
1313 third arguments.  The value of such an expression is void.  This option
1314 is not supported for C++.
1315
1316 @item -funsigned-char
1317 @opindex funsigned-char
1318 Let the type @code{char} be unsigned, like @code{unsigned char}.
1319
1320 Each kind of machine has a default for what @code{char} should
1321 be.  It is either like @code{unsigned char} by default or like
1322 @code{signed char} by default.
1323
1324 Ideally, a portable program should always use @code{signed char} or
1325 @code{unsigned char} when it depends on the signedness of an object.
1326 But many programs have been written to use plain @code{char} and
1327 expect it to be signed, or expect it to be unsigned, depending on the
1328 machines they were written for.  This option, and its inverse, let you
1329 make such a program work with the opposite default.
1330
1331 The type @code{char} is always a distinct type from each of
1332 @code{signed char} or @code{unsigned char}, even though its behavior
1333 is always just like one of those two.
1334
1335 @item -fsigned-char
1336 @opindex fsigned-char
1337 Let the type @code{char} be signed, like @code{signed char}.
1338
1339 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1340 the negative form of @option{-funsigned-char}.  Likewise, the option
1341 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1342
1343 @item -fsigned-bitfields
1344 @itemx -funsigned-bitfields
1345 @itemx -fno-signed-bitfields
1346 @itemx -fno-unsigned-bitfields
1347 @opindex fsigned-bitfields
1348 @opindex funsigned-bitfields
1349 @opindex fno-signed-bitfields
1350 @opindex fno-unsigned-bitfields
1351 These options control whether a bit-field is signed or unsigned, when the
1352 declaration does not use either @code{signed} or @code{unsigned}.  By
1353 default, such a bit-field is signed, because this is consistent: the
1354 basic integer types such as @code{int} are signed types.
1355 @end table
1356
1357 @node C++ Dialect Options
1358 @section Options Controlling C++ Dialect
1359
1360 @cindex compiler options, C++
1361 @cindex C++ options, command line
1362 @cindex options, C++
1363 This section describes the command-line options that are only meaningful
1364 for C++ programs; but you can also use most of the GNU compiler options
1365 regardless of what language your program is in.  For example, you
1366 might compile a file @code{firstClass.C} like this:
1367
1368 @smallexample
1369 g++ -g -frepo -O -c firstClass.C
1370 @end smallexample
1371
1372 @noindent
1373 In this example, only @option{-frepo} is an option meant
1374 only for C++ programs; you can use the other options with any
1375 language supported by GCC@.
1376
1377 Here is a list of options that are @emph{only} for compiling C++ programs:
1378
1379 @table @gcctabopt
1380
1381 @item -fabi-version=@var{n}
1382 @opindex fabi-version
1383 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1384 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1385 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1386 the version that conforms most closely to the C++ ABI specification.
1387 Therefore, the ABI obtained using version 0 will change as ABI bugs
1388 are fixed.
1389
1390 The default is version 2.
1391
1392 @item -fno-access-control
1393 @opindex fno-access-control
1394 Turn off all access checking.  This switch is mainly useful for working
1395 around bugs in the access control code.
1396
1397 @item -fcheck-new
1398 @opindex fcheck-new
1399 Check that the pointer returned by @code{operator new} is non-null
1400 before attempting to modify the storage allocated.  This check is
1401 normally unnecessary because the C++ standard specifies that
1402 @code{operator new} will only return @code{0} if it is declared
1403 @samp{throw()}, in which case the compiler will always check the
1404 return value even without this option.  In all other cases, when
1405 @code{operator new} has a non-empty exception specification, memory
1406 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1407 @samp{new (nothrow)}.
1408
1409 @item -fconserve-space
1410 @opindex fconserve-space
1411 Put uninitialized or runtime-initialized global variables into the
1412 common segment, as C does.  This saves space in the executable at the
1413 cost of not diagnosing duplicate definitions.  If you compile with this
1414 flag and your program mysteriously crashes after @code{main()} has
1415 completed, you may have an object that is being destroyed twice because
1416 two definitions were merged.
1417
1418 This option is no longer useful on most targets, now that support has
1419 been added for putting variables into BSS without making them common.
1420
1421 @item -fno-const-strings
1422 @opindex fno-const-strings
1423 Give string constants type @code{char *} instead of type @code{const
1424 char *}.  By default, G++ uses type @code{const char *} as required by
1425 the standard.  Even if you use @option{-fno-const-strings}, you cannot
1426 actually modify the value of a string constant.
1427
1428 This option might be removed in a future release of G++.  For maximum
1429 portability, you should structure your code so that it works with
1430 string constants that have type @code{const char *}.
1431
1432 @item -fno-elide-constructors
1433 @opindex fno-elide-constructors
1434 The C++ standard allows an implementation to omit creating a temporary
1435 which is only used to initialize another object of the same type.
1436 Specifying this option disables that optimization, and forces G++ to
1437 call the copy constructor in all cases.
1438
1439 @item -fno-enforce-eh-specs
1440 @opindex fno-enforce-eh-specs
1441 Don't check for violation of exception specifications at runtime.  This
1442 option violates the C++ standard, but may be useful for reducing code
1443 size in production builds, much like defining @samp{NDEBUG}.  The compiler
1444 will still optimize based on the exception specifications.
1445
1446 @item -ffor-scope
1447 @itemx -fno-for-scope
1448 @opindex ffor-scope
1449 @opindex fno-for-scope
1450 If @option{-ffor-scope} is specified, the scope of variables declared in
1451 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1452 as specified by the C++ standard.
1453 If @option{-fno-for-scope} is specified, the scope of variables declared in
1454 a @i{for-init-statement} extends to the end of the enclosing scope,
1455 as was the case in old versions of G++, and other (traditional)
1456 implementations of C++.
1457
1458 The default if neither flag is given to follow the standard,
1459 but to allow and give a warning for old-style code that would
1460 otherwise be invalid, or have different behavior.
1461
1462 @item -fno-gnu-keywords
1463 @opindex fno-gnu-keywords
1464 Do not recognize @code{typeof} as a keyword, so that code can use this
1465 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1466 @option{-ansi} implies @option{-fno-gnu-keywords}.
1467
1468 @item -fno-implicit-templates
1469 @opindex fno-implicit-templates
1470 Never emit code for non-inline templates which are instantiated
1471 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1472 @xref{Template Instantiation}, for more information.
1473
1474 @item -fno-implicit-inline-templates
1475 @opindex fno-implicit-inline-templates
1476 Don't emit code for implicit instantiations of inline templates, either.
1477 The default is to handle inlines differently so that compiles with and
1478 without optimization will need the same set of explicit instantiations.
1479
1480 @item -fno-implement-inlines
1481 @opindex fno-implement-inlines
1482 To save space, do not emit out-of-line copies of inline functions
1483 controlled by @samp{#pragma implementation}.  This will cause linker
1484 errors if these functions are not inlined everywhere they are called.
1485
1486 @item -fms-extensions
1487 @opindex fms-extensions
1488 Disable pedantic warnings about constructs used in MFC, such as implicit
1489 int and getting a pointer to member function via non-standard syntax.
1490
1491 @item -fno-nonansi-builtins
1492 @opindex fno-nonansi-builtins
1493 Disable built-in declarations of functions that are not mandated by
1494 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1495 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1496
1497 @item -fno-operator-names
1498 @opindex fno-operator-names
1499 Do not treat the operator name keywords @code{and}, @code{bitand},
1500 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1501 synonyms as keywords.
1502
1503 @item -fno-optional-diags
1504 @opindex fno-optional-diags
1505 Disable diagnostics that the standard says a compiler does not need to
1506 issue.  Currently, the only such diagnostic issued by G++ is the one for
1507 a name having multiple meanings within a class.
1508
1509 @item -fpermissive
1510 @opindex fpermissive
1511 Downgrade some diagnostics about nonconformant code from errors to
1512 warnings.  Thus, using @option{-fpermissive} will allow some
1513 nonconforming code to compile.
1514
1515 @item -frepo
1516 @opindex frepo
1517 Enable automatic template instantiation at link time.  This option also
1518 implies @option{-fno-implicit-templates}.  @xref{Template
1519 Instantiation}, for more information.
1520
1521 @item -fno-rtti
1522 @opindex fno-rtti
1523 Disable generation of information about every class with virtual
1524 functions for use by the C++ runtime type identification features
1525 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1526 of the language, you can save some space by using this flag.  Note that
1527 exception handling uses the same information, but it will generate it as
1528 needed.
1529
1530 @item -fstats
1531 @opindex fstats
1532 Emit statistics about front-end processing at the end of the compilation.
1533 This information is generally only useful to the G++ development team.
1534
1535 @item -ftemplate-depth-@var{n}
1536 @opindex ftemplate-depth
1537 Set the maximum instantiation depth for template classes to @var{n}.
1538 A limit on the template instantiation depth is needed to detect
1539 endless recursions during template class instantiation.  ANSI/ISO C++
1540 conforming programs must not rely on a maximum depth greater than 17.
1541
1542 @item -fno-threadsafe-statics
1543 @opindex fno-threadsafe-statics
1544 Do not emit the extra code to use the routines specified in the C++
1545 ABI for thread-safe initialization of local statics.  You can use this
1546 option to reduce code size slightly in code that doesn't need to be
1547 thread-safe.
1548
1549 @item -fuse-cxa-atexit
1550 @opindex fuse-cxa-atexit
1551 Register destructors for objects with static storage duration with the
1552 @code{__cxa_atexit} function rather than the @code{atexit} function.
1553 This option is required for fully standards-compliant handling of static
1554 destructors, but will only work if your C library supports
1555 @code{__cxa_atexit}.
1556
1557 @item -fvisibility-inlines-hidden
1558 @opindex fvisibility-inlines-hidden
1559 Causes all inlined methods to be marked with
1560 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1561 appear in the export table of a DSO and do not require a PLT indirection
1562 when used within the DSO@.  Enabling this option can have a dramatic effect
1563 on load and link times of a DSO as it massively reduces the size of the
1564 dynamic export table when the library makes heavy use of templates.  While
1565 it can cause bloating through duplication of code within each DSO where
1566 it is used, often the wastage is less than the considerable space occupied
1567 by a long symbol name in the export table which is typical when using
1568 templates and namespaces.  For even more savings, combine with the
1569 @option{-fvisibility=hidden} switch.
1570
1571 @item -fno-weak
1572 @opindex fno-weak
1573 Do not use weak symbol support, even if it is provided by the linker.
1574 By default, G++ will use weak symbols if they are available.  This
1575 option exists only for testing, and should not be used by end-users;
1576 it will result in inferior code and has no benefits.  This option may
1577 be removed in a future release of G++.
1578
1579 @item -nostdinc++
1580 @opindex nostdinc++
1581 Do not search for header files in the standard directories specific to
1582 C++, but do still search the other standard directories.  (This option
1583 is used when building the C++ library.)
1584 @end table
1585
1586 In addition, these optimization, warning, and code generation options
1587 have meanings only for C++ programs:
1588
1589 @table @gcctabopt
1590 @item -fno-default-inline
1591 @opindex fno-default-inline
1592 Do not assume @samp{inline} for functions defined inside a class scope.
1593 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1594 functions will have linkage like inline functions; they just won't be
1595 inlined by default.
1596
1597 @item -Wabi @r{(C++ only)}
1598 @opindex Wabi
1599 Warn when G++ generates code that is probably not compatible with the
1600 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1601 all such cases, there are probably some cases that are not warned about,
1602 even though G++ is generating incompatible code.  There may also be
1603 cases where warnings are emitted even though the code that is generated
1604 will be compatible.
1605
1606 You should rewrite your code to avoid these warnings if you are
1607 concerned about the fact that code generated by G++ may not be binary
1608 compatible with code generated by other compilers.
1609
1610 The known incompatibilities at this point include:
1611
1612 @itemize @bullet
1613
1614 @item
1615 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1616 pack data into the same byte as a base class.  For example:
1617
1618 @smallexample
1619 struct A @{ virtual void f(); int f1 : 1; @};
1620 struct B : public A @{ int f2 : 1; @};
1621 @end smallexample
1622
1623 @noindent
1624 In this case, G++ will place @code{B::f2} into the same byte
1625 as@code{A::f1}; other compilers will not.  You can avoid this problem
1626 by explicitly padding @code{A} so that its size is a multiple of the
1627 byte size on your platform; that will cause G++ and other compilers to
1628 layout @code{B} identically.
1629
1630 @item
1631 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1632 tail padding when laying out virtual bases.  For example:
1633
1634 @smallexample
1635 struct A @{ virtual void f(); char c1; @};
1636 struct B @{ B(); char c2; @};
1637 struct C : public A, public virtual B @{@};
1638 @end smallexample
1639
1640 @noindent
1641 In this case, G++ will not place @code{B} into the tail-padding for
1642 @code{A}; other compilers will.  You can avoid this problem by
1643 explicitly padding @code{A} so that its size is a multiple of its
1644 alignment (ignoring virtual base classes); that will cause G++ and other
1645 compilers to layout @code{C} identically.
1646
1647 @item
1648 Incorrect handling of bit-fields with declared widths greater than that
1649 of their underlying types, when the bit-fields appear in a union.  For
1650 example:
1651
1652 @smallexample
1653 union U @{ int i : 4096; @};
1654 @end smallexample
1655
1656 @noindent
1657 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1658 union too small by the number of bits in an @code{int}.
1659
1660 @item
1661 Empty classes can be placed at incorrect offsets.  For example:
1662
1663 @smallexample
1664 struct A @{@};
1665
1666 struct B @{
1667   A a;
1668   virtual void f ();
1669 @};
1670
1671 struct C : public B, public A @{@};
1672 @end smallexample
1673
1674 @noindent
1675 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1676 it should be placed at offset zero.  G++ mistakenly believes that the
1677 @code{A} data member of @code{B} is already at offset zero.
1678
1679 @item
1680 Names of template functions whose types involve @code{typename} or
1681 template template parameters can be mangled incorrectly.
1682
1683 @smallexample
1684 template <typename Q>
1685 void f(typename Q::X) @{@}
1686
1687 template <template <typename> class Q>
1688 void f(typename Q<int>::X) @{@}
1689 @end smallexample
1690
1691 @noindent
1692 Instantiations of these templates may be mangled incorrectly.
1693
1694 @end itemize
1695
1696 @item -Wctor-dtor-privacy @r{(C++ only)}
1697 @opindex Wctor-dtor-privacy
1698 Warn when a class seems unusable because all the constructors or
1699 destructors in that class are private, and it has neither friends nor
1700 public static member functions.
1701
1702 @item -Wnon-virtual-dtor @r{(C++ only)}
1703 @opindex Wnon-virtual-dtor
1704 Warn when a class appears to be polymorphic, thereby requiring a virtual
1705 destructor, yet it declares a non-virtual one.
1706 This warning is enabled by @option{-Wall}.
1707
1708 @item -Wreorder @r{(C++ only)}
1709 @opindex Wreorder
1710 @cindex reordering, warning
1711 @cindex warning for reordering of member initializers
1712 Warn when the order of member initializers given in the code does not
1713 match the order in which they must be executed.  For instance:
1714
1715 @smallexample
1716 struct A @{
1717   int i;
1718   int j;
1719   A(): j (0), i (1) @{ @}
1720 @};
1721 @end smallexample
1722
1723 The compiler will rearrange the member initializers for @samp{i}
1724 and @samp{j} to match the declaration order of the members, emitting
1725 a warning to that effect.  This warning is enabled by @option{-Wall}.
1726 @end table
1727
1728 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1729
1730 @table @gcctabopt
1731 @item -Weffc++ @r{(C++ only)}
1732 @opindex Weffc++
1733 Warn about violations of the following style guidelines from Scott Meyers'
1734 @cite{Effective C++} book:
1735
1736 @itemize @bullet
1737 @item
1738 Item 11:  Define a copy constructor and an assignment operator for classes
1739 with dynamically allocated memory.
1740
1741 @item
1742 Item 12:  Prefer initialization to assignment in constructors.
1743
1744 @item
1745 Item 14:  Make destructors virtual in base classes.
1746
1747 @item
1748 Item 15:  Have @code{operator=} return a reference to @code{*this}.
1749
1750 @item
1751 Item 23:  Don't try to return a reference when you must return an object.
1752
1753 @end itemize
1754
1755 Also warn about violations of the following style guidelines from
1756 Scott Meyers' @cite{More Effective C++} book:
1757
1758 @itemize @bullet
1759 @item
1760 Item 6:  Distinguish between prefix and postfix forms of increment and
1761 decrement operators.
1762
1763 @item
1764 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
1765
1766 @end itemize
1767
1768 When selecting this option, be aware that the standard library
1769 headers do not obey all of these guidelines; use @samp{grep -v}
1770 to filter out those warnings.
1771
1772 @item -Wno-deprecated @r{(C++ only)}
1773 @opindex Wno-deprecated
1774 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
1775
1776 @item -Wstrict-null-sentinel @r{(C++ only)}
1777 @opindex Wstrict-null-sentinel
1778 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
1779 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
1780 to @code{__null}.  Although it is a null pointer constant not a null pointer,
1781 it is guaranteed to of the same size as a pointer.  But this use is
1782 not portable across different compilers.
1783
1784 @item -Wno-non-template-friend @r{(C++ only)}
1785 @opindex Wno-non-template-friend
1786 Disable warnings when non-templatized friend functions are declared
1787 within a template.  Since the advent of explicit template specification
1788 support in G++, if the name of the friend is an unqualified-id (i.e.,
1789 @samp{friend foo(int)}), the C++ language specification demands that the
1790 friend declare or define an ordinary, nontemplate function.  (Section
1791 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
1792 could be interpreted as a particular specialization of a templatized
1793 function.  Because this non-conforming behavior is no longer the default
1794 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
1795 check existing code for potential trouble spots and is on by default.
1796 This new compiler behavior can be turned off with
1797 @option{-Wno-non-template-friend} which keeps the conformant compiler code
1798 but disables the helpful warning.
1799
1800 @item -Wold-style-cast @r{(C++ only)}
1801 @opindex Wold-style-cast
1802 Warn if an old-style (C-style) cast to a non-void type is used within
1803 a C++ program.  The new-style casts (@samp{static_cast},
1804 @samp{reinterpret_cast}, and @samp{const_cast}) are less vulnerable to
1805 unintended effects and much easier to search for.
1806
1807 @item -Woverloaded-virtual @r{(C++ only)}
1808 @opindex Woverloaded-virtual
1809 @cindex overloaded virtual fn, warning
1810 @cindex warning for overloaded virtual fn
1811 Warn when a function declaration hides virtual functions from a
1812 base class.  For example, in:
1813
1814 @smallexample
1815 struct A @{
1816   virtual void f();
1817 @};
1818
1819 struct B: public A @{
1820   void f(int);
1821 @};
1822 @end smallexample
1823
1824 the @code{A} class version of @code{f} is hidden in @code{B}, and code
1825 like:
1826
1827 @smallexample
1828 B* b;
1829 b->f();
1830 @end smallexample
1831
1832 will fail to compile.
1833
1834 @item -Wno-pmf-conversions @r{(C++ only)}
1835 @opindex Wno-pmf-conversions
1836 Disable the diagnostic for converting a bound pointer to member function
1837 to a plain pointer.
1838
1839 @item -Wsign-promo @r{(C++ only)}
1840 @opindex Wsign-promo
1841 Warn when overload resolution chooses a promotion from unsigned or
1842 enumerated type to a signed type, over a conversion to an unsigned type of
1843 the same size.  Previous versions of G++ would try to preserve
1844 unsignedness, but the standard mandates the current behavior.
1845
1846 @smallexample
1847 struct A @{
1848   operator int ();
1849   A& operator = (int);
1850 @};
1851
1852 main ()
1853 @{
1854   A a,b;
1855   a = b;
1856 @}
1857 @end smallexample
1858
1859 In this example, G++ will synthesize a default @samp{A& operator =
1860 (const A&);}, while cfront will use the user-defined @samp{operator =}.
1861 @end table
1862
1863 @node Objective-C and Objective-C++ Dialect Options
1864 @section Options Controlling Objective-C and Objective-C++ Dialects
1865
1866 @cindex compiler options, Objective-C and Objective-C++
1867 @cindex Objective-C and Objective-C++ options, command line
1868 @cindex options, Objective-C and Objective-C++
1869 (NOTE: This manual does not describe the Objective-C and Objective-C++
1870 languages themselves.  See @xref{Standards,,Language Standards
1871 Supported by GCC}, for references.)
1872
1873 This section describes the command-line options that are only meaningful
1874 for Objective-C and Objective-C++ programs, but you can also use most of
1875 the language-independent GNU compiler options.
1876 For example, you might compile a file @code{some_class.m} like this:
1877
1878 @smallexample
1879 gcc -g -fgnu-runtime -O -c some_class.m
1880 @end smallexample
1881
1882 @noindent
1883 In this example, @option{-fgnu-runtime} is an option meant only for
1884 Objective-C and Objective-C++ programs; you can use the other options with
1885 any language supported by GCC@.
1886
1887 Note that since Objective-C is an extension of the C language, Objective-C
1888 compilations may also use options specific to the C front-end (e.g.,
1889 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
1890 C++-specific options (e.g., @option{-Wabi}).
1891
1892 Here is a list of options that are @emph{only} for compiling Objective-C
1893 and Objective-C++ programs:
1894
1895 @table @gcctabopt
1896 @item -fconstant-string-class=@var{class-name}
1897 @opindex fconstant-string-class
1898 Use @var{class-name} as the name of the class to instantiate for each
1899 literal string specified with the syntax @code{@@"@dots{}"}.  The default
1900 class name is @code{NXConstantString} if the GNU runtime is being used, and
1901 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
1902 @option{-fconstant-cfstrings} option, if also present, will override the
1903 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
1904 to be laid out as constant CoreFoundation strings.
1905
1906 @item -fgnu-runtime
1907 @opindex fgnu-runtime
1908 Generate object code compatible with the standard GNU Objective-C
1909 runtime.  This is the default for most types of systems.
1910
1911 @item -fnext-runtime
1912 @opindex fnext-runtime
1913 Generate output compatible with the NeXT runtime.  This is the default
1914 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
1915 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
1916 used.
1917
1918 @item -fno-nil-receivers
1919 @opindex fno-nil-receivers
1920 Assume that all Objective-C message dispatches (e.g.,
1921 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
1922 is not @code{nil}.  This allows for more efficient entry points in the runtime
1923 to be used.  Currently, this option is only available in conjunction with
1924 the NeXT runtime on Mac OS X 10.3 and later.
1925
1926 @item -fobjc-call-cxx-cdtors
1927 @opindex fobjc-call-cxx-cdtors
1928 For each Objective-C class, check if any of its instance variables is a
1929 C++ object with a non-trivial default constructor.  If so, synthesize a
1930 special @code{- (id) .cxx_construct} instance method that will run
1931 non-trivial default constructors on any such instance variables, in order,
1932 and then return @code{self}.  Similarly, check if any instance variable
1933 is a C++ object with a non-trivial destructor, and if so, synthesize a
1934 special @code{- (void) .cxx_destruct} method that will run
1935 all such default destructors, in reverse order.
1936
1937 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
1938 thusly generated will only operate on instance variables declared in the
1939 current Objective-C class, and not those inherited from superclasses.  It
1940 is the responsibility of the Objective-C runtime to invoke all such methods
1941 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
1942 will be invoked by the runtime immediately after a new object
1943 instance is allocated; the @code{- (void) .cxx_destruct} methods will
1944 be invoked immediately before the runtime deallocates an object instance.
1945
1946 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
1947 support for invoking the @code{- (id) .cxx_construct} and
1948 @code{- (void) .cxx_destruct} methods.
1949
1950 @item -fobjc-direct-dispatch
1951 @opindex fobjc-direct-dispatch
1952 Allow fast jumps to the message dispatcher.  On Darwin this is
1953 accomplished via the comm page.
1954
1955 @item -fobjc-exceptions
1956 @opindex fobjc-exceptions
1957 Enable syntactic support for structured exception handling in Objective-C,
1958 similar to what is offered by C++ and Java.  Currently, this option is only
1959 available in conjunction with the NeXT runtime on Mac OS X 10.3 and later.
1960
1961 @smallexample
1962   @@try @{
1963     @dots{}
1964        @@throw expr;
1965     @dots{}
1966   @}
1967   @@catch (AnObjCClass *exc) @{
1968     @dots{}
1969       @@throw expr;
1970     @dots{}
1971       @@throw;
1972     @dots{}
1973   @}
1974   @@catch (AnotherClass *exc) @{
1975     @dots{}
1976   @}
1977   @@catch (id allOthers) @{
1978     @dots{}
1979   @}
1980   @@finally @{
1981     @dots{}
1982       @@throw expr;
1983     @dots{}
1984   @}
1985 @end smallexample
1986
1987 The @code{@@throw} statement may appear anywhere in an Objective-C or
1988 Objective-C++ program; when used inside of a @code{@@catch} block, the
1989 @code{@@throw} may appear without an argument (as shown above), in which case
1990 the object caught by the @code{@@catch} will be rethrown.
1991
1992 Note that only (pointers to) Objective-C objects may be thrown and
1993 caught using this scheme.  When an object is thrown, it will be caught
1994 by the nearest @code{@@catch} clause capable of handling objects of that type,
1995 analogously to how @code{catch} blocks work in C++ and Java.  A
1996 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
1997 any and all Objective-C exceptions not caught by previous @code{@@catch}
1998 clauses (if any).
1999
2000 The @code{@@finally} clause, if present, will be executed upon exit from the
2001 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2002 regardless of whether any exceptions are thrown, caught or rethrown
2003 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2004 of the @code{finally} clause in Java.
2005
2006 There are several caveats to using the new exception mechanism:
2007
2008 @itemize @bullet
2009 @item
2010 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2011 idioms provided by the @code{NSException} class, the new
2012 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2013 systems, due to additional functionality needed in the (NeXT) Objective-C
2014 runtime.
2015
2016 @item
2017 As mentioned above, the new exceptions do not support handling
2018 types other than Objective-C objects.   Furthermore, when used from
2019 Objective-C++, the Objective-C exception model does not interoperate with C++
2020 exceptions at this time.  This means you cannot @code{@@throw} an exception
2021 from Objective-C and @code{catch} it in C++, or vice versa
2022 (i.e., @code{throw @dots{} @@catch}).
2023 @end itemize
2024
2025 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2026 blocks for thread-safe execution:
2027
2028 @smallexample
2029   @@synchronized (ObjCClass *guard) @{
2030     @dots{}
2031   @}
2032 @end smallexample
2033
2034 Upon entering the @code{@@synchronized} block, a thread of execution shall
2035 first check whether a lock has been placed on the corresponding @code{guard}
2036 object by another thread.  If it has, the current thread shall wait until
2037 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2038 the current thread will place its own lock on it, execute the code contained in
2039 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2040 making @code{guard} available to other threads).
2041
2042 Unlike Java, Objective-C does not allow for entire methods to be marked
2043 @code{@@synchronized}.  Note that throwing exceptions out of
2044 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2045 to be unlocked properly.
2046
2047 @item -fobjc-gc
2048 @opindex fobjc-gc
2049 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2050
2051 @item -freplace-objc-classes
2052 @opindex freplace-objc-classes
2053 Emit a special marker instructing @command{ld(1)} not to statically link in
2054 the resulting object file, and allow @command{dyld(1)} to load it in at
2055 run time instead.  This is used in conjunction with the Fix-and-Continue
2056 debugging mode, where the object file in question may be recompiled and
2057 dynamically reloaded in the course of program execution, without the need
2058 to restart the program itself.  Currently, Fix-and-Continue functionality
2059 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2060 and later.
2061
2062 @item -fzero-link
2063 @opindex fzero-link
2064 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2065 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2066 compile time) with static class references that get initialized at load time,
2067 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2068 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2069 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2070 for individual class implementations to be modified during program execution.
2071
2072 @item -gen-decls
2073 @opindex gen-decls
2074 Dump interface declarations for all classes seen in the source file to a
2075 file named @file{@var{sourcename}.decl}.
2076
2077 @item -Wassign-intercept
2078 @opindex Wassign-intercept
2079 Warn whenever an Objective-C assignment is being intercepted by the
2080 garbage collector.
2081
2082 @item -Wno-protocol
2083 @opindex Wno-protocol
2084 If a class is declared to implement a protocol, a warning is issued for
2085 every method in the protocol that is not implemented by the class.  The
2086 default behavior is to issue a warning for every method not explicitly
2087 implemented in the class, even if a method implementation is inherited
2088 from the superclass.  If you use the @option{-Wno-protocol} option, then
2089 methods inherited from the superclass are considered to be implemented,
2090 and no warning is issued for them.
2091
2092 @item -Wselector
2093 @opindex Wselector
2094 Warn if multiple methods of different types for the same selector are
2095 found during compilation.  The check is performed on the list of methods
2096 in the final stage of compilation.  Additionally, a check is performed
2097 for each selector appearing in a @code{@@selector(@dots{})}
2098 expression, and a corresponding method for that selector has been found
2099 during compilation.  Because these checks scan the method table only at
2100 the end of compilation, these warnings are not produced if the final
2101 stage of compilation is not reached, for example because an error is
2102 found during compilation, or because the @option{-fsyntax-only} option is
2103 being used.
2104
2105 @item -Wstrict-selector-match
2106 @opindex Wstrict-selector-match
2107 Warn if multiple methods with differing argument and/or return types are
2108 found for a given selector when attempting to send a message using this
2109 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2110 is off (which is the default behavior), the compiler will omit such warnings
2111 if any differences found are confined to types which share the same size
2112 and alignment.
2113
2114 @item -Wundeclared-selector
2115 @opindex Wundeclared-selector
2116 Warn if a @code{@@selector(@dots{})} expression referring to an
2117 undeclared selector is found.  A selector is considered undeclared if no
2118 method with that name has been declared before the
2119 @code{@@selector(@dots{})} expression, either explicitly in an
2120 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2121 an @code{@@implementation} section.  This option always performs its
2122 checks as soon as a @code{@@selector(@dots{})} expression is found,
2123 while @option{-Wselector} only performs its checks in the final stage of
2124 compilation.  This also enforces the coding style convention
2125 that methods and selectors must be declared before being used.
2126
2127 @item -print-objc-runtime-info
2128 @opindex print-objc-runtime-info
2129 Generate C header describing the largest structure that is passed by
2130 value, if any.
2131
2132 @end table
2133
2134 @node Language Independent Options
2135 @section Options to Control Diagnostic Messages Formatting
2136 @cindex options to control diagnostics formatting
2137 @cindex diagnostic messages
2138 @cindex message formatting
2139
2140 Traditionally, diagnostic messages have been formatted irrespective of
2141 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2142 below can be used to control the diagnostic messages formatting
2143 algorithm, e.g.@: how many characters per line, how often source location
2144 information should be reported.  Right now, only the C++ front end can
2145 honor these options.  However it is expected, in the near future, that
2146 the remaining front ends would be able to digest them correctly.
2147
2148 @table @gcctabopt
2149 @item -fmessage-length=@var{n}
2150 @opindex fmessage-length
2151 Try to format error messages so that they fit on lines of about @var{n}
2152 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2153 the front ends supported by GCC@.  If @var{n} is zero, then no
2154 line-wrapping will be done; each error message will appear on a single
2155 line.
2156
2157 @opindex fdiagnostics-show-location
2158 @item -fdiagnostics-show-location=once
2159 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2160 reporter to emit @emph{once} source location information; that is, in
2161 case the message is too long to fit on a single physical line and has to
2162 be wrapped, the source location won't be emitted (as prefix) again,
2163 over and over, in subsequent continuation lines.  This is the default
2164 behavior.
2165
2166 @item -fdiagnostics-show-location=every-line
2167 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2168 messages reporter to emit the same source location information (as
2169 prefix) for physical lines that result from the process of breaking
2170 a message which is too long to fit on a single line.
2171
2172 @item -fdiagnostics-show-options
2173 @opindex fdiagnostics-show-options
2174 This option instructs the diagnostic machinery to add text to each
2175 diagnostic emitted, which indicates which command line option directly
2176 controls that diagnostic, when such an option is known to the
2177 diagnostic machinery.
2178
2179 @end table
2180
2181 @node Warning Options
2182 @section Options to Request or Suppress Warnings
2183 @cindex options to control warnings
2184 @cindex warning messages
2185 @cindex messages, warning
2186 @cindex suppressing warnings
2187
2188 Warnings are diagnostic messages that report constructions which
2189 are not inherently erroneous but which are risky or suggest there
2190 may have been an error.
2191
2192 You can request many specific warnings with options beginning @samp{-W},
2193 for example @option{-Wimplicit} to request warnings on implicit
2194 declarations.  Each of these specific warning options also has a
2195 negative form beginning @samp{-Wno-} to turn off warnings;
2196 for example, @option{-Wno-implicit}.  This manual lists only one of the
2197 two forms, whichever is not the default.
2198
2199 The following options control the amount and kinds of warnings produced
2200 by GCC; for further, language-specific options also refer to
2201 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2202 Options}.
2203
2204 @table @gcctabopt
2205 @cindex syntax checking
2206 @item -fsyntax-only
2207 @opindex fsyntax-only
2208 Check the code for syntax errors, but don't do anything beyond that.
2209
2210 @item -pedantic
2211 @opindex pedantic
2212 Issue all the warnings demanded by strict ISO C and ISO C++;
2213 reject all programs that use forbidden extensions, and some other
2214 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2215 version of the ISO C standard specified by any @option{-std} option used.
2216
2217 Valid ISO C and ISO C++ programs should compile properly with or without
2218 this option (though a rare few will require @option{-ansi} or a
2219 @option{-std} option specifying the required version of ISO C)@.  However,
2220 without this option, certain GNU extensions and traditional C and C++
2221 features are supported as well.  With this option, they are rejected.
2222
2223 @option{-pedantic} does not cause warning messages for use of the
2224 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2225 warnings are also disabled in the expression that follows
2226 @code{__extension__}.  However, only system header files should use
2227 these escape routes; application programs should avoid them.
2228 @xref{Alternate Keywords}.
2229
2230 Some users try to use @option{-pedantic} to check programs for strict ISO
2231 C conformance.  They soon find that it does not do quite what they want:
2232 it finds some non-ISO practices, but not all---only those for which
2233 ISO C @emph{requires} a diagnostic, and some others for which
2234 diagnostics have been added.
2235
2236 A feature to report any failure to conform to ISO C might be useful in
2237 some instances, but would require considerable additional work and would
2238 be quite different from @option{-pedantic}.  We don't have plans to
2239 support such a feature in the near future.
2240
2241 Where the standard specified with @option{-std} represents a GNU
2242 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2243 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2244 extended dialect is based.  Warnings from @option{-pedantic} are given
2245 where they are required by the base standard.  (It would not make sense
2246 for such warnings to be given only for features not in the specified GNU
2247 C dialect, since by definition the GNU dialects of C include all
2248 features the compiler supports with the given option, and there would be
2249 nothing to warn about.)
2250
2251 @item -pedantic-errors
2252 @opindex pedantic-errors
2253 Like @option{-pedantic}, except that errors are produced rather than
2254 warnings.
2255
2256 @item -w
2257 @opindex w
2258 Inhibit all warning messages.
2259
2260 @item -Wno-import
2261 @opindex Wno-import
2262 Inhibit warning messages about the use of @samp{#import}.
2263
2264 @item -Wchar-subscripts
2265 @opindex Wchar-subscripts
2266 Warn if an array subscript has type @code{char}.  This is a common cause
2267 of error, as programmers often forget that this type is signed on some
2268 machines.
2269 This warning is enabled by @option{-Wall}.
2270
2271 @item -Wcomment
2272 @opindex Wcomment
2273 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2274 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2275 This warning is enabled by @option{-Wall}.
2276
2277 @item -Wfatal-errors
2278 @opindex Wfatal-errors
2279 This option causes the compiler to abort compilation on the first error
2280 occurred rather than trying to keep going and printing further error
2281 messages.
2282
2283 @item -Wformat
2284 @opindex Wformat
2285 @opindex ffreestanding
2286 @opindex fno-builtin
2287 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2288 the arguments supplied have types appropriate to the format string
2289 specified, and that the conversions specified in the format string make
2290 sense.  This includes standard functions, and others specified by format
2291 attributes (@pxref{Function Attributes}), in the @code{printf},
2292 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2293 not in the C standard) families (or other target-specific families).
2294 Which functions are checked without format attributes having been
2295 specified depends on the standard version selected, and such checks of
2296 functions without the attribute specified are disabled by
2297 @option{-ffreestanding} or @option{-fno-builtin}.
2298
2299 The formats are checked against the format features supported by GNU
2300 libc version 2.2.  These include all ISO C90 and C99 features, as well
2301 as features from the Single Unix Specification and some BSD and GNU
2302 extensions.  Other library implementations may not support all these
2303 features; GCC does not support warning about features that go beyond a
2304 particular library's limitations.  However, if @option{-pedantic} is used
2305 with @option{-Wformat}, warnings will be given about format features not
2306 in the selected standard version (but not for @code{strfmon} formats,
2307 since those are not in any version of the C standard).  @xref{C Dialect
2308 Options,,Options Controlling C Dialect}.
2309
2310 Since @option{-Wformat} also checks for null format arguments for
2311 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2312
2313 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2314 aspects of format checking, the options @option{-Wformat-y2k},
2315 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2316 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2317 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2318
2319 @item -Wformat-y2k
2320 @opindex Wformat-y2k
2321 If @option{-Wformat} is specified, also warn about @code{strftime}
2322 formats which may yield only a two-digit year.
2323
2324 @item -Wno-format-extra-args
2325 @opindex Wno-format-extra-args
2326 If @option{-Wformat} is specified, do not warn about excess arguments to a
2327 @code{printf} or @code{scanf} format function.  The C standard specifies
2328 that such arguments are ignored.
2329
2330 Where the unused arguments lie between used arguments that are
2331 specified with @samp{$} operand number specifications, normally
2332 warnings are still given, since the implementation could not know what
2333 type to pass to @code{va_arg} to skip the unused arguments.  However,
2334 in the case of @code{scanf} formats, this option will suppress the
2335 warning if the unused arguments are all pointers, since the Single
2336 Unix Specification says that such unused arguments are allowed.
2337
2338 @item -Wno-format-zero-length
2339 @opindex Wno-format-zero-length
2340 If @option{-Wformat} is specified, do not warn about zero-length formats.
2341 The C standard specifies that zero-length formats are allowed.
2342
2343 @item -Wformat-nonliteral
2344 @opindex Wformat-nonliteral
2345 If @option{-Wformat} is specified, also warn if the format string is not a
2346 string literal and so cannot be checked, unless the format function
2347 takes its format arguments as a @code{va_list}.
2348
2349 @item -Wformat-security
2350 @opindex Wformat-security
2351 If @option{-Wformat} is specified, also warn about uses of format
2352 functions that represent possible security problems.  At present, this
2353 warns about calls to @code{printf} and @code{scanf} functions where the
2354 format string is not a string literal and there are no format arguments,
2355 as in @code{printf (foo);}.  This may be a security hole if the format
2356 string came from untrusted input and contains @samp{%n}.  (This is
2357 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2358 in future warnings may be added to @option{-Wformat-security} that are not
2359 included in @option{-Wformat-nonliteral}.)
2360
2361 @item -Wformat=2
2362 @opindex Wformat=2
2363 Enable @option{-Wformat} plus format checks not included in
2364 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2365 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2366
2367 @item -Wnonnull
2368 @opindex Wnonnull
2369 Warn about passing a null pointer for arguments marked as
2370 requiring a non-null value by the @code{nonnull} function attribute.
2371
2372 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2373 can be disabled with the @option{-Wno-nonnull} option.
2374
2375 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2376 @opindex Winit-self
2377 Warn about uninitialized variables which are initialized with themselves.
2378 Note this option can only be used with the @option{-Wuninitialized} option,
2379 which in turn only works with @option{-O1} and above.
2380
2381 For example, GCC will warn about @code{i} being uninitialized in the
2382 following snippet only when @option{-Winit-self} has been specified:
2383 @smallexample
2384 @group
2385 int f()
2386 @{
2387   int i = i;
2388   return i;
2389 @}
2390 @end group
2391 @end smallexample
2392
2393 @item -Wimplicit-int
2394 @opindex Wimplicit-int
2395 Warn when a declaration does not specify a type.
2396 This warning is enabled by @option{-Wall}.
2397
2398 @item -Wimplicit-function-declaration
2399 @itemx -Werror-implicit-function-declaration
2400 @opindex Wimplicit-function-declaration
2401 @opindex Werror-implicit-function-declaration
2402 Give a warning (or error) whenever a function is used before being
2403 declared.  The form @option{-Wno-error-implicit-function-declaration}
2404 is not supported.
2405 This warning is enabled by @option{-Wall} (as a warning, not an error).
2406
2407 @item -Wimplicit
2408 @opindex Wimplicit
2409 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2410 This warning is enabled by @option{-Wall}.
2411
2412 @item -Wmain
2413 @opindex Wmain
2414 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2415 function with external linkage, returning int, taking either zero
2416 arguments, two, or three arguments of appropriate types.
2417 This warning is enabled by @option{-Wall}.
2418
2419 @item -Wmissing-braces
2420 @opindex Wmissing-braces
2421 Warn if an aggregate or union initializer is not fully bracketed.  In
2422 the following example, the initializer for @samp{a} is not fully
2423 bracketed, but that for @samp{b} is fully bracketed.
2424
2425 @smallexample
2426 int a[2][2] = @{ 0, 1, 2, 3 @};
2427 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2428 @end smallexample
2429
2430 This warning is enabled by @option{-Wall}.
2431
2432 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2433 @opindex Wmissing-include-dirs
2434 Warn if a user-supplied include directory does not exist.
2435
2436 @item -Wparentheses
2437 @opindex Wparentheses
2438 Warn if parentheses are omitted in certain contexts, such
2439 as when there is an assignment in a context where a truth value
2440 is expected, or when operators are nested whose precedence people
2441 often get confused about.  Only the warning for an assignment used as
2442 a truth value is supported when compiling C++; the other warnings are
2443 only supported when compiling C@.
2444
2445 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2446 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2447 interpretation from that of ordinary mathematical notation.
2448
2449 Also warn about constructions where there may be confusion to which
2450 @code{if} statement an @code{else} branch belongs.  Here is an example of
2451 such a case:
2452
2453 @smallexample
2454 @group
2455 @{
2456   if (a)
2457     if (b)
2458       foo ();
2459   else
2460     bar ();
2461 @}
2462 @end group
2463 @end smallexample
2464
2465 In C, every @code{else} branch belongs to the innermost possible @code{if}
2466 statement, which in this example is @code{if (b)}.  This is often not
2467 what the programmer expected, as illustrated in the above example by
2468 indentation the programmer chose.  When there is the potential for this
2469 confusion, GCC will issue a warning when this flag is specified.
2470 To eliminate the warning, add explicit braces around the innermost
2471 @code{if} statement so there is no way the @code{else} could belong to
2472 the enclosing @code{if}.  The resulting code would look like this:
2473
2474 @smallexample
2475 @group
2476 @{
2477   if (a)
2478     @{
2479       if (b)
2480         foo ();
2481       else
2482         bar ();
2483     @}
2484 @}
2485 @end group
2486 @end smallexample
2487
2488 This warning is enabled by @option{-Wall}.
2489
2490 @item -Wsequence-point
2491 @opindex Wsequence-point
2492 Warn about code that may have undefined semantics because of violations
2493 of sequence point rules in the C standard.
2494
2495 The C standard defines the order in which expressions in a C program are
2496 evaluated in terms of @dfn{sequence points}, which represent a partial
2497 ordering between the execution of parts of the program: those executed
2498 before the sequence point, and those executed after it.  These occur
2499 after the evaluation of a full expression (one which is not part of a
2500 larger expression), after the evaluation of the first operand of a
2501 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2502 function is called (but after the evaluation of its arguments and the
2503 expression denoting the called function), and in certain other places.
2504 Other than as expressed by the sequence point rules, the order of
2505 evaluation of subexpressions of an expression is not specified.  All
2506 these rules describe only a partial order rather than a total order,
2507 since, for example, if two functions are called within one expression
2508 with no sequence point between them, the order in which the functions
2509 are called is not specified.  However, the standards committee have
2510 ruled that function calls do not overlap.
2511
2512 It is not specified when between sequence points modifications to the
2513 values of objects take effect.  Programs whose behavior depends on this
2514 have undefined behavior; the C standard specifies that ``Between the
2515 previous and next sequence point an object shall have its stored value
2516 modified at most once by the evaluation of an expression.  Furthermore,
2517 the prior value shall be read only to determine the value to be
2518 stored.''.  If a program breaks these rules, the results on any
2519 particular implementation are entirely unpredictable.
2520
2521 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2522 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2523 diagnosed by this option, and it may give an occasional false positive
2524 result, but in general it has been found fairly effective at detecting
2525 this sort of problem in programs.
2526
2527 The present implementation of this option only works for C programs.  A
2528 future implementation may also work for C++ programs.
2529
2530 The C standard is worded confusingly, therefore there is some debate
2531 over the precise meaning of the sequence point rules in subtle cases.
2532 Links to discussions of the problem, including proposed formal
2533 definitions, may be found on the GCC readings page, at
2534 @w{@uref{http://gcc.gnu.org/readings.html}}.
2535
2536 This warning is enabled by @option{-Wall}.
2537
2538 @item -Wreturn-type
2539 @opindex Wreturn-type
2540 Warn whenever a function is defined with a return-type that defaults to
2541 @code{int}.  Also warn about any @code{return} statement with no
2542 return-value in a function whose return-type is not @code{void}.
2543
2544 For C, also warn if the return type of a function has a type qualifier
2545 such as @code{const}.  Such a type qualifier has no effect, since the
2546 value returned by a function is not an lvalue.  ISO C prohibits
2547 qualified @code{void} return types on function definitions, so such
2548 return types always receive a warning even without this option.
2549
2550 For C++, a function without return type always produces a diagnostic
2551 message, even when @option{-Wno-return-type} is specified.  The only
2552 exceptions are @samp{main} and functions defined in system headers.
2553
2554 This warning is enabled by @option{-Wall}.
2555
2556 @item -Wswitch
2557 @opindex Wswitch
2558 Warn whenever a @code{switch} statement has an index of enumerated type
2559 and lacks a @code{case} for one or more of the named codes of that
2560 enumeration.  (The presence of a @code{default} label prevents this
2561 warning.)  @code{case} labels outside the enumeration range also
2562 provoke warnings when this option is used.
2563 This warning is enabled by @option{-Wall}.
2564
2565 @item -Wswitch-default
2566 @opindex Wswitch-switch
2567 Warn whenever a @code{switch} statement does not have a @code{default}
2568 case.
2569
2570 @item -Wswitch-enum
2571 @opindex Wswitch-enum
2572 Warn whenever a @code{switch} statement has an index of enumerated type
2573 and lacks a @code{case} for one or more of the named codes of that
2574 enumeration.  @code{case} labels outside the enumeration range also
2575 provoke warnings when this option is used.
2576
2577 @item -Wtrigraphs
2578 @opindex Wtrigraphs
2579 Warn if any trigraphs are encountered that might change the meaning of
2580 the program (trigraphs within comments are not warned about).
2581 This warning is enabled by @option{-Wall}.
2582
2583 @item -Wunused-function
2584 @opindex Wunused-function
2585 Warn whenever a static function is declared but not defined or a
2586 non\-inline static function is unused.
2587 This warning is enabled by @option{-Wall}.
2588
2589 @item -Wunused-label
2590 @opindex Wunused-label
2591 Warn whenever a label is declared but not used.
2592 This warning is enabled by @option{-Wall}.
2593
2594 To suppress this warning use the @samp{unused} attribute
2595 (@pxref{Variable Attributes}).
2596
2597 @item -Wunused-parameter
2598 @opindex Wunused-parameter
2599 Warn whenever a function parameter is unused aside from its declaration.
2600
2601 To suppress this warning use the @samp{unused} attribute
2602 (@pxref{Variable Attributes}).
2603
2604 @item -Wunused-variable
2605 @opindex Wunused-variable
2606 Warn whenever a local variable or non-constant static variable is unused
2607 aside from its declaration
2608 This warning is enabled by @option{-Wall}.
2609
2610 To suppress this warning use the @samp{unused} attribute
2611 (@pxref{Variable Attributes}).
2612
2613 @item -Wunused-value
2614 @opindex Wunused-value
2615 Warn whenever a statement computes a result that is explicitly not used.
2616 This warning is enabled by @option{-Wall}.
2617
2618 To suppress this warning cast the expression to @samp{void}.
2619
2620 @item -Wunused
2621 @opindex Wunused
2622 All the above @option{-Wunused} options combined.
2623
2624 In order to get a warning about an unused function parameter, you must
2625 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2626 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2627
2628 @item -Wuninitialized
2629 @opindex Wuninitialized
2630 Warn if an automatic variable is used without first being initialized or
2631 if a variable may be clobbered by a @code{setjmp} call.
2632
2633 These warnings are possible only in optimizing compilation,
2634 because they require data flow information that is computed only
2635 when optimizing.  If you don't specify @option{-O}, you simply won't
2636 get these warnings.
2637
2638 If you want to warn about code which uses the uninitialized value of the
2639 variable in its own initializer, use the @option{-Winit-self} option.
2640
2641 These warnings occur for individual uninitialized or clobbered
2642 elements of structure, union or array variables as well as for
2643 variables which are uninitialized or clobbered as a whole.  They do
2644 not occur for variables or elements declared @code{volatile}.  Because
2645 these warnings depend on optimization, the exact variables or elements
2646 for which there are warnings will depend on the precise optimization
2647 options and version of GCC used.
2648
2649 Note that there may be no warning about a variable that is used only
2650 to compute a value that itself is never used, because such
2651 computations may be deleted by data flow analysis before the warnings
2652 are printed.
2653
2654 These warnings are made optional because GCC is not smart
2655 enough to see all the reasons why the code might be correct
2656 despite appearing to have an error.  Here is one example of how
2657 this can happen:
2658
2659 @smallexample
2660 @group
2661 @{
2662   int x;
2663   switch (y)
2664     @{
2665     case 1: x = 1;
2666       break;
2667     case 2: x = 4;
2668       break;
2669     case 3: x = 5;
2670     @}
2671   foo (x);
2672 @}
2673 @end group
2674 @end smallexample
2675
2676 @noindent
2677 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2678 always initialized, but GCC doesn't know this.  Here is
2679 another common case:
2680
2681 @smallexample
2682 @{
2683   int save_y;
2684   if (change_y) save_y = y, y = new_y;
2685   @dots{}
2686   if (change_y) y = save_y;
2687 @}
2688 @end smallexample
2689
2690 @noindent
2691 This has no bug because @code{save_y} is used only if it is set.
2692
2693 @cindex @code{longjmp} warnings
2694 This option also warns when a non-volatile automatic variable might be
2695 changed by a call to @code{longjmp}.  These warnings as well are possible
2696 only in optimizing compilation.
2697
2698 The compiler sees only the calls to @code{setjmp}.  It cannot know
2699 where @code{longjmp} will be called; in fact, a signal handler could
2700 call it at any point in the code.  As a result, you may get a warning
2701 even when there is in fact no problem because @code{longjmp} cannot
2702 in fact be called at the place which would cause a problem.
2703
2704 Some spurious warnings can be avoided if you declare all the functions
2705 you use that never return as @code{noreturn}.  @xref{Function
2706 Attributes}.
2707
2708 This warning is enabled by @option{-Wall}.
2709
2710 @item -Wunknown-pragmas
2711 @opindex Wunknown-pragmas
2712 @cindex warning for unknown pragmas
2713 @cindex unknown pragmas, warning
2714 @cindex pragmas, warning of unknown
2715 Warn when a #pragma directive is encountered which is not understood by
2716 GCC@.  If this command line option is used, warnings will even be issued
2717 for unknown pragmas in system header files.  This is not the case if
2718 the warnings were only enabled by the @option{-Wall} command line option.
2719
2720 @item -Wno-pragmas
2721 @opindex Wno-pragmas
2722 @opindex Wpragmas
2723 Do not warn about misuses of pragmas, such as incorrect parameters,
2724 invalid syntax, or conflicts between pragmas.  See also
2725 @samp{-Wunknown-pragmas}.
2726
2727 @item -Wstrict-aliasing
2728 @opindex Wstrict-aliasing
2729 This option is only active when @option{-fstrict-aliasing} is active.
2730 It warns about code which might break the strict aliasing rules that the
2731 compiler is using for optimization.  The warning does not catch all
2732 cases, but does attempt to catch the more common pitfalls.  It is
2733 included in @option{-Wall}.
2734
2735 @item -Wstrict-aliasing=2
2736 @opindex Wstrict-aliasing=2
2737 This option is only active when @option{-fstrict-aliasing} is active.
2738 It warns about code which might break the strict aliasing rules that the
2739 compiler is using for optimization.  This warning catches more cases than
2740 @option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
2741 cases that are safe.
2742
2743 @item -Wall
2744 @opindex Wall
2745 All of the above @samp{-W} options combined.  This enables all the
2746 warnings about constructions that some users consider questionable, and
2747 that are easy to avoid (or modify to prevent the warning), even in
2748 conjunction with macros.  This also enables some language-specific
2749 warnings described in @ref{C++ Dialect Options} and
2750 @ref{Objective-C and Objective-C++ Dialect Options}.
2751 @end table
2752
2753 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
2754 Some of them warn about constructions that users generally do not
2755 consider questionable, but which occasionally you might wish to check
2756 for; others warn about constructions that are necessary or hard to avoid
2757 in some cases, and there is no simple way to modify the code to suppress
2758 the warning.
2759
2760 @table @gcctabopt
2761 @item -Wextra
2762 @opindex W
2763 @opindex Wextra
2764 (This option used to be called @option{-W}.  The older name is still
2765 supported, but the newer name is more descriptive.)  Print extra warning
2766 messages for these events:
2767
2768 @itemize @bullet
2769 @item
2770 A function can return either with or without a value.  (Falling
2771 off the end of the function body is considered returning without
2772 a value.)  For example, this function would evoke such a
2773 warning:
2774
2775 @smallexample
2776 @group
2777 foo (a)
2778 @{
2779   if (a > 0)
2780     return a;
2781 @}
2782 @end group
2783 @end smallexample
2784
2785 @item
2786 An expression-statement or the left-hand side of a comma expression
2787 contains no side effects.
2788 To suppress the warning, cast the unused expression to void.
2789 For example, an expression such as @samp{x[i,j]} will cause a warning,
2790 but @samp{x[(void)i,j]} will not.
2791
2792 @item
2793 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
2794
2795 @item
2796 Storage-class specifiers like @code{static} are not the first things in
2797 a declaration.  According to the C Standard, this usage is obsolescent.
2798
2799 @item
2800 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
2801 arguments.
2802
2803 @item
2804 A comparison between signed and unsigned values could produce an
2805 incorrect result when the signed value is converted to unsigned.
2806 (But don't warn if @option{-Wno-sign-compare} is also specified.)
2807
2808 @item
2809 An aggregate has an initializer which does not initialize all members.
2810 This warning can be independently controlled by
2811 @option{-Wmissing-field-initializers}.
2812
2813 @item
2814 A function parameter is declared without a type specifier in K&R-style
2815 functions:
2816
2817 @smallexample
2818 void foo(bar) @{ @}
2819 @end smallexample
2820
2821 @item
2822 An empty body occurs in an @samp{if} or @samp{else} statement.
2823
2824 @item
2825 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2826 @samp{>}, or @samp{>=}.
2827
2828 @item
2829 A variable might be changed by @samp{longjmp} or @samp{vfork}.
2830
2831 @item
2832 Any of several floating-point events that often indicate errors, such as
2833 overflow, underflow, loss of precision, etc.
2834
2835 @item @r{(C++ only)}
2836 An enumerator and a non-enumerator both appear in a conditional expression.
2837
2838 @item @r{(C++ only)}
2839 A non-static reference or non-static @samp{const} member appears in a
2840 class without constructors.
2841
2842 @item @r{(C++ only)}
2843 Ambiguous virtual bases.
2844
2845 @item @r{(C++ only)}
2846 Subscripting an array which has been declared @samp{register}.
2847
2848 @item @r{(C++ only)}
2849 Taking the address of a variable which has been declared @samp{register}.
2850
2851 @item @r{(C++ only)}
2852 A base class is not initialized in a derived class' copy constructor.
2853 @end itemize
2854
2855 @item -Wno-div-by-zero
2856 @opindex Wno-div-by-zero
2857 @opindex Wdiv-by-zero
2858 Do not warn about compile-time integer division by zero.  Floating point
2859 division by zero is not warned about, as it can be a legitimate way of
2860 obtaining infinities and NaNs.
2861
2862 @item -Wsystem-headers
2863 @opindex Wsystem-headers
2864 @cindex warnings from system headers
2865 @cindex system headers, warnings from
2866 Print warning messages for constructs found in system header files.
2867 Warnings from system headers are normally suppressed, on the assumption
2868 that they usually do not indicate real problems and would only make the
2869 compiler output harder to read.  Using this command line option tells
2870 GCC to emit warnings from system headers as if they occurred in user
2871 code.  However, note that using @option{-Wall} in conjunction with this
2872 option will @emph{not} warn about unknown pragmas in system
2873 headers---for that, @option{-Wunknown-pragmas} must also be used.
2874
2875 @item -Wfloat-equal
2876 @opindex Wfloat-equal
2877 Warn if floating point values are used in equality comparisons.
2878
2879 The idea behind this is that sometimes it is convenient (for the
2880 programmer) to consider floating-point values as approximations to
2881 infinitely precise real numbers.  If you are doing this, then you need
2882 to compute (by analyzing the code, or in some other way) the maximum or
2883 likely maximum error that the computation introduces, and allow for it
2884 when performing comparisons (and when producing output, but that's a
2885 different problem).  In particular, instead of testing for equality, you
2886 would check to see whether the two values have ranges that overlap; and
2887 this is done with the relational operators, so equality comparisons are
2888 probably mistaken.
2889
2890 @item -Wtraditional @r{(C only)}
2891 @opindex Wtraditional
2892 Warn about certain constructs that behave differently in traditional and
2893 ISO C@.  Also warn about ISO C constructs that have no traditional C
2894 equivalent, and/or problematic constructs which should be avoided.
2895
2896 @itemize @bullet
2897 @item
2898 Macro parameters that appear within string literals in the macro body.
2899 In traditional C macro replacement takes place within string literals,
2900 but does not in ISO C@.
2901
2902 @item
2903 In traditional C, some preprocessor directives did not exist.
2904 Traditional preprocessors would only consider a line to be a directive
2905 if the @samp{#} appeared in column 1 on the line.  Therefore
2906 @option{-Wtraditional} warns about directives that traditional C
2907 understands but would ignore because the @samp{#} does not appear as the
2908 first character on the line.  It also suggests you hide directives like
2909 @samp{#pragma} not understood by traditional C by indenting them.  Some
2910 traditional implementations would not recognize @samp{#elif}, so it
2911 suggests avoiding it altogether.
2912
2913 @item
2914 A function-like macro that appears without arguments.
2915
2916 @item
2917 The unary plus operator.
2918
2919 @item
2920 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
2921 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
2922 constants.)  Note, these suffixes appear in macros defined in the system
2923 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
2924 Use of these macros in user code might normally lead to spurious
2925 warnings, however GCC's integrated preprocessor has enough context to
2926 avoid warning in these cases.
2927
2928 @item
2929 A function declared external in one block and then used after the end of
2930 the block.
2931
2932 @item
2933 A @code{switch} statement has an operand of type @code{long}.
2934
2935 @item
2936 A non-@code{static} function declaration follows a @code{static} one.
2937 This construct is not accepted by some traditional C compilers.
2938
2939 @item
2940 The ISO type of an integer constant has a different width or
2941 signedness from its traditional type.  This warning is only issued if
2942 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
2943 typically represent bit patterns, are not warned about.
2944
2945 @item
2946 Usage of ISO string concatenation is detected.
2947
2948 @item
2949 Initialization of automatic aggregates.
2950
2951 @item
2952 Identifier conflicts with labels.  Traditional C lacks a separate
2953 namespace for labels.
2954
2955 @item
2956 Initialization of unions.  If the initializer is zero, the warning is
2957 omitted.  This is done under the assumption that the zero initializer in
2958 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
2959 initializer warnings and relies on default initialization to zero in the
2960 traditional C case.
2961
2962 @item
2963 Conversions by prototypes between fixed/floating point values and vice
2964 versa.  The absence of these prototypes when compiling with traditional
2965 C would cause serious problems.  This is a subset of the possible
2966 conversion warnings, for the full set use @option{-Wconversion}.
2967
2968 @item
2969 Use of ISO C style function definitions.  This warning intentionally is
2970 @emph{not} issued for prototype declarations or variadic functions
2971 because these ISO C features will appear in your code when using
2972 libiberty's traditional C compatibility macros, @code{PARAMS} and
2973 @code{VPARAMS}.  This warning is also bypassed for nested functions
2974 because that feature is already a GCC extension and thus not relevant to
2975 traditional C compatibility.
2976 @end itemize
2977
2978 @item -Wdeclaration-after-statement @r{(C only)}
2979 @opindex Wdeclaration-after-statement
2980 Warn when a declaration is found after a statement in a block.  This
2981 construct, known from C++, was introduced with ISO C99 and is by default
2982 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
2983 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
2984
2985 @item -Wundef
2986 @opindex Wundef
2987 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
2988
2989 @item -Wno-endif-labels
2990 @opindex Wno-endif-labels
2991 @opindex Wendif-labels
2992 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
2993
2994 @item -Wshadow
2995 @opindex Wshadow
2996 Warn whenever a local variable shadows another local variable, parameter or
2997 global variable or whenever a built-in function is shadowed.
2998
2999 @item -Wlarger-than-@var{len}
3000 @opindex Wlarger-than
3001 Warn whenever an object of larger than @var{len} bytes is defined.
3002
3003 @item -Wunsafe-loop-optimizations
3004 @opindex Wunsafe-loop-optimizations
3005 Warn if the loop cannot be optimized because the compiler could not
3006 assume anything on the bounds of the loop indices.  With
3007 @option{-funsafe-loop-optimizations} warn if the compiler made
3008 such assumptions.
3009
3010 @item -Wpointer-arith
3011 @opindex Wpointer-arith
3012 Warn about anything that depends on the ``size of'' a function type or
3013 of @code{void}.  GNU C assigns these types a size of 1, for
3014 convenience in calculations with @code{void *} pointers and pointers
3015 to functions.
3016
3017 @item -Wbad-function-cast @r{(C only)}
3018 @opindex Wbad-function-cast
3019 Warn whenever a function call is cast to a non-matching type.
3020 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3021
3022 @item -Wc++-compat
3023 Warn about ISO C constructs that are outside of the common subset of
3024 ISO C and ISO C++, e.g.@: request for implicit conversion from
3025 @code{void *} to a pointer to non-@code{void} type.
3026
3027 @item -Wcast-qual
3028 @opindex Wcast-qual
3029 Warn whenever a pointer is cast so as to remove a type qualifier from
3030 the target type.  For example, warn if a @code{const char *} is cast
3031 to an ordinary @code{char *}.
3032
3033 @item -Wcast-align
3034 @opindex Wcast-align
3035 Warn whenever a pointer is cast such that the required alignment of the
3036 target is increased.  For example, warn if a @code{char *} is cast to
3037 an @code{int *} on machines where integers can only be accessed at
3038 two- or four-byte boundaries.
3039
3040 @item -Wwrite-strings
3041 @opindex Wwrite-strings
3042 When compiling C, give string constants the type @code{const
3043 char[@var{length}]} so that
3044 copying the address of one into a non-@code{const} @code{char *}
3045 pointer will get a warning; when compiling C++, warn about the
3046 deprecated conversion from string constants to @code{char *}.
3047 These warnings will help you find at
3048 compile time code that can try to write into a string constant, but
3049 only if you have been very careful about using @code{const} in
3050 declarations and prototypes.  Otherwise, it will just be a nuisance;
3051 this is why we did not make @option{-Wall} request these warnings.
3052
3053 @item -Wconversion
3054 @opindex Wconversion
3055 Warn if a prototype causes a type conversion that is different from what
3056 would happen to the same argument in the absence of a prototype.  This
3057 includes conversions of fixed point to floating and vice versa, and
3058 conversions changing the width or signedness of a fixed point argument
3059 except when the same as the default promotion.
3060
3061 Also, warn if a negative integer constant expression is implicitly
3062 converted to an unsigned type.  For example, warn about the assignment
3063 @code{x = -1} if @code{x} is unsigned.  But do not warn about explicit
3064 casts like @code{(unsigned) -1}.
3065
3066 @item -Wsign-compare
3067 @opindex Wsign-compare
3068 @cindex warning for comparison of signed and unsigned values
3069 @cindex comparison of signed and unsigned values, warning
3070 @cindex signed and unsigned values, comparison warning
3071 Warn when a comparison between signed and unsigned values could produce
3072 an incorrect result when the signed value is converted to unsigned.
3073 This warning is also enabled by @option{-Wextra}; to get the other warnings
3074 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3075
3076 @item -Waggregate-return
3077 @opindex Waggregate-return
3078 Warn if any functions that return structures or unions are defined or
3079 called.  (In languages where you can return an array, this also elicits
3080 a warning.)
3081
3082 @item -Wno-attributes
3083 @opindex Wno-attributes
3084 @opindex Wattributes
3085 Do not warn if an unexpected @code{__attribute__} is used, such as
3086 unrecognized attributes, function attributes applied to variables,
3087 etc.  This will not stop errors for incorrect use of supported
3088 attributes.
3089
3090 @item -Wstrict-prototypes @r{(C only)}
3091 @opindex Wstrict-prototypes
3092 Warn if a function is declared or defined without specifying the
3093 argument types.  (An old-style function definition is permitted without
3094 a warning if preceded by a declaration which specifies the argument
3095 types.)
3096
3097 @item -Wold-style-definition @r{(C only)}
3098 @opindex Wold-style-definition
3099 Warn if an old-style function definition is used.  A warning is given
3100 even if there is a previous prototype.
3101
3102 @item -Wmissing-prototypes @r{(C only)}
3103 @opindex Wmissing-prototypes
3104 Warn if a global function is defined without a previous prototype
3105 declaration.  This warning is issued even if the definition itself
3106 provides a prototype.  The aim is to detect global functions that fail
3107 to be declared in header files.
3108
3109 @item -Wmissing-declarations @r{(C only)}
3110 @opindex Wmissing-declarations
3111 Warn if a global function is defined without a previous declaration.
3112 Do so even if the definition itself provides a prototype.
3113 Use this option to detect global functions that are not declared in
3114 header files.
3115
3116 @item -Wmissing-field-initializers
3117 @opindex Wmissing-field-initializers
3118 @opindex W
3119 @opindex Wextra
3120 Warn if a structure's initializer has some fields missing.  For
3121 example, the following code would cause such a warning, because
3122 @code{x.h} is implicitly zero:
3123
3124 @smallexample
3125 struct s @{ int f, g, h; @};
3126 struct s x = @{ 3, 4 @};
3127 @end smallexample
3128
3129 This option does not warn about designated initializers, so the following
3130 modification would not trigger a warning:
3131
3132 @smallexample
3133 struct s @{ int f, g, h; @};
3134 struct s x = @{ .f = 3, .g = 4 @};
3135 @end smallexample
3136
3137 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3138 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3139
3140 @item -Wmissing-noreturn
3141 @opindex Wmissing-noreturn
3142 Warn about functions which might be candidates for attribute @code{noreturn}.
3143 Note these are only possible candidates, not absolute ones.  Care should
3144 be taken to manually verify functions actually do not ever return before
3145 adding the @code{noreturn} attribute, otherwise subtle code generation
3146 bugs could be introduced.  You will not get a warning for @code{main} in
3147 hosted C environments.
3148
3149 @item -Wmissing-format-attribute
3150 @opindex Wmissing-format-attribute
3151 @opindex Wformat
3152 Warn about function pointers which might be candidates for @code{format}
3153 attributes.  Note these are only possible candidates, not absolute ones.
3154 GCC will guess that function pointers with @code{format} attributes that
3155 are used in assignment, initialization, parameter passing or return
3156 statements should have a corresponding @code{format} attribute in the
3157 resulting type.  I.e.@: the left-hand side of the assignment or
3158 initialization, the type of the parameter variable, or the return type
3159 of the containing function respectively should also have a @code{format}
3160 attribute to avoid the warning.
3161
3162 GCC will also warn about function definitions which might be
3163 candidates for @code{format} attributes.  Again, these are only
3164 possible candidates.  GCC will guess that @code{format} attributes
3165 might be appropriate for any function that calls a function like
3166 @code{vprintf} or @code{vscanf}, but this might not always be the
3167 case, and some functions for which @code{format} attributes are
3168 appropriate may not be detected.
3169
3170 @item -Wno-multichar
3171 @opindex Wno-multichar
3172 @opindex Wmultichar
3173 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3174 Usually they indicate a typo in the user's code, as they have
3175 implementation-defined values, and should not be used in portable code.
3176
3177 @item -Wnormalized=<none|id|nfc|nfkc>
3178 @opindex Wnormalized
3179 @cindex NFC
3180 @cindex NFKC
3181 @cindex character set, input normalization
3182 In ISO C and ISO C++, two identifiers are different if they are
3183 different sequences of characters.  However, sometimes when characters
3184 outside the basic ASCII character set are used, you can have two
3185 different character sequences that look the same.  To avoid confusion,
3186 the ISO 10646 standard sets out some @dfn{normalization rules} which
3187 when applied ensure that two sequences that look the same are turned into
3188 the same sequence.  GCC can warn you if you are using identifiers which
3189 have not been normalized; this option controls that warning.
3190
3191 There are four levels of warning that GCC supports.  The default is
3192 @option{-Wnormalized=nfc}, which warns about any identifier which is
3193 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3194 recommended form for most uses.
3195
3196 Unfortunately, there are some characters which ISO C and ISO C++ allow
3197 in identifiers that when turned into NFC aren't allowable as
3198 identifiers.  That is, there's no way to use these symbols in portable
3199 ISO C or C++ and have all your identifiers in NFC.
3200 @option{-Wnormalized=id} suppresses the warning for these characters.
3201 It is hoped that future versions of the standards involved will correct
3202 this, which is why this option is not the default.
3203
3204 You can switch the warning off for all characters by writing
3205 @option{-Wnormalized=none}.  You would only want to do this if you
3206 were using some other normalization scheme (like ``D''), because
3207 otherwise you can easily create bugs that are literally impossible to see.
3208
3209 Some characters in ISO 10646 have distinct meanings but look identical
3210 in some fonts or display methodologies, especially once formatting has
3211 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3212 LETTER N'', will display just like a regular @code{n} which has been
3213 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3214 normalisation scheme to convert all these into a standard form as
3215 well, and GCC will warn if your code is not in NFKC if you use
3216 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3217 about every identifier that contains the letter O because it might be
3218 confused with the digit 0, and so is not the default, but may be
3219 useful as a local coding convention if the programming environment is
3220 unable to be fixed to display these characters distinctly.
3221
3222 @item -Wno-deprecated-declarations
3223 @opindex Wno-deprecated-declarations
3224 Do not warn about uses of functions, variables, and types marked as
3225 deprecated by using the @code{deprecated} attribute.
3226 (@pxref{Function Attributes}, @pxref{Variable Attributes},
3227 @pxref{Type Attributes}.)
3228
3229 @item -Wpacked
3230 @opindex Wpacked
3231 Warn if a structure is given the packed attribute, but the packed
3232 attribute has no effect on the layout or size of the structure.
3233 Such structures may be mis-aligned for little benefit.  For
3234 instance, in this code, the variable @code{f.x} in @code{struct bar}
3235 will be misaligned even though @code{struct bar} does not itself
3236 have the packed attribute:
3237
3238 @smallexample
3239 @group
3240 struct foo @{
3241   int x;
3242   char a, b, c, d;
3243 @} __attribute__((packed));
3244 struct bar @{
3245   char z;
3246   struct foo f;
3247 @};
3248 @end group
3249 @end smallexample
3250
3251 @item -Wpadded
3252 @opindex Wpadded
3253 Warn if padding is included in a structure, either to align an element
3254 of the structure or to align the whole structure.  Sometimes when this
3255 happens it is possible to rearrange the fields of the structure to
3256 reduce the padding and so make the structure smaller.
3257
3258 @item -Wredundant-decls
3259 @opindex Wredundant-decls
3260 Warn if anything is declared more than once in the same scope, even in
3261 cases where multiple declaration is valid and changes nothing.
3262
3263 @item -Wnested-externs @r{(C only)}
3264 @opindex Wnested-externs
3265 Warn if an @code{extern} declaration is encountered within a function.
3266
3267 @item -Wunreachable-code
3268 @opindex Wunreachable-code
3269 Warn if the compiler detects that code will never be executed.
3270
3271 This option is intended to warn when the compiler detects that at
3272 least a whole line of source code will never be executed, because
3273 some condition is never satisfied or because it is after a
3274 procedure that never returns.
3275
3276 It is possible for this option to produce a warning even though there
3277 are circumstances under which part of the affected line can be executed,
3278 so care should be taken when removing apparently-unreachable code.
3279
3280 For instance, when a function is inlined, a warning may mean that the
3281 line is unreachable in only one inlined copy of the function.
3282
3283 This option is not made part of @option{-Wall} because in a debugging
3284 version of a program there is often substantial code which checks
3285 correct functioning of the program and is, hopefully, unreachable
3286 because the program does work.  Another common use of unreachable
3287 code is to provide behavior which is selectable at compile-time.
3288
3289 @item -Winline
3290 @opindex Winline
3291 Warn if a function can not be inlined and it was declared as inline.
3292 Even with this option, the compiler will not warn about failures to
3293 inline functions declared in system headers.
3294
3295 The compiler uses a variety of heuristics to determine whether or not
3296 to inline a function.  For example, the compiler takes into account
3297 the size of the function being inlined and the amount of inlining
3298 that has already been done in the current function.  Therefore,
3299 seemingly insignificant changes in the source program can cause the
3300 warnings produced by @option{-Winline} to appear or disappear.
3301
3302 @item -Wno-invalid-offsetof @r{(C++ only)}
3303 @opindex Wno-invalid-offsetof
3304 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3305 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3306 to a non-POD type is undefined.  In existing C++ implementations,
3307 however, @samp{offsetof} typically gives meaningful results even when
3308 applied to certain kinds of non-POD types. (Such as a simple
3309 @samp{struct} that fails to be a POD type only by virtue of having a
3310 constructor.)  This flag is for users who are aware that they are
3311 writing nonportable code and who have deliberately chosen to ignore the
3312 warning about it.
3313
3314 The restrictions on @samp{offsetof} may be relaxed in a future version
3315 of the C++ standard.
3316
3317 @item -Wno-int-to-pointer-cast @r{(C only)}
3318 @opindex Wno-int-to-pointer-cast
3319 Suppress warnings from casts to pointer type of an integer of a
3320 different size.
3321
3322 @item -Wno-pointer-to-int-cast @r{(C only)}
3323 @opindex Wno-pointer-to-int-cast
3324 Suppress warnings from casts from a pointer to an integer type of a
3325 different size.
3326
3327 @item -Winvalid-pch
3328 @opindex Winvalid-pch
3329 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3330 the search path but can't be used.
3331
3332 @item -Wlong-long
3333 @opindex Wlong-long
3334 @opindex Wno-long-long
3335 Warn if @samp{long long} type is used.  This is default.  To inhibit
3336 the warning messages, use @option{-Wno-long-long}.  Flags
3337 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3338 only when @option{-pedantic} flag is used.
3339
3340 @item -Wvariadic-macros
3341 @opindex Wvariadic-macros
3342 @opindex Wno-variadic-macros
3343 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3344 alternate syntax when in pedantic ISO C99 mode.  This is default.
3345 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3346
3347 @item -Wdisabled-optimization
3348 @opindex Wdisabled-optimization
3349 Warn if a requested optimization pass is disabled.  This warning does
3350 not generally indicate that there is anything wrong with your code; it
3351 merely indicates that GCC's optimizers were unable to handle the code
3352 effectively.  Often, the problem is that your code is too big or too
3353 complex; GCC will refuse to optimize programs when the optimization
3354 itself is likely to take inordinate amounts of time.
3355
3356 @item -Wno-pointer-sign
3357 @opindex Wno-pointer-sign
3358 Don't warn for pointer argument passing or assignment with different signedness.
3359 Only useful in the negative form since this warning is enabled by default.
3360 This option is only supported for C and Objective-C@.
3361
3362 @item -Werror
3363 @opindex Werror
3364 Make all warnings into errors.
3365 @end table
3366
3367 @node Debugging Options
3368 @section Options for Debugging Your Program or GCC
3369 @cindex options, debugging
3370 @cindex debugging information options
3371
3372 GCC has various special options that are used for debugging
3373 either your program or GCC:
3374
3375 @table @gcctabopt
3376 @item -g
3377 @opindex g
3378 Produce debugging information in the operating system's native format
3379 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3380 information.
3381
3382 On most systems that use stabs format, @option{-g} enables use of extra
3383 debugging information that only GDB can use; this extra information
3384 makes debugging work better in GDB but will probably make other debuggers
3385 crash or
3386 refuse to read the program.  If you want to control for certain whether
3387 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3388 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3389
3390 GCC allows you to use @option{-g} with
3391 @option{-O}.  The shortcuts taken by optimized code may occasionally
3392 produce surprising results: some variables you declared may not exist
3393 at all; flow of control may briefly move where you did not expect it;
3394 some statements may not be executed because they compute constant
3395 results or their values were already at hand; some statements may
3396 execute in different places because they were moved out of loops.
3397
3398 Nevertheless it proves possible to debug optimized output.  This makes
3399 it reasonable to use the optimizer for programs that might have bugs.
3400
3401 The following options are useful when GCC is generated with the
3402 capability for more than one debugging format.
3403
3404 @item -ggdb
3405 @opindex ggdb
3406 Produce debugging information for use by GDB@.  This means to use the
3407 most expressive format available (DWARF 2, stabs, or the native format
3408 if neither of those are supported), including GDB extensions if at all
3409 possible.
3410
3411 @item -gstabs
3412 @opindex gstabs
3413 Produce debugging information in stabs format (if that is supported),
3414 without GDB extensions.  This is the format used by DBX on most BSD
3415 systems.  On MIPS, Alpha and System V Release 4 systems this option
3416 produces stabs debugging output which is not understood by DBX or SDB@.
3417 On System V Release 4 systems this option requires the GNU assembler.
3418
3419 @item -feliminate-unused-debug-symbols
3420 @opindex feliminate-unused-debug-symbols
3421 Produce debugging information in stabs format (if that is supported),
3422 for only symbols that are actually used.
3423
3424 @item -gstabs+
3425 @opindex gstabs+
3426 Produce debugging information in stabs format (if that is supported),
3427 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3428 use of these extensions is likely to make other debuggers crash or
3429 refuse to read the program.
3430
3431 @item -gcoff
3432 @opindex gcoff
3433 Produce debugging information in COFF format (if that is supported).
3434 This is the format used by SDB on most System V systems prior to
3435 System V Release 4.
3436
3437 @item -gxcoff
3438 @opindex gxcoff
3439 Produce debugging information in XCOFF format (if that is supported).
3440 This is the format used by the DBX debugger on IBM RS/6000 systems.
3441
3442 @item -gxcoff+
3443 @opindex gxcoff+
3444 Produce debugging information in XCOFF format (if that is supported),
3445 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3446 use of these extensions is likely to make other debuggers crash or
3447 refuse to read the program, and may cause assemblers other than the GNU
3448 assembler (GAS) to fail with an error.
3449
3450 @item -gdwarf-2
3451 @opindex gdwarf-2
3452 Produce debugging information in DWARF version 2 format (if that is
3453 supported).  This is the format used by DBX on IRIX 6.  With this
3454 option, GCC uses features of DWARF version 3 when they are useful;
3455 version 3 is upward compatible with version 2, but may still cause
3456 problems for older debuggers.
3457
3458 @item -gvms
3459 @opindex gvms
3460 Produce debugging information in VMS debug format (if that is
3461 supported).  This is the format used by DEBUG on VMS systems.
3462
3463 @item -g@var{level}
3464 @itemx -ggdb@var{level}
3465 @itemx -gstabs@var{level}
3466 @itemx -gcoff@var{level}
3467 @itemx -gxcoff@var{level}
3468 @itemx -gvms@var{level}
3469 Request debugging information and also use @var{level} to specify how
3470 much information.  The default level is 2.
3471
3472 Level 1 produces minimal information, enough for making backtraces in
3473 parts of the program that you don't plan to debug.  This includes
3474 descriptions of functions and external variables, but no information
3475 about local variables and no line numbers.
3476
3477 Level 3 includes extra information, such as all the macro definitions
3478 present in the program.  Some debuggers support macro expansion when
3479 you use @option{-g3}.
3480
3481 @option{-gdwarf-2} does not accept a concatenated debug level, because
3482 GCC used to support an option @option{-gdwarf} that meant to generate
3483 debug information in version 1 of the DWARF format (which is very
3484 different from version 2), and it would have been too confusing.  That
3485 debug format is long obsolete, but the option cannot be changed now.
3486 Instead use an additional @option{-g@var{level}} option to change the
3487 debug level for DWARF2.
3488
3489 @item -feliminate-dwarf2-dups
3490 @opindex feliminate-dwarf2-dups
3491 Compress DWARF2 debugging information by eliminating duplicated
3492 information about each symbol.  This option only makes sense when
3493 generating DWARF2 debugging information with @option{-gdwarf-2}.
3494
3495 @cindex @command{prof}
3496 @item -p
3497 @opindex p
3498 Generate extra code to write profile information suitable for the
3499 analysis program @command{prof}.  You must use this option when compiling
3500 the source files you want data about, and you must also use it when
3501 linking.
3502
3503 @cindex @command{gprof}
3504 @item -pg
3505 @opindex pg
3506 Generate extra code to write profile information suitable for the
3507 analysis program @command{gprof}.  You must use this option when compiling
3508 the source files you want data about, and you must also use it when
3509 linking.
3510
3511 @item -Q
3512 @opindex Q
3513 Makes the compiler print out each function name as it is compiled, and
3514 print some statistics about each pass when it finishes.
3515
3516 @item -ftime-report
3517 @opindex ftime-report
3518 Makes the compiler print some statistics about the time consumed by each
3519 pass when it finishes.
3520
3521 @item -fmem-report
3522 @opindex fmem-report
3523 Makes the compiler print some statistics about permanent memory
3524 allocation when it finishes.
3525
3526 @item -fprofile-arcs
3527 @opindex fprofile-arcs
3528 Add code so that program flow @dfn{arcs} are instrumented.  During
3529 execution the program records how many times each branch and call is
3530 executed and how many times it is taken or returns.  When the compiled
3531 program exits it saves this data to a file called
3532 @file{@var{auxname}.gcda} for each source file.  The data may be used for
3533 profile-directed optimizations (@option{-fbranch-probabilities}), or for
3534 test coverage analysis (@option{-ftest-coverage}).  Each object file's
3535 @var{auxname} is generated from the name of the output file, if
3536 explicitly specified and it is not the final executable, otherwise it is
3537 the basename of the source file.  In both cases any suffix is removed
3538 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
3539 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
3540 @xref{Cross-profiling}.
3541
3542 @cindex @command{gcov}
3543 @item --coverage
3544 @opindex coverage
3545
3546 This option is used to compile and link code instrumented for coverage
3547 analysis.  The option is a synonym for @option{-fprofile-arcs}
3548 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
3549 linking).  See the documentation for those options for more details.
3550
3551 @itemize
3552
3553 @item
3554 Compile the source files with @option{-fprofile-arcs} plus optimization
3555 and code generation options.  For test coverage analysis, use the
3556 additional @option{-ftest-coverage} option.  You do not need to profile
3557 every source file in a program.
3558
3559 @item
3560 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
3561 (the latter implies the former).
3562
3563 @item
3564 Run the program on a representative workload to generate the arc profile
3565 information.  This may be repeated any number of times.  You can run
3566 concurrent instances of your program, and provided that the file system
3567 supports locking, the data files will be correctly updated.  Also
3568 @code{fork} calls are detected and correctly handled (double counting
3569 will not happen).
3570
3571 @item
3572 For profile-directed optimizations, compile the source files again with
3573 the same optimization and code generation options plus
3574 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
3575 Control Optimization}).
3576
3577 @item
3578 For test coverage analysis, use @command{gcov} to produce human readable
3579 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
3580 @command{gcov} documentation for further information.
3581
3582 @end itemize
3583
3584 With @option{-fprofile-arcs}, for each function of your program GCC
3585 creates a program flow graph, then finds a spanning tree for the graph.
3586 Only arcs that are not on the spanning tree have to be instrumented: the
3587 compiler adds code to count the number of times that these arcs are
3588 executed.  When an arc is the only exit or only entrance to a block, the
3589 instrumentation code can be added to the block; otherwise, a new basic
3590 block must be created to hold the instrumentation code.
3591
3592 @need 2000
3593 @item -ftest-coverage
3594 @opindex ftest-coverage
3595 Produce a notes file that the @command{gcov} code-coverage utility
3596 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
3597 show program coverage.  Each source file's note file is called
3598 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
3599 above for a description of @var{auxname} and instructions on how to
3600 generate test coverage data.  Coverage data will match the source files
3601 more closely, if you do not optimize.
3602
3603 @item -d@var{letters}
3604 @item -fdump-rtl-@var{pass}
3605 @opindex d
3606 Says to make debugging dumps during compilation at times specified by
3607 @var{letters}.    This is used for debugging the RTL-based passes of the
3608 compiler.  The file names for most of the dumps are made by appending a
3609 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
3610 from the name of the output file, if explicitly specified and it is not
3611 an executable, otherwise it is the basename of the source file.
3612
3613 Most debug dumps can be enabled either passing a letter to the @option{-d}
3614 option, or with a long @option{-fdump-rtl} switch; here are the possible
3615 letters for use in @var{letters} and @var{pass}, and their meanings:
3616
3617 @table @gcctabopt
3618 @item -dA
3619 @opindex dA
3620 Annotate the assembler output with miscellaneous debugging information.
3621
3622 @item -db
3623 @itemx -fdump-rtl-bp
3624 @opindex db
3625 @opindex fdump-rtl-bp
3626 Dump after computing branch probabilities, to @file{@var{file}.09.bp}.
3627
3628 @item -dB
3629 @itemx -fdump-rtl-bbro
3630 @opindex dB
3631 @opindex fdump-rtl-bbro
3632 Dump after block reordering, to @file{@var{file}.30.bbro}.
3633
3634 @item -dc
3635 @itemx -fdump-rtl-combine
3636 @opindex dc
3637 @opindex fdump-rtl-combine
3638 Dump after instruction combination, to the file @file{@var{file}.17.combine}.
3639
3640 @item -dC
3641 @itemx -fdump-rtl-ce1
3642 @itemx -fdump-rtl-ce2
3643 @opindex dC
3644 @opindex fdump-rtl-ce1
3645 @opindex fdump-rtl-ce2
3646 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
3647 first if conversion, to the file @file{@var{file}.11.ce1}.  @option{-dC}
3648 and @option{-fdump-rtl-ce2} enable dumping after the second if
3649 conversion, to the file @file{@var{file}.18.ce2}.
3650
3651 @item -dd
3652 @itemx -fdump-rtl-btl
3653 @itemx -fdump-rtl-dbr
3654 @opindex dd
3655 @opindex fdump-rtl-btl
3656 @opindex fdump-rtl-dbr
3657 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
3658 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
3659 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
3660 scheduling, to @file{@var{file}.36.dbr}.
3661
3662 @item -dD
3663 @opindex dD
3664 Dump all macro definitions, at the end of preprocessing, in addition to
3665 normal output.
3666
3667 @item -dE
3668 @itemx -fdump-rtl-ce3
3669 @opindex dE
3670 @opindex fdump-rtl-ce3
3671 Dump after the third if conversion, to @file{@var{file}.28.ce3}.
3672
3673 @item -df
3674 @itemx -fdump-rtl-cfg
3675 @itemx -fdump-rtl-life
3676 @opindex df
3677 @opindex fdump-rtl-cfg
3678 @opindex fdump-rtl-life
3679 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
3680 and data flow analysis, to @file{@var{file}.08.cfg}.  @option{-df}
3681 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
3682 to @file{@var{file}.16.life}.
3683
3684 @item -dg
3685 @itemx -fdump-rtl-greg
3686 @opindex dg
3687 @opindex fdump-rtl-greg
3688 Dump after global register allocation, to @file{@var{file}.23.greg}.
3689
3690 @item -dG
3691 @itemx -fdump-rtl-gcse
3692 @itemx -fdump-rtl-bypass
3693 @opindex dG
3694 @opindex fdump-rtl-gcse
3695 @opindex fdump-rtl-bypass
3696 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
3697 @file{@var{file}.05.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
3698 enable dumping after jump bypassing and control flow optimizations, to
3699 @file{@var{file}.07.bypass}.
3700
3701 @item -dh
3702 @itemx -fdump-rtl-eh
3703 @opindex dh
3704 @opindex fdump-rtl-eh
3705 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
3706
3707 @item -di
3708 @itemx -fdump-rtl-sibling
3709 @opindex di
3710 @opindex fdump-rtl-sibling
3711 Dump after sibling call optimizations, to @file{@var{file}.01.sibling}.
3712
3713 @item -dj
3714 @itemx -fdump-rtl-jump
3715 @opindex dj
3716 @opindex fdump-rtl-jump
3717 Dump after the first jump optimization, to @file{@var{file}.03.jump}.
3718
3719 @item -dk
3720 @itemx -fdump-rtl-stack
3721 @opindex dk
3722 @opindex fdump-rtl-stack
3723 Dump after conversion from registers to stack, to @file{@var{file}.33.stack}.
3724
3725 @item -dl
3726 @itemx -fdump-rtl-lreg
3727 @opindex dl
3728 @opindex fdump-rtl-lreg
3729 Dump after local register allocation, to @file{@var{file}.22.lreg}.
3730
3731 @item -dL
3732 @itemx -fdump-rtl-loop
3733 @itemx -fdump-rtl-loop2
3734 @opindex dL
3735 @opindex fdump-rtl-loop
3736 @opindex fdump-rtl-loop2
3737 @option{-dL} and @option{-fdump-rtl-loop} enable dumping after the first
3738 loop optimization pass, to @file{@var{file}.06.loop}.  @option{-dL} and
3739 @option{-fdump-rtl-loop2} enable dumping after the second pass, to
3740 @file{@var{file}.13.loop2}.
3741
3742 @item -dm
3743 @itemx -fdump-rtl-sms
3744 @opindex dm
3745 @opindex fdump-rtl-sms
3746 Dump after modulo scheduling, to @file{@var{file}.20.sms}.
3747
3748 @item -dM
3749 @itemx -fdump-rtl-mach
3750 @opindex dM
3751 @opindex fdump-rtl-mach
3752 Dump after performing the machine dependent reorganization pass, to
3753 @file{@var{file}.35.mach}.
3754
3755 @item -dn
3756 @itemx -fdump-rtl-rnreg
3757 @opindex dn
3758 @opindex fdump-rtl-rnreg
3759 Dump after register renumbering, to @file{@var{file}.29.rnreg}.
3760
3761 @item -dN
3762 @itemx -fdump-rtl-regmove
3763 @opindex dN
3764 @opindex fdump-rtl-regmove
3765 Dump after the register move pass, to @file{@var{file}.19.regmove}.
3766
3767 @item -do
3768 @itemx -fdump-rtl-postreload
3769 @opindex do
3770 @opindex fdump-rtl-postreload
3771 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
3772
3773 @item -dr
3774 @itemx -fdump-rtl-expand
3775 @opindex dr
3776 @opindex fdump-rtl-expand
3777 Dump after RTL generation, to @file{@var{file}.00.expand}.
3778
3779 @item -dR
3780 @itemx -fdump-rtl-sched2
3781 @opindex dR
3782 @opindex fdump-rtl-sched2
3783 Dump after the second scheduling pass, to @file{@var{file}.32.sched2}.
3784
3785 @item -ds
3786 @itemx -fdump-rtl-cse
3787 @opindex ds
3788 @opindex fdump-rtl-cse
3789 Dump after CSE (including the jump optimization that sometimes follows
3790 CSE), to @file{@var{file}.04.cse}.
3791
3792 @item -dS
3793 @itemx -fdump-rtl-sched
3794 @opindex dS
3795 @opindex fdump-rtl-sched
3796 Dump after the first scheduling pass, to @file{@var{file}.21.sched}.
3797
3798 @item -dt
3799 @itemx -fdump-rtl-cse2
3800 @opindex dt
3801 @opindex fdump-rtl-cse2
3802 Dump after the second CSE pass (including the jump optimization that
3803 sometimes follows CSE), to @file{@var{file}.15.cse2}.
3804
3805 @item -dT
3806 @itemx -fdump-rtl-tracer
3807 @opindex dT
3808 @opindex fdump-rtl-tracer
3809 Dump after running tracer, to @file{@var{file}.12.tracer}.
3810
3811 @item -dV
3812 @itemx -fdump-rtl-vpt
3813 @itemx -fdump-rtl-vartrack
3814 @opindex dV
3815 @opindex fdump-rtl-vpt
3816 @opindex fdump-rtl-vartrack
3817 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
3818 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
3819 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
3820 to @file{@var{file}.34.vartrack}.
3821
3822 @item -dw
3823 @itemx -fdump-rtl-flow2
3824 @opindex dw
3825 @opindex fdump-rtl-flow2
3826 Dump after the second flow pass, to @file{@var{file}.26.flow2}.
3827
3828 @item -dz
3829 @itemx -fdump-rtl-peephole2
3830 @opindex dz
3831 @opindex fdump-rtl-peephole2
3832 Dump after the peephole pass, to @file{@var{file}.27.peephole2}.
3833
3834 @item -dZ
3835 @itemx -fdump-rtl-web
3836 @opindex dZ
3837 @opindex fdump-rtl-web
3838 Dump after live range splitting, to @file{@var{file}.14.web}.
3839
3840 @item -da
3841 @itemx -fdump-rtl-all
3842 @opindex da
3843 @opindex fdump-rtl-all
3844 Produce all the dumps listed above.
3845
3846 @item -dH
3847 @opindex dH
3848 Produce a core dump whenever an error occurs.
3849
3850 @item -dm
3851 @opindex dm
3852 Print statistics on memory usage, at the end of the run, to
3853 standard error.
3854
3855 @item -dp
3856 @opindex dp
3857 Annotate the assembler output with a comment indicating which
3858 pattern and alternative was used.  The length of each instruction is
3859 also printed.
3860
3861 @item -dP
3862 @opindex dP
3863 Dump the RTL in the assembler output as a comment before each instruction.
3864 Also turns on @option{-dp} annotation.
3865
3866 @item -dv
3867 @opindex dv
3868 For each of the other indicated dump files (either with @option{-d} or
3869 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
3870 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
3871
3872 @item -dx
3873 @opindex dx
3874 Just generate RTL for a function instead of compiling it.  Usually used
3875 with @samp{r} (@option{-fdump-rtl-expand}).
3876
3877 @item -dy
3878 @opindex dy
3879 Dump debugging information during parsing, to standard error.
3880 @end table
3881
3882 @item -fdump-unnumbered
3883 @opindex fdump-unnumbered
3884 When doing debugging dumps (see @option{-d} option above), suppress instruction
3885 numbers and line number note output.  This makes it more feasible to
3886 use diff on debugging dumps for compiler invocations with different
3887 options, in particular with and without @option{-g}.
3888
3889 @item -fdump-translation-unit @r{(C++ only)}
3890 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
3891 @opindex fdump-translation-unit
3892 Dump a representation of the tree structure for the entire translation
3893 unit to a file.  The file name is made by appending @file{.tu} to the
3894 source file name.  If the @samp{-@var{options}} form is used, @var{options}
3895 controls the details of the dump as described for the
3896 @option{-fdump-tree} options.
3897
3898 @item -fdump-class-hierarchy @r{(C++ only)}
3899 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
3900 @opindex fdump-class-hierarchy
3901 Dump a representation of each class's hierarchy and virtual function
3902 table layout to a file.  The file name is made by appending @file{.class}
3903 to the source file name.  If the @samp{-@var{options}} form is used,
3904 @var{options} controls the details of the dump as described for the
3905 @option{-fdump-tree} options.
3906
3907 @item -fdump-ipa-@var{switch}
3908 @opindex fdump-ipa
3909 Control the dumping at various stages of inter-procedural analysis
3910 language tree to a file.  The file name is generated by appending a switch
3911 specific suffix to the source file name.  The following dumps are possible:
3912
3913 @table @samp
3914 @item all
3915 Enables all inter-procedural analysis dumps; currently the only produced
3916 dump is the @samp{cgraph} dump.
3917
3918 @item cgraph
3919 Dumps information about call-graph optimization, unused function removal,
3920 and inlining decisions.
3921 @end table
3922
3923 @item -fdump-tree-@var{switch} @r{(C and C++ only)}
3924 @itemx -fdump-tree-@var{switch}-@var{options} @r{(C and C++ only)}
3925 @opindex fdump-tree
3926 Control the dumping at various stages of processing the intermediate
3927 language tree to a file.  The file name is generated by appending a switch
3928 specific suffix to the source file name.  If the @samp{-@var{options}}
3929 form is used, @var{options} is a list of @samp{-} separated options that
3930 control the details of the dump.  Not all options are applicable to all
3931 dumps, those which are not meaningful will be ignored.  The following
3932 options are available
3933
3934 @table @samp
3935 @item address
3936 Print the address of each node.  Usually this is not meaningful as it
3937 changes according to the environment and source file.  Its primary use
3938 is for tying up a dump file with a debug environment.
3939 @item slim
3940 Inhibit dumping of members of a scope or body of a function merely
3941 because that scope has been reached.  Only dump such items when they
3942 are directly reachable by some other path.  When dumping pretty-printed
3943 trees, this option inhibits dumping the bodies of control structures.
3944 @item raw
3945 Print a raw representation of the tree.  By default, trees are
3946 pretty-printed into a C-like representation.
3947 @item details
3948 Enable more detailed dumps (not honored by every dump option).
3949 @item stats
3950 Enable dumping various statistics about the pass (not honored by every dump
3951 option).
3952 @item blocks
3953 Enable showing basic block boundaries (disabled in raw dumps).
3954 @item vops
3955 Enable showing virtual operands for every statement.
3956 @item lineno
3957 Enable showing line numbers for statements.
3958 @item uid
3959 Enable showing the unique ID (@code{DECL_UID}) for each variable.
3960 @item all
3961 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
3962 @end table
3963
3964 The following tree dumps are possible:
3965 @table @samp
3966
3967 @item original
3968 Dump before any tree based optimization, to @file{@var{file}.original}.
3969
3970 @item optimized
3971 Dump after all tree based optimization, to @file{@var{file}.optimized}.
3972
3973 @item inlined
3974 Dump after function inlining, to @file{@var{file}.inlined}.
3975
3976 @item gimple
3977 @opindex fdump-tree-gimple
3978 Dump each function before and after the gimplification pass to a file.  The
3979 file name is made by appending @file{.gimple} to the source file name.
3980
3981 @item cfg
3982 @opindex fdump-tree-cfg
3983 Dump the control flow graph of each function to a file.  The file name is
3984 made by appending @file{.cfg} to the source file name.
3985
3986 @item vcg
3987 @opindex fdump-tree-vcg
3988 Dump the control flow graph of each function to a file in VCG format.  The
3989 file name is made by appending @file{.vcg} to the source file name.  Note
3990 that if the file contains more than one function, the generated file cannot
3991 be used directly by VCG@.  You will need to cut and paste each function's
3992 graph into its own separate file first.
3993
3994 @item ch
3995 @opindex fdump-tree-ch
3996 Dump each function after copying loop headers.  The file name is made by
3997 appending @file{.ch} to the source file name.
3998
3999 @item ssa
4000 @opindex fdump-tree-ssa
4001 Dump SSA related information to a file.  The file name is made by appending
4002 @file{.ssa} to the source file name.
4003
4004 @item salias
4005 @opindex fdump-tree-salias
4006 Dump structure aliasing variable information to a file.  This file name
4007 is made by appending @file{.salias} to the source file name.
4008
4009 @item alias
4010 @opindex fdump-tree-alias
4011 Dump aliasing information for each function.  The file name is made by
4012 appending @file{.alias} to the source file name.
4013
4014 @item ccp
4015 @opindex fdump-tree-ccp
4016 Dump each function after CCP@.  The file name is made by appending
4017 @file{.ccp} to the source file name.
4018
4019 @item storeccp
4020 @opindex fdump-tree-storeccp
4021 Dump each function after STORE-CCP.  The file name is made by appending
4022 @file{.storeccp} to the source file name.
4023
4024 @item pre
4025 @opindex fdump-tree-pre
4026 Dump trees after partial redundancy elimination.  The file name is made
4027 by appending @file{.pre} to the source file name.
4028
4029 @item fre
4030 @opindex fdump-tree-fre
4031 Dump trees after full redundancy elimination.  The file name is made
4032 by appending @file{.fre} to the source file name.
4033
4034 @item copyprop
4035 @opindex fdump-tree-copyprop
4036 Dump trees after copy propagation.  The file name is made
4037 by appending @file{.copyprop} to the source file name.
4038
4039 @item store_copyprop
4040 @opindex fdump-tree-store_copyprop
4041 Dump trees after store copy-propagation.  The file name is made
4042 by appending @file{.store_copyprop} to the source file name.
4043
4044 @item dce
4045 @opindex fdump-tree-dce
4046 Dump each function after dead code elimination.  The file name is made by
4047 appending @file{.dce} to the source file name.
4048
4049 @item mudflap
4050 @opindex fdump-tree-mudflap
4051 Dump each function after adding mudflap instrumentation.  The file name is
4052 made by appending @file{.mudflap} to the source file name.
4053
4054 @item sra
4055 @opindex fdump-tree-sra
4056 Dump each function after performing scalar replacement of aggregates.  The
4057 file name is made by appending @file{.sra} to the source file name.
4058
4059 @item sink
4060 @opindex fdump-tree-sink
4061 Dump each function after performing code sinking.  The file name is made
4062 by appending @file{.sink} to the source file name. 
4063
4064 @item dom
4065 @opindex fdump-tree-dom
4066 Dump each function after applying dominator tree optimizations.  The file
4067 name is made by appending @file{.dom} to the source file name.
4068
4069 @item dse
4070 @opindex fdump-tree-dse
4071 Dump each function after applying dead store elimination.  The file
4072 name is made by appending @file{.dse} to the source file name.
4073
4074 @item phiopt
4075 @opindex fdump-tree-phiopt
4076 Dump each function after optimizing PHI nodes into straightline code.  The file
4077 name is made by appending @file{.phiopt} to the source file name.
4078
4079 @item forwprop
4080 @opindex fdump-tree-forwprop
4081 Dump each function after forward propagating single use variables.  The file
4082 name is made by appending @file{.forwprop} to the source file name.
4083
4084 @item copyrename
4085 @opindex fdump-tree-copyrename
4086 Dump each function after applying the copy rename optimization.  The file
4087 name is made by appending @file{.copyrename} to the source file name.
4088
4089 @item nrv
4090 @opindex fdump-tree-nrv
4091 Dump each function after applying the named return value optimization on
4092 generic trees.  The file name is made by appending @file{.nrv} to the source
4093 file name.
4094
4095 @item vect
4096 @opindex fdump-tree-vect
4097 Dump each function after applying vectorization of loops.  The file name is
4098 made by appending @file{.vect} to the source file name.
4099
4100 @item vrp
4101 @opindex fdump-tree-vrp
4102 Dump each function after Value Range Propagation (VRP).  The file name
4103 is made by appending @file{.vrp} to the source file name.
4104
4105 @item all
4106 @opindex fdump-tree-all
4107 Enable all the available tree dumps with the flags provided in this option.
4108 @end table
4109
4110 @item -ftree-vectorizer-verbose=@var{n}
4111 @opindex ftree-vectorizer-verbose
4112 This option controls the amount of debugging output the vectorizer prints.
4113 This information is written to standard error, unless @option{-fdump-tree-all}
4114 or @option{-fdump-tree-vect} is specified, in which case it is output to the
4115 usual dump listing file, @file{.vect}.
4116
4117 @item -frandom-seed=@var{string}
4118 @opindex frandom-string
4119 This option provides a seed that GCC uses when it would otherwise use
4120 random numbers.  It is used to generate certain symbol names
4121 that have to be different in every compiled file.  It is also used to
4122 place unique stamps in coverage data files and the object files that
4123 produce them.  You can use the @option{-frandom-seed} option to produce
4124 reproducibly identical object files.
4125
4126 The @var{string} should be different for every file you compile.
4127
4128 @item -fsched-verbose=@var{n}
4129 @opindex fsched-verbose
4130 On targets that use instruction scheduling, this option controls the
4131 amount of debugging output the scheduler prints.  This information is
4132 written to standard error, unless @option{-dS} or @option{-dR} is
4133 specified, in which case it is output to the usual dump
4134 listing file, @file{.sched} or @file{.sched2} respectively.  However
4135 for @var{n} greater than nine, the output is always printed to standard
4136 error.
4137
4138 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4139 same information as @option{-dRS}.  For @var{n} greater than one, it
4140 also output basic block probabilities, detailed ready list information
4141 and unit/insn info.  For @var{n} greater than two, it includes RTL
4142 at abort point, control-flow and regions info.  And for @var{n} over
4143 four, @option{-fsched-verbose} also includes dependence info.
4144
4145 @item -save-temps
4146 @opindex save-temps
4147 Store the usual ``temporary'' intermediate files permanently; place them
4148 in the current directory and name them based on the source file.  Thus,
4149 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4150 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4151 preprocessed @file{foo.i} output file even though the compiler now
4152 normally uses an integrated preprocessor.
4153
4154 When used in combination with the @option{-x} command line option,
4155 @option{-save-temps} is sensible enough to avoid over writing an
4156 input source file with the same extension as an intermediate file.
4157 The corresponding intermediate file may be obtained by renaming the
4158 source file before using @option{-save-temps}.
4159
4160 @item -time
4161 @opindex time
4162 Report the CPU time taken by each subprocess in the compilation
4163 sequence.  For C source files, this is the compiler proper and assembler
4164 (plus the linker if linking is done).  The output looks like this:
4165
4166 @smallexample
4167 # cc1 0.12 0.01
4168 # as 0.00 0.01
4169 @end smallexample
4170
4171 The first number on each line is the ``user time'', that is time spent
4172 executing the program itself.  The second number is ``system time'',
4173 time spent executing operating system routines on behalf of the program.
4174 Both numbers are in seconds.
4175
4176 @item -fvar-tracking
4177 @opindex fvar-tracking
4178 Run variable tracking pass.  It computes where variables are stored at each
4179 position in code.  Better debugging information is then generated
4180 (if the debugging information format supports this information).
4181
4182 It is enabled by default when compiling with optimization (@option{-Os},
4183 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4184 the debug info format supports it.
4185
4186 @item -print-file-name=@var{library}
4187 @opindex print-file-name
4188 Print the full absolute name of the library file @var{library} that
4189 would be used when linking---and don't do anything else.  With this
4190 option, GCC does not compile or link anything; it just prints the
4191 file name.
4192
4193 @item -print-multi-directory
4194 @opindex print-multi-directory
4195 Print the directory name corresponding to the multilib selected by any
4196 other switches present in the command line.  This directory is supposed
4197 to exist in @env{GCC_EXEC_PREFIX}.
4198
4199 @item -print-multi-lib
4200 @opindex print-multi-lib
4201 Print the mapping from multilib directory names to compiler switches
4202 that enable them.  The directory name is separated from the switches by
4203 @samp{;}, and each switch starts with an @samp{@@} instead of the
4204 @samp{-}, without spaces between multiple switches.  This is supposed to
4205 ease shell-processing.
4206
4207 @item -print-prog-name=@var{program}
4208 @opindex print-prog-name
4209 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4210
4211 @item -print-libgcc-file-name
4212 @opindex print-libgcc-file-name
4213 Same as @option{-print-file-name=libgcc.a}.
4214
4215 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4216 but you do want to link with @file{libgcc.a}.  You can do
4217
4218 @smallexample
4219 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4220 @end smallexample
4221
4222 @item -print-search-dirs
4223 @opindex print-search-dirs
4224 Print the name of the configured installation directory and a list of
4225 program and library directories @command{gcc} will search---and don't do anything else.
4226
4227 This is useful when @command{gcc} prints the error message
4228 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4229 To resolve this you either need to put @file{cpp0} and the other compiler
4230 components where @command{gcc} expects to find them, or you can set the environment
4231 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4232 Don't forget the trailing @samp{/}.
4233 @xref{Environment Variables}.
4234
4235 @item -dumpmachine
4236 @opindex dumpmachine
4237 Print the compiler's target machine (for example,
4238 @samp{i686-pc-linux-gnu})---and don't do anything else.
4239
4240 @item -dumpversion
4241 @opindex dumpversion
4242 Print the compiler version (for example, @samp{3.0})---and don't do
4243 anything else.
4244
4245 @item -dumpspecs
4246 @opindex dumpspecs
4247 Print the compiler's built-in specs---and don't do anything else.  (This
4248 is used when GCC itself is being built.)  @xref{Spec Files}.
4249
4250 @item -feliminate-unused-debug-types
4251 @opindex feliminate-unused-debug-types
4252 Normally, when producing DWARF2 output, GCC will emit debugging
4253 information for all types declared in a compilation
4254 unit, regardless of whether or not they are actually used
4255 in that compilation unit.  Sometimes this is useful, such as
4256 if, in the debugger, you want to cast a value to a type that is
4257 not actually used in your program (but is declared).  More often,
4258 however, this results in a significant amount of wasted space.
4259 With this option, GCC will avoid producing debug symbol output
4260 for types that are nowhere used in the source file being compiled.
4261 @end table
4262
4263 @node Optimize Options
4264 @section Options That Control Optimization
4265 @cindex optimize options
4266 @cindex options, optimization
4267
4268 These options control various sorts of optimizations.
4269
4270 Without any optimization option, the compiler's goal is to reduce the
4271 cost of compilation and to make debugging produce the expected
4272 results.  Statements are independent: if you stop the program with a
4273 breakpoint between statements, you can then assign a new value to any
4274 variable or change the program counter to any other statement in the
4275 function and get exactly the results you would expect from the source
4276 code.
4277
4278 Turning on optimization flags makes the compiler attempt to improve
4279 the performance and/or code size at the expense of compilation time
4280 and possibly the ability to debug the program.
4281
4282 The compiler performs optimization based on the knowledge it has of
4283 the program.  Optimization levels @option{-O2} and above, in
4284 particular, enable @emph{unit-at-a-time} mode, which allows the
4285 compiler to consider information gained from later functions in
4286 the file when compiling a function.  Compiling multiple files at
4287 once to a single output file in @emph{unit-at-a-time} mode allows
4288 the compiler to use information gained from all of the files when
4289 compiling each of them.
4290
4291 Not all optimizations are controlled directly by a flag.  Only
4292 optimizations that have a flag are listed.
4293
4294 @table @gcctabopt
4295 @item -O
4296 @itemx -O1
4297 @opindex O
4298 @opindex O1
4299 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4300 more memory for a large function.
4301
4302 With @option{-O}, the compiler tries to reduce code size and execution
4303 time, without performing any optimizations that take a great deal of
4304 compilation time.
4305
4306 @option{-O} turns on the following optimization flags:
4307 @gccoptlist{-fdefer-pop @gol
4308 -fdelayed-branch @gol
4309 -fguess-branch-probability @gol
4310 -fcprop-registers @gol
4311 -floop-optimize @gol
4312 -fif-conversion @gol
4313 -fif-conversion2 @gol
4314 -ftree-ccp @gol
4315 -ftree-dce @gol
4316 -ftree-dominator-opts @gol
4317 -ftree-dse @gol
4318 -ftree-ter @gol
4319 -ftree-lrs @gol
4320 -ftree-sra @gol
4321 -ftree-copyrename @gol
4322 -ftree-fre @gol
4323 -ftree-ch @gol
4324 -fmerge-constants}
4325
4326 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4327 where doing so does not interfere with debugging.
4328
4329 @item -O2
4330 @opindex O2
4331 Optimize even more.  GCC performs nearly all supported optimizations
4332 that do not involve a space-speed tradeoff.  The compiler does not
4333 perform loop unrolling or function inlining when you specify @option{-O2}.
4334 As compared to @option{-O}, this option increases both compilation time
4335 and the performance of the generated code.
4336
4337 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4338 also turns on the following optimization flags:
4339 @gccoptlist{-fthread-jumps @gol
4340 -fcrossjumping @gol
4341 -foptimize-sibling-calls @gol
4342 -fcse-follow-jumps  -fcse-skip-blocks @gol
4343 -fgcse  -fgcse-lm  @gol
4344 -fexpensive-optimizations @gol
4345 -fstrength-reduce @gol
4346 -frerun-cse-after-loop  -frerun-loop-opt @gol
4347 -fcaller-saves @gol
4348 -fpeephole2 @gol
4349 -fschedule-insns  -fschedule-insns2 @gol
4350 -fsched-interblock  -fsched-spec @gol
4351 -fregmove @gol
4352 -fstrict-aliasing @gol
4353 -fdelete-null-pointer-checks @gol
4354 -freorder-blocks  -freorder-functions @gol
4355 -funit-at-a-time @gol
4356 -falign-functions  -falign-jumps @gol
4357 -falign-loops  -falign-labels @gol
4358 -ftree-vrp @gol
4359 -ftree-pre}
4360
4361 Please note the warning under @option{-fgcse} about
4362 invoking @option{-O2} on programs that use computed gotos.
4363
4364 @item -O3
4365 @opindex O3
4366 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4367 @option{-O2} and also turns on the @option{-finline-functions},
4368 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4369
4370 @item -O0
4371 @opindex O0
4372 Do not optimize.  This is the default.
4373
4374 @item -Os
4375 @opindex Os
4376 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4377 do not typically increase code size.  It also performs further
4378 optimizations designed to reduce code size.
4379
4380 @option{-Os} disables the following optimization flags:
4381 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4382 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition -fprefetch-loop-arrays}
4383
4384 If you use multiple @option{-O} options, with or without level numbers,
4385 the last such option is the one that is effective.
4386 @end table
4387
4388 Options of the form @option{-f@var{flag}} specify machine-independent
4389 flags.  Most flags have both positive and negative forms; the negative
4390 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4391 below, only one of the forms is listed---the one you typically will
4392 use.  You can figure out the other form by either removing @samp{no-}
4393 or adding it.
4394
4395 The following options control specific optimizations.  They are either
4396 activated by @option{-O} options or are related to ones that are.  You
4397 can use the following flags in the rare cases when ``fine-tuning'' of
4398 optimizations to be performed is desired.
4399
4400 @table @gcctabopt
4401 @item -fno-default-inline
4402 @opindex fno-default-inline
4403 Do not make member functions inline by default merely because they are
4404 defined inside the class scope (C++ only).  Otherwise, when you specify
4405 @w{@option{-O}}, member functions defined inside class scope are compiled
4406 inline by default; i.e., you don't need to add @samp{inline} in front of
4407 the member function name.
4408
4409 @item -fno-defer-pop
4410 @opindex fno-defer-pop
4411 Always pop the arguments to each function call as soon as that function
4412 returns.  For machines which must pop arguments after a function call,
4413 the compiler normally lets arguments accumulate on the stack for several
4414 function calls and pops them all at once.
4415
4416 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4417
4418 @item -fforce-mem
4419 @opindex fforce-mem
4420 Force memory operands to be copied into registers before doing
4421 arithmetic on them.  This produces better code by making all memory
4422 references potential common subexpressions.  When they are not common
4423 subexpressions, instruction combination should eliminate the separate
4424 register-load. This option is now a nop and will be removed in 4.2.
4425
4426 @item -fforce-addr
4427 @opindex fforce-addr
4428 Force memory address constants to be copied into registers before
4429 doing arithmetic on them.
4430
4431 @item -fomit-frame-pointer
4432 @opindex fomit-frame-pointer
4433 Don't keep the frame pointer in a register for functions that
4434 don't need one.  This avoids the instructions to save, set up and
4435 restore frame pointers; it also makes an extra register available
4436 in many functions.  @strong{It also makes debugging impossible on
4437 some machines.}
4438
4439 On some machines, such as the VAX, this flag has no effect, because
4440 the standard calling sequence automatically handles the frame pointer
4441 and nothing is saved by pretending it doesn't exist.  The
4442 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4443 whether a target machine supports this flag.  @xref{Registers,,Register
4444 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4445
4446 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4447
4448 @item -foptimize-sibling-calls
4449 @opindex foptimize-sibling-calls
4450 Optimize sibling and tail recursive calls.
4451
4452 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4453
4454 @item -fno-inline
4455 @opindex fno-inline
4456 Don't pay attention to the @code{inline} keyword.  Normally this option
4457 is used to keep the compiler from expanding any functions inline.
4458 Note that if you are not optimizing, no functions can be expanded inline.
4459
4460 @item -finline-functions
4461 @opindex finline-functions
4462 Integrate all simple functions into their callers.  The compiler
4463 heuristically decides which functions are simple enough to be worth
4464 integrating in this way.
4465
4466 If all calls to a given function are integrated, and the function is
4467 declared @code{static}, then the function is normally not output as
4468 assembler code in its own right.
4469
4470 Enabled at level @option{-O3}.
4471
4472 @item -fearly-inlining
4473 @opindex fearly-inlining
4474 Inline functions marked by @code{always_inline} and functions whose body seems
4475 smaller than the function call overhead early before doing
4476 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4477 makes profiling significantly cheaper and usually inlining faster on programs
4478 having large chains of nested wrapper functions.
4479
4480 Enabled by default.
4481
4482 @item -finline-limit=@var{n}
4483 @opindex finline-limit
4484 By default, GCC limits the size of functions that can be inlined.  This flag
4485 allows the control of this limit for functions that are explicitly marked as
4486 inline (i.e., marked with the inline keyword or defined within the class
4487 definition in c++).  @var{n} is the size of functions that can be inlined in
4488 number of pseudo instructions (not counting parameter handling).  The default
4489 value of @var{n} is 600.
4490 Increasing this value can result in more inlined code at
4491 the cost of compilation time and memory consumption.  Decreasing usually makes
4492 the compilation faster and less code will be inlined (which presumably
4493 means slower programs).  This option is particularly useful for programs that
4494 use inlining heavily such as those based on recursive templates with C++.
4495
4496 Inlining is actually controlled by a number of parameters, which may be
4497 specified individually by using @option{--param @var{name}=@var{value}}.
4498 The @option{-finline-limit=@var{n}} option sets some of these parameters
4499 as follows:
4500
4501 @table @gcctabopt
4502  @item max-inline-insns-single
4503   is set to @var{n}/2.
4504  @item max-inline-insns-auto
4505   is set to @var{n}/2.
4506  @item min-inline-insns
4507   is set to 130 or @var{n}/4, whichever is smaller.
4508  @item max-inline-insns-rtl
4509   is set to @var{n}.
4510 @end table
4511
4512 See below for a documentation of the individual
4513 parameters controlling inlining.
4514
4515 @emph{Note:} pseudo instruction represents, in this particular context, an
4516 abstract measurement of function's size.  In no way does it represent a count
4517 of assembly instructions and as such its exact meaning might change from one
4518 release to an another.
4519
4520 @item -fkeep-inline-functions
4521 @opindex fkeep-inline-functions
4522 In C, emit @code{static} functions that are declared @code{inline}
4523 into the object file, even if the function has been inlined into all
4524 of its callers.  This switch does not affect functions using the
4525 @code{extern inline} extension in GNU C@.  In C++, emit any and all
4526 inline functions into the object file.
4527
4528 @item -fkeep-static-consts
4529 @opindex fkeep-static-consts
4530 Emit variables declared @code{static const} when optimization isn't turned
4531 on, even if the variables aren't referenced.
4532
4533 GCC enables this option by default.  If you want to force the compiler to
4534 check if the variable was referenced, regardless of whether or not
4535 optimization is turned on, use the @option{-fno-keep-static-consts} option.
4536
4537 @item -fmerge-constants
4538 Attempt to merge identical constants (string constants and floating point
4539 constants) across compilation units.
4540
4541 This option is the default for optimized compilation if the assembler and
4542 linker support it.  Use @option{-fno-merge-constants} to inhibit this
4543 behavior.
4544
4545 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4546
4547 @item -fmerge-all-constants
4548 Attempt to merge identical constants and identical variables.
4549
4550 This option implies @option{-fmerge-constants}.  In addition to
4551 @option{-fmerge-constants} this considers e.g.@: even constant initialized
4552 arrays or initialized constant variables with integral or floating point
4553 types.  Languages like C or C++ require each non-automatic variable to
4554 have distinct location, so using this option will result in non-conforming
4555 behavior.
4556
4557 @item -fmodulo-sched
4558 @opindex fmodulo-sched
4559 Perform swing modulo scheduling immediately before the first scheduling
4560 pass.  This pass looks at innermost loops and reorders their
4561 instructions by overlapping different iterations.
4562
4563 @item -fno-branch-count-reg
4564 @opindex fno-branch-count-reg
4565 Do not use ``decrement and branch'' instructions on a count register,
4566 but instead generate a sequence of instructions that decrement a
4567 register, compare it against zero, then branch based upon the result.
4568 This option is only meaningful on architectures that support such
4569 instructions, which include x86, PowerPC, IA-64 and S/390.
4570
4571 The default is @option{-fbranch-count-reg}, enabled when
4572 @option{-fstrength-reduce} is enabled.
4573
4574 @item -fno-function-cse
4575 @opindex fno-function-cse
4576 Do not put function addresses in registers; make each instruction that
4577 calls a constant function contain the function's address explicitly.
4578
4579 This option results in less efficient code, but some strange hacks
4580 that alter the assembler output may be confused by the optimizations
4581 performed when this option is not used.
4582
4583 The default is @option{-ffunction-cse}
4584
4585 @item -fno-zero-initialized-in-bss
4586 @opindex fno-zero-initialized-in-bss
4587 If the target supports a BSS section, GCC by default puts variables that
4588 are initialized to zero into BSS@.  This can save space in the resulting
4589 code.
4590
4591 This option turns off this behavior because some programs explicitly
4592 rely on variables going to the data section.  E.g., so that the
4593 resulting executable can find the beginning of that section and/or make
4594 assumptions based on that.
4595
4596 The default is @option{-fzero-initialized-in-bss}.
4597
4598 @item -fbounds-check
4599 @opindex fbounds-check
4600 For front-ends that support it, generate additional code to check that
4601 indices used to access arrays are within the declared range.  This is
4602 currently only supported by the Java and Fortran front-ends, where
4603 this option defaults to true and false respectively.
4604
4605 @item -fmudflap -fmudflapth -fmudflapir
4606 @opindex fmudflap
4607 @opindex fmudflapth
4608 @opindex fmudflapir
4609 @cindex bounds checking
4610 @cindex mudflap
4611 For front-ends that support it (C and C++), instrument all risky
4612 pointer/array dereferencing operations, some standard library
4613 string/heap functions, and some other associated constructs with
4614 range/validity tests.  Modules so instrumented should be immune to
4615 buffer overflows, invalid heap use, and some other classes of C/C++
4616 programming errors.  The instrumentation relies on a separate runtime
4617 library (@file{libmudflap}), which will be linked into a program if
4618 @option{-fmudflap} is given at link time.  Run-time behavior of the
4619 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
4620 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
4621 for its options.
4622
4623 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
4624 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
4625 addition to @option{-fmudflap} or @option{-fmudflapth}, if
4626 instrumentation should ignore pointer reads.  This produces less
4627 instrumentation (and therefore faster execution) and still provides
4628 some protection against outright memory corrupting writes, but allows
4629 erroneously read data to propagate within a program.
4630
4631 @item -fstrength-reduce
4632 @opindex fstrength-reduce
4633 Perform the optimizations of loop strength reduction and
4634 elimination of iteration variables.
4635
4636 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4637
4638 @item -fthread-jumps
4639 @opindex fthread-jumps
4640 Perform optimizations where we check to see if a jump branches to a
4641 location where another comparison subsumed by the first is found.  If
4642 so, the first branch is redirected to either the destination of the
4643 second branch or a point immediately following it, depending on whether
4644 the condition is known to be true or false.
4645
4646 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4647
4648 @item -fcse-follow-jumps
4649 @opindex fcse-follow-jumps
4650 In common subexpression elimination, scan through jump instructions
4651 when the target of the jump is not reached by any other path.  For
4652 example, when CSE encounters an @code{if} statement with an
4653 @code{else} clause, CSE will follow the jump when the condition
4654 tested is false.
4655
4656 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4657
4658 @item -fcse-skip-blocks
4659 @opindex fcse-skip-blocks
4660 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
4661 follow jumps which conditionally skip over blocks.  When CSE
4662 encounters a simple @code{if} statement with no else clause,
4663 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
4664 body of the @code{if}.
4665
4666 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4667
4668 @item -frerun-cse-after-loop
4669 @opindex frerun-cse-after-loop
4670 Re-run common subexpression elimination after loop optimizations has been
4671 performed.
4672
4673 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4674
4675 @item -frerun-loop-opt
4676 @opindex frerun-loop-opt
4677 Run the loop optimizer twice.
4678
4679 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4680
4681 @item -fgcse
4682 @opindex fgcse
4683 Perform a global common subexpression elimination pass.
4684 This pass also performs global constant and copy propagation.
4685
4686 @emph{Note:} When compiling a program using computed gotos, a GCC
4687 extension, you may get better runtime performance if you disable
4688 the global common subexpression elimination pass by adding
4689 @option{-fno-gcse} to the command line.
4690
4691 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4692
4693 @item -fgcse-lm
4694 @opindex fgcse-lm
4695 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
4696 attempt to move loads which are only killed by stores into themselves.  This
4697 allows a loop containing a load/store sequence to be changed to a load outside
4698 the loop, and a copy/store within the loop.
4699
4700 Enabled by default when gcse is enabled.
4701
4702 @item -fgcse-sm
4703 @opindex fgcse-sm
4704 When @option{-fgcse-sm} is enabled, a store motion pass is run after
4705 global common subexpression elimination.  This pass will attempt to move
4706 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
4707 loops containing a load/store sequence can be changed to a load before
4708 the loop and a store after the loop.
4709
4710 Not enabled at any optimization level.
4711
4712 @item -fgcse-las
4713 @opindex fgcse-las
4714 When @option{-fgcse-las} is enabled, the global common subexpression
4715 elimination pass eliminates redundant loads that come after stores to the
4716 same memory location (both partial and full redundancies).
4717
4718 Not enabled at any optimization level.
4719
4720 @item -fgcse-after-reload
4721 @opindex fgcse-after-reload
4722 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
4723 pass is performed after reload.  The purpose of this pass is to cleanup
4724 redundant spilling.
4725
4726 @item -floop-optimize
4727 @opindex floop-optimize
4728 Perform loop optimizations: move constant expressions out of loops, simplify
4729 exit test conditions and optionally do strength-reduction as well.
4730
4731 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4732
4733 @item -floop-optimize2
4734 @opindex floop-optimize2
4735 Perform loop optimizations using the new loop optimizer.  The optimizations
4736 (loop unrolling, peeling and unswitching, loop invariant motion) are enabled
4737 by separate flags.
4738
4739 @item -funsafe-loop-optimizations
4740 @opindex funsafe-loop-optimizations
4741 If given, the loop optimizer will assume that loop indices do not
4742 overflow, and that the loops with nontrivial exit condition are not
4743 infinite.  This enables a wider range of loop optimizations even if
4744 the loop optimizer itself cannot prove that these assumptions are valid.
4745 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
4746 if it finds this kind of loop.
4747
4748 @item -fcrossjumping
4749 @opindex crossjumping
4750 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
4751 resulting code may or may not perform better than without cross-jumping.
4752
4753 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4754
4755 @item -fif-conversion
4756 @opindex if-conversion
4757 Attempt to transform conditional jumps into branch-less equivalents.  This
4758 include use of conditional moves, min, max, set flags and abs instructions, and
4759 some tricks doable by standard arithmetics.  The use of conditional execution
4760 on chips where it is available is controlled by @code{if-conversion2}.
4761
4762 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4763
4764 @item -fif-conversion2
4765 @opindex if-conversion2
4766 Use conditional execution (where available) to transform conditional jumps into
4767 branch-less equivalents.
4768
4769 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4770
4771 @item -fdelete-null-pointer-checks
4772 @opindex fdelete-null-pointer-checks
4773 Use global dataflow analysis to identify and eliminate useless checks
4774 for null pointers.  The compiler assumes that dereferencing a null
4775 pointer would have halted the program.  If a pointer is checked after
4776 it has already been dereferenced, it cannot be null.
4777
4778 In some environments, this assumption is not true, and programs can
4779 safely dereference null pointers.  Use
4780 @option{-fno-delete-null-pointer-checks} to disable this optimization
4781 for programs which depend on that behavior.
4782
4783 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4784
4785 @item -fexpensive-optimizations
4786 @opindex fexpensive-optimizations
4787 Perform a number of minor optimizations that are relatively expensive.
4788
4789 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4790
4791 @item -foptimize-register-move
4792 @itemx -fregmove
4793 @opindex foptimize-register-move
4794 @opindex fregmove
4795 Attempt to reassign register numbers in move instructions and as
4796 operands of other simple instructions in order to maximize the amount of
4797 register tying.  This is especially helpful on machines with two-operand
4798 instructions.
4799
4800 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
4801 optimization.
4802
4803 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4804
4805 @item -fdelayed-branch
4806 @opindex fdelayed-branch
4807 If supported for the target machine, attempt to reorder instructions
4808 to exploit instruction slots available after delayed branch
4809 instructions.
4810
4811 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4812
4813 @item -fschedule-insns
4814 @opindex fschedule-insns
4815 If supported for the target machine, attempt to reorder instructions to
4816 eliminate execution stalls due to required data being unavailable.  This
4817 helps machines that have slow floating point or memory load instructions
4818 by allowing other instructions to be issued until the result of the load
4819 or floating point instruction is required.
4820
4821 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4822
4823 @item -fschedule-insns2
4824 @opindex fschedule-insns2
4825 Similar to @option{-fschedule-insns}, but requests an additional pass of
4826 instruction scheduling after register allocation has been done.  This is
4827 especially useful on machines with a relatively small number of
4828 registers and where memory load instructions take more than one cycle.
4829
4830 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4831
4832 @item -fno-sched-interblock
4833 @opindex fno-sched-interblock
4834 Don't schedule instructions across basic blocks.  This is normally
4835 enabled by default when scheduling before register allocation, i.e.@:
4836 with @option{-fschedule-insns} or at @option{-O2} or higher.
4837
4838 @item -fno-sched-spec
4839 @opindex fno-sched-spec
4840 Don't allow speculative motion of non-load instructions.  This is normally
4841 enabled by default when scheduling before register allocation, i.e.@:
4842 with @option{-fschedule-insns} or at @option{-O2} or higher.
4843
4844 @item -fsched-spec-load
4845 @opindex fsched-spec-load
4846 Allow speculative motion of some load instructions.  This only makes
4847 sense when scheduling before register allocation, i.e.@: with
4848 @option{-fschedule-insns} or at @option{-O2} or higher.
4849
4850 @item -fsched-spec-load-dangerous
4851 @opindex fsched-spec-load-dangerous
4852 Allow speculative motion of more load instructions.  This only makes
4853 sense when scheduling before register allocation, i.e.@: with
4854 @option{-fschedule-insns} or at @option{-O2} or higher.
4855
4856 @item -fsched-stalled-insns=@var{n}
4857 @opindex fsched-stalled-insns
4858 Define how many insns (if any) can be moved prematurely from the queue
4859 of stalled insns into the ready list, during the second scheduling pass.
4860
4861 @item -fsched-stalled-insns-dep=@var{n}
4862 @opindex fsched-stalled-insns-dep
4863 Define how many insn groups (cycles) will be examined for a dependency
4864 on a stalled insn that is candidate for premature removal from the queue
4865 of stalled insns.  Has an effect only during the second scheduling pass,
4866 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
4867
4868 @item -fsched2-use-superblocks
4869 @opindex fsched2-use-superblocks
4870 When scheduling after register allocation, do use superblock scheduling
4871 algorithm.  Superblock scheduling allows motion across basic block boundaries
4872 resulting on faster schedules.  This option is experimental, as not all machine
4873 descriptions used by GCC model the CPU closely enough to avoid unreliable
4874 results from the algorithm.
4875
4876 This only makes sense when scheduling after register allocation, i.e.@: with
4877 @option{-fschedule-insns2} or at @option{-O2} or higher.
4878
4879 @item -fsched2-use-traces
4880 @opindex fsched2-use-traces
4881 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
4882 allocation and additionally perform code duplication in order to increase the
4883 size of superblocks using tracer pass.  See @option{-ftracer} for details on
4884 trace formation.
4885
4886 This mode should produce faster but significantly longer programs.  Also
4887 without @option{-fbranch-probabilities} the traces constructed may not
4888 match the reality and hurt the performance.  This only makes
4889 sense when scheduling after register allocation, i.e.@: with
4890 @option{-fschedule-insns2} or at @option{-O2} or higher.
4891
4892 @item -freschedule-modulo-scheduled-loops
4893 @opindex fscheduling-in-modulo-scheduled-loops
4894 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
4895 we may want to prevent the later scheduling passes from changing its schedule, we use this
4896 option to control that.
4897
4898 @item -fcaller-saves
4899 @opindex fcaller-saves
4900 Enable values to be allocated in registers that will be clobbered by
4901 function calls, by emitting extra instructions to save and restore the
4902 registers around such calls.  Such allocation is done only when it
4903 seems to result in better code than would otherwise be produced.
4904
4905 This option is always enabled by default on certain machines, usually
4906 those which have no call-preserved registers to use instead.
4907
4908 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4909
4910 @item -ftree-pre
4911 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
4912 enabled by default at @option{-O2} and @option{-O3}.
4913
4914 @item -ftree-fre
4915 Perform Full Redundancy Elimination (FRE) on trees.  The difference
4916 between FRE and PRE is that FRE only considers expressions
4917 that are computed on all paths leading to the redundant computation.
4918 This analysis faster than PRE, though it exposes fewer redundancies.
4919 This flag is enabled by default at @option{-O} and higher.
4920
4921 @item -ftree-copy-prop
4922 Perform copy propagation on trees.  This pass eliminates unnecessary
4923 copy operations.  This flag is enabled by default at @option{-O} and
4924 higher.
4925
4926 @item -ftree-store-copy-prop
4927 Perform copy propagation of memory loads and stores.  This pass
4928 eliminates unnecessary copy operations in memory references
4929 (structures, global variables, arrays, etc).  This flag is enabled by
4930 default at @option{-O2} and higher.
4931
4932 @item -ftree-salias
4933 Perform structural alias analysis on trees.  This flag
4934 is enabled by default at @option{-O} and higher.
4935
4936 @item -ftree-sink
4937 Perform forward store motion  on trees.  This flag is
4938 enabled by default at @option{-O} and higher.
4939
4940 @item -ftree-ccp
4941 Perform sparse conditional constant propagation (CCP) on trees.  This
4942 pass only operates on local scalar variables and is enabled by default
4943 at @option{-O} and higher.
4944
4945 @item -ftree-store-ccp
4946 Perform sparse conditional constant propagation (CCP) on trees.  This
4947 pass operates on both local scalar variables and memory stores and
4948 loads (global variables, structures, arrays, etc).  This flag is
4949 enabled by default at @option{-O2} and higher.
4950
4951 @item -ftree-dce
4952 Perform dead code elimination (DCE) on trees.  This flag is enabled by
4953 default at @option{-O} and higher.
4954
4955 @item -ftree-dominator-opts
4956 Perform dead code elimination (DCE) on trees.  This flag is enabled by
4957 default at @option{-O} and higher.
4958
4959 @item -ftree-ch
4960 Perform loop header copying on trees.  This is beneficial since it increases
4961 effectiveness of code motion optimizations.  It also saves one jump.  This flag
4962 is enabled by default at @option{-O} and higher.  It is not enabled
4963 for @option{-Os}, since it usually increases code size.
4964
4965 @item -ftree-loop-optimize
4966 Perform loop optimizations on trees.  This flag is enabled by default
4967 at @option{-O} and higher.
4968
4969 @item -ftree-loop-linear
4970 Perform linear loop transformations on tree.  This flag can improve cache
4971 performance and allow further loop optimizations to take place.
4972
4973 @item -ftree-loop-im
4974 Perform loop invariant motion on trees.  This pass moves only invariants that
4975 would be hard to handle at RTL level (function calls, operations that expand to
4976 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
4977 operands of conditions that are invariant out of the loop, so that we can use
4978 just trivial invariantness analysis in loop unswitching.  The pass also includes
4979 store motion.
4980
4981 @item -ftree-loop-ivcanon
4982 Create a canonical counter for number of iterations in the loop for that
4983 determining number of iterations requires complicated analysis.  Later
4984 optimizations then may determine the number easily.  Useful especially
4985 in connection with unrolling.
4986
4987 @item -fivopts
4988 Perform induction variable optimizations (strength reduction, induction
4989 variable merging and induction variable elimination) on trees.
4990
4991 @item -ftree-sra
4992 Perform scalar replacement of aggregates.  This pass replaces structure
4993 references with scalars to prevent committing structures to memory too
4994 early.  This flag is enabled by default at @option{-O} and higher.
4995
4996 @item -ftree-copyrename
4997 Perform copy renaming on trees.  This pass attempts to rename compiler
4998 temporaries to other variables at copy locations, usually resulting in
4999 variable names which more closely resemble the original variables.  This flag
5000 is enabled by default at @option{-O} and higher.
5001
5002 @item -ftree-ter
5003 Perform temporary expression replacement during the SSA->normal phase.  Single
5004 use/single def temporaries are replaced at their use location with their
5005 defining expression.  This results in non-GIMPLE code, but gives the expanders
5006 much more complex trees to work on resulting in better RTL generation.  This is
5007 enabled by default at @option{-O} and higher.
5008
5009 @item -ftree-lrs
5010 Perform live range splitting during the SSA->normal phase.  Distinct live
5011 ranges of a variable are split into unique variables, allowing for better
5012 optimization later.  This is enabled by default at @option{-O} and higher.
5013
5014 @item -ftree-vectorize
5015 Perform loop vectorization on trees.
5016
5017 @item -ftree-vrp
5018 Perform Value Range Propagation on trees.  This is similar to the
5019 constant propagation pass, but instead of values, ranges of values are
5020 propagated.  This allows the optimizers to remove unnecessary range
5021 checks like array bound checks and null pointer checks.  This is
5022 enabled by default at @option{-O2} and higher.  Null pointer check
5023 elimination is only done if @option{-fdelete-null-pointer-checks} is
5024 enabled.
5025
5026 @item -ftracer
5027 @opindex ftracer
5028 Perform tail duplication to enlarge superblock size.  This transformation
5029 simplifies the control flow of the function allowing other optimizations to do
5030 better job.
5031
5032 @item -funroll-loops
5033 @opindex funroll-loops
5034 Unroll loops whose number of iterations can be determined at compile
5035 time or upon entry to the loop.  @option{-funroll-loops} implies both
5036 @option{-fstrength-reduce} and @option{-frerun-cse-after-loop}.  This
5037 option makes code larger, and may or may not make it run faster.
5038
5039 @item -funroll-all-loops
5040 @opindex funroll-all-loops
5041 Unroll all loops, even if their number of iterations is uncertain when
5042 the loop is entered.  This usually makes programs run more slowly.
5043 @option{-funroll-all-loops} implies the same options as
5044 @option{-funroll-loops},
5045
5046 @item -fsplit-ivs-in-unroller
5047 @opindex -fsplit-ivs-in-unroller
5048 Enables expressing of values of induction variables in later iterations
5049 of the unrolled loop using the value in the first iteration.  This breaks
5050 long dependency chains, thus improving efficiency of the scheduling passes.
5051
5052 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5053 same effect.  However in cases the loop body is more complicated than
5054 a single basic block, this is not reliable.  It also does not work at all
5055 on some of the architectures due to restrictions in the CSE pass.
5056
5057 This optimization is enabled by default.
5058
5059 @item -fvariable-expansion-in-unroller
5060 @opindex -fvariable-expansion-in-unroller
5061 With this option, the compiler will create multiple copies of some
5062 local variables when unrolling a loop which can result in superior code.
5063
5064 @item -fprefetch-loop-arrays
5065 @opindex fprefetch-loop-arrays
5066 If supported by the target machine, generate instructions to prefetch
5067 memory to improve the performance of loops that access large arrays.
5068
5069 These options may generate better or worse code; results are highly
5070 dependent on the structure of loops within the source code.
5071
5072 @item -fno-peephole
5073 @itemx -fno-peephole2
5074 @opindex fno-peephole
5075 @opindex fno-peephole2
5076 Disable any machine-specific peephole optimizations.  The difference
5077 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5078 are implemented in the compiler; some targets use one, some use the
5079 other, a few use both.
5080
5081 @option{-fpeephole} is enabled by default.
5082 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5083
5084 @item -fno-guess-branch-probability
5085 @opindex fno-guess-branch-probability
5086 Do not guess branch probabilities using heuristics.
5087
5088 GCC will use heuristics to guess branch probabilities if they are
5089 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5090 heuristics are based on the control flow graph.  If some branch probabilities
5091 are specified by @samp{__builtin_expect}, then the heuristics will be
5092 used to guess branch probabilities for the rest of the control flow graph,
5093 taking the @samp{__builtin_expect} info into account.  The interactions
5094 between the heuristics and @samp{__builtin_expect} can be complex, and in
5095 some cases, it may be useful to disable the heuristics so that the effects
5096 of @samp{__builtin_expect} are easier to understand.
5097
5098 The default is @option{-fguess-branch-probability} at levels
5099 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5100
5101 @item -freorder-blocks
5102 @opindex freorder-blocks
5103 Reorder basic blocks in the compiled function in order to reduce number of
5104 taken branches and improve code locality.
5105
5106 Enabled at levels @option{-O2}, @option{-O3}.
5107
5108 @item -freorder-blocks-and-partition
5109 @opindex freorder-blocks-and-partition
5110 In addition to reordering basic blocks in the compiled function, in order
5111 to reduce number of taken branches, partitions hot and cold basic blocks
5112 into separate sections of the assembly and .o files, to improve
5113 paging and cache locality performance.
5114
5115 This optimization is automatically turned off in the presence of
5116 exception handling, for linkonce sections, for functions with a user-defined
5117 section attribute and on any architecture that does not support named
5118 sections.
5119
5120 @item -freorder-functions
5121 @opindex freorder-functions
5122 Reorder functions in the object file in order to
5123 improve code locality.  This is implemented by using special
5124 subsections @code{.text.hot} for most frequently executed functions and
5125 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5126 the linker so object file format must support named sections and linker must
5127 place them in a reasonable way.
5128
5129 Also profile feedback must be available in to make this option effective.  See
5130 @option{-fprofile-arcs} for details.
5131
5132 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5133
5134 @item -fstrict-aliasing
5135 @opindex fstrict-aliasing
5136 Allows the compiler to assume the strictest aliasing rules applicable to
5137 the language being compiled.  For C (and C++), this activates
5138 optimizations based on the type of expressions.  In particular, an
5139 object of one type is assumed never to reside at the same address as an
5140 object of a different type, unless the types are almost the same.  For
5141 example, an @code{unsigned int} can alias an @code{int}, but not a
5142 @code{void*} or a @code{double}.  A character type may alias any other
5143 type.
5144
5145 Pay special attention to code like this:
5146 @smallexample
5147 union a_union @{
5148   int i;
5149   double d;
5150 @};
5151
5152 int f() @{
5153   a_union t;
5154   t.d = 3.0;
5155   return t.i;
5156 @}
5157 @end smallexample
5158 The practice of reading from a different union member than the one most
5159 recently written to (called ``type-punning'') is common.  Even with
5160 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5161 is accessed through the union type.  So, the code above will work as
5162 expected.  However, this code might not:
5163 @smallexample
5164 int f() @{
5165   a_union t;
5166   int* ip;
5167   t.d = 3.0;
5168   ip = &t.i;
5169   return *ip;
5170 @}
5171 @end smallexample
5172
5173 Every language that wishes to perform language-specific alias analysis
5174 should define a function that computes, given an @code{tree}
5175 node, an alias set for the node.  Nodes in different alias sets are not
5176 allowed to alias.  For an example, see the C front-end function
5177 @code{c_get_alias_set}.
5178
5179 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5180
5181 @item -falign-functions
5182 @itemx -falign-functions=@var{n}
5183 @opindex falign-functions
5184 Align the start of functions to the next power-of-two greater than
5185 @var{n}, skipping up to @var{n} bytes.  For instance,
5186 @option{-falign-functions=32} aligns functions to the next 32-byte
5187 boundary, but @option{-falign-functions=24} would align to the next
5188 32-byte boundary only if this can be done by skipping 23 bytes or less.
5189
5190 @option{-fno-align-functions} and @option{-falign-functions=1} are
5191 equivalent and mean that functions will not be aligned.
5192
5193 Some assemblers only support this flag when @var{n} is a power of two;
5194 in that case, it is rounded up.
5195
5196 If @var{n} is not specified or is zero, use a machine-dependent default.
5197
5198 Enabled at levels @option{-O2}, @option{-O3}.
5199
5200 @item -falign-labels
5201 @itemx -falign-labels=@var{n}
5202 @opindex falign-labels
5203 Align all branch targets to a power-of-two boundary, skipping up to
5204 @var{n} bytes like @option{-falign-functions}.  This option can easily
5205 make code slower, because it must insert dummy operations for when the
5206 branch target is reached in the usual flow of the code.
5207
5208 @option{-fno-align-labels} and @option{-falign-labels=1} are
5209 equivalent and mean that labels will not be aligned.
5210
5211 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5212 are greater than this value, then their values are used instead.
5213
5214 If @var{n} is not specified or is zero, use a machine-dependent default
5215 which is very likely to be @samp{1}, meaning no alignment.
5216
5217 Enabled at levels @option{-O2}, @option{-O3}.
5218
5219 @item -falign-loops
5220 @itemx -falign-loops=@var{n}
5221 @opindex falign-loops
5222 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5223 like @option{-falign-functions}.  The hope is that the loop will be
5224 executed many times, which will make up for any execution of the dummy
5225 operations.
5226
5227 @option{-fno-align-loops} and @option{-falign-loops=1} are
5228 equivalent and mean that loops will not be aligned.
5229
5230 If @var{n} is not specified or is zero, use a machine-dependent default.
5231
5232 Enabled at levels @option{-O2}, @option{-O3}.
5233
5234 @item -falign-jumps
5235 @itemx -falign-jumps=@var{n}
5236 @opindex falign-jumps
5237 Align branch targets to a power-of-two boundary, for branch targets
5238 where the targets can only be reached by jumping, skipping up to @var{n}
5239 bytes like @option{-falign-functions}.  In this case, no dummy operations
5240 need be executed.
5241
5242 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5243 equivalent and mean that loops will not be aligned.
5244
5245 If @var{n} is not specified or is zero, use a machine-dependent default.
5246
5247 Enabled at levels @option{-O2}, @option{-O3}.
5248
5249 @item -funit-at-a-time
5250 @opindex funit-at-a-time
5251 Parse the whole compilation unit before starting to produce code.
5252 This allows some extra optimizations to take place but consumes
5253 more memory (in general).  There are some compatibility issues
5254 with @emph{unit-at-at-time} mode:
5255 @itemize @bullet
5256 @item
5257 enabling @emph{unit-at-a-time} mode may change the order
5258 in which functions, variables, and top-level @code{asm} statements
5259 are emitted, and will likely break code relying on some particular
5260 ordering.  The majority of such top-level @code{asm} statements,
5261 though, can be replaced by @code{section} attributes.
5262
5263 @item
5264 @emph{unit-at-a-time} mode removes unreferenced static variables
5265 and functions.  This may result in undefined references
5266 when an @code{asm} statement refers directly to variables or functions
5267 that are otherwise unused.  In that case either the variable/function
5268 shall be listed as an operand of the @code{asm} statement operand or,
5269 in the case of top-level @code{asm} statements the attribute @code{used}
5270 shall be used on the declaration.
5271
5272 @item
5273 Static functions now can use non-standard passing conventions that
5274 may break @code{asm} statements calling functions directly.  Again,
5275 attribute @code{used} will prevent this behavior.
5276 @end itemize
5277
5278 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5279 but this scheme may not be supported by future releases of GCC@.
5280
5281 Enabled at levels @option{-O2}, @option{-O3}.
5282
5283 @item -fweb
5284 @opindex fweb
5285 Constructs webs as commonly used for register allocation purposes and assign
5286 each web individual pseudo register.  This allows the register allocation pass
5287 to operate on pseudos directly, but also strengthens several other optimization
5288 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5289 however, make debugging impossible, since variables will no longer stay in a
5290 ``home register''.
5291
5292 Enabled by default with @option{-funroll-loops}.
5293
5294 @item -fwhole-program
5295 @opindex fwhole-program
5296 Assume that the current compilation unit represents whole program being
5297 compiled.  All public functions and variables with the exception of @code{main}
5298 and those merged by attribute @code{externally_visible} become static functions
5299 and in a affect gets more aggressively optimized by interprocedural optimizers.
5300 While this option is equivalent to proper use of @code{static} keyword for
5301 programs consisting of single file, in combination with option
5302 @option{--combine} this flag can be used to compile most of smaller scale C
5303 programs since the functions and variables become local for the whole combined
5304 compilation unit, not for the single source file itself.
5305
5306
5307 @item -fno-cprop-registers
5308 @opindex fno-cprop-registers
5309 After register allocation and post-register allocation instruction splitting,
5310 we perform a copy-propagation pass to try to reduce scheduling dependencies
5311 and occasionally eliminate the copy.
5312
5313 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5314
5315 @item -fprofile-generate
5316 @opindex fprofile-generate
5317
5318 Enable options usually used for instrumenting application to produce
5319 profile useful for later recompilation with profile feedback based
5320 optimization.  You must use @option{-fprofile-generate} both when
5321 compiling and when linking your program.
5322
5323 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5324
5325 @item -fprofile-use
5326 @opindex fprofile-use
5327 Enable profile feedback directed optimizations, and optimizations
5328 generally profitable only with profile feedback available.
5329
5330 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5331 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer},
5332 @code{-fno-loop-optimize}.
5333
5334 @end table
5335
5336 The following options control compiler behavior regarding floating
5337 point arithmetic.  These options trade off between speed and
5338 correctness.  All must be specifically enabled.
5339
5340 @table @gcctabopt
5341 @item -ffloat-store
5342 @opindex ffloat-store
5343 Do not store floating point variables in registers, and inhibit other
5344 options that might change whether a floating point value is taken from a
5345 register or memory.
5346
5347 @cindex floating point precision
5348 This option prevents undesirable excess precision on machines such as
5349 the 68000 where the floating registers (of the 68881) keep more
5350 precision than a @code{double} is supposed to have.  Similarly for the
5351 x86 architecture.  For most programs, the excess precision does only
5352 good, but a few programs rely on the precise definition of IEEE floating
5353 point.  Use @option{-ffloat-store} for such programs, after modifying
5354 them to store all pertinent intermediate computations into variables.
5355
5356 @item -ffast-math
5357 @opindex ffast-math
5358 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5359 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5360 @option{-fno-rounding-math}, @option{-fno-signaling-nans}
5361 and @option{fcx-limited-range}.
5362
5363 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5364
5365 This option should never be turned on by any @option{-O} option since
5366 it can result in incorrect output for programs which depend on
5367 an exact implementation of IEEE or ISO rules/specifications for
5368 math functions.
5369
5370 @item -fno-math-errno
5371 @opindex fno-math-errno
5372 Do not set ERRNO after calling math functions that are executed
5373 with a single instruction, e.g., sqrt.  A program that relies on
5374 IEEE exceptions for math error handling may want to use this flag
5375 for speed while maintaining IEEE arithmetic compatibility.
5376
5377 This option should never be turned on by any @option{-O} option since
5378 it can result in incorrect output for programs which depend on
5379 an exact implementation of IEEE or ISO rules/specifications for
5380 math functions.
5381
5382 The default is @option{-fmath-errno}.
5383
5384 On Darwin systems, the math library never sets @code{errno}.  There is therefore
5385 no reason for the compiler to consider the possibility that it might,
5386 and @option{-fno-math-errno} is the default.
5387
5388 @item -funsafe-math-optimizations
5389 @opindex funsafe-math-optimizations
5390 Allow optimizations for floating-point arithmetic that (a) assume
5391 that arguments and results are valid and (b) may violate IEEE or
5392 ANSI standards.  When used at link-time, it may include libraries
5393 or startup files that change the default FPU control word or other
5394 similar optimizations.
5395
5396 This option should never be turned on by any @option{-O} option since
5397 it can result in incorrect output for programs which depend on
5398 an exact implementation of IEEE or ISO rules/specifications for
5399 math functions.
5400
5401 The default is @option{-fno-unsafe-math-optimizations}.
5402
5403 @item -ffinite-math-only
5404 @opindex ffinite-math-only
5405 Allow optimizations for floating-point arithmetic that assume
5406 that arguments and results are not NaNs or +-Infs.
5407
5408 This option should never be turned on by any @option{-O} option since
5409 it can result in incorrect output for programs which depend on
5410 an exact implementation of IEEE or ISO rules/specifications.
5411
5412 The default is @option{-fno-finite-math-only}.
5413
5414 @item -fno-trapping-math
5415 @opindex fno-trapping-math
5416 Compile code assuming that floating-point operations cannot generate
5417 user-visible traps.  These traps include division by zero, overflow,
5418 underflow, inexact result and invalid operation.  This option implies
5419 @option{-fno-signaling-nans}.  Setting this option may allow faster
5420 code if one relies on ``non-stop'' IEEE arithmetic, for example.
5421
5422 This option should never be turned on by any @option{-O} option since
5423 it can result in incorrect output for programs which depend on
5424 an exact implementation of IEEE or ISO rules/specifications for
5425 math functions.
5426
5427 The default is @option{-ftrapping-math}.
5428
5429 @item -frounding-math
5430 @opindex frounding-math
5431 Disable transformations and optimizations that assume default floating
5432 point rounding behavior.  This is round-to-zero for all floating point
5433 to integer conversions, and round-to-nearest for all other arithmetic
5434 truncations.  This option should be specified for programs that change
5435 the FP rounding mode dynamically, or that may be executed with a
5436 non-default rounding mode.  This option disables constant folding of
5437 floating point expressions at compile-time (which may be affected by
5438 rounding mode) and arithmetic transformations that are unsafe in the
5439 presence of sign-dependent rounding modes.
5440
5441 The default is @option{-fno-rounding-math}.
5442
5443 This option is experimental and does not currently guarantee to
5444 disable all GCC optimizations that are affected by rounding mode.
5445 Future versions of GCC may provide finer control of this setting
5446 using C99's @code{FENV_ACCESS} pragma.  This command line option
5447 will be used to specify the default state for @code{FENV_ACCESS}.
5448
5449 @item -fsignaling-nans
5450 @opindex fsignaling-nans
5451 Compile code assuming that IEEE signaling NaNs may generate user-visible
5452 traps during floating-point operations.  Setting this option disables
5453 optimizations that may change the number of exceptions visible with
5454 signaling NaNs.  This option implies @option{-ftrapping-math}.
5455
5456 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
5457 be defined.
5458
5459 The default is @option{-fno-signaling-nans}.
5460
5461 This option is experimental and does not currently guarantee to
5462 disable all GCC optimizations that affect signaling NaN behavior.
5463
5464 @item -fsingle-precision-constant
5465 @opindex fsingle-precision-constant
5466 Treat floating point constant as single precision constant instead of
5467 implicitly converting it to double precision constant.
5468
5469 @item -fcx-limited-range
5470 @itemx -fno-cx-limited-range
5471 @opindex fcx-limited-range
5472 @opindex fno-cx-limited-range
5473 When enabled, this option states that a range reduction step is not
5474 needed when performing complex division.  The default is
5475 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
5476
5477 This option controls the default setting of the ISO C99 
5478 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
5479 all languages.
5480
5481 @end table
5482
5483 The following options control optimizations that may improve
5484 performance, but are not enabled by any @option{-O} options.  This
5485 section includes experimental options that may produce broken code.
5486
5487 @table @gcctabopt
5488 @item -fbranch-probabilities
5489 @opindex fbranch-probabilities
5490 After running a program compiled with @option{-fprofile-arcs}
5491 (@pxref{Debugging Options,, Options for Debugging Your Program or
5492 @command{gcc}}), you can compile it a second time using
5493 @option{-fbranch-probabilities}, to improve optimizations based on
5494 the number of times each branch was taken.  When the program
5495 compiled with @option{-fprofile-arcs} exits it saves arc execution
5496 counts to a file called @file{@var{sourcename}.gcda} for each source
5497 file  The information in this data file is very dependent on the
5498 structure of the generated code, so you must use the same source code
5499 and the same optimization options for both compilations.
5500
5501 With @option{-fbranch-probabilities}, GCC puts a
5502 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
5503 These can be used to improve optimization.  Currently, they are only
5504 used in one place: in @file{reorg.c}, instead of guessing which path a
5505 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
5506 exactly determine which path is taken more often.
5507
5508 @item -fprofile-values
5509 @opindex fprofile-values
5510 If combined with @option{-fprofile-arcs}, it adds code so that some
5511 data about values of expressions in the program is gathered.
5512
5513 With @option{-fbranch-probabilities}, it reads back the data gathered
5514 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
5515 notes to instructions for their later usage in optimizations.
5516
5517 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
5518
5519 @item -fvpt
5520 @opindex fvpt
5521 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
5522 a code to gather information about values of expressions.
5523
5524 With @option{-fbranch-probabilities}, it reads back the data gathered
5525 and actually performs the optimizations based on them.
5526 Currently the optimizations include specialization of division operation
5527 using the knowledge about the value of the denominator.
5528
5529 @item -frename-registers
5530 @opindex frename-registers
5531 Attempt to avoid false dependencies in scheduled code by making use
5532 of registers left over after register allocation.  This optimization
5533 will most benefit processors with lots of registers.  Depending on the
5534 debug information format adopted by the target, however, it can
5535 make debugging impossible, since variables will no longer stay in
5536 a ``home register''.
5537
5538 Enabled by default with @option{-funroll-loops}.
5539
5540 @item -ftracer
5541 @opindex ftracer
5542 Perform tail duplication to enlarge superblock size.  This transformation
5543 simplifies the control flow of the function allowing other optimizations to do
5544 better job.
5545
5546 Enabled with @option{-fprofile-use}.
5547
5548 @item -funroll-loops
5549 @opindex funroll-loops
5550 Unroll loops whose number of iterations can be determined at compile time or
5551 upon entry to the loop.  @option{-funroll-loops} implies
5552 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}. 
5553 It also turns on complete loop peeling (i.e.@: complete removal of loops with
5554 small constant number of iterations).  This option makes code larger, and may
5555 or may not make it run faster.
5556
5557 Enabled with @option{-fprofile-use}.
5558
5559 @item -funroll-all-loops
5560 @opindex funroll-all-loops
5561 Unroll all loops, even if their number of iterations is uncertain when
5562 the loop is entered.  This usually makes programs run more slowly.
5563 @option{-funroll-all-loops} implies the same options as
5564 @option{-funroll-loops}.
5565
5566 @item -fpeel-loops
5567 @opindex fpeel-loops
5568 Peels the loops for that there is enough information that they do not
5569 roll much (from profile feedback).  It also turns on complete loop peeling
5570 (i.e.@: complete removal of loops with small constant number of iterations).
5571
5572 Enabled with @option{-fprofile-use}.
5573
5574 @item -fmove-loop-invariants
5575 @opindex fmove-loop-invariants
5576 Enables the loop invariant motion pass in the new loop optimizer.  Enabled
5577 at level @option{-O1}
5578
5579 @item -funswitch-loops
5580 @opindex funswitch-loops
5581 Move branches with loop invariant conditions out of the loop, with duplicates
5582 of the loop on both branches (modified according to result of the condition).
5583
5584 @item -fprefetch-loop-arrays
5585 @opindex fprefetch-loop-arrays
5586 If supported by the target machine, generate instructions to prefetch
5587 memory to improve the performance of loops that access large arrays.
5588
5589 Disabled at level @option{-Os}.
5590
5591 @item -ffunction-sections
5592 @itemx -fdata-sections
5593 @opindex ffunction-sections
5594 @opindex fdata-sections
5595 Place each function or data item into its own section in the output
5596 file if the target supports arbitrary sections.  The name of the
5597 function or the name of the data item determines the section's name
5598 in the output file.
5599
5600 Use these options on systems where the linker can perform optimizations
5601 to improve locality of reference in the instruction space.  Most systems
5602 using the ELF object format and SPARC processors running Solaris 2 have
5603 linkers with such optimizations.  AIX may have these optimizations in
5604 the future.
5605
5606 Only use these options when there are significant benefits from doing
5607 so.  When you specify these options, the assembler and linker will
5608 create larger object and executable files and will also be slower.
5609 You will not be able to use @code{gprof} on all systems if you
5610 specify this option and you may have problems with debugging if
5611 you specify both this option and @option{-g}.
5612
5613 @item -fbranch-target-load-optimize
5614 @opindex fbranch-target-load-optimize
5615 Perform branch target register load optimization before prologue / epilogue
5616 threading.
5617 The use of target registers can typically be exposed only during reload,
5618 thus hoisting loads out of loops and doing inter-block scheduling needs
5619 a separate optimization pass.
5620
5621 @item -fbranch-target-load-optimize2
5622 @opindex fbranch-target-load-optimize2
5623 Perform branch target register load optimization after prologue / epilogue
5624 threading.
5625
5626 @item -fbtr-bb-exclusive
5627 @opindex fbtr-bb-exclusive
5628 When performing branch target register load optimization, don't reuse
5629 branch target registers in within any basic block.
5630
5631 @item --param @var{name}=@var{value}
5632 @opindex param
5633 In some places, GCC uses various constants to control the amount of
5634 optimization that is done.  For example, GCC will not inline functions
5635 that contain more that a certain number of instructions.  You can
5636 control some of these constants on the command-line using the
5637 @option{--param} option.
5638
5639 The names of specific parameters, and the meaning of the values, are
5640 tied to the internals of the compiler, and are subject to change
5641 without notice in future releases.
5642
5643 In each case, the @var{value} is an integer.  The allowable choices for
5644 @var{name} are given in the following table:
5645
5646 @table @gcctabopt
5647 @item salias-max-implicit-fields
5648 The maximum number of fields in a variable without direct
5649 structure accesses for which structure aliasing will consider trying 
5650 to track each field.  The default is 5
5651
5652 @item sra-max-structure-size
5653 The maximum structure size, in bytes, at which the scalar replacement
5654 of aggregates (SRA) optimization will perform block copies.  The
5655 default value, 0, implies that GCC will select the most appropriate
5656 size itself.
5657
5658 @item sra-field-structure-ratio
5659 The threshold ratio (as a percentage) between instantiated fields and
5660 the complete structure size.  We say that if the ratio of the number
5661 of bytes in instantiated fields to the number of bytes in the complete
5662 structure exceeds this parameter, then block copies are not used.  The
5663 default is 75.
5664
5665 @item max-crossjump-edges
5666 The maximum number of incoming edges to consider for crossjumping.
5667 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
5668 the number of edges incoming to each block.  Increasing values mean
5669 more aggressive optimization, making the compile time increase with
5670 probably small improvement in executable size.
5671
5672 @item min-crossjump-insns
5673 The minimum number of instructions which must be matched at the end
5674 of two blocks before crossjumping will be performed on them.  This
5675 value is ignored in the case where all instructions in the block being
5676 crossjumped from are matched.  The default value is 5.
5677
5678 @item max-goto-duplication-insns
5679 The maximum number of instructions to duplicate to a block that jumps
5680 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
5681 passes, GCC factors computed gotos early in the compilation process,
5682 and unfactors them as late as possible.  Only computed jumps at the
5683 end of a basic blocks with no more than max-goto-duplication-insns are
5684 unfactored.  The default value is 8.
5685
5686 @item max-delay-slot-insn-search
5687 The maximum number of instructions to consider when looking for an
5688 instruction to fill a delay slot.  If more than this arbitrary number of
5689 instructions is searched, the time savings from filling the delay slot
5690 will be minimal so stop searching.  Increasing values mean more
5691 aggressive optimization, making the compile time increase with probably
5692 small improvement in executable run time.
5693
5694 @item max-delay-slot-live-search
5695 When trying to fill delay slots, the maximum number of instructions to
5696 consider when searching for a block with valid live register
5697 information.  Increasing this arbitrarily chosen value means more
5698 aggressive optimization, increasing the compile time.  This parameter
5699 should be removed when the delay slot code is rewritten to maintain the
5700 control-flow graph.
5701
5702 @item max-gcse-memory
5703 The approximate maximum amount of memory that will be allocated in
5704 order to perform the global common subexpression elimination
5705 optimization.  If more memory than specified is required, the
5706 optimization will not be done.
5707
5708 @item max-gcse-passes
5709 The maximum number of passes of GCSE to run.  The default is 1.
5710
5711 @item max-pending-list-length
5712 The maximum number of pending dependencies scheduling will allow
5713 before flushing the current state and starting over.  Large functions
5714 with few branches or calls can create excessively large lists which
5715 needlessly consume memory and resources.
5716
5717 @item max-inline-insns-single
5718 Several parameters control the tree inliner used in gcc.
5719 This number sets the maximum number of instructions (counted in GCC's
5720 internal representation) in a single function that the tree inliner
5721 will consider for inlining.  This only affects functions declared
5722 inline and methods implemented in a class declaration (C++).
5723 The default value is 450.
5724
5725 @item max-inline-insns-auto
5726 When you use @option{-finline-functions} (included in @option{-O3}),
5727 a lot of functions that would otherwise not be considered for inlining
5728 by the compiler will be investigated.  To those functions, a different
5729 (more restrictive) limit compared to functions declared inline can
5730 be applied.
5731 The default value is 90.
5732
5733 @item large-function-insns
5734 The limit specifying really large functions.  For functions larger than this
5735 limit after inlining inlining is constrained by
5736 @option{--param large-function-growth}.  This parameter is useful primarily
5737 to avoid extreme compilation time caused by non-linear algorithms used by the
5738 backend.
5739 This parameter is ignored when @option{-funit-at-a-time} is not used.
5740 The default value is 2700.
5741
5742 @item large-function-growth
5743 Specifies maximal growth of large function caused by inlining in percents.
5744 This parameter is ignored when @option{-funit-at-a-time} is not used.
5745 The default value is 100 which limits large function growth to 2.0 times
5746 the original size.
5747
5748 @item inline-unit-growth
5749 Specifies maximal overall growth of the compilation unit caused by inlining.
5750 This parameter is ignored when @option{-funit-at-a-time} is not used.
5751 The default value is 50 which limits unit growth to 1.5 times the original
5752 size.
5753
5754 @item max-inline-insns-recursive
5755 @itemx max-inline-insns-recursive-auto
5756 Specifies maximum number of instructions out-of-line copy of self recursive inline
5757 function can grow into by performing recursive inlining.
5758
5759 For functions declared inline @option{--param max-inline-insns-recursive} is
5760 taken into acount.  For function not declared inline, recursive inlining
5761 happens only when @option{-finline-functions} (included in @option{-O3}) is
5762 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
5763 default value is 450.
5764
5765 @item max-inline-recursive-depth
5766 @itemx max-inline-recursive-depth-auto
5767 Specifies maximum recursion depth used by the recursive inlining.
5768
5769 For functions declared inline @option{--param max-inline-recursive-depth} is
5770 taken into acount.  For function not declared inline, recursive inlining
5771 happens only when @option{-finline-functions} (included in @option{-O3}) is
5772 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
5773 default value is 450.
5774
5775 @item min-inline-recursive-probability
5776 Recursive inlining is profitable only for function having deep recursion
5777 in average and can hurt for function having little recursion depth by
5778 increasing the prologue size or complexity of function body to other
5779 optimizers.
5780
5781 When profile feedback is available (see @option{-fprofile-generate}) the actual
5782 recursion depth can be guessed from probability that function will recurse via
5783 given call expression.  This parameter limits inlining only to call expression
5784 whose probability exceeds given threshold (in percents).  The default value is
5785 10.
5786
5787 @item inline-call-cost
5788 Specify cost of call instruction relative to simple arithmetics operations
5789 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
5790 functions and at the same time increases size of leaf function that is believed to
5791 reduce function size by being inlined.  In effect it increases amount of
5792 inlining for code having large abstraction penalty (many functions that just
5793 pass the arguments to other functions) and decrease inlining for code with low
5794 abstraction penalty.  The default value is 16.
5795
5796 @item max-unrolled-insns
5797 The maximum number of instructions that a loop should have if that loop
5798 is unrolled, and if the loop is unrolled, it determines how many times
5799 the loop code is unrolled.
5800
5801 @item max-average-unrolled-insns
5802 The maximum number of instructions biased by probabilities of their execution
5803 that a loop should have if that loop is unrolled, and if the loop is unrolled,
5804 it determines how many times the loop code is unrolled.
5805
5806 @item max-unroll-times
5807 The maximum number of unrollings of a single loop.
5808
5809 @item max-peeled-insns
5810 The maximum number of instructions that a loop should have if that loop
5811 is peeled, and if the loop is peeled, it determines how many times
5812 the loop code is peeled.
5813
5814 @item max-peel-times
5815 The maximum number of peelings of a single loop.
5816
5817 @item max-completely-peeled-insns
5818 The maximum number of insns of a completely peeled loop.
5819
5820 @item max-completely-peel-times
5821 The maximum number of iterations of a loop to be suitable for complete peeling.
5822
5823 @item max-unswitch-insns
5824 The maximum number of insns of an unswitched loop.
5825
5826 @item max-unswitch-level
5827 The maximum number of branches unswitched in a single loop.
5828
5829 @item lim-expensive
5830 The minimum cost of an expensive expression in the loop invariant motion.
5831
5832 @item iv-consider-all-candidates-bound
5833 Bound on number of candidates for induction variables below that
5834 all candidates are considered for each use in induction variable
5835 optimizations.  Only the most relevant candidates are considered
5836 if there are more candidates, to avoid quadratic time complexity.
5837
5838 @item iv-max-considered-uses
5839 The induction variable optimizations give up on loops that contain more
5840 induction variable uses.
5841
5842 @item iv-always-prune-cand-set-bound
5843 If number of candidates in the set is smaller than this value,
5844 we always try to remove unnecessary ivs from the set during its
5845 optimization when a new iv is added to the set.
5846
5847 @item scev-max-expr-size
5848 Bound on size of expressions used in the scalar evolutions analyzer.
5849 Large expressions slow the analyzer.
5850
5851 @item max-iterations-to-track
5852
5853 The maximum number of iterations of a loop the brute force algorithm
5854 for analysis of # of iterations of the loop tries to evaluate.
5855
5856 @item hot-bb-count-fraction
5857 Select fraction of the maximal count of repetitions of basic block in program
5858 given basic block needs to have to be considered hot.
5859
5860 @item hot-bb-frequency-fraction
5861 Select fraction of the maximal frequency of executions of basic block in
5862 function given basic block needs to have to be considered hot
5863
5864 @item tracer-dynamic-coverage
5865 @itemx tracer-dynamic-coverage-feedback
5866
5867 This value is used to limit superblock formation once the given percentage of
5868 executed instructions is covered.  This limits unnecessary code size
5869 expansion.
5870
5871 The @option{tracer-dynamic-coverage-feedback} is used only when profile
5872 feedback is available.  The real profiles (as opposed to statically estimated
5873 ones) are much less balanced allowing the threshold to be larger value.
5874
5875 @item tracer-max-code-growth
5876 Stop tail duplication once code growth has reached given percentage.  This is
5877 rather hokey argument, as most of the duplicates will be eliminated later in
5878 cross jumping, so it may be set to much higher values than is the desired code
5879 growth.
5880
5881 @item tracer-min-branch-ratio
5882
5883 Stop reverse growth when the reverse probability of best edge is less than this
5884 threshold (in percent).
5885
5886 @item tracer-min-branch-ratio
5887 @itemx tracer-min-branch-ratio-feedback
5888
5889 Stop forward growth if the best edge do have probability lower than this
5890 threshold.
5891
5892 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
5893 compilation for profile feedback and one for compilation without.  The value
5894 for compilation with profile feedback needs to be more conservative (higher) in
5895 order to make tracer effective.
5896
5897 @item max-cse-path-length
5898
5899 Maximum number of basic blocks on path that cse considers.  The default is 10.
5900
5901 @item global-var-threshold
5902
5903 Counts the number of function calls (@var{n}) and the number of
5904 call-clobbered variables (@var{v}).  If @var{n}x@var{v} is larger than this limit, a
5905 single artificial variable will be created to represent all the
5906 call-clobbered variables at function call sites.  This artificial
5907 variable will then be made to alias every call-clobbered variable.
5908 (done as @code{int * size_t} on the host machine; beware overflow).
5909
5910 @item max-aliased-vops
5911
5912 Maximum number of virtual operands allowed to represent aliases
5913 before triggering the alias grouping heuristic.  Alias grouping
5914 reduces compile times and memory consumption needed for aliasing at
5915 the expense of precision loss in alias information.
5916
5917 @item ggc-min-expand
5918
5919 GCC uses a garbage collector to manage its own memory allocation.  This
5920 parameter specifies the minimum percentage by which the garbage
5921 collector's heap should be allowed to expand between collections.
5922 Tuning this may improve compilation speed; it has no effect on code
5923 generation.
5924
5925 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
5926 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
5927 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
5928 GCC is not able to calculate RAM on a particular platform, the lower
5929 bound of 30% is used.  Setting this parameter and
5930 @option{ggc-min-heapsize} to zero causes a full collection to occur at
5931 every opportunity.  This is extremely slow, but can be useful for
5932 debugging.
5933
5934 @item ggc-min-heapsize
5935
5936 Minimum size of the garbage collector's heap before it begins bothering
5937 to collect garbage.  The first collection occurs after the heap expands
5938 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
5939 tuning this may improve compilation speed, and has no effect on code
5940 generation.
5941
5942 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
5943 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
5944 with a lower bound of 4096 (four megabytes) and an upper bound of
5945 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
5946 particular platform, the lower bound is used.  Setting this parameter
5947 very large effectively disables garbage collection.  Setting this
5948 parameter and @option{ggc-min-expand} to zero causes a full collection
5949 to occur at every opportunity.
5950
5951 @item max-reload-search-insns
5952 The maximum number of instruction reload should look backward for equivalent
5953 register.  Increasing values mean more aggressive optimization, making the
5954 compile time increase with probably slightly better performance.  The default
5955 value is 100.
5956
5957 @item max-cselib-memory-location
5958 The maximum number of memory locations cselib should take into acount.
5959 Increasing values mean more aggressive optimization, making the compile time
5960 increase with probably slightly better performance.  The default value is 500.
5961
5962 @item reorder-blocks-duplicate
5963 @itemx reorder-blocks-duplicate-feedback
5964
5965 Used by basic block reordering pass to decide whether to use unconditional
5966 branch or duplicate the code on its destination.  Code is duplicated when its
5967 estimated size is smaller than this value multiplied by the estimated size of
5968 unconditional jump in the hot spots of the program.
5969
5970 The @option{reorder-block-duplicate-feedback} is used only when profile
5971 feedback is available and may be set to higher values than
5972 @option{reorder-block-duplicate} since information about the hot spots is more
5973 accurate.
5974
5975 @item max-sched-region-blocks
5976 The maximum number of blocks in a region to be considered for
5977 interblock scheduling.  The default value is 10.
5978
5979 @item max-sched-region-insns
5980 The maximum number of insns in a region to be considered for
5981 interblock scheduling.  The default value is 100.
5982
5983 @item max-last-value-rtl
5984
5985 The maximum size measured as number of RTLs that can be recorded in an expression
5986 in combiner for a pseudo register as last known value of that register.  The default
5987 is 10000.
5988
5989 @item integer-share-limit
5990 Small integer constants can use a shared data structure, reducing the
5991 compiler's memory usage and increasing its speed.  This sets the maximum
5992 value of a shared integer constant's.  The default value is 256.
5993
5994 @item min-virtual-mappings
5995 Specifies the minimum number of virtual mappings in the incremental
5996 SSA updater that should be registered to trigger the virtual mappings
5997 heuristic defined by virtual-mappings-ratio.  The default value is
5998 100.
5999
6000 @item virtual-mappings-ratio
6001 If the number of virtual mappings is virtual-mappings-ratio bigger
6002 than the number of virtual symbols to be updated, then the incremental
6003 SSA updater switches to a full update for those symbols.  The default
6004 ratio is 3.
6005
6006 @end table
6007 @end table
6008
6009 @node Preprocessor Options
6010 @section Options Controlling the Preprocessor
6011 @cindex preprocessor options
6012 @cindex options, preprocessor
6013
6014 These options control the C preprocessor, which is run on each C source
6015 file before actual compilation.
6016
6017 If you use the @option{-E} option, nothing is done except preprocessing.
6018 Some of these options make sense only together with @option{-E} because
6019 they cause the preprocessor output to be unsuitable for actual
6020 compilation.
6021
6022 @table @gcctabopt
6023 @opindex Wp
6024 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6025 and pass @var{option} directly through to the preprocessor.  If
6026 @var{option} contains commas, it is split into multiple options at the
6027 commas.  However, many options are modified, translated or interpreted
6028 by the compiler driver before being passed to the preprocessor, and
6029 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6030 interface is undocumented and subject to change, so whenever possible
6031 you should avoid using @option{-Wp} and let the driver handle the
6032 options instead.
6033
6034 @item -Xpreprocessor @var{option}
6035 @opindex preprocessor
6036 Pass @var{option} as an option to the preprocessor.  You can use this to
6037 supply system-specific preprocessor options which GCC does not know how to
6038 recognize.
6039
6040 If you want to pass an option that takes an argument, you must use
6041 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6042 @end table
6043
6044 @include cppopts.texi
6045
6046 @node Assembler Options
6047 @section Passing Options to the Assembler
6048
6049 @c prevent bad page break with this line
6050 You can pass options to the assembler.
6051
6052 @table @gcctabopt
6053 @item -Wa,@var{option}
6054 @opindex Wa
6055 Pass @var{option} as an option to the assembler.  If @var{option}
6056 contains commas, it is split into multiple options at the commas.
6057
6058 @item -Xassembler @var{option}
6059 @opindex Xassembler
6060 Pass @var{option} as an option to the assembler.  You can use this to
6061 supply system-specific assembler options which GCC does not know how to
6062 recognize.
6063
6064 If you want to pass an option that takes an argument, you must use
6065 @option{-Xassembler} twice, once for the option and once for the argument.
6066
6067 @end table
6068
6069 @node Link Options
6070 @section Options for Linking
6071 @cindex link options
6072 @cindex options, linking
6073
6074 These options come into play when the compiler links object files into
6075 an executable output file.  They are meaningless if the compiler is
6076 not doing a link step.
6077
6078 @table @gcctabopt
6079 @cindex file names
6080 @item @var{object-file-name}
6081 A file name that does not end in a special recognized suffix is
6082 considered to name an object file or library.  (Object files are
6083 distinguished from libraries by the linker according to the file
6084 contents.)  If linking is done, these object files are used as input
6085 to the linker.
6086
6087 @item -c
6088 @itemx -S
6089 @itemx -E
6090 @opindex c
6091 @opindex S
6092 @opindex E
6093 If any of these options is used, then the linker is not run, and
6094 object file names should not be used as arguments.  @xref{Overall
6095 Options}.
6096
6097 @cindex Libraries
6098 @item -l@var{library}
6099 @itemx -l @var{library}
6100 @opindex l
6101 Search the library named @var{library} when linking.  (The second
6102 alternative with the library as a separate argument is only for
6103 POSIX compliance and is not recommended.)
6104
6105 It makes a difference where in the command you write this option; the
6106 linker searches and processes libraries and object files in the order they
6107 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6108 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6109 to functions in @samp{z}, those functions may not be loaded.
6110
6111 The linker searches a standard list of directories for the library,
6112 which is actually a file named @file{lib@var{library}.a}.  The linker
6113 then uses this file as if it had been specified precisely by name.
6114
6115 The directories searched include several standard system directories
6116 plus any that you specify with @option{-L}.
6117
6118 Normally the files found this way are library files---archive files
6119 whose members are object files.  The linker handles an archive file by
6120 scanning through it for members which define symbols that have so far
6121 been referenced but not defined.  But if the file that is found is an
6122 ordinary object file, it is linked in the usual fashion.  The only
6123 difference between using an @option{-l} option and specifying a file name
6124 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6125 and searches several directories.
6126
6127 @item -lobjc
6128 @opindex lobjc
6129 You need this special case of the @option{-l} option in order to
6130 link an Objective-C or Objective-C++ program.
6131
6132 @item -nostartfiles
6133 @opindex nostartfiles
6134 Do not use the standard system startup files when linking.
6135 The standard system libraries are used normally, unless @option{-nostdlib}
6136 or @option{-nodefaultlibs} is used.
6137
6138 @item -nodefaultlibs
6139 @opindex nodefaultlibs
6140 Do not use the standard system libraries when linking.
6141 Only the libraries you specify will be passed to the linker.
6142 The standard startup files are used normally, unless @option{-nostartfiles}
6143 is used.  The compiler may generate calls to @code{memcmp},
6144 @code{memset}, @code{memcpy} and @code{memmove}.
6145 These entries are usually resolved by entries in
6146 libc.  These entry points should be supplied through some other
6147 mechanism when this option is specified.
6148
6149 @item -nostdlib
6150 @opindex nostdlib
6151 Do not use the standard system startup files or libraries when linking.
6152 No startup files and only the libraries you specify will be passed to
6153 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6154 @code{memcpy} and @code{memmove}.
6155 These entries are usually resolved by entries in
6156 libc.  These entry points should be supplied through some other
6157 mechanism when this option is specified.
6158
6159 @cindex @option{-lgcc}, use with @option{-nostdlib}
6160 @cindex @option{-nostdlib} and unresolved references
6161 @cindex unresolved references and @option{-nostdlib}
6162 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6163 @cindex @option{-nodefaultlibs} and unresolved references
6164 @cindex unresolved references and @option{-nodefaultlibs}
6165 One of the standard libraries bypassed by @option{-nostdlib} and
6166 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6167 that GCC uses to overcome shortcomings of particular machines, or special
6168 needs for some languages.
6169 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6170 Collection (GCC) Internals},
6171 for more discussion of @file{libgcc.a}.)
6172 In most cases, you need @file{libgcc.a} even when you want to avoid
6173 other standard libraries.  In other words, when you specify @option{-nostdlib}
6174 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6175 This ensures that you have no unresolved references to internal GCC
6176 library subroutines.  (For example, @samp{__main}, used to ensure C++
6177 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6178 GNU Compiler Collection (GCC) Internals}.)
6179
6180 @item -pie
6181 @opindex pie
6182 Produce a position independent executable on targets which support it.
6183 For predictable results, you must also specify the same set of options
6184 that were used to generate code (@option{-fpie}, @option{-fPIE},
6185 or model suboptions) when you specify this option.
6186
6187 @item -rdynamic
6188 @opindex rdynamic
6189 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6190 that support it. This instructs the linker to add all symbols, not
6191 only used ones, to the dynamic symbol table. This option is needed
6192 for some uses of @code{dlopen} or to allow obtaining backtraces
6193 from within a program.
6194
6195 @item -s
6196 @opindex s
6197 Remove all symbol table and relocation information from the executable.
6198
6199 @item -static
6200 @opindex static
6201 On systems that support dynamic linking, this prevents linking with the shared
6202 libraries.  On other systems, this option has no effect.
6203
6204 @item -shared
6205 @opindex shared
6206 Produce a shared object which can then be linked with other objects to
6207 form an executable.  Not all systems support this option.  For predictable
6208 results, you must also specify the same set of options that were used to
6209 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6210 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6211 needs to build supplementary stub code for constructors to work.  On
6212 multi-libbed systems, @samp{gcc -shared} must select the correct support
6213 libraries to link against.  Failing to supply the correct flags may lead
6214 to subtle defects.  Supplying them in cases where they are not necessary
6215 is innocuous.}
6216
6217 @item -shared-libgcc
6218 @itemx -static-libgcc
6219 @opindex shared-libgcc
6220 @opindex static-libgcc
6221 On systems that provide @file{libgcc} as a shared library, these options
6222 force the use of either the shared or static version respectively.
6223 If no shared version of @file{libgcc} was built when the compiler was
6224 configured, these options have no effect.
6225
6226 There are several situations in which an application should use the
6227 shared @file{libgcc} instead of the static version.  The most common
6228 of these is when the application wishes to throw and catch exceptions
6229 across different shared libraries.  In that case, each of the libraries
6230 as well as the application itself should use the shared @file{libgcc}.
6231
6232 Therefore, the G++ and GCJ drivers automatically add
6233 @option{-shared-libgcc} whenever you build a shared library or a main
6234 executable, because C++ and Java programs typically use exceptions, so
6235 this is the right thing to do.
6236
6237 If, instead, you use the GCC driver to create shared libraries, you may
6238 find that they will not always be linked with the shared @file{libgcc}.
6239 If GCC finds, at its configuration time, that you have a non-GNU linker
6240 or a GNU linker that does not support option @option{--eh-frame-hdr},
6241 it will link the shared version of @file{libgcc} into shared libraries
6242 by default.  Otherwise, it will take advantage of the linker and optimize
6243 away the linking with the shared version of @file{libgcc}, linking with
6244 the static version of libgcc by default.  This allows exceptions to
6245 propagate through such shared libraries, without incurring relocation
6246 costs at library load time.
6247
6248 However, if a library or main executable is supposed to throw or catch
6249 exceptions, you must link it using the G++ or GCJ driver, as appropriate
6250 for the languages used in the program, or using the option
6251 @option{-shared-libgcc}, such that it is linked with the shared
6252 @file{libgcc}.
6253
6254 @item -symbolic
6255 @opindex symbolic
6256 Bind references to global symbols when building a shared object.  Warn
6257 about any unresolved references (unless overridden by the link editor
6258 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
6259 this option.
6260
6261 @item -Xlinker @var{option}
6262 @opindex Xlinker
6263 Pass @var{option} as an option to the linker.  You can use this to
6264 supply system-specific linker options which GCC does not know how to
6265 recognize.
6266
6267 If you want to pass an option that takes an argument, you must use
6268 @option{-Xlinker} twice, once for the option and once for the argument.
6269 For example, to pass @option{-assert definitions}, you must write
6270 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
6271 @option{-Xlinker "-assert definitions"}, because this passes the entire
6272 string as a single argument, which is not what the linker expects.
6273
6274 @item -Wl,@var{option}
6275 @opindex Wl
6276 Pass @var{option} as an option to the linker.  If @var{option} contains
6277 commas, it is split into multiple options at the commas.
6278
6279 @item -u @var{symbol}
6280 @opindex u
6281 Pretend the symbol @var{symbol} is undefined, to force linking of
6282 library modules to define it.  You can use @option{-u} multiple times with
6283 different symbols to force loading of additional library modules.
6284 @end table
6285
6286 @node Directory Options
6287 @section Options for Directory Search
6288 @cindex directory options
6289 @cindex options, directory search
6290 @cindex search path
6291
6292 These options specify directories to search for header files, for
6293 libraries and for parts of the compiler:
6294
6295 @table @gcctabopt
6296 @item -I@var{dir}
6297 @opindex I
6298 Add the directory @var{dir} to the head of the list of directories to be
6299 searched for header files.  This can be used to override a system header
6300 file, substituting your own version, since these directories are
6301 searched before the system header file directories.  However, you should
6302 not use this option to add directories that contain vendor-supplied
6303 system header files (use @option{-isystem} for that).  If you use more than
6304 one @option{-I} option, the directories are scanned in left-to-right
6305 order; the standard system directories come after.
6306
6307 If a standard system include directory, or a directory specified with
6308 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
6309 option will be ignored.  The directory will still be searched but as a
6310 system directory at its normal position in the system include chain.
6311 This is to ensure that GCC's procedure to fix buggy system headers and
6312 the ordering for the include_next directive are not inadvertently changed.
6313 If you really need to change the search order for system directories,
6314 use the @option{-nostdinc} and/or @option{-isystem} options.
6315
6316 @item -iquote@var{dir}
6317 @opindex iquote
6318 Add the directory @var{dir} to the head of the list of directories to
6319 be searched for header files only for the case of @samp{#include
6320 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
6321 otherwise just like @option{-I}.
6322
6323 @item -L@var{dir}
6324 @opindex L
6325 Add directory @var{dir} to the list of directories to be searched
6326 for @option{-l}.
6327
6328 @item -B@var{prefix}
6329 @opindex B
6330 This option specifies where to find the executables, libraries,
6331 include files, and data files of the compiler itself.
6332
6333 The compiler driver program runs one or more of the subprograms
6334 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
6335 @var{prefix} as a prefix for each program it tries to run, both with and
6336 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
6337
6338 For each subprogram to be run, the compiler driver first tries the
6339 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
6340 was not specified, the driver tries two standard prefixes, which are
6341 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
6342 those results in a file name that is found, the unmodified program
6343 name is searched for using the directories specified in your
6344 @env{PATH} environment variable.
6345
6346 The compiler will check to see if the path provided by the @option{-B}
6347 refers to a directory, and if necessary it will add a directory
6348 separator character at the end of the path.
6349
6350 @option{-B} prefixes that effectively specify directory names also apply
6351 to libraries in the linker, because the compiler translates these
6352 options into @option{-L} options for the linker.  They also apply to
6353 includes files in the preprocessor, because the compiler translates these
6354 options into @option{-isystem} options for the preprocessor.  In this case,
6355 the compiler appends @samp{include} to the prefix.
6356
6357 The run-time support file @file{libgcc.a} can also be searched for using
6358 the @option{-B} prefix, if needed.  If it is not found there, the two
6359 standard prefixes above are tried, and that is all.  The file is left
6360 out of the link if it is not found by those means.
6361
6362 Another way to specify a prefix much like the @option{-B} prefix is to use
6363 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
6364 Variables}.
6365
6366 As a special kludge, if the path provided by @option{-B} is
6367 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
6368 9, then it will be replaced by @file{[dir/]include}.  This is to help
6369 with boot-strapping the compiler.
6370
6371 @item -specs=@var{file}
6372 @opindex specs
6373 Process @var{file} after the compiler reads in the standard @file{specs}
6374 file, in order to override the defaults that the @file{gcc} driver
6375 program uses when determining what switches to pass to @file{cc1},
6376 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
6377 @option{-specs=@var{file}} can be specified on the command line, and they
6378 are processed in order, from left to right.
6379
6380 @item --sysroot=@var{dir}
6381 @opindex sysroot
6382 Use @var{dir} as the logical root directory for headers and libraries.
6383 For example, if the compiler would normally search for headers in
6384 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
6385 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.  
6386
6387 If you use both this option and the @option{-isysroot} option, then
6388 the @option{--sysroot} option will apply to libraries, but the
6389 @option{-isysroot} option will apply to header files.
6390
6391 The GNU linker (beginning with version 2.16) has the necessary support
6392 for this option.  If your linker does not support this option, the
6393 header file aspect of @option{--sysroot} will still work, but the
6394 library aspect will not.
6395
6396 @item -I-
6397 @opindex I-
6398 This option has been deprecated.  Please use @option{-iquote} instead for
6399 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
6400 Any directories you specify with @option{-I} options before the @option{-I-}
6401 option are searched only for the case of @samp{#include "@var{file}"};
6402 they are not searched for @samp{#include <@var{file}>}.
6403
6404 If additional directories are specified with @option{-I} options after
6405 the @option{-I-}, these directories are searched for all @samp{#include}
6406 directives.  (Ordinarily @emph{all} @option{-I} directories are used
6407 this way.)
6408
6409 In addition, the @option{-I-} option inhibits the use of the current
6410 directory (where the current input file came from) as the first search
6411 directory for @samp{#include "@var{file}"}.  There is no way to
6412 override this effect of @option{-I-}.  With @option{-I.} you can specify
6413 searching the directory which was current when the compiler was
6414 invoked.  That is not exactly the same as what the preprocessor does
6415 by default, but it is often satisfactory.
6416
6417 @option{-I-} does not inhibit the use of the standard system directories
6418 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
6419 independent.
6420 @end table
6421
6422 @c man end
6423
6424 @node Spec Files
6425 @section Specifying subprocesses and the switches to pass to them
6426 @cindex Spec Files
6427
6428 @command{gcc} is a driver program.  It performs its job by invoking a
6429 sequence of other programs to do the work of compiling, assembling and
6430 linking.  GCC interprets its command-line parameters and uses these to
6431 deduce which programs it should invoke, and which command-line options
6432 it ought to place on their command lines.  This behavior is controlled
6433 by @dfn{spec strings}.  In most cases there is one spec string for each
6434 program that GCC can invoke, but a few programs have multiple spec
6435 strings to control their behavior.  The spec strings built into GCC can
6436 be overridden by using the @option{-specs=} command-line switch to specify
6437 a spec file.
6438
6439 @dfn{Spec files} are plaintext files that are used to construct spec
6440 strings.  They consist of a sequence of directives separated by blank
6441 lines.  The type of directive is determined by the first non-whitespace
6442 character on the line and it can be one of the following:
6443
6444 @table @code
6445 @item %@var{command}
6446 Issues a @var{command} to the spec file processor.  The commands that can
6447 appear here are:
6448
6449 @table @code
6450 @item %include <@var{file}>
6451 @cindex %include
6452 Search for @var{file} and insert its text at the current point in the
6453 specs file.
6454
6455 @item %include_noerr <@var{file}>
6456 @cindex %include_noerr
6457 Just like @samp{%include}, but do not generate an error message if the include
6458 file cannot be found.
6459
6460 @item %rename @var{old_name} @var{new_name}
6461 @cindex %rename
6462 Rename the spec string @var{old_name} to @var{new_name}.
6463
6464 @end table
6465
6466 @item *[@var{spec_name}]:
6467 This tells the compiler to create, override or delete the named spec
6468 string.  All lines after this directive up to the next directive or
6469 blank line are considered to be the text for the spec string.  If this
6470 results in an empty string then the spec will be deleted.  (Or, if the
6471 spec did not exist, then nothing will happened.)  Otherwise, if the spec
6472 does not currently exist a new spec will be created.  If the spec does
6473 exist then its contents will be overridden by the text of this
6474 directive, unless the first character of that text is the @samp{+}
6475 character, in which case the text will be appended to the spec.
6476
6477 @item [@var{suffix}]:
6478 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
6479 and up to the next directive or blank line are considered to make up the
6480 spec string for the indicated suffix.  When the compiler encounters an
6481 input file with the named suffix, it will processes the spec string in
6482 order to work out how to compile that file.  For example:
6483
6484 @smallexample
6485 .ZZ:
6486 z-compile -input %i
6487 @end smallexample
6488
6489 This says that any input file whose name ends in @samp{.ZZ} should be
6490 passed to the program @samp{z-compile}, which should be invoked with the
6491 command-line switch @option{-input} and with the result of performing the
6492 @samp{%i} substitution.  (See below.)
6493
6494 As an alternative to providing a spec string, the text that follows a
6495 suffix directive can be one of the following:
6496
6497 @table @code
6498 @item @@@var{language}
6499 This says that the suffix is an alias for a known @var{language}.  This is
6500 similar to using the @option{-x} command-line switch to GCC to specify a
6501 language explicitly.  For example:
6502
6503 @smallexample
6504 .ZZ:
6505 @@c++
6506 @end smallexample
6507
6508 Says that .ZZ files are, in fact, C++ source files.
6509
6510 @item #@var{name}
6511 This causes an error messages saying:
6512
6513 @smallexample
6514 @var{name} compiler not installed on this system.
6515 @end smallexample
6516 @end table
6517
6518 GCC already has an extensive list of suffixes built into it.
6519 This directive will add an entry to the end of the list of suffixes, but
6520 since the list is searched from the end backwards, it is effectively
6521 possible to override earlier entries using this technique.
6522
6523 @end table
6524
6525 GCC has the following spec strings built into it.  Spec files can
6526 override these strings or create their own.  Note that individual
6527 targets can also add their own spec strings to this list.
6528
6529 @smallexample
6530 asm          Options to pass to the assembler
6531 asm_final    Options to pass to the assembler post-processor
6532 cpp          Options to pass to the C preprocessor
6533 cc1          Options to pass to the C compiler
6534 cc1plus      Options to pass to the C++ compiler
6535 endfile      Object files to include at the end of the link
6536 link         Options to pass to the linker
6537 lib          Libraries to include on the command line to the linker
6538 libgcc       Decides which GCC support library to pass to the linker
6539 linker       Sets the name of the linker
6540 predefines   Defines to be passed to the C preprocessor
6541 signed_char  Defines to pass to CPP to say whether @code{char} is signed
6542              by default
6543 startfile    Object files to include at the start of the link
6544 @end smallexample
6545
6546 Here is a small example of a spec file:
6547
6548 @smallexample
6549 %rename lib                 old_lib
6550
6551 *lib:
6552 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
6553 @end smallexample
6554
6555 This example renames the spec called @samp{lib} to @samp{old_lib} and
6556 then overrides the previous definition of @samp{lib} with a new one.
6557 The new definition adds in some extra command-line options before
6558 including the text of the old definition.
6559
6560 @dfn{Spec strings} are a list of command-line options to be passed to their
6561 corresponding program.  In addition, the spec strings can contain
6562 @samp{%}-prefixed sequences to substitute variable text or to
6563 conditionally insert text into the command line.  Using these constructs
6564 it is possible to generate quite complex command lines.
6565
6566 Here is a table of all defined @samp{%}-sequences for spec
6567 strings.  Note that spaces are not generated automatically around the
6568 results of expanding these sequences.  Therefore you can concatenate them
6569 together or combine them with constant text in a single argument.
6570
6571 @table @code
6572 @item %%
6573 Substitute one @samp{%} into the program name or argument.
6574
6575 @item %i
6576 Substitute the name of the input file being processed.
6577
6578 @item %b
6579 Substitute the basename of the input file being processed.
6580 This is the substring up to (and not including) the last period
6581 and not including the directory.
6582
6583 @item %B
6584 This is the same as @samp{%b}, but include the file suffix (text after
6585 the last period).
6586
6587 @item %d
6588 Marks the argument containing or following the @samp{%d} as a
6589 temporary file name, so that that file will be deleted if GCC exits
6590 successfully.  Unlike @samp{%g}, this contributes no text to the
6591 argument.
6592
6593 @item %g@var{suffix}
6594 Substitute a file name that has suffix @var{suffix} and is chosen
6595 once per compilation, and mark the argument in the same way as
6596 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
6597 name is now chosen in a way that is hard to predict even when previously
6598 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
6599 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
6600 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
6601 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
6602 was simply substituted with a file name chosen once per compilation,
6603 without regard to any appended suffix (which was therefore treated
6604 just like ordinary text), making such attacks more likely to succeed.
6605
6606 @item %u@var{suffix}
6607 Like @samp{%g}, but generates a new temporary file name even if
6608 @samp{%u@var{suffix}} was already seen.
6609
6610 @item %U@var{suffix}
6611 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
6612 new one if there is no such last file name.  In the absence of any
6613 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
6614 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
6615 would involve the generation of two distinct file names, one
6616 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
6617 simply substituted with a file name chosen for the previous @samp{%u},
6618 without regard to any appended suffix.
6619
6620 @item %j@var{suffix}
6621 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
6622 writable, and if save-temps is off; otherwise, substitute the name
6623 of a temporary file, just like @samp{%u}.  This temporary file is not
6624 meant for communication between processes, but rather as a junk
6625 disposal mechanism.
6626
6627 @item %|@var{suffix}
6628 @itemx %m@var{suffix}
6629 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
6630 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
6631 all.  These are the two most common ways to instruct a program that it
6632 should read from standard input or write to standard output.  If you
6633 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
6634 construct: see for example @file{f/lang-specs.h}.
6635
6636 @item %.@var{SUFFIX}
6637 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
6638 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
6639 terminated by the next space or %.
6640
6641 @item %w
6642 Marks the argument containing or following the @samp{%w} as the
6643 designated output file of this compilation.  This puts the argument
6644 into the sequence of arguments that @samp{%o} will substitute later.
6645
6646 @item %o
6647 Substitutes the names of all the output files, with spaces
6648 automatically placed around them.  You should write spaces
6649 around the @samp{%o} as well or the results are undefined.
6650 @samp{%o} is for use in the specs for running the linker.
6651 Input files whose names have no recognized suffix are not compiled
6652 at all, but they are included among the output files, so they will
6653 be linked.
6654
6655 @item %O
6656 Substitutes the suffix for object files.  Note that this is
6657 handled specially when it immediately follows @samp{%g, %u, or %U},
6658 because of the need for those to form complete file names.  The
6659 handling is such that @samp{%O} is treated exactly as if it had already
6660 been substituted, except that @samp{%g, %u, and %U} do not currently
6661 support additional @var{suffix} characters following @samp{%O} as they would
6662 following, for example, @samp{.o}.
6663
6664 @item %p
6665 Substitutes the standard macro predefinitions for the
6666 current target machine.  Use this when running @code{cpp}.
6667
6668 @item %P
6669 Like @samp{%p}, but puts @samp{__} before and after the name of each
6670 predefined macro, except for macros that start with @samp{__} or with
6671 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
6672 C@.
6673
6674 @item %I
6675 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
6676 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}), and
6677 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
6678 as necessary.
6679
6680 @item %s
6681 Current argument is the name of a library or startup file of some sort.
6682 Search for that file in a standard list of directories and substitute
6683 the full name found.
6684
6685 @item %e@var{str}
6686 Print @var{str} as an error message.  @var{str} is terminated by a newline.
6687 Use this when inconsistent options are detected.
6688
6689 @item %(@var{name})
6690 Substitute the contents of spec string @var{name} at this point.
6691
6692 @item %[@var{name}]
6693 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
6694
6695 @item %x@{@var{option}@}
6696 Accumulate an option for @samp{%X}.
6697
6698 @item %X
6699 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
6700 spec string.
6701
6702 @item %Y
6703 Output the accumulated assembler options specified by @option{-Wa}.
6704
6705 @item %Z
6706 Output the accumulated preprocessor options specified by @option{-Wp}.
6707
6708 @item %a
6709 Process the @code{asm} spec.  This is used to compute the
6710 switches to be passed to the assembler.
6711
6712 @item %A
6713 Process the @code{asm_final} spec.  This is a spec string for
6714 passing switches to an assembler post-processor, if such a program is
6715 needed.
6716
6717 @item %l
6718 Process the @code{link} spec.  This is the spec for computing the
6719 command line passed to the linker.  Typically it will make use of the
6720 @samp{%L %G %S %D and %E} sequences.
6721
6722 @item %D
6723 Dump out a @option{-L} option for each directory that GCC believes might
6724 contain startup files.  If the target supports multilibs then the
6725 current multilib directory will be prepended to each of these paths.
6726
6727 @item %L
6728 Process the @code{lib} spec.  This is a spec string for deciding which
6729 libraries should be included on the command line to the linker.
6730
6731 @item %G
6732 Process the @code{libgcc} spec.  This is a spec string for deciding
6733 which GCC support library should be included on the command line to the linker.
6734
6735 @item %S
6736 Process the @code{startfile} spec.  This is a spec for deciding which
6737 object files should be the first ones passed to the linker.  Typically
6738 this might be a file named @file{crt0.o}.
6739
6740 @item %E
6741 Process the @code{endfile} spec.  This is a spec string that specifies
6742 the last object files that will be passed to the linker.
6743
6744 @item %C
6745 Process the @code{cpp} spec.  This is used to construct the arguments
6746 to be passed to the C preprocessor.
6747
6748 @item %1
6749 Process the @code{cc1} spec.  This is used to construct the options to be
6750 passed to the actual C compiler (@samp{cc1}).
6751
6752 @item %2
6753 Process the @code{cc1plus} spec.  This is used to construct the options to be
6754 passed to the actual C++ compiler (@samp{cc1plus}).
6755
6756 @item %*
6757 Substitute the variable part of a matched option.  See below.
6758 Note that each comma in the substituted string is replaced by
6759 a single space.
6760
6761 @item %<@code{S}
6762 Remove all occurrences of @code{-S} from the command line.  Note---this
6763 command is position dependent.  @samp{%} commands in the spec string
6764 before this one will see @code{-S}, @samp{%} commands in the spec string
6765 after this one will not.
6766
6767 @item %:@var{function}(@var{args})
6768 Call the named function @var{function}, passing it @var{args}.
6769 @var{args} is first processed as a nested spec string, then split
6770 into an argument vector in the usual fashion.  The function returns
6771 a string which is processed as if it had appeared literally as part
6772 of the current spec.
6773
6774 The following built-in spec functions are provided:
6775
6776 @table @code
6777 @item @code{if-exists}
6778 The @code{if-exists} spec function takes one argument, an absolute
6779 pathname to a file.  If the file exists, @code{if-exists} returns the
6780 pathname.  Here is a small example of its usage:
6781
6782 @smallexample
6783 *startfile:
6784 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
6785 @end smallexample
6786
6787 @item @code{if-exists-else}
6788 The @code{if-exists-else} spec function is similar to the @code{if-exists}
6789 spec function, except that it takes two arguments.  The first argument is
6790 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
6791 returns the pathname.  If it does not exist, it returns the second argument.
6792 This way, @code{if-exists-else} can be used to select one file or another,
6793 based on the existence of the first.  Here is a small example of its usage:
6794
6795 @smallexample
6796 *startfile:
6797 crt0%O%s %:if-exists(crti%O%s) \
6798 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
6799 @end smallexample
6800
6801 @item @code{replace-outfile}
6802 The @code{replace-outfile} spec function takes two arguments.  It looks for the
6803 first argument in the outfiles array and replaces it with the second argument.  Here
6804 is a small example of its usage:
6805
6806 @smallexample
6807 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
6808 @end smallexample
6809
6810 @end table
6811
6812 @item %@{@code{S}@}
6813 Substitutes the @code{-S} switch, if that switch was given to GCC@.
6814 If that switch was not specified, this substitutes nothing.  Note that
6815 the leading dash is omitted when specifying this option, and it is
6816 automatically inserted if the substitution is performed.  Thus the spec
6817 string @samp{%@{foo@}} would match the command-line option @option{-foo}
6818 and would output the command line option @option{-foo}.
6819
6820 @item %W@{@code{S}@}
6821 Like %@{@code{S}@} but mark last argument supplied within as a file to be
6822 deleted on failure.
6823
6824 @item %@{@code{S}*@}
6825 Substitutes all the switches specified to GCC whose names start
6826 with @code{-S}, but which also take an argument.  This is used for
6827 switches like @option{-o}, @option{-D}, @option{-I}, etc.
6828 GCC considers @option{-o foo} as being
6829 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
6830 text, including the space.  Thus two arguments would be generated.
6831
6832 @item %@{@code{S}*&@code{T}*@}
6833 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
6834 (the order of @code{S} and @code{T} in the spec is not significant).
6835 There can be any number of ampersand-separated variables; for each the
6836 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
6837
6838 @item %@{@code{S}:@code{X}@}
6839 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
6840
6841 @item %@{!@code{S}:@code{X}@}
6842 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
6843
6844 @item %@{@code{S}*:@code{X}@}
6845 Substitutes @code{X} if one or more switches whose names start with
6846 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
6847 once, no matter how many such switches appeared.  However, if @code{%*}
6848 appears somewhere in @code{X}, then @code{X} will be substituted once
6849 for each matching switch, with the @code{%*} replaced by the part of
6850 that switch that matched the @code{*}.
6851
6852 @item %@{.@code{S}:@code{X}@}
6853 Substitutes @code{X}, if processing a file with suffix @code{S}.
6854
6855 @item %@{!.@code{S}:@code{X}@}
6856 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
6857
6858 @item %@{@code{S}|@code{P}:@code{X}@}
6859 Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@.
6860 This may be combined with @samp{!}, @samp{.}, and @code{*} sequences as well,
6861 although they have a stronger binding than the @samp{|}.  If @code{%*}
6862 appears in @code{X}, all of the alternatives must be starred, and only
6863 the first matching alternative is substituted.
6864
6865 For example, a spec string like this:
6866
6867 @smallexample
6868 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
6869 @end smallexample
6870
6871 will output the following command-line options from the following input
6872 command-line options:
6873
6874 @smallexample
6875 fred.c        -foo -baz
6876 jim.d         -bar -boggle
6877 -d fred.c     -foo -baz -boggle
6878 -d jim.d      -bar -baz -boggle
6879 @end smallexample
6880
6881 @item %@{S:X; T:Y; :D@}
6882
6883 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
6884 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
6885 be as many clauses as you need.  This may be combined with @code{.},
6886 @code{!}, @code{|}, and @code{*} as needed.
6887
6888
6889 @end table
6890
6891 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
6892 construct may contain other nested @samp{%} constructs or spaces, or
6893 even newlines.  They are processed as usual, as described above.
6894 Trailing white space in @code{X} is ignored.  White space may also
6895 appear anywhere on the left side of the colon in these constructs,
6896 except between @code{.} or @code{*} and the corresponding word.
6897
6898 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
6899 handled specifically in these constructs.  If another value of
6900 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
6901 @option{-W} switch is found later in the command line, the earlier
6902 switch value is ignored, except with @{@code{S}*@} where @code{S} is
6903 just one letter, which passes all matching options.
6904
6905 The character @samp{|} at the beginning of the predicate text is used to
6906 indicate that a command should be piped to the following command, but
6907 only if @option{-pipe} is specified.
6908
6909 It is built into GCC which switches take arguments and which do not.
6910 (You might think it would be useful to generalize this to allow each
6911 compiler's spec to say which switches take arguments.  But this cannot
6912 be done in a consistent fashion.  GCC cannot even decide which input
6913 files have been specified without knowing which switches take arguments,
6914 and it must know which input files to compile in order to tell which
6915 compilers to run).
6916
6917 GCC also knows implicitly that arguments starting in @option{-l} are to be
6918 treated as compiler output files, and passed to the linker in their
6919 proper position among the other output files.
6920
6921 @c man begin OPTIONS
6922
6923 @node Target Options
6924 @section Specifying Target Machine and Compiler Version
6925 @cindex target options
6926 @cindex cross compiling
6927 @cindex specifying machine version
6928 @cindex specifying compiler version and target machine
6929 @cindex compiler version, specifying
6930 @cindex target machine, specifying
6931
6932 The usual way to run GCC is to run the executable called @file{gcc}, or
6933 @file{<machine>-gcc} when cross-compiling, or
6934 @file{<machine>-gcc-<version>} to run a version other than the one that
6935 was installed last.  Sometimes this is inconvenient, so GCC provides
6936 options that will switch to another cross-compiler or version.
6937
6938 @table @gcctabopt
6939 @item -b @var{machine}
6940 @opindex b
6941 The argument @var{machine} specifies the target machine for compilation.
6942
6943 The value to use for @var{machine} is the same as was specified as the
6944 machine type when configuring GCC as a cross-compiler.  For
6945 example, if a cross-compiler was configured with @samp{configure
6946 i386v}, meaning to compile for an 80386 running System V, then you
6947 would specify @option{-b i386v} to run that cross compiler.
6948
6949 @item -V @var{version}
6950 @opindex V
6951 The argument @var{version} specifies which version of GCC to run.
6952 This is useful when multiple versions are installed.  For example,
6953 @var{version} might be @samp{2.0}, meaning to run GCC version 2.0.
6954 @end table
6955
6956 The @option{-V} and @option{-b} options work by running the
6957 @file{<machine>-gcc-<version>} executable, so there's no real reason to
6958 use them if you can just run that directly.
6959
6960 @node Submodel Options
6961 @section Hardware Models and Configurations
6962 @cindex submodel options
6963 @cindex specifying hardware config
6964 @cindex hardware models and configurations, specifying
6965 @cindex machine dependent options
6966
6967 Earlier we discussed the standard option @option{-b} which chooses among
6968 different installed compilers for completely different target
6969 machines, such as VAX vs.@: 68000 vs.@: 80386.
6970
6971 In addition, each of these target machine types can have its own
6972 special options, starting with @samp{-m}, to choose among various
6973 hardware models or configurations---for example, 68010 vs 68020,
6974 floating coprocessor or none.  A single installed version of the
6975 compiler can compile for any model or configuration, according to the
6976 options specified.
6977
6978 Some configurations of the compiler also support additional special
6979 options, usually for compatibility with other compilers on the same
6980 platform.
6981
6982 @c This list is ordered alphanumerically by subsection name.
6983 @c It should be the same order and spelling as these options are listed
6984 @c in Machine Dependent Options
6985
6986 @menu
6987 * ARC Options::
6988 * ARM Options::
6989 * AVR Options::
6990 * Blackfin Options::
6991 * CRIS Options::
6992 * CRX Options::
6993 * Darwin Options::
6994 * DEC Alpha Options::
6995 * DEC Alpha/VMS Options::
6996 * FRV Options::
6997 * H8/300 Options::
6998 * HPPA Options::
6999 * i386 and x86-64 Options::
7000 * IA-64 Options::
7001 * M32C Options::
7002 * M32R/D Options::
7003 * M680x0 Options::
7004 * M68hc1x Options::
7005 * MCore Options::
7006 * MIPS Options::
7007 * MMIX Options::
7008 * MN10300 Options::
7009 * PDP-11 Options::
7010 * PowerPC Options::
7011 * RS/6000 and PowerPC Options::
7012 * S/390 and zSeries Options::
7013 * SH Options::
7014 * SPARC Options::
7015 * System V Options::
7016 * TMS320C3x/C4x Options::
7017 * V850 Options::
7018 * VAX Options::
7019 * x86-64 Options::
7020 * Xstormy16 Options::
7021 * Xtensa Options::
7022 * zSeries Options::
7023 @end menu
7024
7025 @node ARC Options
7026 @subsection ARC Options
7027 @cindex ARC Options
7028
7029 These options are defined for ARC implementations:
7030
7031 @table @gcctabopt
7032 @item -EL
7033 @opindex EL
7034 Compile code for little endian mode.  This is the default.
7035
7036 @item -EB
7037 @opindex EB
7038 Compile code for big endian mode.
7039
7040 @item -mmangle-cpu
7041 @opindex mmangle-cpu
7042 Prepend the name of the cpu to all public symbol names.
7043 In multiple-processor systems, there are many ARC variants with different
7044 instruction and register set characteristics.  This flag prevents code
7045 compiled for one cpu to be linked with code compiled for another.
7046 No facility exists for handling variants that are ``almost identical''.
7047 This is an all or nothing option.
7048
7049 @item -mcpu=@var{cpu}
7050 @opindex mcpu
7051 Compile code for ARC variant @var{cpu}.
7052 Which variants are supported depend on the configuration.
7053 All variants support @option{-mcpu=base}, this is the default.
7054
7055 @item -mtext=@var{text-section}
7056 @itemx -mdata=@var{data-section}
7057 @itemx -mrodata=@var{readonly-data-section}
7058 @opindex mtext
7059 @opindex mdata
7060 @opindex mrodata
7061 Put functions, data, and readonly data in @var{text-section},
7062 @var{data-section}, and @var{readonly-data-section} respectively
7063 by default.  This can be overridden with the @code{section} attribute.
7064 @xref{Variable Attributes}.
7065
7066 @end table
7067
7068 @node ARM Options
7069 @subsection ARM Options
7070 @cindex ARM options
7071
7072 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7073 architectures:
7074
7075 @table @gcctabopt
7076 @item -mabi=@var{name}
7077 @opindex mabi
7078 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7079 @samp{atpcs}, @samp{aapcs} and @samp{iwmmxt}.
7080
7081 @item -mapcs-frame
7082 @opindex mapcs-frame
7083 Generate a stack frame that is compliant with the ARM Procedure Call
7084 Standard for all functions, even if this is not strictly necessary for
7085 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7086 with this option will cause the stack frames not to be generated for
7087 leaf functions.  The default is @option{-mno-apcs-frame}.
7088
7089 @item -mapcs
7090 @opindex mapcs
7091 This is a synonym for @option{-mapcs-frame}.
7092
7093 @ignore
7094 @c not currently implemented
7095 @item -mapcs-stack-check
7096 @opindex mapcs-stack-check
7097 Generate code to check the amount of stack space available upon entry to
7098 every function (that actually uses some stack space).  If there is
7099 insufficient space available then either the function
7100 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7101 called, depending upon the amount of stack space required.  The run time
7102 system is required to provide these functions.  The default is
7103 @option{-mno-apcs-stack-check}, since this produces smaller code.
7104
7105 @c not currently implemented
7106 @item -mapcs-float
7107 @opindex mapcs-float
7108 Pass floating point arguments using the float point registers.  This is
7109 one of the variants of the APCS@.  This option is recommended if the
7110 target hardware has a floating point unit or if a lot of floating point
7111 arithmetic is going to be performed by the code.  The default is
7112 @option{-mno-apcs-float}, since integer only code is slightly increased in
7113 size if @option{-mapcs-float} is used.
7114
7115 @c not currently implemented
7116 @item -mapcs-reentrant
7117 @opindex mapcs-reentrant
7118 Generate reentrant, position independent code.  The default is
7119 @option{-mno-apcs-reentrant}.
7120 @end ignore
7121
7122 @item -mthumb-interwork
7123 @opindex mthumb-interwork
7124 Generate code which supports calling between the ARM and Thumb
7125 instruction sets.  Without this option the two instruction sets cannot
7126 be reliably used inside one program.  The default is
7127 @option{-mno-thumb-interwork}, since slightly larger code is generated
7128 when @option{-mthumb-interwork} is specified.
7129
7130 @item -mno-sched-prolog
7131 @opindex mno-sched-prolog
7132 Prevent the reordering of instructions in the function prolog, or the
7133 merging of those instruction with the instructions in the function's
7134 body.  This means that all functions will start with a recognizable set
7135 of instructions (or in fact one of a choice from a small set of
7136 different function prologues), and this information can be used to
7137 locate the start if functions inside an executable piece of code.  The
7138 default is @option{-msched-prolog}.
7139
7140 @item -mhard-float
7141 @opindex mhard-float
7142 Generate output containing floating point instructions.  This is the
7143 default.
7144
7145 @item -msoft-float
7146 @opindex msoft-float
7147 Generate output containing library calls for floating point.
7148 @strong{Warning:} the requisite libraries are not available for all ARM
7149 targets.  Normally the facilities of the machine's usual C compiler are
7150 used, but this cannot be done directly in cross-compilation.  You must make
7151 your own arrangements to provide suitable library functions for
7152 cross-compilation.
7153
7154 @option{-msoft-float} changes the calling convention in the output file;
7155 therefore, it is only useful if you compile @emph{all} of a program with
7156 this option.  In particular, you need to compile @file{libgcc.a}, the
7157 library that comes with GCC, with @option{-msoft-float} in order for
7158 this to work.
7159
7160 @item -mfloat-abi=@var{name}
7161 @opindex mfloat-abi
7162 Specifies which ABI to use for floating point values.  Permissible values
7163 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7164
7165 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7166 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7167 of floating point instructions, but still uses the soft-float calling
7168 conventions.
7169
7170 @item -mlittle-endian
7171 @opindex mlittle-endian
7172 Generate code for a processor running in little-endian mode.  This is
7173 the default for all standard configurations.
7174
7175 @item -mbig-endian
7176 @opindex mbig-endian
7177 Generate code for a processor running in big-endian mode; the default is
7178 to compile code for a little-endian processor.
7179
7180 @item -mwords-little-endian
7181 @opindex mwords-little-endian
7182 This option only applies when generating code for big-endian processors.
7183 Generate code for a little-endian word order but a big-endian byte
7184 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7185 option should only be used if you require compatibility with code for
7186 big-endian ARM processors generated by versions of the compiler prior to
7187 2.8.
7188
7189 @item -mcpu=@var{name}
7190 @opindex mcpu
7191 This specifies the name of the target ARM processor.  GCC uses this name
7192 to determine what kind of instructions it can emit when generating
7193 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7194 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7195 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7196 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7197 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7198 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7199 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7200 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7201 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7202 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7203 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7204 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7205 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7206 @samp{arm1176jz-s}, @samp{arm1176jzf-s}, @samp{xscale}, @samp{iwmmxt},
7207 @samp{ep9312}.
7208
7209 @itemx -mtune=@var{name}
7210 @opindex mtune
7211 This option is very similar to the @option{-mcpu=} option, except that
7212 instead of specifying the actual target processor type, and hence
7213 restricting which instructions can be used, it specifies that GCC should
7214 tune the performance of the code as if the target were of the type
7215 specified in this option, but still choosing the instructions that it
7216 will generate based on the cpu specified by a @option{-mcpu=} option.
7217 For some ARM implementations better performance can be obtained by using
7218 this option.
7219
7220 @item -march=@var{name}
7221 @opindex march
7222 This specifies the name of the target ARM architecture.  GCC uses this
7223 name to determine what kind of instructions it can emit when generating
7224 assembly code.  This option can be used in conjunction with or instead
7225 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
7226 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
7227 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
7228 @samp{iwmmxt}, @samp{ep9312}.
7229
7230 @item -mfpu=@var{name}
7231 @itemx -mfpe=@var{number}
7232 @itemx -mfp=@var{number}
7233 @opindex mfpu
7234 @opindex mfpe
7235 @opindex mfp
7236 This specifies what floating point hardware (or hardware emulation) is
7237 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
7238 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
7239 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
7240 with older versions of GCC@.
7241
7242 If @option{-msoft-float} is specified this specifies the format of
7243 floating point values.
7244
7245 @item -mstructure-size-boundary=@var{n}
7246 @opindex mstructure-size-boundary
7247 The size of all structures and unions will be rounded up to a multiple
7248 of the number of bits set by this option.  Permissible values are 8, 32
7249 and 64.  The default value varies for different toolchains.  For the COFF
7250 targeted toolchain the default value is 8.  A value of 64 is only allowed
7251 if the underlying ABI supports it.
7252
7253 Specifying the larger number can produce faster, more efficient code, but
7254 can also increase the size of the program.  Different values are potentially
7255 incompatible.  Code compiled with one value cannot necessarily expect to
7256 work with code or libraries compiled with another value, if they exchange
7257 information using structures or unions.
7258
7259 @item -mabort-on-noreturn
7260 @opindex mabort-on-noreturn
7261 Generate a call to the function @code{abort} at the end of a
7262 @code{noreturn} function.  It will be executed if the function tries to
7263 return.
7264
7265 @item -mlong-calls
7266 @itemx -mno-long-calls
7267 @opindex mlong-calls
7268 @opindex mno-long-calls
7269 Tells the compiler to perform function calls by first loading the
7270 address of the function into a register and then performing a subroutine
7271 call on this register.  This switch is needed if the target function
7272 will lie outside of the 64 megabyte addressing range of the offset based
7273 version of subroutine call instruction.
7274
7275 Even if this switch is enabled, not all function calls will be turned
7276 into long calls.  The heuristic is that static functions, functions
7277 which have the @samp{short-call} attribute, functions that are inside
7278 the scope of a @samp{#pragma no_long_calls} directive and functions whose
7279 definitions have already been compiled within the current compilation
7280 unit, will not be turned into long calls.  The exception to this rule is
7281 that weak function definitions, functions with the @samp{long-call}
7282 attribute or the @samp{section} attribute, and functions that are within
7283 the scope of a @samp{#pragma long_calls} directive, will always be
7284 turned into long calls.
7285
7286 This feature is not enabled by default.  Specifying
7287 @option{-mno-long-calls} will restore the default behavior, as will
7288 placing the function calls within the scope of a @samp{#pragma
7289 long_calls_off} directive.  Note these switches have no effect on how
7290 the compiler generates code to handle function calls via function
7291 pointers.
7292
7293 @item -mnop-fun-dllimport
7294 @opindex mnop-fun-dllimport
7295 Disable support for the @code{dllimport} attribute.
7296
7297 @item -msingle-pic-base
7298 @opindex msingle-pic-base
7299 Treat the register used for PIC addressing as read-only, rather than
7300 loading it in the prologue for each function.  The run-time system is
7301 responsible for initializing this register with an appropriate value
7302 before execution begins.
7303
7304 @item -mpic-register=@var{reg}
7305 @opindex mpic-register
7306 Specify the register to be used for PIC addressing.  The default is R10
7307 unless stack-checking is enabled, when R9 is used.
7308
7309 @item -mcirrus-fix-invalid-insns
7310 @opindex mcirrus-fix-invalid-insns
7311 @opindex mno-cirrus-fix-invalid-insns
7312 Insert NOPs into the instruction stream to in order to work around
7313 problems with invalid Maverick instruction combinations.  This option
7314 is only valid if the @option{-mcpu=ep9312} option has been used to
7315 enable generation of instructions for the Cirrus Maverick floating
7316 point co-processor.  This option is not enabled by default, since the
7317 problem is only present in older Maverick implementations.  The default
7318 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
7319 switch.
7320
7321 @item -mpoke-function-name
7322 @opindex mpoke-function-name
7323 Write the name of each function into the text section, directly
7324 preceding the function prologue.  The generated code is similar to this:
7325
7326 @smallexample
7327      t0
7328          .ascii "arm_poke_function_name", 0
7329          .align
7330      t1
7331          .word 0xff000000 + (t1 - t0)
7332      arm_poke_function_name
7333          mov     ip, sp
7334          stmfd   sp!, @{fp, ip, lr, pc@}
7335          sub     fp, ip, #4
7336 @end smallexample
7337
7338 When performing a stack backtrace, code can inspect the value of
7339 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
7340 location @code{pc - 12} and the top 8 bits are set, then we know that
7341 there is a function name embedded immediately preceding this location
7342 and has length @code{((pc[-3]) & 0xff000000)}.
7343
7344 @item -mthumb
7345 @opindex mthumb
7346 Generate code for the 16-bit Thumb instruction set.  The default is to
7347 use the 32-bit ARM instruction set.
7348
7349 @item -mtpcs-frame
7350 @opindex mtpcs-frame
7351 Generate a stack frame that is compliant with the Thumb Procedure Call
7352 Standard for all non-leaf functions.  (A leaf function is one that does
7353 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
7354
7355 @item -mtpcs-leaf-frame
7356 @opindex mtpcs-leaf-frame
7357 Generate a stack frame that is compliant with the Thumb Procedure Call
7358 Standard for all leaf functions.  (A leaf function is one that does
7359 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
7360
7361 @item -mcallee-super-interworking
7362 @opindex mcallee-super-interworking
7363 Gives all externally visible functions in the file being compiled an ARM
7364 instruction set header which switches to Thumb mode before executing the
7365 rest of the function.  This allows these functions to be called from
7366 non-interworking code.
7367
7368 @item -mcaller-super-interworking
7369 @opindex mcaller-super-interworking
7370 Allows calls via function pointers (including virtual functions) to
7371 execute correctly regardless of whether the target code has been
7372 compiled for interworking or not.  There is a small overhead in the cost
7373 of executing a function pointer if this option is enabled.
7374
7375 @end table
7376
7377 @node AVR Options
7378 @subsection AVR Options
7379 @cindex AVR Options
7380
7381 These options are defined for AVR implementations:
7382
7383 @table @gcctabopt
7384 @item -mmcu=@var{mcu}
7385 @opindex mmcu
7386 Specify ATMEL AVR instruction set or MCU type.
7387
7388 Instruction set avr1 is for the minimal AVR core, not supported by the C
7389 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
7390 attiny11, attiny12, attiny15, attiny28).
7391
7392 Instruction set avr2 (default) is for the classic AVR core with up to
7393 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
7394 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
7395 at90c8534, at90s8535).
7396
7397 Instruction set avr3 is for the classic AVR core with up to 128K program
7398 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
7399
7400 Instruction set avr4 is for the enhanced AVR core with up to 8K program
7401 memory space (MCU types: atmega8, atmega83, atmega85).
7402
7403 Instruction set avr5 is for the enhanced AVR core with up to 128K program
7404 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
7405 atmega64, atmega128, at43usb355, at94k).
7406
7407 @item -msize
7408 @opindex msize
7409 Output instruction sizes to the asm file.
7410
7411 @item -minit-stack=@var{N}
7412 @opindex minit-stack
7413 Specify the initial stack address, which may be a symbol or numeric value,
7414 @samp{__stack} is the default.
7415
7416 @item -mno-interrupts
7417 @opindex mno-interrupts
7418 Generated code is not compatible with hardware interrupts.
7419 Code size will be smaller.
7420
7421 @item -mcall-prologues
7422 @opindex mcall-prologues
7423 Functions prologues/epilogues expanded as call to appropriate
7424 subroutines.  Code size will be smaller.
7425
7426 @item -mno-tablejump
7427 @opindex mno-tablejump
7428 Do not generate tablejump insns which sometimes increase code size.
7429
7430 @item -mtiny-stack
7431 @opindex mtiny-stack
7432 Change only the low 8 bits of the stack pointer.
7433
7434 @item -mint8
7435 @opindex mint8
7436 Assume int to be 8 bit integer.  This affects the sizes of all types: A
7437 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
7438 and long long will be 4 bytes.  Please note that this option does not
7439 comply to the C standards, but it will provide you with smaller code
7440 size.
7441 @end table
7442
7443 @node Blackfin Options
7444 @subsection Blackfin Options
7445 @cindex Blackfin Options
7446
7447 @table @gcctabopt
7448 @item -momit-leaf-frame-pointer
7449 @opindex momit-leaf-frame-pointer
7450 Don't keep the frame pointer in a register for leaf functions.  This
7451 avoids the instructions to save, set up and restore frame pointers and
7452 makes an extra register available in leaf functions.  The option
7453 @option{-fomit-frame-pointer} removes the frame pointer for all functions
7454 which might make debugging harder.
7455
7456 @item -mspecld-anomaly
7457 @opindex mspecld-anomaly
7458 When enabled, the compiler will ensure that the generated code does not
7459 contain speculative loads after jump instructions.  This option is enabled
7460 by default.
7461
7462 @item -mno-specld-anomaly
7463 @opindex mno-specld-anomaly
7464 Don't generate extra code to prevent speculative loads from occurring.
7465
7466 @item -mcsync-anomaly
7467 @opindex mcsync-anomaly
7468 When enabled, the compiler will ensure that the generated code does not
7469 contain CSYNC or SSYNC instructions too soon after conditional branches.
7470 This option is enabled by default.
7471
7472 @item -mno-csync-anomaly
7473 @opindex mno-csync-anomaly
7474 Don't generate extra code to prevent CSYNC or SSYNC instructions from
7475 occurring too soon after a conditional branch.
7476
7477 @item -mlow-64k
7478 @opindex mlow-64k
7479 When enabled, the compiler is free to take advantage of the knowledge that
7480 the entire program fits into the low 64k of memory.
7481
7482 @item -mno-low-64k
7483 @opindex mno-low-64k
7484 Assume that the program is arbitrarily large.  This is the default.
7485
7486 @item -mid-shared-library
7487 @opindex mid-shared-library
7488 Generate code that supports shared libraries via the library ID method.
7489 This allows for execute in place and shared libraries in an environment
7490 without virtual memory management.  This option implies @option{-fPIC}.
7491
7492 @item -mno-id-shared-library
7493 @opindex mno-id-shared-library
7494 Generate code that doesn't assume ID based shared libraries are being used.
7495 This is the default.
7496
7497 @item -mshared-library-id=n
7498 @opindex mshared-library-id
7499 Specified the identification number of the ID based shared library being
7500 compiled.  Specifying a value of 0 will generate more compact code, specifying
7501 other values will force the allocation of that number to the current
7502 library but is no more space or time efficient than omitting this option.
7503
7504 @item -mlong-calls
7505 @itemx -mno-long-calls
7506 @opindex mlong-calls
7507 @opindex mno-long-calls
7508 Tells the compiler to perform function calls by first loading the
7509 address of the function into a register and then performing a subroutine
7510 call on this register.  This switch is needed if the target function
7511 will lie outside of the 24 bit addressing range of the offset based
7512 version of subroutine call instruction.
7513
7514 This feature is not enabled by default.  Specifying
7515 @option{-mno-long-calls} will restore the default behavior.  Note these
7516 switches have no effect on how the compiler generates code to handle
7517 function calls via function pointers.
7518 @end table
7519
7520 @node CRIS Options
7521 @subsection CRIS Options
7522 @cindex CRIS Options
7523
7524 These options are defined specifically for the CRIS ports.
7525
7526 @table @gcctabopt
7527 @item -march=@var{architecture-type}
7528 @itemx -mcpu=@var{architecture-type}
7529 @opindex march
7530 @opindex mcpu
7531 Generate code for the specified architecture.  The choices for
7532 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
7533 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
7534 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
7535 @samp{v10}.
7536
7537 @item -mtune=@var{architecture-type}
7538 @opindex mtune
7539 Tune to @var{architecture-type} everything applicable about the generated
7540 code, except for the ABI and the set of available instructions.  The
7541 choices for @var{architecture-type} are the same as for
7542 @option{-march=@var{architecture-type}}.
7543
7544 @item -mmax-stack-frame=@var{n}
7545 @opindex mmax-stack-frame
7546 Warn when the stack frame of a function exceeds @var{n} bytes.
7547
7548 @item -melinux-stacksize=@var{n}
7549 @opindex melinux-stacksize
7550 Only available with the @samp{cris-axis-aout} target.  Arranges for
7551 indications in the program to the kernel loader that the stack of the
7552 program should be set to @var{n} bytes.
7553
7554 @item -metrax4
7555 @itemx -metrax100
7556 @opindex metrax4
7557 @opindex metrax100
7558 The options @option{-metrax4} and @option{-metrax100} are synonyms for
7559 @option{-march=v3} and @option{-march=v8} respectively.
7560
7561 @item -mmul-bug-workaround
7562 @itemx -mno-mul-bug-workaround
7563 @opindex mmul-bug-workaround
7564 @opindex mno-mul-bug-workaround
7565 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
7566 models where it applies.  This option is active by default.
7567
7568 @item -mpdebug
7569 @opindex mpdebug
7570 Enable CRIS-specific verbose debug-related information in the assembly
7571 code.  This option also has the effect to turn off the @samp{#NO_APP}
7572 formatted-code indicator to the assembler at the beginning of the
7573 assembly file.
7574
7575 @item -mcc-init
7576 @opindex mcc-init
7577 Do not use condition-code results from previous instruction; always emit
7578 compare and test instructions before use of condition codes.
7579
7580 @item -mno-side-effects
7581 @opindex mno-side-effects
7582 Do not emit instructions with side-effects in addressing modes other than
7583 post-increment.
7584
7585 @item -mstack-align
7586 @itemx -mno-stack-align
7587 @itemx -mdata-align
7588 @itemx -mno-data-align
7589 @itemx -mconst-align
7590 @itemx -mno-const-align
7591 @opindex mstack-align
7592 @opindex mno-stack-align
7593 @opindex mdata-align
7594 @opindex mno-data-align
7595 @opindex mconst-align
7596 @opindex mno-const-align
7597 These options (no-options) arranges (eliminate arrangements) for the
7598 stack-frame, individual data and constants to be aligned for the maximum
7599 single data access size for the chosen CPU model.  The default is to
7600 arrange for 32-bit alignment.  ABI details such as structure layout are
7601 not affected by these options.
7602
7603 @item -m32-bit
7604 @itemx -m16-bit
7605 @itemx -m8-bit
7606 @opindex m32-bit
7607 @opindex m16-bit
7608 @opindex m8-bit
7609 Similar to the stack- data- and const-align options above, these options
7610 arrange for stack-frame, writable data and constants to all be 32-bit,
7611 16-bit or 8-bit aligned.  The default is 32-bit alignment.
7612
7613 @item -mno-prologue-epilogue
7614 @itemx -mprologue-epilogue
7615 @opindex mno-prologue-epilogue
7616 @opindex mprologue-epilogue
7617 With @option{-mno-prologue-epilogue}, the normal function prologue and
7618 epilogue that sets up the stack-frame are omitted and no return
7619 instructions or return sequences are generated in the code.  Use this
7620 option only together with visual inspection of the compiled code: no
7621 warnings or errors are generated when call-saved registers must be saved,
7622 or storage for local variable needs to be allocated.
7623
7624 @item -mno-gotplt
7625 @itemx -mgotplt
7626 @opindex mno-gotplt
7627 @opindex mgotplt
7628 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
7629 instruction sequences that load addresses for functions from the PLT part
7630 of the GOT rather than (traditional on other architectures) calls to the
7631 PLT@.  The default is @option{-mgotplt}.
7632
7633 @item -maout
7634 @opindex maout
7635 Legacy no-op option only recognized with the cris-axis-aout target.
7636
7637 @item -melf
7638 @opindex melf
7639 Legacy no-op option only recognized with the cris-axis-elf and
7640 cris-axis-linux-gnu targets.
7641
7642 @item -melinux
7643 @opindex melinux
7644 Only recognized with the cris-axis-aout target, where it selects a
7645 GNU/linux-like multilib, include files and instruction set for
7646 @option{-march=v8}.
7647
7648 @item -mlinux
7649 @opindex mlinux
7650 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
7651
7652 @item -sim
7653 @opindex sim
7654 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
7655 to link with input-output functions from a simulator library.  Code,
7656 initialized data and zero-initialized data are allocated consecutively.
7657
7658 @item -sim2
7659 @opindex sim2
7660 Like @option{-sim}, but pass linker options to locate initialized data at
7661 0x40000000 and zero-initialized data at 0x80000000.
7662 @end table
7663
7664 @node CRX Options
7665 @subsection CRX Options
7666 @cindex CRX Options
7667
7668 These options are defined specifically for the CRX ports.
7669
7670 @table @gcctabopt
7671
7672 @item -mmac
7673 @opindex mmac
7674 Enable the use of multiply-accumulate instructions. Disabled by default.
7675
7676 @item -mpush-args
7677 @opindex mpush-args
7678 Push instructions will be used to pass outgoing arguments when functions
7679 are called. Enabled by default.
7680 @end table
7681
7682 @node Darwin Options
7683 @subsection Darwin Options
7684 @cindex Darwin options
7685
7686 These options are defined for all architectures running the Darwin operating
7687 system.
7688
7689 FSF GCC on Darwin does not create ``fat'' object files; it will create
7690 an object file for the single architecture that it was built to
7691 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
7692 @option{-arch} options are used; it does so by running the compiler or
7693 linker multiple times and joining the results together with
7694 @file{lipo}.
7695
7696 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
7697 @samp{i686}) is determined by the flags that specify the ISA
7698 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
7699 @option{-force_cpusubtype_ALL} option can be used to override this.
7700
7701 The Darwin tools vary in their behavior when presented with an ISA
7702 mismatch.  The assembler, @file{as}, will only permit instructions to
7703 be used that are valid for the subtype of the file it is generating,
7704 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
7705 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
7706 and print an error if asked to create a shared library with a less
7707 restrictive subtype than its input files (for instance, trying to put
7708 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
7709 for executables, @file{ld}, will quietly give the executable the most
7710 restrictive subtype of any of its input files.
7711
7712 @table @gcctabopt
7713 @item -F@var{dir}
7714 @opindex F
7715 Add the framework directory @var{dir} to the head of the list of
7716 directories to be searched for header files.  These directories are
7717 interleaved with those specified by @option{-I} options and are
7718 scanned in a left-to-right order.
7719
7720 A framework directory is a directory with frameworks in it.  A
7721 framework is a directory with a @samp{"Headers"} and/or
7722 @samp{"PrivateHeaders"} directory contained directly in it that ends
7723 in @samp{".framework"}.  The name of a framework is the name of this
7724 directory excluding the @samp{".framework"}.  Headers associated with
7725 the framework are found in one of those two directories, with
7726 @samp{"Headers"} being searched first.  A subframework is a framework
7727 directory that is in a framework's @samp{"Frameworks"} directory.
7728 Includes of subframework headers can only appear in a header of a
7729 framework that contains the subframework, or in a sibling subframework
7730 header.  Two subframeworks are siblings if they occur in the same
7731 framework.  A subframework should not have the same name as a
7732 framework, a warning will be issued if this is violated.  Currently a
7733 subframework cannot have subframeworks, in the future, the mechanism
7734 may be extended to support this.  The standard frameworks can be found
7735 in @samp{"/System/Library/Frameworks"} and
7736 @samp{"/Library/Frameworks"}.  An example include looks like
7737 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
7738 the name of the framework and header.h is found in the
7739 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
7740
7741 @item -gused
7742 @opindex -gused
7743 Emit debugging information for symbols that are used.  For STABS
7744 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
7745 This is by default ON@.
7746
7747 @item -gfull
7748 @opindex -gfull
7749 Emit debugging information for all symbols and types.
7750
7751 @item -mmacosx-version-min=@var{version}
7752 The earliest version of MacOS X that this executable will run on
7753 is @var{version}.  Typical values of @var{version} include @code{10.1},
7754 @code{10.2}, and @code{10.3.9}.
7755
7756 The default for this option is to make choices that seem to be most
7757 useful.  
7758
7759 @item -mone-byte-bool
7760 @opindex -mone-byte-bool
7761 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
7762 By default @samp{sizeof(bool)} is @samp{4} when compiling for
7763 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
7764 option has no effect on x86.
7765
7766 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
7767 to generate code that is not binary compatible with code generated
7768 without that switch.  Using this switch may require recompiling all
7769 other modules in a program, including system libraries.  Use this
7770 switch to conform to a non-default data model.
7771
7772 @item -mfix-and-continue
7773 @itemx -ffix-and-continue
7774 @itemx -findirect-data
7775 @opindex mfix-and-continue
7776 @opindex ffix-and-continue
7777 @opindex findirect-data
7778 Generate code suitable for fast turn around development.  Needed to
7779 enable gdb to dynamically load @code{.o} files into already running
7780 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
7781 are provided for backwards compatibility.
7782
7783 @item -all_load
7784 @opindex all_load
7785 Loads all members of static archive libraries.
7786 See man ld(1) for more information.
7787
7788 @item -arch_errors_fatal
7789 @opindex arch_errors_fatal
7790 Cause the errors having to do with files that have the wrong architecture
7791 to be fatal.
7792
7793 @item -bind_at_load
7794 @opindex bind_at_load
7795 Causes the output file to be marked such that the dynamic linker will
7796 bind all undefined references when the file is loaded or launched.
7797
7798 @item -bundle
7799 @opindex bundle
7800 Produce a Mach-o bundle format file.
7801 See man ld(1) for more information.
7802
7803 @item -bundle_loader @var{executable}
7804 @opindex bundle_loader
7805 This option specifies the @var{executable} that will be loading the build
7806 output file being linked.  See man ld(1) for more information.
7807
7808 @item -dynamiclib
7809 @opindex -dynamiclib
7810 When passed this option, GCC will produce a dynamic library instead of
7811 an executable when linking, using the Darwin @file{libtool} command.
7812
7813 @item -force_cpusubtype_ALL
7814 @opindex -force_cpusubtype_ALL
7815 This causes GCC's output file to have the @var{ALL} subtype, instead of
7816 one controlled by the @option{-mcpu} or @option{-march} option.
7817
7818 @item -allowable_client  @var{client_name}
7819 @itemx -client_name
7820 @itemx -compatibility_version
7821 @itemx -current_version
7822 @itemx -dead_strip
7823 @itemx -dependency-file
7824 @itemx -dylib_file
7825 @itemx -dylinker_install_name
7826 @itemx -dynamic
7827 @itemx -exported_symbols_list
7828 @itemx -filelist
7829 @itemx -flat_namespace
7830 @itemx -force_flat_namespace
7831 @itemx -headerpad_max_install_names
7832 @itemx -image_base
7833 @itemx -init
7834 @itemx -install_name
7835 @itemx -keep_private_externs
7836 @itemx -multi_module
7837 @itemx -multiply_defined
7838 @itemx -multiply_defined_unused
7839 @itemx -noall_load
7840 @itemx -no_dead_strip_inits_and_terms
7841 @itemx -nofixprebinding
7842 @itemx -nomultidefs
7843 @itemx -noprebind
7844 @itemx -noseglinkedit
7845 @itemx -pagezero_size
7846 @itemx -prebind
7847 @itemx -prebind_all_twolevel_modules
7848 @itemx -private_bundle
7849 @itemx -read_only_relocs
7850 @itemx -sectalign
7851 @itemx -sectobjectsymbols
7852 @itemx -whyload
7853 @itemx -seg1addr
7854 @itemx -sectcreate
7855 @itemx -sectobjectsymbols
7856 @itemx -sectorder
7857 @itemx -segaddr
7858 @itemx -segs_read_only_addr
7859 @itemx -segs_read_write_addr
7860 @itemx -seg_addr_table
7861 @itemx -seg_addr_table_filename
7862 @itemx -seglinkedit
7863 @itemx -segprot
7864 @itemx -segs_read_only_addr
7865 @itemx -segs_read_write_addr
7866 @itemx -single_module
7867 @itemx -static
7868 @itemx -sub_library
7869 @itemx -sub_umbrella
7870 @itemx -twolevel_namespace
7871 @itemx -umbrella
7872 @itemx -undefined
7873 @itemx -unexported_symbols_list
7874 @itemx -weak_reference_mismatches
7875 @itemx -whatsloaded
7876
7877 @opindex allowable_client
7878 @opindex client_name
7879 @opindex compatibility_version
7880 @opindex current_version
7881 @opindex dead_strip
7882 @opindex dependency-file
7883 @opindex dylib_file
7884 @opindex dylinker_install_name
7885 @opindex dynamic
7886 @opindex exported_symbols_list
7887 @opindex filelist
7888 @opindex flat_namespace
7889 @opindex force_flat_namespace
7890 @opindex headerpad_max_install_names
7891 @opindex image_base
7892 @opindex init
7893 @opindex install_name
7894 @opindex keep_private_externs
7895 @opindex multi_module
7896 @opindex multiply_defined
7897 @opindex multiply_defined_unused
7898 @opindex noall_load
7899 @opindex no_dead_strip_inits_and_terms
7900 @opindex nofixprebinding
7901 @opindex nomultidefs
7902 @opindex noprebind
7903 @opindex noseglinkedit
7904 @opindex pagezero_size
7905 @opindex prebind
7906 @opindex prebind_all_twolevel_modules
7907 @opindex private_bundle
7908 @opindex read_only_relocs
7909 @opindex sectalign
7910 @opindex sectobjectsymbols
7911 @opindex whyload
7912 @opindex seg1addr
7913 @opindex sectcreate
7914 @opindex sectobjectsymbols
7915 @opindex sectorder
7916 @opindex segaddr
7917 @opindex segs_read_only_addr
7918 @opindex segs_read_write_addr
7919 @opindex seg_addr_table
7920 @opindex seg_addr_table_filename
7921 @opindex seglinkedit
7922 @opindex segprot
7923 @opindex segs_read_only_addr
7924 @opindex segs_read_write_addr
7925 @opindex single_module
7926 @opindex static
7927 @opindex sub_library
7928 @opindex sub_umbrella
7929 @opindex twolevel_namespace
7930 @opindex umbrella
7931 @opindex undefined
7932 @opindex unexported_symbols_list
7933 @opindex weak_reference_mismatches
7934 @opindex whatsloaded
7935
7936 These options are passed to the Darwin linker.  The Darwin linker man page
7937 describes them in detail.
7938 @end table
7939
7940 @node DEC Alpha Options
7941 @subsection DEC Alpha Options
7942
7943 These @samp{-m} options are defined for the DEC Alpha implementations:
7944
7945 @table @gcctabopt
7946 @item -mno-soft-float
7947 @itemx -msoft-float
7948 @opindex mno-soft-float
7949 @opindex msoft-float
7950 Use (do not use) the hardware floating-point instructions for
7951 floating-point operations.  When @option{-msoft-float} is specified,
7952 functions in @file{libgcc.a} will be used to perform floating-point
7953 operations.  Unless they are replaced by routines that emulate the
7954 floating-point operations, or compiled in such a way as to call such
7955 emulations routines, these routines will issue floating-point
7956 operations.   If you are compiling for an Alpha without floating-point
7957 operations, you must ensure that the library is built so as not to call
7958 them.
7959
7960 Note that Alpha implementations without floating-point operations are
7961 required to have floating-point registers.
7962
7963 @item -mfp-reg
7964 @itemx -mno-fp-regs
7965 @opindex mfp-reg
7966 @opindex mno-fp-regs
7967 Generate code that uses (does not use) the floating-point register set.
7968 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
7969 register set is not used, floating point operands are passed in integer
7970 registers as if they were integers and floating-point results are passed
7971 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
7972 so any function with a floating-point argument or return value called by code
7973 compiled with @option{-mno-fp-regs} must also be compiled with that
7974 option.
7975
7976 A typical use of this option is building a kernel that does not use,
7977 and hence need not save and restore, any floating-point registers.
7978
7979 @item -mieee
7980 @opindex mieee
7981 The Alpha architecture implements floating-point hardware optimized for
7982 maximum performance.  It is mostly compliant with the IEEE floating
7983 point standard.  However, for full compliance, software assistance is
7984 required.  This option generates code fully IEEE compliant code
7985 @emph{except} that the @var{inexact-flag} is not maintained (see below).
7986 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
7987 defined during compilation.  The resulting code is less efficient but is
7988 able to correctly support denormalized numbers and exceptional IEEE
7989 values such as not-a-number and plus/minus infinity.  Other Alpha
7990 compilers call this option @option{-ieee_with_no_inexact}.
7991
7992 @item -mieee-with-inexact
7993 @opindex mieee-with-inexact
7994 This is like @option{-mieee} except the generated code also maintains
7995 the IEEE @var{inexact-flag}.  Turning on this option causes the
7996 generated code to implement fully-compliant IEEE math.  In addition to
7997 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
7998 macro.  On some Alpha implementations the resulting code may execute
7999 significantly slower than the code generated by default.  Since there is
8000 very little code that depends on the @var{inexact-flag}, you should
8001 normally not specify this option.  Other Alpha compilers call this
8002 option @option{-ieee_with_inexact}.
8003
8004 @item -mfp-trap-mode=@var{trap-mode}
8005 @opindex mfp-trap-mode
8006 This option controls what floating-point related traps are enabled.
8007 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8008 The trap mode can be set to one of four values:
8009
8010 @table @samp
8011 @item n
8012 This is the default (normal) setting.  The only traps that are enabled
8013 are the ones that cannot be disabled in software (e.g., division by zero
8014 trap).
8015
8016 @item u
8017 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8018 as well.
8019
8020 @item su
8021 Like @samp{su}, but the instructions are marked to be safe for software
8022 completion (see Alpha architecture manual for details).
8023
8024 @item sui
8025 Like @samp{su}, but inexact traps are enabled as well.
8026 @end table
8027
8028 @item -mfp-rounding-mode=@var{rounding-mode}
8029 @opindex mfp-rounding-mode
8030 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8031 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8032 of:
8033
8034 @table @samp
8035 @item n
8036 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8037 the nearest machine number or towards the even machine number in case
8038 of a tie.
8039
8040 @item m
8041 Round towards minus infinity.
8042
8043 @item c
8044 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8045
8046 @item d
8047 Dynamic rounding mode.  A field in the floating point control register
8048 (@var{fpcr}, see Alpha architecture reference manual) controls the
8049 rounding mode in effect.  The C library initializes this register for
8050 rounding towards plus infinity.  Thus, unless your program modifies the
8051 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8052 @end table
8053
8054 @item -mtrap-precision=@var{trap-precision}
8055 @opindex mtrap-precision
8056 In the Alpha architecture, floating point traps are imprecise.  This
8057 means without software assistance it is impossible to recover from a
8058 floating trap and program execution normally needs to be terminated.
8059 GCC can generate code that can assist operating system trap handlers
8060 in determining the exact location that caused a floating point trap.
8061 Depending on the requirements of an application, different levels of
8062 precisions can be selected:
8063
8064 @table @samp
8065 @item p
8066 Program precision.  This option is the default and means a trap handler
8067 can only identify which program caused a floating point exception.
8068
8069 @item f
8070 Function precision.  The trap handler can determine the function that
8071 caused a floating point exception.
8072
8073 @item i
8074 Instruction precision.  The trap handler can determine the exact
8075 instruction that caused a floating point exception.
8076 @end table
8077
8078 Other Alpha compilers provide the equivalent options called
8079 @option{-scope_safe} and @option{-resumption_safe}.
8080
8081 @item -mieee-conformant
8082 @opindex mieee-conformant
8083 This option marks the generated code as IEEE conformant.  You must not
8084 use this option unless you also specify @option{-mtrap-precision=i} and either
8085 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8086 is to emit the line @samp{.eflag 48} in the function prologue of the
8087 generated assembly file.  Under DEC Unix, this has the effect that
8088 IEEE-conformant math library routines will be linked in.
8089
8090 @item -mbuild-constants
8091 @opindex mbuild-constants
8092 Normally GCC examines a 32- or 64-bit integer constant to
8093 see if it can construct it from smaller constants in two or three
8094 instructions.  If it cannot, it will output the constant as a literal and
8095 generate code to load it from the data segment at runtime.
8096
8097 Use this option to require GCC to construct @emph{all} integer constants
8098 using code, even if it takes more instructions (the maximum is six).
8099
8100 You would typically use this option to build a shared library dynamic
8101 loader.  Itself a shared library, it must relocate itself in memory
8102 before it can find the variables and constants in its own data segment.
8103
8104 @item -malpha-as
8105 @itemx -mgas
8106 @opindex malpha-as
8107 @opindex mgas
8108 Select whether to generate code to be assembled by the vendor-supplied
8109 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8110
8111 @item -mbwx
8112 @itemx -mno-bwx
8113 @itemx -mcix
8114 @itemx -mno-cix
8115 @itemx -mfix
8116 @itemx -mno-fix
8117 @itemx -mmax
8118 @itemx -mno-max
8119 @opindex mbwx
8120 @opindex mno-bwx
8121 @opindex mcix
8122 @opindex mno-cix
8123 @opindex mfix
8124 @opindex mno-fix
8125 @opindex mmax
8126 @opindex mno-max
8127 Indicate whether GCC should generate code to use the optional BWX,
8128 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8129 sets supported by the CPU type specified via @option{-mcpu=} option or that
8130 of the CPU on which GCC was built if none was specified.
8131
8132 @item -mfloat-vax
8133 @itemx -mfloat-ieee
8134 @opindex mfloat-vax
8135 @opindex mfloat-ieee
8136 Generate code that uses (does not use) VAX F and G floating point
8137 arithmetic instead of IEEE single and double precision.
8138
8139 @item -mexplicit-relocs
8140 @itemx -mno-explicit-relocs
8141 @opindex mexplicit-relocs
8142 @opindex mno-explicit-relocs
8143 Older Alpha assemblers provided no way to generate symbol relocations
8144 except via assembler macros.  Use of these macros does not allow
8145 optimal instruction scheduling.  GNU binutils as of version 2.12
8146 supports a new syntax that allows the compiler to explicitly mark
8147 which relocations should apply to which instructions.  This option
8148 is mostly useful for debugging, as GCC detects the capabilities of
8149 the assembler when it is built and sets the default accordingly.
8150
8151 @item -msmall-data
8152 @itemx -mlarge-data
8153 @opindex msmall-data
8154 @opindex mlarge-data
8155 When @option{-mexplicit-relocs} is in effect, static data is
8156 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
8157 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
8158 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
8159 16-bit relocations off of the @code{$gp} register.  This limits the
8160 size of the small data area to 64KB, but allows the variables to be
8161 directly accessed via a single instruction.
8162
8163 The default is @option{-mlarge-data}.  With this option the data area
8164 is limited to just below 2GB@.  Programs that require more than 2GB of
8165 data must use @code{malloc} or @code{mmap} to allocate the data in the
8166 heap instead of in the program's data segment.
8167
8168 When generating code for shared libraries, @option{-fpic} implies
8169 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
8170
8171 @item -msmall-text
8172 @itemx -mlarge-text
8173 @opindex msmall-text
8174 @opindex mlarge-text
8175 When @option{-msmall-text} is used, the compiler assumes that the
8176 code of the entire program (or shared library) fits in 4MB, and is
8177 thus reachable with a branch instruction.  When @option{-msmall-data}
8178 is used, the compiler can assume that all local symbols share the
8179 same @code{$gp} value, and thus reduce the number of instructions
8180 required for a function call from 4 to 1.
8181
8182 The default is @option{-mlarge-text}.
8183
8184 @item -mcpu=@var{cpu_type}
8185 @opindex mcpu
8186 Set the instruction set and instruction scheduling parameters for
8187 machine type @var{cpu_type}.  You can specify either the @samp{EV}
8188 style name or the corresponding chip number.  GCC supports scheduling
8189 parameters for the EV4, EV5 and EV6 family of processors and will
8190 choose the default values for the instruction set from the processor
8191 you specify.  If you do not specify a processor type, GCC will default
8192 to the processor on which the compiler was built.
8193
8194 Supported values for @var{cpu_type} are
8195
8196 @table @samp
8197 @item ev4
8198 @itemx ev45
8199 @itemx 21064
8200 Schedules as an EV4 and has no instruction set extensions.
8201
8202 @item ev5
8203 @itemx 21164
8204 Schedules as an EV5 and has no instruction set extensions.
8205
8206 @item ev56
8207 @itemx 21164a
8208 Schedules as an EV5 and supports the BWX extension.
8209
8210 @item pca56
8211 @itemx 21164pc
8212 @itemx 21164PC
8213 Schedules as an EV5 and supports the BWX and MAX extensions.
8214
8215 @item ev6
8216 @itemx 21264
8217 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
8218
8219 @item ev67
8220 @itemx 21264a
8221 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
8222 @end table
8223
8224 @item -mtune=@var{cpu_type}
8225 @opindex mtune
8226 Set only the instruction scheduling parameters for machine type
8227 @var{cpu_type}.  The instruction set is not changed.
8228
8229 @item -mmemory-latency=@var{time}
8230 @opindex mmemory-latency
8231 Sets the latency the scheduler should assume for typical memory
8232 references as seen by the application.  This number is highly
8233 dependent on the memory access patterns used by the application
8234 and the size of the external cache on the machine.
8235
8236 Valid options for @var{time} are
8237
8238 @table @samp
8239 @item @var{number}
8240 A decimal number representing clock cycles.
8241
8242 @item L1
8243 @itemx L2
8244 @itemx L3
8245 @itemx main
8246 The compiler contains estimates of the number of clock cycles for
8247 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
8248 (also called Dcache, Scache, and Bcache), as well as to main memory.
8249 Note that L3 is only valid for EV5.
8250
8251 @end table
8252 @end table
8253
8254 @node DEC Alpha/VMS Options
8255 @subsection DEC Alpha/VMS Options
8256
8257 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
8258
8259 @table @gcctabopt
8260 @item -mvms-return-codes
8261 @opindex mvms-return-codes
8262 Return VMS condition codes from main.  The default is to return POSIX
8263 style condition (e.g.@ error) codes.
8264 @end table
8265
8266 @node FRV Options
8267 @subsection FRV Options
8268 @cindex FRV Options
8269
8270 @table @gcctabopt
8271 @item -mgpr-32
8272 @opindex mgpr-32
8273
8274 Only use the first 32 general purpose registers.
8275
8276 @item -mgpr-64
8277 @opindex mgpr-64
8278
8279 Use all 64 general purpose registers.
8280
8281 @item -mfpr-32
8282 @opindex mfpr-32
8283
8284 Use only the first 32 floating point registers.
8285
8286 @item -mfpr-64
8287 @opindex mfpr-64
8288
8289 Use all 64 floating point registers
8290
8291 @item -mhard-float
8292 @opindex mhard-float
8293
8294 Use hardware instructions for floating point operations.
8295
8296 @item -msoft-float
8297 @opindex msoft-float
8298
8299 Use library routines for floating point operations.
8300
8301 @item -malloc-cc
8302 @opindex malloc-cc
8303
8304 Dynamically allocate condition code registers.
8305
8306 @item -mfixed-cc
8307 @opindex mfixed-cc
8308
8309 Do not try to dynamically allocate condition code registers, only
8310 use @code{icc0} and @code{fcc0}.
8311
8312 @item -mdword
8313 @opindex mdword
8314
8315 Change ABI to use double word insns.
8316
8317 @item -mno-dword
8318 @opindex mno-dword
8319
8320 Do not use double word instructions.
8321
8322 @item -mdouble
8323 @opindex mdouble
8324
8325 Use floating point double instructions.
8326
8327 @item -mno-double
8328 @opindex mno-double
8329
8330 Do not use floating point double instructions.
8331
8332 @item -mmedia
8333 @opindex mmedia
8334
8335 Use media instructions.
8336
8337 @item -mno-media
8338 @opindex mno-media
8339
8340 Do not use media instructions.
8341
8342 @item -mmuladd
8343 @opindex mmuladd
8344
8345 Use multiply and add/subtract instructions.
8346
8347 @item -mno-muladd
8348 @opindex mno-muladd
8349
8350 Do not use multiply and add/subtract instructions.
8351
8352 @item -mfdpic
8353 @opindex mfdpic
8354
8355 Select the FDPIC ABI, that uses function descriptors to represent
8356 pointers to functions.  Without any PIC/PIE-related options, it
8357 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
8358 assumes GOT entries and small data are within a 12-bit range from the
8359 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
8360 are computed with 32 bits.
8361
8362 @item -minline-plt
8363 @opindex minline-plt
8364
8365 Enable inlining of PLT entries in function calls to functions that are
8366 not known to bind locally.  It has no effect without @option{-mfdpic}.
8367 It's enabled by default if optimizing for speed and compiling for
8368 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
8369 optimization option such as @option{-O3} or above is present in the
8370 command line.
8371
8372 @item -mTLS
8373 @opindex TLS
8374
8375 Assume a large TLS segment when generating thread-local code.
8376
8377 @item -mtls
8378 @opindex tls
8379
8380 Do not assume a large TLS segment when generating thread-local code.
8381
8382 @item -mgprel-ro
8383 @opindex mgprel-ro
8384
8385 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
8386 that is known to be in read-only sections.  It's enabled by default,
8387 except for @option{-fpic} or @option{-fpie}: even though it may help
8388 make the global offset table smaller, it trades 1 instruction for 4.
8389 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
8390 one of which may be shared by multiple symbols, and it avoids the need
8391 for a GOT entry for the referenced symbol, so it's more likely to be a
8392 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
8393
8394 @item -multilib-library-pic
8395 @opindex multilib-library-pic
8396
8397 Link with the (library, not FD) pic libraries.  It's implied by
8398 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
8399 @option{-fpic} without @option{-mfdpic}.  You should never have to use
8400 it explicitly.
8401
8402 @item -mlinked-fp
8403 @opindex mlinked-fp
8404
8405 Follow the EABI requirement of always creating a frame pointer whenever
8406 a stack frame is allocated.  This option is enabled by default and can
8407 be disabled with @option{-mno-linked-fp}.
8408
8409 @item -mlong-calls
8410 @opindex mlong-calls
8411
8412 Use indirect addressing to call functions outside the current
8413 compilation unit.  This allows the functions to be placed anywhere
8414 within the 32-bit address space.
8415
8416 @item -malign-labels
8417 @opindex malign-labels
8418
8419 Try to align labels to an 8-byte boundary by inserting nops into the
8420 previous packet.  This option only has an effect when VLIW packing
8421 is enabled.  It doesn't create new packets; it merely adds nops to
8422 existing ones.
8423
8424 @item -mlibrary-pic
8425 @opindex mlibrary-pic
8426
8427 Generate position-independent EABI code.
8428
8429 @item -macc-4
8430 @opindex macc-4
8431
8432 Use only the first four media accumulator registers.
8433
8434 @item -macc-8
8435 @opindex macc-8
8436
8437 Use all eight media accumulator registers.
8438
8439 @item -mpack
8440 @opindex mpack
8441
8442 Pack VLIW instructions.
8443
8444 @item -mno-pack
8445 @opindex mno-pack
8446
8447 Do not pack VLIW instructions.
8448
8449 @item -mno-eflags
8450 @opindex mno-eflags
8451
8452 Do not mark ABI switches in e_flags.
8453
8454 @item -mcond-move
8455 @opindex mcond-move
8456
8457 Enable the use of conditional-move instructions (default).
8458
8459 This switch is mainly for debugging the compiler and will likely be removed
8460 in a future version.
8461
8462 @item -mno-cond-move
8463 @opindex mno-cond-move
8464
8465 Disable the use of conditional-move instructions.
8466
8467 This switch is mainly for debugging the compiler and will likely be removed
8468 in a future version.
8469
8470 @item -mscc
8471 @opindex mscc
8472
8473 Enable the use of conditional set instructions (default).
8474
8475 This switch is mainly for debugging the compiler and will likely be removed
8476 in a future version.
8477
8478 @item -mno-scc
8479 @opindex mno-scc
8480
8481 Disable the use of conditional set instructions.
8482
8483 This switch is mainly for debugging the compiler and will likely be removed
8484 in a future version.
8485
8486 @item -mcond-exec
8487 @opindex mcond-exec
8488
8489 Enable the use of conditional execution (default).
8490
8491 This switch is mainly for debugging the compiler and will likely be removed
8492 in a future version.
8493
8494 @item -mno-cond-exec
8495 @opindex mno-cond-exec
8496
8497 Disable the use of conditional execution.
8498
8499 This switch is mainly for debugging the compiler and will likely be removed
8500 in a future version.
8501
8502 @item -mvliw-branch
8503 @opindex mvliw-branch
8504
8505 Run a pass to pack branches into VLIW instructions (default).
8506
8507 This switch is mainly for debugging the compiler and will likely be removed
8508 in a future version.
8509
8510 @item -mno-vliw-branch
8511 @opindex mno-vliw-branch
8512
8513 Do not run a pass to pack branches into VLIW instructions.
8514
8515 This switch is mainly for debugging the compiler and will likely be removed
8516 in a future version.
8517
8518 @item -mmulti-cond-exec
8519 @opindex mmulti-cond-exec
8520
8521 Enable optimization of @code{&&} and @code{||} in conditional execution
8522 (default).
8523
8524 This switch is mainly for debugging the compiler and will likely be removed
8525 in a future version.
8526
8527 @item -mno-multi-cond-exec
8528 @opindex mno-multi-cond-exec
8529
8530 Disable optimization of @code{&&} and @code{||} in conditional execution.
8531
8532 This switch is mainly for debugging the compiler and will likely be removed
8533 in a future version.
8534
8535 @item -mnested-cond-exec
8536 @opindex mnested-cond-exec
8537
8538 Enable nested conditional execution optimizations (default).
8539
8540 This switch is mainly for debugging the compiler and will likely be removed
8541 in a future version.
8542
8543 @item -mno-nested-cond-exec
8544 @opindex mno-nested-cond-exec
8545
8546 Disable nested conditional execution optimizations.
8547
8548 This switch is mainly for debugging the compiler and will likely be removed
8549 in a future version.
8550
8551 @item -moptimize-membar
8552 @opindex moptimize-membar
8553
8554 This switch removes redundant @code{membar} instructions from the
8555 compiler generated code.  It is enabled by default.
8556
8557 @item -mno-optimize-membar
8558 @opindex mno-optimize-membar
8559
8560 This switch disables the automatic removal of redundant @code{membar}
8561 instructions from the generated code.
8562
8563 @item -mtomcat-stats
8564 @opindex mtomcat-stats
8565
8566 Cause gas to print out tomcat statistics.
8567
8568 @item -mcpu=@var{cpu}
8569 @opindex mcpu
8570
8571 Select the processor type for which to generate code.  Possible values are
8572 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
8573 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
8574
8575 @end table
8576
8577 @node H8/300 Options
8578 @subsection H8/300 Options
8579
8580 These @samp{-m} options are defined for the H8/300 implementations:
8581
8582 @table @gcctabopt
8583 @item -mrelax
8584 @opindex mrelax
8585 Shorten some address references at link time, when possible; uses the
8586 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
8587 ld, Using ld}, for a fuller description.
8588
8589 @item -mh
8590 @opindex mh
8591 Generate code for the H8/300H@.
8592
8593 @item -ms
8594 @opindex ms
8595 Generate code for the H8S@.
8596
8597 @item -mn
8598 @opindex mn
8599 Generate code for the H8S and H8/300H in the normal mode.  This switch
8600 must be used either with @option{-mh} or @option{-ms}.
8601
8602 @item -ms2600
8603 @opindex ms2600
8604 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
8605
8606 @item -mint32
8607 @opindex mint32
8608 Make @code{int} data 32 bits by default.
8609
8610 @item -malign-300
8611 @opindex malign-300
8612 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
8613 The default for the H8/300H and H8S is to align longs and floats on 4
8614 byte boundaries.
8615 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
8616 This option has no effect on the H8/300.
8617 @end table
8618
8619 @node HPPA Options
8620 @subsection HPPA Options
8621 @cindex HPPA Options
8622
8623 These @samp{-m} options are defined for the HPPA family of computers:
8624
8625 @table @gcctabopt
8626 @item -march=@var{architecture-type}
8627 @opindex march
8628 Generate code for the specified architecture.  The choices for
8629 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
8630 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
8631 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
8632 architecture option for your machine.  Code compiled for lower numbered
8633 architectures will run on higher numbered architectures, but not the
8634 other way around.
8635
8636 @item -mpa-risc-1-0
8637 @itemx -mpa-risc-1-1
8638 @itemx -mpa-risc-2-0
8639 @opindex mpa-risc-1-0
8640 @opindex mpa-risc-1-1
8641 @opindex mpa-risc-2-0
8642 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
8643
8644 @item -mbig-switch
8645 @opindex mbig-switch
8646 Generate code suitable for big switch tables.  Use this option only if
8647 the assembler/linker complain about out of range branches within a switch
8648 table.
8649
8650 @item -mjump-in-delay
8651 @opindex mjump-in-delay
8652 Fill delay slots of function calls with unconditional jump instructions
8653 by modifying the return pointer for the function call to be the target
8654 of the conditional jump.
8655
8656 @item -mdisable-fpregs
8657 @opindex mdisable-fpregs
8658 Prevent floating point registers from being used in any manner.  This is
8659 necessary for compiling kernels which perform lazy context switching of
8660 floating point registers.  If you use this option and attempt to perform
8661 floating point operations, the compiler will abort.
8662
8663 @item -mdisable-indexing
8664 @opindex mdisable-indexing
8665 Prevent the compiler from using indexing address modes.  This avoids some
8666 rather obscure problems when compiling MIG generated code under MACH@.
8667
8668 @item -mno-space-regs
8669 @opindex mno-space-regs
8670 Generate code that assumes the target has no space registers.  This allows
8671 GCC to generate faster indirect calls and use unscaled index address modes.
8672
8673 Such code is suitable for level 0 PA systems and kernels.
8674
8675 @item -mfast-indirect-calls
8676 @opindex mfast-indirect-calls
8677 Generate code that assumes calls never cross space boundaries.  This
8678 allows GCC to emit code which performs faster indirect calls.
8679
8680 This option will not work in the presence of shared libraries or nested
8681 functions.
8682
8683 @item -mfixed-range=@var{register-range}
8684 @opindex mfixed-range
8685 Generate code treating the given register range as fixed registers.
8686 A fixed register is one that the register allocator can not use.  This is
8687 useful when compiling kernel code.  A register range is specified as
8688 two registers separated by a dash.  Multiple register ranges can be
8689 specified separated by a comma.
8690
8691 @item -mlong-load-store
8692 @opindex mlong-load-store
8693 Generate 3-instruction load and store sequences as sometimes required by
8694 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
8695 the HP compilers.
8696
8697 @item -mportable-runtime
8698 @opindex mportable-runtime
8699 Use the portable calling conventions proposed by HP for ELF systems.
8700
8701 @item -mgas
8702 @opindex mgas
8703 Enable the use of assembler directives only GAS understands.
8704
8705 @item -mschedule=@var{cpu-type}
8706 @opindex mschedule
8707 Schedule code according to the constraints for the machine type
8708 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
8709 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
8710 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
8711 proper scheduling option for your machine.  The default scheduling is
8712 @samp{8000}.
8713
8714 @item -mlinker-opt
8715 @opindex mlinker-opt
8716 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
8717 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
8718 linkers in which they give bogus error messages when linking some programs.
8719
8720 @item -msoft-float
8721 @opindex msoft-float
8722 Generate output containing library calls for floating point.
8723 @strong{Warning:} the requisite libraries are not available for all HPPA
8724 targets.  Normally the facilities of the machine's usual C compiler are
8725 used, but this cannot be done directly in cross-compilation.  You must make
8726 your own arrangements to provide suitable library functions for
8727 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
8728 does provide software floating point support.
8729
8730 @option{-msoft-float} changes the calling convention in the output file;
8731 therefore, it is only useful if you compile @emph{all} of a program with
8732 this option.  In particular, you need to compile @file{libgcc.a}, the
8733 library that comes with GCC, with @option{-msoft-float} in order for
8734 this to work.
8735
8736 @item -msio
8737 @opindex msio
8738 Generate the predefine, @code{_SIO}, for server IO@.  The default is
8739 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
8740 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
8741 options are available under HP-UX and HI-UX@.
8742
8743 @item -mgnu-ld
8744 @opindex gnu-ld
8745 Use GNU ld specific options.  This passes @option{-shared} to ld when
8746 building a shared library.  It is the default when GCC is configured,
8747 explicitly or implicitly, with the GNU linker.  This option does not
8748 have any affect on which ld is called, it only changes what parameters
8749 are passed to that ld.  The ld that is called is determined by the
8750 @option{--with-ld} configure option, GCC's program search path, and
8751 finally by the user's @env{PATH}.  The linker used by GCC can be printed
8752 using @samp{which `gcc -print-prog-name=ld`}.
8753
8754 @item -mhp-ld
8755 @opindex hp-ld
8756 Use HP ld specific options.  This passes @option{-b} to ld when building
8757 a shared library and passes @option{+Accept TypeMismatch} to ld on all
8758 links.  It is the default when GCC is configured, explicitly or
8759 implicitly, with the HP linker.  This option does not have any affect on
8760 which ld is called, it only changes what parameters are passed to that
8761 ld.  The ld that is called is determined by the @option{--with-ld}
8762 configure option, GCC's program search path, and finally by the user's
8763 @env{PATH}.  The linker used by GCC can be printed using @samp{which
8764 `gcc -print-prog-name=ld`}.
8765
8766 @item -mlong-calls
8767 @opindex mno-long-calls
8768 Generate code that uses long call sequences.  This ensures that a call
8769 is always able to reach linker generated stubs.  The default is to generate
8770 long calls only when the distance from the call site to the beginning
8771 of the function or translation unit, as the case may be, exceeds a
8772 predefined limit set by the branch type being used.  The limits for
8773 normal calls are 7,600,000 and 240,000 bytes, respectively for the
8774 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
8775 240,000 bytes.
8776
8777 Distances are measured from the beginning of functions when using the
8778 @option{-ffunction-sections} option, or when using the @option{-mgas}
8779 and @option{-mno-portable-runtime} options together under HP-UX with
8780 the SOM linker.
8781
8782 It is normally not desirable to use this option as it will degrade
8783 performance.  However, it may be useful in large applications,
8784 particularly when partial linking is used to build the application.
8785
8786 The types of long calls used depends on the capabilities of the
8787 assembler and linker, and the type of code being generated.  The
8788 impact on systems that support long absolute calls, and long pic
8789 symbol-difference or pc-relative calls should be relatively small.
8790 However, an indirect call is used on 32-bit ELF systems in pic code
8791 and it is quite long.
8792
8793 @item -munix=@var{unix-std}
8794 @opindex march
8795 Generate compiler predefines and select a startfile for the specified
8796 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
8797 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
8798 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
8799 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
8800 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
8801 and later.
8802
8803 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
8804 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
8805 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
8806 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
8807 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
8808 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
8809
8810 It is @emph{important} to note that this option changes the interfaces
8811 for various library routines.  It also affects the operational behavior
8812 of the C library.  Thus, @emph{extreme} care is needed in using this
8813 option.
8814
8815 Library code that is intended to operate with more than one UNIX
8816 standard must test, set and restore the variable @var{__xpg4_extended_mask}
8817 as appropriate.  Most GNU software doesn't provide this capability.
8818
8819 @item -nolibdld
8820 @opindex nolibdld
8821 Suppress the generation of link options to search libdld.sl when the
8822 @option{-static} option is specified on HP-UX 10 and later.
8823
8824 @item -static
8825 @opindex static
8826 The HP-UX implementation of setlocale in libc has a dependency on
8827 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
8828 when the @option{-static} option is specified, special link options
8829 are needed to resolve this dependency.
8830
8831 On HP-UX 10 and later, the GCC driver adds the necessary options to
8832 link with libdld.sl when the @option{-static} option is specified.
8833 This causes the resulting binary to be dynamic.  On the 64-bit port,
8834 the linkers generate dynamic binaries by default in any case.  The
8835 @option{-nolibdld} option can be used to prevent the GCC driver from
8836 adding these link options.
8837
8838 @item -threads
8839 @opindex threads
8840 Add support for multithreading with the @dfn{dce thread} library
8841 under HP-UX@.  This option sets flags for both the preprocessor and
8842 linker.
8843 @end table
8844
8845 @node i386 and x86-64 Options
8846 @subsection Intel 386 and AMD x86-64 Options
8847 @cindex i386 Options
8848 @cindex x86-64 Options
8849 @cindex Intel 386 Options
8850 @cindex AMD x86-64 Options
8851
8852 These @samp{-m} options are defined for the i386 and x86-64 family of
8853 computers:
8854
8855 @table @gcctabopt
8856 @item -mtune=@var{cpu-type}
8857 @opindex mtune
8858 Tune to @var{cpu-type} everything applicable about the generated code, except
8859 for the ABI and the set of available instructions.  The choices for
8860 @var{cpu-type} are:
8861 @table @emph
8862 @item i386
8863 Original Intel's i386 CPU@.
8864 @item i486
8865 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
8866 @item i586, pentium
8867 Intel Pentium CPU with no MMX support.
8868 @item pentium-mmx
8869 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
8870 @item i686, pentiumpro
8871 Intel PentiumPro CPU@.
8872 @item pentium2
8873 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
8874 @item pentium3, pentium3m
8875 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
8876 support.
8877 @item pentium-m
8878 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
8879 support.  Used by Centrino notebooks.
8880 @item pentium4, pentium4m
8881 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
8882 @item prescott
8883 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
8884 set support.
8885 @item nocona
8886 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
8887 SSE2 and SSE3 instruction set support.
8888 @item k6
8889 AMD K6 CPU with MMX instruction set support.
8890 @item k6-2, k6-3
8891 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
8892 @item athlon, athlon-tbird
8893 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
8894 support.
8895 @item athlon-4, athlon-xp, athlon-mp
8896 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
8897 instruction set support.
8898 @item k8, opteron, athlon64, athlon-fx
8899 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
8900 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
8901 @item winchip-c6
8902 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
8903 set support.
8904 @item winchip2
8905 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
8906 instruction set support.
8907 @item c3
8908 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
8909 implemented for this chip.)
8910 @item c3-2
8911 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
8912 implemented for this chip.)
8913 @end table
8914
8915 While picking a specific @var{cpu-type} will schedule things appropriately
8916 for that particular chip, the compiler will not generate any code that
8917 does not run on the i386 without the @option{-march=@var{cpu-type}} option
8918 being used.
8919
8920 @item -march=@var{cpu-type}
8921 @opindex march
8922 Generate instructions for the machine type @var{cpu-type}.  The choices
8923 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
8924 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
8925
8926 @item -mcpu=@var{cpu-type}
8927 @opindex mcpu
8928 A deprecated synonym for @option{-mtune}.
8929
8930 @item -m386
8931 @itemx -m486
8932 @itemx -mpentium
8933 @itemx -mpentiumpro
8934 @opindex m386
8935 @opindex m486
8936 @opindex mpentium
8937 @opindex mpentiumpro
8938 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
8939 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
8940 These synonyms are deprecated.
8941
8942 @item -mfpmath=@var{unit}
8943 @opindex march
8944 Generate floating point arithmetics for selected unit @var{unit}.  The choices
8945 for @var{unit} are:
8946
8947 @table @samp
8948 @item 387
8949 Use the standard 387 floating point coprocessor present majority of chips and
8950 emulated otherwise.  Code compiled with this option will run almost everywhere.
8951 The temporary results are computed in 80bit precision instead of precision
8952 specified by the type resulting in slightly different results compared to most
8953 of other chips.  See @option{-ffloat-store} for more detailed description.
8954
8955 This is the default choice for i386 compiler.
8956
8957 @item sse
8958 Use scalar floating point instructions present in the SSE instruction set.
8959 This instruction set is supported by Pentium3 and newer chips, in the AMD line
8960 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
8961 instruction set supports only single precision arithmetics, thus the double and
8962 extended precision arithmetics is still done using 387.  Later version, present
8963 only in Pentium4 and the future AMD x86-64 chips supports double precision
8964 arithmetics too.
8965
8966 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
8967 or @option{-msse2} switches to enable SSE extensions and make this option
8968 effective.  For the x86-64 compiler, these extensions are enabled by default.
8969
8970 The resulting code should be considerably faster in the majority of cases and avoid
8971 the numerical instability problems of 387 code, but may break some existing
8972 code that expects temporaries to be 80bit.
8973
8974 This is the default choice for the x86-64 compiler.
8975
8976 @item sse,387
8977 Attempt to utilize both instruction sets at once.  This effectively double the
8978 amount of available registers and on chips with separate execution units for
8979 387 and SSE the execution resources too.  Use this option with care, as it is
8980 still experimental, because the GCC register allocator does not model separate
8981 functional units well resulting in instable performance.
8982 @end table
8983
8984 @item -masm=@var{dialect}
8985 @opindex masm=@var{dialect}
8986 Output asm instructions using selected @var{dialect}.  Supported choices are
8987 @samp{intel} or @samp{att} (the default one).
8988
8989 @item -mieee-fp
8990 @itemx -mno-ieee-fp
8991 @opindex mieee-fp
8992 @opindex mno-ieee-fp
8993 Control whether or not the compiler uses IEEE floating point
8994 comparisons.  These handle correctly the case where the result of a
8995 comparison is unordered.
8996
8997 @item -msoft-float
8998 @opindex msoft-float
8999 Generate output containing library calls for floating point.
9000 @strong{Warning:} the requisite libraries are not part of GCC@.
9001 Normally the facilities of the machine's usual C compiler are used, but
9002 this can't be done directly in cross-compilation.  You must make your
9003 own arrangements to provide suitable library functions for
9004 cross-compilation.
9005
9006 On machines where a function returns floating point results in the 80387
9007 register stack, some floating point opcodes may be emitted even if
9008 @option{-msoft-float} is used.
9009
9010 @item -mno-fp-ret-in-387
9011 @opindex mno-fp-ret-in-387
9012 Do not use the FPU registers for return values of functions.
9013
9014 The usual calling convention has functions return values of types
9015 @code{float} and @code{double} in an FPU register, even if there
9016 is no FPU@.  The idea is that the operating system should emulate
9017 an FPU@.
9018
9019 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9020 in ordinary CPU registers instead.
9021
9022 @item -mno-fancy-math-387
9023 @opindex mno-fancy-math-387
9024 Some 387 emulators do not support the @code{sin}, @code{cos} and
9025 @code{sqrt} instructions for the 387.  Specify this option to avoid
9026 generating those instructions.  This option is the default on FreeBSD,
9027 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9028 indicates that the target cpu will always have an FPU and so the
9029 instruction will not need emulation.  As of revision 2.6.1, these
9030 instructions are not generated unless you also use the
9031 @option{-funsafe-math-optimizations} switch.
9032
9033 @item -malign-double
9034 @itemx -mno-align-double
9035 @opindex malign-double
9036 @opindex mno-align-double
9037 Control whether GCC aligns @code{double}, @code{long double}, and
9038 @code{long long} variables on a two word boundary or a one word
9039 boundary.  Aligning @code{double} variables on a two word boundary will
9040 produce code that runs somewhat faster on a @samp{Pentium} at the
9041 expense of more memory.
9042
9043 @strong{Warning:} if you use the @option{-malign-double} switch,
9044 structures containing the above types will be aligned differently than
9045 the published application binary interface specifications for the 386
9046 and will not be binary compatible with structures in code compiled
9047 without that switch.
9048
9049 @item -m96bit-long-double
9050 @itemx -m128bit-long-double
9051 @opindex m96bit-long-double
9052 @opindex m128bit-long-double
9053 These switches control the size of @code{long double} type.  The i386
9054 application binary interface specifies the size to be 96 bits,
9055 so @option{-m96bit-long-double} is the default in 32 bit mode.
9056
9057 Modern architectures (Pentium and newer) would prefer @code{long double}
9058 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9059 conforming to the ABI, this would not be possible.  So specifying a
9060 @option{-m128bit-long-double} will align @code{long double}
9061 to a 16 byte boundary by padding the @code{long double} with an additional
9062 32 bit zero.
9063
9064 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9065 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9066
9067 Notice that neither of these options enable any extra precision over the x87
9068 standard of 80 bits for a @code{long double}.
9069
9070 @strong{Warning:} if you override the default value for your target ABI, the
9071 structures and arrays containing @code{long double} variables will change
9072 their size as well as function calling convention for function taking
9073 @code{long double} will be modified.  Hence they will not be binary
9074 compatible with arrays or structures in code compiled without that switch.
9075
9076 @item -mmlarge-data-threshold=@var{number}
9077 @opindex mlarge-data-threshold=@var{number}
9078 When @option{-mcmodel=medium} is specified, the data greater than
9079 @var{threshold} are placed in large data section.  This value must be the
9080 same across all object linked into the binarry and defaults to 65535.
9081
9082 @item -msvr3-shlib
9083 @itemx -mno-svr3-shlib
9084 @opindex msvr3-shlib
9085 @opindex mno-svr3-shlib
9086 Control whether GCC places uninitialized local variables into the
9087 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9088 into @code{bss}.  These options are meaningful only on System V Release 3.
9089
9090 @item -mrtd
9091 @opindex mrtd
9092 Use a different function-calling convention, in which functions that
9093 take a fixed number of arguments return with the @code{ret} @var{num}
9094 instruction, which pops their arguments while returning.  This saves one
9095 instruction in the caller since there is no need to pop the arguments
9096 there.
9097
9098 You can specify that an individual function is called with this calling
9099 sequence with the function attribute @samp{stdcall}.  You can also
9100 override the @option{-mrtd} option by using the function attribute
9101 @samp{cdecl}.  @xref{Function Attributes}.
9102
9103 @strong{Warning:} this calling convention is incompatible with the one
9104 normally used on Unix, so you cannot use it if you need to call
9105 libraries compiled with the Unix compiler.
9106
9107 Also, you must provide function prototypes for all functions that
9108 take variable numbers of arguments (including @code{printf});
9109 otherwise incorrect code will be generated for calls to those
9110 functions.
9111
9112 In addition, seriously incorrect code will result if you call a
9113 function with too many arguments.  (Normally, extra arguments are
9114 harmlessly ignored.)
9115
9116 @item -mregparm=@var{num}
9117 @opindex mregparm
9118 Control how many registers are used to pass integer arguments.  By
9119 default, no registers are used to pass arguments, and at most 3
9120 registers can be used.  You can control this behavior for a specific
9121 function by using the function attribute @samp{regparm}.
9122 @xref{Function Attributes}.
9123
9124 @strong{Warning:} if you use this switch, and
9125 @var{num} is nonzero, then you must build all modules with the same
9126 value, including any libraries.  This includes the system libraries and
9127 startup modules.
9128
9129 @item -msseregparm
9130 @opindex msseregparm
9131 Use SSE register passing conventions for float and double arguments
9132 and return values.  You can control this behavior for a specific
9133 function by using the function attribute @samp{sseregparm}.
9134 @xref{Function Attributes}.
9135
9136 @strong{Warning:} if you use this switch then you must build all
9137 modules with the same value, including any libraries.  This includes
9138 the system libraries and startup modules.
9139
9140 @item -mpreferred-stack-boundary=@var{num}
9141 @opindex mpreferred-stack-boundary
9142 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
9143 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
9144 the default is 4 (16 bytes or 128 bits), except when optimizing for code
9145 size (@option{-Os}), in which case the default is the minimum correct
9146 alignment (4 bytes for x86, and 8 bytes for x86-64).
9147
9148 On Pentium and PentiumPro, @code{double} and @code{long double} values
9149 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
9150 suffer significant run time performance penalties.  On Pentium III, the
9151 Streaming SIMD Extension (SSE) data type @code{__m128} suffers similar
9152 penalties if it is not 16 byte aligned.
9153
9154 To ensure proper alignment of this values on the stack, the stack boundary
9155 must be as aligned as that required by any value stored on the stack.
9156 Further, every function must be generated such that it keeps the stack
9157 aligned.  Thus calling a function compiled with a higher preferred
9158 stack boundary from a function compiled with a lower preferred stack
9159 boundary will most likely misalign the stack.  It is recommended that
9160 libraries that use callbacks always use the default setting.
9161
9162 This extra alignment does consume extra stack space, and generally
9163 increases code size.  Code that is sensitive to stack space usage, such
9164 as embedded systems and operating system kernels, may want to reduce the
9165 preferred alignment to @option{-mpreferred-stack-boundary=2}.
9166
9167 @item -mmmx
9168 @itemx -mno-mmx
9169 @item -msse
9170 @itemx -mno-sse
9171 @item -msse2
9172 @itemx -mno-sse2
9173 @item -msse3
9174 @itemx -mno-sse3
9175 @item -m3dnow
9176 @itemx -mno-3dnow
9177 @opindex mmmx
9178 @opindex mno-mmx
9179 @opindex msse
9180 @opindex mno-sse
9181 @opindex m3dnow
9182 @opindex mno-3dnow
9183 These switches enable or disable the use of built-in functions that allow
9184 direct access to the MMX, SSE, SSE2, SSE3 and 3Dnow extensions of the
9185 instruction set.
9186
9187 @xref{X86 Built-in Functions}, for details of the functions enabled
9188 and disabled by these switches.
9189
9190 To have SSE/SSE2 instructions generated automatically from floating-point
9191 code, see @option{-mfpmath=sse}.
9192
9193 @item -mpush-args
9194 @itemx -mno-push-args
9195 @opindex mpush-args
9196 @opindex mno-push-args
9197 Use PUSH operations to store outgoing parameters.  This method is shorter
9198 and usually equally fast as method using SUB/MOV operations and is enabled
9199 by default.  In some cases disabling it may improve performance because of
9200 improved scheduling and reduced dependencies.
9201
9202 @item -maccumulate-outgoing-args
9203 @opindex maccumulate-outgoing-args
9204 If enabled, the maximum amount of space required for outgoing arguments will be
9205 computed in the function prologue.  This is faster on most modern CPUs
9206 because of reduced dependencies, improved scheduling and reduced stack usage
9207 when preferred stack boundary is not equal to 2.  The drawback is a notable
9208 increase in code size.  This switch implies @option{-mno-push-args}.
9209
9210 @item -mthreads
9211 @opindex mthreads
9212 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
9213 on thread-safe exception handling must compile and link all code with the
9214 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
9215 @option{-D_MT}; when linking, it links in a special thread helper library
9216 @option{-lmingwthrd} which cleans up per thread exception handling data.
9217
9218 @item -mno-align-stringops
9219 @opindex mno-align-stringops
9220 Do not align destination of inlined string operations.  This switch reduces
9221 code size and improves performance in case the destination is already aligned,
9222 but GCC doesn't know about it.
9223
9224 @item -minline-all-stringops
9225 @opindex minline-all-stringops
9226 By default GCC inlines string operations only when destination is known to be
9227 aligned at least to 4 byte boundary.  This enables more inlining, increase code
9228 size, but may improve performance of code that depends on fast memcpy, strlen
9229 and memset for short lengths.
9230
9231 @item -momit-leaf-frame-pointer
9232 @opindex momit-leaf-frame-pointer
9233 Don't keep the frame pointer in a register for leaf functions.  This
9234 avoids the instructions to save, set up and restore frame pointers and
9235 makes an extra register available in leaf functions.  The option
9236 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9237 which might make debugging harder.
9238
9239 @item -mtls-direct-seg-refs
9240 @itemx -mno-tls-direct-seg-refs
9241 @opindex mtls-direct-seg-refs
9242 Controls whether TLS variables may be accessed with offsets from the
9243 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
9244 or whether the thread base pointer must be added.  Whether or not this
9245 is legal depends on the operating system, and whether it maps the
9246 segment to cover the entire TLS area.
9247
9248 For systems that use GNU libc, the default is on.
9249 @end table
9250
9251 These @samp{-m} switches are supported in addition to the above
9252 on AMD x86-64 processors in 64-bit environments.
9253
9254 @table @gcctabopt
9255 @item -m32
9256 @itemx -m64
9257 @opindex m32
9258 @opindex m64
9259 Generate code for a 32-bit or 64-bit environment.
9260 The 32-bit environment sets int, long and pointer to 32 bits and
9261 generates code that runs on any i386 system.
9262 The 64-bit environment sets int to 32 bits and long and pointer
9263 to 64 bits and generates code for AMD's x86-64 architecture.
9264
9265 @item -mno-red-zone
9266 @opindex no-red-zone
9267 Do not use a so called red zone for x86-64 code.  The red zone is mandated
9268 by the x86-64 ABI, it is a 128-byte area beyond the location of the
9269 stack pointer that will not be modified by signal or interrupt handlers
9270 and therefore can be used for temporary data without adjusting the stack
9271 pointer.  The flag @option{-mno-red-zone} disables this red zone.
9272
9273 @item -mcmodel=small
9274 @opindex mcmodel=small
9275 Generate code for the small code model: the program and its symbols must
9276 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
9277 Programs can be statically or dynamically linked.  This is the default
9278 code model.
9279
9280 @item -mcmodel=kernel
9281 @opindex mcmodel=kernel
9282 Generate code for the kernel code model.  The kernel runs in the
9283 negative 2 GB of the address space.
9284 This model has to be used for Linux kernel code.
9285
9286 @item -mcmodel=medium
9287 @opindex mcmodel=medium
9288 Generate code for the medium model: The program is linked in the lower 2
9289 GB of the address space but symbols can be located anywhere in the
9290 address space.  Programs can be statically or dynamically linked, but
9291 building of shared libraries are not supported with the medium model.
9292
9293 @item -mcmodel=large
9294 @opindex mcmodel=large
9295 Generate code for the large model: This model makes no assumptions
9296 about addresses and sizes of sections.  Currently GCC does not implement
9297 this model.
9298 @end table
9299
9300 @node IA-64 Options
9301 @subsection IA-64 Options
9302 @cindex IA-64 Options
9303
9304 These are the @samp{-m} options defined for the Intel IA-64 architecture.
9305
9306 @table @gcctabopt
9307 @item -mbig-endian
9308 @opindex mbig-endian
9309 Generate code for a big endian target.  This is the default for HP-UX@.
9310
9311 @item -mlittle-endian
9312 @opindex mlittle-endian
9313 Generate code for a little endian target.  This is the default for AIX5
9314 and GNU/Linux.
9315
9316 @item -mgnu-as
9317 @itemx -mno-gnu-as
9318 @opindex mgnu-as
9319 @opindex mno-gnu-as
9320 Generate (or don't) code for the GNU assembler.  This is the default.
9321 @c Also, this is the default if the configure option @option{--with-gnu-as}
9322 @c is used.
9323
9324 @item -mgnu-ld
9325 @itemx -mno-gnu-ld
9326 @opindex mgnu-ld
9327 @opindex mno-gnu-ld
9328 Generate (or don't) code for the GNU linker.  This is the default.
9329 @c Also, this is the default if the configure option @option{--with-gnu-ld}
9330 @c is used.
9331
9332 @item -mno-pic
9333 @opindex mno-pic
9334 Generate code that does not use a global pointer register.  The result
9335 is not position independent code, and violates the IA-64 ABI@.
9336
9337 @item -mvolatile-asm-stop
9338 @itemx -mno-volatile-asm-stop
9339 @opindex mvolatile-asm-stop
9340 @opindex mno-volatile-asm-stop
9341 Generate (or don't) a stop bit immediately before and after volatile asm
9342 statements.
9343
9344 @item -mregister-names
9345 @itemx -mno-register-names
9346 @opindex mregister-names
9347 @opindex mno-register-names
9348 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
9349 the stacked registers.  This may make assembler output more readable.
9350
9351 @item -mno-sdata
9352 @itemx -msdata
9353 @opindex mno-sdata
9354 @opindex msdata
9355 Disable (or enable) optimizations that use the small data section.  This may
9356 be useful for working around optimizer bugs.
9357
9358 @item -mconstant-gp
9359 @opindex mconstant-gp
9360 Generate code that uses a single constant global pointer value.  This is
9361 useful when compiling kernel code.
9362
9363 @item -mauto-pic
9364 @opindex mauto-pic
9365 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
9366 This is useful when compiling firmware code.
9367
9368 @item -minline-float-divide-min-latency
9369 @opindex minline-float-divide-min-latency
9370 Generate code for inline divides of floating point values
9371 using the minimum latency algorithm.
9372
9373 @item -minline-float-divide-max-throughput
9374 @opindex minline-float-divide-max-throughput
9375 Generate code for inline divides of floating point values
9376 using the maximum throughput algorithm.
9377
9378 @item -minline-int-divide-min-latency
9379 @opindex minline-int-divide-min-latency
9380 Generate code for inline divides of integer values
9381 using the minimum latency algorithm.
9382
9383 @item -minline-int-divide-max-throughput
9384 @opindex minline-int-divide-max-throughput
9385 Generate code for inline divides of integer values
9386 using the maximum throughput algorithm.
9387
9388 @item -minline-sqrt-min-latency
9389 @opindex minline-sqrt-min-latency
9390 Generate code for inline square roots
9391 using the minimum latency algorithm.
9392
9393 @item -minline-sqrt-max-throughput
9394 @opindex minline-sqrt-max-throughput
9395 Generate code for inline square roots
9396 using the maximum throughput algorithm.
9397
9398 @item -mno-dwarf2-asm
9399 @itemx -mdwarf2-asm
9400 @opindex mno-dwarf2-asm
9401 @opindex mdwarf2-asm
9402 Don't (or do) generate assembler code for the DWARF2 line number debugging
9403 info.  This may be useful when not using the GNU assembler.
9404
9405 @item -mearly-stop-bits
9406 @itemx -mno-early-stop-bits
9407 @opindex mearly-stop-bits
9408 @opindex mno-early-stop-bits
9409 Allow stop bits to be placed earlier than immediately preceding the
9410 instruction that triggered the stop bit.  This can improve instruction
9411 scheduling, but does not always do so.
9412
9413 @item -mfixed-range=@var{register-range}
9414 @opindex mfixed-range
9415 Generate code treating the given register range as fixed registers.
9416 A fixed register is one that the register allocator can not use.  This is
9417 useful when compiling kernel code.  A register range is specified as
9418 two registers separated by a dash.  Multiple register ranges can be
9419 specified separated by a comma.
9420
9421 @item -mtls-size=@var{tls-size}
9422 @opindex mtls-size
9423 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
9424 64.
9425
9426 @item -mtune-arch=@var{cpu-type}
9427 @opindex mtune-arch
9428 Tune the instruction scheduling for a particular CPU, Valid values are
9429 itanium, itanium1, merced, itanium2, and mckinley.
9430
9431 @item -mt
9432 @itemx -pthread
9433 @opindex mt
9434 @opindex pthread
9435 Add support for multithreading using the POSIX threads library.  This
9436 option sets flags for both the preprocessor and linker.  It does
9437 not affect the thread safety of object code produced by the compiler or
9438 that of libraries supplied with it.  These are HP-UX specific flags.
9439
9440 @item -milp32
9441 @itemx -mlp64
9442 @opindex milp32
9443 @opindex mlp64
9444 Generate code for a 32-bit or 64-bit environment.
9445 The 32-bit environment sets int, long and pointer to 32 bits.
9446 The 64-bit environment sets int to 32 bits and long and pointer
9447 to 64 bits.  These are HP-UX specific flags.
9448
9449 @end table
9450
9451 @node M32C Options
9452 @subsection M32C Options
9453 @cindex M32C options
9454
9455 @table @gcctabopt
9456 @item -mcpu=@var{name}
9457 @opindex mcpu=
9458 Select the CPU for which code is generated.  @var{name} may be one of
9459 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
9460 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
9461 the M32C/80 series.
9462
9463 @item -msim
9464 @opindex msim
9465 Specifies that the program will be run on the simulator.  This causes
9466 an alternate runtime library to be linked in which supports, for
9467 example, file I/O.  You must not use this option when generating
9468 programs that will run on real hardware; you must provide your own
9469 runtime library for whatever I/O functions are needed.
9470
9471 @item -memregs=@var{number}
9472 @opindex memregs=
9473 Specifies the number of memory-based pseudo-registers GCC will use
9474 during code generation.  These pseudo-registers will be used like real
9475 registers, so there is a tradeoff between GCC's ability to fit the
9476 code into available registers, and the performance penalty of using
9477 memory instead of registers.  Note that all modules in a program must
9478 be compiled with the same value for this option.  Because of that, you
9479 must not use this option with the default runtime libraries gcc
9480 builds.
9481
9482 @end table
9483
9484 @node M32R/D Options
9485 @subsection M32R/D Options
9486 @cindex M32R/D options
9487
9488 These @option{-m} options are defined for Renesas M32R/D architectures:
9489
9490 @table @gcctabopt
9491 @item -m32r2
9492 @opindex m32r2
9493 Generate code for the M32R/2@.
9494
9495 @item -m32rx
9496 @opindex m32rx
9497 Generate code for the M32R/X@.
9498
9499 @item -m32r
9500 @opindex m32r
9501 Generate code for the M32R@.  This is the default.
9502
9503 @item -mmodel=small
9504 @opindex mmodel=small
9505 Assume all objects live in the lower 16MB of memory (so that their addresses
9506 can be loaded with the @code{ld24} instruction), and assume all subroutines
9507 are reachable with the @code{bl} instruction.
9508 This is the default.
9509
9510 The addressability of a particular object can be set with the
9511 @code{model} attribute.
9512
9513 @item -mmodel=medium
9514 @opindex mmodel=medium
9515 Assume objects may be anywhere in the 32-bit address space (the compiler
9516 will generate @code{seth/add3} instructions to load their addresses), and
9517 assume all subroutines are reachable with the @code{bl} instruction.
9518
9519 @item -mmodel=large
9520 @opindex mmodel=large
9521 Assume objects may be anywhere in the 32-bit address space (the compiler
9522 will generate @code{seth/add3} instructions to load their addresses), and
9523 assume subroutines may not be reachable with the @code{bl} instruction
9524 (the compiler will generate the much slower @code{seth/add3/jl}
9525 instruction sequence).
9526
9527 @item -msdata=none
9528 @opindex msdata=none
9529 Disable use of the small data area.  Variables will be put into
9530 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
9531 @code{section} attribute has been specified).
9532 This is the default.
9533
9534 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
9535 Objects may be explicitly put in the small data area with the
9536 @code{section} attribute using one of these sections.
9537
9538 @item -msdata=sdata
9539 @opindex msdata=sdata
9540 Put small global and static data in the small data area, but do not
9541 generate special code to reference them.
9542
9543 @item -msdata=use
9544 @opindex msdata=use
9545 Put small global and static data in the small data area, and generate
9546 special instructions to reference them.
9547
9548 @item -G @var{num}
9549 @opindex G
9550 @cindex smaller data references
9551 Put global and static objects less than or equal to @var{num} bytes
9552 into the small data or bss sections instead of the normal data or bss
9553 sections.  The default value of @var{num} is 8.
9554 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
9555 for this option to have any effect.
9556
9557 All modules should be compiled with the same @option{-G @var{num}} value.
9558 Compiling with different values of @var{num} may or may not work; if it
9559 doesn't the linker will give an error message---incorrect code will not be
9560 generated.
9561
9562 @item -mdebug
9563 @opindex mdebug
9564 Makes the M32R specific code in the compiler display some statistics
9565 that might help in debugging programs.
9566
9567 @item -malign-loops
9568 @opindex malign-loops
9569 Align all loops to a 32-byte boundary.
9570
9571 @item -mno-align-loops
9572 @opindex mno-align-loops
9573 Do not enforce a 32-byte alignment for loops.  This is the default.
9574
9575 @item -missue-rate=@var{number}
9576 @opindex missue-rate=@var{number}
9577 Issue @var{number} instructions per cycle.  @var{number} can only be 1
9578 or 2.
9579
9580 @item -mbranch-cost=@var{number}
9581 @opindex mbranch-cost=@var{number}
9582 @var{number} can only be 1 or 2.  If it is 1 then branches will be
9583 preferred over conditional code, if it is 2, then the opposite will
9584 apply.
9585
9586 @item -mflush-trap=@var{number}
9587 @opindex mflush-trap=@var{number}
9588 Specifies the trap number to use to flush the cache.  The default is
9589 12.  Valid numbers are between 0 and 15 inclusive.
9590
9591 @item -mno-flush-trap
9592 @opindex mno-flush-trap
9593 Specifies that the cache cannot be flushed by using a trap.
9594
9595 @item -mflush-func=@var{name}
9596 @opindex mflush-func=@var{name}
9597 Specifies the name of the operating system function to call to flush
9598 the cache.  The default is @emph{_flush_cache}, but a function call
9599 will only be used if a trap is not available.
9600
9601 @item -mno-flush-func
9602 @opindex mno-flush-func
9603 Indicates that there is no OS function for flushing the cache.
9604
9605 @end table
9606
9607 @node M680x0 Options
9608 @subsection M680x0 Options
9609 @cindex M680x0 options
9610
9611 These are the @samp{-m} options defined for the 68000 series.  The default
9612 values for these options depends on which style of 68000 was selected when
9613 the compiler was configured; the defaults for the most common choices are
9614 given below.
9615
9616 @table @gcctabopt
9617 @item -m68000
9618 @itemx -mc68000
9619 @opindex m68000
9620 @opindex mc68000
9621 Generate output for a 68000.  This is the default
9622 when the compiler is configured for 68000-based systems.
9623
9624 Use this option for microcontrollers with a 68000 or EC000 core,
9625 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
9626
9627 @item -m68020
9628 @itemx -mc68020
9629 @opindex m68020
9630 @opindex mc68020
9631 Generate output for a 68020.  This is the default
9632 when the compiler is configured for 68020-based systems.
9633
9634 @item -m68881
9635 @opindex m68881
9636 Generate output containing 68881 instructions for floating point.
9637 This is the default for most 68020 systems unless @option{--nfp} was
9638 specified when the compiler was configured.
9639
9640 @item -m68030
9641 @opindex m68030
9642 Generate output for a 68030.  This is the default when the compiler is
9643 configured for 68030-based systems.
9644
9645 @item -m68040
9646 @opindex m68040
9647 Generate output for a 68040.  This is the default when the compiler is
9648 configured for 68040-based systems.
9649
9650 This option inhibits the use of 68881/68882 instructions that have to be
9651 emulated by software on the 68040.  Use this option if your 68040 does not
9652 have code to emulate those instructions.
9653
9654 @item -m68060
9655 @opindex m68060
9656 Generate output for a 68060.  This is the default when the compiler is
9657 configured for 68060-based systems.
9658
9659 This option inhibits the use of 68020 and 68881/68882 instructions that
9660 have to be emulated by software on the 68060.  Use this option if your 68060
9661 does not have code to emulate those instructions.
9662
9663 @item -mcpu32
9664 @opindex mcpu32
9665 Generate output for a CPU32.  This is the default
9666 when the compiler is configured for CPU32-based systems.
9667
9668 Use this option for microcontrollers with a
9669 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
9670 68336, 68340, 68341, 68349 and 68360.
9671
9672 @item -m5200
9673 @opindex m5200
9674 Generate output for a 520X ``coldfire'' family cpu.  This is the default
9675 when the compiler is configured for 520X-based systems.
9676
9677 Use this option for microcontroller with a 5200 core, including
9678 the MCF5202, MCF5203, MCF5204 and MCF5202.
9679
9680
9681 @item -m68020-40
9682 @opindex m68020-40
9683 Generate output for a 68040, without using any of the new instructions.
9684 This results in code which can run relatively efficiently on either a
9685 68020/68881 or a 68030 or a 68040.  The generated code does use the
9686 68881 instructions that are emulated on the 68040.
9687
9688 @item -m68020-60
9689 @opindex m68020-60
9690 Generate output for a 68060, without using any of the new instructions.
9691 This results in code which can run relatively efficiently on either a
9692 68020/68881 or a 68030 or a 68040.  The generated code does use the
9693 68881 instructions that are emulated on the 68060.
9694
9695 @item -msoft-float
9696 @opindex msoft-float
9697 Generate output containing library calls for floating point.
9698 @strong{Warning:} the requisite libraries are not available for all m68k
9699 targets.  Normally the facilities of the machine's usual C compiler are
9700 used, but this can't be done directly in cross-compilation.  You must
9701 make your own arrangements to provide suitable library functions for
9702 cross-compilation.  The embedded targets @samp{m68k-*-aout} and
9703 @samp{m68k-*-coff} do provide software floating point support.
9704
9705 @item -mshort
9706 @opindex mshort
9707 Consider type @code{int} to be 16 bits wide, like @code{short int}.
9708 Additionally, parameters passed on the stack are also aligned to a
9709 16-bit boundary even on targets whose API mandates promotion to 32-bit.
9710
9711 @item -mnobitfield
9712 @opindex mnobitfield
9713 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
9714 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
9715
9716 @item -mbitfield
9717 @opindex mbitfield
9718 Do use the bit-field instructions.  The @option{-m68020} option implies
9719 @option{-mbitfield}.  This is the default if you use a configuration
9720 designed for a 68020.
9721
9722 @item -mrtd
9723 @opindex mrtd
9724 Use a different function-calling convention, in which functions
9725 that take a fixed number of arguments return with the @code{rtd}
9726 instruction, which pops their arguments while returning.  This
9727 saves one instruction in the caller since there is no need to pop
9728 the arguments there.
9729
9730 This calling convention is incompatible with the one normally
9731 used on Unix, so you cannot use it if you need to call libraries
9732 compiled with the Unix compiler.
9733
9734 Also, you must provide function prototypes for all functions that
9735 take variable numbers of arguments (including @code{printf});
9736 otherwise incorrect code will be generated for calls to those
9737 functions.
9738
9739 In addition, seriously incorrect code will result if you call a
9740 function with too many arguments.  (Normally, extra arguments are
9741 harmlessly ignored.)
9742
9743 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
9744 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
9745
9746 @item -malign-int
9747 @itemx -mno-align-int
9748 @opindex malign-int
9749 @opindex mno-align-int
9750 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
9751 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
9752 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
9753 Aligning variables on 32-bit boundaries produces code that runs somewhat
9754 faster on processors with 32-bit busses at the expense of more memory.
9755
9756 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
9757 align structures containing the above types  differently than
9758 most published application binary interface specifications for the m68k.
9759
9760 @item -mpcrel
9761 @opindex mpcrel
9762 Use the pc-relative addressing mode of the 68000 directly, instead of
9763 using a global offset table.  At present, this option implies @option{-fpic},
9764 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
9765 not presently supported with @option{-mpcrel}, though this could be supported for
9766 68020 and higher processors.
9767
9768 @item -mno-strict-align
9769 @itemx -mstrict-align
9770 @opindex mno-strict-align
9771 @opindex mstrict-align
9772 Do not (do) assume that unaligned memory references will be handled by
9773 the system.
9774
9775 @item -msep-data
9776 Generate code that allows the data segment to be located in a different
9777 area of memory from the text segment.  This allows for execute in place in
9778 an environment without virtual memory management.  This option implies
9779 @option{-fPIC}.
9780
9781 @item -mno-sep-data
9782 Generate code that assumes that the data segment follows the text segment.
9783 This is the default.
9784
9785 @item -mid-shared-library
9786 Generate code that supports shared libraries via the library ID method.
9787 This allows for execute in place and shared libraries in an environment
9788 without virtual memory management.  This option implies @option{-fPIC}.
9789
9790 @item -mno-id-shared-library
9791 Generate code that doesn't assume ID based shared libraries are being used.
9792 This is the default.
9793
9794 @item -mshared-library-id=n
9795 Specified the identification number of the ID based shared library being
9796 compiled.  Specifying a value of 0 will generate more compact code, specifying
9797 other values will force the allocation of that number to the current
9798 library but is no more space or time efficient than omitting this option.
9799
9800 @end table
9801
9802 @node M68hc1x Options
9803 @subsection M68hc1x Options
9804 @cindex M68hc1x options
9805
9806 These are the @samp{-m} options defined for the 68hc11 and 68hc12
9807 microcontrollers.  The default values for these options depends on
9808 which style of microcontroller was selected when the compiler was configured;
9809 the defaults for the most common choices are given below.
9810
9811 @table @gcctabopt
9812 @item -m6811
9813 @itemx -m68hc11
9814 @opindex m6811
9815 @opindex m68hc11
9816 Generate output for a 68HC11.  This is the default
9817 when the compiler is configured for 68HC11-based systems.
9818
9819 @item -m6812
9820 @itemx -m68hc12
9821 @opindex m6812
9822 @opindex m68hc12
9823 Generate output for a 68HC12.  This is the default
9824 when the compiler is configured for 68HC12-based systems.
9825
9826 @item -m68S12
9827 @itemx -m68hcs12
9828 @opindex m68S12
9829 @opindex m68hcs12
9830 Generate output for a 68HCS12.
9831
9832 @item -mauto-incdec
9833 @opindex mauto-incdec
9834 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
9835 addressing modes.
9836
9837 @item -minmax
9838 @itemx -nominmax
9839 @opindex minmax
9840 @opindex mnominmax
9841 Enable the use of 68HC12 min and max instructions.
9842
9843 @item -mlong-calls
9844 @itemx -mno-long-calls
9845 @opindex mlong-calls
9846 @opindex mno-long-calls
9847 Treat all calls as being far away (near).  If calls are assumed to be
9848 far away, the compiler will use the @code{call} instruction to
9849 call a function and the @code{rtc} instruction for returning.
9850
9851 @item -mshort
9852 @opindex mshort
9853 Consider type @code{int} to be 16 bits wide, like @code{short int}.
9854
9855 @item -msoft-reg-count=@var{count}
9856 @opindex msoft-reg-count
9857 Specify the number of pseudo-soft registers which are used for the
9858 code generation.  The maximum number is 32.  Using more pseudo-soft
9859 register may or may not result in better code depending on the program.
9860 The default is 4 for 68HC11 and 2 for 68HC12.
9861
9862 @end table
9863
9864 @node MCore Options
9865 @subsection MCore Options
9866 @cindex MCore options
9867
9868 These are the @samp{-m} options defined for the Motorola M*Core
9869 processors.
9870
9871 @table @gcctabopt
9872
9873 @item -mhardlit
9874 @itemx -mno-hardlit
9875 @opindex mhardlit
9876 @opindex mno-hardlit
9877 Inline constants into the code stream if it can be done in two
9878 instructions or less.
9879
9880 @item -mdiv
9881 @itemx -mno-div
9882 @opindex mdiv
9883 @opindex mno-div
9884 Use the divide instruction.  (Enabled by default).
9885
9886 @item -mrelax-immediate
9887 @itemx -mno-relax-immediate
9888 @opindex mrelax-immediate
9889 @opindex mno-relax-immediate
9890 Allow arbitrary sized immediates in bit operations.
9891
9892 @item -mwide-bitfields
9893 @itemx -mno-wide-bitfields
9894 @opindex mwide-bitfields
9895 @opindex mno-wide-bitfields
9896 Always treat bit-fields as int-sized.
9897
9898 @item -m4byte-functions
9899 @itemx -mno-4byte-functions
9900 @opindex m4byte-functions
9901 @opindex mno-4byte-functions
9902 Force all functions to be aligned to a four byte boundary.
9903
9904 @item -mcallgraph-data
9905 @itemx -mno-callgraph-data
9906 @opindex mcallgraph-data
9907 @opindex mno-callgraph-data
9908 Emit callgraph information.
9909
9910 @item -mslow-bytes
9911 @itemx -mno-slow-bytes
9912 @opindex mslow-bytes
9913 @opindex mno-slow-bytes
9914 Prefer word access when reading byte quantities.
9915
9916 @item -mlittle-endian
9917 @itemx -mbig-endian
9918 @opindex mlittle-endian
9919 @opindex mbig-endian
9920 Generate code for a little endian target.
9921
9922 @item -m210
9923 @itemx -m340
9924 @opindex m210
9925 @opindex m340
9926 Generate code for the 210 processor.
9927 @end table
9928
9929 @node MIPS Options
9930 @subsection MIPS Options
9931 @cindex MIPS options
9932
9933 @table @gcctabopt
9934
9935 @item -EB
9936 @opindex EB
9937 Generate big-endian code.
9938
9939 @item -EL
9940 @opindex EL
9941 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
9942 configurations.
9943
9944 @item -march=@var{arch}
9945 @opindex march
9946 Generate code that will run on @var{arch}, which can be the name of a
9947 generic MIPS ISA, or the name of a particular processor.
9948 The ISA names are:
9949 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
9950 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
9951 The processor names are:
9952 @samp{4kc}, @samp{4km}, @samp{4kp},
9953 @samp{5kc}, @samp{5kf},
9954 @samp{20kc},
9955 @samp{24k}, @samp{24kc}, @samp{24kf}, @samp{24kx},
9956 @samp{m4k},
9957 @samp{orion},
9958 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
9959 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
9960 @samp{rm7000}, @samp{rm9000},
9961 @samp{sb1},
9962 @samp{sr71000},
9963 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
9964 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
9965 The special value @samp{from-abi} selects the
9966 most compatible architecture for the selected ABI (that is,
9967 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
9968
9969 In processor names, a final @samp{000} can be abbreviated as @samp{k}
9970 (for example, @samp{-march=r2k}).  Prefixes are optional, and
9971 @samp{vr} may be written @samp{r}.
9972
9973 GCC defines two macros based on the value of this option.  The first
9974 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
9975 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
9976 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
9977 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
9978 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
9979
9980 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
9981 above.  In other words, it will have the full prefix and will not
9982 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
9983 the macro names the resolved architecture (either @samp{"mips1"} or
9984 @samp{"mips3"}).  It names the default architecture when no
9985 @option{-march} option is given.
9986
9987 @item -mtune=@var{arch}
9988 @opindex mtune
9989 Optimize for @var{arch}.  Among other things, this option controls
9990 the way instructions are scheduled, and the perceived cost of arithmetic
9991 operations.  The list of @var{arch} values is the same as for
9992 @option{-march}.
9993
9994 When this option is not used, GCC will optimize for the processor
9995 specified by @option{-march}.  By using @option{-march} and
9996 @option{-mtune} together, it is possible to generate code that will
9997 run on a family of processors, but optimize the code for one
9998 particular member of that family.
9999
10000 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
10001 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
10002 @samp{-march} ones described above.
10003
10004 @item -mips1
10005 @opindex mips1
10006 Equivalent to @samp{-march=mips1}.
10007
10008 @item -mips2
10009 @opindex mips2
10010 Equivalent to @samp{-march=mips2}.
10011
10012 @item -mips3
10013 @opindex mips3
10014 Equivalent to @samp{-march=mips3}.
10015
10016 @item -mips4
10017 @opindex mips4
10018 Equivalent to @samp{-march=mips4}.
10019
10020 @item -mips32
10021 @opindex mips32
10022 Equivalent to @samp{-march=mips32}.
10023
10024 @item -mips32r2
10025 @opindex mips32r2
10026 Equivalent to @samp{-march=mips32r2}.
10027
10028 @item -mips64
10029 @opindex mips64
10030 Equivalent to @samp{-march=mips64}.
10031
10032 @item -mips16
10033 @itemx -mno-mips16
10034 @opindex mips16
10035 @opindex mno-mips16
10036 Generate (do not generate) MIPS16 code.  If GCC is targetting a
10037 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
10038
10039 @item -mabi=32
10040 @itemx -mabi=o64
10041 @itemx -mabi=n32
10042 @itemx -mabi=64
10043 @itemx -mabi=eabi
10044 @opindex mabi=32
10045 @opindex mabi=o64
10046 @opindex mabi=n32
10047 @opindex mabi=64
10048 @opindex mabi=eabi
10049 Generate code for the given ABI@.
10050
10051 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
10052 generates 64-bit code when you select a 64-bit architecture, but you
10053 can use @option{-mgp32} to get 32-bit code instead.
10054
10055 For information about the O64 ABI, see
10056 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
10057
10058 @item -mabicalls
10059 @itemx -mno-abicalls
10060 @opindex mabicalls
10061 @opindex mno-abicalls
10062 Generate (do not generate) SVR4-style position-independent code.
10063 @option{-mabicalls} is the default for SVR4-based systems.
10064
10065 @item -mxgot
10066 @itemx -mno-xgot
10067 @opindex mxgot
10068 @opindex mno-xgot
10069 Lift (do not lift) the usual restrictions on the size of the global
10070 offset table.
10071
10072 GCC normally uses a single instruction to load values from the GOT@.
10073 While this is relatively efficient, it will only work if the GOT
10074 is smaller than about 64k.  Anything larger will cause the linker
10075 to report an error such as:
10076
10077 @cindex relocation truncated to fit (MIPS)
10078 @smallexample
10079 relocation truncated to fit: R_MIPS_GOT16 foobar
10080 @end smallexample
10081
10082 If this happens, you should recompile your code with @option{-mxgot}.
10083 It should then work with very large GOTs, although it will also be
10084 less efficient, since it will take three instructions to fetch the
10085 value of a global symbol.
10086
10087 Note that some linkers can create multiple GOTs.  If you have such a
10088 linker, you should only need to use @option{-mxgot} when a single object
10089 file accesses more than 64k's worth of GOT entries.  Very few do.
10090
10091 These options have no effect unless GCC is generating position
10092 independent code.
10093
10094 @item -mgp32
10095 @opindex mgp32
10096 Assume that general-purpose registers are 32 bits wide.
10097
10098 @item -mgp64
10099 @opindex mgp64
10100 Assume that general-purpose registers are 64 bits wide.
10101
10102 @item -mfp32
10103 @opindex mfp32
10104 Assume that floating-point registers are 32 bits wide.
10105
10106 @item -mfp64
10107 @opindex mfp64
10108 Assume that floating-point registers are 64 bits wide.
10109
10110 @item -mhard-float
10111 @opindex mhard-float
10112 Use floating-point coprocessor instructions.
10113
10114 @item -msoft-float
10115 @opindex msoft-float
10116 Do not use floating-point coprocessor instructions.  Implement
10117 floating-point calculations using library calls instead.
10118
10119 @item -msingle-float
10120 @opindex msingle-float
10121 Assume that the floating-point coprocessor only supports single-precision
10122 operations.
10123
10124 @itemx -mdouble-float
10125 @opindex mdouble-float
10126 Assume that the floating-point coprocessor supports double-precision
10127 operations.  This is the default.
10128
10129 @itemx -mdsp
10130 @itemx -mno-dsp
10131 @opindex mdsp
10132 @opindex mno-dsp
10133 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
10134
10135 @itemx -mpaired-single
10136 @itemx -mno-paired-single
10137 @opindex mpaired-single
10138 @opindex mno-paired-single
10139 Use (do not use) paired-single floating-point instructions.
10140 @xref{MIPS Paired-Single Support}.  This option can only be used
10141 when generating 64-bit code and requires hardware floating-point
10142 support to be enabled.
10143
10144 @itemx -mips3d
10145 @itemx -mno-mips3d
10146 @opindex mips3d
10147 @opindex mno-mips3d
10148 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
10149 The option @option{-mips3d} implies @option{-mpaired-single}.
10150
10151 @item -mlong64
10152 @opindex mlong64
10153 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
10154 an explanation of the default and the way that the pointer size is
10155 determined.
10156
10157 @item -mlong32
10158 @opindex mlong32
10159 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
10160
10161 The default size of @code{int}s, @code{long}s and pointers depends on
10162 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
10163 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
10164 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
10165 or the same size as integer registers, whichever is smaller.
10166
10167 @item -msym32
10168 @itemx -mno-sym32
10169 @opindex msym32
10170 @opindex mno-sym32
10171 Assume (do not assume) that all symbols have 32-bit values, regardless
10172 of the selected ABI@.  This option is useful in combination with
10173 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
10174 to generate shorter and faster references to symbolic addresses.
10175
10176 @item -G @var{num}
10177 @opindex G
10178 @cindex smaller data references (MIPS)
10179 @cindex gp-relative references (MIPS)
10180 Put global and static items less than or equal to @var{num} bytes into
10181 the small data or bss section instead of the normal data or bss section.
10182 This allows the data to be accessed using a single instruction.
10183
10184 All modules should be compiled with the same @option{-G @var{num}}
10185 value.
10186
10187 @item -membedded-data
10188 @itemx -mno-embedded-data
10189 @opindex membedded-data
10190 @opindex mno-embedded-data
10191 Allocate variables to the read-only data section first if possible, then
10192 next in the small data section if possible, otherwise in data.  This gives
10193 slightly slower code than the default, but reduces the amount of RAM required
10194 when executing, and thus may be preferred for some embedded systems.
10195
10196 @item -muninit-const-in-rodata
10197 @itemx -mno-uninit-const-in-rodata
10198 @opindex muninit-const-in-rodata
10199 @opindex mno-uninit-const-in-rodata
10200 Put uninitialized @code{const} variables in the read-only data section.
10201 This option is only meaningful in conjunction with @option{-membedded-data}.
10202
10203 @item -msplit-addresses
10204 @itemx -mno-split-addresses
10205 @opindex msplit-addresses
10206 @opindex mno-split-addresses
10207 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
10208 relocation operators.  This option has been superseded by
10209 @option{-mexplicit-relocs} but is retained for backwards compatibility.
10210
10211 @item -mexplicit-relocs
10212 @itemx -mno-explicit-relocs
10213 @opindex mexplicit-relocs
10214 @opindex mno-explicit-relocs
10215 Use (do not use) assembler relocation operators when dealing with symbolic
10216 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
10217 is to use assembler macros instead.
10218
10219 @option{-mexplicit-relocs} is the default if GCC was configured
10220 to use an assembler that supports relocation operators.
10221
10222 @item -mcheck-zero-division
10223 @itemx -mno-check-zero-division
10224 @opindex mcheck-zero-division
10225 @opindex mno-check-zero-division
10226 Trap (do not trap) on integer division by zero.  The default is
10227 @option{-mcheck-zero-division}.
10228
10229 @item -mdivide-traps
10230 @itemx -mdivide-breaks
10231 @opindex mdivide-traps
10232 @opindex mdivide-breaks
10233 MIPS systems check for division by zero by generating either a
10234 conditional trap or a break instruction.  Using traps results in
10235 smaller code, but is only supported on MIPS II and later.  Also, some
10236 versions of the Linux kernel have a bug that prevents trap from
10237 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
10238 allow conditional traps on architectures that support them and
10239 @option{-mdivide-breaks} to force the use of breaks.
10240
10241 The default is usually @option{-mdivide-traps}, but this can be
10242 overridden at configure time using @option{--with-divide=breaks}.
10243 Divide-by-zero checks can be completely disabled using
10244 @option{-mno-check-zero-division}.
10245
10246 @item -mmemcpy
10247 @itemx -mno-memcpy
10248 @opindex mmemcpy
10249 @opindex mno-memcpy
10250 Force (do not force) the use of @code{memcpy()} for non-trivial block
10251 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
10252 most constant-sized copies.
10253
10254 @item -mlong-calls
10255 @itemx -mno-long-calls
10256 @opindex mlong-calls
10257 @opindex mno-long-calls
10258 Disable (do not disable) use of the @code{jal} instruction.  Calling
10259 functions using @code{jal} is more efficient but requires the caller
10260 and callee to be in the same 256 megabyte segment.
10261
10262 This option has no effect on abicalls code.  The default is
10263 @option{-mno-long-calls}.
10264
10265 @item -mmad
10266 @itemx -mno-mad
10267 @opindex mmad
10268 @opindex mno-mad
10269 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
10270 instructions, as provided by the R4650 ISA@.
10271
10272 @item -mfused-madd
10273 @itemx -mno-fused-madd
10274 @opindex mfused-madd
10275 @opindex mno-fused-madd
10276 Enable (disable) use of the floating point multiply-accumulate
10277 instructions, when they are available.  The default is
10278 @option{-mfused-madd}.
10279
10280 When multiply-accumulate instructions are used, the intermediate
10281 product is calculated to infinite precision and is not subject to
10282 the FCSR Flush to Zero bit.  This may be undesirable in some
10283 circumstances.
10284
10285 @item -nocpp
10286 @opindex nocpp
10287 Tell the MIPS assembler to not run its preprocessor over user
10288 assembler files (with a @samp{.s} suffix) when assembling them.
10289
10290 @item -mfix-r4000
10291 @itemx -mno-fix-r4000
10292 @opindex mfix-r4000
10293 @opindex mno-fix-r4000
10294 Work around certain R4000 CPU errata:
10295 @itemize @minus
10296 @item
10297 A double-word or a variable shift may give an incorrect result if executed
10298 immediately after starting an integer division.
10299 @item
10300 A double-word or a variable shift may give an incorrect result if executed
10301 while an integer multiplication is in progress.
10302 @item
10303 An integer division may give an incorrect result if started in a delay slot
10304 of a taken branch or a jump.
10305 @end itemize
10306
10307 @item -mfix-r4400
10308 @itemx -mno-fix-r4400
10309 @opindex mfix-r4400
10310 @opindex mno-fix-r4400
10311 Work around certain R4400 CPU errata:
10312 @itemize @minus
10313 @item
10314 A double-word or a variable shift may give an incorrect result if executed
10315 immediately after starting an integer division.
10316 @end itemize
10317
10318 @item -mfix-vr4120
10319 @itemx -mno-fix-vr4120
10320 @opindex mfix-vr4120
10321 Work around certain VR4120 errata:
10322 @itemize @minus
10323 @item
10324 @code{dmultu} does not always produce the correct result.
10325 @item
10326 @code{div} and @code{ddiv} do not always produce the correct result if one
10327 of the operands is negative.
10328 @end itemize
10329 The workarounds for the division errata rely on special functions in
10330 @file{libgcc.a}.  At present, these functions are only provided by
10331 the @code{mips64vr*-elf} configurations.
10332
10333 Other VR4120 errata require a nop to be inserted between certain pairs of
10334 instructions.  These errata are handled by the assembler, not by GCC itself.
10335
10336 @item -mfix-vr4130
10337 @opindex mfix-vr4130
10338 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
10339 workarounds are implemented by the assembler rather than by GCC,
10340 although GCC will avoid using @code{mflo} and @code{mfhi} if the
10341 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
10342 instructions are available instead.
10343
10344 @item -mfix-sb1
10345 @itemx -mno-fix-sb1
10346 @opindex mfix-sb1
10347 Work around certain SB-1 CPU core errata.
10348 (This flag currently works around the SB-1 revision 2
10349 ``F1'' and ``F2'' floating point errata.)
10350
10351 @item -mflush-func=@var{func}
10352 @itemx -mno-flush-func
10353 @opindex mflush-func
10354 Specifies the function to call to flush the I and D caches, or to not
10355 call any such function.  If called, the function must take the same
10356 arguments as the common @code{_flush_func()}, that is, the address of the
10357 memory range for which the cache is being flushed, the size of the
10358 memory range, and the number 3 (to flush both caches).  The default
10359 depends on the target GCC was configured for, but commonly is either
10360 @samp{_flush_func} or @samp{__cpu_flush}.
10361
10362 @item -mbranch-likely
10363 @itemx -mno-branch-likely
10364 @opindex mbranch-likely
10365 @opindex mno-branch-likely
10366 Enable or disable use of Branch Likely instructions, regardless of the
10367 default for the selected architecture.  By default, Branch Likely
10368 instructions may be generated if they are supported by the selected
10369 architecture.  An exception is for the MIPS32 and MIPS64 architectures
10370 and processors which implement those architectures; for those, Branch
10371 Likely instructions will not be generated by default because the MIPS32
10372 and MIPS64 architectures specifically deprecate their use.
10373
10374 @item -mfp-exceptions
10375 @itemx -mno-fp-exceptions
10376 @opindex mfp-exceptions
10377 Specifies whether FP exceptions are enabled.  This affects how we schedule
10378 FP instructions for some processors.  The default is that FP exceptions are
10379 enabled.
10380
10381 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
10382 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
10383 FP pipe.
10384
10385 @item -mvr4130-align
10386 @itemx -mno-vr4130-align
10387 @opindex mvr4130-align
10388 The VR4130 pipeline is two-way superscalar, but can only issue two
10389 instructions together if the first one is 8-byte aligned.  When this
10390 option is enabled, GCC will align pairs of instructions that it
10391 thinks should execute in parallel.
10392
10393 This option only has an effect when optimizing for the VR4130.
10394 It normally makes code faster, but at the expense of making it bigger.
10395 It is enabled by default at optimization level @option{-O3}.
10396 @end table
10397
10398 @node MMIX Options
10399 @subsection MMIX Options
10400 @cindex MMIX Options
10401
10402 These options are defined for the MMIX:
10403
10404 @table @gcctabopt
10405 @item -mlibfuncs
10406 @itemx -mno-libfuncs
10407 @opindex mlibfuncs
10408 @opindex mno-libfuncs
10409 Specify that intrinsic library functions are being compiled, passing all
10410 values in registers, no matter the size.
10411
10412 @item -mepsilon
10413 @itemx -mno-epsilon
10414 @opindex mepsilon
10415 @opindex mno-epsilon
10416 Generate floating-point comparison instructions that compare with respect
10417 to the @code{rE} epsilon register.
10418
10419 @item -mabi=mmixware
10420 @itemx -mabi=gnu
10421 @opindex mabi-mmixware
10422 @opindex mabi=gnu
10423 Generate code that passes function parameters and return values that (in
10424 the called function) are seen as registers @code{$0} and up, as opposed to
10425 the GNU ABI which uses global registers @code{$231} and up.
10426
10427 @item -mzero-extend
10428 @itemx -mno-zero-extend
10429 @opindex mzero-extend
10430 @opindex mno-zero-extend
10431 When reading data from memory in sizes shorter than 64 bits, use (do not
10432 use) zero-extending load instructions by default, rather than
10433 sign-extending ones.
10434
10435 @item -mknuthdiv
10436 @itemx -mno-knuthdiv
10437 @opindex mknuthdiv
10438 @opindex mno-knuthdiv
10439 Make the result of a division yielding a remainder have the same sign as
10440 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
10441 remainder follows the sign of the dividend.  Both methods are
10442 arithmetically valid, the latter being almost exclusively used.
10443
10444 @item -mtoplevel-symbols
10445 @itemx -mno-toplevel-symbols
10446 @opindex mtoplevel-symbols
10447 @opindex mno-toplevel-symbols
10448 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
10449 code can be used with the @code{PREFIX} assembly directive.
10450
10451 @item -melf
10452 @opindex melf
10453 Generate an executable in the ELF format, rather than the default
10454 @samp{mmo} format used by the @command{mmix} simulator.
10455
10456 @item -mbranch-predict
10457 @itemx -mno-branch-predict
10458 @opindex mbranch-predict
10459 @opindex mno-branch-predict
10460 Use (do not use) the probable-branch instructions, when static branch
10461 prediction indicates a probable branch.
10462
10463 @item -mbase-addresses
10464 @itemx -mno-base-addresses
10465 @opindex mbase-addresses
10466 @opindex mno-base-addresses
10467 Generate (do not generate) code that uses @emph{base addresses}.  Using a
10468 base address automatically generates a request (handled by the assembler
10469 and the linker) for a constant to be set up in a global register.  The
10470 register is used for one or more base address requests within the range 0
10471 to 255 from the value held in the register.  The generally leads to short
10472 and fast code, but the number of different data items that can be
10473 addressed is limited.  This means that a program that uses lots of static
10474 data may require @option{-mno-base-addresses}.
10475
10476 @item -msingle-exit
10477 @itemx -mno-single-exit
10478 @opindex msingle-exit
10479 @opindex mno-single-exit
10480 Force (do not force) generated code to have a single exit point in each
10481 function.
10482 @end table
10483
10484 @node MN10300 Options
10485 @subsection MN10300 Options
10486 @cindex MN10300 options
10487
10488 These @option{-m} options are defined for Matsushita MN10300 architectures:
10489
10490 @table @gcctabopt
10491 @item -mmult-bug
10492 @opindex mmult-bug
10493 Generate code to avoid bugs in the multiply instructions for the MN10300
10494 processors.  This is the default.
10495
10496 @item -mno-mult-bug
10497 @opindex mno-mult-bug
10498 Do not generate code to avoid bugs in the multiply instructions for the
10499 MN10300 processors.
10500
10501 @item -mam33
10502 @opindex mam33
10503 Generate code which uses features specific to the AM33 processor.
10504
10505 @item -mno-am33
10506 @opindex mno-am33
10507 Do not generate code which uses features specific to the AM33 processor.  This
10508 is the default.
10509
10510 @item -mno-crt0
10511 @opindex mno-crt0
10512 Do not link in the C run-time initialization object file.
10513
10514 @item -mrelax
10515 @opindex mrelax
10516 Indicate to the linker that it should perform a relaxation optimization pass
10517 to shorten branches, calls and absolute memory addresses.  This option only
10518 has an effect when used on the command line for the final link step.
10519
10520 This option makes symbolic debugging impossible.
10521 @end table
10522
10523 @node PDP-11 Options
10524 @subsection PDP-11 Options
10525 @cindex PDP-11 Options
10526
10527 These options are defined for the PDP-11:
10528
10529 @table @gcctabopt
10530 @item -mfpu
10531 @opindex mfpu
10532 Use hardware FPP floating point.  This is the default.  (FIS floating
10533 point on the PDP-11/40 is not supported.)
10534
10535 @item -msoft-float
10536 @opindex msoft-float
10537 Do not use hardware floating point.
10538
10539 @item -mac0
10540 @opindex mac0
10541 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
10542
10543 @item -mno-ac0
10544 @opindex mno-ac0
10545 Return floating-point results in memory.  This is the default.
10546
10547 @item -m40
10548 @opindex m40
10549 Generate code for a PDP-11/40.
10550
10551 @item -m45
10552 @opindex m45
10553 Generate code for a PDP-11/45.  This is the default.
10554
10555 @item -m10
10556 @opindex m10
10557 Generate code for a PDP-11/10.
10558
10559 @item -mbcopy-builtin
10560 @opindex bcopy-builtin
10561 Use inline @code{movmemhi} patterns for copying memory.  This is the
10562 default.
10563
10564 @item -mbcopy
10565 @opindex mbcopy
10566 Do not use inline @code{movmemhi} patterns for copying memory.
10567
10568 @item -mint16
10569 @itemx -mno-int32
10570 @opindex mint16
10571 @opindex mno-int32
10572 Use 16-bit @code{int}.  This is the default.
10573
10574 @item -mint32
10575 @itemx -mno-int16
10576 @opindex mint32
10577 @opindex mno-int16
10578 Use 32-bit @code{int}.
10579
10580 @item -mfloat64
10581 @itemx -mno-float32
10582 @opindex mfloat64
10583 @opindex mno-float32
10584 Use 64-bit @code{float}.  This is the default.
10585
10586 @item -mfloat32
10587 @itemx -mno-float64
10588 @opindex mfloat32
10589 @opindex mno-float64
10590 Use 32-bit @code{float}.
10591
10592 @item -mabshi
10593 @opindex mabshi
10594 Use @code{abshi2} pattern.  This is the default.
10595
10596 @item -mno-abshi
10597 @opindex mno-abshi
10598 Do not use @code{abshi2} pattern.
10599
10600 @item -mbranch-expensive
10601 @opindex mbranch-expensive
10602 Pretend that branches are expensive.  This is for experimenting with
10603 code generation only.
10604
10605 @item -mbranch-cheap
10606 @opindex mbranch-cheap
10607 Do not pretend that branches are expensive.  This is the default.
10608
10609 @item -msplit
10610 @opindex msplit
10611 Generate code for a system with split I&D@.
10612
10613 @item -mno-split
10614 @opindex mno-split
10615 Generate code for a system without split I&D@.  This is the default.
10616
10617 @item -munix-asm
10618 @opindex munix-asm
10619 Use Unix assembler syntax.  This is the default when configured for
10620 @samp{pdp11-*-bsd}.
10621
10622 @item -mdec-asm
10623 @opindex mdec-asm
10624 Use DEC assembler syntax.  This is the default when configured for any
10625 PDP-11 target other than @samp{pdp11-*-bsd}.
10626 @end table
10627
10628 @node PowerPC Options
10629 @subsection PowerPC Options
10630 @cindex PowerPC options
10631
10632 These are listed under @xref{RS/6000 and PowerPC Options}.
10633
10634 @node RS/6000 and PowerPC Options
10635 @subsection IBM RS/6000 and PowerPC Options
10636 @cindex RS/6000 and PowerPC Options
10637 @cindex IBM RS/6000 and PowerPC Options
10638
10639 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
10640 @table @gcctabopt
10641 @item -mpower
10642 @itemx -mno-power
10643 @itemx -mpower2
10644 @itemx -mno-power2
10645 @itemx -mpowerpc
10646 @itemx -mno-powerpc
10647 @itemx -mpowerpc-gpopt
10648 @itemx -mno-powerpc-gpopt
10649 @itemx -mpowerpc-gfxopt
10650 @itemx -mno-powerpc-gfxopt
10651 @itemx -mpowerpc64
10652 @itemx -mno-powerpc64
10653 @opindex mpower
10654 @opindex mno-power
10655 @opindex mpower2
10656 @opindex mno-power2
10657 @opindex mpowerpc
10658 @opindex mno-powerpc
10659 @opindex mpowerpc-gpopt
10660 @opindex mno-powerpc-gpopt
10661 @opindex mpowerpc-gfxopt
10662 @opindex mno-powerpc-gfxopt
10663 @opindex mpowerpc64
10664 @opindex mno-powerpc64
10665 GCC supports two related instruction set architectures for the
10666 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
10667 instructions supported by the @samp{rios} chip set used in the original
10668 RS/6000 systems and the @dfn{PowerPC} instruction set is the
10669 architecture of the Motorola MPC5xx, MPC6xx, MPC8xx microprocessors, and
10670 the IBM 4xx microprocessors.
10671
10672 Neither architecture is a subset of the other.  However there is a
10673 large common subset of instructions supported by both.  An MQ
10674 register is included in processors supporting the POWER architecture.
10675
10676 You use these options to specify which instructions are available on the
10677 processor you are using.  The default value of these options is
10678 determined when configuring GCC@.  Specifying the
10679 @option{-mcpu=@var{cpu_type}} overrides the specification of these
10680 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
10681 rather than the options listed above.
10682
10683 The @option{-mpower} option allows GCC to generate instructions that
10684 are found only in the POWER architecture and to use the MQ register.
10685 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
10686 to generate instructions that are present in the POWER2 architecture but
10687 not the original POWER architecture.
10688
10689 The @option{-mpowerpc} option allows GCC to generate instructions that
10690 are found only in the 32-bit subset of the PowerPC architecture.
10691 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
10692 GCC to use the optional PowerPC architecture instructions in the
10693 General Purpose group, including floating-point square root.  Specifying
10694 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
10695 use the optional PowerPC architecture instructions in the Graphics
10696 group, including floating-point select.
10697
10698 The @option{-mpowerpc64} option allows GCC to generate the additional
10699 64-bit instructions that are found in the full PowerPC64 architecture
10700 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
10701 @option{-mno-powerpc64}.
10702
10703 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
10704 will use only the instructions in the common subset of both
10705 architectures plus some special AIX common-mode calls, and will not use
10706 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
10707 permits GCC to use any instruction from either architecture and to
10708 allow use of the MQ register; specify this for the Motorola MPC601.
10709
10710 @item -mnew-mnemonics
10711 @itemx -mold-mnemonics
10712 @opindex mnew-mnemonics
10713 @opindex mold-mnemonics
10714 Select which mnemonics to use in the generated assembler code.  With
10715 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
10716 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
10717 assembler mnemonics defined for the POWER architecture.  Instructions
10718 defined in only one architecture have only one mnemonic; GCC uses that
10719 mnemonic irrespective of which of these options is specified.
10720
10721 GCC defaults to the mnemonics appropriate for the architecture in
10722 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
10723 value of these option.  Unless you are building a cross-compiler, you
10724 should normally not specify either @option{-mnew-mnemonics} or
10725 @option{-mold-mnemonics}, but should instead accept the default.
10726
10727 @item -mcpu=@var{cpu_type}
10728 @opindex mcpu
10729 Set architecture type, register usage, choice of mnemonics, and
10730 instruction scheduling parameters for machine type @var{cpu_type}.
10731 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
10732 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
10733 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
10734 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
10735 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
10736 @samp{860}, @samp{970}, @samp{8540}, @samp{common}, @samp{ec603e}, @samp{G3},
10737 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
10738 @samp{power4}, @samp{power5}, @samp{powerpc}, @samp{powerpc64},
10739 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
10740
10741 @option{-mcpu=common} selects a completely generic processor.  Code
10742 generated under this option will run on any POWER or PowerPC processor.
10743 GCC will use only the instructions in the common subset of both
10744 architectures, and will not use the MQ register.  GCC assumes a generic
10745 processor model for scheduling purposes.
10746
10747 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
10748 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
10749 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
10750 types, with an appropriate, generic processor model assumed for
10751 scheduling purposes.
10752
10753 The other options specify a specific processor.  Code generated under
10754 those options will run best on that processor, and may not run at all on
10755 others.
10756
10757 The @option{-mcpu} options automatically enable or disable the
10758 following options: @option{-maltivec}, @option{-mhard-float},
10759 @option{-mmfcrf}, @option{-mmultiple}, @option{-mnew-mnemonics},
10760 @option{-mpower}, @option{-mpower2}, @option{-mpowerpc64},
10761 @option{-mpowerpc-gpopt}, @option{-mpowerpc-gfxopt},
10762 @option{-mstring}.  The particular options set for any particular CPU
10763 will vary between compiler versions, depending on what setting seems
10764 to produce optimal code for that CPU; it doesn't necessarily reflect
10765 the actual hardware's capabilities.  If you wish to set an individual
10766 option to a particular value, you may specify it after the
10767 @option{-mcpu} option, like @samp{-mcpu=970 -mno-altivec}.
10768
10769 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
10770 not enabled or disabled by the @option{-mcpu} option at present, since
10771 AIX does not have full support for these options.  You may still
10772 enable or disable them individually if you're sure it'll work in your
10773 environment.
10774
10775 @item -mtune=@var{cpu_type}
10776 @opindex mtune
10777 Set the instruction scheduling parameters for machine type
10778 @var{cpu_type}, but do not set the architecture type, register usage, or
10779 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
10780 values for @var{cpu_type} are used for @option{-mtune} as for
10781 @option{-mcpu}.  If both are specified, the code generated will use the
10782 architecture, registers, and mnemonics set by @option{-mcpu}, but the
10783 scheduling parameters set by @option{-mtune}.
10784
10785 @item -mswdiv
10786 @itemx -mno-swdiv
10787 @opindex mswdiv
10788 @opindex mno-swdiv
10789 Generate code to compute division as reciprocal estimate and iterative
10790 refinement, creating opportunities for increased throughput.  This
10791 feature requires: optional PowerPC Graphics instruction set for single
10792 precision and FRE instruction for double precision, assuming divides
10793 cannot generate user-visible traps, and the domain values not include
10794 Infinities, denormals or zero denominator.
10795
10796 @item -maltivec
10797 @itemx -mno-altivec
10798 @opindex maltivec
10799 @opindex mno-altivec
10800 Generate code that uses (does not use) AltiVec instructions, and also
10801 enable the use of built-in functions that allow more direct access to
10802 the AltiVec instruction set.  You may also need to set
10803 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
10804 enhancements.
10805
10806 @item -mvrsave
10807 @item -mno-vrsave
10808 @opindex mvrsave
10809 @opindex mno-vrsave
10810 Generate VRSAVE instructions when generating AltiVec code.
10811
10812 @item -mabi=spe
10813 @opindex mabi=spe
10814 Extend the current ABI with SPE ABI extensions.  This does not change
10815 the default ABI, instead it adds the SPE ABI extensions to the current
10816 ABI@.
10817
10818 @item -mabi=no-spe
10819 @opindex mabi=no-spe
10820 Disable Booke SPE ABI extensions for the current ABI@.
10821
10822 @item -msecure-plt
10823 @opindex msecure-plt
10824 Generate code that allows ld and ld.so to build executables and shared
10825 libraries with non-exec .plt and .got sections.  This is a PowerPC
10826 32-bit SYSV ABI option.
10827
10828 @item -mbss-plt
10829 @opindex mbss-plt
10830 Generate code that uses a BSS .plt section that ld.so fills in, and
10831 requires .plt and .got sections that are both writable and executable.
10832 This is a PowerPC 32-bit SYSV ABI option.
10833
10834 @item -misel
10835 @itemx -mno-isel
10836 @opindex misel
10837 @opindex mno-isel
10838 This switch enables or disables the generation of ISEL instructions.
10839
10840 @item -misel=@var{yes/no}
10841 This switch has been deprecated.  Use @option{-misel} and
10842 @option{-mno-isel} instead.
10843
10844 @item -mspe
10845 @itemx -mno-isel
10846 @opindex mspe
10847 @opindex mno-spe
10848 This switch enables or disables the generation of SPE simd
10849 instructions.
10850
10851 @item -mspe=@var{yes/no}
10852 This option has been deprecated.  Use @option{-mspe} and
10853 @option{-mno-spe} instead.
10854
10855 @item -mfloat-gprs=@var{yes/single/double/no}
10856 @itemx -mfloat-gprs
10857 @opindex mfloat-gprs
10858 This switch enables or disables the generation of floating point
10859 operations on the general purpose registers for architectures that
10860 support it.
10861
10862 The argument @var{yes} or @var{single} enables the use of
10863 single-precision floating point operations.
10864
10865 The argument @var{double} enables the use of single and
10866 double-precision floating point operations.
10867
10868 The argument @var{no} disables floating point operations on the
10869 general purpose registers.
10870
10871 This option is currently only available on the MPC854x.
10872
10873 @item -m32
10874 @itemx -m64
10875 @opindex m32
10876 @opindex m64
10877 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
10878 targets (including GNU/Linux).  The 32-bit environment sets int, long
10879 and pointer to 32 bits and generates code that runs on any PowerPC
10880 variant.  The 64-bit environment sets int to 32 bits and long and
10881 pointer to 64 bits, and generates code for PowerPC64, as for
10882 @option{-mpowerpc64}.
10883
10884 @item -mfull-toc
10885 @itemx -mno-fp-in-toc
10886 @itemx -mno-sum-in-toc
10887 @itemx -mminimal-toc
10888 @opindex mfull-toc
10889 @opindex mno-fp-in-toc
10890 @opindex mno-sum-in-toc
10891 @opindex mminimal-toc
10892 Modify generation of the TOC (Table Of Contents), which is created for
10893 every executable file.  The @option{-mfull-toc} option is selected by
10894 default.  In that case, GCC will allocate at least one TOC entry for
10895 each unique non-automatic variable reference in your program.  GCC
10896 will also place floating-point constants in the TOC@.  However, only
10897 16,384 entries are available in the TOC@.
10898
10899 If you receive a linker error message that saying you have overflowed
10900 the available TOC space, you can reduce the amount of TOC space used
10901 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
10902 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
10903 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
10904 generate code to calculate the sum of an address and a constant at
10905 run-time instead of putting that sum into the TOC@.  You may specify one
10906 or both of these options.  Each causes GCC to produce very slightly
10907 slower and larger code at the expense of conserving TOC space.
10908
10909 If you still run out of space in the TOC even when you specify both of
10910 these options, specify @option{-mminimal-toc} instead.  This option causes
10911 GCC to make only one TOC entry for every file.  When you specify this
10912 option, GCC will produce code that is slower and larger but which
10913 uses extremely little TOC space.  You may wish to use this option
10914 only on files that contain less frequently executed code.
10915
10916 @item -maix64
10917 @itemx -maix32
10918 @opindex maix64
10919 @opindex maix32
10920 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
10921 @code{long} type, and the infrastructure needed to support them.
10922 Specifying @option{-maix64} implies @option{-mpowerpc64} and
10923 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
10924 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
10925
10926 @item -mxl-compat
10927 @itemx -mno-xl-compat
10928 @opindex mxl-compat
10929 @opindex mno-xl-compat
10930 Produce code that conforms more closely to IBM XLC semantics when using
10931 AIX-compatible ABI.  Pass floating-point arguments to prototyped
10932 functions beyond the register save area (RSA) on the stack in addition
10933 to argument FPRs.  Do not assume that most significant double in 128
10934 bit long double value is properly rounded when comparing values.
10935
10936 The AIX calling convention was extended but not initially documented to
10937 handle an obscure K&R C case of calling a function that takes the
10938 address of its arguments with fewer arguments than declared.  AIX XL
10939 compilers access floating point arguments which do not fit in the
10940 RSA from the stack when a subroutine is compiled without
10941 optimization.  Because always storing floating-point arguments on the
10942 stack is inefficient and rarely needed, this option is not enabled by
10943 default and only is necessary when calling subroutines compiled by AIX
10944 XL compilers without optimization.
10945
10946 @item -mpe
10947 @opindex mpe
10948 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
10949 application written to use message passing with special startup code to
10950 enable the application to run.  The system must have PE installed in the
10951 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
10952 must be overridden with the @option{-specs=} option to specify the
10953 appropriate directory location.  The Parallel Environment does not
10954 support threads, so the @option{-mpe} option and the @option{-pthread}
10955 option are incompatible.
10956
10957 @item -malign-natural
10958 @itemx -malign-power
10959 @opindex malign-natural
10960 @opindex malign-power
10961 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
10962 @option{-malign-natural} overrides the ABI-defined alignment of larger
10963 types, such as floating-point doubles, on their natural size-based boundary.
10964 The option @option{-malign-power} instructs GCC to follow the ABI-specified
10965 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
10966
10967 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
10968 is not supported.
10969
10970 @item -msoft-float
10971 @itemx -mhard-float
10972 @opindex msoft-float
10973 @opindex mhard-float
10974 Generate code that does not use (uses) the floating-point register set.
10975 Software floating point emulation is provided if you use the
10976 @option{-msoft-float} option, and pass the option to GCC when linking.
10977
10978 @item -mmultiple
10979 @itemx -mno-multiple
10980 @opindex mmultiple
10981 @opindex mno-multiple
10982 Generate code that uses (does not use) the load multiple word
10983 instructions and the store multiple word instructions.  These
10984 instructions are generated by default on POWER systems, and not
10985 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
10986 endian PowerPC systems, since those instructions do not work when the
10987 processor is in little endian mode.  The exceptions are PPC740 and
10988 PPC750 which permit the instructions usage in little endian mode.
10989
10990 @item -mstring
10991 @itemx -mno-string
10992 @opindex mstring
10993 @opindex mno-string
10994 Generate code that uses (does not use) the load string instructions
10995 and the store string word instructions to save multiple registers and
10996 do small block moves.  These instructions are generated by default on
10997 POWER systems, and not generated on PowerPC systems.  Do not use
10998 @option{-mstring} on little endian PowerPC systems, since those
10999 instructions do not work when the processor is in little endian mode.
11000 The exceptions are PPC740 and PPC750 which permit the instructions
11001 usage in little endian mode.
11002
11003 @item -mupdate
11004 @itemx -mno-update
11005 @opindex mupdate
11006 @opindex mno-update
11007 Generate code that uses (does not use) the load or store instructions
11008 that update the base register to the address of the calculated memory
11009 location.  These instructions are generated by default.  If you use
11010 @option{-mno-update}, there is a small window between the time that the
11011 stack pointer is updated and the address of the previous frame is
11012 stored, which means code that walks the stack frame across interrupts or
11013 signals may get corrupted data.
11014
11015 @item -mfused-madd
11016 @itemx -mno-fused-madd
11017 @opindex mfused-madd
11018 @opindex mno-fused-madd
11019 Generate code that uses (does not use) the floating point multiply and
11020 accumulate instructions.  These instructions are generated by default if
11021 hardware floating is used.
11022
11023 @item -mno-bit-align
11024 @itemx -mbit-align
11025 @opindex mno-bit-align
11026 @opindex mbit-align
11027 On System V.4 and embedded PowerPC systems do not (do) force structures
11028 and unions that contain bit-fields to be aligned to the base type of the
11029 bit-field.
11030
11031 For example, by default a structure containing nothing but 8
11032 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
11033 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
11034 the structure would be aligned to a 1 byte boundary and be one byte in
11035 size.
11036
11037 @item -mno-strict-align
11038 @itemx -mstrict-align
11039 @opindex mno-strict-align
11040 @opindex mstrict-align
11041 On System V.4 and embedded PowerPC systems do not (do) assume that
11042 unaligned memory references will be handled by the system.
11043
11044 @item -mrelocatable
11045 @itemx -mno-relocatable
11046 @opindex mrelocatable
11047 @opindex mno-relocatable
11048 On embedded PowerPC systems generate code that allows (does not allow)
11049 the program to be relocated to a different address at runtime.  If you
11050 use @option{-mrelocatable} on any module, all objects linked together must
11051 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
11052
11053 @item -mrelocatable-lib
11054 @itemx -mno-relocatable-lib
11055 @opindex mrelocatable-lib
11056 @opindex mno-relocatable-lib
11057 On embedded PowerPC systems generate code that allows (does not allow)
11058 the program to be relocated to a different address at runtime.  Modules
11059 compiled with @option{-mrelocatable-lib} can be linked with either modules
11060 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
11061 with modules compiled with the @option{-mrelocatable} options.
11062
11063 @item -mno-toc
11064 @itemx -mtoc
11065 @opindex mno-toc
11066 @opindex mtoc
11067 On System V.4 and embedded PowerPC systems do not (do) assume that
11068 register 2 contains a pointer to a global area pointing to the addresses
11069 used in the program.
11070
11071 @item -mlittle
11072 @itemx -mlittle-endian
11073 @opindex mlittle
11074 @opindex mlittle-endian
11075 On System V.4 and embedded PowerPC systems compile code for the
11076 processor in little endian mode.  The @option{-mlittle-endian} option is
11077 the same as @option{-mlittle}.
11078
11079 @item -mbig
11080 @itemx -mbig-endian
11081 @opindex mbig
11082 @opindex mbig-endian
11083 On System V.4 and embedded PowerPC systems compile code for the
11084 processor in big endian mode.  The @option{-mbig-endian} option is
11085 the same as @option{-mbig}.
11086
11087 @item -mdynamic-no-pic
11088 @opindex mdynamic-no-pic
11089 On Darwin and Mac OS X systems, compile code so that it is not
11090 relocatable, but that its external references are relocatable.  The
11091 resulting code is suitable for applications, but not shared
11092 libraries.
11093
11094 @item -mprioritize-restricted-insns=@var{priority}
11095 @opindex mprioritize-restricted-insns
11096 This option controls the priority that is assigned to
11097 dispatch-slot restricted instructions during the second scheduling
11098 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
11099 @var{no/highest/second-highest} priority to dispatch slot restricted
11100 instructions.
11101
11102 @item -msched-costly-dep=@var{dependence_type}
11103 @opindex msched-costly-dep
11104 This option controls which dependences are considered costly
11105 by the target during instruction scheduling.  The argument
11106 @var{dependence_type} takes one of the following values:
11107 @var{no}: no dependence is costly,
11108 @var{all}: all dependences are costly,
11109 @var{true_store_to_load}: a true dependence from store to load is costly,
11110 @var{store_to_load}: any dependence from store to load is costly,
11111 @var{number}: any dependence which latency >= @var{number} is costly.
11112
11113 @item -minsert-sched-nops=@var{scheme}
11114 @opindex minsert-sched-nops
11115 This option controls which nop insertion scheme will be used during
11116 the second scheduling pass.  The argument @var{scheme} takes one of the
11117 following values:
11118 @var{no}: Don't insert nops.
11119 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
11120 according to the scheduler's grouping.
11121 @var{regroup_exact}: Insert nops to force costly dependent insns into
11122 separate groups.  Insert exactly as many nops as needed to force an insn
11123 to a new group, according to the estimated processor grouping.
11124 @var{number}: Insert nops to force costly dependent insns into
11125 separate groups.  Insert @var{number} nops to force an insn to a new group.
11126
11127 @item -mcall-sysv
11128 @opindex mcall-sysv
11129 On System V.4 and embedded PowerPC systems compile code using calling
11130 conventions that adheres to the March 1995 draft of the System V
11131 Application Binary Interface, PowerPC processor supplement.  This is the
11132 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
11133
11134 @item -mcall-sysv-eabi
11135 @opindex mcall-sysv-eabi
11136 Specify both @option{-mcall-sysv} and @option{-meabi} options.
11137
11138 @item -mcall-sysv-noeabi
11139 @opindex mcall-sysv-noeabi
11140 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
11141
11142 @item -mcall-solaris
11143 @opindex mcall-solaris
11144 On System V.4 and embedded PowerPC systems compile code for the Solaris
11145 operating system.
11146
11147 @item -mcall-linux
11148 @opindex mcall-linux
11149 On System V.4 and embedded PowerPC systems compile code for the
11150 Linux-based GNU system.
11151
11152 @item -mcall-gnu
11153 @opindex mcall-gnu
11154 On System V.4 and embedded PowerPC systems compile code for the
11155 Hurd-based GNU system.
11156
11157 @item -mcall-netbsd
11158 @opindex mcall-netbsd
11159 On System V.4 and embedded PowerPC systems compile code for the
11160 NetBSD operating system.
11161
11162 @item -maix-struct-return
11163 @opindex maix-struct-return
11164 Return all structures in memory (as specified by the AIX ABI)@.
11165
11166 @item -msvr4-struct-return
11167 @opindex msvr4-struct-return
11168 Return structures smaller than 8 bytes in registers (as specified by the
11169 SVR4 ABI)@.
11170
11171 @item -mabi=@var{abi-type}
11172 @opindex mabi
11173 Extend the current ABI with a particular extension, or remove such extension.
11174 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
11175 @var{no-spe}@.
11176
11177 @item -mprototype
11178 @itemx -mno-prototype
11179 @opindex mprototype
11180 @opindex mno-prototype
11181 On System V.4 and embedded PowerPC systems assume that all calls to
11182 variable argument functions are properly prototyped.  Otherwise, the
11183 compiler must insert an instruction before every non prototyped call to
11184 set or clear bit 6 of the condition code register (@var{CR}) to
11185 indicate whether floating point values were passed in the floating point
11186 registers in case the function takes a variable arguments.  With
11187 @option{-mprototype}, only calls to prototyped variable argument functions
11188 will set or clear the bit.
11189
11190 @item -msim
11191 @opindex msim
11192 On embedded PowerPC systems, assume that the startup module is called
11193 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
11194 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
11195 configurations.
11196
11197 @item -mmvme
11198 @opindex mmvme
11199 On embedded PowerPC systems, assume that the startup module is called
11200 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
11201 @file{libc.a}.
11202
11203 @item -mads
11204 @opindex mads
11205 On embedded PowerPC systems, assume that the startup module is called
11206 @file{crt0.o} and the standard C libraries are @file{libads.a} and
11207 @file{libc.a}.
11208
11209 @item -myellowknife
11210 @opindex myellowknife
11211 On embedded PowerPC systems, assume that the startup module is called
11212 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
11213 @file{libc.a}.
11214
11215 @item -mvxworks
11216 @opindex mvxworks
11217 On System V.4 and embedded PowerPC systems, specify that you are
11218 compiling for a VxWorks system.
11219
11220 @item -mwindiss
11221 @opindex mwindiss
11222 Specify that you are compiling for the WindISS simulation environment.
11223
11224 @item -memb
11225 @opindex memb
11226 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
11227 header to indicate that @samp{eabi} extended relocations are used.
11228
11229 @item -meabi
11230 @itemx -mno-eabi
11231 @opindex meabi
11232 @opindex mno-eabi
11233 On System V.4 and embedded PowerPC systems do (do not) adhere to the
11234 Embedded Applications Binary Interface (eabi) which is a set of
11235 modifications to the System V.4 specifications.  Selecting @option{-meabi}
11236 means that the stack is aligned to an 8 byte boundary, a function
11237 @code{__eabi} is called to from @code{main} to set up the eabi
11238 environment, and the @option{-msdata} option can use both @code{r2} and
11239 @code{r13} to point to two separate small data areas.  Selecting
11240 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
11241 do not call an initialization function from @code{main}, and the
11242 @option{-msdata} option will only use @code{r13} to point to a single
11243 small data area.  The @option{-meabi} option is on by default if you
11244 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
11245
11246 @item -msdata=eabi
11247 @opindex msdata=eabi
11248 On System V.4 and embedded PowerPC systems, put small initialized
11249 @code{const} global and static data in the @samp{.sdata2} section, which
11250 is pointed to by register @code{r2}.  Put small initialized
11251 non-@code{const} global and static data in the @samp{.sdata} section,
11252 which is pointed to by register @code{r13}.  Put small uninitialized
11253 global and static data in the @samp{.sbss} section, which is adjacent to
11254 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
11255 incompatible with the @option{-mrelocatable} option.  The
11256 @option{-msdata=eabi} option also sets the @option{-memb} option.
11257
11258 @item -msdata=sysv
11259 @opindex msdata=sysv
11260 On System V.4 and embedded PowerPC systems, put small global and static
11261 data in the @samp{.sdata} section, which is pointed to by register
11262 @code{r13}.  Put small uninitialized global and static data in the
11263 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
11264 The @option{-msdata=sysv} option is incompatible with the
11265 @option{-mrelocatable} option.
11266
11267 @item -msdata=default
11268 @itemx -msdata
11269 @opindex msdata=default
11270 @opindex msdata
11271 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
11272 compile code the same as @option{-msdata=eabi}, otherwise compile code the
11273 same as @option{-msdata=sysv}.
11274
11275 @item -msdata-data
11276 @opindex msdata-data
11277 On System V.4 and embedded PowerPC systems, put small global and static
11278 data in the @samp{.sdata} section.  Put small uninitialized global and
11279 static data in the @samp{.sbss} section.  Do not use register @code{r13}
11280 to address small data however.  This is the default behavior unless
11281 other @option{-msdata} options are used.
11282
11283 @item -msdata=none
11284 @itemx -mno-sdata
11285 @opindex msdata=none
11286 @opindex mno-sdata
11287 On embedded PowerPC systems, put all initialized global and static data
11288 in the @samp{.data} section, and all uninitialized data in the
11289 @samp{.bss} section.
11290
11291 @item -G @var{num}
11292 @opindex G
11293 @cindex smaller data references (PowerPC)
11294 @cindex .sdata/.sdata2 references (PowerPC)
11295 On embedded PowerPC systems, put global and static items less than or
11296 equal to @var{num} bytes into the small data or bss sections instead of
11297 the normal data or bss section.  By default, @var{num} is 8.  The
11298 @option{-G @var{num}} switch is also passed to the linker.
11299 All modules should be compiled with the same @option{-G @var{num}} value.
11300
11301 @item -mregnames
11302 @itemx -mno-regnames
11303 @opindex mregnames
11304 @opindex mno-regnames
11305 On System V.4 and embedded PowerPC systems do (do not) emit register
11306 names in the assembly language output using symbolic forms.
11307
11308 @item -mlongcall
11309 @itemx -mno-longcall
11310 @opindex mlongcall
11311 @opindex mno-longcall
11312 Default to making all function calls indirectly, using a register, so
11313 that functions which reside further than 32 megabytes (33,554,432
11314 bytes) from the current location can be called.  This setting can be
11315 overridden by the @code{shortcall} function attribute, or by
11316 @code{#pragma longcall(0)}.
11317
11318 Some linkers are capable of detecting out-of-range calls and generating
11319 glue code on the fly.  On these systems, long calls are unnecessary and
11320 generate slower code.  As of this writing, the AIX linker can do this,
11321 as can the GNU linker for PowerPC/64.  It is planned to add this feature
11322 to the GNU linker for 32-bit PowerPC systems as well.
11323
11324 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
11325 callee, L42'', plus a ``branch island'' (glue code).  The two target
11326 addresses represent the callee and the ``branch island''.  The
11327 Darwin/PPC linker will prefer the first address and generate a ``bl
11328 callee'' if the PPC ``bl'' instruction will reach the callee directly;
11329 otherwise, the linker will generate ``bl L42'' to call the ``branch
11330 island''.  The ``branch island'' is appended to the body of the
11331 calling function; it computes the full 32-bit address of the callee
11332 and jumps to it.
11333
11334 On Mach-O (Darwin) systems, this option directs the compiler emit to
11335 the glue for every direct call, and the Darwin linker decides whether
11336 to use or discard it.
11337
11338 In the future, we may cause GCC to ignore all longcall specifications
11339 when the linker is known to generate glue.
11340
11341 @item -pthread
11342 @opindex pthread
11343 Adds support for multithreading with the @dfn{pthreads} library.
11344 This option sets flags for both the preprocessor and linker.
11345
11346 @end table
11347
11348 @node S/390 and zSeries Options
11349 @subsection S/390 and zSeries Options
11350 @cindex S/390 and zSeries Options
11351
11352 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
11353
11354 @table @gcctabopt
11355 @item -mhard-float
11356 @itemx -msoft-float
11357 @opindex mhard-float
11358 @opindex msoft-float
11359 Use (do not use) the hardware floating-point instructions and registers
11360 for floating-point operations.  When @option{-msoft-float} is specified,
11361 functions in @file{libgcc.a} will be used to perform floating-point
11362 operations.  When @option{-mhard-float} is specified, the compiler
11363 generates IEEE floating-point instructions.  This is the default.
11364
11365 @item -mbackchain
11366 @itemx -mno-backchain
11367 @opindex mbackchain
11368 @opindex mno-backchain
11369 Store (do not store) the address of the caller's frame as backchain pointer
11370 into the callee's stack frame.
11371 A backchain may be needed to allow debugging using tools that do not understand
11372 DWARF-2 call frame information.
11373 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
11374 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
11375 the backchain is placed into the topmost word of the 96/160 byte register
11376 save area.
11377
11378 In general, code compiled with @option{-mbackchain} is call-compatible with
11379 code compiled with @option{-mmo-backchain}; however, use of the backchain
11380 for debugging purposes usually requires that the whole binary is built with
11381 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
11382 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
11383 to build a linux kernel use @option{-msoft-float}.
11384
11385 The default is to not maintain the backchain.
11386
11387 @item -mpacked-stack
11388 @item -mno-packed-stack
11389 @opindex mpacked-stack
11390 @opindex mno-packed-stack
11391 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
11392 specified, the compiler uses the all fields of the 96/160 byte register save
11393 area only for their default purpose; unused fields still take up stack space.
11394 When @option{-mpacked-stack} is specified, register save slots are densely
11395 packed at the top of the register save area; unused space is reused for other
11396 purposes, allowing for more efficient use of the available stack space.
11397 However, when @option{-mbackchain} is also in effect, the topmost word of
11398 the save area is always used to store the backchain, and the return address
11399 register is always saved two words below the backchain.
11400
11401 As long as the stack frame backchain is not used, code generated with
11402 @option{-mpacked-stack} is call-compatible with code generated with
11403 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
11404 S/390 or zSeries generated code that uses the stack frame backchain at run
11405 time, not just for debugging purposes.  Such code is not call-compatible
11406 with code compiled with @option{-mpacked-stack}.  Also, note that the
11407 combination of @option{-mbackchain},
11408 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
11409 to build a linux kernel use @option{-msoft-float}.
11410
11411 The default is to not use the packed stack layout.
11412
11413 @item -msmall-exec
11414 @itemx -mno-small-exec
11415 @opindex msmall-exec
11416 @opindex mno-small-exec
11417 Generate (or do not generate) code using the @code{bras} instruction
11418 to do subroutine calls.
11419 This only works reliably if the total executable size does not
11420 exceed 64k.  The default is to use the @code{basr} instruction instead,
11421 which does not have this limitation.
11422
11423 @item -m64
11424 @itemx -m31
11425 @opindex m64
11426 @opindex m31
11427 When @option{-m31} is specified, generate code compliant to the
11428 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
11429 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
11430 particular to generate 64-bit instructions.  For the @samp{s390}
11431 targets, the default is @option{-m31}, while the @samp{s390x}
11432 targets default to @option{-m64}.
11433
11434 @item -mzarch
11435 @itemx -mesa
11436 @opindex mzarch
11437 @opindex mesa
11438 When @option{-mzarch} is specified, generate code using the
11439 instructions available on z/Architecture.
11440 When @option{-mesa} is specified, generate code using the
11441 instructions available on ESA/390.  Note that @option{-mesa} is
11442 not possible with @option{-m64}.
11443 When generating code compliant to the GNU/Linux for S/390 ABI,
11444 the default is @option{-mesa}.  When generating code compliant
11445 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
11446
11447 @item -mmvcle
11448 @itemx -mno-mvcle
11449 @opindex mmvcle
11450 @opindex mno-mvcle
11451 Generate (or do not generate) code using the @code{mvcle} instruction
11452 to perform block moves.  When @option{-mno-mvcle} is specified,
11453 use a @code{mvc} loop instead.  This is the default unless optimizing for
11454 size.
11455
11456 @item -mdebug
11457 @itemx -mno-debug
11458 @opindex mdebug
11459 @opindex mno-debug
11460 Print (or do not print) additional debug information when compiling.
11461 The default is to not print debug information.
11462
11463 @item -march=@var{cpu-type}
11464 @opindex march
11465 Generate code that will run on @var{cpu-type}, which is the name of a system
11466 representing a certain processor type.  Possible values for
11467 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
11468 When generating code using the instructions available on z/Architecture,
11469 the default is @option{-march=z900}.  Otherwise, the default is
11470 @option{-march=g5}.
11471
11472 @item -mtune=@var{cpu-type}
11473 @opindex mtune
11474 Tune to @var{cpu-type} everything applicable about the generated code,
11475 except for the ABI and the set of available instructions.
11476 The list of @var{cpu-type} values is the same as for @option{-march}.
11477 The default is the value used for @option{-march}.
11478
11479 @item -mtpf-trace
11480 @itemx -mno-tpf-trace
11481 @opindex mtpf-trace
11482 @opindex mno-tpf-trace
11483 Generate code that adds (does not add) in TPF OS specific branches to trace
11484 routines in the operating system.  This option is off by default, even
11485 when compiling for the TPF OS@.
11486
11487 @item -mfused-madd
11488 @itemx -mno-fused-madd
11489 @opindex mfused-madd
11490 @opindex mno-fused-madd
11491 Generate code that uses (does not use) the floating point multiply and
11492 accumulate instructions.  These instructions are generated by default if
11493 hardware floating point is used.
11494
11495 @item -mwarn-framesize=@var{framesize}
11496 @opindex mwarn-framesize
11497 Emit a warning if the current function exceeds the given frame size.  Because
11498 this is a compile time check it doesn't need to be a real problem when the program
11499 runs.  It is intended to identify functions which most probably cause
11500 a stack overflow.  It is useful to be used in an environment with limited stack
11501 size e.g.@: the linux kernel.
11502
11503 @item -mwarn-dynamicstack
11504 @opindex mwarn-dynamicstack
11505 Emit a warning if the function calls alloca or uses dynamically
11506 sized arrays.  This is generally a bad idea with a limited stack size.
11507
11508 @item -mstack-guard=@var{stack-guard}
11509 @item -mstack-size=@var{stack-size}
11510 @opindex mstack-guard
11511 @opindex mstack-size
11512 These arguments always have to be used in conjunction.  If they are present the s390
11513 back end emits additional instructions in the function prologue which trigger a trap
11514 if the stack size is @var{stack-guard} bytes above the @var{stack-size}
11515 (remember that the stack on s390 grows downward).  These options are intended to
11516 be used to help debugging stack overflow problems.  The additionally emitted code
11517 cause only little overhead and hence can also be used in production like systems
11518 without greater performance degradation.  The given values have to be exact
11519 powers of 2 and @var{stack-size} has to be greater than @var{stack-guard}.
11520 In order to be efficient the extra code makes the assumption that the stack starts
11521 at an address aligned to the value given by @var{stack-size}.
11522 @end table
11523
11524 @node SH Options
11525 @subsection SH Options
11526
11527 These @samp{-m} options are defined for the SH implementations:
11528
11529 @table @gcctabopt
11530 @item -m1
11531 @opindex m1
11532 Generate code for the SH1.
11533
11534 @item -m2
11535 @opindex m2
11536 Generate code for the SH2.
11537
11538 @item -m2e
11539 Generate code for the SH2e.
11540
11541 @item -m3
11542 @opindex m3
11543 Generate code for the SH3.
11544
11545 @item -m3e
11546 @opindex m3e
11547 Generate code for the SH3e.
11548
11549 @item -m4-nofpu
11550 @opindex m4-nofpu
11551 Generate code for the SH4 without a floating-point unit.
11552
11553 @item -m4-single-only
11554 @opindex m4-single-only
11555 Generate code for the SH4 with a floating-point unit that only
11556 supports single-precision arithmetic.
11557
11558 @item -m4-single
11559 @opindex m4-single
11560 Generate code for the SH4 assuming the floating-point unit is in
11561 single-precision mode by default.
11562
11563 @item -m4
11564 @opindex m4
11565 Generate code for the SH4.
11566
11567 @item -m4a-nofpu
11568 @opindex m4a-nofpu
11569 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
11570 floating-point unit is not used.
11571
11572 @item -m4a-single-only
11573 @opindex m4a-single-only
11574 Generate code for the SH4a, in such a way that no double-precision
11575 floating point operations are used.
11576
11577 @item -m4a-single
11578 @opindex m4a-single
11579 Generate code for the SH4a assuming the floating-point unit is in
11580 single-precision mode by default.
11581
11582 @item -m4a
11583 @opindex m4a
11584 Generate code for the SH4a.
11585
11586 @item -m4al
11587 @opindex m4al
11588 Same as @option{-m4a-nofpu}, except that it implicitly passes
11589 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
11590 instructions at the moment.
11591
11592 @item -mb
11593 @opindex mb
11594 Compile code for the processor in big endian mode.
11595
11596 @item -ml
11597 @opindex ml
11598 Compile code for the processor in little endian mode.
11599
11600 @item -mdalign
11601 @opindex mdalign
11602 Align doubles at 64-bit boundaries.  Note that this changes the calling
11603 conventions, and thus some functions from the standard C library will
11604 not work unless you recompile it first with @option{-mdalign}.
11605
11606 @item -mrelax
11607 @opindex mrelax
11608 Shorten some address references at link time, when possible; uses the
11609 linker option @option{-relax}.
11610
11611 @item -mbigtable
11612 @opindex mbigtable
11613 Use 32-bit offsets in @code{switch} tables.  The default is to use
11614 16-bit offsets.
11615
11616 @item -mfmovd
11617 @opindex mfmovd
11618 Enable the use of the instruction @code{fmovd}.
11619
11620 @item -mhitachi
11621 @opindex mhitachi
11622 Comply with the calling conventions defined by Renesas.
11623
11624 @item -mrenesas
11625 @opindex mhitachi
11626 Comply with the calling conventions defined by Renesas.
11627
11628 @item -mno-renesas
11629 @opindex mhitachi
11630 Comply with the calling conventions defined for GCC before the Renesas
11631 conventions were available.  This option is the default for all
11632 targets of the SH toolchain except for @samp{sh-symbianelf}.
11633
11634 @item -mnomacsave
11635 @opindex mnomacsave
11636 Mark the @code{MAC} register as call-clobbered, even if
11637 @option{-mhitachi} is given.
11638
11639 @item -mieee
11640 @opindex mieee
11641 Increase IEEE-compliance of floating-point code.
11642 At the moment, this is equivalent to @option{-fno-finite-math-only}.
11643 When generating 16 bit SH opcodes, getting IEEE-conforming results for
11644 comparisons of NANs / infinities incurs extra overhead in every
11645 floating point comparison, therefore the default is set to
11646 @option{-ffinite-math-only}.
11647
11648 @item -misize
11649 @opindex misize
11650 Dump instruction size and location in the assembly code.
11651
11652 @item -mpadstruct
11653 @opindex mpadstruct
11654 This option is deprecated.  It pads structures to multiple of 4 bytes,
11655 which is incompatible with the SH ABI@.
11656
11657 @item -mspace
11658 @opindex mspace
11659 Optimize for space instead of speed.  Implied by @option{-Os}.
11660
11661 @item -mprefergot
11662 @opindex mprefergot
11663 When generating position-independent code, emit function calls using
11664 the Global Offset Table instead of the Procedure Linkage Table.
11665
11666 @item -musermode
11667 @opindex musermode
11668 Generate a library function call to invalidate instruction cache
11669 entries, after fixing up a trampoline.  This library function call
11670 doesn't assume it can write to the whole memory address space.  This
11671 is the default when the target is @code{sh-*-linux*}.
11672
11673 @item -multcost=@var{number}
11674 @opindex multcost=@var{number}
11675 Set the cost to assume for a multiply insn.
11676
11677 @item -mdiv=@var{strategy}
11678 @opindex mdiv=@var{strategy}
11679 Set the division strategy to use for SHmedia code.  @var{strategy} must be
11680 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
11681 inv:call2, inv:fp .
11682 "fp" performs the operation in floating point.  This has a very high latency,
11683 but needs only a few instructions, so it might be a good choice if
11684 your code has enough easily exploitable ILP to allow the compiler to
11685 schedule the floating point instructions together with other instructions.
11686 Division by zero causes a floating point exception.
11687 "inv" uses integer operations to calculate the inverse of the divisor,
11688 and then multiplies the dividend with the inverse.  This strategy allows
11689 cse and hoisting of the inverse calculation.  Division by zero calculates
11690 an unspecified result, but does not trap.
11691 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
11692 have been found, or if the entire operation has been hoisted to the same
11693 place, the last stages of the inverse calculation are intertwined with the
11694 final multiply to reduce the overall latency, at the expense of using a few
11695 more instructions, and thus offering fewer scheduling opportunities with
11696 other code.
11697 "call" calls a library function that usually implements the inv:minlat
11698 strategy.
11699 This gives high code density for m5-*media-nofpu compilations.
11700 "call2" uses a different entry point of the same library function, where it
11701 assumes that a pointer to a lookup table has already been set up, which
11702 exposes the pointer load to cse / code hoisting optimizations.
11703 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
11704 code generation, but if the code stays unoptimized, revert to the "call",
11705 "call2", or "fp" strategies, respectively.  Note that the
11706 potentially-trapping side effect of division by zero is carried by a
11707 separate instruction, so it is possible that all the integer instructions
11708 are hoisted out, but the marker for the side effect stays where it is.
11709 A recombination to fp operations or a call is not possible in that case.
11710 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
11711 that the inverse calculation was nor separated from the multiply, they speed
11712 up division where the dividend fits into 20 bits (plus sign where applicable),
11713 by inserting a test to skip a number of operations in this case; this test
11714 slows down the case of larger dividends.  inv20u assumes the case of a such
11715 a small dividend to be unlikely, and inv20l assumes it to be likely.
11716
11717 @item -mdivsi3_libfunc=@var{name}
11718 @opindex mdivsi3_libfunc=@var{name}
11719 Set the name of the library function used for 32 bit signed division to
11720 @var{name}.  This only affect the name used in the call and inv:call
11721 division strategies, and the compiler will still expect the same
11722 sets of input/output/clobbered registers as if this option was not present.
11723
11724 @item -madjust-unroll
11725 @opindex madjust-unroll
11726 Throttle unrolling to avoid thrashing target registers.
11727 This option only has an effect if the gcc code base supports the
11728 TARGET_ADJUST_UNROLL_MAX target hook.
11729
11730 @item -mindexed-addressing
11731 @opindex mindexed-addressing
11732 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
11733 This is only safe if the hardware and/or OS implement 32 bit wrap-around
11734 semantics for the indexed addressing mode.  The architecture allows the
11735 implementation of processors with 64 bit MMU, which the OS could use to
11736 get 32 bit addressing, but since no current hardware implementation supports
11737 this or any other way to make the indexed addressing mode safe to use in
11738 the 32 bit ABI, the default is -mno-indexed-addressing.
11739
11740 @item -mgettrcost=@var{number}
11741 @opindex mgettrcost=@var{number}
11742 Set the cost assumed for the gettr instruction to @var{number}.
11743 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
11744
11745 @item -mpt-fixed
11746 @opindex mpt-fixed
11747 Assume pt* instructions won't trap.  This will generally generate better
11748 scheduled code, but is unsafe on current hardware.  The current architecture
11749 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
11750 This has the unintentional effect of making it unsafe to schedule ptabs /
11751 ptrel before a branch, or hoist it out of a loop.  For example,
11752 __do_global_ctors, a part of libgcc that runs constructors at program
11753 startup, calls functions in a list which is delimited by -1.  With the
11754 -mpt-fixed option, the ptabs will be done before testing against -1.
11755 That means that all the constructors will be run a bit quicker, but when
11756 the loop comes to the end of the list, the program crashes because ptabs
11757 loads -1 into a target register.  Since this option is unsafe for any
11758 hardware implementing the current architecture specification, the default
11759 is -mno-pt-fixed.  Unless the user specifies a specific cost with
11760 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
11761 this deters register allocation using target registers for storing
11762 ordinary integers.
11763
11764 @item -minvalid-symbols
11765 @opindex minvalid-symbols
11766 Assume symbols might be invalid.  Ordinary function symbols generated by
11767 the compiler will always be valid to load with movi/shori/ptabs or
11768 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
11769 to generate symbols that will cause ptabs / ptrel to trap.
11770 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
11771 It will then prevent cross-basic-block cse, hoisting and most scheduling
11772 of symbol loads.  The default is @option{-mno-invalid-symbols}.
11773 @end table
11774
11775 @node SPARC Options
11776 @subsection SPARC Options
11777 @cindex SPARC options
11778
11779 These @samp{-m} options are supported on the SPARC:
11780
11781 @table @gcctabopt
11782 @item -mno-app-regs
11783 @itemx -mapp-regs
11784 @opindex mno-app-regs
11785 @opindex mapp-regs
11786 Specify @option{-mapp-regs} to generate output using the global registers
11787 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
11788 is the default.
11789
11790 To be fully SVR4 ABI compliant at the cost of some performance loss,
11791 specify @option{-mno-app-regs}.  You should compile libraries and system
11792 software with this option.
11793
11794 @item -mfpu
11795 @itemx -mhard-float
11796 @opindex mfpu
11797 @opindex mhard-float
11798 Generate output containing floating point instructions.  This is the
11799 default.
11800
11801 @item -mno-fpu
11802 @itemx -msoft-float
11803 @opindex mno-fpu
11804 @opindex msoft-float
11805 Generate output containing library calls for floating point.
11806 @strong{Warning:} the requisite libraries are not available for all SPARC
11807 targets.  Normally the facilities of the machine's usual C compiler are
11808 used, but this cannot be done directly in cross-compilation.  You must make
11809 your own arrangements to provide suitable library functions for
11810 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
11811 @samp{sparclite-*-*} do provide software floating point support.
11812
11813 @option{-msoft-float} changes the calling convention in the output file;
11814 therefore, it is only useful if you compile @emph{all} of a program with
11815 this option.  In particular, you need to compile @file{libgcc.a}, the
11816 library that comes with GCC, with @option{-msoft-float} in order for
11817 this to work.
11818
11819 @item -mhard-quad-float
11820 @opindex mhard-quad-float
11821 Generate output containing quad-word (long double) floating point
11822 instructions.
11823
11824 @item -msoft-quad-float
11825 @opindex msoft-quad-float
11826 Generate output containing library calls for quad-word (long double)
11827 floating point instructions.  The functions called are those specified
11828 in the SPARC ABI@.  This is the default.
11829
11830 As of this writing, there are no SPARC implementations that have hardware
11831 support for the quad-word floating point instructions.  They all invoke
11832 a trap handler for one of these instructions, and then the trap handler
11833 emulates the effect of the instruction.  Because of the trap handler overhead,
11834 this is much slower than calling the ABI library routines.  Thus the
11835 @option{-msoft-quad-float} option is the default.
11836
11837 @item -mno-unaligned-doubles
11838 @itemx -munaligned-doubles
11839 @opindex mno-unaligned-doubles
11840 @opindex munaligned-doubles
11841 Assume that doubles have 8 byte alignment.  This is the default.
11842
11843 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
11844 alignment only if they are contained in another type, or if they have an
11845 absolute address.  Otherwise, it assumes they have 4 byte alignment.
11846 Specifying this option avoids some rare compatibility problems with code
11847 generated by other compilers.  It is not the default because it results
11848 in a performance loss, especially for floating point code.
11849
11850 @item -mno-faster-structs
11851 @itemx -mfaster-structs
11852 @opindex mno-faster-structs
11853 @opindex mfaster-structs
11854 With @option{-mfaster-structs}, the compiler assumes that structures
11855 should have 8 byte alignment.  This enables the use of pairs of
11856 @code{ldd} and @code{std} instructions for copies in structure
11857 assignment, in place of twice as many @code{ld} and @code{st} pairs.
11858 However, the use of this changed alignment directly violates the SPARC
11859 ABI@.  Thus, it's intended only for use on targets where the developer
11860 acknowledges that their resulting code will not be directly in line with
11861 the rules of the ABI@.
11862
11863 @item -mimpure-text
11864 @opindex mimpure-text
11865 @option{-mimpure-text}, used in addition to @option{-shared}, tells
11866 the compiler to not pass @option{-z text} to the linker when linking a
11867 shared object.  Using this option, you can link position-dependent
11868 code into a shared object.
11869
11870 @option{-mimpure-text} suppresses the ``relocations remain against
11871 allocatable but non-writable sections'' linker error message.
11872 However, the necessary relocations will trigger copy-on-write, and the
11873 shared object is not actually shared across processes.  Instead of
11874 using @option{-mimpure-text}, you should compile all source code with
11875 @option{-fpic} or @option{-fPIC}.
11876
11877 This option is only available on SunOS and Solaris.
11878
11879 @item -mcpu=@var{cpu_type}
11880 @opindex mcpu
11881 Set the instruction set, register set, and instruction scheduling parameters
11882 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
11883 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
11884 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
11885 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc}, and
11886 @samp{ultrasparc3}.
11887
11888 Default instruction scheduling parameters are used for values that select
11889 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
11890 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
11891
11892 Here is a list of each supported architecture and their supported
11893 implementations.
11894
11895 @smallexample
11896     v7:             cypress
11897     v8:             supersparc, hypersparc
11898     sparclite:      f930, f934, sparclite86x
11899     sparclet:       tsc701
11900     v9:             ultrasparc, ultrasparc3
11901 @end smallexample
11902
11903 By default (unless configured otherwise), GCC generates code for the V7
11904 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
11905 additionally optimizes it for the Cypress CY7C602 chip, as used in the
11906 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
11907 SPARCStation 1, 2, IPX etc.
11908
11909 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
11910 architecture.  The only difference from V7 code is that the compiler emits
11911 the integer multiply and integer divide instructions which exist in SPARC-V8
11912 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
11913 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
11914 2000 series.
11915
11916 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
11917 the SPARC architecture.  This adds the integer multiply, integer divide step
11918 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
11919 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
11920 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
11921 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
11922 MB86934 chip, which is the more recent SPARClite with FPU@.
11923
11924 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
11925 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
11926 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
11927 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
11928 optimizes it for the TEMIC SPARClet chip.
11929
11930 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
11931 architecture.  This adds 64-bit integer and floating-point move instructions,
11932 3 additional floating-point condition code registers and conditional move
11933 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
11934 optimizes it for the Sun UltraSPARC I/II chips.  With
11935 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
11936 Sun UltraSPARC III chip.
11937
11938 @item -mtune=@var{cpu_type}
11939 @opindex mtune
11940 Set the instruction scheduling parameters for machine type
11941 @var{cpu_type}, but do not set the instruction set or register set that the
11942 option @option{-mcpu=@var{cpu_type}} would.
11943
11944 The same values for @option{-mcpu=@var{cpu_type}} can be used for
11945 @option{-mtune=@var{cpu_type}}, but the only useful values are those
11946 that select a particular cpu implementation.  Those are @samp{cypress},
11947 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
11948 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, and
11949 @samp{ultrasparc3}.
11950
11951 @item -mv8plus
11952 @itemx -mno-v8plus
11953 @opindex mv8plus
11954 @opindex mno-v8plus
11955 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
11956 difference from the V8 ABI is that the global and out registers are
11957 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
11958 mode for all SPARC-V9 processors.
11959
11960 @item -mvis
11961 @itemx -mno-vis
11962 @opindex mvis
11963 @opindex mno-vis
11964 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
11965 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
11966 @end table
11967
11968 These @samp{-m} options are supported in addition to the above
11969 on SPARC-V9 processors in 64-bit environments:
11970
11971 @table @gcctabopt
11972 @item -mlittle-endian
11973 @opindex mlittle-endian
11974 Generate code for a processor running in little-endian mode.  It is only
11975 available for a few configurations and most notably not on Solaris and Linux.
11976
11977 @item -m32
11978 @itemx -m64
11979 @opindex m32
11980 @opindex m64
11981 Generate code for a 32-bit or 64-bit environment.
11982 The 32-bit environment sets int, long and pointer to 32 bits.
11983 The 64-bit environment sets int to 32 bits and long and pointer
11984 to 64 bits.
11985
11986 @item -mcmodel=medlow
11987 @opindex mcmodel=medlow
11988 Generate code for the Medium/Low code model: 64-bit addresses, programs
11989 must be linked in the low 32 bits of memory.  Programs can be statically
11990 or dynamically linked.
11991
11992 @item -mcmodel=medmid
11993 @opindex mcmodel=medmid
11994 Generate code for the Medium/Middle code model: 64-bit addresses, programs
11995 must be linked in the low 44 bits of memory, the text and data segments must
11996 be less than 2GB in size and the data segment must be located within 2GB of
11997 the text segment.
11998
11999 @item -mcmodel=medany
12000 @opindex mcmodel=medany
12001 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
12002 may be linked anywhere in memory, the text and data segments must be less
12003 than 2GB in size and the data segment must be located within 2GB of the
12004 text segment.
12005
12006 @item -mcmodel=embmedany
12007 @opindex mcmodel=embmedany
12008 Generate code for the Medium/Anywhere code model for embedded systems:
12009 64-bit addresses, the text and data segments must be less than 2GB in
12010 size, both starting anywhere in memory (determined at link time).  The
12011 global register %g4 points to the base of the data segment.  Programs
12012 are statically linked and PIC is not supported.
12013
12014 @item -mstack-bias
12015 @itemx -mno-stack-bias
12016 @opindex mstack-bias
12017 @opindex mno-stack-bias
12018 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
12019 frame pointer if present, are offset by @minus{}2047 which must be added back
12020 when making stack frame references.  This is the default in 64-bit mode.
12021 Otherwise, assume no such offset is present.
12022 @end table
12023
12024 These switches are supported in addition to the above on Solaris:
12025
12026 @table @gcctabopt
12027 @item -threads
12028 @opindex threads
12029 Add support for multithreading using the Solaris threads library.  This
12030 option sets flags for both the preprocessor and linker.  This option does
12031 not affect the thread safety of object code produced by the compiler or
12032 that of libraries supplied with it.
12033
12034 @item -pthreads
12035 @opindex pthreads
12036 Add support for multithreading using the POSIX threads library.  This
12037 option sets flags for both the preprocessor and linker.  This option does
12038 not affect the thread safety of object code produced  by the compiler or
12039 that of libraries supplied with it.
12040 @end table
12041
12042 @node System V Options
12043 @subsection Options for System V
12044
12045 These additional options are available on System V Release 4 for
12046 compatibility with other compilers on those systems:
12047
12048 @table @gcctabopt
12049 @item -G
12050 @opindex G
12051 Create a shared object.
12052 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
12053
12054 @item -Qy
12055 @opindex Qy
12056 Identify the versions of each tool used by the compiler, in a
12057 @code{.ident} assembler directive in the output.
12058
12059 @item -Qn
12060 @opindex Qn
12061 Refrain from adding @code{.ident} directives to the output file (this is
12062 the default).
12063
12064 @item -YP,@var{dirs}
12065 @opindex YP
12066 Search the directories @var{dirs}, and no others, for libraries
12067 specified with @option{-l}.
12068
12069 @item -Ym,@var{dir}
12070 @opindex Ym
12071 Look in the directory @var{dir} to find the M4 preprocessor.
12072 The assembler uses this option.
12073 @c This is supposed to go with a -Yd for predefined M4 macro files, but
12074 @c the generic assembler that comes with Solaris takes just -Ym.
12075 @end table
12076
12077 @node TMS320C3x/C4x Options
12078 @subsection TMS320C3x/C4x Options
12079 @cindex TMS320C3x/C4x Options
12080
12081 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
12082
12083 @table @gcctabopt
12084
12085 @item -mcpu=@var{cpu_type}
12086 @opindex mcpu
12087 Set the instruction set, register set, and instruction scheduling
12088 parameters for machine type @var{cpu_type}.  Supported values for
12089 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
12090 @samp{c44}.  The default is @samp{c40} to generate code for the
12091 TMS320C40.
12092
12093 @item -mbig-memory
12094 @itemx -mbig
12095 @itemx -msmall-memory
12096 @itemx -msmall
12097 @opindex mbig-memory
12098 @opindex mbig
12099 @opindex msmall-memory
12100 @opindex msmall
12101 Generates code for the big or small memory model.  The small memory
12102 model assumed that all data fits into one 64K word page.  At run-time
12103 the data page (DP) register must be set to point to the 64K page
12104 containing the .bss and .data program sections.  The big memory model is
12105 the default and requires reloading of the DP register for every direct
12106 memory access.
12107
12108 @item -mbk
12109 @itemx -mno-bk
12110 @opindex mbk
12111 @opindex mno-bk
12112 Allow (disallow) allocation of general integer operands into the block
12113 count register BK@.
12114
12115 @item -mdb
12116 @itemx -mno-db
12117 @opindex mdb
12118 @opindex mno-db
12119 Enable (disable) generation of code using decrement and branch,
12120 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
12121 on the safe side, this is disabled for the C3x, since the maximum
12122 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
12123 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
12124 that it can utilize the decrement and branch instruction, but will give
12125 up if there is more than one memory reference in the loop.  Thus a loop
12126 where the loop counter is decremented can generate slightly more
12127 efficient code, in cases where the RPTB instruction cannot be utilized.
12128
12129 @item -mdp-isr-reload
12130 @itemx -mparanoid
12131 @opindex mdp-isr-reload
12132 @opindex mparanoid
12133 Force the DP register to be saved on entry to an interrupt service
12134 routine (ISR), reloaded to point to the data section, and restored on
12135 exit from the ISR@.  This should not be required unless someone has
12136 violated the small memory model by modifying the DP register, say within
12137 an object library.
12138
12139 @item -mmpyi
12140 @itemx -mno-mpyi
12141 @opindex mmpyi
12142 @opindex mno-mpyi
12143 For the C3x use the 24-bit MPYI instruction for integer multiplies
12144 instead of a library call to guarantee 32-bit results.  Note that if one
12145 of the operands is a constant, then the multiplication will be performed
12146 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
12147 then squaring operations are performed inline instead of a library call.
12148
12149 @item -mfast-fix
12150 @itemx -mno-fast-fix
12151 @opindex mfast-fix
12152 @opindex mno-fast-fix
12153 The C3x/C4x FIX instruction to convert a floating point value to an
12154 integer value chooses the nearest integer less than or equal to the
12155 floating point value rather than to the nearest integer.  Thus if the
12156 floating point number is negative, the result will be incorrectly
12157 truncated an additional code is necessary to detect and correct this
12158 case.  This option can be used to disable generation of the additional
12159 code required to correct the result.
12160
12161 @item -mrptb
12162 @itemx -mno-rptb
12163 @opindex mrptb
12164 @opindex mno-rptb
12165 Enable (disable) generation of repeat block sequences using the RPTB
12166 instruction for zero overhead looping.  The RPTB construct is only used
12167 for innermost loops that do not call functions or jump across the loop
12168 boundaries.  There is no advantage having nested RPTB loops due to the
12169 overhead required to save and restore the RC, RS, and RE registers.
12170 This is enabled by default with @option{-O2}.
12171
12172 @item -mrpts=@var{count}
12173 @itemx -mno-rpts
12174 @opindex mrpts
12175 @opindex mno-rpts
12176 Enable (disable) the use of the single instruction repeat instruction
12177 RPTS@.  If a repeat block contains a single instruction, and the loop
12178 count can be guaranteed to be less than the value @var{count}, GCC will
12179 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
12180 then a RPTS will be emitted even if the loop count cannot be determined
12181 at compile time.  Note that the repeated instruction following RPTS does
12182 not have to be reloaded from memory each iteration, thus freeing up the
12183 CPU buses for operands.  However, since interrupts are blocked by this
12184 instruction, it is disabled by default.
12185
12186 @item -mloop-unsigned
12187 @itemx -mno-loop-unsigned
12188 @opindex mloop-unsigned
12189 @opindex mno-loop-unsigned
12190 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
12191 is @math{2^{31} + 1} since these instructions test if the iteration count is
12192 negative to terminate the loop.  If the iteration count is unsigned
12193 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
12194 exceeded.  This switch allows an unsigned iteration count.
12195
12196 @item -mti
12197 @opindex mti
12198 Try to emit an assembler syntax that the TI assembler (asm30) is happy
12199 with.  This also enforces compatibility with the API employed by the TI
12200 C3x C compiler.  For example, long doubles are passed as structures
12201 rather than in floating point registers.
12202
12203 @item -mregparm
12204 @itemx -mmemparm
12205 @opindex mregparm
12206 @opindex mmemparm
12207 Generate code that uses registers (stack) for passing arguments to functions.
12208 By default, arguments are passed in registers where possible rather
12209 than by pushing arguments on to the stack.
12210
12211 @item -mparallel-insns
12212 @itemx -mno-parallel-insns
12213 @opindex mparallel-insns
12214 @opindex mno-parallel-insns
12215 Allow the generation of parallel instructions.  This is enabled by
12216 default with @option{-O2}.
12217
12218 @item -mparallel-mpy
12219 @itemx -mno-parallel-mpy
12220 @opindex mparallel-mpy
12221 @opindex mno-parallel-mpy
12222 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
12223 provided @option{-mparallel-insns} is also specified.  These instructions have
12224 tight register constraints which can pessimize the code generation
12225 of large functions.
12226
12227 @end table
12228
12229 @node V850 Options
12230 @subsection V850 Options
12231 @cindex V850 Options
12232
12233 These @samp{-m} options are defined for V850 implementations:
12234
12235 @table @gcctabopt
12236 @item -mlong-calls
12237 @itemx -mno-long-calls
12238 @opindex mlong-calls
12239 @opindex mno-long-calls
12240 Treat all calls as being far away (near).  If calls are assumed to be
12241 far away, the compiler will always load the functions address up into a
12242 register, and call indirect through the pointer.
12243
12244 @item -mno-ep
12245 @itemx -mep
12246 @opindex mno-ep
12247 @opindex mep
12248 Do not optimize (do optimize) basic blocks that use the same index
12249 pointer 4 or more times to copy pointer into the @code{ep} register, and
12250 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
12251 option is on by default if you optimize.
12252
12253 @item -mno-prolog-function
12254 @itemx -mprolog-function
12255 @opindex mno-prolog-function
12256 @opindex mprolog-function
12257 Do not use (do use) external functions to save and restore registers
12258 at the prologue and epilogue of a function.  The external functions
12259 are slower, but use less code space if more than one function saves
12260 the same number of registers.  The @option{-mprolog-function} option
12261 is on by default if you optimize.
12262
12263 @item -mspace
12264 @opindex mspace
12265 Try to make the code as small as possible.  At present, this just turns
12266 on the @option{-mep} and @option{-mprolog-function} options.
12267
12268 @item -mtda=@var{n}
12269 @opindex mtda
12270 Put static or global variables whose size is @var{n} bytes or less into
12271 the tiny data area that register @code{ep} points to.  The tiny data
12272 area can hold up to 256 bytes in total (128 bytes for byte references).
12273
12274 @item -msda=@var{n}
12275 @opindex msda
12276 Put static or global variables whose size is @var{n} bytes or less into
12277 the small data area that register @code{gp} points to.  The small data
12278 area can hold up to 64 kilobytes.
12279
12280 @item -mzda=@var{n}
12281 @opindex mzda
12282 Put static or global variables whose size is @var{n} bytes or less into
12283 the first 32 kilobytes of memory.
12284
12285 @item -mv850
12286 @opindex mv850
12287 Specify that the target processor is the V850.
12288
12289 @item -mbig-switch
12290 @opindex mbig-switch
12291 Generate code suitable for big switch tables.  Use this option only if
12292 the assembler/linker complain about out of range branches within a switch
12293 table.
12294
12295 @item -mapp-regs
12296 @opindex mapp-regs
12297 This option will cause r2 and r5 to be used in the code generated by
12298 the compiler.  This setting is the default.
12299
12300 @item -mno-app-regs
12301 @opindex mno-app-regs
12302 This option will cause r2 and r5 to be treated as fixed registers.
12303
12304 @item -mv850e1
12305 @opindex mv850e1
12306 Specify that the target processor is the V850E1.  The preprocessor
12307 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
12308 this option is used.
12309
12310 @item -mv850e
12311 @opindex mv850e
12312 Specify that the target processor is the V850E@.  The preprocessor
12313 constant @samp{__v850e__} will be defined if this option is used.
12314
12315 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
12316 are defined then a default target processor will be chosen and the
12317 relevant @samp{__v850*__} preprocessor constant will be defined.
12318
12319 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
12320 defined, regardless of which processor variant is the target.
12321
12322 @item -mdisable-callt
12323 @opindex mdisable-callt
12324 This option will suppress generation of the CALLT instruction for the
12325 v850e and v850e1 flavors of the v850 architecture.  The default is
12326 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
12327
12328 @end table
12329
12330 @node VAX Options
12331 @subsection VAX Options
12332 @cindex VAX options
12333
12334 These @samp{-m} options are defined for the VAX:
12335
12336 @table @gcctabopt
12337 @item -munix
12338 @opindex munix
12339 Do not output certain jump instructions (@code{aobleq} and so on)
12340 that the Unix assembler for the VAX cannot handle across long
12341 ranges.
12342
12343 @item -mgnu
12344 @opindex mgnu
12345 Do output those jump instructions, on the assumption that you
12346 will assemble with the GNU assembler.
12347
12348 @item -mg
12349 @opindex mg
12350 Output code for g-format floating point numbers instead of d-format.
12351 @end table
12352
12353 @node x86-64 Options
12354 @subsection x86-64 Options
12355 @cindex x86-64 options
12356
12357 These are listed under @xref{i386 and x86-64 Options}.
12358
12359 @node Xstormy16 Options
12360 @subsection Xstormy16 Options
12361 @cindex Xstormy16 Options
12362
12363 These options are defined for Xstormy16:
12364
12365 @table @gcctabopt
12366 @item -msim
12367 @opindex msim
12368 Choose startup files and linker script suitable for the simulator.
12369 @end table
12370
12371 @node Xtensa Options
12372 @subsection Xtensa Options
12373 @cindex Xtensa Options
12374
12375 These options are supported for Xtensa targets:
12376
12377 @table @gcctabopt
12378 @item -mconst16
12379 @itemx -mno-const16
12380 @opindex mconst16
12381 @opindex mno-const16
12382 Enable or disable use of @code{CONST16} instructions for loading
12383 constant values.  The @code{CONST16} instruction is currently not a
12384 standard option from Tensilica.  When enabled, @code{CONST16}
12385 instructions are always used in place of the standard @code{L32R}
12386 instructions.  The use of @code{CONST16} is enabled by default only if
12387 the @code{L32R} instruction is not available.
12388
12389 @item -mfused-madd
12390 @itemx -mno-fused-madd
12391 @opindex mfused-madd
12392 @opindex mno-fused-madd
12393 Enable or disable use of fused multiply/add and multiply/subtract
12394 instructions in the floating-point option.  This has no effect if the
12395 floating-point option is not also enabled.  Disabling fused multiply/add
12396 and multiply/subtract instructions forces the compiler to use separate
12397 instructions for the multiply and add/subtract operations.  This may be
12398 desirable in some cases where strict IEEE 754-compliant results are
12399 required: the fused multiply add/subtract instructions do not round the
12400 intermediate result, thereby producing results with @emph{more} bits of
12401 precision than specified by the IEEE standard.  Disabling fused multiply
12402 add/subtract instructions also ensures that the program output is not
12403 sensitive to the compiler's ability to combine multiply and add/subtract
12404 operations.
12405
12406 @item -mtext-section-literals
12407 @itemx -mno-text-section-literals
12408 @opindex mtext-section-literals
12409 @opindex mno-text-section-literals
12410 Control the treatment of literal pools.  The default is
12411 @option{-mno-text-section-literals}, which places literals in a separate
12412 section in the output file.  This allows the literal pool to be placed
12413 in a data RAM/ROM, and it also allows the linker to combine literal
12414 pools from separate object files to remove redundant literals and
12415 improve code size.  With @option{-mtext-section-literals}, the literals
12416 are interspersed in the text section in order to keep them as close as
12417 possible to their references.  This may be necessary for large assembly
12418 files.
12419
12420 @item -mtarget-align
12421 @itemx -mno-target-align
12422 @opindex mtarget-align
12423 @opindex mno-target-align
12424 When this option is enabled, GCC instructs the assembler to
12425 automatically align instructions to reduce branch penalties at the
12426 expense of some code density.  The assembler attempts to widen density
12427 instructions to align branch targets and the instructions following call
12428 instructions.  If there are not enough preceding safe density
12429 instructions to align a target, no widening will be performed.  The
12430 default is @option{-mtarget-align}.  These options do not affect the
12431 treatment of auto-aligned instructions like @code{LOOP}, which the
12432 assembler will always align, either by widening density instructions or
12433 by inserting no-op instructions.
12434
12435 @item -mlongcalls
12436 @itemx -mno-longcalls
12437 @opindex mlongcalls
12438 @opindex mno-longcalls
12439 When this option is enabled, GCC instructs the assembler to translate
12440 direct calls to indirect calls unless it can determine that the target
12441 of a direct call is in the range allowed by the call instruction.  This
12442 translation typically occurs for calls to functions in other source
12443 files.  Specifically, the assembler translates a direct @code{CALL}
12444 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
12445 The default is @option{-mno-longcalls}.  This option should be used in
12446 programs where the call target can potentially be out of range.  This
12447 option is implemented in the assembler, not the compiler, so the
12448 assembly code generated by GCC will still show direct call
12449 instructions---look at the disassembled object code to see the actual
12450 instructions.  Note that the assembler will use an indirect call for
12451 every cross-file call, not just those that really will be out of range.
12452 @end table
12453
12454 @node zSeries Options
12455 @subsection zSeries Options
12456 @cindex zSeries options
12457
12458 These are listed under @xref{S/390 and zSeries Options}.
12459
12460 @node Code Gen Options
12461 @section Options for Code Generation Conventions
12462 @cindex code generation conventions
12463 @cindex options, code generation
12464 @cindex run-time options
12465
12466 These machine-independent options control the interface conventions
12467 used in code generation.
12468
12469 Most of them have both positive and negative forms; the negative form
12470 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
12471 one of the forms is listed---the one which is not the default.  You
12472 can figure out the other form by either removing @samp{no-} or adding
12473 it.
12474
12475 @table @gcctabopt
12476 @item -fbounds-check
12477 @opindex fbounds-check
12478 For front-ends that support it, generate additional code to check that
12479 indices used to access arrays are within the declared range.  This is
12480 currently only supported by the Java and Fortran 77 front-ends, where
12481 this option defaults to true and false respectively.
12482
12483 @item -ftrapv
12484 @opindex ftrapv
12485 This option generates traps for signed overflow on addition, subtraction,
12486 multiplication operations.
12487
12488 @item -fwrapv
12489 @opindex fwrapv
12490 This option instructs the compiler to assume that signed arithmetic
12491 overflow of addition, subtraction and multiplication wraps around
12492 using twos-complement representation.  This flag enables some optimizations
12493 and disables other.  This option is enabled by default for the Java
12494 front-end, as required by the Java language specification.
12495
12496 @item -fexceptions
12497 @opindex fexceptions
12498 Enable exception handling.  Generates extra code needed to propagate
12499 exceptions.  For some targets, this implies GCC will generate frame
12500 unwind information for all functions, which can produce significant data
12501 size overhead, although it does not affect execution.  If you do not
12502 specify this option, GCC will enable it by default for languages like
12503 C++ which normally require exception handling, and disable it for
12504 languages like C that do not normally require it.  However, you may need
12505 to enable this option when compiling C code that needs to interoperate
12506 properly with exception handlers written in C++.  You may also wish to
12507 disable this option if you are compiling older C++ programs that don't
12508 use exception handling.
12509
12510 @item -fnon-call-exceptions
12511 @opindex fnon-call-exceptions
12512 Generate code that allows trapping instructions to throw exceptions.
12513 Note that this requires platform-specific runtime support that does
12514 not exist everywhere.  Moreover, it only allows @emph{trapping}
12515 instructions to throw exceptions, i.e.@: memory references or floating
12516 point instructions.  It does not allow exceptions to be thrown from
12517 arbitrary signal handlers such as @code{SIGALRM}.
12518
12519 @item -funwind-tables
12520 @opindex funwind-tables
12521 Similar to @option{-fexceptions}, except that it will just generate any needed
12522 static data, but will not affect the generated code in any other way.
12523 You will normally not enable this option; instead, a language processor
12524 that needs this handling would enable it on your behalf.
12525
12526 @item -fasynchronous-unwind-tables
12527 @opindex fasynchronous-unwind-tables
12528 Generate unwind table in dwarf2 format, if supported by target machine.  The
12529 table is exact at each instruction boundary, so it can be used for stack
12530 unwinding from asynchronous events (such as debugger or garbage collector).
12531
12532 @item -fpcc-struct-return
12533 @opindex fpcc-struct-return
12534 Return ``short'' @code{struct} and @code{union} values in memory like
12535 longer ones, rather than in registers.  This convention is less
12536 efficient, but it has the advantage of allowing intercallability between
12537 GCC-compiled files and files compiled with other compilers, particularly
12538 the Portable C Compiler (pcc).
12539
12540 The precise convention for returning structures in memory depends
12541 on the target configuration macros.
12542
12543 Short structures and unions are those whose size and alignment match
12544 that of some integer type.
12545
12546 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
12547 switch is not binary compatible with code compiled with the
12548 @option{-freg-struct-return} switch.
12549 Use it to conform to a non-default application binary interface.
12550
12551 @item -freg-struct-return
12552 @opindex freg-struct-return
12553 Return @code{struct} and @code{union} values in registers when possible.
12554 This is more efficient for small structures than
12555 @option{-fpcc-struct-return}.
12556
12557 If you specify neither @option{-fpcc-struct-return} nor
12558 @option{-freg-struct-return}, GCC defaults to whichever convention is
12559 standard for the target.  If there is no standard convention, GCC
12560 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
12561 the principal compiler.  In those cases, we can choose the standard, and
12562 we chose the more efficient register return alternative.
12563
12564 @strong{Warning:} code compiled with the @option{-freg-struct-return}
12565 switch is not binary compatible with code compiled with the
12566 @option{-fpcc-struct-return} switch.
12567 Use it to conform to a non-default application binary interface.
12568
12569 @item -fshort-enums
12570 @opindex fshort-enums
12571 Allocate to an @code{enum} type only as many bytes as it needs for the
12572 declared range of possible values.  Specifically, the @code{enum} type
12573 will be equivalent to the smallest integer type which has enough room.
12574
12575 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
12576 code that is not binary compatible with code generated without that switch.
12577 Use it to conform to a non-default application binary interface.
12578
12579 @item -fshort-double
12580 @opindex fshort-double
12581 Use the same size for @code{double} as for @code{float}.
12582
12583 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
12584 code that is not binary compatible with code generated without that switch.
12585 Use it to conform to a non-default application binary interface.
12586
12587 @item -fshort-wchar
12588 @opindex fshort-wchar
12589 Override the underlying type for @samp{wchar_t} to be @samp{short
12590 unsigned int} instead of the default for the target.  This option is
12591 useful for building programs to run under WINE@.
12592
12593 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
12594 code that is not binary compatible with code generated without that switch.
12595 Use it to conform to a non-default application binary interface.
12596
12597 @item -fshared-data
12598 @opindex fshared-data
12599 Requests that the data and non-@code{const} variables of this
12600 compilation be shared data rather than private data.  The distinction
12601 makes sense only on certain operating systems, where shared data is
12602 shared between processes running the same program, while private data
12603 exists in one copy per process.
12604
12605 @item -fno-common
12606 @opindex fno-common
12607 In C, allocate even uninitialized global variables in the data section of the
12608 object file, rather than generating them as common blocks.  This has the
12609 effect that if the same variable is declared (without @code{extern}) in
12610 two different compilations, you will get an error when you link them.
12611 The only reason this might be useful is if you wish to verify that the
12612 program will work on other systems which always work this way.
12613
12614 @item -fno-ident
12615 @opindex fno-ident
12616 Ignore the @samp{#ident} directive.
12617
12618 @item -finhibit-size-directive
12619 @opindex finhibit-size-directive
12620 Don't output a @code{.size} assembler directive, or anything else that
12621 would cause trouble if the function is split in the middle, and the
12622 two halves are placed at locations far apart in memory.  This option is
12623 used when compiling @file{crtstuff.c}; you should not need to use it
12624 for anything else.
12625
12626 @item -fverbose-asm
12627 @opindex fverbose-asm
12628 Put extra commentary information in the generated assembly code to
12629 make it more readable.  This option is generally only of use to those
12630 who actually need to read the generated assembly code (perhaps while
12631 debugging the compiler itself).
12632
12633 @option{-fno-verbose-asm}, the default, causes the
12634 extra information to be omitted and is useful when comparing two assembler
12635 files.
12636
12637 @item -fpic
12638 @opindex fpic
12639 @cindex global offset table
12640 @cindex PIC
12641 Generate position-independent code (PIC) suitable for use in a shared
12642 library, if supported for the target machine.  Such code accesses all
12643 constant addresses through a global offset table (GOT)@.  The dynamic
12644 loader resolves the GOT entries when the program starts (the dynamic
12645 loader is not part of GCC; it is part of the operating system).  If
12646 the GOT size for the linked executable exceeds a machine-specific
12647 maximum size, you get an error message from the linker indicating that
12648 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
12649 instead.  (These maximums are 8k on the SPARC and 32k
12650 on the m68k and RS/6000.  The 386 has no such limit.)
12651
12652 Position-independent code requires special support, and therefore works
12653 only on certain machines.  For the 386, GCC supports PIC for System V
12654 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
12655 position-independent.
12656
12657 @item -fPIC
12658 @opindex fPIC
12659 If supported for the target machine, emit position-independent code,
12660 suitable for dynamic linking and avoiding any limit on the size of the
12661 global offset table.  This option makes a difference on the m68k,
12662 PowerPC and SPARC@.
12663
12664 Position-independent code requires special support, and therefore works
12665 only on certain machines.
12666
12667 @item -fpie
12668 @itemx -fPIE
12669 @opindex fpie
12670 @opindex fPIE
12671 These options are similar to @option{-fpic} and @option{-fPIC}, but
12672 generated position independent code can be only linked into executables.
12673 Usually these options are used when @option{-pie} GCC option will be
12674 used during linking.
12675
12676 @item -fno-jump-tables
12677 @opindex fno-jump-tables
12678 Do not use jump tables for switch statements even where it would be
12679 more efficient than other code generation strategies.  This option is
12680 of use in conjunction with @option{-fpic} or @option{-fPIC} for
12681 building code which forms part of a dynamic linker and cannot
12682 reference the address of a jump table.  On some targets, jump tables
12683 do not require a GOT and this option is not needed.
12684
12685 @item -ffixed-@var{reg}
12686 @opindex ffixed
12687 Treat the register named @var{reg} as a fixed register; generated code
12688 should never refer to it (except perhaps as a stack pointer, frame
12689 pointer or in some other fixed role).
12690
12691 @var{reg} must be the name of a register.  The register names accepted
12692 are machine-specific and are defined in the @code{REGISTER_NAMES}
12693 macro in the machine description macro file.
12694
12695 This flag does not have a negative form, because it specifies a
12696 three-way choice.
12697
12698 @item -fcall-used-@var{reg}
12699 @opindex fcall-used
12700 Treat the register named @var{reg} as an allocable register that is
12701 clobbered by function calls.  It may be allocated for temporaries or
12702 variables that do not live across a call.  Functions compiled this way
12703 will not save and restore the register @var{reg}.
12704
12705 It is an error to used this flag with the frame pointer or stack pointer.
12706 Use of this flag for other registers that have fixed pervasive roles in
12707 the machine's execution model will produce disastrous results.
12708
12709 This flag does not have a negative form, because it specifies a
12710 three-way choice.
12711
12712 @item -fcall-saved-@var{reg}
12713 @opindex fcall-saved
12714 Treat the register named @var{reg} as an allocable register saved by
12715 functions.  It may be allocated even for temporaries or variables that
12716 live across a call.  Functions compiled this way will save and restore
12717 the register @var{reg} if they use it.
12718
12719 It is an error to used this flag with the frame pointer or stack pointer.
12720 Use of this flag for other registers that have fixed pervasive roles in
12721 the machine's execution model will produce disastrous results.
12722
12723 A different sort of disaster will result from the use of this flag for
12724 a register in which function values may be returned.
12725
12726 This flag does not have a negative form, because it specifies a
12727 three-way choice.
12728
12729 @item -fpack-struct[=@var{n}]
12730 @opindex fpack-struct
12731 Without a value specified, pack all structure members together without
12732 holes.  When a value is specified (which must be a small power of two), pack
12733 structure members according to this value, representing the maximum
12734 alignment (that is, objects with default alignment requirements larger than
12735 this will be output potentially unaligned at the next fitting location.
12736
12737 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
12738 code that is not binary compatible with code generated without that switch.
12739 Additionally, it makes the code suboptimal.
12740 Use it to conform to a non-default application binary interface.
12741
12742 @item -finstrument-functions
12743 @opindex finstrument-functions
12744 Generate instrumentation calls for entry and exit to functions.  Just
12745 after function entry and just before function exit, the following
12746 profiling functions will be called with the address of the current
12747 function and its call site.  (On some platforms,
12748 @code{__builtin_return_address} does not work beyond the current
12749 function, so the call site information may not be available to the
12750 profiling functions otherwise.)
12751
12752 @smallexample
12753 void __cyg_profile_func_enter (void *this_fn,
12754                                void *call_site);
12755 void __cyg_profile_func_exit  (void *this_fn,
12756                                void *call_site);
12757 @end smallexample
12758
12759 The first argument is the address of the start of the current function,
12760 which may be looked up exactly in the symbol table.
12761
12762 This instrumentation is also done for functions expanded inline in other
12763 functions.  The profiling calls will indicate where, conceptually, the
12764 inline function is entered and exited.  This means that addressable
12765 versions of such functions must be available.  If all your uses of a
12766 function are expanded inline, this may mean an additional expansion of
12767 code size.  If you use @samp{extern inline} in your C code, an
12768 addressable version of such functions must be provided.  (This is
12769 normally the case anyways, but if you get lucky and the optimizer always
12770 expands the functions inline, you might have gotten away without
12771 providing static copies.)
12772
12773 A function may be given the attribute @code{no_instrument_function}, in
12774 which case this instrumentation will not be done.  This can be used, for
12775 example, for the profiling functions listed above, high-priority
12776 interrupt routines, and any functions from which the profiling functions
12777 cannot safely be called (perhaps signal handlers, if the profiling
12778 routines generate output or allocate memory).
12779
12780 @item -fstack-check
12781 @opindex fstack-check
12782 Generate code to verify that you do not go beyond the boundary of the
12783 stack.  You should specify this flag if you are running in an
12784 environment with multiple threads, but only rarely need to specify it in
12785 a single-threaded environment since stack overflow is automatically
12786 detected on nearly all systems if there is only one stack.
12787
12788 Note that this switch does not actually cause checking to be done; the
12789 operating system must do that.  The switch causes generation of code
12790 to ensure that the operating system sees the stack being extended.
12791
12792 @item -fstack-limit-register=@var{reg}
12793 @itemx -fstack-limit-symbol=@var{sym}
12794 @itemx -fno-stack-limit
12795 @opindex fstack-limit-register
12796 @opindex fstack-limit-symbol
12797 @opindex fno-stack-limit
12798 Generate code to ensure that the stack does not grow beyond a certain value,
12799 either the value of a register or the address of a symbol.  If the stack
12800 would grow beyond the value, a signal is raised.  For most targets,
12801 the signal is raised before the stack overruns the boundary, so
12802 it is possible to catch the signal without taking special precautions.
12803
12804 For instance, if the stack starts at absolute address @samp{0x80000000}
12805 and grows downwards, you can use the flags
12806 @option{-fstack-limit-symbol=__stack_limit} and
12807 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
12808 of 128KB@.  Note that this may only work with the GNU linker.
12809
12810 @cindex aliasing of parameters
12811 @cindex parameters, aliased
12812 @item -fargument-alias
12813 @itemx -fargument-noalias
12814 @itemx -fargument-noalias-global
12815 @opindex fargument-alias
12816 @opindex fargument-noalias
12817 @opindex fargument-noalias-global
12818 Specify the possible relationships among parameters and between
12819 parameters and global data.
12820
12821 @option{-fargument-alias} specifies that arguments (parameters) may
12822 alias each other and may alias global storage.@*
12823 @option{-fargument-noalias} specifies that arguments do not alias
12824 each other, but may alias global storage.@*
12825 @option{-fargument-noalias-global} specifies that arguments do not
12826 alias each other and do not alias global storage.
12827
12828 Each language will automatically use whatever option is required by
12829 the language standard.  You should not need to use these options yourself.
12830
12831 @item -fleading-underscore
12832 @opindex fleading-underscore
12833 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
12834 change the way C symbols are represented in the object file.  One use
12835 is to help link with legacy assembly code.
12836
12837 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
12838 generate code that is not binary compatible with code generated without that
12839 switch.  Use it to conform to a non-default application binary interface.
12840 Not all targets provide complete support for this switch.
12841
12842 @item -ftls-model=@var{model}
12843 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
12844 The @var{model} argument should be one of @code{global-dynamic},
12845 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
12846
12847 The default without @option{-fpic} is @code{initial-exec}; with
12848 @option{-fpic} the default is @code{global-dynamic}.
12849
12850 @item -fvisibility=@var{default|internal|hidden|protected}
12851 @opindex fvisibility
12852 Set the default ELF image symbol visibility to the specified option---all
12853 symbols will be marked with this unless overridden within the code.
12854 Using this feature can very substantially improve linking and
12855 load times of shared object libraries, produce more optimized
12856 code, provide near-perfect API export and prevent symbol clashes.
12857 It is @strong{strongly} recommended that you use this in any shared objects
12858 you distribute.
12859
12860 Despite the nomenclature, @code{default} always means public ie;
12861 available to be linked against from outside the shared object.
12862 @code{protected} and @code{internal} are pretty useless in real-world
12863 usage so the only other commonly used option will be @code{hidden}.
12864 The default if @option{-fvisibility} isn't specified is
12865 @code{default}, i.e., make every
12866 symbol public---this causes the same behavior as previous versions of
12867 GCC@.
12868
12869 A good explanation of the benefits offered by ensuring ELF
12870 symbols have the correct visibility is given by ``How To Write
12871 Shared Libraries'' by Ulrich Drepper (which can be found at
12872 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
12873 solution made possible by this option to marking things hidden when
12874 the default is public is to make the default hidden and mark things
12875 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
12876 and @code{__attribute__ ((visibility("default")))} instead of
12877 @code{__declspec(dllexport)} you get almost identical semantics with
12878 identical syntax.  This is a great boon to those working with
12879 cross-platform projects.
12880
12881 For those adding visibility support to existing code, you may find
12882 @samp{#pragma GCC visibility} of use.  This works by you enclosing
12883 the declarations you wish to set visibility for with (for example)
12884 @samp{#pragma GCC visibility push(hidden)} and
12885 @samp{#pragma GCC visibility pop}.
12886 Bear in mind that symbol visibility should be viewed @strong{as
12887 part of the API interface contract} and thus all new code should
12888 always specify visibility when it is not the default ie; declarations
12889 only for use within the local DSO should @strong{always} be marked explicitly
12890 as hidden as so to avoid PLT indirection overheads---making this
12891 abundantly clear also aids readability and self-documentation of the code.
12892 Note that due to ISO C++ specification requirements, operator new and
12893 operator delete must always be of default visibility.
12894
12895 An overview of these techniques, their benefits and how to use them
12896 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
12897
12898 @end table
12899
12900 @c man end
12901
12902 @node Environment Variables
12903 @section Environment Variables Affecting GCC
12904 @cindex environment variables
12905
12906 @c man begin ENVIRONMENT
12907 This section describes several environment variables that affect how GCC
12908 operates.  Some of them work by specifying directories or prefixes to use
12909 when searching for various kinds of files.  Some are used to specify other
12910 aspects of the compilation environment.
12911
12912 Note that you can also specify places to search using options such as
12913 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
12914 take precedence over places specified using environment variables, which
12915 in turn take precedence over those specified by the configuration of GCC@.
12916 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
12917 GNU Compiler Collection (GCC) Internals}.
12918
12919 @table @env
12920 @item LANG
12921 @itemx LC_CTYPE
12922 @c @itemx LC_COLLATE
12923 @itemx LC_MESSAGES
12924 @c @itemx LC_MONETARY
12925 @c @itemx LC_NUMERIC
12926 @c @itemx LC_TIME
12927 @itemx LC_ALL
12928 @findex LANG
12929 @findex LC_CTYPE
12930 @c @findex LC_COLLATE
12931 @findex LC_MESSAGES
12932 @c @findex LC_MONETARY
12933 @c @findex LC_NUMERIC
12934 @c @findex LC_TIME
12935 @findex LC_ALL
12936 @cindex locale
12937 These environment variables control the way that GCC uses
12938 localization information that allow GCC to work with different
12939 national conventions.  GCC inspects the locale categories
12940 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
12941 so.  These locale categories can be set to any value supported by your
12942 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
12943 Kingdom encoded in UTF-8.
12944
12945 The @env{LC_CTYPE} environment variable specifies character
12946 classification.  GCC uses it to determine the character boundaries in
12947 a string; this is needed for some multibyte encodings that contain quote
12948 and escape characters that would otherwise be interpreted as a string
12949 end or escape.
12950
12951 The @env{LC_MESSAGES} environment variable specifies the language to
12952 use in diagnostic messages.
12953
12954 If the @env{LC_ALL} environment variable is set, it overrides the value
12955 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
12956 and @env{LC_MESSAGES} default to the value of the @env{LANG}
12957 environment variable.  If none of these variables are set, GCC
12958 defaults to traditional C English behavior.
12959
12960 @item TMPDIR
12961 @findex TMPDIR
12962 If @env{TMPDIR} is set, it specifies the directory to use for temporary
12963 files.  GCC uses temporary files to hold the output of one stage of
12964 compilation which is to be used as input to the next stage: for example,
12965 the output of the preprocessor, which is the input to the compiler
12966 proper.
12967
12968 @item GCC_EXEC_PREFIX
12969 @findex GCC_EXEC_PREFIX
12970 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
12971 names of the subprograms executed by the compiler.  No slash is added
12972 when this prefix is combined with the name of a subprogram, but you can
12973 specify a prefix that ends with a slash if you wish.
12974
12975 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
12976 an appropriate prefix to use based on the pathname it was invoked with.
12977
12978 If GCC cannot find the subprogram using the specified prefix, it
12979 tries looking in the usual places for the subprogram.
12980
12981 The default value of @env{GCC_EXEC_PREFIX} is
12982 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the value
12983 of @code{prefix} when you ran the @file{configure} script.
12984
12985 Other prefixes specified with @option{-B} take precedence over this prefix.
12986
12987 This prefix is also used for finding files such as @file{crt0.o} that are
12988 used for linking.
12989
12990 In addition, the prefix is used in an unusual way in finding the
12991 directories to search for header files.  For each of the standard
12992 directories whose name normally begins with @samp{/usr/local/lib/gcc}
12993 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
12994 replacing that beginning with the specified prefix to produce an
12995 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
12996 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
12997 These alternate directories are searched first; the standard directories
12998 come next.
12999
13000 @item COMPILER_PATH
13001 @findex COMPILER_PATH
13002 The value of @env{COMPILER_PATH} is a colon-separated list of
13003 directories, much like @env{PATH}.  GCC tries the directories thus
13004 specified when searching for subprograms, if it can't find the
13005 subprograms using @env{GCC_EXEC_PREFIX}.
13006
13007 @item LIBRARY_PATH
13008 @findex LIBRARY_PATH
13009 The value of @env{LIBRARY_PATH} is a colon-separated list of
13010 directories, much like @env{PATH}.  When configured as a native compiler,
13011 GCC tries the directories thus specified when searching for special
13012 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
13013 using GCC also uses these directories when searching for ordinary
13014 libraries for the @option{-l} option (but directories specified with
13015 @option{-L} come first).
13016
13017 @item LANG
13018 @findex LANG
13019 @cindex locale definition
13020 This variable is used to pass locale information to the compiler.  One way in
13021 which this information is used is to determine the character set to be used
13022 when character literals, string literals and comments are parsed in C and C++.
13023 When the compiler is configured to allow multibyte characters,
13024 the following values for @env{LANG} are recognized:
13025
13026 @table @samp
13027 @item C-JIS
13028 Recognize JIS characters.
13029 @item C-SJIS
13030 Recognize SJIS characters.
13031 @item C-EUCJP
13032 Recognize EUCJP characters.
13033 @end table
13034
13035 If @env{LANG} is not defined, or if it has some other value, then the
13036 compiler will use mblen and mbtowc as defined by the default locale to
13037 recognize and translate multibyte characters.
13038 @end table
13039
13040 @noindent
13041 Some additional environments variables affect the behavior of the
13042 preprocessor.
13043
13044 @include cppenv.texi
13045
13046 @c man end
13047
13048 @node Precompiled Headers
13049 @section Using Precompiled Headers
13050 @cindex precompiled headers
13051 @cindex speed of compilation
13052
13053 Often large projects have many header files that are included in every
13054 source file.  The time the compiler takes to process these header files
13055 over and over again can account for nearly all of the time required to
13056 build the project.  To make builds faster, GCC allows users to
13057 `precompile' a header file; then, if builds can use the precompiled
13058 header file they will be much faster.
13059
13060 To create a precompiled header file, simply compile it as you would any
13061 other file, if necessary using the @option{-x} option to make the driver
13062 treat it as a C or C++ header file.  You will probably want to use a
13063 tool like @command{make} to keep the precompiled header up-to-date when
13064 the headers it contains change.
13065
13066 A precompiled header file will be searched for when @code{#include} is
13067 seen in the compilation.  As it searches for the included file
13068 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
13069 compiler looks for a precompiled header in each directory just before it
13070 looks for the include file in that directory.  The name searched for is
13071 the name specified in the @code{#include} with @samp{.gch} appended.  If
13072 the precompiled header file can't be used, it is ignored.
13073
13074 For instance, if you have @code{#include "all.h"}, and you have
13075 @file{all.h.gch} in the same directory as @file{all.h}, then the
13076 precompiled header file will be used if possible, and the original
13077 header will be used otherwise.
13078
13079 Alternatively, you might decide to put the precompiled header file in a
13080 directory and use @option{-I} to ensure that directory is searched
13081 before (or instead of) the directory containing the original header.
13082 Then, if you want to check that the precompiled header file is always
13083 used, you can put a file of the same name as the original header in this
13084 directory containing an @code{#error} command.
13085
13086 This also works with @option{-include}.  So yet another way to use
13087 precompiled headers, good for projects not designed with precompiled
13088 header files in mind, is to simply take most of the header files used by
13089 a project, include them from another header file, precompile that header
13090 file, and @option{-include} the precompiled header.  If the header files
13091 have guards against multiple inclusion, they will be skipped because
13092 they've already been included (in the precompiled header).
13093
13094 If you need to precompile the same header file for different
13095 languages, targets, or compiler options, you can instead make a
13096 @emph{directory} named like @file{all.h.gch}, and put each precompiled
13097 header in the directory, perhaps using @option{-o}.  It doesn't matter
13098 what you call the files in the directory, every precompiled header in
13099 the directory will be considered.  The first precompiled header
13100 encountered in the directory that is valid for this compilation will
13101 be used; they're searched in no particular order.
13102
13103 There are many other possibilities, limited only by your imagination,
13104 good sense, and the constraints of your build system.
13105
13106 A precompiled header file can be used only when these conditions apply:
13107
13108 @itemize
13109 @item
13110 Only one precompiled header can be used in a particular compilation.
13111
13112 @item
13113 A precompiled header can't be used once the first C token is seen.  You
13114 can have preprocessor directives before a precompiled header; you can
13115 even include a precompiled header from inside another header, so long as
13116 there are no C tokens before the @code{#include}.
13117
13118 @item
13119 The precompiled header file must be produced for the same language as
13120 the current compilation.  You can't use a C precompiled header for a C++
13121 compilation.
13122
13123 @item
13124 The precompiled header file must have been produced by the same compiler
13125 binary as the current compilation is using.
13126
13127 @item
13128 Any macros defined before the precompiled header is included must
13129 either be defined in the same way as when the precompiled header was
13130 generated, or must not affect the precompiled header, which usually
13131 means that they don't appear in the precompiled header at all.
13132
13133 The @option{-D} option is one way to define a macro before a
13134 precompiled header is included; using a @code{#define} can also do it.
13135 There are also some options that define macros implicitly, like
13136 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
13137 defined this way.
13138
13139 @item If debugging information is output when using the precompiled
13140 header, using @option{-g} or similar, the same kind of debugging information
13141 must have been output when building the precompiled header.  However,
13142 a precompiled header built using @option{-g} can be used in a compilation
13143 when no debugging information is being output.
13144
13145 @item The same @option{-m} options must generally be used when building
13146 and using the precompiled header.  @xref{Submodel Options},
13147 for any cases where this rule is relaxed.
13148
13149 @item Each of the following options must be the same when building and using
13150 the precompiled header:
13151
13152 @gccoptlist{-fexceptions -funit-at-a-time}
13153
13154 @item
13155 Some other command-line options starting with @option{-f},
13156 @option{-p}, or @option{-O} must be defined in the same way as when
13157 the precompiled header was generated.  At present, it's not clear
13158 which options are safe to change and which are not; the safest choice
13159 is to use exactly the same options when generating and using the
13160 precompiled header.  The following are known to be safe:
13161
13162 @gccoptlist{-fpreprocessed
13163 -fsched-interblock -fsched-spec -fsched-spec-load -fsched-spec-load-dangerous
13164 -fsched-verbose=<number> -fschedule-insns
13165 -pedantic-errors}
13166
13167 @end itemize
13168
13169 For all of these except the last, the compiler will automatically
13170 ignore the precompiled header if the conditions aren't met.  If you
13171 find an option combination that doesn't work and doesn't cause the
13172 precompiled header to be ignored, please consider filing a bug report,
13173 see @ref{Bugs}.
13174
13175 If you do use differing options when generating and using the
13176 precompiled header, the actual behavior will be a mixture of the
13177 behavior for the options.  For instance, if you use @option{-g} to
13178 generate the precompiled header but not when using it, you may or may
13179 not get debugging information for routines in the precompiled header.
13180
13181 @node Running Protoize
13182 @section Running Protoize
13183
13184 The program @code{protoize} is an optional part of GCC@.  You can use
13185 it to add prototypes to a program, thus converting the program to ISO
13186 C in one respect.  The companion program @code{unprotoize} does the
13187 reverse: it removes argument types from any prototypes that are found.
13188
13189 When you run these programs, you must specify a set of source files as
13190 command line arguments.  The conversion programs start out by compiling
13191 these files to see what functions they define.  The information gathered
13192 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
13193
13194 After scanning comes actual conversion.  The specified files are all
13195 eligible to be converted; any files they include (whether sources or
13196 just headers) are eligible as well.
13197
13198 But not all the eligible files are converted.  By default,
13199 @code{protoize} and @code{unprotoize} convert only source and header
13200 files in the current directory.  You can specify additional directories
13201 whose files should be converted with the @option{-d @var{directory}}
13202 option.  You can also specify particular files to exclude with the
13203 @option{-x @var{file}} option.  A file is converted if it is eligible, its
13204 directory name matches one of the specified directory names, and its
13205 name within the directory has not been excluded.
13206
13207 Basic conversion with @code{protoize} consists of rewriting most
13208 function definitions and function declarations to specify the types of
13209 the arguments.  The only ones not rewritten are those for varargs
13210 functions.
13211
13212 @code{protoize} optionally inserts prototype declarations at the
13213 beginning of the source file, to make them available for any calls that
13214 precede the function's definition.  Or it can insert prototype
13215 declarations with block scope in the blocks where undeclared functions
13216 are called.
13217
13218 Basic conversion with @code{unprotoize} consists of rewriting most
13219 function declarations to remove any argument types, and rewriting
13220 function definitions to the old-style pre-ISO form.
13221
13222 Both conversion programs print a warning for any function declaration or
13223 definition that they can't convert.  You can suppress these warnings
13224 with @option{-q}.
13225
13226 The output from @code{protoize} or @code{unprotoize} replaces the
13227 original source file.  The original file is renamed to a name ending
13228 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
13229 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
13230 for DOS) file already exists, then the source file is simply discarded.
13231
13232 @code{protoize} and @code{unprotoize} both depend on GCC itself to
13233 scan the program and collect information about the functions it uses.
13234 So neither of these programs will work until GCC is installed.
13235
13236 Here is a table of the options you can use with @code{protoize} and
13237 @code{unprotoize}.  Each option works with both programs unless
13238 otherwise stated.
13239
13240 @table @code
13241 @item -B @var{directory}
13242 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
13243 usual directory (normally @file{/usr/local/lib}).  This file contains
13244 prototype information about standard system functions.  This option
13245 applies only to @code{protoize}.
13246
13247 @item -c @var{compilation-options}
13248 Use @var{compilation-options} as the options when running @command{gcc} to
13249 produce the @samp{.X} files.  The special option @option{-aux-info} is
13250 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
13251
13252 Note that the compilation options must be given as a single argument to
13253 @code{protoize} or @code{unprotoize}.  If you want to specify several
13254 @command{gcc} options, you must quote the entire set of compilation options
13255 to make them a single word in the shell.
13256
13257 There are certain @command{gcc} arguments that you cannot use, because they
13258 would produce the wrong kind of output.  These include @option{-g},
13259 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
13260 the @var{compilation-options}, they are ignored.
13261
13262 @item -C
13263 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
13264 systems) instead of @samp{.c}.  This is convenient if you are converting
13265 a C program to C++.  This option applies only to @code{protoize}.
13266
13267 @item -g
13268 Add explicit global declarations.  This means inserting explicit
13269 declarations at the beginning of each source file for each function
13270 that is called in the file and was not declared.  These declarations
13271 precede the first function definition that contains a call to an
13272 undeclared function.  This option applies only to @code{protoize}.
13273
13274 @item -i @var{string}
13275 Indent old-style parameter declarations with the string @var{string}.
13276 This option applies only to @code{protoize}.
13277
13278 @code{unprotoize} converts prototyped function definitions to old-style
13279 function definitions, where the arguments are declared between the
13280 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
13281 uses five spaces as the indentation.  If you want to indent with just
13282 one space instead, use @option{-i " "}.
13283
13284 @item -k
13285 Keep the @samp{.X} files.  Normally, they are deleted after conversion
13286 is finished.
13287
13288 @item -l
13289 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
13290 a prototype declaration for each function in each block which calls the
13291 function without any declaration.  This option applies only to
13292 @code{protoize}.
13293
13294 @item -n
13295 Make no real changes.  This mode just prints information about the conversions
13296 that would have been done without @option{-n}.
13297
13298 @item -N
13299 Make no @samp{.save} files.  The original files are simply deleted.
13300 Use this option with caution.
13301
13302 @item -p @var{program}
13303 Use the program @var{program} as the compiler.  Normally, the name
13304 @file{gcc} is used.
13305
13306 @item -q
13307 Work quietly.  Most warnings are suppressed.
13308
13309 @item -v
13310 Print the version number, just like @option{-v} for @command{gcc}.
13311 @end table
13312
13313 If you need special compiler options to compile one of your program's
13314 source files, then you should generate that file's @samp{.X} file
13315 specially, by running @command{gcc} on that source file with the
13316 appropriate options and the option @option{-aux-info}.  Then run
13317 @code{protoize} on the entire set of files.  @code{protoize} will use
13318 the existing @samp{.X} file because it is newer than the source file.
13319 For example:
13320
13321 @smallexample
13322 gcc -Dfoo=bar file1.c -aux-info file1.X
13323 protoize *.c
13324 @end smallexample
13325
13326 @noindent
13327 You need to include the special files along with the rest in the
13328 @code{protoize} command, even though their @samp{.X} files already
13329 exist, because otherwise they won't get converted.
13330
13331 @xref{Protoize Caveats}, for more information on how to use
13332 @code{protoize} successfully.