]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/gcc/doc/invoke.texi
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
3 @c This is part of the GCC manual.
4 @c For copying conditions, see the file gcc.texi.
5
6 @ignore
7 @c man begin INCLUDE
8 @include gcc-vers.texi
9 @c man end
10
11 @c man begin COPYRIGHT
12 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
13 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
14
15 Permission is granted to copy, distribute and/or modify this document
16 under the terms of the GNU Free Documentation License, Version 1.2 or
17 any later version published by the Free Software Foundation; with the
18 Invariant Sections being ``GNU General Public License'' and ``Funding
19 Free Software'', the Front-Cover texts being (a) (see below), and with
20 the Back-Cover Texts being (b) (see below).  A copy of the license is
21 included in the gfdl(7) man page.
22
23 (a) The FSF's Front-Cover Text is:
24
25      A GNU Manual
26
27 (b) The FSF's Back-Cover Text is:
28
29      You have freedom to copy and modify this GNU Manual, like GNU
30      software.  Copies published by the Free Software Foundation raise
31      funds for GNU development.
32 @c man end
33 @c Set file name and title for the man page.
34 @setfilename gcc
35 @settitle GNU project C and C++ compiler
36 @c man begin SYNOPSIS
37 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
38     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
39     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
40     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
41     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
42     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
43     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
44
45 Only the most useful options are listed here; see below for the
46 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
47 @c man end
48 @c man begin SEEALSO
49 gpl(7), gfdl(7), fsf-funding(7),
50 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
51 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
52 @file{ld}, @file{binutils} and @file{gdb}.
53 @c man end
54 @c man begin BUGS
55 For instructions on reporting bugs, see
56 @w{@uref{http://gcc.gnu.org/bugs.html}}.
57 @c man end
58 @c man begin AUTHOR
59 See the Info entry for @command{gcc}, or
60 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
61 for contributors to GCC@.
62 @c man end
63 @end ignore
64
65 @node Invoking GCC
66 @chapter GCC Command Options
67 @cindex GCC command options
68 @cindex command options
69 @cindex options, GCC command
70
71 @c man begin DESCRIPTION
72 When you invoke GCC, it normally does preprocessing, compilation,
73 assembly and linking.  The ``overall options'' allow you to stop this
74 process at an intermediate stage.  For example, the @option{-c} option
75 says not to run the linker.  Then the output consists of object files
76 output by the assembler.
77
78 Other options are passed on to one stage of processing.  Some options
79 control the preprocessor and others the compiler itself.  Yet other
80 options control the assembler and linker; most of these are not
81 documented here, since you rarely need to use any of them.
82
83 @cindex C compilation options
84 Most of the command line options that you can use with GCC are useful
85 for C programs; when an option is only useful with another language
86 (usually C++), the explanation says so explicitly.  If the description
87 for a particular option does not mention a source language, you can use
88 that option with all supported languages.
89
90 @cindex C++ compilation options
91 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
92 options for compiling C++ programs.
93
94 @cindex grouping options
95 @cindex options, grouping
96 The @command{gcc} program accepts options and file names as operands.  Many
97 options have multi-letter names; therefore multiple single-letter options
98 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
99 -r}}.
100
101 @cindex order of options
102 @cindex options, order
103 You can mix options and other arguments.  For the most part, the order
104 you use doesn't matter.  Order does matter when you use several options
105 of the same kind; for example, if you specify @option{-L} more than once,
106 the directories are searched in the order specified.
107
108 Many options have long names starting with @samp{-f} or with
109 @samp{-W}---for example, 
110 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
111 these have both positive and negative forms; the negative form of
112 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
113 only one of these two forms, whichever one is not the default.
114
115 @c man end
116
117 @xref{Option Index}, for an index to GCC's options.
118
119 @menu
120 * Option Summary::      Brief list of all options, without explanations.
121 * Overall Options::     Controlling the kind of output:
122                         an executable, object files, assembler files,
123                         or preprocessed source.
124 * Invoking G++::        Compiling C++ programs.
125 * C Dialect Options::   Controlling the variant of C language compiled.
126 * C++ Dialect Options:: Variations on C++.
127 * Language Independent Options:: Controlling how diagnostics should be
128                         formatted.
129 * Warning Options::     How picky should the compiler be?
130 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
131 * Optimize Options::    How much optimization?
132 * Preprocessor Options:: Controlling header files and macro definitions.
133                          Also, getting dependency information for Make.
134 * Assembler Options::   Passing options to the assembler.
135 * Link Options::        Specifying libraries and so on.
136 * Directory Options::   Where to find header files and libraries.
137                         Where to find the compiler executable files.
138 * Spec Files::          How to pass switches to sub-processes.
139 * Target Options::      Running a cross-compiler, or an old version of GCC.
140 * Submodel Options::    Specifying minor hardware or convention variations,
141                         such as 68010 vs 68020.
142 * Code Gen Options::    Specifying conventions for function calls, data layout
143                         and register usage.
144 * Environment Variables:: Env vars that affect GCC.
145 * Precompiled Headers:: Compiling a header once, and using it many times.
146 * Running Protoize::    Automatically adding or removing function prototypes.
147 @end menu
148
149 @c man begin OPTIONS
150
151 @node Option Summary
152 @section Option Summary
153
154 Here is a summary of all the options, grouped by type.  Explanations are
155 in the following sections.
156
157 @table @emph
158 @item Overall Options
159 @xref{Overall Options,,Options Controlling the Kind of Output}.
160 @gccoptlist{-c  -S  -E  -o @var{file}  -combine -pipe  -pass-exit-codes  @gol
161 -x @var{language}  -v  -###  --help  --target-help  --version @@@var{file}}
162
163 @item C Language Options
164 @xref{C Dialect Options,,Options Controlling C Dialect}.
165 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
166 -aux-info @var{filename} @gol
167 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
168 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
169 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
170 -fallow-single-precision  -fcond-mismatch @gol
171 -fsigned-bitfields  -fsigned-char @gol
172 -funsigned-bitfields  -funsigned-char}
173
174 @item C++ Language Options
175 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
176 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
177 -fconserve-space  -ffriend-injection @gol
178 -fno-elide-constructors @gol
179 -fno-enforce-eh-specs @gol
180 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
181 -fno-implicit-templates @gol
182 -fno-implicit-inline-templates @gol
183 -fno-implement-inlines  -fms-extensions @gol
184 -fno-nonansi-builtins  -fno-operator-names @gol
185 -fno-optional-diags  -fpermissive @gol
186 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
187 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
188 -fno-default-inline  -fvisibility-inlines-hidden @gol
189 -Wabi  -Wctor-dtor-privacy @gol
190 -Wnon-virtual-dtor  -Wreorder @gol
191 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
192 -Wno-non-template-friend  -Wold-style-cast @gol
193 -Woverloaded-virtual  -Wno-pmf-conversions @gol
194 -Wsign-promo}
195
196 @item Language Independent Options
197 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
198 @gccoptlist{-fmessage-length=@var{n}  @gol
199 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
200 -fdiagnostics-show-option}
201
202 @item Warning Options
203 @xref{Warning Options,,Options to Request or Suppress Warnings}.
204 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
205 -w  -Wextra  -Wall  -Waddress  -Waggregate-return -Wno-attributes @gol
206 -Wc++-compat -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment @gol
207 -Wconversion  -Wno-deprecated-declarations @gol
208 -Wdisabled-optimization  -Wno-div-by-zero  -Wno-endif-labels @gol
209 -Werror  -Werror=* -Werror-implicit-function-declaration @gol
210 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
211 -Wno-format-extra-args -Wformat-nonliteral @gol
212 -Wformat-security  -Wformat-y2k @gol
213 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
214 -Wimport  -Wno-import  -Winit-self  -Winline @gol
215 -Wno-int-to-pointer-cast @gol
216 -Wno-invalid-offsetof  -Winvalid-pch @gol
217 -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations  -Wlong-long @gol
218 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
219 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
220 -Wmissing-noreturn @gol
221 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
222 -Woverlength-strings  -Wpacked  -Wpadded @gol
223 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
224 -Wredundant-decls @gol
225 -Wreturn-type  -Wsequence-point  -Wshadow @gol
226 -Wsign-compare  -Wstack-protector @gol
227 -Wstrict-aliasing -Wstrict-aliasing=2 @gol
228 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
229 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
230 -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
231 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
232 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
233 -Wunused-value  -Wunused-variable  -Wvariadic-macros @gol
234 -Wvolatile-register-var  -Wwrite-strings}
235
236 @item C-only Warning Options
237 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
238 -Wmissing-prototypes  -Wnested-externs  -Wold-style-definition @gol
239 -Wstrict-prototypes  -Wtraditional @gol
240 -Wdeclaration-after-statement -Wpointer-sign}
241
242 @item Debugging Options
243 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
244 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
245 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
246 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
247 -fdump-ipa-all -fdump-ipa-cgraph @gol
248 -fdump-tree-all @gol
249 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
250 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
251 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
252 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
253 -fdump-tree-ch @gol
254 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
255 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
256 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
257 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
258 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
259 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
260 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
261 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
262 -fdump-tree-nrv -fdump-tree-vect @gol
263 -fdump-tree-sink @gol
264 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
265 -fdump-tree-salias @gol
266 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
267 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
268 -ftree-vectorizer-verbose=@var{n} @gol
269 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
270 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
271 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
272 -fmem-report -fprofile-arcs @gol
273 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
274 -ftest-coverage  -ftime-report -fvar-tracking @gol
275 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
276 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
277 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
278 -print-multi-directory  -print-multi-lib @gol
279 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
280 -save-temps  -time}
281
282 @item Optimization Options
283 @xref{Optimize Options,,Options that Control Optimization}.
284 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
285 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
286 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
287 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
288 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
289 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
290 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
291 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
292 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
293 -fforce-addr  -ffunction-sections @gol
294 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
295 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
296 -finline-functions  -finline-functions-called-once @gol
297 -finline-limit=@var{n}  -fkeep-inline-functions @gol
298 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
299 -fmodulo-sched -fno-branch-count-reg @gol
300 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
301 -fno-function-cse  -fno-guess-branch-probability @gol
302 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
303 -funsafe-math-optimizations  -funsafe-loop-optimizations  -ffinite-math-only @gol
304 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
305 -fomit-frame-pointer  -foptimize-register-move @gol
306 -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
307 -fprofile-generate -fprofile-use @gol
308 -fregmove  -frename-registers @gol
309 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
310 -frerun-cse-after-loop @gol
311 -frounding-math -frtl-abstract-sequences @gol
312 -fschedule-insns  -fschedule-insns2 @gol
313 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
314 -fsched-spec-load-dangerous  @gol
315 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
316 -fsched2-use-superblocks @gol
317 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
318 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
319 -fstack-protector  -fstack-protector-all @gol
320 -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps @gol
321 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
322 -fsplit-ivs-in-unroller -funswitch-loops @gol
323 -fvariable-expansion-in-unroller @gol
324 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
325 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
326 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
327 -ftree-ch -ftree-sra -ftree-ter -ftree-lrs -ftree-fre -ftree-vectorize @gol
328 -ftree-vect-loop-version -ftree-salias -fipa-pta -fweb @gol
329 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
330 --param @var{name}=@var{value}
331 -O  -O0  -O1  -O2  -O3  -Os}
332
333 @item Preprocessor Options
334 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
335 @gccoptlist{-A@var{question}=@var{answer} @gol
336 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
337 -C  -dD  -dI  -dM  -dN @gol
338 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
339 -idirafter @var{dir} @gol
340 -include @var{file}  -imacros @var{file} @gol
341 -iprefix @var{file}  -iwithprefix @var{dir} @gol
342 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
343 -imultilib @var{dir} -isysroot @var{dir} @gol
344 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
345 -P  -fworking-directory  -remap @gol
346 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
347 -Xpreprocessor @var{option}}
348
349 @item Assembler Option
350 @xref{Assembler Options,,Passing Options to the Assembler}.
351 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
352
353 @item Linker Options
354 @xref{Link Options,,Options for Linking}.
355 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
356 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
357 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
358 -Wl,@var{option}  -Xlinker @var{option} @gol
359 -u @var{symbol}}
360
361 @item Directory Options
362 @xref{Directory Options,,Options for Directory Search}.
363 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
364 -specs=@var{file}  -I- --sysroot=@var{dir}}
365
366 @item Target Options
367 @c I wrote this xref this way to avoid overfull hbox. -- rms
368 @xref{Target Options}.
369 @gccoptlist{-V @var{version}  -b @var{machine}}
370
371 @item Machine Dependent Options
372 @xref{Submodel Options,,Hardware Models and Configurations}.
373 @c This list is ordered alphanumerically by subsection name.
374 @c Try and put the significant identifier (CPU or system) first,
375 @c so users have a clue at guessing where the ones they want will be.
376
377 @emph{ARC Options}
378 @gccoptlist{-EB  -EL @gol
379 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
380 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
381
382 @emph{ARM Options}
383 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
384 -mabi=@var{name} @gol
385 -mapcs-stack-check  -mno-apcs-stack-check @gol
386 -mapcs-float  -mno-apcs-float @gol
387 -mapcs-reentrant  -mno-apcs-reentrant @gol
388 -msched-prolog  -mno-sched-prolog @gol
389 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
390 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
391 -mthumb-interwork  -mno-thumb-interwork @gol
392 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
393 -mstructure-size-boundary=@var{n} @gol
394 -mabort-on-noreturn @gol
395 -mlong-calls  -mno-long-calls @gol
396 -msingle-pic-base  -mno-single-pic-base @gol
397 -mpic-register=@var{reg} @gol
398 -mnop-fun-dllimport @gol
399 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
400 -mpoke-function-name @gol
401 -mthumb  -marm @gol
402 -mtpcs-frame  -mtpcs-leaf-frame @gol
403 -mcaller-super-interworking  -mcallee-super-interworking @gol
404 -mtp=@var{name}}
405
406 @emph{AVR Options}
407 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
408 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
409
410 @emph{Blackfin Options}
411 @gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol
412 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly @gol
413 -mlow-64k -mno-low64k -mid-shared-library @gol
414 -mno-id-shared-library -mshared-library-id=@var{n} @gol
415 -mlong-calls  -mno-long-calls}
416
417 @emph{CRIS Options}
418 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
419 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
420 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
421 -mstack-align  -mdata-align  -mconst-align @gol
422 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
423 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
424 -mmul-bug-workaround  -mno-mul-bug-workaround}
425
426 @emph{CRX Options}
427 @gccoptlist{-mmac -mpush-args}
428
429 @emph{Darwin Options}
430 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
431 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
432 -client_name  -compatibility_version  -current_version @gol
433 -dead_strip @gol
434 -dependency-file  -dylib_file  -dylinker_install_name @gol
435 -dynamic  -dynamiclib  -exported_symbols_list @gol
436 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
437 -force_flat_namespace  -headerpad_max_install_names @gol
438 -image_base  -init  -install_name  -keep_private_externs @gol
439 -multi_module  -multiply_defined  -multiply_defined_unused @gol
440 -noall_load   -no_dead_strip_inits_and_terms @gol
441 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
442 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
443 -private_bundle  -read_only_relocs  -sectalign @gol
444 -sectobjectsymbols  -whyload  -seg1addr @gol
445 -sectcreate  -sectobjectsymbols  -sectorder @gol
446 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
447 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
448 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
449 -single_module  -static  -sub_library  -sub_umbrella @gol
450 -twolevel_namespace  -umbrella  -undefined @gol
451 -unexported_symbols_list  -weak_reference_mismatches @gol
452 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
453 -mkernel -mone-byte-bool}
454
455 @emph{DEC Alpha Options}
456 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
457 -mieee  -mieee-with-inexact  -mieee-conformant @gol
458 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
459 -mtrap-precision=@var{mode}  -mbuild-constants @gol
460 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
461 -mbwx  -mmax  -mfix  -mcix @gol
462 -mfloat-vax  -mfloat-ieee @gol
463 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
464 -msmall-text  -mlarge-text @gol
465 -mmemory-latency=@var{time}}
466
467 @emph{DEC Alpha/VMS Options}
468 @gccoptlist{-mvms-return-codes}
469
470 @emph{FRV Options}
471 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
472 -mhard-float  -msoft-float @gol
473 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
474 -mdouble  -mno-double @gol
475 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
476 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
477 -mlinked-fp  -mlong-calls  -malign-labels @gol
478 -mlibrary-pic  -macc-4  -macc-8 @gol
479 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
480 -moptimize-membar -mno-optimize-membar @gol
481 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
482 -mvliw-branch  -mno-vliw-branch @gol
483 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
484 -mno-nested-cond-exec  -mtomcat-stats @gol
485 -mTLS -mtls @gol
486 -mcpu=@var{cpu}}
487
488 @emph{GNU/Linux Options}
489 @gccoptlist{-muclibc}
490
491 @emph{H8/300 Options}
492 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
493
494 @emph{HPPA Options}
495 @gccoptlist{-march=@var{architecture-type} @gol
496 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
497 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
498 -mfixed-range=@var{register-range} @gol
499 -mjump-in-delay -mlinker-opt -mlong-calls @gol
500 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
501 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
502 -mno-jump-in-delay  -mno-long-load-store @gol
503 -mno-portable-runtime  -mno-soft-float @gol
504 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
505 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
506 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
507 -munix=@var{unix-std}  -nolibdld  -static  -threads}
508
509 @emph{i386 and x86-64 Options}
510 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
511 -mfpmath=@var{unit} @gol
512 -masm=@var{dialect}  -mno-fancy-math-387 @gol
513 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
514 -mno-wide-multiply  -mrtd  -malign-double @gol
515 -mpreferred-stack-boundary=@var{num} @gol
516 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4a -m3dnow -mpopcnt -mabm @gol
517 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
518 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
519 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
520 -mstackrealign @gol
521 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
522 -mcmodel=@var{code-model} @gol
523 -m32  -m64 -mlarge-data-threshold=@var{num}}
524
525 @emph{IA-64 Options}
526 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
527 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
528 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
529 -minline-float-divide-max-throughput @gol
530 -minline-int-divide-min-latency @gol
531 -minline-int-divide-max-throughput  @gol
532 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
533 -mno-dwarf2-asm -mearly-stop-bits @gol
534 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
535 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
536 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
537 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
538 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
539 -mno-sched-prefer-non-data-spec-insns @gol
540 -mno-sched-prefer-non-control-spec-insns @gol
541 -mno-sched-count-spec-in-critical-path}
542
543 @emph{M32R/D Options}
544 @gccoptlist{-m32r2 -m32rx -m32r @gol
545 -mdebug @gol
546 -malign-loops -mno-align-loops @gol
547 -missue-rate=@var{number} @gol
548 -mbranch-cost=@var{number} @gol
549 -mmodel=@var{code-size-model-type} @gol
550 -msdata=@var{sdata-type} @gol
551 -mno-flush-func -mflush-func=@var{name} @gol
552 -mno-flush-trap -mflush-trap=@var{number} @gol
553 -G @var{num}}
554
555 @emph{M32C Options}
556 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
557
558 @emph{M680x0 Options}
559 @gccoptlist{-m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
560 -m68060  -mcpu32  -m5200  -mcfv4e -m68881  -mbitfield  @gol
561 -mc68000  -mc68020   @gol
562 -mnobitfield  -mrtd  -mshort  -msoft-float  -mpcrel @gol
563 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
564 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
565
566 @emph{M68hc1x Options}
567 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
568 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
569 -msoft-reg-count=@var{count}}
570
571 @emph{MCore Options}
572 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
573 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
574 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
575 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
576 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
577
578 @emph{MIPS Options}
579 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
580 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
581 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
582 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64  @gol
583 -mfp32  -mfp64  -mhard-float  -msoft-float  @gol
584 -msingle-float  -mdouble-float  -mdsp  -mpaired-single  -mips3d @gol
585 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
586 -G@var{num}  -membedded-data  -mno-embedded-data @gol
587 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
588 -msplit-addresses  -mno-split-addresses  @gol
589 -mexplicit-relocs  -mno-explicit-relocs  @gol
590 -mcheck-zero-division  -mno-check-zero-division @gol
591 -mdivide-traps  -mdivide-breaks @gol
592 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
593 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
594 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
595 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130 @gol
596 -mfix-sb1  -mno-fix-sb1 @gol
597 -mflush-func=@var{func}  -mno-flush-func @gol
598 -mbranch-likely  -mno-branch-likely @gol
599 -mfp-exceptions -mno-fp-exceptions @gol
600 -mvr4130-align -mno-vr4130-align}
601
602 @emph{MMIX Options}
603 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
604 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
605 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
606 -mno-base-addresses  -msingle-exit  -mno-single-exit}
607
608 @emph{MN10300 Options}
609 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
610 -mam33  -mno-am33 @gol
611 -mam33-2  -mno-am33-2 @gol
612 -mreturn-pointer-on-d0 @gol
613 -mno-crt0  -mrelax}
614
615 @emph{MT Options}
616 @gccoptlist{-mno-crt0 -mbacc -msim @gol
617 -march=@var{cpu-type} }
618
619 @emph{PDP-11 Options}
620 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
621 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
622 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
623 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
624 -mbranch-expensive  -mbranch-cheap @gol
625 -msplit  -mno-split  -munix-asm  -mdec-asm}
626
627 @emph{PowerPC Options}
628 See RS/6000 and PowerPC Options.
629
630 @emph{RS/6000 and PowerPC Options}
631 @gccoptlist{-mcpu=@var{cpu-type} @gol
632 -mtune=@var{cpu-type} @gol
633 -mpower  -mno-power  -mpower2  -mno-power2 @gol
634 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
635 -maltivec  -mno-altivec @gol
636 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
637 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
638 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
639 -mnew-mnemonics  -mold-mnemonics @gol
640 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
641 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
642 -malign-power  -malign-natural @gol
643 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
644 -mstring  -mno-string  -mupdate  -mno-update @gol
645 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
646 -mstrict-align  -mno-strict-align  -mrelocatable @gol
647 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
648 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
649 -mdynamic-no-pic  -maltivec  -mswdiv @gol
650 -mprioritize-restricted-insns=@var{priority} @gol
651 -msched-costly-dep=@var{dependence_type} @gol
652 -minsert-sched-nops=@var{scheme} @gol
653 -mcall-sysv  -mcall-netbsd @gol
654 -maix-struct-return  -msvr4-struct-return @gol
655 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
656 -misel -mno-isel @gol
657 -misel=yes  -misel=no @gol
658 -mspe -mno-spe @gol
659 -mspe=yes  -mspe=no @gol
660 -mvrsave -mno-vrsave @gol
661 -mmulhw -mno-mulhw @gol
662 -mdlmzb -mno-dlmzb @gol
663 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
664 -mprototype  -mno-prototype @gol
665 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
666 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
667
668 @emph{S/390 and zSeries Options}
669 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
670 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
671 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
672 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
673 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
674 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
675 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
676
677 @emph{Score Options}
678 @gccoptlist{-meb -mel @gol
679 -mnhwloop @gol
680 -muls @gol
681 -mmac @gol
682 -mscore5 -mscore5u -mscore7 -mscore7d}
683  
684 @emph{SH Options}
685 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
686 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
687 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
688 -m5-64media  -m5-64media-nofpu @gol
689 -m5-32media  -m5-32media-nofpu @gol
690 -m5-compact  -m5-compact-nofpu @gol
691 -mb  -ml  -mdalign  -mrelax @gol
692 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
693 -mieee  -misize  -mpadstruct  -mspace @gol
694 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
695 -mdivsi3_libfunc=@var{name}  @gol
696 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
697  -minvalid-symbols}
698
699 @emph{SPARC Options}
700 @gccoptlist{-mcpu=@var{cpu-type} @gol
701 -mtune=@var{cpu-type} @gol
702 -mcmodel=@var{code-model} @gol
703 -m32  -m64  -mapp-regs  -mno-app-regs @gol
704 -mfaster-structs  -mno-faster-structs @gol
705 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
706 -mhard-quad-float  -msoft-quad-float @gol
707 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
708 -mstack-bias  -mno-stack-bias @gol
709 -munaligned-doubles  -mno-unaligned-doubles @gol
710 -mv8plus  -mno-v8plus  -mvis  -mno-vis
711 -threads -pthreads -pthread}
712
713 @emph{System V Options}
714 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
715
716 @emph{TMS320C3x/C4x Options}
717 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
718 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
719 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
720 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
721
722 @emph{V850 Options}
723 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
724 -mprolog-function  -mno-prolog-function  -mspace @gol
725 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
726 -mapp-regs  -mno-app-regs @gol
727 -mdisable-callt  -mno-disable-callt @gol
728 -mv850e1 @gol
729 -mv850e @gol
730 -mv850  -mbig-switch}
731
732 @emph{VAX Options}
733 @gccoptlist{-mg  -mgnu  -munix}
734
735 @emph{x86-64 Options}
736 See i386 and x86-64 Options.
737
738 @emph{Xstormy16 Options}
739 @gccoptlist{-msim}
740
741 @emph{Xtensa Options}
742 @gccoptlist{-mconst16 -mno-const16 @gol
743 -mfused-madd  -mno-fused-madd @gol
744 -mtext-section-literals  -mno-text-section-literals @gol
745 -mtarget-align  -mno-target-align @gol
746 -mlongcalls  -mno-longcalls}
747
748 @emph{zSeries Options}
749 See S/390 and zSeries Options.
750
751 @item Code Generation Options
752 @xref{Code Gen Options,,Options for Code Generation Conventions}.
753 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
754 -ffixed-@var{reg}  -fexceptions @gol
755 -fnon-call-exceptions  -funwind-tables @gol
756 -fasynchronous-unwind-tables @gol
757 -finhibit-size-directive  -finstrument-functions @gol
758 -fno-common  -fno-ident @gol
759 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
760 -fno-jump-tables @gol
761 -freg-struct-return  -fshort-enums @gol
762 -fshort-double  -fshort-wchar @gol
763 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
764 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
765 -fargument-alias  -fargument-noalias @gol
766 -fargument-noalias-global  -fargument-noalias-anything
767 -fleading-underscore  -ftls-model=@var{model} @gol
768 -ftrapv  -fwrapv  -fbounds-check @gol
769 -fvisibility}
770 @end table
771
772 @menu
773 * Overall Options::     Controlling the kind of output:
774                         an executable, object files, assembler files,
775                         or preprocessed source.
776 * C Dialect Options::   Controlling the variant of C language compiled.
777 * C++ Dialect Options:: Variations on C++.
778 * Language Independent Options:: Controlling how diagnostics should be
779                         formatted.
780 * Warning Options::     How picky should the compiler be?
781 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
782 * Optimize Options::    How much optimization?
783 * Preprocessor Options:: Controlling header files and macro definitions.
784                          Also, getting dependency information for Make.
785 * Assembler Options::   Passing options to the assembler.
786 * Link Options::        Specifying libraries and so on.
787 * Directory Options::   Where to find header files and libraries.
788                         Where to find the compiler executable files.
789 * Spec Files::          How to pass switches to sub-processes.
790 * Target Options::      Running a cross-compiler, or an old version of GCC.
791 @end menu
792
793 @node Overall Options
794 @section Options Controlling the Kind of Output
795
796 Compilation can involve up to four stages: preprocessing, compilation
797 proper, assembly and linking, always in that order.  GCC is capable of
798 preprocessing and compiling several files either into several
799 assembler input files, or into one assembler input file; then each
800 assembler input file produces an object file, and linking combines all
801 the object files (those newly compiled, and those specified as input)
802 into an executable file.
803
804 @cindex file name suffix
805 For any given input file, the file name suffix determines what kind of
806 compilation is done:
807
808 @table @gcctabopt
809 @item @var{file}.c
810 C source code which must be preprocessed.
811
812 @item @var{file}.i
813 C source code which should not be preprocessed.
814
815 @item @var{file}.ii
816 C++ source code which should not be preprocessed.
817
818 @item @var{file}.h
819 C, or C++ header file to be turned into a precompiled header.
820
821 @item @var{file}.cc
822 @itemx @var{file}.cp
823 @itemx @var{file}.cxx
824 @itemx @var{file}.cpp
825 @itemx @var{file}.CPP
826 @itemx @var{file}.c++
827 @itemx @var{file}.C
828 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
829 the last two letters must both be literally @samp{x}.  Likewise,
830 @samp{.C} refers to a literal capital C@.
831
832 @item @var{file}.hh
833 @itemx @var{file}.H
834 C++ header file to be turned into a precompiled header.
835
836 @item @var{file}.f
837 @itemx @var{file}.for
838 @itemx @var{file}.FOR
839 Fixed form Fortran source code which should not be preprocessed.
840
841 @item @var{file}.F
842 @itemx @var{file}.fpp
843 @itemx @var{file}.FPP
844 Fixed form Fortran source code which must be preprocessed (with the traditional
845 preprocessor).
846
847 @item @var{file}.f90
848 @itemx @var{file}.f95
849 Free form Fortran source code which should not be preprocessed.
850
851 @item @var{file}.F90
852 @itemx @var{file}.F95
853 Free form Fortran source code which must be preprocessed (with the
854 traditional preprocessor).
855
856 @c FIXME: Descriptions of Java file types.
857 @c @var{file}.java
858 @c @var{file}.class
859 @c @var{file}.zip
860 @c @var{file}.jar
861
862 @item @var{file}.ads
863 Ada source code file which contains a library unit declaration (a
864 declaration of a package, subprogram, or generic, or a generic
865 instantiation), or a library unit renaming declaration (a package,
866 generic, or subprogram renaming declaration).  Such files are also
867 called @dfn{specs}.
868
869 @itemx @var{file}.adb
870 Ada source code file containing a library unit body (a subprogram or
871 package body).  Such files are also called @dfn{bodies}.
872
873 @c GCC also knows about some suffixes for languages not yet included:
874 @c Pascal:
875 @c @var{file}.p
876 @c @var{file}.pas
877 @c Ratfor:
878 @c @var{file}.r
879
880 @item @var{file}.s
881 Assembler code.
882
883 @item @var{file}.S
884 Assembler code which must be preprocessed.
885
886 @item @var{other}
887 An object file to be fed straight into linking.
888 Any file name with no recognized suffix is treated this way.
889 @end table
890
891 @opindex x
892 You can specify the input language explicitly with the @option{-x} option:
893
894 @table @gcctabopt
895 @item -x @var{language}
896 Specify explicitly the @var{language} for the following input files
897 (rather than letting the compiler choose a default based on the file
898 name suffix).  This option applies to all following input files until
899 the next @option{-x} option.  Possible values for @var{language} are:
900 @smallexample
901 c  c-header  c-cpp-output
902 c++  c++-header  c++-cpp-output
903 assembler  assembler-with-cpp
904 ada
905 f95  f95-cpp-input
906 java
907 treelang
908 @end smallexample
909
910 @item -x none
911 Turn off any specification of a language, so that subsequent files are
912 handled according to their file name suffixes (as they are if @option{-x}
913 has not been used at all).
914
915 @item -pass-exit-codes
916 @opindex pass-exit-codes
917 Normally the @command{gcc} program will exit with the code of 1 if any
918 phase of the compiler returns a non-success return code.  If you specify
919 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
920 numerically highest error produced by any phase that returned an error
921 indication.  The C, C++, and Fortran frontends return 4, if an internal
922 compiler error is encountered.
923 @end table
924
925 If you only want some of the stages of compilation, you can use
926 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
927 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
928 @command{gcc} is to stop.  Note that some combinations (for example,
929 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
930
931 @table @gcctabopt
932 @item -c
933 @opindex c
934 Compile or assemble the source files, but do not link.  The linking
935 stage simply is not done.  The ultimate output is in the form of an
936 object file for each source file.
937
938 By default, the object file name for a source file is made by replacing
939 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
940
941 Unrecognized input files, not requiring compilation or assembly, are
942 ignored.
943
944 @item -S
945 @opindex S
946 Stop after the stage of compilation proper; do not assemble.  The output
947 is in the form of an assembler code file for each non-assembler input
948 file specified.
949
950 By default, the assembler file name for a source file is made by
951 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
952
953 Input files that don't require compilation are ignored.
954
955 @item -E
956 @opindex E
957 Stop after the preprocessing stage; do not run the compiler proper.  The
958 output is in the form of preprocessed source code, which is sent to the
959 standard output.
960
961 Input files which don't require preprocessing are ignored.
962
963 @cindex output file option
964 @item -o @var{file}
965 @opindex o
966 Place output in file @var{file}.  This applies regardless to whatever
967 sort of output is being produced, whether it be an executable file,
968 an object file, an assembler file or preprocessed C code.
969
970 If @option{-o} is not specified, the default is to put an executable
971 file in @file{a.out}, the object file for
972 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
973 assembler file in @file{@var{source}.s}, a precompiled header file in
974 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
975 standard output.
976
977 @item -v
978 @opindex v
979 Print (on standard error output) the commands executed to run the stages
980 of compilation.  Also print the version number of the compiler driver
981 program and of the preprocessor and the compiler proper.
982
983 @item -###
984 @opindex ###
985 Like @option{-v} except the commands are not executed and all command
986 arguments are quoted.  This is useful for shell scripts to capture the
987 driver-generated command lines.
988
989 @item -pipe
990 @opindex pipe
991 Use pipes rather than temporary files for communication between the
992 various stages of compilation.  This fails to work on some systems where
993 the assembler is unable to read from a pipe; but the GNU assembler has
994 no trouble.
995
996 @item -combine
997 @opindex combine
998 If you are compiling multiple source files, this option tells the driver
999 to pass all the source files to the compiler at once (for those
1000 languages for which the compiler can handle this).  This will allow
1001 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1002 language for which this is supported is C@.  If you pass source files for
1003 multiple languages to the driver, using this option, the driver will invoke
1004 the compiler(s) that support IMA once each, passing each compiler all the
1005 source files appropriate for it.  For those languages that do not support
1006 IMA this option will be ignored, and the compiler will be invoked once for
1007 each source file in that language.  If you use this option in conjunction
1008 with @option{-save-temps}, the compiler will generate multiple
1009 pre-processed files
1010 (one for each source file), but only one (combined) @file{.o} or
1011 @file{.s} file.
1012
1013 @item --help
1014 @opindex help
1015 Print (on the standard output) a description of the command line options
1016 understood by @command{gcc}.  If the @option{-v} option is also specified
1017 then @option{--help} will also be passed on to the various processes
1018 invoked by @command{gcc}, so that they can display the command line options
1019 they accept.  If the @option{-Wextra} option is also specified then command
1020 line options which have no documentation associated with them will also
1021 be displayed.
1022
1023 @item --target-help
1024 @opindex target-help
1025 Print (on the standard output) a description of target specific command
1026 line options for each tool.
1027
1028 @item --version
1029 @opindex version
1030 Display the version number and copyrights of the invoked GCC@.
1031
1032 @include @value{srcdir}/../libiberty/at-file.texi
1033 @end table
1034
1035 @node Invoking G++
1036 @section Compiling C++ Programs
1037
1038 @cindex suffixes for C++ source
1039 @cindex C++ source file suffixes
1040 C++ source files conventionally use one of the suffixes @samp{.C},
1041 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1042 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1043 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1044 files with these names and compiles them as C++ programs even if you
1045 call the compiler the same way as for compiling C programs (usually
1046 with the name @command{gcc}).
1047
1048 @findex g++
1049 @findex c++
1050 However, the use of @command{gcc} does not add the C++ library.
1051 @command{g++} is a program that calls GCC and treats @samp{.c},
1052 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1053 files unless @option{-x} is used, and automatically specifies linking
1054 against the C++ library.  This program is also useful when
1055 precompiling a C header file with a @samp{.h} extension for use in C++
1056 compilations.  On many systems, @command{g++} is also installed with
1057 the name @command{c++}.
1058
1059 @cindex invoking @command{g++}
1060 When you compile C++ programs, you may specify many of the same
1061 command-line options that you use for compiling programs in any
1062 language; or command-line options meaningful for C and related
1063 languages; or options that are meaningful only for C++ programs.
1064 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1065 explanations of options for languages related to C@.
1066 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1067 explanations of options that are meaningful only for C++ programs.
1068
1069 @node C Dialect Options
1070 @section Options Controlling C Dialect
1071 @cindex dialect options
1072 @cindex language dialect options
1073 @cindex options, dialect
1074
1075 The following options control the dialect of C (or languages derived
1076 from C, such as C++) that the compiler accepts:
1077
1078 @table @gcctabopt
1079 @cindex ANSI support
1080 @cindex ISO support
1081 @item -ansi
1082 @opindex ansi
1083 In C mode, support all ISO C90 programs.  In C++ mode,
1084 remove GNU extensions that conflict with ISO C++.
1085
1086 This turns off certain features of GCC that are incompatible with ISO
1087 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1088 such as the @code{asm} and @code{typeof} keywords, and
1089 predefined macros such as @code{unix} and @code{vax} that identify the
1090 type of system you are using.  It also enables the undesirable and
1091 rarely used ISO trigraph feature.  For the C compiler,
1092 it disables recognition of C++ style @samp{//} comments as well as
1093 the @code{inline} keyword.
1094
1095 The alternate keywords @code{__asm__}, @code{__extension__},
1096 @code{__inline__} and @code{__typeof__} continue to work despite
1097 @option{-ansi}.  You would not want to use them in an ISO C program, of
1098 course, but it is useful to put them in header files that might be included
1099 in compilations done with @option{-ansi}.  Alternate predefined macros
1100 such as @code{__unix__} and @code{__vax__} are also available, with or
1101 without @option{-ansi}.
1102
1103 The @option{-ansi} option does not cause non-ISO programs to be
1104 rejected gratuitously.  For that, @option{-pedantic} is required in
1105 addition to @option{-ansi}.  @xref{Warning Options}.
1106
1107 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1108 option is used.  Some header files may notice this macro and refrain
1109 from declaring certain functions or defining certain macros that the
1110 ISO standard doesn't call for; this is to avoid interfering with any
1111 programs that might use these names for other things.
1112
1113 Functions which would normally be built in but do not have semantics
1114 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1115 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1116 built-in functions provided by GCC}, for details of the functions
1117 affected.
1118
1119 @item -std=
1120 @opindex std
1121 Determine the language standard.  This option is currently only
1122 supported when compiling C or C++.  A value for this option must be
1123 provided; possible values are
1124
1125 @table @samp
1126 @item c89
1127 @itemx iso9899:1990
1128 ISO C90 (same as @option{-ansi}).
1129
1130 @item iso9899:199409
1131 ISO C90 as modified in amendment 1.
1132
1133 @item c99
1134 @itemx c9x
1135 @itemx iso9899:1999
1136 @itemx iso9899:199x
1137 ISO C99.  Note that this standard is not yet fully supported; see
1138 @w{@uref{http://gcc.gnu.org/gcc-4.2/c99status.html}} for more information.  The
1139 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1140
1141 @item gnu89
1142 Default, ISO C90 plus GNU extensions (including some C99 features).
1143
1144 @item gnu99
1145 @itemx gnu9x
1146 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1147 this will become the default.  The name @samp{gnu9x} is deprecated.
1148
1149 @item c++98
1150 The 1998 ISO C++ standard plus amendments.
1151
1152 @item gnu++98
1153 The same as @option{-std=c++98} plus GNU extensions.  This is the
1154 default for C++ code.
1155 @end table
1156
1157 Even when this option is not specified, you can still use some of the
1158 features of newer standards in so far as they do not conflict with
1159 previous C standards.  For example, you may use @code{__restrict__} even
1160 when @option{-std=c99} is not specified.
1161
1162 The @option{-std} options specifying some version of ISO C have the same
1163 effects as @option{-ansi}, except that features that were not in ISO C90
1164 but are in the specified version (for example, @samp{//} comments and
1165 the @code{inline} keyword in ISO C99) are not disabled.
1166
1167 @xref{Standards,,Language Standards Supported by GCC}, for details of
1168 these standard versions.
1169
1170 @item -fgnu89-inline
1171 @opindex fgnu89-inline
1172 The option @option{-fgnu89-inline} tells GCC to use the traditional
1173 GNU semantics for @code{inline} functions when in C99 mode.
1174 @xref{Inline,,An Inline Function is As Fast As a Macro}.  Using this
1175 option is roughly equivalent to adding the @code{gnu_inline} function
1176 attribute to all inline functions (@pxref{Function Attributes}).
1177
1178 This option is accepted by GCC versions 4.1.3 and up.  In GCC versions
1179 prior to 4.3, C99 inline semantics are not supported, and thus this
1180 option is effectively assumed to be present regardless of whether or not
1181 it is specified; the only effect of specifying it explicitly is to
1182 disable warnings about using inline functions in C99 mode.  Likewise,
1183 the option @option{-fno-gnu89-inline} is not supported in versions of
1184 GCC before 4.3.  It will be supported only in C99 or gnu99 mode, not in
1185 C89 or gnu89 mode.
1186
1187 The preprocesor macros @code{__GNUC_GNU_INLINE__} and
1188 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1189 in effect for @code{inline} functions.  @xref{Common Predefined
1190 Macros,,,cpp,The C Preprocessor}.
1191
1192 @item -aux-info @var{filename}
1193 @opindex aux-info
1194 Output to the given filename prototyped declarations for all functions
1195 declared and/or defined in a translation unit, including those in header
1196 files.  This option is silently ignored in any language other than C@.
1197
1198 Besides declarations, the file indicates, in comments, the origin of
1199 each declaration (source file and line), whether the declaration was
1200 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1201 @samp{O} for old, respectively, in the first character after the line
1202 number and the colon), and whether it came from a declaration or a
1203 definition (@samp{C} or @samp{F}, respectively, in the following
1204 character).  In the case of function definitions, a K&R-style list of
1205 arguments followed by their declarations is also provided, inside
1206 comments, after the declaration.
1207
1208 @item -fno-asm
1209 @opindex fno-asm
1210 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1211 keyword, so that code can use these words as identifiers.  You can use
1212 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1213 instead.  @option{-ansi} implies @option{-fno-asm}.
1214
1215 In C++, this switch only affects the @code{typeof} keyword, since
1216 @code{asm} and @code{inline} are standard keywords.  You may want to
1217 use the @option{-fno-gnu-keywords} flag instead, which has the same
1218 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1219 switch only affects the @code{asm} and @code{typeof} keywords, since
1220 @code{inline} is a standard keyword in ISO C99.
1221
1222 @item -fno-builtin
1223 @itemx -fno-builtin-@var{function}
1224 @opindex fno-builtin
1225 @cindex built-in functions
1226 Don't recognize built-in functions that do not begin with
1227 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1228 functions provided by GCC}, for details of the functions affected,
1229 including those which are not built-in functions when @option{-ansi} or
1230 @option{-std} options for strict ISO C conformance are used because they
1231 do not have an ISO standard meaning.
1232
1233 GCC normally generates special code to handle certain built-in functions
1234 more efficiently; for instance, calls to @code{alloca} may become single
1235 instructions that adjust the stack directly, and calls to @code{memcpy}
1236 may become inline copy loops.  The resulting code is often both smaller
1237 and faster, but since the function calls no longer appear as such, you
1238 cannot set a breakpoint on those calls, nor can you change the behavior
1239 of the functions by linking with a different library.  In addition,
1240 when a function is recognized as a built-in function, GCC may use
1241 information about that function to warn about problems with calls to
1242 that function, or to generate more efficient code, even if the
1243 resulting code still contains calls to that function.  For example,
1244 warnings are given with @option{-Wformat} for bad calls to
1245 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1246 known not to modify global memory.
1247
1248 With the @option{-fno-builtin-@var{function}} option
1249 only the built-in function @var{function} is
1250 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1251 function is named this is not built-in in this version of GCC, this
1252 option is ignored.  There is no corresponding
1253 @option{-fbuiltin-@var{function}} option; if you wish to enable
1254 built-in functions selectively when using @option{-fno-builtin} or
1255 @option{-ffreestanding}, you may define macros such as:
1256
1257 @smallexample
1258 #define abs(n)          __builtin_abs ((n))
1259 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1260 @end smallexample
1261
1262 @item -fhosted
1263 @opindex fhosted
1264 @cindex hosted environment
1265
1266 Assert that compilation takes place in a hosted environment.  This implies
1267 @option{-fbuiltin}.  A hosted environment is one in which the
1268 entire standard library is available, and in which @code{main} has a return
1269 type of @code{int}.  Examples are nearly everything except a kernel.
1270 This is equivalent to @option{-fno-freestanding}.
1271
1272 @item -ffreestanding
1273 @opindex ffreestanding
1274 @cindex hosted environment
1275
1276 Assert that compilation takes place in a freestanding environment.  This
1277 implies @option{-fno-builtin}.  A freestanding environment
1278 is one in which the standard library may not exist, and program startup may
1279 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1280 This is equivalent to @option{-fno-hosted}.
1281
1282 @xref{Standards,,Language Standards Supported by GCC}, for details of
1283 freestanding and hosted environments.
1284
1285 @item -fopenmp
1286 @opindex fopenmp
1287 @cindex openmp parallel
1288 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1289 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1290 compiler generates parallel code according to the OpenMP Application
1291 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1292
1293 @item -fms-extensions
1294 @opindex fms-extensions
1295 Accept some non-standard constructs used in Microsoft header files.
1296
1297 Some cases of unnamed fields in structures and unions are only
1298 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1299 fields within structs/unions}, for details.
1300
1301 @item -trigraphs
1302 @opindex trigraphs
1303 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1304 options for strict ISO C conformance) implies @option{-trigraphs}.
1305
1306 @item -no-integrated-cpp
1307 @opindex no-integrated-cpp
1308 Performs a compilation in two passes: preprocessing and compiling.  This
1309 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1310 @option{-B} option.  The user supplied compilation step can then add in
1311 an additional preprocessing step after normal preprocessing but before
1312 compiling.  The default is to use the integrated cpp (internal cpp)
1313
1314 The semantics of this option will change if "cc1", "cc1plus", and
1315 "cc1obj" are merged.
1316
1317 @cindex traditional C language
1318 @cindex C language, traditional
1319 @item -traditional
1320 @itemx -traditional-cpp
1321 @opindex traditional-cpp
1322 @opindex traditional
1323 Formerly, these options caused GCC to attempt to emulate a pre-standard
1324 C compiler.  They are now only supported with the @option{-E} switch.
1325 The preprocessor continues to support a pre-standard mode.  See the GNU
1326 CPP manual for details.
1327
1328 @item -fcond-mismatch
1329 @opindex fcond-mismatch
1330 Allow conditional expressions with mismatched types in the second and
1331 third arguments.  The value of such an expression is void.  This option
1332 is not supported for C++.
1333
1334 @item -funsigned-char
1335 @opindex funsigned-char
1336 Let the type @code{char} be unsigned, like @code{unsigned char}.
1337
1338 Each kind of machine has a default for what @code{char} should
1339 be.  It is either like @code{unsigned char} by default or like
1340 @code{signed char} by default.
1341
1342 Ideally, a portable program should always use @code{signed char} or
1343 @code{unsigned char} when it depends on the signedness of an object.
1344 But many programs have been written to use plain @code{char} and
1345 expect it to be signed, or expect it to be unsigned, depending on the
1346 machines they were written for.  This option, and its inverse, let you
1347 make such a program work with the opposite default.
1348
1349 The type @code{char} is always a distinct type from each of
1350 @code{signed char} or @code{unsigned char}, even though its behavior
1351 is always just like one of those two.
1352
1353 @item -fsigned-char
1354 @opindex fsigned-char
1355 Let the type @code{char} be signed, like @code{signed char}.
1356
1357 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1358 the negative form of @option{-funsigned-char}.  Likewise, the option
1359 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1360
1361 @item -fsigned-bitfields
1362 @itemx -funsigned-bitfields
1363 @itemx -fno-signed-bitfields
1364 @itemx -fno-unsigned-bitfields
1365 @opindex fsigned-bitfields
1366 @opindex funsigned-bitfields
1367 @opindex fno-signed-bitfields
1368 @opindex fno-unsigned-bitfields
1369 These options control whether a bit-field is signed or unsigned, when the
1370 declaration does not use either @code{signed} or @code{unsigned}.  By
1371 default, such a bit-field is signed, because this is consistent: the
1372 basic integer types such as @code{int} are signed types.
1373 @end table
1374
1375 @node C++ Dialect Options
1376 @section Options Controlling C++ Dialect
1377
1378 @cindex compiler options, C++
1379 @cindex C++ options, command line
1380 @cindex options, C++
1381 This section describes the command-line options that are only meaningful
1382 for C++ programs; but you can also use most of the GNU compiler options
1383 regardless of what language your program is in.  For example, you
1384 might compile a file @code{firstClass.C} like this:
1385
1386 @smallexample
1387 g++ -g -frepo -O -c firstClass.C
1388 @end smallexample
1389
1390 @noindent
1391 In this example, only @option{-frepo} is an option meant
1392 only for C++ programs; you can use the other options with any
1393 language supported by GCC@.
1394
1395 Here is a list of options that are @emph{only} for compiling C++ programs:
1396
1397 @table @gcctabopt
1398
1399 @item -fabi-version=@var{n}
1400 @opindex fabi-version
1401 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1402 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1403 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1404 the version that conforms most closely to the C++ ABI specification.
1405 Therefore, the ABI obtained using version 0 will change as ABI bugs
1406 are fixed.
1407
1408 The default is version 2.
1409
1410 @item -fno-access-control
1411 @opindex fno-access-control
1412 Turn off all access checking.  This switch is mainly useful for working
1413 around bugs in the access control code.
1414
1415 @item -fcheck-new
1416 @opindex fcheck-new
1417 Check that the pointer returned by @code{operator new} is non-null
1418 before attempting to modify the storage allocated.  This check is
1419 normally unnecessary because the C++ standard specifies that
1420 @code{operator new} will only return @code{0} if it is declared
1421 @samp{throw()}, in which case the compiler will always check the
1422 return value even without this option.  In all other cases, when
1423 @code{operator new} has a non-empty exception specification, memory
1424 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1425 @samp{new (nothrow)}.
1426
1427 @item -fconserve-space
1428 @opindex fconserve-space
1429 Put uninitialized or runtime-initialized global variables into the
1430 common segment, as C does.  This saves space in the executable at the
1431 cost of not diagnosing duplicate definitions.  If you compile with this
1432 flag and your program mysteriously crashes after @code{main()} has
1433 completed, you may have an object that is being destroyed twice because
1434 two definitions were merged.
1435
1436 This option is no longer useful on most targets, now that support has
1437 been added for putting variables into BSS without making them common.
1438
1439 @item -ffriend-injection
1440 @opindex ffriend-injection
1441 Inject friend functions into the enclosing namespace, so that they are
1442 visible outside the scope of the class in which they are declared.
1443 Friend functions were documented to work this way in the old Annotated
1444 C++ Reference Manual, and versions of G++ before 4.1 always worked
1445 that way.  However, in ISO C++ a friend function which is not declared
1446 in an enclosing scope can only be found using argument dependent
1447 lookup.  This option causes friends to be injected as they were in
1448 earlier releases.
1449
1450 This option is for compatibility, and may be removed in a future
1451 release of G++.
1452
1453 @item -fno-elide-constructors
1454 @opindex fno-elide-constructors
1455 The C++ standard allows an implementation to omit creating a temporary
1456 which is only used to initialize another object of the same type.
1457 Specifying this option disables that optimization, and forces G++ to
1458 call the copy constructor in all cases.
1459
1460 @item -fno-enforce-eh-specs
1461 @opindex fno-enforce-eh-specs
1462 Don't generate code to check for violation of exception specifications
1463 at runtime.  This option violates the C++ standard, but may be useful
1464 for reducing code size in production builds, much like defining
1465 @samp{NDEBUG}.  This does not give user code permission to throw
1466 exceptions in violation of the exception specifications; the compiler
1467 will still optimize based on the specifications, so throwing an
1468 unexpected exception will result in undefined behavior.
1469
1470 @item -ffor-scope
1471 @itemx -fno-for-scope
1472 @opindex ffor-scope
1473 @opindex fno-for-scope
1474 If @option{-ffor-scope} is specified, the scope of variables declared in
1475 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1476 as specified by the C++ standard.
1477 If @option{-fno-for-scope} is specified, the scope of variables declared in
1478 a @i{for-init-statement} extends to the end of the enclosing scope,
1479 as was the case in old versions of G++, and other (traditional)
1480 implementations of C++.
1481
1482 The default if neither flag is given to follow the standard,
1483 but to allow and give a warning for old-style code that would
1484 otherwise be invalid, or have different behavior.
1485
1486 @item -fno-gnu-keywords
1487 @opindex fno-gnu-keywords
1488 Do not recognize @code{typeof} as a keyword, so that code can use this
1489 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1490 @option{-ansi} implies @option{-fno-gnu-keywords}.
1491
1492 @item -fno-implicit-templates
1493 @opindex fno-implicit-templates
1494 Never emit code for non-inline templates which are instantiated
1495 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1496 @xref{Template Instantiation}, for more information.
1497
1498 @item -fno-implicit-inline-templates
1499 @opindex fno-implicit-inline-templates
1500 Don't emit code for implicit instantiations of inline templates, either.
1501 The default is to handle inlines differently so that compiles with and
1502 without optimization will need the same set of explicit instantiations.
1503
1504 @item -fno-implement-inlines
1505 @opindex fno-implement-inlines
1506 To save space, do not emit out-of-line copies of inline functions
1507 controlled by @samp{#pragma implementation}.  This will cause linker
1508 errors if these functions are not inlined everywhere they are called.
1509
1510 @item -fms-extensions
1511 @opindex fms-extensions
1512 Disable pedantic warnings about constructs used in MFC, such as implicit
1513 int and getting a pointer to member function via non-standard syntax.
1514
1515 @item -fno-nonansi-builtins
1516 @opindex fno-nonansi-builtins
1517 Disable built-in declarations of functions that are not mandated by
1518 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1519 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1520
1521 @item -fno-operator-names
1522 @opindex fno-operator-names
1523 Do not treat the operator name keywords @code{and}, @code{bitand},
1524 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1525 synonyms as keywords.
1526
1527 @item -fno-optional-diags
1528 @opindex fno-optional-diags
1529 Disable diagnostics that the standard says a compiler does not need to
1530 issue.  Currently, the only such diagnostic issued by G++ is the one for
1531 a name having multiple meanings within a class.
1532
1533 @item -fpermissive
1534 @opindex fpermissive
1535 Downgrade some diagnostics about nonconformant code from errors to
1536 warnings.  Thus, using @option{-fpermissive} will allow some
1537 nonconforming code to compile.
1538
1539 @item -frepo
1540 @opindex frepo
1541 Enable automatic template instantiation at link time.  This option also
1542 implies @option{-fno-implicit-templates}.  @xref{Template
1543 Instantiation}, for more information.
1544
1545 @item -fno-rtti
1546 @opindex fno-rtti
1547 Disable generation of information about every class with virtual
1548 functions for use by the C++ runtime type identification features
1549 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1550 of the language, you can save some space by using this flag.  Note that
1551 exception handling uses the same information, but it will generate it as
1552 needed. The @samp{dynamic_cast} operator can still be used for casts that
1553 do not require runtime type information, i.e. casts to @code{void *} or to
1554 unambiguous base classes.
1555
1556 @item -fstats
1557 @opindex fstats
1558 Emit statistics about front-end processing at the end of the compilation.
1559 This information is generally only useful to the G++ development team.
1560
1561 @item -ftemplate-depth-@var{n}
1562 @opindex ftemplate-depth
1563 Set the maximum instantiation depth for template classes to @var{n}.
1564 A limit on the template instantiation depth is needed to detect
1565 endless recursions during template class instantiation.  ANSI/ISO C++
1566 conforming programs must not rely on a maximum depth greater than 17.
1567
1568 @item -fno-threadsafe-statics
1569 @opindex fno-threadsafe-statics
1570 Do not emit the extra code to use the routines specified in the C++
1571 ABI for thread-safe initialization of local statics.  You can use this
1572 option to reduce code size slightly in code that doesn't need to be
1573 thread-safe.
1574
1575 @item -fuse-cxa-atexit
1576 @opindex fuse-cxa-atexit
1577 Register destructors for objects with static storage duration with the
1578 @code{__cxa_atexit} function rather than the @code{atexit} function.
1579 This option is required for fully standards-compliant handling of static
1580 destructors, but will only work if your C library supports
1581 @code{__cxa_atexit}.
1582
1583 @item -fno-use-cxa-get-exception-ptr
1584 @opindex fno-use-cxa-get-exception-ptr
1585 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1586 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1587 if the runtime routine is not available.
1588
1589 @item -fvisibility-inlines-hidden
1590 @opindex fvisibility-inlines-hidden
1591 This switch declares that the user does not attempt to compare
1592 pointers to inline methods where the addresses of the two functions
1593 were taken in different shared objects.
1594
1595 The effect of this is that GCC may, effectively, mark inline methods with
1596 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1597 appear in the export table of a DSO and do not require a PLT indirection
1598 when used within the DSO@.  Enabling this option can have a dramatic effect
1599 on load and link times of a DSO as it massively reduces the size of the
1600 dynamic export table when the library makes heavy use of templates.
1601
1602 The behaviour of this switch is not quite the same as marking the
1603 methods as hidden directly, because it does not affect static variables
1604 local to the function or cause the compiler to deduce that
1605 the function is defined in only one shared object.
1606
1607 You may mark a method as having a visibility explicitly to negate the
1608 effect of the switch for that method.  For example, if you do want to
1609 compare pointers to a particular inline method, you might mark it as
1610 having default visibility.  Marking the enclosing class with explicit
1611 visibility will have no effect.
1612
1613 Explicitly instantiated inline methods are unaffected by this option
1614 as their linkage might otherwise cross a shared library boundary.
1615 @xref{Template Instantiation}.
1616
1617 @item -fno-weak
1618 @opindex fno-weak
1619 Do not use weak symbol support, even if it is provided by the linker.
1620 By default, G++ will use weak symbols if they are available.  This
1621 option exists only for testing, and should not be used by end-users;
1622 it will result in inferior code and has no benefits.  This option may
1623 be removed in a future release of G++.
1624
1625 @item -nostdinc++
1626 @opindex nostdinc++
1627 Do not search for header files in the standard directories specific to
1628 C++, but do still search the other standard directories.  (This option
1629 is used when building the C++ library.)
1630 @end table
1631
1632 In addition, these optimization, warning, and code generation options
1633 have meanings only for C++ programs:
1634
1635 @table @gcctabopt
1636 @item -fno-default-inline
1637 @opindex fno-default-inline
1638 Do not assume @samp{inline} for functions defined inside a class scope.
1639 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1640 functions will have linkage like inline functions; they just won't be
1641 inlined by default.
1642
1643 @item -Wabi @r{(C++ only)}
1644 @opindex Wabi
1645 Warn when G++ generates code that is probably not compatible with the
1646 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1647 all such cases, there are probably some cases that are not warned about,
1648 even though G++ is generating incompatible code.  There may also be
1649 cases where warnings are emitted even though the code that is generated
1650 will be compatible.
1651
1652 You should rewrite your code to avoid these warnings if you are
1653 concerned about the fact that code generated by G++ may not be binary
1654 compatible with code generated by other compilers.
1655
1656 The known incompatibilities at this point include:
1657
1658 @itemize @bullet
1659
1660 @item
1661 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1662 pack data into the same byte as a base class.  For example:
1663
1664 @smallexample
1665 struct A @{ virtual void f(); int f1 : 1; @};
1666 struct B : public A @{ int f2 : 1; @};
1667 @end smallexample
1668
1669 @noindent
1670 In this case, G++ will place @code{B::f2} into the same byte
1671 as@code{A::f1}; other compilers will not.  You can avoid this problem
1672 by explicitly padding @code{A} so that its size is a multiple of the
1673 byte size on your platform; that will cause G++ and other compilers to
1674 layout @code{B} identically.
1675
1676 @item
1677 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1678 tail padding when laying out virtual bases.  For example:
1679
1680 @smallexample
1681 struct A @{ virtual void f(); char c1; @};
1682 struct B @{ B(); char c2; @};
1683 struct C : public A, public virtual B @{@};
1684 @end smallexample
1685
1686 @noindent
1687 In this case, G++ will not place @code{B} into the tail-padding for
1688 @code{A}; other compilers will.  You can avoid this problem by
1689 explicitly padding @code{A} so that its size is a multiple of its
1690 alignment (ignoring virtual base classes); that will cause G++ and other
1691 compilers to layout @code{C} identically.
1692
1693 @item
1694 Incorrect handling of bit-fields with declared widths greater than that
1695 of their underlying types, when the bit-fields appear in a union.  For
1696 example:
1697
1698 @smallexample
1699 union U @{ int i : 4096; @};
1700 @end smallexample
1701
1702 @noindent
1703 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1704 union too small by the number of bits in an @code{int}.
1705
1706 @item
1707 Empty classes can be placed at incorrect offsets.  For example:
1708
1709 @smallexample
1710 struct A @{@};
1711
1712 struct B @{
1713   A a;
1714   virtual void f ();
1715 @};
1716
1717 struct C : public B, public A @{@};
1718 @end smallexample
1719
1720 @noindent
1721 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1722 it should be placed at offset zero.  G++ mistakenly believes that the
1723 @code{A} data member of @code{B} is already at offset zero.
1724
1725 @item
1726 Names of template functions whose types involve @code{typename} or
1727 template template parameters can be mangled incorrectly.
1728
1729 @smallexample
1730 template <typename Q>
1731 void f(typename Q::X) @{@}
1732
1733 template <template <typename> class Q>
1734 void f(typename Q<int>::X) @{@}
1735 @end smallexample
1736
1737 @noindent
1738 Instantiations of these templates may be mangled incorrectly.
1739
1740 @end itemize
1741
1742 @item -Wctor-dtor-privacy @r{(C++ only)}
1743 @opindex Wctor-dtor-privacy
1744 Warn when a class seems unusable because all the constructors or
1745 destructors in that class are private, and it has neither friends nor
1746 public static member functions.
1747
1748 @item -Wnon-virtual-dtor @r{(C++ only)}
1749 @opindex Wnon-virtual-dtor
1750 Warn when a class appears to be polymorphic, thereby requiring a virtual
1751 destructor, yet it declares a non-virtual one.  This warning is also
1752 enabled if -Weffc++ is specified.
1753
1754 @item -Wreorder @r{(C++ only)}
1755 @opindex Wreorder
1756 @cindex reordering, warning
1757 @cindex warning for reordering of member initializers
1758 Warn when the order of member initializers given in the code does not
1759 match the order in which they must be executed.  For instance:
1760
1761 @smallexample
1762 struct A @{
1763   int i;
1764   int j;
1765   A(): j (0), i (1) @{ @}
1766 @};
1767 @end smallexample
1768
1769 The compiler will rearrange the member initializers for @samp{i}
1770 and @samp{j} to match the declaration order of the members, emitting
1771 a warning to that effect.  This warning is enabled by @option{-Wall}.
1772 @end table
1773
1774 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1775
1776 @table @gcctabopt
1777 @item -Weffc++ @r{(C++ only)}
1778 @opindex Weffc++
1779 Warn about violations of the following style guidelines from Scott Meyers'
1780 @cite{Effective C++} book:
1781
1782 @itemize @bullet
1783 @item
1784 Item 11:  Define a copy constructor and an assignment operator for classes
1785 with dynamically allocated memory.
1786
1787 @item
1788 Item 12:  Prefer initialization to assignment in constructors.
1789
1790 @item
1791 Item 14:  Make destructors virtual in base classes.
1792
1793 @item
1794 Item 15:  Have @code{operator=} return a reference to @code{*this}.
1795
1796 @item
1797 Item 23:  Don't try to return a reference when you must return an object.
1798
1799 @end itemize
1800
1801 Also warn about violations of the following style guidelines from
1802 Scott Meyers' @cite{More Effective C++} book:
1803
1804 @itemize @bullet
1805 @item
1806 Item 6:  Distinguish between prefix and postfix forms of increment and
1807 decrement operators.
1808
1809 @item
1810 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
1811
1812 @end itemize
1813
1814 When selecting this option, be aware that the standard library
1815 headers do not obey all of these guidelines; use @samp{grep -v}
1816 to filter out those warnings.
1817
1818 @item -Wno-deprecated @r{(C++ only)}
1819 @opindex Wno-deprecated
1820 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
1821
1822 @item -Wstrict-null-sentinel @r{(C++ only)}
1823 @opindex Wstrict-null-sentinel
1824 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
1825 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
1826 to @code{__null}.  Although it is a null pointer constant not a null pointer,
1827 it is guaranteed to of the same size as a pointer.  But this use is
1828 not portable across different compilers.
1829
1830 @item -Wno-non-template-friend @r{(C++ only)}
1831 @opindex Wno-non-template-friend
1832 Disable warnings when non-templatized friend functions are declared
1833 within a template.  Since the advent of explicit template specification
1834 support in G++, if the name of the friend is an unqualified-id (i.e.,
1835 @samp{friend foo(int)}), the C++ language specification demands that the
1836 friend declare or define an ordinary, nontemplate function.  (Section
1837 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
1838 could be interpreted as a particular specialization of a templatized
1839 function.  Because this non-conforming behavior is no longer the default
1840 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
1841 check existing code for potential trouble spots and is on by default.
1842 This new compiler behavior can be turned off with
1843 @option{-Wno-non-template-friend} which keeps the conformant compiler code
1844 but disables the helpful warning.
1845
1846 @item -Wold-style-cast @r{(C++ only)}
1847 @opindex Wold-style-cast
1848 Warn if an old-style (C-style) cast to a non-void type is used within
1849 a C++ program.  The new-style casts (@samp{dynamic_cast},
1850 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
1851 less vulnerable to unintended effects and much easier to search for.
1852
1853 @item -Woverloaded-virtual @r{(C++ only)}
1854 @opindex Woverloaded-virtual
1855 @cindex overloaded virtual fn, warning
1856 @cindex warning for overloaded virtual fn
1857 Warn when a function declaration hides virtual functions from a
1858 base class.  For example, in:
1859
1860 @smallexample
1861 struct A @{
1862   virtual void f();
1863 @};
1864
1865 struct B: public A @{
1866   void f(int);
1867 @};
1868 @end smallexample
1869
1870 the @code{A} class version of @code{f} is hidden in @code{B}, and code
1871 like:
1872
1873 @smallexample
1874 B* b;
1875 b->f();
1876 @end smallexample
1877
1878 will fail to compile.
1879
1880 @item -Wno-pmf-conversions @r{(C++ only)}
1881 @opindex Wno-pmf-conversions
1882 Disable the diagnostic for converting a bound pointer to member function
1883 to a plain pointer.
1884
1885 @item -Wsign-promo @r{(C++ only)}
1886 @opindex Wsign-promo
1887 Warn when overload resolution chooses a promotion from unsigned or
1888 enumerated type to a signed type, over a conversion to an unsigned type of
1889 the same size.  Previous versions of G++ would try to preserve
1890 unsignedness, but the standard mandates the current behavior.
1891
1892 @smallexample
1893 struct A @{
1894   operator int ();
1895   A& operator = (int);
1896 @};
1897
1898 main ()
1899 @{
1900   A a,b;
1901   a = b;
1902 @}
1903 @end smallexample
1904
1905 In this example, G++ will synthesize a default @samp{A& operator =
1906 (const A&);}, while cfront will use the user-defined @samp{operator =}.
1907 @end table
1908
1909 @node Language Independent Options
1910 @section Options to Control Diagnostic Messages Formatting
1911 @cindex options to control diagnostics formatting
1912 @cindex diagnostic messages
1913 @cindex message formatting
1914
1915 Traditionally, diagnostic messages have been formatted irrespective of
1916 the output device's aspect (e.g.@: its width, @dots{}).  The options described
1917 below can be used to control the diagnostic messages formatting
1918 algorithm, e.g.@: how many characters per line, how often source location
1919 information should be reported.  Right now, only the C++ front end can
1920 honor these options.  However it is expected, in the near future, that
1921 the remaining front ends would be able to digest them correctly.
1922
1923 @table @gcctabopt
1924 @item -fmessage-length=@var{n}
1925 @opindex fmessage-length
1926 Try to format error messages so that they fit on lines of about @var{n}
1927 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
1928 the front ends supported by GCC@.  If @var{n} is zero, then no
1929 line-wrapping will be done; each error message will appear on a single
1930 line.
1931
1932 @opindex fdiagnostics-show-location
1933 @item -fdiagnostics-show-location=once
1934 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
1935 reporter to emit @emph{once} source location information; that is, in
1936 case the message is too long to fit on a single physical line and has to
1937 be wrapped, the source location won't be emitted (as prefix) again,
1938 over and over, in subsequent continuation lines.  This is the default
1939 behavior.
1940
1941 @item -fdiagnostics-show-location=every-line
1942 Only meaningful in line-wrapping mode.  Instructs the diagnostic
1943 messages reporter to emit the same source location information (as
1944 prefix) for physical lines that result from the process of breaking
1945 a message which is too long to fit on a single line.
1946
1947 @item -fdiagnostics-show-option
1948 @opindex fdiagnostics-show-option
1949 This option instructs the diagnostic machinery to add text to each
1950 diagnostic emitted, which indicates which command line option directly
1951 controls that diagnostic, when such an option is known to the
1952 diagnostic machinery.
1953
1954 @end table
1955
1956 @node Warning Options
1957 @section Options to Request or Suppress Warnings
1958 @cindex options to control warnings
1959 @cindex warning messages
1960 @cindex messages, warning
1961 @cindex suppressing warnings
1962
1963 Warnings are diagnostic messages that report constructions which
1964 are not inherently erroneous but which are risky or suggest there
1965 may have been an error.
1966
1967 You can request many specific warnings with options beginning @samp{-W},
1968 for example @option{-Wimplicit} to request warnings on implicit
1969 declarations.  Each of these specific warning options also has a
1970 negative form beginning @samp{-Wno-} to turn off warnings;
1971 for example, @option{-Wno-implicit}.  This manual lists only one of the
1972 two forms, whichever is not the default.
1973
1974 The following options control the amount and kinds of warnings produced
1975 by GCC; for further, language-specific options also refer to
1976 @ref{C++ Dialect Options}.
1977
1978 @table @gcctabopt
1979 @cindex syntax checking
1980 @item -fsyntax-only
1981 @opindex fsyntax-only
1982 Check the code for syntax errors, but don't do anything beyond that.
1983
1984 @item -pedantic
1985 @opindex pedantic
1986 Issue all the warnings demanded by strict ISO C and ISO C++;
1987 reject all programs that use forbidden extensions, and some other
1988 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
1989 version of the ISO C standard specified by any @option{-std} option used.
1990
1991 Valid ISO C and ISO C++ programs should compile properly with or without
1992 this option (though a rare few will require @option{-ansi} or a
1993 @option{-std} option specifying the required version of ISO C)@.  However,
1994 without this option, certain GNU extensions and traditional C and C++
1995 features are supported as well.  With this option, they are rejected.
1996
1997 @option{-pedantic} does not cause warning messages for use of the
1998 alternate keywords whose names begin and end with @samp{__}.  Pedantic
1999 warnings are also disabled in the expression that follows
2000 @code{__extension__}.  However, only system header files should use
2001 these escape routes; application programs should avoid them.
2002 @xref{Alternate Keywords}.
2003
2004 Some users try to use @option{-pedantic} to check programs for strict ISO
2005 C conformance.  They soon find that it does not do quite what they want:
2006 it finds some non-ISO practices, but not all---only those for which
2007 ISO C @emph{requires} a diagnostic, and some others for which
2008 diagnostics have been added.
2009
2010 A feature to report any failure to conform to ISO C might be useful in
2011 some instances, but would require considerable additional work and would
2012 be quite different from @option{-pedantic}.  We don't have plans to
2013 support such a feature in the near future.
2014
2015 Where the standard specified with @option{-std} represents a GNU
2016 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2017 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2018 extended dialect is based.  Warnings from @option{-pedantic} are given
2019 where they are required by the base standard.  (It would not make sense
2020 for such warnings to be given only for features not in the specified GNU
2021 C dialect, since by definition the GNU dialects of C include all
2022 features the compiler supports with the given option, and there would be
2023 nothing to warn about.)
2024
2025 @item -pedantic-errors
2026 @opindex pedantic-errors
2027 Like @option{-pedantic}, except that errors are produced rather than
2028 warnings.
2029
2030 @item -w
2031 @opindex w
2032 Inhibit all warning messages.
2033
2034 @item -Wno-import
2035 @opindex Wno-import
2036 Inhibit warning messages about the use of @samp{#import}.
2037
2038 @item -Wchar-subscripts
2039 @opindex Wchar-subscripts
2040 Warn if an array subscript has type @code{char}.  This is a common cause
2041 of error, as programmers often forget that this type is signed on some
2042 machines.
2043 This warning is enabled by @option{-Wall}.
2044
2045 @item -Wcomment
2046 @opindex Wcomment
2047 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2048 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2049 This warning is enabled by @option{-Wall}.
2050
2051 @item -Wfatal-errors
2052 @opindex Wfatal-errors
2053 This option causes the compiler to abort compilation on the first error
2054 occurred rather than trying to keep going and printing further error
2055 messages.
2056
2057 @item -Wformat
2058 @opindex Wformat
2059 @opindex ffreestanding
2060 @opindex fno-builtin
2061 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2062 the arguments supplied have types appropriate to the format string
2063 specified, and that the conversions specified in the format string make
2064 sense.  This includes standard functions, and others specified by format
2065 attributes (@pxref{Function Attributes}), in the @code{printf},
2066 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2067 not in the C standard) families (or other target-specific families).
2068 Which functions are checked without format attributes having been
2069 specified depends on the standard version selected, and such checks of
2070 functions without the attribute specified are disabled by
2071 @option{-ffreestanding} or @option{-fno-builtin}.
2072
2073 The formats are checked against the format features supported by GNU
2074 libc version 2.2.  These include all ISO C90 and C99 features, as well
2075 as features from the Single Unix Specification and some BSD and GNU
2076 extensions.  Other library implementations may not support all these
2077 features; GCC does not support warning about features that go beyond a
2078 particular library's limitations.  However, if @option{-pedantic} is used
2079 with @option{-Wformat}, warnings will be given about format features not
2080 in the selected standard version (but not for @code{strfmon} formats,
2081 since those are not in any version of the C standard).  @xref{C Dialect
2082 Options,,Options Controlling C Dialect}.
2083
2084 Since @option{-Wformat} also checks for null format arguments for
2085 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2086
2087 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2088 aspects of format checking, the options @option{-Wformat-y2k},
2089 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2090 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2091 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2092
2093 @item -Wformat-y2k
2094 @opindex Wformat-y2k
2095 If @option{-Wformat} is specified, also warn about @code{strftime}
2096 formats which may yield only a two-digit year.
2097
2098 @item -Wno-format-extra-args
2099 @opindex Wno-format-extra-args
2100 If @option{-Wformat} is specified, do not warn about excess arguments to a
2101 @code{printf} or @code{scanf} format function.  The C standard specifies
2102 that such arguments are ignored.
2103
2104 Where the unused arguments lie between used arguments that are
2105 specified with @samp{$} operand number specifications, normally
2106 warnings are still given, since the implementation could not know what
2107 type to pass to @code{va_arg} to skip the unused arguments.  However,
2108 in the case of @code{scanf} formats, this option will suppress the
2109 warning if the unused arguments are all pointers, since the Single
2110 Unix Specification says that such unused arguments are allowed.
2111
2112 @item -Wno-format-zero-length
2113 @opindex Wno-format-zero-length
2114 If @option{-Wformat} is specified, do not warn about zero-length formats.
2115 The C standard specifies that zero-length formats are allowed.
2116
2117 @item -Wformat-nonliteral
2118 @opindex Wformat-nonliteral
2119 If @option{-Wformat} is specified, also warn if the format string is not a
2120 string literal and so cannot be checked, unless the format function
2121 takes its format arguments as a @code{va_list}.
2122
2123 @item -Wformat-security
2124 @opindex Wformat-security
2125 If @option{-Wformat} is specified, also warn about uses of format
2126 functions that represent possible security problems.  At present, this
2127 warns about calls to @code{printf} and @code{scanf} functions where the
2128 format string is not a string literal and there are no format arguments,
2129 as in @code{printf (foo);}.  This may be a security hole if the format
2130 string came from untrusted input and contains @samp{%n}.  (This is
2131 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2132 in future warnings may be added to @option{-Wformat-security} that are not
2133 included in @option{-Wformat-nonliteral}.)
2134
2135 @item -Wformat=2
2136 @opindex Wformat=2
2137 Enable @option{-Wformat} plus format checks not included in
2138 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2139 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2140
2141 @item -Wnonnull
2142 @opindex Wnonnull
2143 Warn about passing a null pointer for arguments marked as
2144 requiring a non-null value by the @code{nonnull} function attribute.
2145
2146 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2147 can be disabled with the @option{-Wno-nonnull} option.
2148
2149 @item -Winit-self @r{(C and C++ only)}
2150 @opindex Winit-self
2151 Warn about uninitialized variables which are initialized with themselves.
2152 Note this option can only be used with the @option{-Wuninitialized} option,
2153 which in turn only works with @option{-O1} and above.
2154
2155 For example, GCC will warn about @code{i} being uninitialized in the
2156 following snippet only when @option{-Winit-self} has been specified:
2157 @smallexample
2158 @group
2159 int f()
2160 @{
2161   int i = i;
2162   return i;
2163 @}
2164 @end group
2165 @end smallexample
2166
2167 @item -Wimplicit-int
2168 @opindex Wimplicit-int
2169 Warn when a declaration does not specify a type.
2170 This warning is enabled by @option{-Wall}.
2171
2172 @item -Wimplicit-function-declaration
2173 @itemx -Werror-implicit-function-declaration
2174 @opindex Wimplicit-function-declaration
2175 @opindex Werror-implicit-function-declaration
2176 Give a warning (or error) whenever a function is used before being
2177 declared.  The form @option{-Wno-error-implicit-function-declaration}
2178 is not supported.
2179 This warning is enabled by @option{-Wall} (as a warning, not an error).
2180
2181 @item -Wimplicit
2182 @opindex Wimplicit
2183 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2184 This warning is enabled by @option{-Wall}.
2185
2186 @item -Wmain
2187 @opindex Wmain
2188 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2189 function with external linkage, returning int, taking either zero
2190 arguments, two, or three arguments of appropriate types.
2191 This warning is enabled by @option{-Wall}.
2192
2193 @item -Wmissing-braces
2194 @opindex Wmissing-braces
2195 Warn if an aggregate or union initializer is not fully bracketed.  In
2196 the following example, the initializer for @samp{a} is not fully
2197 bracketed, but that for @samp{b} is fully bracketed.
2198
2199 @smallexample
2200 int a[2][2] = @{ 0, 1, 2, 3 @};
2201 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2202 @end smallexample
2203
2204 This warning is enabled by @option{-Wall}.
2205
2206 @item -Wmissing-include-dirs @r{(C and C++ only)}
2207 @opindex Wmissing-include-dirs
2208 Warn if a user-supplied include directory does not exist.
2209
2210 @item -Wparentheses
2211 @opindex Wparentheses
2212 Warn if parentheses are omitted in certain contexts, such
2213 as when there is an assignment in a context where a truth value
2214 is expected, or when operators are nested whose precedence people
2215 often get confused about.  Only the warning for an assignment used as
2216 a truth value is supported when compiling C++; the other warnings are
2217 only supported when compiling C@.
2218
2219 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2220 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2221 interpretation from that of ordinary mathematical notation.
2222
2223 Also warn about constructions where there may be confusion to which
2224 @code{if} statement an @code{else} branch belongs.  Here is an example of
2225 such a case:
2226
2227 @smallexample
2228 @group
2229 @{
2230   if (a)
2231     if (b)
2232       foo ();
2233   else
2234     bar ();
2235 @}
2236 @end group
2237 @end smallexample
2238
2239 In C, every @code{else} branch belongs to the innermost possible @code{if}
2240 statement, which in this example is @code{if (b)}.  This is often not
2241 what the programmer expected, as illustrated in the above example by
2242 indentation the programmer chose.  When there is the potential for this
2243 confusion, GCC will issue a warning when this flag is specified.
2244 To eliminate the warning, add explicit braces around the innermost
2245 @code{if} statement so there is no way the @code{else} could belong to
2246 the enclosing @code{if}.  The resulting code would look like this:
2247
2248 @smallexample
2249 @group
2250 @{
2251   if (a)
2252     @{
2253       if (b)
2254         foo ();
2255       else
2256         bar ();
2257     @}
2258 @}
2259 @end group
2260 @end smallexample
2261
2262 This warning is enabled by @option{-Wall}.
2263
2264 @item -Wsequence-point
2265 @opindex Wsequence-point
2266 Warn about code that may have undefined semantics because of violations
2267 of sequence point rules in the C and C++ standards.
2268
2269 The C and C++ standards defines the order in which expressions in a C/C++
2270 program are evaluated in terms of @dfn{sequence points}, which represent
2271 a partial ordering between the execution of parts of the program: those
2272 executed before the sequence point, and those executed after it.  These
2273 occur after the evaluation of a full expression (one which is not part
2274 of a larger expression), after the evaluation of the first operand of a
2275 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2276 function is called (but after the evaluation of its arguments and the
2277 expression denoting the called function), and in certain other places.
2278 Other than as expressed by the sequence point rules, the order of
2279 evaluation of subexpressions of an expression is not specified.  All
2280 these rules describe only a partial order rather than a total order,
2281 since, for example, if two functions are called within one expression
2282 with no sequence point between them, the order in which the functions
2283 are called is not specified.  However, the standards committee have
2284 ruled that function calls do not overlap.
2285
2286 It is not specified when between sequence points modifications to the
2287 values of objects take effect.  Programs whose behavior depends on this
2288 have undefined behavior; the C and C++ standards specify that ``Between
2289 the previous and next sequence point an object shall have its stored
2290 value modified at most once by the evaluation of an expression.  
2291 Furthermore, the prior value shall be read only to determine the value
2292 to be stored.''.  If a program breaks these rules, the results on any
2293 particular implementation are entirely unpredictable.
2294
2295 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2296 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2297 diagnosed by this option, and it may give an occasional false positive
2298 result, but in general it has been found fairly effective at detecting
2299 this sort of problem in programs.
2300
2301 The standard is worded confusingly, therefore there is some debate
2302 over the precise meaning of the sequence point rules in subtle cases.
2303 Links to discussions of the problem, including proposed formal
2304 definitions, may be found on the GCC readings page, at
2305 @w{@uref{http://gcc.gnu.org/readings.html}}.
2306
2307 This warning is enabled by @option{-Wall} for C and C++.
2308
2309 @item -Wreturn-type
2310 @opindex Wreturn-type
2311 Warn whenever a function is defined with a return-type that defaults to
2312 @code{int}.  Also warn about any @code{return} statement with no
2313 return-value in a function whose return-type is not @code{void}.
2314
2315 For C, also warn if the return type of a function has a type qualifier
2316 such as @code{const}.  Such a type qualifier has no effect, since the
2317 value returned by a function is not an lvalue.  ISO C prohibits
2318 qualified @code{void} return types on function definitions, so such
2319 return types always receive a warning even without this option.
2320
2321 For C++, a function without return type always produces a diagnostic
2322 message, even when @option{-Wno-return-type} is specified.  The only
2323 exceptions are @samp{main} and functions defined in system headers.
2324
2325 This warning is enabled by @option{-Wall}.
2326
2327 @item -Wswitch
2328 @opindex Wswitch
2329 Warn whenever a @code{switch} statement has an index of enumerated type
2330 and lacks a @code{case} for one or more of the named codes of that
2331 enumeration.  (The presence of a @code{default} label prevents this
2332 warning.)  @code{case} labels outside the enumeration range also
2333 provoke warnings when this option is used.
2334 This warning is enabled by @option{-Wall}.
2335
2336 @item -Wswitch-default
2337 @opindex Wswitch-switch
2338 Warn whenever a @code{switch} statement does not have a @code{default}
2339 case.
2340
2341 @item -Wswitch-enum
2342 @opindex Wswitch-enum
2343 Warn whenever a @code{switch} statement has an index of enumerated type
2344 and lacks a @code{case} for one or more of the named codes of that
2345 enumeration.  @code{case} labels outside the enumeration range also
2346 provoke warnings when this option is used.
2347
2348 @item -Wtrigraphs
2349 @opindex Wtrigraphs
2350 Warn if any trigraphs are encountered that might change the meaning of
2351 the program (trigraphs within comments are not warned about).
2352 This warning is enabled by @option{-Wall}.
2353
2354 @item -Wunused-function
2355 @opindex Wunused-function
2356 Warn whenever a static function is declared but not defined or a
2357 non-inline static function is unused.
2358 This warning is enabled by @option{-Wall}.
2359
2360 @item -Wunused-label
2361 @opindex Wunused-label
2362 Warn whenever a label is declared but not used.
2363 This warning is enabled by @option{-Wall}.
2364
2365 To suppress this warning use the @samp{unused} attribute
2366 (@pxref{Variable Attributes}).
2367
2368 @item -Wunused-parameter
2369 @opindex Wunused-parameter
2370 Warn whenever a function parameter is unused aside from its declaration.
2371
2372 To suppress this warning use the @samp{unused} attribute
2373 (@pxref{Variable Attributes}).
2374
2375 @item -Wunused-variable
2376 @opindex Wunused-variable
2377 Warn whenever a local variable or non-constant static variable is unused
2378 aside from its declaration.
2379 This warning is enabled by @option{-Wall}.
2380
2381 To suppress this warning use the @samp{unused} attribute
2382 (@pxref{Variable Attributes}).
2383
2384 @item -Wunused-value
2385 @opindex Wunused-value
2386 Warn whenever a statement computes a result that is explicitly not used.
2387 This warning is enabled by @option{-Wall}.
2388
2389 To suppress this warning cast the expression to @samp{void}.
2390
2391 @item -Wunused
2392 @opindex Wunused
2393 All the above @option{-Wunused} options combined.
2394
2395 In order to get a warning about an unused function parameter, you must
2396 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2397 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2398
2399 @item -Wuninitialized
2400 @opindex Wuninitialized
2401 Warn if an automatic variable is used without first being initialized or
2402 if a variable may be clobbered by a @code{setjmp} call.
2403
2404 These warnings are possible only in optimizing compilation,
2405 because they require data flow information that is computed only
2406 when optimizing.  If you do not specify @option{-O}, you will not get 
2407 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2408 requiring @option{-O}.
2409
2410 If you want to warn about code which uses the uninitialized value of the
2411 variable in its own initializer, use the @option{-Winit-self} option.
2412
2413 These warnings occur for individual uninitialized or clobbered
2414 elements of structure, union or array variables as well as for
2415 variables which are uninitialized or clobbered as a whole.  They do
2416 not occur for variables or elements declared @code{volatile}.  Because
2417 these warnings depend on optimization, the exact variables or elements
2418 for which there are warnings will depend on the precise optimization
2419 options and version of GCC used.
2420
2421 Note that there may be no warning about a variable that is used only
2422 to compute a value that itself is never used, because such
2423 computations may be deleted by data flow analysis before the warnings
2424 are printed.
2425
2426 These warnings are made optional because GCC is not smart
2427 enough to see all the reasons why the code might be correct
2428 despite appearing to have an error.  Here is one example of how
2429 this can happen:
2430
2431 @smallexample
2432 @group
2433 @{
2434   int x;
2435   switch (y)
2436     @{
2437     case 1: x = 1;
2438       break;
2439     case 2: x = 4;
2440       break;
2441     case 3: x = 5;
2442     @}
2443   foo (x);
2444 @}
2445 @end group
2446 @end smallexample
2447
2448 @noindent
2449 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2450 always initialized, but GCC doesn't know this.  Here is
2451 another common case:
2452
2453 @smallexample
2454 @{
2455   int save_y;
2456   if (change_y) save_y = y, y = new_y;
2457   @dots{}
2458   if (change_y) y = save_y;
2459 @}
2460 @end smallexample
2461
2462 @noindent
2463 This has no bug because @code{save_y} is used only if it is set.
2464
2465 @cindex @code{longjmp} warnings
2466 This option also warns when a non-volatile automatic variable might be
2467 changed by a call to @code{longjmp}.  These warnings as well are possible
2468 only in optimizing compilation.
2469
2470 The compiler sees only the calls to @code{setjmp}.  It cannot know
2471 where @code{longjmp} will be called; in fact, a signal handler could
2472 call it at any point in the code.  As a result, you may get a warning
2473 even when there is in fact no problem because @code{longjmp} cannot
2474 in fact be called at the place which would cause a problem.
2475
2476 Some spurious warnings can be avoided if you declare all the functions
2477 you use that never return as @code{noreturn}.  @xref{Function
2478 Attributes}.
2479
2480 This warning is enabled by @option{-Wall}.
2481
2482 @item -Wunknown-pragmas
2483 @opindex Wunknown-pragmas
2484 @cindex warning for unknown pragmas
2485 @cindex unknown pragmas, warning
2486 @cindex pragmas, warning of unknown
2487 Warn when a #pragma directive is encountered which is not understood by
2488 GCC@.  If this command line option is used, warnings will even be issued
2489 for unknown pragmas in system header files.  This is not the case if
2490 the warnings were only enabled by the @option{-Wall} command line option.
2491
2492 @item -Wno-pragmas
2493 @opindex Wno-pragmas
2494 @opindex Wpragmas
2495 Do not warn about misuses of pragmas, such as incorrect parameters,
2496 invalid syntax, or conflicts between pragmas.  See also
2497 @samp{-Wunknown-pragmas}.
2498
2499 @item -Wstrict-aliasing
2500 @opindex Wstrict-aliasing
2501 This option is only active when @option{-fstrict-aliasing} is active.
2502 It warns about code which might break the strict aliasing rules that the
2503 compiler is using for optimization.  The warning does not catch all
2504 cases, but does attempt to catch the more common pitfalls.  It is
2505 included in @option{-Wall}.
2506
2507 @item -Wstrict-aliasing=2
2508 @opindex Wstrict-aliasing=2
2509 This option is only active when @option{-fstrict-aliasing} is active.
2510 It warns about code which might break the strict aliasing rules that the
2511 compiler is using for optimization.  This warning catches more cases than
2512 @option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
2513 cases that are safe.
2514
2515 @item -Wstrict-overflow
2516 @item -Wstrict-overflow=@var{n}
2517 @opindex Wstrict-overflow
2518 This option is only active when @option{-fstrict-overflow} is active.
2519 It warns about cases where the compiler optimizes based on the
2520 assumption that signed overflow does not occur.  Note that it does not
2521 warn about all cases where the code might overflow: it only warns
2522 about cases where the compiler implements some optimization.  Thus
2523 this warning depends on the optimization level.
2524
2525 An optimization which assumes that signed overflow does not occur is
2526 perfectly safe if the values of the variables involved are such that
2527 overflow never does, in fact, occur.  Therefore this warning can
2528 easily give a false positive: a warning about code which is not
2529 actually a problem.  To help focus on important issues, several
2530 warning levels are defined.  No warnings are issued for the use of
2531 undefined signed overflow when estimating how many iterations a loop
2532 will require, in particular when determining whether a loop will be
2533 executed at all.
2534
2535 @table @option
2536 @item -Wstrict-overflow=1
2537 Warn about cases which are both questionable and easy to avoid.  For
2538 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
2539 compiler will simplify this to @code{1}.  This level of
2540 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
2541 are not, and must be explicitly requested.
2542
2543 @item -Wstrict-overflow=2
2544 Also warn about other cases where a comparison is simplified to a
2545 constant.  For example: @code{abs (x) >= 0}.  This can only be
2546 simplified when @option{-fstrict-overflow} is in effect, because
2547 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
2548 zero.  @option{-Wstrict-overflow} (with no level) is the same as
2549 @option{-Wstrict-overflow=2}.
2550
2551 @item -Wstrict-overflow=3
2552 Also warn about other cases where a comparison is simplified.  For
2553 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
2554
2555 @item -Wstrict-overflow=4
2556 Also warn about other simplifications not covered by the above cases.
2557 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
2558
2559 @item -Wstrict-overflow=5
2560 Also warn about cases where the compiler reduces the magnitude of a
2561 constant involved in a comparison.  For example: @code{x + 2 > y} will
2562 be simplified to @code{x + 1 >= y}.  This is reported only at the
2563 highest warning level because this simplification applies to many
2564 comparisons, so this warning level will give a very large number of
2565 false positives.
2566 @end table
2567
2568 @item -Wall
2569 @opindex Wall
2570 All of the above @samp{-W} options combined.  This enables all the
2571 warnings about constructions that some users consider questionable, and
2572 that are easy to avoid (or modify to prevent the warning), even in
2573 conjunction with macros.  This also enables some language-specific
2574 warnings described in @ref{C++ Dialect Options}.
2575 @end table
2576
2577 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
2578 Some of them warn about constructions that users generally do not
2579 consider questionable, but which occasionally you might wish to check
2580 for; others warn about constructions that are necessary or hard to avoid
2581 in some cases, and there is no simple way to modify the code to suppress
2582 the warning.
2583
2584 @table @gcctabopt
2585 @item -Wextra
2586 @opindex W
2587 @opindex Wextra
2588 (This option used to be called @option{-W}.  The older name is still
2589 supported, but the newer name is more descriptive.)  Print extra warning
2590 messages for these events:
2591
2592 @itemize @bullet
2593 @item
2594 A function can return either with or without a value.  (Falling
2595 off the end of the function body is considered returning without
2596 a value.)  For example, this function would evoke such a
2597 warning:
2598
2599 @smallexample
2600 @group
2601 foo (a)
2602 @{
2603   if (a > 0)
2604     return a;
2605 @}
2606 @end group
2607 @end smallexample
2608
2609 @item
2610 An expression-statement or the left-hand side of a comma expression
2611 contains no side effects.
2612 To suppress the warning, cast the unused expression to void.
2613 For example, an expression such as @samp{x[i,j]} will cause a warning,
2614 but @samp{x[(void)i,j]} will not.
2615
2616 @item
2617 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
2618
2619 @item
2620 Storage-class specifiers like @code{static} are not the first things in
2621 a declaration.  According to the C Standard, this usage is obsolescent.
2622
2623 @item
2624 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
2625 arguments.
2626
2627 @item
2628 A comparison between signed and unsigned values could produce an
2629 incorrect result when the signed value is converted to unsigned.
2630 (But don't warn if @option{-Wno-sign-compare} is also specified.)
2631
2632 @item
2633 An aggregate has an initializer which does not initialize all members.
2634 This warning can be independently controlled by
2635 @option{-Wmissing-field-initializers}.
2636
2637 @item
2638 An initialized field without side effects is overridden when using
2639 designated initializers (@pxref{Designated Inits, , Designated
2640 Initializers}).  This warning can be independently controlled by
2641 @option{-Woverride-init}.
2642
2643 @item
2644 A function parameter is declared without a type specifier in K&R-style
2645 functions:
2646
2647 @smallexample
2648 void foo(bar) @{ @}
2649 @end smallexample
2650
2651 @item
2652 An empty body occurs in an @samp{if} or @samp{else} statement.
2653
2654 @item
2655 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2656 @samp{>}, or @samp{>=}.
2657
2658 @item
2659 A variable might be changed by @samp{longjmp} or @samp{vfork}.
2660
2661 @item @r{(C++ only)}
2662 An enumerator and a non-enumerator both appear in a conditional expression.
2663
2664 @item @r{(C++ only)}
2665 A non-static reference or non-static @samp{const} member appears in a
2666 class without constructors.
2667
2668 @item @r{(C++ only)}
2669 Ambiguous virtual bases.
2670
2671 @item @r{(C++ only)}
2672 Subscripting an array which has been declared @samp{register}.
2673
2674 @item @r{(C++ only)}
2675 Taking the address of a variable which has been declared @samp{register}.
2676
2677 @item @r{(C++ only)}
2678 A base class is not initialized in a derived class' copy constructor.
2679 @end itemize
2680
2681 @item -Wno-div-by-zero
2682 @opindex Wno-div-by-zero
2683 @opindex Wdiv-by-zero
2684 Do not warn about compile-time integer division by zero.  Floating point
2685 division by zero is not warned about, as it can be a legitimate way of
2686 obtaining infinities and NaNs.
2687
2688 @item -Wsystem-headers
2689 @opindex Wsystem-headers
2690 @cindex warnings from system headers
2691 @cindex system headers, warnings from
2692 Print warning messages for constructs found in system header files.
2693 Warnings from system headers are normally suppressed, on the assumption
2694 that they usually do not indicate real problems and would only make the
2695 compiler output harder to read.  Using this command line option tells
2696 GCC to emit warnings from system headers as if they occurred in user
2697 code.  However, note that using @option{-Wall} in conjunction with this
2698 option will @emph{not} warn about unknown pragmas in system
2699 headers---for that, @option{-Wunknown-pragmas} must also be used.
2700
2701 @item -Wfloat-equal
2702 @opindex Wfloat-equal
2703 Warn if floating point values are used in equality comparisons.
2704
2705 The idea behind this is that sometimes it is convenient (for the
2706 programmer) to consider floating-point values as approximations to
2707 infinitely precise real numbers.  If you are doing this, then you need
2708 to compute (by analyzing the code, or in some other way) the maximum or
2709 likely maximum error that the computation introduces, and allow for it
2710 when performing comparisons (and when producing output, but that's a
2711 different problem).  In particular, instead of testing for equality, you
2712 would check to see whether the two values have ranges that overlap; and
2713 this is done with the relational operators, so equality comparisons are
2714 probably mistaken.
2715
2716 @item -Wtraditional @r{(C only)}
2717 @opindex Wtraditional
2718 Warn about certain constructs that behave differently in traditional and
2719 ISO C@.  Also warn about ISO C constructs that have no traditional C
2720 equivalent, and/or problematic constructs which should be avoided.
2721
2722 @itemize @bullet
2723 @item
2724 Macro parameters that appear within string literals in the macro body.
2725 In traditional C macro replacement takes place within string literals,
2726 but does not in ISO C@.
2727
2728 @item
2729 In traditional C, some preprocessor directives did not exist.
2730 Traditional preprocessors would only consider a line to be a directive
2731 if the @samp{#} appeared in column 1 on the line.  Therefore
2732 @option{-Wtraditional} warns about directives that traditional C
2733 understands but would ignore because the @samp{#} does not appear as the
2734 first character on the line.  It also suggests you hide directives like
2735 @samp{#pragma} not understood by traditional C by indenting them.  Some
2736 traditional implementations would not recognize @samp{#elif}, so it
2737 suggests avoiding it altogether.
2738
2739 @item
2740 A function-like macro that appears without arguments.
2741
2742 @item
2743 The unary plus operator.
2744
2745 @item
2746 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
2747 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
2748 constants.)  Note, these suffixes appear in macros defined in the system
2749 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
2750 Use of these macros in user code might normally lead to spurious
2751 warnings, however GCC's integrated preprocessor has enough context to
2752 avoid warning in these cases.
2753
2754 @item
2755 A function declared external in one block and then used after the end of
2756 the block.
2757
2758 @item
2759 A @code{switch} statement has an operand of type @code{long}.
2760
2761 @item
2762 A non-@code{static} function declaration follows a @code{static} one.
2763 This construct is not accepted by some traditional C compilers.
2764
2765 @item
2766 The ISO type of an integer constant has a different width or
2767 signedness from its traditional type.  This warning is only issued if
2768 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
2769 typically represent bit patterns, are not warned about.
2770
2771 @item
2772 Usage of ISO string concatenation is detected.
2773
2774 @item
2775 Initialization of automatic aggregates.
2776
2777 @item
2778 Identifier conflicts with labels.  Traditional C lacks a separate
2779 namespace for labels.
2780
2781 @item
2782 Initialization of unions.  If the initializer is zero, the warning is
2783 omitted.  This is done under the assumption that the zero initializer in
2784 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
2785 initializer warnings and relies on default initialization to zero in the
2786 traditional C case.
2787
2788 @item
2789 Conversions by prototypes between fixed/floating point values and vice
2790 versa.  The absence of these prototypes when compiling with traditional
2791 C would cause serious problems.  This is a subset of the possible
2792 conversion warnings, for the full set use @option{-Wconversion}.
2793
2794 @item
2795 Use of ISO C style function definitions.  This warning intentionally is
2796 @emph{not} issued for prototype declarations or variadic functions
2797 because these ISO C features will appear in your code when using
2798 libiberty's traditional C compatibility macros, @code{PARAMS} and
2799 @code{VPARAMS}.  This warning is also bypassed for nested functions
2800 because that feature is already a GCC extension and thus not relevant to
2801 traditional C compatibility.
2802 @end itemize
2803
2804 @item -Wdeclaration-after-statement @r{(C only)}
2805 @opindex Wdeclaration-after-statement
2806 Warn when a declaration is found after a statement in a block.  This
2807 construct, known from C++, was introduced with ISO C99 and is by default
2808 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
2809 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
2810
2811 @item -Wundef
2812 @opindex Wundef
2813 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
2814
2815 @item -Wno-endif-labels
2816 @opindex Wno-endif-labels
2817 @opindex Wendif-labels
2818 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
2819
2820 @item -Wshadow
2821 @opindex Wshadow
2822 Warn whenever a local variable shadows another local variable, parameter or
2823 global variable or whenever a built-in function is shadowed.
2824
2825 @item -Wlarger-than-@var{len}
2826 @opindex Wlarger-than
2827 Warn whenever an object of larger than @var{len} bytes is defined.
2828
2829 @item -Wunsafe-loop-optimizations
2830 @opindex Wunsafe-loop-optimizations
2831 Warn if the loop cannot be optimized because the compiler could not
2832 assume anything on the bounds of the loop indices.  With
2833 @option{-funsafe-loop-optimizations} warn if the compiler made
2834 such assumptions.
2835
2836 @item -Wpointer-arith
2837 @opindex Wpointer-arith
2838 Warn about anything that depends on the ``size of'' a function type or
2839 of @code{void}.  GNU C assigns these types a size of 1, for
2840 convenience in calculations with @code{void *} pointers and pointers
2841 to functions.
2842
2843 @item -Wbad-function-cast @r{(C only)}
2844 @opindex Wbad-function-cast
2845 Warn whenever a function call is cast to a non-matching type.
2846 For example, warn if @code{int malloc()} is cast to @code{anything *}.
2847
2848 @item -Wc++-compat
2849 Warn about ISO C constructs that are outside of the common subset of
2850 ISO C and ISO C++, e.g.@: request for implicit conversion from
2851 @code{void *} to a pointer to non-@code{void} type.
2852
2853 @item -Wcast-qual
2854 @opindex Wcast-qual
2855 Warn whenever a pointer is cast so as to remove a type qualifier from
2856 the target type.  For example, warn if a @code{const char *} is cast
2857 to an ordinary @code{char *}.
2858
2859 @item -Wcast-align
2860 @opindex Wcast-align
2861 Warn whenever a pointer is cast such that the required alignment of the
2862 target is increased.  For example, warn if a @code{char *} is cast to
2863 an @code{int *} on machines where integers can only be accessed at
2864 two- or four-byte boundaries.
2865
2866 @item -Wwrite-strings
2867 @opindex Wwrite-strings
2868 When compiling C, give string constants the type @code{const
2869 char[@var{length}]} so that
2870 copying the address of one into a non-@code{const} @code{char *}
2871 pointer will get a warning; when compiling C++, warn about the
2872 deprecated conversion from string literals to @code{char *}.  This
2873 warning, by default, is enabled for C++ programs.
2874 These warnings will help you find at
2875 compile time code that can try to write into a string constant, but
2876 only if you have been very careful about using @code{const} in
2877 declarations and prototypes.  Otherwise, it will just be a nuisance;
2878 this is why we did not make @option{-Wall} request these warnings.
2879
2880 @item -Wconversion
2881 @opindex Wconversion
2882 Warn if a prototype causes a type conversion that is different from what
2883 would happen to the same argument in the absence of a prototype.  This
2884 includes conversions of fixed point to floating and vice versa, and
2885 conversions changing the width or signedness of a fixed point argument
2886 except when the same as the default promotion.
2887
2888 Also, warn if a negative integer constant expression is implicitly
2889 converted to an unsigned type.  For example, warn about the assignment
2890 @code{x = -1} if @code{x} is unsigned.  But do not warn about explicit
2891 casts like @code{(unsigned) -1}.
2892
2893 @item -Wsign-compare
2894 @opindex Wsign-compare
2895 @cindex warning for comparison of signed and unsigned values
2896 @cindex comparison of signed and unsigned values, warning
2897 @cindex signed and unsigned values, comparison warning
2898 Warn when a comparison between signed and unsigned values could produce
2899 an incorrect result when the signed value is converted to unsigned.
2900 This warning is also enabled by @option{-Wextra}; to get the other warnings
2901 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
2902
2903 @item -Waddress
2904 @opindex Waddress
2905 @opindex Wno-address
2906 Warn about suspicious uses of memory addresses. These include using
2907 the address of a function in a conditional expression, such as
2908 @code{void func(void); if (func)}, and comparisons against the memory
2909 address of a string literal, such as @code{if (x == "abc")}.  Such
2910 uses typically indicate a programmer error: the address of a function
2911 always evaluates to true, so their use in a conditional usually
2912 indicate that the programmer forgot the parentheses in a function
2913 call; and comparisons against string literals result in unspecified
2914 behavior and are not portable in C, so they usually indicate that the
2915 programmer intended to use @code{strcmp}.  This warning is enabled by
2916 @option{-Wall}.
2917
2918 @item -Waggregate-return
2919 @opindex Waggregate-return
2920 Warn if any functions that return structures or unions are defined or
2921 called.  (In languages where you can return an array, this also elicits
2922 a warning.)
2923
2924 @item -Wno-attributes
2925 @opindex Wno-attributes
2926 @opindex Wattributes
2927 Do not warn if an unexpected @code{__attribute__} is used, such as
2928 unrecognized attributes, function attributes applied to variables,
2929 etc.  This will not stop errors for incorrect use of supported
2930 attributes.
2931
2932 @item -Wstrict-prototypes @r{(C only)}
2933 @opindex Wstrict-prototypes
2934 Warn if a function is declared or defined without specifying the
2935 argument types.  (An old-style function definition is permitted without
2936 a warning if preceded by a declaration which specifies the argument
2937 types.)
2938
2939 @item -Wold-style-definition @r{(C only)}
2940 @opindex Wold-style-definition
2941 Warn if an old-style function definition is used.  A warning is given
2942 even if there is a previous prototype.
2943
2944 @item -Wmissing-prototypes @r{(C only)}
2945 @opindex Wmissing-prototypes
2946 Warn if a global function is defined without a previous prototype
2947 declaration.  This warning is issued even if the definition itself
2948 provides a prototype.  The aim is to detect global functions that fail
2949 to be declared in header files.
2950
2951 @item -Wmissing-declarations @r{(C only)}
2952 @opindex Wmissing-declarations
2953 Warn if a global function is defined without a previous declaration.
2954 Do so even if the definition itself provides a prototype.
2955 Use this option to detect global functions that are not declared in
2956 header files.
2957
2958 @item -Wmissing-field-initializers
2959 @opindex Wmissing-field-initializers
2960 @opindex W
2961 @opindex Wextra
2962 Warn if a structure's initializer has some fields missing.  For
2963 example, the following code would cause such a warning, because
2964 @code{x.h} is implicitly zero:
2965
2966 @smallexample
2967 struct s @{ int f, g, h; @};
2968 struct s x = @{ 3, 4 @};
2969 @end smallexample
2970
2971 This option does not warn about designated initializers, so the following
2972 modification would not trigger a warning:
2973
2974 @smallexample
2975 struct s @{ int f, g, h; @};
2976 struct s x = @{ .f = 3, .g = 4 @};
2977 @end smallexample
2978
2979 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
2980 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
2981
2982 @item -Wmissing-noreturn
2983 @opindex Wmissing-noreturn
2984 Warn about functions which might be candidates for attribute @code{noreturn}.
2985 Note these are only possible candidates, not absolute ones.  Care should
2986 be taken to manually verify functions actually do not ever return before
2987 adding the @code{noreturn} attribute, otherwise subtle code generation
2988 bugs could be introduced.  You will not get a warning for @code{main} in
2989 hosted C environments.
2990
2991 @item -Wmissing-format-attribute
2992 @opindex Wmissing-format-attribute
2993 @opindex Wformat
2994 Warn about function pointers which might be candidates for @code{format}
2995 attributes.  Note these are only possible candidates, not absolute ones.
2996 GCC will guess that function pointers with @code{format} attributes that
2997 are used in assignment, initialization, parameter passing or return
2998 statements should have a corresponding @code{format} attribute in the
2999 resulting type.  I.e.@: the left-hand side of the assignment or
3000 initialization, the type of the parameter variable, or the return type
3001 of the containing function respectively should also have a @code{format}
3002 attribute to avoid the warning.
3003
3004 GCC will also warn about function definitions which might be
3005 candidates for @code{format} attributes.  Again, these are only
3006 possible candidates.  GCC will guess that @code{format} attributes
3007 might be appropriate for any function that calls a function like
3008 @code{vprintf} or @code{vscanf}, but this might not always be the
3009 case, and some functions for which @code{format} attributes are
3010 appropriate may not be detected.
3011
3012 @item -Wno-multichar
3013 @opindex Wno-multichar
3014 @opindex Wmultichar
3015 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3016 Usually they indicate a typo in the user's code, as they have
3017 implementation-defined values, and should not be used in portable code.
3018
3019 @item -Wnormalized=<none|id|nfc|nfkc>
3020 @opindex Wnormalized
3021 @cindex NFC
3022 @cindex NFKC
3023 @cindex character set, input normalization
3024 In ISO C and ISO C++, two identifiers are different if they are
3025 different sequences of characters.  However, sometimes when characters
3026 outside the basic ASCII character set are used, you can have two
3027 different character sequences that look the same.  To avoid confusion,
3028 the ISO 10646 standard sets out some @dfn{normalization rules} which
3029 when applied ensure that two sequences that look the same are turned into
3030 the same sequence.  GCC can warn you if you are using identifiers which
3031 have not been normalized; this option controls that warning.
3032
3033 There are four levels of warning that GCC supports.  The default is
3034 @option{-Wnormalized=nfc}, which warns about any identifier which is
3035 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3036 recommended form for most uses.
3037
3038 Unfortunately, there are some characters which ISO C and ISO C++ allow
3039 in identifiers that when turned into NFC aren't allowable as
3040 identifiers.  That is, there's no way to use these symbols in portable
3041 ISO C or C++ and have all your identifiers in NFC.
3042 @option{-Wnormalized=id} suppresses the warning for these characters.
3043 It is hoped that future versions of the standards involved will correct
3044 this, which is why this option is not the default.
3045
3046 You can switch the warning off for all characters by writing
3047 @option{-Wnormalized=none}.  You would only want to do this if you
3048 were using some other normalization scheme (like ``D''), because
3049 otherwise you can easily create bugs that are literally impossible to see.
3050
3051 Some characters in ISO 10646 have distinct meanings but look identical
3052 in some fonts or display methodologies, especially once formatting has
3053 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3054 LETTER N'', will display just like a regular @code{n} which has been
3055 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3056 normalization scheme to convert all these into a standard form as
3057 well, and GCC will warn if your code is not in NFKC if you use
3058 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3059 about every identifier that contains the letter O because it might be
3060 confused with the digit 0, and so is not the default, but may be
3061 useful as a local coding convention if the programming environment is
3062 unable to be fixed to display these characters distinctly.
3063
3064 @item -Wno-deprecated-declarations
3065 @opindex Wno-deprecated-declarations
3066 Do not warn about uses of functions (@pxref{Function Attributes}),
3067 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3068 Attributes}) marked as deprecated by using the @code{deprecated}
3069 attribute.
3070
3071 @item -Wno-overflow
3072 @opindex Wno-overflow
3073 Do not warn about compile-time overflow in constant expressions.
3074
3075 @item -Woverride-init
3076 @opindex Woverride-init
3077 @opindex W
3078 @opindex Wextra
3079 Warn if an initialized field without side effects is overridden when
3080 using designated initializers (@pxref{Designated Inits, , Designated
3081 Initializers}).
3082
3083 This warning is included in @option{-Wextra}.  To get other
3084 @option{-Wextra} warnings without this one, use @samp{-Wextra
3085 -Wno-override-init}.
3086
3087 @item -Wpacked
3088 @opindex Wpacked
3089 Warn if a structure is given the packed attribute, but the packed
3090 attribute has no effect on the layout or size of the structure.
3091 Such structures may be mis-aligned for little benefit.  For
3092 instance, in this code, the variable @code{f.x} in @code{struct bar}
3093 will be misaligned even though @code{struct bar} does not itself
3094 have the packed attribute:
3095
3096 @smallexample
3097 @group
3098 struct foo @{
3099   int x;
3100   char a, b, c, d;
3101 @} __attribute__((packed));
3102 struct bar @{
3103   char z;
3104   struct foo f;
3105 @};
3106 @end group
3107 @end smallexample
3108
3109 @item -Wpadded
3110 @opindex Wpadded
3111 Warn if padding is included in a structure, either to align an element
3112 of the structure or to align the whole structure.  Sometimes when this
3113 happens it is possible to rearrange the fields of the structure to
3114 reduce the padding and so make the structure smaller.
3115
3116 @item -Wredundant-decls
3117 @opindex Wredundant-decls
3118 Warn if anything is declared more than once in the same scope, even in
3119 cases where multiple declaration is valid and changes nothing.
3120
3121 @item -Wnested-externs @r{(C only)}
3122 @opindex Wnested-externs
3123 Warn if an @code{extern} declaration is encountered within a function.
3124
3125 @item -Wunreachable-code
3126 @opindex Wunreachable-code
3127 Warn if the compiler detects that code will never be executed.
3128
3129 This option is intended to warn when the compiler detects that at
3130 least a whole line of source code will never be executed, because
3131 some condition is never satisfied or because it is after a
3132 procedure that never returns.
3133
3134 It is possible for this option to produce a warning even though there
3135 are circumstances under which part of the affected line can be executed,
3136 so care should be taken when removing apparently-unreachable code.
3137
3138 For instance, when a function is inlined, a warning may mean that the
3139 line is unreachable in only one inlined copy of the function.
3140
3141 This option is not made part of @option{-Wall} because in a debugging
3142 version of a program there is often substantial code which checks
3143 correct functioning of the program and is, hopefully, unreachable
3144 because the program does work.  Another common use of unreachable
3145 code is to provide behavior which is selectable at compile-time.
3146
3147 @item -Winline
3148 @opindex Winline
3149 Warn if a function can not be inlined and it was declared as inline.
3150 Even with this option, the compiler will not warn about failures to
3151 inline functions declared in system headers.
3152
3153 The compiler uses a variety of heuristics to determine whether or not
3154 to inline a function.  For example, the compiler takes into account
3155 the size of the function being inlined and the amount of inlining
3156 that has already been done in the current function.  Therefore,
3157 seemingly insignificant changes in the source program can cause the
3158 warnings produced by @option{-Winline} to appear or disappear.
3159
3160 @item -Wno-invalid-offsetof @r{(C++ only)}
3161 @opindex Wno-invalid-offsetof
3162 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3163 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3164 to a non-POD type is undefined.  In existing C++ implementations,
3165 however, @samp{offsetof} typically gives meaningful results even when
3166 applied to certain kinds of non-POD types. (Such as a simple
3167 @samp{struct} that fails to be a POD type only by virtue of having a
3168 constructor.)  This flag is for users who are aware that they are
3169 writing nonportable code and who have deliberately chosen to ignore the
3170 warning about it.
3171
3172 The restrictions on @samp{offsetof} may be relaxed in a future version
3173 of the C++ standard.
3174
3175 @item -Wno-int-to-pointer-cast @r{(C only)}
3176 @opindex Wno-int-to-pointer-cast
3177 Suppress warnings from casts to pointer type of an integer of a
3178 different size.
3179
3180 @item -Wno-pointer-to-int-cast @r{(C only)}
3181 @opindex Wno-pointer-to-int-cast
3182 Suppress warnings from casts from a pointer to an integer type of a
3183 different size.
3184
3185 @item -Winvalid-pch
3186 @opindex Winvalid-pch
3187 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3188 the search path but can't be used.
3189
3190 @item -Wlong-long
3191 @opindex Wlong-long
3192 @opindex Wno-long-long
3193 Warn if @samp{long long} type is used.  This is default.  To inhibit
3194 the warning messages, use @option{-Wno-long-long}.  Flags
3195 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3196 only when @option{-pedantic} flag is used.
3197
3198 @item -Wvariadic-macros
3199 @opindex Wvariadic-macros
3200 @opindex Wno-variadic-macros
3201 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3202 alternate syntax when in pedantic ISO C99 mode.  This is default.
3203 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3204
3205 @item -Wvolatile-register-var
3206 @opindex Wvolatile-register-var
3207 @opindex Wno-volatile-register-var
3208 Warn if a register variable is declared volatile.  The volatile
3209 modifier does not inhibit all optimizations that may eliminate reads
3210 and/or writes to register variables.
3211
3212 @item -Wdisabled-optimization
3213 @opindex Wdisabled-optimization
3214 Warn if a requested optimization pass is disabled.  This warning does
3215 not generally indicate that there is anything wrong with your code; it
3216 merely indicates that GCC's optimizers were unable to handle the code
3217 effectively.  Often, the problem is that your code is too big or too
3218 complex; GCC will refuse to optimize programs when the optimization
3219 itself is likely to take inordinate amounts of time.
3220
3221 @item -Wpointer-sign
3222 @opindex Wpointer-sign
3223 @opindex Wno-pointer-sign
3224 Warn for pointer argument passing or assignment with different signedness.
3225 This option is only supported for C.  It is implied by @option{-Wall}
3226 and by @option{-pedantic}, which can be disabled with
3227 @option{-Wno-pointer-sign}.
3228
3229 @item -Werror
3230 @opindex Werror
3231 Make all warnings into errors.
3232
3233 @item -Werror=
3234 @opindex Werror=
3235 Make the specified warning into an errors.  The specifier for a
3236 warning is appended, for example @option{-Werror=switch} turns the
3237 warnings controlled by @option{-Wswitch} into errors.  This switch
3238 takes a negative form, to be used to negate @option{-Werror} for
3239 specific warnings, for example @option{-Wno-error=switch} makes
3240 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3241 is in effect.  You can use the @option{-fdiagnostics-show-option}
3242 option to have each controllable warning amended with the option which
3243 controls it, to determine what to use with this option.
3244
3245 Note that specifying @option{-Werror=}@var{foo} automatically implies
3246 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3247 imply anything.
3248
3249 @item -Wstack-protector
3250 @opindex Wstack-protector
3251 This option is only active when @option{-fstack-protector} is active.  It
3252 warns about functions that will not be protected against stack smashing.
3253
3254 @item -Woverlength-strings
3255 @opindex Woverlength-strings
3256 Warn about string constants which are longer than the ``minimum
3257 maximum'' length specified in the C standard.  Modern compilers
3258 generally allow string constants which are much longer than the
3259 standard's minimum limit, but very portable programs should avoid
3260 using longer strings.
3261
3262 The limit applies @emph{after} string constant concatenation, and does
3263 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3264 C99, it was raised to 4095.  C++98 does not specify a normative
3265 minimum maximum, so we do not diagnose overlength strings in C++@.
3266
3267 This option is implied by @option{-pedantic}, and can be disabled with
3268 @option{-Wno-overlength-strings}.
3269 @end table
3270
3271 @node Debugging Options
3272 @section Options for Debugging Your Program or GCC
3273 @cindex options, debugging
3274 @cindex debugging information options
3275
3276 GCC has various special options that are used for debugging
3277 either your program or GCC:
3278
3279 @table @gcctabopt
3280 @item -g
3281 @opindex g
3282 Produce debugging information in the operating system's native format
3283 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3284 information.
3285
3286 On most systems that use stabs format, @option{-g} enables use of extra
3287 debugging information that only GDB can use; this extra information
3288 makes debugging work better in GDB but will probably make other debuggers
3289 crash or
3290 refuse to read the program.  If you want to control for certain whether
3291 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3292 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3293
3294 GCC allows you to use @option{-g} with
3295 @option{-O}.  The shortcuts taken by optimized code may occasionally
3296 produce surprising results: some variables you declared may not exist
3297 at all; flow of control may briefly move where you did not expect it;
3298 some statements may not be executed because they compute constant
3299 results or their values were already at hand; some statements may
3300 execute in different places because they were moved out of loops.
3301
3302 Nevertheless it proves possible to debug optimized output.  This makes
3303 it reasonable to use the optimizer for programs that might have bugs.
3304
3305 The following options are useful when GCC is generated with the
3306 capability for more than one debugging format.
3307
3308 @item -ggdb
3309 @opindex ggdb
3310 Produce debugging information for use by GDB@.  This means to use the
3311 most expressive format available (DWARF 2, stabs, or the native format
3312 if neither of those are supported), including GDB extensions if at all
3313 possible.
3314
3315 @item -gstabs
3316 @opindex gstabs
3317 Produce debugging information in stabs format (if that is supported),
3318 without GDB extensions.  This is the format used by DBX on most BSD
3319 systems.  On MIPS, Alpha and System V Release 4 systems this option
3320 produces stabs debugging output which is not understood by DBX or SDB@.
3321 On System V Release 4 systems this option requires the GNU assembler.
3322
3323 @item -feliminate-unused-debug-symbols
3324 @opindex feliminate-unused-debug-symbols
3325 Produce debugging information in stabs format (if that is supported),
3326 for only symbols that are actually used.
3327
3328 @item -femit-class-debug-always
3329 Instead of emitting debugging information for a C++ class in only one
3330 object file, emit it in all object files using the class.  This option
3331 should be used only with debuggers that are unable to handle the way GCC
3332 normally emits debugging information for classes because using this
3333 option will increase the size of debugging information by as much as a
3334 factor of two.
3335
3336 @item -gstabs+
3337 @opindex gstabs+
3338 Produce debugging information in stabs format (if that is supported),
3339 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3340 use of these extensions is likely to make other debuggers crash or
3341 refuse to read the program.
3342
3343 @item -gcoff
3344 @opindex gcoff
3345 Produce debugging information in COFF format (if that is supported).
3346 This is the format used by SDB on most System V systems prior to
3347 System V Release 4.
3348
3349 @item -gxcoff
3350 @opindex gxcoff
3351 Produce debugging information in XCOFF format (if that is supported).
3352 This is the format used by the DBX debugger on IBM RS/6000 systems.
3353
3354 @item -gxcoff+
3355 @opindex gxcoff+
3356 Produce debugging information in XCOFF format (if that is supported),
3357 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3358 use of these extensions is likely to make other debuggers crash or
3359 refuse to read the program, and may cause assemblers other than the GNU
3360 assembler (GAS) to fail with an error.
3361
3362 @item -gdwarf-2
3363 @opindex gdwarf-2
3364 Produce debugging information in DWARF version 2 format (if that is
3365 supported).  This is the format used by DBX on IRIX 6.  With this
3366 option, GCC uses features of DWARF version 3 when they are useful;
3367 version 3 is upward compatible with version 2, but may still cause
3368 problems for older debuggers.
3369
3370 @item -gvms
3371 @opindex gvms
3372 Produce debugging information in VMS debug format (if that is
3373 supported).  This is the format used by DEBUG on VMS systems.
3374
3375 @item -g@var{level}
3376 @itemx -ggdb@var{level}
3377 @itemx -gstabs@var{level}
3378 @itemx -gcoff@var{level}
3379 @itemx -gxcoff@var{level}
3380 @itemx -gvms@var{level}
3381 Request debugging information and also use @var{level} to specify how
3382 much information.  The default level is 2.
3383
3384 Level 1 produces minimal information, enough for making backtraces in
3385 parts of the program that you don't plan to debug.  This includes
3386 descriptions of functions and external variables, but no information
3387 about local variables and no line numbers.
3388
3389 Level 3 includes extra information, such as all the macro definitions
3390 present in the program.  Some debuggers support macro expansion when
3391 you use @option{-g3}.
3392
3393 @option{-gdwarf-2} does not accept a concatenated debug level, because
3394 GCC used to support an option @option{-gdwarf} that meant to generate
3395 debug information in version 1 of the DWARF format (which is very
3396 different from version 2), and it would have been too confusing.  That
3397 debug format is long obsolete, but the option cannot be changed now.
3398 Instead use an additional @option{-g@var{level}} option to change the
3399 debug level for DWARF2.
3400
3401 @item -feliminate-dwarf2-dups
3402 @opindex feliminate-dwarf2-dups
3403 Compress DWARF2 debugging information by eliminating duplicated
3404 information about each symbol.  This option only makes sense when
3405 generating DWARF2 debugging information with @option{-gdwarf-2}.
3406
3407 @cindex @command{prof}
3408 @item -p
3409 @opindex p
3410 Generate extra code to write profile information suitable for the
3411 analysis program @command{prof}.  You must use this option when compiling
3412 the source files you want data about, and you must also use it when
3413 linking.
3414
3415 @cindex @command{gprof}
3416 @item -pg
3417 @opindex pg
3418 Generate extra code to write profile information suitable for the
3419 analysis program @command{gprof}.  You must use this option when compiling
3420 the source files you want data about, and you must also use it when
3421 linking.
3422
3423 @item -Q
3424 @opindex Q
3425 Makes the compiler print out each function name as it is compiled, and
3426 print some statistics about each pass when it finishes.
3427
3428 @item -ftime-report
3429 @opindex ftime-report
3430 Makes the compiler print some statistics about the time consumed by each
3431 pass when it finishes.
3432
3433 @item -fmem-report
3434 @opindex fmem-report
3435 Makes the compiler print some statistics about permanent memory
3436 allocation when it finishes.
3437
3438 @item -fprofile-arcs
3439 @opindex fprofile-arcs
3440 Add code so that program flow @dfn{arcs} are instrumented.  During
3441 execution the program records how many times each branch and call is
3442 executed and how many times it is taken or returns.  When the compiled
3443 program exits it saves this data to a file called
3444 @file{@var{auxname}.gcda} for each source file.  The data may be used for
3445 profile-directed optimizations (@option{-fbranch-probabilities}), or for
3446 test coverage analysis (@option{-ftest-coverage}).  Each object file's
3447 @var{auxname} is generated from the name of the output file, if
3448 explicitly specified and it is not the final executable, otherwise it is
3449 the basename of the source file.  In both cases any suffix is removed
3450 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
3451 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
3452 @xref{Cross-profiling}.
3453
3454 @cindex @command{gcov}
3455 @item --coverage
3456 @opindex coverage
3457
3458 This option is used to compile and link code instrumented for coverage
3459 analysis.  The option is a synonym for @option{-fprofile-arcs}
3460 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
3461 linking).  See the documentation for those options for more details.
3462
3463 @itemize
3464
3465 @item
3466 Compile the source files with @option{-fprofile-arcs} plus optimization
3467 and code generation options.  For test coverage analysis, use the
3468 additional @option{-ftest-coverage} option.  You do not need to profile
3469 every source file in a program.
3470
3471 @item
3472 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
3473 (the latter implies the former).
3474
3475 @item
3476 Run the program on a representative workload to generate the arc profile
3477 information.  This may be repeated any number of times.  You can run
3478 concurrent instances of your program, and provided that the file system
3479 supports locking, the data files will be correctly updated.  Also
3480 @code{fork} calls are detected and correctly handled (double counting
3481 will not happen).
3482
3483 @item
3484 For profile-directed optimizations, compile the source files again with
3485 the same optimization and code generation options plus
3486 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
3487 Control Optimization}).
3488
3489 @item
3490 For test coverage analysis, use @command{gcov} to produce human readable
3491 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
3492 @command{gcov} documentation for further information.
3493
3494 @end itemize
3495
3496 With @option{-fprofile-arcs}, for each function of your program GCC
3497 creates a program flow graph, then finds a spanning tree for the graph.
3498 Only arcs that are not on the spanning tree have to be instrumented: the
3499 compiler adds code to count the number of times that these arcs are
3500 executed.  When an arc is the only exit or only entrance to a block, the
3501 instrumentation code can be added to the block; otherwise, a new basic
3502 block must be created to hold the instrumentation code.
3503
3504 @need 2000
3505 @item -ftest-coverage
3506 @opindex ftest-coverage
3507 Produce a notes file that the @command{gcov} code-coverage utility
3508 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
3509 show program coverage.  Each source file's note file is called
3510 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
3511 above for a description of @var{auxname} and instructions on how to
3512 generate test coverage data.  Coverage data will match the source files
3513 more closely, if you do not optimize.
3514
3515 @item -d@var{letters}
3516 @item -fdump-rtl-@var{pass}
3517 @opindex d
3518 Says to make debugging dumps during compilation at times specified by
3519 @var{letters}.    This is used for debugging the RTL-based passes of the
3520 compiler.  The file names for most of the dumps are made by appending a
3521 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
3522 from the name of the output file, if explicitly specified and it is not
3523 an executable, otherwise it is the basename of the source file.
3524
3525 Most debug dumps can be enabled either passing a letter to the @option{-d}
3526 option, or with a long @option{-fdump-rtl} switch; here are the possible
3527 letters for use in @var{letters} and @var{pass}, and their meanings:
3528
3529 @table @gcctabopt
3530 @item -dA
3531 @opindex dA
3532 Annotate the assembler output with miscellaneous debugging information.
3533
3534 @item -dB
3535 @itemx -fdump-rtl-bbro
3536 @opindex dB
3537 @opindex fdump-rtl-bbro
3538 Dump after block reordering, to @file{@var{file}.148r.bbro}.
3539
3540 @item -dc
3541 @itemx -fdump-rtl-combine
3542 @opindex dc
3543 @opindex fdump-rtl-combine
3544 Dump after instruction combination, to the file @file{@var{file}.129r.combine}.
3545
3546 @item -dC
3547 @itemx -fdump-rtl-ce1
3548 @itemx -fdump-rtl-ce2
3549 @opindex dC
3550 @opindex fdump-rtl-ce1
3551 @opindex fdump-rtl-ce2
3552 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
3553 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
3554 and @option{-fdump-rtl-ce2} enable dumping after the second if
3555 conversion, to the file @file{@var{file}.130r.ce2}.
3556
3557 @item -dd
3558 @itemx -fdump-rtl-btl
3559 @itemx -fdump-rtl-dbr
3560 @opindex dd
3561 @opindex fdump-rtl-btl
3562 @opindex fdump-rtl-dbr
3563 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
3564 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
3565 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
3566 scheduling, to @file{@var{file}.36.dbr}.
3567
3568 @item -dD
3569 @opindex dD
3570 Dump all macro definitions, at the end of preprocessing, in addition to
3571 normal output.
3572
3573 @item -dE
3574 @itemx -fdump-rtl-ce3
3575 @opindex dE
3576 @opindex fdump-rtl-ce3
3577 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
3578
3579 @item -df
3580 @itemx -fdump-rtl-cfg
3581 @itemx -fdump-rtl-life
3582 @opindex df
3583 @opindex fdump-rtl-cfg
3584 @opindex fdump-rtl-life
3585 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
3586 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
3587 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
3588 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
3589
3590 @item -dg
3591 @itemx -fdump-rtl-greg
3592 @opindex dg
3593 @opindex fdump-rtl-greg
3594 Dump after global register allocation, to @file{@var{file}.139r.greg}.
3595
3596 @item -dG
3597 @itemx -fdump-rtl-gcse
3598 @itemx -fdump-rtl-bypass
3599 @opindex dG
3600 @opindex fdump-rtl-gcse
3601 @opindex fdump-rtl-bypass
3602 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
3603 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
3604 enable dumping after jump bypassing and control flow optimizations, to
3605 @file{@var{file}.115r.bypass}.
3606
3607 @item -dh
3608 @itemx -fdump-rtl-eh
3609 @opindex dh
3610 @opindex fdump-rtl-eh
3611 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
3612
3613 @item -di
3614 @itemx -fdump-rtl-sibling
3615 @opindex di
3616 @opindex fdump-rtl-sibling
3617 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
3618
3619 @item -dj
3620 @itemx -fdump-rtl-jump
3621 @opindex dj
3622 @opindex fdump-rtl-jump
3623 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
3624
3625 @item -dk
3626 @itemx -fdump-rtl-stack
3627 @opindex dk
3628 @opindex fdump-rtl-stack
3629 Dump after conversion from registers to stack, to @file{@var{file}.152r.stack}.
3630
3631 @item -dl
3632 @itemx -fdump-rtl-lreg
3633 @opindex dl
3634 @opindex fdump-rtl-lreg
3635 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
3636
3637 @item -dL
3638 @itemx -fdump-rtl-loop2
3639 @opindex dL
3640 @opindex fdump-rtl-loop2
3641 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
3642 loop optimization pass, to @file{@var{file}.119r.loop2},
3643 @file{@var{file}.120r.loop2_init},
3644 @file{@var{file}.121r.loop2_invariant}, and
3645 @file{@var{file}.125r.loop2_done}.
3646
3647 @item -dm
3648 @itemx -fdump-rtl-sms
3649 @opindex dm
3650 @opindex fdump-rtl-sms
3651 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
3652
3653 @item -dM
3654 @itemx -fdump-rtl-mach
3655 @opindex dM
3656 @opindex fdump-rtl-mach
3657 Dump after performing the machine dependent reorganization pass, to
3658 @file{@var{file}.155r.mach}.
3659
3660 @item -dn
3661 @itemx -fdump-rtl-rnreg
3662 @opindex dn
3663 @opindex fdump-rtl-rnreg
3664 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
3665
3666 @item -dN
3667 @itemx -fdump-rtl-regmove
3668 @opindex dN
3669 @opindex fdump-rtl-regmove
3670 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
3671
3672 @item -do
3673 @itemx -fdump-rtl-postreload
3674 @opindex do
3675 @opindex fdump-rtl-postreload
3676 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
3677
3678 @item -dr
3679 @itemx -fdump-rtl-expand
3680 @opindex dr
3681 @opindex fdump-rtl-expand
3682 Dump after RTL generation, to @file{@var{file}.104r.expand}.
3683
3684 @item -dR
3685 @itemx -fdump-rtl-sched2
3686 @opindex dR
3687 @opindex fdump-rtl-sched2
3688 Dump after the second scheduling pass, to @file{@var{file}.150r.sched2}.
3689
3690 @item -ds
3691 @itemx -fdump-rtl-cse
3692 @opindex ds
3693 @opindex fdump-rtl-cse
3694 Dump after CSE (including the jump optimization that sometimes follows
3695 CSE), to @file{@var{file}.113r.cse}.
3696
3697 @item -dS
3698 @itemx -fdump-rtl-sched
3699 @opindex dS
3700 @opindex fdump-rtl-sched
3701 Dump after the first scheduling pass, to @file{@var{file}.21.sched}.
3702
3703 @item -dt
3704 @itemx -fdump-rtl-cse2
3705 @opindex dt
3706 @opindex fdump-rtl-cse2
3707 Dump after the second CSE pass (including the jump optimization that
3708 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
3709
3710 @item -dT
3711 @itemx -fdump-rtl-tracer
3712 @opindex dT
3713 @opindex fdump-rtl-tracer
3714 Dump after running tracer, to @file{@var{file}.118r.tracer}.
3715
3716 @item -dV
3717 @itemx -fdump-rtl-vpt
3718 @itemx -fdump-rtl-vartrack
3719 @opindex dV
3720 @opindex fdump-rtl-vpt
3721 @opindex fdump-rtl-vartrack
3722 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
3723 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
3724 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
3725 to @file{@var{file}.154r.vartrack}.
3726
3727 @item -dw
3728 @itemx -fdump-rtl-flow2
3729 @opindex dw
3730 @opindex fdump-rtl-flow2
3731 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
3732
3733 @item -dz
3734 @itemx -fdump-rtl-peephole2
3735 @opindex dz
3736 @opindex fdump-rtl-peephole2
3737 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
3738
3739 @item -dZ
3740 @itemx -fdump-rtl-web
3741 @opindex dZ
3742 @opindex fdump-rtl-web
3743 Dump after live range splitting, to @file{@var{file}.126r.web}.
3744
3745 @item -da
3746 @itemx -fdump-rtl-all
3747 @opindex da
3748 @opindex fdump-rtl-all
3749 Produce all the dumps listed above.
3750
3751 @item -dH
3752 @opindex dH
3753 Produce a core dump whenever an error occurs.
3754
3755 @item -dm
3756 @opindex dm
3757 Print statistics on memory usage, at the end of the run, to
3758 standard error.
3759
3760 @item -dp
3761 @opindex dp
3762 Annotate the assembler output with a comment indicating which
3763 pattern and alternative was used.  The length of each instruction is
3764 also printed.
3765
3766 @item -dP
3767 @opindex dP
3768 Dump the RTL in the assembler output as a comment before each instruction.
3769 Also turns on @option{-dp} annotation.
3770
3771 @item -dv
3772 @opindex dv
3773 For each of the other indicated dump files (either with @option{-d} or
3774 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
3775 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
3776
3777 @item -dx
3778 @opindex dx
3779 Just generate RTL for a function instead of compiling it.  Usually used
3780 with @samp{r} (@option{-fdump-rtl-expand}).
3781
3782 @item -dy
3783 @opindex dy
3784 Dump debugging information during parsing, to standard error.
3785 @end table
3786
3787 @item -fdump-noaddr
3788 @opindex fdump-noaddr
3789 When doing debugging dumps (see @option{-d} option above), suppress
3790 address output.  This makes it more feasible to use diff on debugging
3791 dumps for compiler invocations with different compiler binaries and/or
3792 different text / bss / data / heap / stack / dso start locations.
3793
3794 @item -fdump-unnumbered
3795 @opindex fdump-unnumbered
3796 When doing debugging dumps (see @option{-d} option above), suppress instruction
3797 numbers, line number note and address output.  This makes it more feasible to
3798 use diff on debugging dumps for compiler invocations with different
3799 options, in particular with and without @option{-g}.
3800
3801 @item -fdump-translation-unit @r{(C++ only)}
3802 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
3803 @opindex fdump-translation-unit
3804 Dump a representation of the tree structure for the entire translation
3805 unit to a file.  The file name is made by appending @file{.tu} to the
3806 source file name.  If the @samp{-@var{options}} form is used, @var{options}
3807 controls the details of the dump as described for the
3808 @option{-fdump-tree} options.
3809
3810 @item -fdump-class-hierarchy @r{(C++ only)}
3811 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
3812 @opindex fdump-class-hierarchy
3813 Dump a representation of each class's hierarchy and virtual function
3814 table layout to a file.  The file name is made by appending @file{.class}
3815 to the source file name.  If the @samp{-@var{options}} form is used,
3816 @var{options} controls the details of the dump as described for the
3817 @option{-fdump-tree} options.
3818
3819 @item -fdump-ipa-@var{switch}
3820 @opindex fdump-ipa
3821 Control the dumping at various stages of inter-procedural analysis
3822 language tree to a file.  The file name is generated by appending a switch
3823 specific suffix to the source file name.  The following dumps are possible:
3824
3825 @table @samp
3826 @item all
3827 Enables all inter-procedural analysis dumps; currently the only produced
3828 dump is the @samp{cgraph} dump.
3829
3830 @item cgraph
3831 Dumps information about call-graph optimization, unused function removal,
3832 and inlining decisions.
3833 @end table
3834
3835 @item -fdump-tree-@var{switch}
3836 @itemx -fdump-tree-@var{switch}-@var{options}
3837 @opindex fdump-tree
3838 Control the dumping at various stages of processing the intermediate
3839 language tree to a file.  The file name is generated by appending a switch
3840 specific suffix to the source file name.  If the @samp{-@var{options}}
3841 form is used, @var{options} is a list of @samp{-} separated options that
3842 control the details of the dump.  Not all options are applicable to all
3843 dumps, those which are not meaningful will be ignored.  The following
3844 options are available
3845
3846 @table @samp
3847 @item address
3848 Print the address of each node.  Usually this is not meaningful as it
3849 changes according to the environment and source file.  Its primary use
3850 is for tying up a dump file with a debug environment.
3851 @item slim
3852 Inhibit dumping of members of a scope or body of a function merely
3853 because that scope has been reached.  Only dump such items when they
3854 are directly reachable by some other path.  When dumping pretty-printed
3855 trees, this option inhibits dumping the bodies of control structures.
3856 @item raw
3857 Print a raw representation of the tree.  By default, trees are
3858 pretty-printed into a C-like representation.
3859 @item details
3860 Enable more detailed dumps (not honored by every dump option).
3861 @item stats
3862 Enable dumping various statistics about the pass (not honored by every dump
3863 option).
3864 @item blocks
3865 Enable showing basic block boundaries (disabled in raw dumps).
3866 @item vops
3867 Enable showing virtual operands for every statement.
3868 @item lineno
3869 Enable showing line numbers for statements.
3870 @item uid
3871 Enable showing the unique ID (@code{DECL_UID}) for each variable.
3872 @item all
3873 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
3874 @end table
3875
3876 The following tree dumps are possible:
3877 @table @samp
3878
3879 @item original
3880 Dump before any tree based optimization, to @file{@var{file}.original}.
3881
3882 @item optimized
3883 Dump after all tree based optimization, to @file{@var{file}.optimized}.
3884
3885 @item inlined
3886 Dump after function inlining, to @file{@var{file}.inlined}.
3887
3888 @item gimple
3889 @opindex fdump-tree-gimple
3890 Dump each function before and after the gimplification pass to a file.  The
3891 file name is made by appending @file{.gimple} to the source file name.
3892
3893 @item cfg
3894 @opindex fdump-tree-cfg
3895 Dump the control flow graph of each function to a file.  The file name is
3896 made by appending @file{.cfg} to the source file name.
3897
3898 @item vcg
3899 @opindex fdump-tree-vcg
3900 Dump the control flow graph of each function to a file in VCG format.  The
3901 file name is made by appending @file{.vcg} to the source file name.  Note
3902 that if the file contains more than one function, the generated file cannot
3903 be used directly by VCG@.  You will need to cut and paste each function's
3904 graph into its own separate file first.
3905
3906 @item ch
3907 @opindex fdump-tree-ch
3908 Dump each function after copying loop headers.  The file name is made by
3909 appending @file{.ch} to the source file name.
3910
3911 @item ssa
3912 @opindex fdump-tree-ssa
3913 Dump SSA related information to a file.  The file name is made by appending
3914 @file{.ssa} to the source file name.
3915
3916 @item salias
3917 @opindex fdump-tree-salias
3918 Dump structure aliasing variable information to a file.  This file name
3919 is made by appending @file{.salias} to the source file name.
3920
3921 @item alias
3922 @opindex fdump-tree-alias
3923 Dump aliasing information for each function.  The file name is made by
3924 appending @file{.alias} to the source file name.
3925
3926 @item ccp
3927 @opindex fdump-tree-ccp
3928 Dump each function after CCP@.  The file name is made by appending
3929 @file{.ccp} to the source file name.
3930
3931 @item storeccp
3932 @opindex fdump-tree-storeccp
3933 Dump each function after STORE-CCP.  The file name is made by appending
3934 @file{.storeccp} to the source file name.
3935
3936 @item pre
3937 @opindex fdump-tree-pre
3938 Dump trees after partial redundancy elimination.  The file name is made
3939 by appending @file{.pre} to the source file name.
3940
3941 @item fre
3942 @opindex fdump-tree-fre
3943 Dump trees after full redundancy elimination.  The file name is made
3944 by appending @file{.fre} to the source file name.
3945
3946 @item copyprop
3947 @opindex fdump-tree-copyprop
3948 Dump trees after copy propagation.  The file name is made
3949 by appending @file{.copyprop} to the source file name.
3950
3951 @item store_copyprop
3952 @opindex fdump-tree-store_copyprop
3953 Dump trees after store copy-propagation.  The file name is made
3954 by appending @file{.store_copyprop} to the source file name.
3955
3956 @item dce
3957 @opindex fdump-tree-dce
3958 Dump each function after dead code elimination.  The file name is made by
3959 appending @file{.dce} to the source file name.
3960
3961 @item mudflap
3962 @opindex fdump-tree-mudflap
3963 Dump each function after adding mudflap instrumentation.  The file name is
3964 made by appending @file{.mudflap} to the source file name.
3965
3966 @item sra
3967 @opindex fdump-tree-sra
3968 Dump each function after performing scalar replacement of aggregates.  The
3969 file name is made by appending @file{.sra} to the source file name.
3970
3971 @item sink
3972 @opindex fdump-tree-sink
3973 Dump each function after performing code sinking.  The file name is made
3974 by appending @file{.sink} to the source file name. 
3975
3976 @item dom
3977 @opindex fdump-tree-dom
3978 Dump each function after applying dominator tree optimizations.  The file
3979 name is made by appending @file{.dom} to the source file name.
3980
3981 @item dse
3982 @opindex fdump-tree-dse
3983 Dump each function after applying dead store elimination.  The file
3984 name is made by appending @file{.dse} to the source file name.
3985
3986 @item phiopt
3987 @opindex fdump-tree-phiopt
3988 Dump each function after optimizing PHI nodes into straightline code.  The file
3989 name is made by appending @file{.phiopt} to the source file name.
3990
3991 @item forwprop
3992 @opindex fdump-tree-forwprop
3993 Dump each function after forward propagating single use variables.  The file
3994 name is made by appending @file{.forwprop} to the source file name.
3995
3996 @item copyrename
3997 @opindex fdump-tree-copyrename
3998 Dump each function after applying the copy rename optimization.  The file
3999 name is made by appending @file{.copyrename} to the source file name.
4000
4001 @item nrv
4002 @opindex fdump-tree-nrv
4003 Dump each function after applying the named return value optimization on
4004 generic trees.  The file name is made by appending @file{.nrv} to the source
4005 file name.
4006
4007 @item vect
4008 @opindex fdump-tree-vect
4009 Dump each function after applying vectorization of loops.  The file name is
4010 made by appending @file{.vect} to the source file name.
4011
4012 @item vrp
4013 @opindex fdump-tree-vrp
4014 Dump each function after Value Range Propagation (VRP).  The file name
4015 is made by appending @file{.vrp} to the source file name.
4016
4017 @item all
4018 @opindex fdump-tree-all
4019 Enable all the available tree dumps with the flags provided in this option.
4020 @end table
4021
4022 @item -ftree-vectorizer-verbose=@var{n}
4023 @opindex ftree-vectorizer-verbose
4024 This option controls the amount of debugging output the vectorizer prints.
4025 This information is written to standard error, unless 
4026 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified, 
4027 in which case it is output to the usual dump listing file, @file{.vect}.
4028 For @var{n}=0 no diagnostic information is reported.
4029 If @var{n}=1 the vectorizer reports each loop that got vectorized, 
4030 and the total number of loops that got vectorized.
4031 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed 
4032 the first analysis phase (vect_analyze_loop_form) - i.e. countable, 
4033 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity 
4034 level that @option{-fdump-tree-vect-stats} uses.
4035 Higher verbosity levels mean either more information dumped for each 
4036 reported loop, or same amount of information reported for more loops:
4037 If @var{n}=3, alignment related information is added to the reports.
4038 If @var{n}=4, data-references related information (e.g. memory dependences, 
4039 memory access-patterns) is added to the reports.
4040 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops 
4041 that did not pass the first analysis phase (i.e. may not be countable, or 
4042 may have complicated control-flow).
4043 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4044 For @var{n}=7, all the information the vectorizer generates during its 
4045 analysis and transformation is reported.  This is the same verbosity level
4046 that @option{-fdump-tree-vect-details} uses.
4047
4048 @item -frandom-seed=@var{string}
4049 @opindex frandom-string
4050 This option provides a seed that GCC uses when it would otherwise use
4051 random numbers.  It is used to generate certain symbol names
4052 that have to be different in every compiled file.  It is also used to
4053 place unique stamps in coverage data files and the object files that
4054 produce them.  You can use the @option{-frandom-seed} option to produce
4055 reproducibly identical object files.
4056
4057 The @var{string} should be different for every file you compile.
4058
4059 @item -fsched-verbose=@var{n}
4060 @opindex fsched-verbose
4061 On targets that use instruction scheduling, this option controls the
4062 amount of debugging output the scheduler prints.  This information is
4063 written to standard error, unless @option{-dS} or @option{-dR} is
4064 specified, in which case it is output to the usual dump
4065 listing file, @file{.sched} or @file{.sched2} respectively.  However
4066 for @var{n} greater than nine, the output is always printed to standard
4067 error.
4068
4069 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4070 same information as @option{-dRS}.  For @var{n} greater than one, it
4071 also output basic block probabilities, detailed ready list information
4072 and unit/insn info.  For @var{n} greater than two, it includes RTL
4073 at abort point, control-flow and regions info.  And for @var{n} over
4074 four, @option{-fsched-verbose} also includes dependence info.
4075
4076 @item -save-temps
4077 @opindex save-temps
4078 Store the usual ``temporary'' intermediate files permanently; place them
4079 in the current directory and name them based on the source file.  Thus,
4080 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4081 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4082 preprocessed @file{foo.i} output file even though the compiler now
4083 normally uses an integrated preprocessor.
4084
4085 When used in combination with the @option{-x} command line option,
4086 @option{-save-temps} is sensible enough to avoid over writing an
4087 input source file with the same extension as an intermediate file.
4088 The corresponding intermediate file may be obtained by renaming the
4089 source file before using @option{-save-temps}.
4090
4091 @item -time
4092 @opindex time
4093 Report the CPU time taken by each subprocess in the compilation
4094 sequence.  For C source files, this is the compiler proper and assembler
4095 (plus the linker if linking is done).  The output looks like this:
4096
4097 @smallexample
4098 # cc1 0.12 0.01
4099 # as 0.00 0.01
4100 @end smallexample
4101
4102 The first number on each line is the ``user time'', that is time spent
4103 executing the program itself.  The second number is ``system time'',
4104 time spent executing operating system routines on behalf of the program.
4105 Both numbers are in seconds.
4106
4107 @item -fvar-tracking
4108 @opindex fvar-tracking
4109 Run variable tracking pass.  It computes where variables are stored at each
4110 position in code.  Better debugging information is then generated
4111 (if the debugging information format supports this information).
4112
4113 It is enabled by default when compiling with optimization (@option{-Os},
4114 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4115 the debug info format supports it.
4116
4117 @item -print-file-name=@var{library}
4118 @opindex print-file-name
4119 Print the full absolute name of the library file @var{library} that
4120 would be used when linking---and don't do anything else.  With this
4121 option, GCC does not compile or link anything; it just prints the
4122 file name.
4123
4124 @item -print-multi-directory
4125 @opindex print-multi-directory
4126 Print the directory name corresponding to the multilib selected by any
4127 other switches present in the command line.  This directory is supposed
4128 to exist in @env{GCC_EXEC_PREFIX}.
4129
4130 @item -print-multi-lib
4131 @opindex print-multi-lib
4132 Print the mapping from multilib directory names to compiler switches
4133 that enable them.  The directory name is separated from the switches by
4134 @samp{;}, and each switch starts with an @samp{@@} instead of the
4135 @samp{-}, without spaces between multiple switches.  This is supposed to
4136 ease shell-processing.
4137
4138 @item -print-prog-name=@var{program}
4139 @opindex print-prog-name
4140 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4141
4142 @item -print-libgcc-file-name
4143 @opindex print-libgcc-file-name
4144 Same as @option{-print-file-name=libgcc.a}.
4145
4146 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4147 but you do want to link with @file{libgcc.a}.  You can do
4148
4149 @smallexample
4150 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4151 @end smallexample
4152
4153 @item -print-search-dirs
4154 @opindex print-search-dirs
4155 Print the name of the configured installation directory and a list of
4156 program and library directories @command{gcc} will search---and don't do anything else.
4157
4158 This is useful when @command{gcc} prints the error message
4159 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4160 To resolve this you either need to put @file{cpp0} and the other compiler
4161 components where @command{gcc} expects to find them, or you can set the environment
4162 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4163 Don't forget the trailing @samp{/}.
4164 @xref{Environment Variables}.
4165
4166 @item -dumpmachine
4167 @opindex dumpmachine
4168 Print the compiler's target machine (for example,
4169 @samp{i686-pc-linux-gnu})---and don't do anything else.
4170
4171 @item -dumpversion
4172 @opindex dumpversion
4173 Print the compiler version (for example, @samp{3.0})---and don't do
4174 anything else.
4175
4176 @item -dumpspecs
4177 @opindex dumpspecs
4178 Print the compiler's built-in specs---and don't do anything else.  (This
4179 is used when GCC itself is being built.)  @xref{Spec Files}.
4180
4181 @item -feliminate-unused-debug-types
4182 @opindex feliminate-unused-debug-types
4183 Normally, when producing DWARF2 output, GCC will emit debugging
4184 information for all types declared in a compilation
4185 unit, regardless of whether or not they are actually used
4186 in that compilation unit.  Sometimes this is useful, such as
4187 if, in the debugger, you want to cast a value to a type that is
4188 not actually used in your program (but is declared).  More often,
4189 however, this results in a significant amount of wasted space.
4190 With this option, GCC will avoid producing debug symbol output
4191 for types that are nowhere used in the source file being compiled.
4192 @end table
4193
4194 @node Optimize Options
4195 @section Options That Control Optimization
4196 @cindex optimize options
4197 @cindex options, optimization
4198
4199 These options control various sorts of optimizations.
4200
4201 Without any optimization option, the compiler's goal is to reduce the
4202 cost of compilation and to make debugging produce the expected
4203 results.  Statements are independent: if you stop the program with a
4204 breakpoint between statements, you can then assign a new value to any
4205 variable or change the program counter to any other statement in the
4206 function and get exactly the results you would expect from the source
4207 code.
4208
4209 Turning on optimization flags makes the compiler attempt to improve
4210 the performance and/or code size at the expense of compilation time
4211 and possibly the ability to debug the program.
4212
4213 The compiler performs optimization based on the knowledge it has of
4214 the program.  Optimization levels @option{-O} and above, in
4215 particular, enable @emph{unit-at-a-time} mode, which allows the
4216 compiler to consider information gained from later functions in
4217 the file when compiling a function.  Compiling multiple files at
4218 once to a single output file in @emph{unit-at-a-time} mode allows
4219 the compiler to use information gained from all of the files when
4220 compiling each of them.
4221
4222 Not all optimizations are controlled directly by a flag.  Only
4223 optimizations that have a flag are listed.
4224
4225 @table @gcctabopt
4226 @item -O
4227 @itemx -O1
4228 @opindex O
4229 @opindex O1
4230 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4231 more memory for a large function.
4232
4233 With @option{-O}, the compiler tries to reduce code size and execution
4234 time, without performing any optimizations that take a great deal of
4235 compilation time.
4236
4237 @option{-O} turns on the following optimization flags:
4238 @gccoptlist{-fdefer-pop @gol
4239 -fdelayed-branch @gol
4240 -fguess-branch-probability @gol
4241 -fcprop-registers @gol
4242 -fif-conversion @gol
4243 -fif-conversion2 @gol
4244 -ftree-ccp @gol
4245 -ftree-dce @gol
4246 -ftree-dominator-opts @gol
4247 -ftree-dse @gol
4248 -ftree-ter @gol
4249 -ftree-lrs @gol
4250 -ftree-sra @gol
4251 -ftree-copyrename @gol
4252 -ftree-fre @gol
4253 -ftree-ch @gol
4254 -funit-at-a-time @gol
4255 -fmerge-constants}
4256
4257 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4258 where doing so does not interfere with debugging.
4259
4260 @item -O2
4261 @opindex O2
4262 Optimize even more.  GCC performs nearly all supported optimizations
4263 that do not involve a space-speed tradeoff.  The compiler does not
4264 perform loop unrolling or function inlining when you specify @option{-O2}.
4265 As compared to @option{-O}, this option increases both compilation time
4266 and the performance of the generated code.
4267
4268 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4269 also turns on the following optimization flags:
4270 @gccoptlist{-fthread-jumps @gol
4271 -fcrossjumping @gol
4272 -foptimize-sibling-calls @gol
4273 -fcse-follow-jumps  -fcse-skip-blocks @gol
4274 -fgcse  -fgcse-lm  @gol
4275 -fexpensive-optimizations @gol
4276 -frerun-cse-after-loop  @gol
4277 -fcaller-saves @gol
4278 -fpeephole2 @gol
4279 -fschedule-insns  -fschedule-insns2 @gol
4280 -fsched-interblock  -fsched-spec @gol
4281 -fregmove @gol
4282 -fstrict-aliasing -fstrict-overflow @gol
4283 -fdelete-null-pointer-checks @gol
4284 -freorder-blocks  -freorder-functions @gol
4285 -falign-functions  -falign-jumps @gol
4286 -falign-loops  -falign-labels @gol
4287 -ftree-vrp @gol
4288 -ftree-pre}
4289
4290 Please note the warning under @option{-fgcse} about
4291 invoking @option{-O2} on programs that use computed gotos.
4292
4293 @option{-O2} doesn't turn on @option{-ftree-vrp} for the Ada compiler.
4294 This option must be explicitly specified on the command line to be
4295 enabled for the Ada compiler.
4296
4297 @item -O3
4298 @opindex O3
4299 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4300 @option{-O2} and also turns on the @option{-finline-functions},
4301 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4302
4303 @item -O0
4304 @opindex O0
4305 Do not optimize.  This is the default.
4306
4307 @item -Os
4308 @opindex Os
4309 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4310 do not typically increase code size.  It also performs further
4311 optimizations designed to reduce code size.
4312
4313 @option{-Os} disables the following optimization flags:
4314 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4315 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
4316 -fprefetch-loop-arrays  -ftree-vect-loop-version}
4317
4318 If you use multiple @option{-O} options, with or without level numbers,
4319 the last such option is the one that is effective.
4320 @end table
4321
4322 Options of the form @option{-f@var{flag}} specify machine-independent
4323 flags.  Most flags have both positive and negative forms; the negative
4324 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4325 below, only one of the forms is listed---the one you typically will
4326 use.  You can figure out the other form by either removing @samp{no-}
4327 or adding it.
4328
4329 The following options control specific optimizations.  They are either
4330 activated by @option{-O} options or are related to ones that are.  You
4331 can use the following flags in the rare cases when ``fine-tuning'' of
4332 optimizations to be performed is desired.
4333
4334 @table @gcctabopt
4335 @item -fno-default-inline
4336 @opindex fno-default-inline
4337 Do not make member functions inline by default merely because they are
4338 defined inside the class scope (C++ only).  Otherwise, when you specify
4339 @w{@option{-O}}, member functions defined inside class scope are compiled
4340 inline by default; i.e., you don't need to add @samp{inline} in front of
4341 the member function name.
4342
4343 @item -fno-defer-pop
4344 @opindex fno-defer-pop
4345 Always pop the arguments to each function call as soon as that function
4346 returns.  For machines which must pop arguments after a function call,
4347 the compiler normally lets arguments accumulate on the stack for several
4348 function calls and pops them all at once.
4349
4350 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4351
4352 @item -fforce-mem
4353 @opindex fforce-mem
4354 Force memory operands to be copied into registers before doing
4355 arithmetic on them.  This produces better code by making all memory
4356 references potential common subexpressions.  When they are not common
4357 subexpressions, instruction combination should eliminate the separate
4358 register-load. This option is now a nop and will be removed in 4.3.
4359
4360 @item -fforce-addr
4361 @opindex fforce-addr
4362 Force memory address constants to be copied into registers before
4363 doing arithmetic on them.
4364
4365 @item -fomit-frame-pointer
4366 @opindex fomit-frame-pointer
4367 Don't keep the frame pointer in a register for functions that
4368 don't need one.  This avoids the instructions to save, set up and
4369 restore frame pointers; it also makes an extra register available
4370 in many functions.  @strong{It also makes debugging impossible on
4371 some machines.}
4372
4373 On some machines, such as the VAX, this flag has no effect, because
4374 the standard calling sequence automatically handles the frame pointer
4375 and nothing is saved by pretending it doesn't exist.  The
4376 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4377 whether a target machine supports this flag.  @xref{Registers,,Register
4378 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4379
4380 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4381
4382 @item -foptimize-sibling-calls
4383 @opindex foptimize-sibling-calls
4384 Optimize sibling and tail recursive calls.
4385
4386 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4387
4388 @item -fno-inline
4389 @opindex fno-inline
4390 Don't pay attention to the @code{inline} keyword.  Normally this option
4391 is used to keep the compiler from expanding any functions inline.
4392 Note that if you are not optimizing, no functions can be expanded inline.
4393
4394 @item -finline-functions
4395 @opindex finline-functions
4396 Integrate all simple functions into their callers.  The compiler
4397 heuristically decides which functions are simple enough to be worth
4398 integrating in this way.
4399
4400 If all calls to a given function are integrated, and the function is
4401 declared @code{static}, then the function is normally not output as
4402 assembler code in its own right.
4403
4404 Enabled at level @option{-O3}.
4405
4406 @item -finline-functions-called-once
4407 @opindex finline-functions-called-once
4408 Consider all @code{static} functions called once for inlining into their
4409 caller even if they are not marked @code{inline}.  If a call to a given
4410 function is integrated, then the function is not output as assembler code
4411 in its own right.
4412
4413 Enabled if @option{-funit-at-a-time} is enabled.
4414
4415 @item -fearly-inlining
4416 @opindex fearly-inlining
4417 Inline functions marked by @code{always_inline} and functions whose body seems
4418 smaller than the function call overhead early before doing
4419 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4420 makes profiling significantly cheaper and usually inlining faster on programs
4421 having large chains of nested wrapper functions.
4422
4423 Enabled by default.
4424
4425 @item -finline-limit=@var{n}
4426 @opindex finline-limit
4427 By default, GCC limits the size of functions that can be inlined.  This flag
4428 allows the control of this limit for functions that are explicitly marked as
4429 inline (i.e., marked with the inline keyword or defined within the class
4430 definition in c++).  @var{n} is the size of functions that can be inlined in
4431 number of pseudo instructions (not counting parameter handling).  The default
4432 value of @var{n} is 600.
4433 Increasing this value can result in more inlined code at
4434 the cost of compilation time and memory consumption.  Decreasing usually makes
4435 the compilation faster and less code will be inlined (which presumably
4436 means slower programs).  This option is particularly useful for programs that
4437 use inlining heavily such as those based on recursive templates with C++.
4438
4439 Inlining is actually controlled by a number of parameters, which may be
4440 specified individually by using @option{--param @var{name}=@var{value}}.
4441 The @option{-finline-limit=@var{n}} option sets some of these parameters
4442 as follows:
4443
4444 @table @gcctabopt
4445 @item max-inline-insns-single
4446  is set to @var{n}/2.
4447 @item max-inline-insns-auto
4448  is set to @var{n}/2.
4449 @item min-inline-insns
4450  is set to 130 or @var{n}/4, whichever is smaller.
4451 @item max-inline-insns-rtl
4452  is set to @var{n}.
4453 @end table
4454
4455 See below for a documentation of the individual
4456 parameters controlling inlining.
4457
4458 @emph{Note:} pseudo instruction represents, in this particular context, an
4459 abstract measurement of function's size.  In no way does it represent a count
4460 of assembly instructions and as such its exact meaning might change from one
4461 release to an another.
4462
4463 @item -fkeep-inline-functions
4464 @opindex fkeep-inline-functions
4465 In C, emit @code{static} functions that are declared @code{inline}
4466 into the object file, even if the function has been inlined into all
4467 of its callers.  This switch does not affect functions using the
4468 @code{extern inline} extension in GNU C@.  In C++, emit any and all
4469 inline functions into the object file.
4470
4471 @item -fkeep-static-consts
4472 @opindex fkeep-static-consts
4473 Emit variables declared @code{static const} when optimization isn't turned
4474 on, even if the variables aren't referenced.
4475
4476 GCC enables this option by default.  If you want to force the compiler to
4477 check if the variable was referenced, regardless of whether or not
4478 optimization is turned on, use the @option{-fno-keep-static-consts} option.
4479
4480 @item -fmerge-constants
4481 Attempt to merge identical constants (string constants and floating point
4482 constants) across compilation units.
4483
4484 This option is the default for optimized compilation if the assembler and
4485 linker support it.  Use @option{-fno-merge-constants} to inhibit this
4486 behavior.
4487
4488 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4489
4490 @item -fmerge-all-constants
4491 Attempt to merge identical constants and identical variables.
4492
4493 This option implies @option{-fmerge-constants}.  In addition to
4494 @option{-fmerge-constants} this considers e.g.@: even constant initialized
4495 arrays or initialized constant variables with integral or floating point
4496 types.  Languages like C or C++ require each non-automatic variable to
4497 have distinct location, so using this option will result in non-conforming
4498 behavior.
4499
4500 @item -fmodulo-sched
4501 @opindex fmodulo-sched
4502 Perform swing modulo scheduling immediately before the first scheduling
4503 pass.  This pass looks at innermost loops and reorders their
4504 instructions by overlapping different iterations.
4505
4506 @item -fno-branch-count-reg
4507 @opindex fno-branch-count-reg
4508 Do not use ``decrement and branch'' instructions on a count register,
4509 but instead generate a sequence of instructions that decrement a
4510 register, compare it against zero, then branch based upon the result.
4511 This option is only meaningful on architectures that support such
4512 instructions, which include x86, PowerPC, IA-64 and S/390.
4513
4514 The default is @option{-fbranch-count-reg}.
4515
4516 @item -fno-function-cse
4517 @opindex fno-function-cse
4518 Do not put function addresses in registers; make each instruction that
4519 calls a constant function contain the function's address explicitly.
4520
4521 This option results in less efficient code, but some strange hacks
4522 that alter the assembler output may be confused by the optimizations
4523 performed when this option is not used.
4524
4525 The default is @option{-ffunction-cse}
4526
4527 @item -fno-zero-initialized-in-bss
4528 @opindex fno-zero-initialized-in-bss
4529 If the target supports a BSS section, GCC by default puts variables that
4530 are initialized to zero into BSS@.  This can save space in the resulting
4531 code.
4532
4533 This option turns off this behavior because some programs explicitly
4534 rely on variables going to the data section.  E.g., so that the
4535 resulting executable can find the beginning of that section and/or make
4536 assumptions based on that.
4537
4538 The default is @option{-fzero-initialized-in-bss}.
4539
4540 @item -fbounds-check
4541 @opindex fbounds-check
4542 For front-ends that support it, generate additional code to check that
4543 indices used to access arrays are within the declared range.  This is
4544 currently only supported by the Java and Fortran front-ends, where
4545 this option defaults to true and false respectively.
4546
4547 @item -fmudflap -fmudflapth -fmudflapir
4548 @opindex fmudflap
4549 @opindex fmudflapth
4550 @opindex fmudflapir
4551 @cindex bounds checking
4552 @cindex mudflap
4553 For front-ends that support it (C and C++), instrument all risky
4554 pointer/array dereferencing operations, some standard library
4555 string/heap functions, and some other associated constructs with
4556 range/validity tests.  Modules so instrumented should be immune to
4557 buffer overflows, invalid heap use, and some other classes of C/C++
4558 programming errors.  The instrumentation relies on a separate runtime
4559 library (@file{libmudflap}), which will be linked into a program if
4560 @option{-fmudflap} is given at link time.  Run-time behavior of the
4561 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
4562 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
4563 for its options.
4564
4565 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
4566 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
4567 addition to @option{-fmudflap} or @option{-fmudflapth}, if
4568 instrumentation should ignore pointer reads.  This produces less
4569 instrumentation (and therefore faster execution) and still provides
4570 some protection against outright memory corrupting writes, but allows
4571 erroneously read data to propagate within a program.
4572
4573 @item -fthread-jumps
4574 @opindex fthread-jumps
4575 Perform optimizations where we check to see if a jump branches to a
4576 location where another comparison subsumed by the first is found.  If
4577 so, the first branch is redirected to either the destination of the
4578 second branch or a point immediately following it, depending on whether
4579 the condition is known to be true or false.
4580
4581 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4582
4583 @item -fcse-follow-jumps
4584 @opindex fcse-follow-jumps
4585 In common subexpression elimination, scan through jump instructions
4586 when the target of the jump is not reached by any other path.  For
4587 example, when CSE encounters an @code{if} statement with an
4588 @code{else} clause, CSE will follow the jump when the condition
4589 tested is false.
4590
4591 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4592
4593 @item -fcse-skip-blocks
4594 @opindex fcse-skip-blocks
4595 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
4596 follow jumps which conditionally skip over blocks.  When CSE
4597 encounters a simple @code{if} statement with no else clause,
4598 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
4599 body of the @code{if}.
4600
4601 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4602
4603 @item -frerun-cse-after-loop
4604 @opindex frerun-cse-after-loop
4605 Re-run common subexpression elimination after loop optimizations has been
4606 performed.
4607
4608 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4609
4610 @item -fgcse
4611 @opindex fgcse
4612 Perform a global common subexpression elimination pass.
4613 This pass also performs global constant and copy propagation.
4614
4615 @emph{Note:} When compiling a program using computed gotos, a GCC
4616 extension, you may get better runtime performance if you disable
4617 the global common subexpression elimination pass by adding
4618 @option{-fno-gcse} to the command line.
4619
4620 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4621
4622 @item -fgcse-lm
4623 @opindex fgcse-lm
4624 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
4625 attempt to move loads which are only killed by stores into themselves.  This
4626 allows a loop containing a load/store sequence to be changed to a load outside
4627 the loop, and a copy/store within the loop.
4628
4629 Enabled by default when gcse is enabled.
4630
4631 @item -fgcse-sm
4632 @opindex fgcse-sm
4633 When @option{-fgcse-sm} is enabled, a store motion pass is run after
4634 global common subexpression elimination.  This pass will attempt to move
4635 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
4636 loops containing a load/store sequence can be changed to a load before
4637 the loop and a store after the loop.
4638
4639 Not enabled at any optimization level.
4640
4641 @item -fgcse-las
4642 @opindex fgcse-las
4643 When @option{-fgcse-las} is enabled, the global common subexpression
4644 elimination pass eliminates redundant loads that come after stores to the
4645 same memory location (both partial and full redundancies).
4646
4647 Not enabled at any optimization level.
4648
4649 @item -fgcse-after-reload
4650 @opindex fgcse-after-reload
4651 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
4652 pass is performed after reload.  The purpose of this pass is to cleanup
4653 redundant spilling.
4654
4655 @item -funsafe-loop-optimizations
4656 @opindex funsafe-loop-optimizations
4657 If given, the loop optimizer will assume that loop indices do not
4658 overflow, and that the loops with nontrivial exit condition are not
4659 infinite.  This enables a wider range of loop optimizations even if
4660 the loop optimizer itself cannot prove that these assumptions are valid.
4661 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
4662 if it finds this kind of loop.
4663
4664 @item -fcrossjumping
4665 @opindex crossjumping
4666 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
4667 resulting code may or may not perform better than without cross-jumping.
4668
4669 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4670
4671 @item -fif-conversion
4672 @opindex if-conversion
4673 Attempt to transform conditional jumps into branch-less equivalents.  This
4674 include use of conditional moves, min, max, set flags and abs instructions, and
4675 some tricks doable by standard arithmetics.  The use of conditional execution
4676 on chips where it is available is controlled by @code{if-conversion2}.
4677
4678 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4679
4680 @item -fif-conversion2
4681 @opindex if-conversion2
4682 Use conditional execution (where available) to transform conditional jumps into
4683 branch-less equivalents.
4684
4685 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4686
4687 @item -fdelete-null-pointer-checks
4688 @opindex fdelete-null-pointer-checks
4689 Use global dataflow analysis to identify and eliminate useless checks
4690 for null pointers.  The compiler assumes that dereferencing a null
4691 pointer would have halted the program.  If a pointer is checked after
4692 it has already been dereferenced, it cannot be null.
4693
4694 In some environments, this assumption is not true, and programs can
4695 safely dereference null pointers.  Use
4696 @option{-fno-delete-null-pointer-checks} to disable this optimization
4697 for programs which depend on that behavior.
4698
4699 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4700
4701 @item -fexpensive-optimizations
4702 @opindex fexpensive-optimizations
4703 Perform a number of minor optimizations that are relatively expensive.
4704
4705 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4706
4707 @item -foptimize-register-move
4708 @itemx -fregmove
4709 @opindex foptimize-register-move
4710 @opindex fregmove
4711 Attempt to reassign register numbers in move instructions and as
4712 operands of other simple instructions in order to maximize the amount of
4713 register tying.  This is especially helpful on machines with two-operand
4714 instructions.
4715
4716 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
4717 optimization.
4718
4719 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4720
4721 @item -fdelayed-branch
4722 @opindex fdelayed-branch
4723 If supported for the target machine, attempt to reorder instructions
4724 to exploit instruction slots available after delayed branch
4725 instructions.
4726
4727 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4728
4729 @item -fschedule-insns
4730 @opindex fschedule-insns
4731 If supported for the target machine, attempt to reorder instructions to
4732 eliminate execution stalls due to required data being unavailable.  This
4733 helps machines that have slow floating point or memory load instructions
4734 by allowing other instructions to be issued until the result of the load
4735 or floating point instruction is required.
4736
4737 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4738
4739 @item -fschedule-insns2
4740 @opindex fschedule-insns2
4741 Similar to @option{-fschedule-insns}, but requests an additional pass of
4742 instruction scheduling after register allocation has been done.  This is
4743 especially useful on machines with a relatively small number of
4744 registers and where memory load instructions take more than one cycle.
4745
4746 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4747
4748 @item -fno-sched-interblock
4749 @opindex fno-sched-interblock
4750 Don't schedule instructions across basic blocks.  This is normally
4751 enabled by default when scheduling before register allocation, i.e.@:
4752 with @option{-fschedule-insns} or at @option{-O2} or higher.
4753
4754 @item -fno-sched-spec
4755 @opindex fno-sched-spec
4756 Don't allow speculative motion of non-load instructions.  This is normally
4757 enabled by default when scheduling before register allocation, i.e.@:
4758 with @option{-fschedule-insns} or at @option{-O2} or higher.
4759
4760 @item -fsched-spec-load
4761 @opindex fsched-spec-load
4762 Allow speculative motion of some load instructions.  This only makes
4763 sense when scheduling before register allocation, i.e.@: with
4764 @option{-fschedule-insns} or at @option{-O2} or higher.
4765
4766 @item -fsched-spec-load-dangerous
4767 @opindex fsched-spec-load-dangerous
4768 Allow speculative motion of more load instructions.  This only makes
4769 sense when scheduling before register allocation, i.e.@: with
4770 @option{-fschedule-insns} or at @option{-O2} or higher.
4771
4772 @item -fsched-stalled-insns=@var{n}
4773 @opindex fsched-stalled-insns
4774 Define how many insns (if any) can be moved prematurely from the queue
4775 of stalled insns into the ready list, during the second scheduling pass.
4776
4777 @item -fsched-stalled-insns-dep=@var{n}
4778 @opindex fsched-stalled-insns-dep
4779 Define how many insn groups (cycles) will be examined for a dependency
4780 on a stalled insn that is candidate for premature removal from the queue
4781 of stalled insns.  Has an effect only during the second scheduling pass,
4782 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
4783
4784 @item -fsched2-use-superblocks
4785 @opindex fsched2-use-superblocks
4786 When scheduling after register allocation, do use superblock scheduling
4787 algorithm.  Superblock scheduling allows motion across basic block boundaries
4788 resulting on faster schedules.  This option is experimental, as not all machine
4789 descriptions used by GCC model the CPU closely enough to avoid unreliable
4790 results from the algorithm.
4791
4792 This only makes sense when scheduling after register allocation, i.e.@: with
4793 @option{-fschedule-insns2} or at @option{-O2} or higher.
4794
4795 @item -fsched2-use-traces
4796 @opindex fsched2-use-traces
4797 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
4798 allocation and additionally perform code duplication in order to increase the
4799 size of superblocks using tracer pass.  See @option{-ftracer} for details on
4800 trace formation.
4801
4802 This mode should produce faster but significantly longer programs.  Also
4803 without @option{-fbranch-probabilities} the traces constructed may not
4804 match the reality and hurt the performance.  This only makes
4805 sense when scheduling after register allocation, i.e.@: with
4806 @option{-fschedule-insns2} or at @option{-O2} or higher.
4807
4808 @item -fsee
4809 @opindex fsee
4810 Eliminates redundant extension instructions and move the non redundant
4811 ones to optimal placement using LCM.
4812
4813 @item -freschedule-modulo-scheduled-loops
4814 @opindex fscheduling-in-modulo-scheduled-loops
4815 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
4816 we may want to prevent the later scheduling passes from changing its schedule, we use this
4817 option to control that.
4818
4819 @item -fcaller-saves
4820 @opindex fcaller-saves
4821 Enable values to be allocated in registers that will be clobbered by
4822 function calls, by emitting extra instructions to save and restore the
4823 registers around such calls.  Such allocation is done only when it
4824 seems to result in better code than would otherwise be produced.
4825
4826 This option is always enabled by default on certain machines, usually
4827 those which have no call-preserved registers to use instead.
4828
4829 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4830
4831 @item -ftree-pre
4832 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
4833 enabled by default at @option{-O2} and @option{-O3}.
4834
4835 @item -ftree-fre
4836 Perform Full Redundancy Elimination (FRE) on trees.  The difference
4837 between FRE and PRE is that FRE only considers expressions
4838 that are computed on all paths leading to the redundant computation.
4839 This analysis faster than PRE, though it exposes fewer redundancies.
4840 This flag is enabled by default at @option{-O} and higher.
4841
4842 @item -ftree-copy-prop
4843 Perform copy propagation on trees.  This pass eliminates unnecessary
4844 copy operations.  This flag is enabled by default at @option{-O} and
4845 higher.
4846
4847 @item -ftree-store-copy-prop
4848 Perform copy propagation of memory loads and stores.  This pass
4849 eliminates unnecessary copy operations in memory references
4850 (structures, global variables, arrays, etc).  This flag is enabled by
4851 default at @option{-O2} and higher.
4852
4853 @item -ftree-salias
4854 Perform structural alias analysis on trees.  This flag
4855 is enabled by default at @option{-O} and higher.
4856
4857 @item -fipa-pta
4858 Perform interprocedural pointer analysis.
4859
4860 @item -ftree-sink
4861 Perform forward store motion  on trees.  This flag is
4862 enabled by default at @option{-O} and higher.
4863
4864 @item -ftree-ccp
4865 Perform sparse conditional constant propagation (CCP) on trees.  This
4866 pass only operates on local scalar variables and is enabled by default
4867 at @option{-O} and higher.
4868
4869 @item -ftree-store-ccp
4870 Perform sparse conditional constant propagation (CCP) on trees.  This
4871 pass operates on both local scalar variables and memory stores and
4872 loads (global variables, structures, arrays, etc).  This flag is
4873 enabled by default at @option{-O2} and higher.
4874
4875 @item -ftree-dce
4876 Perform dead code elimination (DCE) on trees.  This flag is enabled by
4877 default at @option{-O} and higher.
4878
4879 @item -ftree-dominator-opts
4880 Perform a variety of simple scalar cleanups (constant/copy
4881 propagation, redundancy elimination, range propagation and expression
4882 simplification) based on a dominator tree traversal.  This also
4883 performs jump threading (to reduce jumps to jumps). This flag is
4884 enabled by default at @option{-O} and higher.
4885
4886 @item -ftree-ch
4887 Perform loop header copying on trees.  This is beneficial since it increases
4888 effectiveness of code motion optimizations.  It also saves one jump.  This flag
4889 is enabled by default at @option{-O} and higher.  It is not enabled
4890 for @option{-Os}, since it usually increases code size.
4891
4892 @item -ftree-loop-optimize
4893 Perform loop optimizations on trees.  This flag is enabled by default
4894 at @option{-O} and higher.
4895
4896 @item -ftree-loop-linear
4897 Perform linear loop transformations on tree.  This flag can improve cache
4898 performance and allow further loop optimizations to take place.
4899
4900 @item -ftree-loop-im
4901 Perform loop invariant motion on trees.  This pass moves only invariants that
4902 would be hard to handle at RTL level (function calls, operations that expand to
4903 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
4904 operands of conditions that are invariant out of the loop, so that we can use
4905 just trivial invariantness analysis in loop unswitching.  The pass also includes
4906 store motion.
4907
4908 @item -ftree-loop-ivcanon
4909 Create a canonical counter for number of iterations in the loop for that
4910 determining number of iterations requires complicated analysis.  Later
4911 optimizations then may determine the number easily.  Useful especially
4912 in connection with unrolling.
4913
4914 @item -fivopts
4915 Perform induction variable optimizations (strength reduction, induction
4916 variable merging and induction variable elimination) on trees.
4917
4918 @item -ftree-sra
4919 Perform scalar replacement of aggregates.  This pass replaces structure
4920 references with scalars to prevent committing structures to memory too
4921 early.  This flag is enabled by default at @option{-O} and higher.
4922
4923 @item -ftree-copyrename
4924 Perform copy renaming on trees.  This pass attempts to rename compiler
4925 temporaries to other variables at copy locations, usually resulting in
4926 variable names which more closely resemble the original variables.  This flag
4927 is enabled by default at @option{-O} and higher.
4928
4929 @item -ftree-ter
4930 Perform temporary expression replacement during the SSA->normal phase.  Single
4931 use/single def temporaries are replaced at their use location with their
4932 defining expression.  This results in non-GIMPLE code, but gives the expanders
4933 much more complex trees to work on resulting in better RTL generation.  This is
4934 enabled by default at @option{-O} and higher.
4935
4936 @item -ftree-lrs
4937 Perform live range splitting during the SSA->normal phase.  Distinct live
4938 ranges of a variable are split into unique variables, allowing for better
4939 optimization later.  This is enabled by default at @option{-O} and higher.
4940
4941 @item -ftree-vectorize
4942 Perform loop vectorization on trees.
4943
4944 @item -ftree-vect-loop-version
4945 @opindex ftree-vect-loop-version
4946 Perform loop versioning when doing loop vectorization on trees.  When a loop
4947 appears to be vectorizable except that data alignment or data dependence cannot
4948 be determined at compile time then vectorized and non-vectorized versions of
4949 the loop are generated along with runtime checks for alignment or dependence
4950 to control which version is executed.  This option is enabled by default
4951 except at level @option{-Os} where it is disabled.
4952
4953 @item -ftree-vrp
4954 Perform Value Range Propagation on trees.  This is similar to the
4955 constant propagation pass, but instead of values, ranges of values are
4956 propagated.  This allows the optimizers to remove unnecessary range
4957 checks like array bound checks and null pointer checks.  This is
4958 enabled by default at @option{-O2} and higher.  Null pointer check
4959 elimination is only done if @option{-fdelete-null-pointer-checks} is
4960 enabled.
4961
4962 @item -ftracer
4963 @opindex ftracer
4964 Perform tail duplication to enlarge superblock size.  This transformation
4965 simplifies the control flow of the function allowing other optimizations to do
4966 better job.
4967
4968 @item -funroll-loops
4969 @opindex funroll-loops
4970 Unroll loops whose number of iterations can be determined at compile
4971 time or upon entry to the loop.  @option{-funroll-loops} implies
4972 @option{-frerun-cse-after-loop}.  This option makes code larger,
4973 and may or may not make it run faster.
4974
4975 @item -funroll-all-loops
4976 @opindex funroll-all-loops
4977 Unroll all loops, even if their number of iterations is uncertain when
4978 the loop is entered.  This usually makes programs run more slowly.
4979 @option{-funroll-all-loops} implies the same options as
4980 @option{-funroll-loops},
4981
4982 @item -fsplit-ivs-in-unroller
4983 @opindex fsplit-ivs-in-unroller
4984 Enables expressing of values of induction variables in later iterations
4985 of the unrolled loop using the value in the first iteration.  This breaks
4986 long dependency chains, thus improving efficiency of the scheduling passes.
4987
4988 Combination of @option{-fweb} and CSE is often sufficient to obtain the
4989 same effect.  However in cases the loop body is more complicated than
4990 a single basic block, this is not reliable.  It also does not work at all
4991 on some of the architectures due to restrictions in the CSE pass.
4992
4993 This optimization is enabled by default.
4994
4995 @item -fvariable-expansion-in-unroller
4996 @opindex fvariable-expansion-in-unroller
4997 With this option, the compiler will create multiple copies of some
4998 local variables when unrolling a loop which can result in superior code.
4999
5000 @item -fprefetch-loop-arrays
5001 @opindex fprefetch-loop-arrays
5002 If supported by the target machine, generate instructions to prefetch
5003 memory to improve the performance of loops that access large arrays.
5004
5005 This option may generate better or worse code; results are highly
5006 dependent on the structure of loops within the source code.
5007
5008 Disabled at level @option{-Os}.
5009
5010 @item -fno-peephole
5011 @itemx -fno-peephole2
5012 @opindex fno-peephole
5013 @opindex fno-peephole2
5014 Disable any machine-specific peephole optimizations.  The difference
5015 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5016 are implemented in the compiler; some targets use one, some use the
5017 other, a few use both.
5018
5019 @option{-fpeephole} is enabled by default.
5020 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5021
5022 @item -fno-guess-branch-probability
5023 @opindex fno-guess-branch-probability
5024 Do not guess branch probabilities using heuristics.
5025
5026 GCC will use heuristics to guess branch probabilities if they are
5027 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5028 heuristics are based on the control flow graph.  If some branch probabilities
5029 are specified by @samp{__builtin_expect}, then the heuristics will be
5030 used to guess branch probabilities for the rest of the control flow graph,
5031 taking the @samp{__builtin_expect} info into account.  The interactions
5032 between the heuristics and @samp{__builtin_expect} can be complex, and in
5033 some cases, it may be useful to disable the heuristics so that the effects
5034 of @samp{__builtin_expect} are easier to understand.
5035
5036 The default is @option{-fguess-branch-probability} at levels
5037 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5038
5039 @item -freorder-blocks
5040 @opindex freorder-blocks
5041 Reorder basic blocks in the compiled function in order to reduce number of
5042 taken branches and improve code locality.
5043
5044 Enabled at levels @option{-O2}, @option{-O3}.
5045
5046 @item -freorder-blocks-and-partition
5047 @opindex freorder-blocks-and-partition
5048 In addition to reordering basic blocks in the compiled function, in order
5049 to reduce number of taken branches, partitions hot and cold basic blocks
5050 into separate sections of the assembly and .o files, to improve
5051 paging and cache locality performance.
5052
5053 This optimization is automatically turned off in the presence of
5054 exception handling, for linkonce sections, for functions with a user-defined
5055 section attribute and on any architecture that does not support named
5056 sections.
5057
5058 @item -freorder-functions
5059 @opindex freorder-functions
5060 Reorder functions in the object file in order to
5061 improve code locality.  This is implemented by using special
5062 subsections @code{.text.hot} for most frequently executed functions and
5063 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5064 the linker so object file format must support named sections and linker must
5065 place them in a reasonable way.
5066
5067 Also profile feedback must be available in to make this option effective.  See
5068 @option{-fprofile-arcs} for details.
5069
5070 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5071
5072 @item -fstrict-aliasing
5073 @opindex fstrict-aliasing
5074 Allows the compiler to assume the strictest aliasing rules applicable to
5075 the language being compiled.  For C (and C++), this activates
5076 optimizations based on the type of expressions.  In particular, an
5077 object of one type is assumed never to reside at the same address as an
5078 object of a different type, unless the types are almost the same.  For
5079 example, an @code{unsigned int} can alias an @code{int}, but not a
5080 @code{void*} or a @code{double}.  A character type may alias any other
5081 type.
5082
5083 Pay special attention to code like this:
5084 @smallexample
5085 union a_union @{
5086   int i;
5087   double d;
5088 @};
5089
5090 int f() @{
5091   a_union t;
5092   t.d = 3.0;
5093   return t.i;
5094 @}
5095 @end smallexample
5096 The practice of reading from a different union member than the one most
5097 recently written to (called ``type-punning'') is common.  Even with
5098 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5099 is accessed through the union type.  So, the code above will work as
5100 expected.  However, this code might not:
5101 @smallexample
5102 int f() @{
5103   a_union t;
5104   int* ip;
5105   t.d = 3.0;
5106   ip = &t.i;
5107   return *ip;
5108 @}
5109 @end smallexample
5110
5111 Every language that wishes to perform language-specific alias analysis
5112 should define a function that computes, given an @code{tree}
5113 node, an alias set for the node.  Nodes in different alias sets are not
5114 allowed to alias.  For an example, see the C front-end function
5115 @code{c_get_alias_set}.
5116
5117 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5118
5119 @item -fstrict-overflow
5120 @opindex fstrict-overflow
5121 Allow the compiler to assume strict signed overflow rules, depending
5122 on the language being compiled.  For C (and C++) this means that
5123 overflow when doing arithmetic with signed numbers is undefined, which
5124 means that the compiler may assume that it will not happen.  This
5125 permits various optimizations.  For example, the compiler will assume
5126 that an expression like @code{i + 10 > i} will always be true for
5127 signed @code{i}.  This assumption is only valid if signed overflow is
5128 undefined, as the expression is false if @code{i + 10} overflows when
5129 using twos complement arithmetic.  When this option is in effect any
5130 attempt to determine whether an operation on signed numbers will
5131 overflow must be written carefully to not actually involve overflow.
5132
5133 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5134 that signed overflow is fully defined: it wraps.  When
5135 @option{-fwrapv} is used, there is no difference between
5136 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5137 @option{-fwrapv} certain types of overflow are permitted.  For
5138 example, if the compiler gets an overflow when doing arithmetic on
5139 constants, the overflowed value can still be used with
5140 @option{-fwrapv}, but not otherwise.
5141
5142 The @option{-fstrict-overflow} option is enabled at levels
5143 @option{-O2}, @option{-O3}, @option{-Os}.
5144
5145 @item -falign-functions
5146 @itemx -falign-functions=@var{n}
5147 @opindex falign-functions
5148 Align the start of functions to the next power-of-two greater than
5149 @var{n}, skipping up to @var{n} bytes.  For instance,
5150 @option{-falign-functions=32} aligns functions to the next 32-byte
5151 boundary, but @option{-falign-functions=24} would align to the next
5152 32-byte boundary only if this can be done by skipping 23 bytes or less.
5153
5154 @option{-fno-align-functions} and @option{-falign-functions=1} are
5155 equivalent and mean that functions will not be aligned.
5156
5157 Some assemblers only support this flag when @var{n} is a power of two;
5158 in that case, it is rounded up.
5159
5160 If @var{n} is not specified or is zero, use a machine-dependent default.
5161
5162 Enabled at levels @option{-O2}, @option{-O3}.
5163
5164 @item -falign-labels
5165 @itemx -falign-labels=@var{n}
5166 @opindex falign-labels
5167 Align all branch targets to a power-of-two boundary, skipping up to
5168 @var{n} bytes like @option{-falign-functions}.  This option can easily
5169 make code slower, because it must insert dummy operations for when the
5170 branch target is reached in the usual flow of the code.
5171
5172 @option{-fno-align-labels} and @option{-falign-labels=1} are
5173 equivalent and mean that labels will not be aligned.
5174
5175 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5176 are greater than this value, then their values are used instead.
5177
5178 If @var{n} is not specified or is zero, use a machine-dependent default
5179 which is very likely to be @samp{1}, meaning no alignment.
5180
5181 Enabled at levels @option{-O2}, @option{-O3}.
5182
5183 @item -falign-loops
5184 @itemx -falign-loops=@var{n}
5185 @opindex falign-loops
5186 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5187 like @option{-falign-functions}.  The hope is that the loop will be
5188 executed many times, which will make up for any execution of the dummy
5189 operations.
5190
5191 @option{-fno-align-loops} and @option{-falign-loops=1} are
5192 equivalent and mean that loops will not be aligned.
5193
5194 If @var{n} is not specified or is zero, use a machine-dependent default.
5195
5196 Enabled at levels @option{-O2}, @option{-O3}.
5197
5198 @item -falign-jumps
5199 @itemx -falign-jumps=@var{n}
5200 @opindex falign-jumps
5201 Align branch targets to a power-of-two boundary, for branch targets
5202 where the targets can only be reached by jumping, skipping up to @var{n}
5203 bytes like @option{-falign-functions}.  In this case, no dummy operations
5204 need be executed.
5205
5206 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5207 equivalent and mean that loops will not be aligned.
5208
5209 If @var{n} is not specified or is zero, use a machine-dependent default.
5210
5211 Enabled at levels @option{-O2}, @option{-O3}.
5212
5213 @item -funit-at-a-time
5214 @opindex funit-at-a-time
5215 Parse the whole compilation unit before starting to produce code.
5216 This allows some extra optimizations to take place but consumes
5217 more memory (in general).  There are some compatibility issues
5218 with @emph{unit-at-a-time} mode:
5219 @itemize @bullet
5220 @item
5221 enabling @emph{unit-at-a-time} mode may change the order
5222 in which functions, variables, and top-level @code{asm} statements
5223 are emitted, and will likely break code relying on some particular
5224 ordering.  The majority of such top-level @code{asm} statements,
5225 though, can be replaced by @code{section} attributes.  The
5226 @option{fno-toplevel-reorder} option may be used to keep the ordering
5227 used in the input file, at the cost of some optimizations.
5228
5229 @item
5230 @emph{unit-at-a-time} mode removes unreferenced static variables
5231 and functions.  This may result in undefined references
5232 when an @code{asm} statement refers directly to variables or functions
5233 that are otherwise unused.  In that case either the variable/function
5234 shall be listed as an operand of the @code{asm} statement operand or,
5235 in the case of top-level @code{asm} statements the attribute @code{used}
5236 shall be used on the declaration.
5237
5238 @item
5239 Static functions now can use non-standard passing conventions that
5240 may break @code{asm} statements calling functions directly.  Again,
5241 attribute @code{used} will prevent this behavior.
5242 @end itemize
5243
5244 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5245 but this scheme may not be supported by future releases of GCC@.
5246
5247 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5248
5249 @item -fno-toplevel-reorder
5250 Do not reorder top-level functions, variables, and @code{asm}
5251 statements.  Output them in the same order that they appear in the
5252 input file.  When this option is used, unreferenced static variables
5253 will not be removed.  This option is intended to support existing code
5254 which relies on a particular ordering.  For new code, it is better to
5255 use attributes.
5256
5257 @item -fweb
5258 @opindex fweb
5259 Constructs webs as commonly used for register allocation purposes and assign
5260 each web individual pseudo register.  This allows the register allocation pass
5261 to operate on pseudos directly, but also strengthens several other optimization
5262 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5263 however, make debugging impossible, since variables will no longer stay in a
5264 ``home register''.
5265
5266 Enabled by default with @option{-funroll-loops}.
5267
5268 @item -fwhole-program
5269 @opindex fwhole-program
5270 Assume that the current compilation unit represents whole program being
5271 compiled.  All public functions and variables with the exception of @code{main}
5272 and those merged by attribute @code{externally_visible} become static functions
5273 and in a affect gets more aggressively optimized by interprocedural optimizers.
5274 While this option is equivalent to proper use of @code{static} keyword for
5275 programs consisting of single file, in combination with option
5276 @option{--combine} this flag can be used to compile most of smaller scale C
5277 programs since the functions and variables become local for the whole combined
5278 compilation unit, not for the single source file itself.
5279
5280
5281 @item -fno-cprop-registers
5282 @opindex fno-cprop-registers
5283 After register allocation and post-register allocation instruction splitting,
5284 we perform a copy-propagation pass to try to reduce scheduling dependencies
5285 and occasionally eliminate the copy.
5286
5287 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5288
5289 @item -fprofile-generate
5290 @opindex fprofile-generate
5291
5292 Enable options usually used for instrumenting application to produce
5293 profile useful for later recompilation with profile feedback based
5294 optimization.  You must use @option{-fprofile-generate} both when
5295 compiling and when linking your program.
5296
5297 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5298
5299 @item -fprofile-use
5300 @opindex fprofile-use
5301 Enable profile feedback directed optimizations, and optimizations
5302 generally profitable only with profile feedback available.
5303
5304 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5305 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
5306
5307 @end table
5308
5309 The following options control compiler behavior regarding floating
5310 point arithmetic.  These options trade off between speed and
5311 correctness.  All must be specifically enabled.
5312
5313 @table @gcctabopt
5314 @item -ffloat-store
5315 @opindex ffloat-store
5316 Do not store floating point variables in registers, and inhibit other
5317 options that might change whether a floating point value is taken from a
5318 register or memory.
5319
5320 @cindex floating point precision
5321 This option prevents undesirable excess precision on machines such as
5322 the 68000 where the floating registers (of the 68881) keep more
5323 precision than a @code{double} is supposed to have.  Similarly for the
5324 x86 architecture.  For most programs, the excess precision does only
5325 good, but a few programs rely on the precise definition of IEEE floating
5326 point.  Use @option{-ffloat-store} for such programs, after modifying
5327 them to store all pertinent intermediate computations into variables.
5328
5329 @item -ffast-math
5330 @opindex ffast-math
5331 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5332 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5333 @option{-fno-rounding-math}, @option{-fno-signaling-nans}
5334 and @option{fcx-limited-range}.
5335
5336 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5337
5338 This option should never be turned on by any @option{-O} option since
5339 it can result in incorrect output for programs which depend on
5340 an exact implementation of IEEE or ISO rules/specifications for
5341 math functions.
5342
5343 @item -fno-math-errno
5344 @opindex fno-math-errno
5345 Do not set ERRNO after calling math functions that are executed
5346 with a single instruction, e.g., sqrt.  A program that relies on
5347 IEEE exceptions for math error handling may want to use this flag
5348 for speed while maintaining IEEE arithmetic compatibility.
5349
5350 This option should never be turned on by any @option{-O} option since
5351 it can result in incorrect output for programs which depend on
5352 an exact implementation of IEEE or ISO rules/specifications for
5353 math functions.
5354
5355 The default is @option{-fmath-errno}.
5356
5357 On Darwin and FreeBSD systems, the math library never sets @code{errno}.
5358 There is therefore
5359 no reason for the compiler to consider the possibility that it might,
5360 and @option{-fno-math-errno} is the default.
5361
5362 @item -funsafe-math-optimizations
5363 @opindex funsafe-math-optimizations
5364 Allow optimizations for floating-point arithmetic that (a) assume
5365 that arguments and results are valid and (b) may violate IEEE or
5366 ANSI standards.  When used at link-time, it may include libraries
5367 or startup files that change the default FPU control word or other
5368 similar optimizations.
5369
5370 This option should never be turned on by any @option{-O} option since
5371 it can result in incorrect output for programs which depend on
5372 an exact implementation of IEEE or ISO rules/specifications for
5373 math functions.
5374
5375 The default is @option{-fno-unsafe-math-optimizations}.
5376
5377 @item -ffinite-math-only
5378 @opindex ffinite-math-only
5379 Allow optimizations for floating-point arithmetic that assume
5380 that arguments and results are not NaNs or +-Infs.
5381
5382 This option should never be turned on by any @option{-O} option since
5383 it can result in incorrect output for programs which depend on
5384 an exact implementation of IEEE or ISO rules/specifications.
5385
5386 The default is @option{-fno-finite-math-only}.
5387
5388 @item -fno-trapping-math
5389 @opindex fno-trapping-math
5390 Compile code assuming that floating-point operations cannot generate
5391 user-visible traps.  These traps include division by zero, overflow,
5392 underflow, inexact result and invalid operation.  This option implies
5393 @option{-fno-signaling-nans}.  Setting this option may allow faster
5394 code if one relies on ``non-stop'' IEEE arithmetic, for example.
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{-ftrapping-math}.
5402
5403 @item -frounding-math
5404 @opindex frounding-math
5405 Disable transformations and optimizations that assume default floating
5406 point rounding behavior.  This is round-to-zero for all floating point
5407 to integer conversions, and round-to-nearest for all other arithmetic
5408 truncations.  This option should be specified for programs that change
5409 the FP rounding mode dynamically, or that may be executed with a
5410 non-default rounding mode.  This option disables constant folding of
5411 floating point expressions at compile-time (which may be affected by
5412 rounding mode) and arithmetic transformations that are unsafe in the
5413 presence of sign-dependent rounding modes.
5414
5415 The default is @option{-fno-rounding-math}.
5416
5417 This option is experimental and does not currently guarantee to
5418 disable all GCC optimizations that are affected by rounding mode.
5419 Future versions of GCC may provide finer control of this setting
5420 using C99's @code{FENV_ACCESS} pragma.  This command line option
5421 will be used to specify the default state for @code{FENV_ACCESS}.
5422
5423 @item -frtl-abstract-sequences
5424 @opindex frtl-abstract-sequences
5425 It is a size optimization method. This option is to find identical
5426 sequences of code, which can be turned into pseudo-procedures  and
5427 then  replace  all  occurrences with  calls to  the  newly created
5428 subroutine. It is kind of an opposite of @option{-finline-functions}.
5429 This optimization runs at RTL level.
5430
5431 @item -fsignaling-nans
5432 @opindex fsignaling-nans
5433 Compile code assuming that IEEE signaling NaNs may generate user-visible
5434 traps during floating-point operations.  Setting this option disables
5435 optimizations that may change the number of exceptions visible with
5436 signaling NaNs.  This option implies @option{-ftrapping-math}.
5437
5438 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
5439 be defined.
5440
5441 The default is @option{-fno-signaling-nans}.
5442
5443 This option is experimental and does not currently guarantee to
5444 disable all GCC optimizations that affect signaling NaN behavior.
5445
5446 @item -fsingle-precision-constant
5447 @opindex fsingle-precision-constant
5448 Treat floating point constant as single precision constant instead of
5449 implicitly converting it to double precision constant.
5450
5451 @item -fcx-limited-range
5452 @itemx -fno-cx-limited-range
5453 @opindex fcx-limited-range
5454 @opindex fno-cx-limited-range
5455 When enabled, this option states that a range reduction step is not
5456 needed when performing complex division.  The default is
5457 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
5458
5459 This option controls the default setting of the ISO C99 
5460 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
5461 all languages.
5462
5463 @end table
5464
5465 The following options control optimizations that may improve
5466 performance, but are not enabled by any @option{-O} options.  This
5467 section includes experimental options that may produce broken code.
5468
5469 @table @gcctabopt
5470 @item -fbranch-probabilities
5471 @opindex fbranch-probabilities
5472 After running a program compiled with @option{-fprofile-arcs}
5473 (@pxref{Debugging Options,, Options for Debugging Your Program or
5474 @command{gcc}}), you can compile it a second time using
5475 @option{-fbranch-probabilities}, to improve optimizations based on
5476 the number of times each branch was taken.  When the program
5477 compiled with @option{-fprofile-arcs} exits it saves arc execution
5478 counts to a file called @file{@var{sourcename}.gcda} for each source
5479 file  The information in this data file is very dependent on the
5480 structure of the generated code, so you must use the same source code
5481 and the same optimization options for both compilations.
5482
5483 With @option{-fbranch-probabilities}, GCC puts a
5484 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
5485 These can be used to improve optimization.  Currently, they are only
5486 used in one place: in @file{reorg.c}, instead of guessing which path a
5487 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
5488 exactly determine which path is taken more often.
5489
5490 @item -fprofile-values
5491 @opindex fprofile-values
5492 If combined with @option{-fprofile-arcs}, it adds code so that some
5493 data about values of expressions in the program is gathered.
5494
5495 With @option{-fbranch-probabilities}, it reads back the data gathered
5496 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
5497 notes to instructions for their later usage in optimizations.
5498
5499 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
5500
5501 @item -fvpt
5502 @opindex fvpt
5503 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
5504 a code to gather information about values of expressions.
5505
5506 With @option{-fbranch-probabilities}, it reads back the data gathered
5507 and actually performs the optimizations based on them.
5508 Currently the optimizations include specialization of division operation
5509 using the knowledge about the value of the denominator.
5510
5511 @item -frename-registers
5512 @opindex frename-registers
5513 Attempt to avoid false dependencies in scheduled code by making use
5514 of registers left over after register allocation.  This optimization
5515 will most benefit processors with lots of registers.  Depending on the
5516 debug information format adopted by the target, however, it can
5517 make debugging impossible, since variables will no longer stay in
5518 a ``home register''.
5519
5520 Enabled by default with @option{-funroll-loops}.
5521
5522 @item -ftracer
5523 @opindex ftracer
5524 Perform tail duplication to enlarge superblock size.  This transformation
5525 simplifies the control flow of the function allowing other optimizations to do
5526 better job.
5527
5528 Enabled with @option{-fprofile-use}.
5529
5530 @item -funroll-loops
5531 @opindex funroll-loops
5532 Unroll loops whose number of iterations can be determined at compile time or
5533 upon entry to the loop.  @option{-funroll-loops} implies
5534 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}. 
5535 It also turns on complete loop peeling (i.e.@: complete removal of loops with
5536 small constant number of iterations).  This option makes code larger, and may
5537 or may not make it run faster.
5538
5539 Enabled with @option{-fprofile-use}.
5540
5541 @item -funroll-all-loops
5542 @opindex funroll-all-loops
5543 Unroll all loops, even if their number of iterations is uncertain when
5544 the loop is entered.  This usually makes programs run more slowly.
5545 @option{-funroll-all-loops} implies the same options as
5546 @option{-funroll-loops}.
5547
5548 @item -fpeel-loops
5549 @opindex fpeel-loops
5550 Peels the loops for that there is enough information that they do not
5551 roll much (from profile feedback).  It also turns on complete loop peeling
5552 (i.e.@: complete removal of loops with small constant number of iterations).
5553
5554 Enabled with @option{-fprofile-use}.
5555
5556 @item -fmove-loop-invariants
5557 @opindex fmove-loop-invariants
5558 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
5559 at level @option{-O1}
5560
5561 @item -funswitch-loops
5562 @opindex funswitch-loops
5563 Move branches with loop invariant conditions out of the loop, with duplicates
5564 of the loop on both branches (modified according to result of the condition).
5565
5566 @item -ffunction-sections
5567 @itemx -fdata-sections
5568 @opindex ffunction-sections
5569 @opindex fdata-sections
5570 Place each function or data item into its own section in the output
5571 file if the target supports arbitrary sections.  The name of the
5572 function or the name of the data item determines the section's name
5573 in the output file.
5574
5575 Use these options on systems where the linker can perform optimizations
5576 to improve locality of reference in the instruction space.  Most systems
5577 using the ELF object format and SPARC processors running Solaris 2 have
5578 linkers with such optimizations.  AIX may have these optimizations in
5579 the future.
5580
5581 Only use these options when there are significant benefits from doing
5582 so.  When you specify these options, the assembler and linker will
5583 create larger object and executable files and will also be slower.
5584 You will not be able to use @code{gprof} on all systems if you
5585 specify this option and you may have problems with debugging if
5586 you specify both this option and @option{-g}.
5587
5588 @item -fbranch-target-load-optimize
5589 @opindex fbranch-target-load-optimize
5590 Perform branch target register load optimization before prologue / epilogue
5591 threading.
5592 The use of target registers can typically be exposed only during reload,
5593 thus hoisting loads out of loops and doing inter-block scheduling needs
5594 a separate optimization pass.
5595
5596 @item -fbranch-target-load-optimize2
5597 @opindex fbranch-target-load-optimize2
5598 Perform branch target register load optimization after prologue / epilogue
5599 threading.
5600
5601 @item -fbtr-bb-exclusive
5602 @opindex fbtr-bb-exclusive
5603 When performing branch target register load optimization, don't reuse
5604 branch target registers in within any basic block.
5605
5606 @item -fstack-protector
5607 Emit extra code to check for buffer overflows, such as stack smashing
5608 attacks.  This is done by adding a guard variable to functions with
5609 vulnerable objects.  This includes functions that call alloca, and
5610 functions with buffers larger than 8 bytes.  The guards are initialized
5611 when a function is entered and then checked when the function exits.
5612 If a guard check fails, an error message is printed and the program exits.
5613
5614 @item -fstack-protector-all
5615 Like @option{-fstack-protector} except that all functions are protected.
5616
5617 @item -fsection-anchors
5618 @opindex fsection-anchors
5619 Try to reduce the number of symbolic address calculations by using
5620 shared ``anchor'' symbols to address nearby objects.  This transformation
5621 can help to reduce the number of GOT entries and GOT accesses on some
5622 targets.
5623
5624 For example, the implementation of the following function @code{foo}:
5625
5626 @smallexample
5627 static int a, b, c;
5628 int foo (void) @{ return a + b + c; @}
5629 @end smallexample
5630
5631 would usually calculate the addresses of all three variables, but if you
5632 compile it with @option{-fsection-anchors}, it will access the variables
5633 from a common anchor point instead.  The effect is similar to the
5634 following pseudocode (which isn't valid C):
5635
5636 @smallexample
5637 int foo (void)
5638 @{
5639   register int *xr = &x;
5640   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
5641 @}
5642 @end smallexample
5643
5644 Not all targets support this option.
5645
5646 @item --param @var{name}=@var{value}
5647 @opindex param
5648 In some places, GCC uses various constants to control the amount of
5649 optimization that is done.  For example, GCC will not inline functions
5650 that contain more that a certain number of instructions.  You can
5651 control some of these constants on the command-line using the
5652 @option{--param} option.
5653
5654 The names of specific parameters, and the meaning of the values, are
5655 tied to the internals of the compiler, and are subject to change
5656 without notice in future releases.
5657
5658 In each case, the @var{value} is an integer.  The allowable choices for
5659 @var{name} are given in the following table:
5660
5661 @table @gcctabopt
5662 @item salias-max-implicit-fields
5663 The maximum number of fields in a variable without direct
5664 structure accesses for which structure aliasing will consider trying 
5665 to track each field.  The default is 5
5666
5667 @item salias-max-array-elements
5668 The maximum number of elements an array can have and its elements
5669 still be tracked individually by structure aliasing. The default is 4
5670
5671 @item sra-max-structure-size
5672 The maximum structure size, in bytes, at which the scalar replacement
5673 of aggregates (SRA) optimization will perform block copies.  The
5674 default value, 0, implies that GCC will select the most appropriate
5675 size itself.
5676
5677 @item sra-field-structure-ratio
5678 The threshold ratio (as a percentage) between instantiated fields and
5679 the complete structure size.  We say that if the ratio of the number
5680 of bytes in instantiated fields to the number of bytes in the complete
5681 structure exceeds this parameter, then block copies are not used.  The
5682 default is 75.
5683
5684 @item max-crossjump-edges
5685 The maximum number of incoming edges to consider for crossjumping.
5686 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
5687 the number of edges incoming to each block.  Increasing values mean
5688 more aggressive optimization, making the compile time increase with
5689 probably small improvement in executable size.
5690
5691 @item min-crossjump-insns
5692 The minimum number of instructions which must be matched at the end
5693 of two blocks before crossjumping will be performed on them.  This
5694 value is ignored in the case where all instructions in the block being
5695 crossjumped from are matched.  The default value is 5.
5696
5697 @item max-grow-copy-bb-insns
5698 The maximum code size expansion factor when copying basic blocks
5699 instead of jumping.  The expansion is relative to a jump instruction.
5700 The default value is 8.
5701
5702 @item max-goto-duplication-insns
5703 The maximum number of instructions to duplicate to a block that jumps
5704 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
5705 passes, GCC factors computed gotos early in the compilation process,
5706 and unfactors them as late as possible.  Only computed jumps at the
5707 end of a basic blocks with no more than max-goto-duplication-insns are
5708 unfactored.  The default value is 8.
5709
5710 @item max-delay-slot-insn-search
5711 The maximum number of instructions to consider when looking for an
5712 instruction to fill a delay slot.  If more than this arbitrary number of
5713 instructions is searched, the time savings from filling the delay slot
5714 will be minimal so stop searching.  Increasing values mean more
5715 aggressive optimization, making the compile time increase with probably
5716 small improvement in executable run time.
5717
5718 @item max-delay-slot-live-search
5719 When trying to fill delay slots, the maximum number of instructions to
5720 consider when searching for a block with valid live register
5721 information.  Increasing this arbitrarily chosen value means more
5722 aggressive optimization, increasing the compile time.  This parameter
5723 should be removed when the delay slot code is rewritten to maintain the
5724 control-flow graph.
5725
5726 @item max-gcse-memory
5727 The approximate maximum amount of memory that will be allocated in
5728 order to perform the global common subexpression elimination
5729 optimization.  If more memory than specified is required, the
5730 optimization will not be done.
5731
5732 @item max-gcse-passes
5733 The maximum number of passes of GCSE to run.  The default is 1.
5734
5735 @item max-pending-list-length
5736 The maximum number of pending dependencies scheduling will allow
5737 before flushing the current state and starting over.  Large functions
5738 with few branches or calls can create excessively large lists which
5739 needlessly consume memory and resources.
5740
5741 @item max-inline-insns-single
5742 Several parameters control the tree inliner used in gcc.
5743 This number sets the maximum number of instructions (counted in GCC's
5744 internal representation) in a single function that the tree inliner
5745 will consider for inlining.  This only affects functions declared
5746 inline and methods implemented in a class declaration (C++).
5747 The default value is 450.
5748
5749 @item max-inline-insns-auto
5750 When you use @option{-finline-functions} (included in @option{-O3}),
5751 a lot of functions that would otherwise not be considered for inlining
5752 by the compiler will be investigated.  To those functions, a different
5753 (more restrictive) limit compared to functions declared inline can
5754 be applied.
5755 The default value is 90.
5756
5757 @item large-function-insns
5758 The limit specifying really large functions.  For functions larger than this
5759 limit after inlining inlining is constrained by
5760 @option{--param large-function-growth}.  This parameter is useful primarily
5761 to avoid extreme compilation time caused by non-linear algorithms used by the
5762 backend.
5763 This parameter is ignored when @option{-funit-at-a-time} is not used.
5764 The default value is 2700.
5765
5766 @item large-function-growth
5767 Specifies maximal growth of large function caused by inlining in percents.
5768 This parameter is ignored when @option{-funit-at-a-time} is not used.
5769 The default value is 100 which limits large function growth to 2.0 times
5770 the original size.
5771
5772 @item large-unit-insns
5773 The limit specifying large translation unit.  Growth caused by inlining of
5774 units larger than this limit is limited by @option{--param inline-unit-growth}.
5775 For small units this might be too tight (consider unit consisting of function A
5776 that is inline and B that just calls A three time.  If B is small relative to
5777 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
5778 large units consisting of small inlininable functions however the overall unit
5779 growth limit is needed to avoid exponential explosion of code size.  Thus for
5780 smaller units, the size is increased to @option{--param large-unit-insns}
5781 before applying @option{--param inline-unit-growth}.  The default is 10000
5782
5783 @item inline-unit-growth
5784 Specifies maximal overall growth of the compilation unit caused by inlining.
5785 This parameter is ignored when @option{-funit-at-a-time} is not used.
5786 The default value is 50 which limits unit growth to 1.5 times the original
5787 size.
5788
5789 @item max-inline-insns-recursive
5790 @itemx max-inline-insns-recursive-auto
5791 Specifies maximum number of instructions out-of-line copy of self recursive inline
5792 function can grow into by performing recursive inlining.
5793
5794 For functions declared inline @option{--param max-inline-insns-recursive} is
5795 taken into account.  For function not declared inline, recursive inlining
5796 happens only when @option{-finline-functions} (included in @option{-O3}) is
5797 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
5798 default value is 450.
5799
5800 @item max-inline-recursive-depth
5801 @itemx max-inline-recursive-depth-auto
5802 Specifies maximum recursion depth used by the recursive inlining.
5803
5804 For functions declared inline @option{--param max-inline-recursive-depth} is
5805 taken into account.  For function not declared inline, recursive inlining
5806 happens only when @option{-finline-functions} (included in @option{-O3}) is
5807 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
5808 default value is 450.
5809
5810 @item min-inline-recursive-probability
5811 Recursive inlining is profitable only for function having deep recursion
5812 in average and can hurt for function having little recursion depth by
5813 increasing the prologue size or complexity of function body to other
5814 optimizers.
5815
5816 When profile feedback is available (see @option{-fprofile-generate}) the actual
5817 recursion depth can be guessed from probability that function will recurse via
5818 given call expression.  This parameter limits inlining only to call expression
5819 whose probability exceeds given threshold (in percents).  The default value is
5820 10.
5821
5822 @item inline-call-cost
5823 Specify cost of call instruction relative to simple arithmetics operations
5824 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
5825 functions and at the same time increases size of leaf function that is believed to
5826 reduce function size by being inlined.  In effect it increases amount of
5827 inlining for code having large abstraction penalty (many functions that just
5828 pass the arguments to other functions) and decrease inlining for code with low
5829 abstraction penalty.  The default value is 16.
5830
5831 @item max-unrolled-insns
5832 The maximum number of instructions that a loop should have if that loop
5833 is unrolled, and if the loop is unrolled, it determines how many times
5834 the loop code is unrolled.
5835
5836 @item max-average-unrolled-insns
5837 The maximum number of instructions biased by probabilities of their execution
5838 that a loop should have if that loop is unrolled, and if the loop is unrolled,
5839 it determines how many times the loop code is unrolled.
5840
5841 @item max-unroll-times
5842 The maximum number of unrollings of a single loop.
5843
5844 @item max-peeled-insns
5845 The maximum number of instructions that a loop should have if that loop
5846 is peeled, and if the loop is peeled, it determines how many times
5847 the loop code is peeled.
5848
5849 @item max-peel-times
5850 The maximum number of peelings of a single loop.
5851
5852 @item max-completely-peeled-insns
5853 The maximum number of insns of a completely peeled loop.
5854
5855 @item max-completely-peel-times
5856 The maximum number of iterations of a loop to be suitable for complete peeling.
5857
5858 @item max-unswitch-insns
5859 The maximum number of insns of an unswitched loop.
5860
5861 @item max-unswitch-level
5862 The maximum number of branches unswitched in a single loop.
5863
5864 @item lim-expensive
5865 The minimum cost of an expensive expression in the loop invariant motion.
5866
5867 @item iv-consider-all-candidates-bound
5868 Bound on number of candidates for induction variables below that
5869 all candidates are considered for each use in induction variable
5870 optimizations.  Only the most relevant candidates are considered
5871 if there are more candidates, to avoid quadratic time complexity.
5872
5873 @item iv-max-considered-uses
5874 The induction variable optimizations give up on loops that contain more
5875 induction variable uses.
5876
5877 @item iv-always-prune-cand-set-bound
5878 If number of candidates in the set is smaller than this value,
5879 we always try to remove unnecessary ivs from the set during its
5880 optimization when a new iv is added to the set.
5881
5882 @item scev-max-expr-size
5883 Bound on size of expressions used in the scalar evolutions analyzer.
5884 Large expressions slow the analyzer.
5885
5886 @item vect-max-version-checks
5887 The maximum number of runtime checks that can be performed when doing
5888 loop versioning in the vectorizer.  See option ftree-vect-loop-version
5889 for more information.
5890
5891 @item max-iterations-to-track
5892
5893 The maximum number of iterations of a loop the brute force algorithm
5894 for analysis of # of iterations of the loop tries to evaluate.
5895
5896 @item hot-bb-count-fraction
5897 Select fraction of the maximal count of repetitions of basic block in program
5898 given basic block needs to have to be considered hot.
5899
5900 @item hot-bb-frequency-fraction
5901 Select fraction of the maximal frequency of executions of basic block in
5902 function given basic block needs to have to be considered hot
5903
5904 @item max-predicted-iterations
5905 The maximum number of loop iterations we predict statically.  This is useful
5906 in cases where function contain single loop with known bound and other loop
5907 with unknown.  We predict the known number of iterations correctly, while
5908 the unknown number of iterations average to roughly 10.  This means that the
5909 loop without bounds would appear artificially cold relative to the other one.
5910
5911 @item tracer-dynamic-coverage
5912 @itemx tracer-dynamic-coverage-feedback
5913
5914 This value is used to limit superblock formation once the given percentage of
5915 executed instructions is covered.  This limits unnecessary code size
5916 expansion.
5917
5918 The @option{tracer-dynamic-coverage-feedback} is used only when profile
5919 feedback is available.  The real profiles (as opposed to statically estimated
5920 ones) are much less balanced allowing the threshold to be larger value.
5921
5922 @item tracer-max-code-growth
5923 Stop tail duplication once code growth has reached given percentage.  This is
5924 rather hokey argument, as most of the duplicates will be eliminated later in
5925 cross jumping, so it may be set to much higher values than is the desired code
5926 growth.
5927
5928 @item tracer-min-branch-ratio
5929
5930 Stop reverse growth when the reverse probability of best edge is less than this
5931 threshold (in percent).
5932
5933 @item tracer-min-branch-ratio
5934 @itemx tracer-min-branch-ratio-feedback
5935
5936 Stop forward growth if the best edge do have probability lower than this
5937 threshold.
5938
5939 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
5940 compilation for profile feedback and one for compilation without.  The value
5941 for compilation with profile feedback needs to be more conservative (higher) in
5942 order to make tracer effective.
5943
5944 @item max-cse-path-length
5945
5946 Maximum number of basic blocks on path that cse considers.  The default is 10.
5947
5948 @item max-cse-insns
5949 The maximum instructions CSE process before flushing. The default is 1000.
5950
5951 @item global-var-threshold
5952
5953 Counts the number of function calls (@var{n}) and the number of
5954 call-clobbered variables (@var{v}).  If @var{n}x@var{v} is larger than this limit, a
5955 single artificial variable will be created to represent all the
5956 call-clobbered variables at function call sites.  This artificial
5957 variable will then be made to alias every call-clobbered variable.
5958 (done as @code{int * size_t} on the host machine; beware overflow).
5959
5960 @item max-aliased-vops
5961
5962 Maximum number of virtual operands allowed to represent aliases
5963 before triggering the alias grouping heuristic.  Alias grouping
5964 reduces compile times and memory consumption needed for aliasing at
5965 the expense of precision loss in alias information.
5966
5967 @item ggc-min-expand
5968
5969 GCC uses a garbage collector to manage its own memory allocation.  This
5970 parameter specifies the minimum percentage by which the garbage
5971 collector's heap should be allowed to expand between collections.
5972 Tuning this may improve compilation speed; it has no effect on code
5973 generation.
5974
5975 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
5976 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
5977 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
5978 GCC is not able to calculate RAM on a particular platform, the lower
5979 bound of 30% is used.  Setting this parameter and
5980 @option{ggc-min-heapsize} to zero causes a full collection to occur at
5981 every opportunity.  This is extremely slow, but can be useful for
5982 debugging.
5983
5984 @item ggc-min-heapsize
5985
5986 Minimum size of the garbage collector's heap before it begins bothering
5987 to collect garbage.  The first collection occurs after the heap expands
5988 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
5989 tuning this may improve compilation speed, and has no effect on code
5990 generation.
5991
5992 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
5993 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
5994 with a lower bound of 4096 (four megabytes) and an upper bound of
5995 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
5996 particular platform, the lower bound is used.  Setting this parameter
5997 very large effectively disables garbage collection.  Setting this
5998 parameter and @option{ggc-min-expand} to zero causes a full collection
5999 to occur at every opportunity.
6000
6001 @item max-reload-search-insns
6002 The maximum number of instruction reload should look backward for equivalent
6003 register.  Increasing values mean more aggressive optimization, making the
6004 compile time increase with probably slightly better performance.  The default
6005 value is 100.
6006
6007 @item max-cselib-memory-locations
6008 The maximum number of memory locations cselib should take into account.
6009 Increasing values mean more aggressive optimization, making the compile time
6010 increase with probably slightly better performance.  The default value is 500.
6011
6012 @item max-flow-memory-locations
6013 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6014 The default value is 100.
6015
6016 @item reorder-blocks-duplicate
6017 @itemx reorder-blocks-duplicate-feedback
6018
6019 Used by basic block reordering pass to decide whether to use unconditional
6020 branch or duplicate the code on its destination.  Code is duplicated when its
6021 estimated size is smaller than this value multiplied by the estimated size of
6022 unconditional jump in the hot spots of the program.
6023
6024 The @option{reorder-block-duplicate-feedback} is used only when profile
6025 feedback is available and may be set to higher values than
6026 @option{reorder-block-duplicate} since information about the hot spots is more
6027 accurate.
6028
6029 @item max-sched-ready-insns
6030 The maximum number of instructions ready to be issued the scheduler should
6031 consider at any given time during the first scheduling pass.  Increasing
6032 values mean more thorough searches, making the compilation time increase
6033 with probably little benefit.  The default value is 100.
6034
6035 @item max-sched-region-blocks
6036 The maximum number of blocks in a region to be considered for
6037 interblock scheduling.  The default value is 10.
6038
6039 @item max-sched-region-insns
6040 The maximum number of insns in a region to be considered for
6041 interblock scheduling.  The default value is 100.
6042
6043 @item min-spec-prob
6044 The minimum probability (in percents) of reaching a source block
6045 for interblock speculative scheduling.  The default value is 40.
6046
6047 @item max-sched-extend-regions-iters
6048 The maximum number of iterations through CFG to extend regions.
6049 0 - disable region extension,
6050 N - do at most N iterations.
6051 The default value is 0.
6052
6053 @item max-sched-insn-conflict-delay
6054 The maximum conflict delay for an insn to be considered for speculative motion.
6055 The default value is 3.
6056
6057 @item sched-spec-prob-cutoff
6058 The minimal probability of speculation success (in percents), so that
6059 speculative insn will be scheduled.
6060 The default value is 40.
6061
6062 @item max-last-value-rtl
6063
6064 The maximum size measured as number of RTLs that can be recorded in an expression
6065 in combiner for a pseudo register as last known value of that register.  The default
6066 is 10000.
6067
6068 @item integer-share-limit
6069 Small integer constants can use a shared data structure, reducing the
6070 compiler's memory usage and increasing its speed.  This sets the maximum
6071 value of a shared integer constant's.  The default value is 256.
6072
6073 @item min-virtual-mappings
6074 Specifies the minimum number of virtual mappings in the incremental
6075 SSA updater that should be registered to trigger the virtual mappings
6076 heuristic defined by virtual-mappings-ratio.  The default value is
6077 100.
6078
6079 @item virtual-mappings-ratio
6080 If the number of virtual mappings is virtual-mappings-ratio bigger
6081 than the number of virtual symbols to be updated, then the incremental
6082 SSA updater switches to a full update for those symbols.  The default
6083 ratio is 3.
6084
6085 @item ssp-buffer-size
6086 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6087 protection when @option{-fstack-protection} is used.
6088
6089 @item max-jump-thread-duplication-stmts
6090 Maximum number of statements allowed in a block that needs to be
6091 duplicated when threading jumps.
6092
6093 @item max-fields-for-field-sensitive
6094 Maximum number of fields in a structure we will treat in
6095 a field sensitive manner during pointer analysis.
6096
6097 @end table
6098 @end table
6099
6100 @node Preprocessor Options
6101 @section Options Controlling the Preprocessor
6102 @cindex preprocessor options
6103 @cindex options, preprocessor
6104
6105 These options control the C preprocessor, which is run on each C source
6106 file before actual compilation.
6107
6108 If you use the @option{-E} option, nothing is done except preprocessing.
6109 Some of these options make sense only together with @option{-E} because
6110 they cause the preprocessor output to be unsuitable for actual
6111 compilation.
6112
6113 @table @gcctabopt
6114 @opindex Wp
6115 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6116 and pass @var{option} directly through to the preprocessor.  If
6117 @var{option} contains commas, it is split into multiple options at the
6118 commas.  However, many options are modified, translated or interpreted
6119 by the compiler driver before being passed to the preprocessor, and
6120 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6121 interface is undocumented and subject to change, so whenever possible
6122 you should avoid using @option{-Wp} and let the driver handle the
6123 options instead.
6124
6125 @item -Xpreprocessor @var{option}
6126 @opindex preprocessor
6127 Pass @var{option} as an option to the preprocessor.  You can use this to
6128 supply system-specific preprocessor options which GCC does not know how to
6129 recognize.
6130
6131 If you want to pass an option that takes an argument, you must use
6132 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6133 @end table
6134
6135 @include cppopts.texi
6136
6137 @node Assembler Options
6138 @section Passing Options to the Assembler
6139
6140 @c prevent bad page break with this line
6141 You can pass options to the assembler.
6142
6143 @table @gcctabopt
6144 @item -Wa,@var{option}
6145 @opindex Wa
6146 Pass @var{option} as an option to the assembler.  If @var{option}
6147 contains commas, it is split into multiple options at the commas.
6148
6149 @item -Xassembler @var{option}
6150 @opindex Xassembler
6151 Pass @var{option} as an option to the assembler.  You can use this to
6152 supply system-specific assembler options which GCC does not know how to
6153 recognize.
6154
6155 If you want to pass an option that takes an argument, you must use
6156 @option{-Xassembler} twice, once for the option and once for the argument.
6157
6158 @end table
6159
6160 @node Link Options
6161 @section Options for Linking
6162 @cindex link options
6163 @cindex options, linking
6164
6165 These options come into play when the compiler links object files into
6166 an executable output file.  They are meaningless if the compiler is
6167 not doing a link step.
6168
6169 @table @gcctabopt
6170 @cindex file names
6171 @item @var{object-file-name}
6172 A file name that does not end in a special recognized suffix is
6173 considered to name an object file or library.  (Object files are
6174 distinguished from libraries by the linker according to the file
6175 contents.)  If linking is done, these object files are used as input
6176 to the linker.
6177
6178 @item -c
6179 @itemx -S
6180 @itemx -E
6181 @opindex c
6182 @opindex S
6183 @opindex E
6184 If any of these options is used, then the linker is not run, and
6185 object file names should not be used as arguments.  @xref{Overall
6186 Options}.
6187
6188 @cindex Libraries
6189 @item -l@var{library}
6190 @itemx -l @var{library}
6191 @opindex l
6192 Search the library named @var{library} when linking.  (The second
6193 alternative with the library as a separate argument is only for
6194 POSIX compliance and is not recommended.)
6195
6196 It makes a difference where in the command you write this option; the
6197 linker searches and processes libraries and object files in the order they
6198 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6199 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6200 to functions in @samp{z}, those functions may not be loaded.
6201
6202 The linker searches a standard list of directories for the library,
6203 which is actually a file named @file{lib@var{library}.a}.  The linker
6204 then uses this file as if it had been specified precisely by name.
6205
6206 The directories searched include several standard system directories
6207 plus any that you specify with @option{-L}.
6208
6209 Normally the files found this way are library files---archive files
6210 whose members are object files.  The linker handles an archive file by
6211 scanning through it for members which define symbols that have so far
6212 been referenced but not defined.  But if the file that is found is an
6213 ordinary object file, it is linked in the usual fashion.  The only
6214 difference between using an @option{-l} option and specifying a file name
6215 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6216 and searches several directories.
6217
6218 @item -nostartfiles
6219 @opindex nostartfiles
6220 Do not use the standard system startup files when linking.
6221 The standard system libraries are used normally, unless @option{-nostdlib}
6222 or @option{-nodefaultlibs} is used.
6223
6224 @item -nodefaultlibs
6225 @opindex nodefaultlibs
6226 Do not use the standard system libraries when linking.
6227 Only the libraries you specify will be passed to the linker.
6228 The standard startup files are used normally, unless @option{-nostartfiles}
6229 is used.  The compiler may generate calls to @code{memcmp},
6230 @code{memset}, @code{memcpy} and @code{memmove}.
6231 These entries are usually resolved by entries in
6232 libc.  These entry points should be supplied through some other
6233 mechanism when this option is specified.
6234
6235 @item -nostdlib
6236 @opindex nostdlib
6237 Do not use the standard system startup files or libraries when linking.
6238 No startup files and only the libraries you specify will be passed to
6239 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6240 @code{memcpy} and @code{memmove}.
6241 These entries are usually resolved by entries in
6242 libc.  These entry points should be supplied through some other
6243 mechanism when this option is specified.
6244
6245 @cindex @option{-lgcc}, use with @option{-nostdlib}
6246 @cindex @option{-nostdlib} and unresolved references
6247 @cindex unresolved references and @option{-nostdlib}
6248 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6249 @cindex @option{-nodefaultlibs} and unresolved references
6250 @cindex unresolved references and @option{-nodefaultlibs}
6251 One of the standard libraries bypassed by @option{-nostdlib} and
6252 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6253 that GCC uses to overcome shortcomings of particular machines, or special
6254 needs for some languages.
6255 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6256 Collection (GCC) Internals},
6257 for more discussion of @file{libgcc.a}.)
6258 In most cases, you need @file{libgcc.a} even when you want to avoid
6259 other standard libraries.  In other words, when you specify @option{-nostdlib}
6260 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6261 This ensures that you have no unresolved references to internal GCC
6262 library subroutines.  (For example, @samp{__main}, used to ensure C++
6263 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6264 GNU Compiler Collection (GCC) Internals}.)
6265
6266 @item -pie
6267 @opindex pie
6268 Produce a position independent executable on targets which support it.
6269 For predictable results, you must also specify the same set of options
6270 that were used to generate code (@option{-fpie}, @option{-fPIE},
6271 or model suboptions) when you specify this option.
6272
6273 @item -rdynamic
6274 @opindex rdynamic
6275 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6276 that support it. This instructs the linker to add all symbols, not
6277 only used ones, to the dynamic symbol table. This option is needed
6278 for some uses of @code{dlopen} or to allow obtaining backtraces
6279 from within a program.
6280
6281 @item -s
6282 @opindex s
6283 Remove all symbol table and relocation information from the executable.
6284
6285 @item -static
6286 @opindex static
6287 On systems that support dynamic linking, this prevents linking with the shared
6288 libraries.  On other systems, this option has no effect.
6289
6290 @item -shared
6291 @opindex shared
6292 Produce a shared object which can then be linked with other objects to
6293 form an executable.  Not all systems support this option.  For predictable
6294 results, you must also specify the same set of options that were used to
6295 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6296 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6297 needs to build supplementary stub code for constructors to work.  On
6298 multi-libbed systems, @samp{gcc -shared} must select the correct support
6299 libraries to link against.  Failing to supply the correct flags may lead
6300 to subtle defects.  Supplying them in cases where they are not necessary
6301 is innocuous.}
6302
6303 @item -shared-libgcc
6304 @itemx -static-libgcc
6305 @opindex shared-libgcc
6306 @opindex static-libgcc
6307 On systems that provide @file{libgcc} as a shared library, these options
6308 force the use of either the shared or static version respectively.
6309 If no shared version of @file{libgcc} was built when the compiler was
6310 configured, these options have no effect.
6311
6312 There are several situations in which an application should use the
6313 shared @file{libgcc} instead of the static version.  The most common
6314 of these is when the application wishes to throw and catch exceptions
6315 across different shared libraries.  In that case, each of the libraries
6316 as well as the application itself should use the shared @file{libgcc}.
6317
6318 Therefore, the G++ and GCJ drivers automatically add
6319 @option{-shared-libgcc} whenever you build a shared library or a main
6320 executable, because C++ and Java programs typically use exceptions, so
6321 this is the right thing to do.
6322
6323 If, instead, you use the GCC driver to create shared libraries, you may
6324 find that they will not always be linked with the shared @file{libgcc}.
6325 If GCC finds, at its configuration time, that you have a non-GNU linker
6326 or a GNU linker that does not support option @option{--eh-frame-hdr},
6327 it will link the shared version of @file{libgcc} into shared libraries
6328 by default.  Otherwise, it will take advantage of the linker and optimize
6329 away the linking with the shared version of @file{libgcc}, linking with
6330 the static version of libgcc by default.  This allows exceptions to
6331 propagate through such shared libraries, without incurring relocation
6332 costs at library load time.
6333
6334 However, if a library or main executable is supposed to throw or catch
6335 exceptions, you must link it using the G++ or GCJ driver, as appropriate
6336 for the languages used in the program, or using the option
6337 @option{-shared-libgcc}, such that it is linked with the shared
6338 @file{libgcc}.
6339
6340 @item -symbolic
6341 @opindex symbolic
6342 Bind references to global symbols when building a shared object.  Warn
6343 about any unresolved references (unless overridden by the link editor
6344 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
6345 this option.
6346
6347 @item -Xlinker @var{option}
6348 @opindex Xlinker
6349 Pass @var{option} as an option to the linker.  You can use this to
6350 supply system-specific linker options which GCC does not know how to
6351 recognize.
6352
6353 If you want to pass an option that takes an argument, you must use
6354 @option{-Xlinker} twice, once for the option and once for the argument.
6355 For example, to pass @option{-assert definitions}, you must write
6356 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
6357 @option{-Xlinker "-assert definitions"}, because this passes the entire
6358 string as a single argument, which is not what the linker expects.
6359
6360 @item -Wl,@var{option}
6361 @opindex Wl
6362 Pass @var{option} as an option to the linker.  If @var{option} contains
6363 commas, it is split into multiple options at the commas.
6364
6365 @item -u @var{symbol}
6366 @opindex u
6367 Pretend the symbol @var{symbol} is undefined, to force linking of
6368 library modules to define it.  You can use @option{-u} multiple times with
6369 different symbols to force loading of additional library modules.
6370 @end table
6371
6372 @node Directory Options
6373 @section Options for Directory Search
6374 @cindex directory options
6375 @cindex options, directory search
6376 @cindex search path
6377
6378 These options specify directories to search for header files, for
6379 libraries and for parts of the compiler:
6380
6381 @table @gcctabopt
6382 @item -I@var{dir}
6383 @opindex I
6384 Add the directory @var{dir} to the head of the list of directories to be
6385 searched for header files.  This can be used to override a system header
6386 file, substituting your own version, since these directories are
6387 searched before the system header file directories.  However, you should
6388 not use this option to add directories that contain vendor-supplied
6389 system header files (use @option{-isystem} for that).  If you use more than
6390 one @option{-I} option, the directories are scanned in left-to-right
6391 order; the standard system directories come after.
6392
6393 If a standard system include directory, or a directory specified with
6394 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
6395 option will be ignored.  The directory will still be searched but as a
6396 system directory at its normal position in the system include chain.
6397 This is to ensure that GCC's procedure to fix buggy system headers and
6398 the ordering for the include_next directive are not inadvertently changed.
6399 If you really need to change the search order for system directories,
6400 use the @option{-nostdinc} and/or @option{-isystem} options.
6401
6402 @item -iquote@var{dir}
6403 @opindex iquote
6404 Add the directory @var{dir} to the head of the list of directories to
6405 be searched for header files only for the case of @samp{#include
6406 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
6407 otherwise just like @option{-I}.
6408
6409 @item -L@var{dir}
6410 @opindex L
6411 Add directory @var{dir} to the list of directories to be searched
6412 for @option{-l}.
6413
6414 @item -B@var{prefix}
6415 @opindex B
6416 This option specifies where to find the executables, libraries,
6417 include files, and data files of the compiler itself.
6418
6419 The compiler driver program runs one or more of the subprograms
6420 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
6421 @var{prefix} as a prefix for each program it tries to run, both with and
6422 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
6423
6424 For each subprogram to be run, the compiler driver first tries the
6425 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
6426 was not specified, the driver tries two standard prefixes, which are
6427 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
6428 those results in a file name that is found, the unmodified program
6429 name is searched for using the directories specified in your
6430 @env{PATH} environment variable.
6431
6432 The compiler will check to see if the path provided by the @option{-B}
6433 refers to a directory, and if necessary it will add a directory
6434 separator character at the end of the path.
6435
6436 @option{-B} prefixes that effectively specify directory names also apply
6437 to libraries in the linker, because the compiler translates these
6438 options into @option{-L} options for the linker.  They also apply to
6439 includes files in the preprocessor, because the compiler translates these
6440 options into @option{-isystem} options for the preprocessor.  In this case,
6441 the compiler appends @samp{include} to the prefix.
6442
6443 The run-time support file @file{libgcc.a} can also be searched for using
6444 the @option{-B} prefix, if needed.  If it is not found there, the two
6445 standard prefixes above are tried, and that is all.  The file is left
6446 out of the link if it is not found by those means.
6447
6448 Another way to specify a prefix much like the @option{-B} prefix is to use
6449 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
6450 Variables}.
6451
6452 As a special kludge, if the path provided by @option{-B} is
6453 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
6454 9, then it will be replaced by @file{[dir/]include}.  This is to help
6455 with boot-strapping the compiler.
6456
6457 @item -specs=@var{file}
6458 @opindex specs
6459 Process @var{file} after the compiler reads in the standard @file{specs}
6460 file, in order to override the defaults that the @file{gcc} driver
6461 program uses when determining what switches to pass to @file{cc1},
6462 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
6463 @option{-specs=@var{file}} can be specified on the command line, and they
6464 are processed in order, from left to right.
6465
6466 @item --sysroot=@var{dir}
6467 @opindex sysroot
6468 Use @var{dir} as the logical root directory for headers and libraries.
6469 For example, if the compiler would normally search for headers in
6470 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
6471 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.  
6472
6473 If you use both this option and the @option{-isysroot} option, then
6474 the @option{--sysroot} option will apply to libraries, but the
6475 @option{-isysroot} option will apply to header files.
6476
6477 The GNU linker (beginning with version 2.16) has the necessary support
6478 for this option.  If your linker does not support this option, the
6479 header file aspect of @option{--sysroot} will still work, but the
6480 library aspect will not.
6481
6482 @item -I-
6483 @opindex I-
6484 This option has been deprecated.  Please use @option{-iquote} instead for
6485 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
6486 Any directories you specify with @option{-I} options before the @option{-I-}
6487 option are searched only for the case of @samp{#include "@var{file}"};
6488 they are not searched for @samp{#include <@var{file}>}.
6489
6490 If additional directories are specified with @option{-I} options after
6491 the @option{-I-}, these directories are searched for all @samp{#include}
6492 directives.  (Ordinarily @emph{all} @option{-I} directories are used
6493 this way.)
6494
6495 In addition, the @option{-I-} option inhibits the use of the current
6496 directory (where the current input file came from) as the first search
6497 directory for @samp{#include "@var{file}"}.  There is no way to
6498 override this effect of @option{-I-}.  With @option{-I.} you can specify
6499 searching the directory which was current when the compiler was
6500 invoked.  That is not exactly the same as what the preprocessor does
6501 by default, but it is often satisfactory.
6502
6503 @option{-I-} does not inhibit the use of the standard system directories
6504 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
6505 independent.
6506 @end table
6507
6508 @c man end
6509
6510 @node Spec Files
6511 @section Specifying subprocesses and the switches to pass to them
6512 @cindex Spec Files
6513
6514 @command{gcc} is a driver program.  It performs its job by invoking a
6515 sequence of other programs to do the work of compiling, assembling and
6516 linking.  GCC interprets its command-line parameters and uses these to
6517 deduce which programs it should invoke, and which command-line options
6518 it ought to place on their command lines.  This behavior is controlled
6519 by @dfn{spec strings}.  In most cases there is one spec string for each
6520 program that GCC can invoke, but a few programs have multiple spec
6521 strings to control their behavior.  The spec strings built into GCC can
6522 be overridden by using the @option{-specs=} command-line switch to specify
6523 a spec file.
6524
6525 @dfn{Spec files} are plaintext files that are used to construct spec
6526 strings.  They consist of a sequence of directives separated by blank
6527 lines.  The type of directive is determined by the first non-whitespace
6528 character on the line and it can be one of the following:
6529
6530 @table @code
6531 @item %@var{command}
6532 Issues a @var{command} to the spec file processor.  The commands that can
6533 appear here are:
6534
6535 @table @code
6536 @item %include <@var{file}>
6537 @cindex %include
6538 Search for @var{file} and insert its text at the current point in the
6539 specs file.
6540
6541 @item %include_noerr <@var{file}>
6542 @cindex %include_noerr
6543 Just like @samp{%include}, but do not generate an error message if the include
6544 file cannot be found.
6545
6546 @item %rename @var{old_name} @var{new_name}
6547 @cindex %rename
6548 Rename the spec string @var{old_name} to @var{new_name}.
6549
6550 @end table
6551
6552 @item *[@var{spec_name}]:
6553 This tells the compiler to create, override or delete the named spec
6554 string.  All lines after this directive up to the next directive or
6555 blank line are considered to be the text for the spec string.  If this
6556 results in an empty string then the spec will be deleted.  (Or, if the
6557 spec did not exist, then nothing will happened.)  Otherwise, if the spec
6558 does not currently exist a new spec will be created.  If the spec does
6559 exist then its contents will be overridden by the text of this
6560 directive, unless the first character of that text is the @samp{+}
6561 character, in which case the text will be appended to the spec.
6562
6563 @item [@var{suffix}]:
6564 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
6565 and up to the next directive or blank line are considered to make up the
6566 spec string for the indicated suffix.  When the compiler encounters an
6567 input file with the named suffix, it will processes the spec string in
6568 order to work out how to compile that file.  For example:
6569
6570 @smallexample
6571 .ZZ:
6572 z-compile -input %i
6573 @end smallexample
6574
6575 This says that any input file whose name ends in @samp{.ZZ} should be
6576 passed to the program @samp{z-compile}, which should be invoked with the
6577 command-line switch @option{-input} and with the result of performing the
6578 @samp{%i} substitution.  (See below.)
6579
6580 As an alternative to providing a spec string, the text that follows a
6581 suffix directive can be one of the following:
6582
6583 @table @code
6584 @item @@@var{language}
6585 This says that the suffix is an alias for a known @var{language}.  This is
6586 similar to using the @option{-x} command-line switch to GCC to specify a
6587 language explicitly.  For example:
6588
6589 @smallexample
6590 .ZZ:
6591 @@c++
6592 @end smallexample
6593
6594 Says that .ZZ files are, in fact, C++ source files.
6595
6596 @item #@var{name}
6597 This causes an error messages saying:
6598
6599 @smallexample
6600 @var{name} compiler not installed on this system.
6601 @end smallexample
6602 @end table
6603
6604 GCC already has an extensive list of suffixes built into it.
6605 This directive will add an entry to the end of the list of suffixes, but
6606 since the list is searched from the end backwards, it is effectively
6607 possible to override earlier entries using this technique.
6608
6609 @end table
6610
6611 GCC has the following spec strings built into it.  Spec files can
6612 override these strings or create their own.  Note that individual
6613 targets can also add their own spec strings to this list.
6614
6615 @smallexample
6616 asm          Options to pass to the assembler
6617 asm_final    Options to pass to the assembler post-processor
6618 cpp          Options to pass to the C preprocessor
6619 cc1          Options to pass to the C compiler
6620 cc1plus      Options to pass to the C++ compiler
6621 endfile      Object files to include at the end of the link
6622 link         Options to pass to the linker
6623 lib          Libraries to include on the command line to the linker
6624 libgcc       Decides which GCC support library to pass to the linker
6625 linker       Sets the name of the linker
6626 predefines   Defines to be passed to the C preprocessor
6627 signed_char  Defines to pass to CPP to say whether @code{char} is signed
6628              by default
6629 startfile    Object files to include at the start of the link
6630 @end smallexample
6631
6632 Here is a small example of a spec file:
6633
6634 @smallexample
6635 %rename lib                 old_lib
6636
6637 *lib:
6638 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
6639 @end smallexample
6640
6641 This example renames the spec called @samp{lib} to @samp{old_lib} and
6642 then overrides the previous definition of @samp{lib} with a new one.
6643 The new definition adds in some extra command-line options before
6644 including the text of the old definition.
6645
6646 @dfn{Spec strings} are a list of command-line options to be passed to their
6647 corresponding program.  In addition, the spec strings can contain
6648 @samp{%}-prefixed sequences to substitute variable text or to
6649 conditionally insert text into the command line.  Using these constructs
6650 it is possible to generate quite complex command lines.
6651
6652 Here is a table of all defined @samp{%}-sequences for spec
6653 strings.  Note that spaces are not generated automatically around the
6654 results of expanding these sequences.  Therefore you can concatenate them
6655 together or combine them with constant text in a single argument.
6656
6657 @table @code
6658 @item %%
6659 Substitute one @samp{%} into the program name or argument.
6660
6661 @item %i
6662 Substitute the name of the input file being processed.
6663
6664 @item %b
6665 Substitute the basename of the input file being processed.
6666 This is the substring up to (and not including) the last period
6667 and not including the directory.
6668
6669 @item %B
6670 This is the same as @samp{%b}, but include the file suffix (text after
6671 the last period).
6672
6673 @item %d
6674 Marks the argument containing or following the @samp{%d} as a
6675 temporary file name, so that that file will be deleted if GCC exits
6676 successfully.  Unlike @samp{%g}, this contributes no text to the
6677 argument.
6678
6679 @item %g@var{suffix}
6680 Substitute a file name that has suffix @var{suffix} and is chosen
6681 once per compilation, and mark the argument in the same way as
6682 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
6683 name is now chosen in a way that is hard to predict even when previously
6684 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
6685 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
6686 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
6687 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
6688 was simply substituted with a file name chosen once per compilation,
6689 without regard to any appended suffix (which was therefore treated
6690 just like ordinary text), making such attacks more likely to succeed.
6691
6692 @item %u@var{suffix}
6693 Like @samp{%g}, but generates a new temporary file name even if
6694 @samp{%u@var{suffix}} was already seen.
6695
6696 @item %U@var{suffix}
6697 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
6698 new one if there is no such last file name.  In the absence of any
6699 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
6700 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
6701 would involve the generation of two distinct file names, one
6702 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
6703 simply substituted with a file name chosen for the previous @samp{%u},
6704 without regard to any appended suffix.
6705
6706 @item %j@var{suffix}
6707 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
6708 writable, and if save-temps is off; otherwise, substitute the name
6709 of a temporary file, just like @samp{%u}.  This temporary file is not
6710 meant for communication between processes, but rather as a junk
6711 disposal mechanism.
6712
6713 @item %|@var{suffix}
6714 @itemx %m@var{suffix}
6715 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
6716 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
6717 all.  These are the two most common ways to instruct a program that it
6718 should read from standard input or write to standard output.  If you
6719 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
6720 construct: see for example @file{f/lang-specs.h}.
6721
6722 @item %.@var{SUFFIX}
6723 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
6724 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
6725 terminated by the next space or %.
6726
6727 @item %w
6728 Marks the argument containing or following the @samp{%w} as the
6729 designated output file of this compilation.  This puts the argument
6730 into the sequence of arguments that @samp{%o} will substitute later.
6731
6732 @item %o
6733 Substitutes the names of all the output files, with spaces
6734 automatically placed around them.  You should write spaces
6735 around the @samp{%o} as well or the results are undefined.
6736 @samp{%o} is for use in the specs for running the linker.
6737 Input files whose names have no recognized suffix are not compiled
6738 at all, but they are included among the output files, so they will
6739 be linked.
6740
6741 @item %O
6742 Substitutes the suffix for object files.  Note that this is
6743 handled specially when it immediately follows @samp{%g, %u, or %U},
6744 because of the need for those to form complete file names.  The
6745 handling is such that @samp{%O} is treated exactly as if it had already
6746 been substituted, except that @samp{%g, %u, and %U} do not currently
6747 support additional @var{suffix} characters following @samp{%O} as they would
6748 following, for example, @samp{.o}.
6749
6750 @item %p
6751 Substitutes the standard macro predefinitions for the
6752 current target machine.  Use this when running @code{cpp}.
6753
6754 @item %P
6755 Like @samp{%p}, but puts @samp{__} before and after the name of each
6756 predefined macro, except for macros that start with @samp{__} or with
6757 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
6758 C@.
6759
6760 @item %I
6761 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
6762 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
6763 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
6764 and @option{-imultilib} as necessary.
6765
6766 @item %s
6767 Current argument is the name of a library or startup file of some sort.
6768 Search for that file in a standard list of directories and substitute
6769 the full name found.
6770
6771 @item %e@var{str}
6772 Print @var{str} as an error message.  @var{str} is terminated by a newline.
6773 Use this when inconsistent options are detected.
6774
6775 @item %(@var{name})
6776 Substitute the contents of spec string @var{name} at this point.
6777
6778 @item %[@var{name}]
6779 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
6780
6781 @item %x@{@var{option}@}
6782 Accumulate an option for @samp{%X}.
6783
6784 @item %X
6785 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
6786 spec string.
6787
6788 @item %Y
6789 Output the accumulated assembler options specified by @option{-Wa}.
6790
6791 @item %Z
6792 Output the accumulated preprocessor options specified by @option{-Wp}.
6793
6794 @item %a
6795 Process the @code{asm} spec.  This is used to compute the
6796 switches to be passed to the assembler.
6797
6798 @item %A
6799 Process the @code{asm_final} spec.  This is a spec string for
6800 passing switches to an assembler post-processor, if such a program is
6801 needed.
6802
6803 @item %l
6804 Process the @code{link} spec.  This is the spec for computing the
6805 command line passed to the linker.  Typically it will make use of the
6806 @samp{%L %G %S %D and %E} sequences.
6807
6808 @item %D
6809 Dump out a @option{-L} option for each directory that GCC believes might
6810 contain startup files.  If the target supports multilibs then the
6811 current multilib directory will be prepended to each of these paths.
6812
6813 @item %L
6814 Process the @code{lib} spec.  This is a spec string for deciding which
6815 libraries should be included on the command line to the linker.
6816
6817 @item %G
6818 Process the @code{libgcc} spec.  This is a spec string for deciding
6819 which GCC support library should be included on the command line to the linker.
6820
6821 @item %S
6822 Process the @code{startfile} spec.  This is a spec for deciding which
6823 object files should be the first ones passed to the linker.  Typically
6824 this might be a file named @file{crt0.o}.
6825
6826 @item %E
6827 Process the @code{endfile} spec.  This is a spec string that specifies
6828 the last object files that will be passed to the linker.
6829
6830 @item %C
6831 Process the @code{cpp} spec.  This is used to construct the arguments
6832 to be passed to the C preprocessor.
6833
6834 @item %1
6835 Process the @code{cc1} spec.  This is used to construct the options to be
6836 passed to the actual C compiler (@samp{cc1}).
6837
6838 @item %2
6839 Process the @code{cc1plus} spec.  This is used to construct the options to be
6840 passed to the actual C++ compiler (@samp{cc1plus}).
6841
6842 @item %*
6843 Substitute the variable part of a matched option.  See below.
6844 Note that each comma in the substituted string is replaced by
6845 a single space.
6846
6847 @item %<@code{S}
6848 Remove all occurrences of @code{-S} from the command line.  Note---this
6849 command is position dependent.  @samp{%} commands in the spec string
6850 before this one will see @code{-S}, @samp{%} commands in the spec string
6851 after this one will not.
6852
6853 @item %:@var{function}(@var{args})
6854 Call the named function @var{function}, passing it @var{args}.
6855 @var{args} is first processed as a nested spec string, then split
6856 into an argument vector in the usual fashion.  The function returns
6857 a string which is processed as if it had appeared literally as part
6858 of the current spec.
6859
6860 The following built-in spec functions are provided:
6861
6862 @table @code
6863 @item @code{if-exists}
6864 The @code{if-exists} spec function takes one argument, an absolute
6865 pathname to a file.  If the file exists, @code{if-exists} returns the
6866 pathname.  Here is a small example of its usage:
6867
6868 @smallexample
6869 *startfile:
6870 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
6871 @end smallexample
6872
6873 @item @code{if-exists-else}
6874 The @code{if-exists-else} spec function is similar to the @code{if-exists}
6875 spec function, except that it takes two arguments.  The first argument is
6876 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
6877 returns the pathname.  If it does not exist, it returns the second argument.
6878 This way, @code{if-exists-else} can be used to select one file or another,
6879 based on the existence of the first.  Here is a small example of its usage:
6880
6881 @smallexample
6882 *startfile:
6883 crt0%O%s %:if-exists(crti%O%s) \
6884 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
6885 @end smallexample
6886
6887 @item @code{replace-outfile}
6888 The @code{replace-outfile} spec function takes two arguments.  It looks for the
6889 first argument in the outfiles array and replaces it with the second argument.  Here
6890 is a small example of its usage:
6891
6892 @smallexample
6893 %@{static|static-libgcc|static-libstdc++:%:replace-outfile(-lstdc++ \
6894 libstdc++.a%s)@}
6895
6896 @end smallexample
6897
6898 @end table
6899
6900 @item %@{@code{S}@}
6901 Substitutes the @code{-S} switch, if that switch was given to GCC@.
6902 If that switch was not specified, this substitutes nothing.  Note that
6903 the leading dash is omitted when specifying this option, and it is
6904 automatically inserted if the substitution is performed.  Thus the spec
6905 string @samp{%@{foo@}} would match the command-line option @option{-foo}
6906 and would output the command line option @option{-foo}.
6907
6908 @item %W@{@code{S}@}
6909 Like %@{@code{S}@} but mark last argument supplied within as a file to be
6910 deleted on failure.
6911
6912 @item %@{@code{S}*@}
6913 Substitutes all the switches specified to GCC whose names start
6914 with @code{-S}, but which also take an argument.  This is used for
6915 switches like @option{-o}, @option{-D}, @option{-I}, etc.
6916 GCC considers @option{-o foo} as being
6917 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
6918 text, including the space.  Thus two arguments would be generated.
6919
6920 @item %@{@code{S}*&@code{T}*@}
6921 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
6922 (the order of @code{S} and @code{T} in the spec is not significant).
6923 There can be any number of ampersand-separated variables; for each the
6924 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
6925
6926 @item %@{@code{S}:@code{X}@}
6927 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
6928
6929 @item %@{!@code{S}:@code{X}@}
6930 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
6931
6932 @item %@{@code{S}*:@code{X}@}
6933 Substitutes @code{X} if one or more switches whose names start with
6934 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
6935 once, no matter how many such switches appeared.  However, if @code{%*}
6936 appears somewhere in @code{X}, then @code{X} will be substituted once
6937 for each matching switch, with the @code{%*} replaced by the part of
6938 that switch that matched the @code{*}.
6939
6940 @item %@{.@code{S}:@code{X}@}
6941 Substitutes @code{X}, if processing a file with suffix @code{S}.
6942
6943 @item %@{!.@code{S}:@code{X}@}
6944 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
6945
6946 @item %@{@code{S}|@code{P}:@code{X}@}
6947 Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@.
6948 This may be combined with @samp{!}, @samp{.}, and @code{*} sequences as well,
6949 although they have a stronger binding than the @samp{|}.  If @code{%*}
6950 appears in @code{X}, all of the alternatives must be starred, and only
6951 the first matching alternative is substituted.
6952
6953 For example, a spec string like this:
6954
6955 @smallexample
6956 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
6957 @end smallexample
6958
6959 will output the following command-line options from the following input
6960 command-line options:
6961
6962 @smallexample
6963 fred.c        -foo -baz
6964 jim.d         -bar -boggle
6965 -d fred.c     -foo -baz -boggle
6966 -d jim.d      -bar -baz -boggle
6967 @end smallexample
6968
6969 @item %@{S:X; T:Y; :D@}
6970
6971 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
6972 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
6973 be as many clauses as you need.  This may be combined with @code{.},
6974 @code{!}, @code{|}, and @code{*} as needed.
6975
6976
6977 @end table
6978
6979 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
6980 construct may contain other nested @samp{%} constructs or spaces, or
6981 even newlines.  They are processed as usual, as described above.
6982 Trailing white space in @code{X} is ignored.  White space may also
6983 appear anywhere on the left side of the colon in these constructs,
6984 except between @code{.} or @code{*} and the corresponding word.
6985
6986 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
6987 handled specifically in these constructs.  If another value of
6988 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
6989 @option{-W} switch is found later in the command line, the earlier
6990 switch value is ignored, except with @{@code{S}*@} where @code{S} is
6991 just one letter, which passes all matching options.
6992
6993 The character @samp{|} at the beginning of the predicate text is used to
6994 indicate that a command should be piped to the following command, but
6995 only if @option{-pipe} is specified.
6996
6997 It is built into GCC which switches take arguments and which do not.
6998 (You might think it would be useful to generalize this to allow each
6999 compiler's spec to say which switches take arguments.  But this cannot
7000 be done in a consistent fashion.  GCC cannot even decide which input
7001 files have been specified without knowing which switches take arguments,
7002 and it must know which input files to compile in order to tell which
7003 compilers to run).
7004
7005 GCC also knows implicitly that arguments starting in @option{-l} are to be
7006 treated as compiler output files, and passed to the linker in their
7007 proper position among the other output files.
7008
7009 @c man begin OPTIONS
7010
7011 @node Target Options
7012 @section Specifying Target Machine and Compiler Version
7013 @cindex target options
7014 @cindex cross compiling
7015 @cindex specifying machine version
7016 @cindex specifying compiler version and target machine
7017 @cindex compiler version, specifying
7018 @cindex target machine, specifying
7019
7020 The usual way to run GCC is to run the executable called @file{gcc}, or
7021 @file{<machine>-gcc} when cross-compiling, or
7022 @file{<machine>-gcc-<version>} to run a version other than the one that
7023 was installed last.  Sometimes this is inconvenient, so GCC provides
7024 options that will switch to another cross-compiler or version.
7025
7026 @table @gcctabopt
7027 @item -b @var{machine}
7028 @opindex b
7029 The argument @var{machine} specifies the target machine for compilation.
7030
7031 The value to use for @var{machine} is the same as was specified as the
7032 machine type when configuring GCC as a cross-compiler.  For
7033 example, if a cross-compiler was configured with @samp{configure
7034 arm-elf}, meaning to compile for an arm processor with elf binaries,
7035 then you would specify @option{-b arm-elf} to run that cross compiler.
7036 Because there are other options beginning with @option{-b}, the
7037 configuration must contain a hyphen. 
7038
7039 @item -V @var{version}
7040 @opindex V
7041 The argument @var{version} specifies which version of GCC to run.
7042 This is useful when multiple versions are installed.  For example,
7043 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7044 @end table
7045
7046 The @option{-V} and @option{-b} options work by running the
7047 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7048 use them if you can just run that directly.
7049
7050 @node Submodel Options
7051 @section Hardware Models and Configurations
7052 @cindex submodel options
7053 @cindex specifying hardware config
7054 @cindex hardware models and configurations, specifying
7055 @cindex machine dependent options
7056
7057 Earlier we discussed the standard option @option{-b} which chooses among
7058 different installed compilers for completely different target
7059 machines, such as VAX vs.@: 68000 vs.@: 80386.
7060
7061 In addition, each of these target machine types can have its own
7062 special options, starting with @samp{-m}, to choose among various
7063 hardware models or configurations---for example, 68010 vs 68020,
7064 floating coprocessor or none.  A single installed version of the
7065 compiler can compile for any model or configuration, according to the
7066 options specified.
7067
7068 Some configurations of the compiler also support additional special
7069 options, usually for compatibility with other compilers on the same
7070 platform.
7071
7072 @c This list is ordered alphanumerically by subsection name.
7073 @c It should be the same order and spelling as these options are listed
7074 @c in Machine Dependent Options
7075
7076 @menu
7077 * ARC Options::
7078 * ARM Options::
7079 * AVR Options::
7080 * Blackfin Options::
7081 * CRIS Options::
7082 * CRX Options::
7083 * Darwin Options::
7084 * DEC Alpha Options::
7085 * DEC Alpha/VMS Options::
7086 * FRV Options::
7087 * GNU/Linux Options::
7088 * H8/300 Options::
7089 * HPPA Options::
7090 * i386 and x86-64 Options::
7091 * IA-64 Options::
7092 * M32C Options::
7093 * M32R/D Options::
7094 * M680x0 Options::
7095 * M68hc1x Options::
7096 * MCore Options::
7097 * MIPS Options::
7098 * MMIX Options::
7099 * MN10300 Options::
7100 * MT Options::
7101 * PDP-11 Options::
7102 * PowerPC Options::
7103 * RS/6000 and PowerPC Options::
7104 * S/390 and zSeries Options::
7105 * Score Options::
7106 * SH Options::
7107 * SPARC Options::
7108 * System V Options::
7109 * TMS320C3x/C4x Options::
7110 * V850 Options::
7111 * VAX Options::
7112 * x86-64 Options::
7113 * Xstormy16 Options::
7114 * Xtensa Options::
7115 * zSeries Options::
7116 @end menu
7117
7118 @node ARC Options
7119 @subsection ARC Options
7120 @cindex ARC Options
7121
7122 These options are defined for ARC implementations:
7123
7124 @table @gcctabopt
7125 @item -EL
7126 @opindex EL
7127 Compile code for little endian mode.  This is the default.
7128
7129 @item -EB
7130 @opindex EB
7131 Compile code for big endian mode.
7132
7133 @item -mmangle-cpu
7134 @opindex mmangle-cpu
7135 Prepend the name of the cpu to all public symbol names.
7136 In multiple-processor systems, there are many ARC variants with different
7137 instruction and register set characteristics.  This flag prevents code
7138 compiled for one cpu to be linked with code compiled for another.
7139 No facility exists for handling variants that are ``almost identical''.
7140 This is an all or nothing option.
7141
7142 @item -mcpu=@var{cpu}
7143 @opindex mcpu
7144 Compile code for ARC variant @var{cpu}.
7145 Which variants are supported depend on the configuration.
7146 All variants support @option{-mcpu=base}, this is the default.
7147
7148 @item -mtext=@var{text-section}
7149 @itemx -mdata=@var{data-section}
7150 @itemx -mrodata=@var{readonly-data-section}
7151 @opindex mtext
7152 @opindex mdata
7153 @opindex mrodata
7154 Put functions, data, and readonly data in @var{text-section},
7155 @var{data-section}, and @var{readonly-data-section} respectively
7156 by default.  This can be overridden with the @code{section} attribute.
7157 @xref{Variable Attributes}.
7158
7159 @end table
7160
7161 @node ARM Options
7162 @subsection ARM Options
7163 @cindex ARM options
7164
7165 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7166 architectures:
7167
7168 @table @gcctabopt
7169 @item -mabi=@var{name}
7170 @opindex mabi
7171 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7172 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
7173
7174 @item -mapcs-frame
7175 @opindex mapcs-frame
7176 Generate a stack frame that is compliant with the ARM Procedure Call
7177 Standard for all functions, even if this is not strictly necessary for
7178 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7179 with this option will cause the stack frames not to be generated for
7180 leaf functions.  The default is @option{-mno-apcs-frame}.
7181
7182 @item -mapcs
7183 @opindex mapcs
7184 This is a synonym for @option{-mapcs-frame}.
7185
7186 @ignore
7187 @c not currently implemented
7188 @item -mapcs-stack-check
7189 @opindex mapcs-stack-check
7190 Generate code to check the amount of stack space available upon entry to
7191 every function (that actually uses some stack space).  If there is
7192 insufficient space available then either the function
7193 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7194 called, depending upon the amount of stack space required.  The run time
7195 system is required to provide these functions.  The default is
7196 @option{-mno-apcs-stack-check}, since this produces smaller code.
7197
7198 @c not currently implemented
7199 @item -mapcs-float
7200 @opindex mapcs-float
7201 Pass floating point arguments using the float point registers.  This is
7202 one of the variants of the APCS@.  This option is recommended if the
7203 target hardware has a floating point unit or if a lot of floating point
7204 arithmetic is going to be performed by the code.  The default is
7205 @option{-mno-apcs-float}, since integer only code is slightly increased in
7206 size if @option{-mapcs-float} is used.
7207
7208 @c not currently implemented
7209 @item -mapcs-reentrant
7210 @opindex mapcs-reentrant
7211 Generate reentrant, position independent code.  The default is
7212 @option{-mno-apcs-reentrant}.
7213 @end ignore
7214
7215 @item -mthumb-interwork
7216 @opindex mthumb-interwork
7217 Generate code which supports calling between the ARM and Thumb
7218 instruction sets.  Without this option the two instruction sets cannot
7219 be reliably used inside one program.  The default is
7220 @option{-mno-thumb-interwork}, since slightly larger code is generated
7221 when @option{-mthumb-interwork} is specified.
7222
7223 @item -mno-sched-prolog
7224 @opindex mno-sched-prolog
7225 Prevent the reordering of instructions in the function prolog, or the
7226 merging of those instruction with the instructions in the function's
7227 body.  This means that all functions will start with a recognizable set
7228 of instructions (or in fact one of a choice from a small set of
7229 different function prologues), and this information can be used to
7230 locate the start if functions inside an executable piece of code.  The
7231 default is @option{-msched-prolog}.
7232
7233 @item -mhard-float
7234 @opindex mhard-float
7235 Generate output containing floating point instructions.  This is the
7236 default.
7237
7238 @item -msoft-float
7239 @opindex msoft-float
7240 Generate output containing library calls for floating point.
7241 @strong{Warning:} the requisite libraries are not available for all ARM
7242 targets.  Normally the facilities of the machine's usual C compiler are
7243 used, but this cannot be done directly in cross-compilation.  You must make
7244 your own arrangements to provide suitable library functions for
7245 cross-compilation.
7246
7247 @option{-msoft-float} changes the calling convention in the output file;
7248 therefore, it is only useful if you compile @emph{all} of a program with
7249 this option.  In particular, you need to compile @file{libgcc.a}, the
7250 library that comes with GCC, with @option{-msoft-float} in order for
7251 this to work.
7252
7253 @item -mfloat-abi=@var{name}
7254 @opindex mfloat-abi
7255 Specifies which ABI to use for floating point values.  Permissible values
7256 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7257
7258 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7259 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7260 of floating point instructions, but still uses the soft-float calling
7261 conventions.
7262
7263 @item -mlittle-endian
7264 @opindex mlittle-endian
7265 Generate code for a processor running in little-endian mode.  This is
7266 the default for all standard configurations.
7267
7268 @item -mbig-endian
7269 @opindex mbig-endian
7270 Generate code for a processor running in big-endian mode; the default is
7271 to compile code for a little-endian processor.
7272
7273 @item -mwords-little-endian
7274 @opindex mwords-little-endian
7275 This option only applies when generating code for big-endian processors.
7276 Generate code for a little-endian word order but a big-endian byte
7277 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7278 option should only be used if you require compatibility with code for
7279 big-endian ARM processors generated by versions of the compiler prior to
7280 2.8.
7281
7282 @item -mcpu=@var{name}
7283 @opindex mcpu
7284 This specifies the name of the target ARM processor.  GCC uses this name
7285 to determine what kind of instructions it can emit when generating
7286 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7287 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7288 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7289 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7290 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7291 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7292 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7293 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7294 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7295 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7296 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7297 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7298 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7299 @samp{arm1176jz-s}, @samp{arm1176jzf-s}, @samp{xscale}, @samp{iwmmxt},
7300 @samp{ep9312}.
7301
7302 @itemx -mtune=@var{name}
7303 @opindex mtune
7304 This option is very similar to the @option{-mcpu=} option, except that
7305 instead of specifying the actual target processor type, and hence
7306 restricting which instructions can be used, it specifies that GCC should
7307 tune the performance of the code as if the target were of the type
7308 specified in this option, but still choosing the instructions that it
7309 will generate based on the cpu specified by a @option{-mcpu=} option.
7310 For some ARM implementations better performance can be obtained by using
7311 this option.
7312
7313 @item -march=@var{name}
7314 @opindex march
7315 This specifies the name of the target ARM architecture.  GCC uses this
7316 name to determine what kind of instructions it can emit when generating
7317 assembly code.  This option can be used in conjunction with or instead
7318 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
7319 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
7320 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
7321 @samp{iwmmxt}, @samp{ep9312}.
7322
7323 @item -mfpu=@var{name}
7324 @itemx -mfpe=@var{number}
7325 @itemx -mfp=@var{number}
7326 @opindex mfpu
7327 @opindex mfpe
7328 @opindex mfp
7329 This specifies what floating point hardware (or hardware emulation) is
7330 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
7331 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
7332 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
7333 with older versions of GCC@.
7334
7335 If @option{-msoft-float} is specified this specifies the format of
7336 floating point values.
7337
7338 @item -mstructure-size-boundary=@var{n}
7339 @opindex mstructure-size-boundary
7340 The size of all structures and unions will be rounded up to a multiple
7341 of the number of bits set by this option.  Permissible values are 8, 32
7342 and 64.  The default value varies for different toolchains.  For the COFF
7343 targeted toolchain the default value is 8.  A value of 64 is only allowed
7344 if the underlying ABI supports it.
7345
7346 Specifying the larger number can produce faster, more efficient code, but
7347 can also increase the size of the program.  Different values are potentially
7348 incompatible.  Code compiled with one value cannot necessarily expect to
7349 work with code or libraries compiled with another value, if they exchange
7350 information using structures or unions.
7351
7352 @item -mabort-on-noreturn
7353 @opindex mabort-on-noreturn
7354 Generate a call to the function @code{abort} at the end of a
7355 @code{noreturn} function.  It will be executed if the function tries to
7356 return.
7357
7358 @item -mlong-calls
7359 @itemx -mno-long-calls
7360 @opindex mlong-calls
7361 @opindex mno-long-calls
7362 Tells the compiler to perform function calls by first loading the
7363 address of the function into a register and then performing a subroutine
7364 call on this register.  This switch is needed if the target function
7365 will lie outside of the 64 megabyte addressing range of the offset based
7366 version of subroutine call instruction.
7367
7368 Even if this switch is enabled, not all function calls will be turned
7369 into long calls.  The heuristic is that static functions, functions
7370 which have the @samp{short-call} attribute, functions that are inside
7371 the scope of a @samp{#pragma no_long_calls} directive and functions whose
7372 definitions have already been compiled within the current compilation
7373 unit, will not be turned into long calls.  The exception to this rule is
7374 that weak function definitions, functions with the @samp{long-call}
7375 attribute or the @samp{section} attribute, and functions that are within
7376 the scope of a @samp{#pragma long_calls} directive, will always be
7377 turned into long calls.
7378
7379 This feature is not enabled by default.  Specifying
7380 @option{-mno-long-calls} will restore the default behavior, as will
7381 placing the function calls within the scope of a @samp{#pragma
7382 long_calls_off} directive.  Note these switches have no effect on how
7383 the compiler generates code to handle function calls via function
7384 pointers.
7385
7386 @item -mnop-fun-dllimport
7387 @opindex mnop-fun-dllimport
7388 Disable support for the @code{dllimport} attribute.
7389
7390 @item -msingle-pic-base
7391 @opindex msingle-pic-base
7392 Treat the register used for PIC addressing as read-only, rather than
7393 loading it in the prologue for each function.  The run-time system is
7394 responsible for initializing this register with an appropriate value
7395 before execution begins.
7396
7397 @item -mpic-register=@var{reg}
7398 @opindex mpic-register
7399 Specify the register to be used for PIC addressing.  The default is R10
7400 unless stack-checking is enabled, when R9 is used.
7401
7402 @item -mcirrus-fix-invalid-insns
7403 @opindex mcirrus-fix-invalid-insns
7404 @opindex mno-cirrus-fix-invalid-insns
7405 Insert NOPs into the instruction stream to in order to work around
7406 problems with invalid Maverick instruction combinations.  This option
7407 is only valid if the @option{-mcpu=ep9312} option has been used to
7408 enable generation of instructions for the Cirrus Maverick floating
7409 point co-processor.  This option is not enabled by default, since the
7410 problem is only present in older Maverick implementations.  The default
7411 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
7412 switch.
7413
7414 @item -mpoke-function-name
7415 @opindex mpoke-function-name
7416 Write the name of each function into the text section, directly
7417 preceding the function prologue.  The generated code is similar to this:
7418
7419 @smallexample
7420      t0
7421          .ascii "arm_poke_function_name", 0
7422          .align
7423      t1
7424          .word 0xff000000 + (t1 - t0)
7425      arm_poke_function_name
7426          mov     ip, sp
7427          stmfd   sp!, @{fp, ip, lr, pc@}
7428          sub     fp, ip, #4
7429 @end smallexample
7430
7431 When performing a stack backtrace, code can inspect the value of
7432 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
7433 location @code{pc - 12} and the top 8 bits are set, then we know that
7434 there is a function name embedded immediately preceding this location
7435 and has length @code{((pc[-3]) & 0xff000000)}.
7436
7437 @item -mthumb
7438 @opindex mthumb
7439 Generate code for the 16-bit Thumb instruction set.  The default is to
7440 use the 32-bit ARM instruction set.
7441
7442 @item -mtpcs-frame
7443 @opindex mtpcs-frame
7444 Generate a stack frame that is compliant with the Thumb Procedure Call
7445 Standard for all non-leaf functions.  (A leaf function is one that does
7446 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
7447
7448 @item -mtpcs-leaf-frame
7449 @opindex mtpcs-leaf-frame
7450 Generate a stack frame that is compliant with the Thumb Procedure Call
7451 Standard for all leaf functions.  (A leaf function is one that does
7452 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
7453
7454 @item -mcallee-super-interworking
7455 @opindex mcallee-super-interworking
7456 Gives all externally visible functions in the file being compiled an ARM
7457 instruction set header which switches to Thumb mode before executing the
7458 rest of the function.  This allows these functions to be called from
7459 non-interworking code.
7460
7461 @item -mcaller-super-interworking
7462 @opindex mcaller-super-interworking
7463 Allows calls via function pointers (including virtual functions) to
7464 execute correctly regardless of whether the target code has been
7465 compiled for interworking or not.  There is a small overhead in the cost
7466 of executing a function pointer if this option is enabled.
7467
7468 @item -mtp=@var{name}
7469 @opindex mtp
7470 Specify the access model for the thread local storage pointer.  The valid
7471 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
7472 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
7473 (supported in the arm6k architecture), and @option{auto}, which uses the
7474 best available method for the selected processor.  The default setting is
7475 @option{auto}.
7476
7477 @end table
7478
7479 @node AVR Options
7480 @subsection AVR Options
7481 @cindex AVR Options
7482
7483 These options are defined for AVR implementations:
7484
7485 @table @gcctabopt
7486 @item -mmcu=@var{mcu}
7487 @opindex mmcu
7488 Specify ATMEL AVR instruction set or MCU type.
7489
7490 Instruction set avr1 is for the minimal AVR core, not supported by the C
7491 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
7492 attiny11, attiny12, attiny15, attiny28).
7493
7494 Instruction set avr2 (default) is for the classic AVR core with up to
7495 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
7496 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
7497 at90c8534, at90s8535).
7498
7499 Instruction set avr3 is for the classic AVR core with up to 128K program
7500 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
7501
7502 Instruction set avr4 is for the enhanced AVR core with up to 8K program
7503 memory space (MCU types: atmega8, atmega83, atmega85).
7504
7505 Instruction set avr5 is for the enhanced AVR core with up to 128K program
7506 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
7507 atmega64, atmega128, at43usb355, at94k).
7508
7509 @item -msize
7510 @opindex msize
7511 Output instruction sizes to the asm file.
7512
7513 @item -minit-stack=@var{N}
7514 @opindex minit-stack
7515 Specify the initial stack address, which may be a symbol or numeric value,
7516 @samp{__stack} is the default.
7517
7518 @item -mno-interrupts
7519 @opindex mno-interrupts
7520 Generated code is not compatible with hardware interrupts.
7521 Code size will be smaller.
7522
7523 @item -mcall-prologues
7524 @opindex mcall-prologues
7525 Functions prologues/epilogues expanded as call to appropriate
7526 subroutines.  Code size will be smaller.
7527
7528 @item -mno-tablejump
7529 @opindex mno-tablejump
7530 Do not generate tablejump insns which sometimes increase code size.
7531
7532 @item -mtiny-stack
7533 @opindex mtiny-stack
7534 Change only the low 8 bits of the stack pointer.
7535
7536 @item -mint8
7537 @opindex mint8
7538 Assume int to be 8 bit integer.  This affects the sizes of all types: A
7539 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
7540 and long long will be 4 bytes.  Please note that this option does not
7541 comply to the C standards, but it will provide you with smaller code
7542 size.
7543 @end table
7544
7545 @node Blackfin Options
7546 @subsection Blackfin Options
7547 @cindex Blackfin Options
7548
7549 @table @gcctabopt
7550 @item -momit-leaf-frame-pointer
7551 @opindex momit-leaf-frame-pointer
7552 Don't keep the frame pointer in a register for leaf functions.  This
7553 avoids the instructions to save, set up and restore frame pointers and
7554 makes an extra register available in leaf functions.  The option
7555 @option{-fomit-frame-pointer} removes the frame pointer for all functions
7556 which might make debugging harder.
7557
7558 @item -mspecld-anomaly
7559 @opindex mspecld-anomaly
7560 When enabled, the compiler will ensure that the generated code does not
7561 contain speculative loads after jump instructions.  This option is enabled
7562 by default.
7563
7564 @item -mno-specld-anomaly
7565 @opindex mno-specld-anomaly
7566 Don't generate extra code to prevent speculative loads from occurring.
7567
7568 @item -mcsync-anomaly
7569 @opindex mcsync-anomaly
7570 When enabled, the compiler will ensure that the generated code does not
7571 contain CSYNC or SSYNC instructions too soon after conditional branches.
7572 This option is enabled by default.
7573
7574 @item -mno-csync-anomaly
7575 @opindex mno-csync-anomaly
7576 Don't generate extra code to prevent CSYNC or SSYNC instructions from
7577 occurring too soon after a conditional branch.
7578
7579 @item -mlow-64k
7580 @opindex mlow-64k
7581 When enabled, the compiler is free to take advantage of the knowledge that
7582 the entire program fits into the low 64k of memory.
7583
7584 @item -mno-low-64k
7585 @opindex mno-low-64k
7586 Assume that the program is arbitrarily large.  This is the default.
7587
7588 @item -mid-shared-library
7589 @opindex mid-shared-library
7590 Generate code that supports shared libraries via the library ID method.
7591 This allows for execute in place and shared libraries in an environment
7592 without virtual memory management.  This option implies @option{-fPIC}.
7593
7594 @item -mno-id-shared-library
7595 @opindex mno-id-shared-library
7596 Generate code that doesn't assume ID based shared libraries are being used.
7597 This is the default.
7598
7599 @item -mshared-library-id=n
7600 @opindex mshared-library-id
7601 Specified the identification number of the ID based shared library being
7602 compiled.  Specifying a value of 0 will generate more compact code, specifying
7603 other values will force the allocation of that number to the current
7604 library but is no more space or time efficient than omitting this option.
7605
7606 @item -mlong-calls
7607 @itemx -mno-long-calls
7608 @opindex mlong-calls
7609 @opindex mno-long-calls
7610 Tells the compiler to perform function calls by first loading the
7611 address of the function into a register and then performing a subroutine
7612 call on this register.  This switch is needed if the target function
7613 will lie outside of the 24 bit addressing range of the offset based
7614 version of subroutine call instruction.
7615
7616 This feature is not enabled by default.  Specifying
7617 @option{-mno-long-calls} will restore the default behavior.  Note these
7618 switches have no effect on how the compiler generates code to handle
7619 function calls via function pointers.
7620 @end table
7621
7622 @node CRIS Options
7623 @subsection CRIS Options
7624 @cindex CRIS Options
7625
7626 These options are defined specifically for the CRIS ports.
7627
7628 @table @gcctabopt
7629 @item -march=@var{architecture-type}
7630 @itemx -mcpu=@var{architecture-type}
7631 @opindex march
7632 @opindex mcpu
7633 Generate code for the specified architecture.  The choices for
7634 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
7635 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
7636 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
7637 @samp{v10}.
7638
7639 @item -mtune=@var{architecture-type}
7640 @opindex mtune
7641 Tune to @var{architecture-type} everything applicable about the generated
7642 code, except for the ABI and the set of available instructions.  The
7643 choices for @var{architecture-type} are the same as for
7644 @option{-march=@var{architecture-type}}.
7645
7646 @item -mmax-stack-frame=@var{n}
7647 @opindex mmax-stack-frame
7648 Warn when the stack frame of a function exceeds @var{n} bytes.
7649
7650 @item -melinux-stacksize=@var{n}
7651 @opindex melinux-stacksize
7652 Only available with the @samp{cris-axis-aout} target.  Arranges for
7653 indications in the program to the kernel loader that the stack of the
7654 program should be set to @var{n} bytes.
7655
7656 @item -metrax4
7657 @itemx -metrax100
7658 @opindex metrax4
7659 @opindex metrax100
7660 The options @option{-metrax4} and @option{-metrax100} are synonyms for
7661 @option{-march=v3} and @option{-march=v8} respectively.
7662
7663 @item -mmul-bug-workaround
7664 @itemx -mno-mul-bug-workaround
7665 @opindex mmul-bug-workaround
7666 @opindex mno-mul-bug-workaround
7667 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
7668 models where it applies.  This option is active by default.
7669
7670 @item -mpdebug
7671 @opindex mpdebug
7672 Enable CRIS-specific verbose debug-related information in the assembly
7673 code.  This option also has the effect to turn off the @samp{#NO_APP}
7674 formatted-code indicator to the assembler at the beginning of the
7675 assembly file.
7676
7677 @item -mcc-init
7678 @opindex mcc-init
7679 Do not use condition-code results from previous instruction; always emit
7680 compare and test instructions before use of condition codes.
7681
7682 @item -mno-side-effects
7683 @opindex mno-side-effects
7684 Do not emit instructions with side-effects in addressing modes other than
7685 post-increment.
7686
7687 @item -mstack-align
7688 @itemx -mno-stack-align
7689 @itemx -mdata-align
7690 @itemx -mno-data-align
7691 @itemx -mconst-align
7692 @itemx -mno-const-align
7693 @opindex mstack-align
7694 @opindex mno-stack-align
7695 @opindex mdata-align
7696 @opindex mno-data-align
7697 @opindex mconst-align
7698 @opindex mno-const-align
7699 These options (no-options) arranges (eliminate arrangements) for the
7700 stack-frame, individual data and constants to be aligned for the maximum
7701 single data access size for the chosen CPU model.  The default is to
7702 arrange for 32-bit alignment.  ABI details such as structure layout are
7703 not affected by these options.
7704
7705 @item -m32-bit
7706 @itemx -m16-bit
7707 @itemx -m8-bit
7708 @opindex m32-bit
7709 @opindex m16-bit
7710 @opindex m8-bit
7711 Similar to the stack- data- and const-align options above, these options
7712 arrange for stack-frame, writable data and constants to all be 32-bit,
7713 16-bit or 8-bit aligned.  The default is 32-bit alignment.
7714
7715 @item -mno-prologue-epilogue
7716 @itemx -mprologue-epilogue
7717 @opindex mno-prologue-epilogue
7718 @opindex mprologue-epilogue
7719 With @option{-mno-prologue-epilogue}, the normal function prologue and
7720 epilogue that sets up the stack-frame are omitted and no return
7721 instructions or return sequences are generated in the code.  Use this
7722 option only together with visual inspection of the compiled code: no
7723 warnings or errors are generated when call-saved registers must be saved,
7724 or storage for local variable needs to be allocated.
7725
7726 @item -mno-gotplt
7727 @itemx -mgotplt
7728 @opindex mno-gotplt
7729 @opindex mgotplt
7730 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
7731 instruction sequences that load addresses for functions from the PLT part
7732 of the GOT rather than (traditional on other architectures) calls to the
7733 PLT@.  The default is @option{-mgotplt}.
7734
7735 @item -maout
7736 @opindex maout
7737 Legacy no-op option only recognized with the cris-axis-aout target.
7738
7739 @item -melf
7740 @opindex melf
7741 Legacy no-op option only recognized with the cris-axis-elf and
7742 cris-axis-linux-gnu targets.
7743
7744 @item -melinux
7745 @opindex melinux
7746 Only recognized with the cris-axis-aout target, where it selects a
7747 GNU/linux-like multilib, include files and instruction set for
7748 @option{-march=v8}.
7749
7750 @item -mlinux
7751 @opindex mlinux
7752 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
7753
7754 @item -sim
7755 @opindex sim
7756 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
7757 to link with input-output functions from a simulator library.  Code,
7758 initialized data and zero-initialized data are allocated consecutively.
7759
7760 @item -sim2
7761 @opindex sim2
7762 Like @option{-sim}, but pass linker options to locate initialized data at
7763 0x40000000 and zero-initialized data at 0x80000000.
7764 @end table
7765
7766 @node CRX Options
7767 @subsection CRX Options
7768 @cindex CRX Options
7769
7770 These options are defined specifically for the CRX ports.
7771
7772 @table @gcctabopt
7773
7774 @item -mmac
7775 @opindex mmac
7776 Enable the use of multiply-accumulate instructions. Disabled by default.
7777
7778 @item -mpush-args
7779 @opindex mpush-args
7780 Push instructions will be used to pass outgoing arguments when functions
7781 are called. Enabled by default.
7782 @end table
7783
7784 @node Darwin Options
7785 @subsection Darwin Options
7786 @cindex Darwin options
7787
7788 These options are defined for all architectures running the Darwin operating
7789 system.
7790
7791 FSF GCC on Darwin does not create ``fat'' object files; it will create
7792 an object file for the single architecture that it was built to
7793 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
7794 @option{-arch} options are used; it does so by running the compiler or
7795 linker multiple times and joining the results together with
7796 @file{lipo}.
7797
7798 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
7799 @samp{i686}) is determined by the flags that specify the ISA
7800 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
7801 @option{-force_cpusubtype_ALL} option can be used to override this.
7802
7803 The Darwin tools vary in their behavior when presented with an ISA
7804 mismatch.  The assembler, @file{as}, will only permit instructions to
7805 be used that are valid for the subtype of the file it is generating,
7806 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
7807 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
7808 and print an error if asked to create a shared library with a less
7809 restrictive subtype than its input files (for instance, trying to put
7810 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
7811 for executables, @file{ld}, will quietly give the executable the most
7812 restrictive subtype of any of its input files.
7813
7814 @table @gcctabopt
7815 @item -F@var{dir}
7816 @opindex F
7817 Add the framework directory @var{dir} to the head of the list of
7818 directories to be searched for header files.  These directories are
7819 interleaved with those specified by @option{-I} options and are
7820 scanned in a left-to-right order.
7821
7822 A framework directory is a directory with frameworks in it.  A
7823 framework is a directory with a @samp{"Headers"} and/or
7824 @samp{"PrivateHeaders"} directory contained directly in it that ends
7825 in @samp{".framework"}.  The name of a framework is the name of this
7826 directory excluding the @samp{".framework"}.  Headers associated with
7827 the framework are found in one of those two directories, with
7828 @samp{"Headers"} being searched first.  A subframework is a framework
7829 directory that is in a framework's @samp{"Frameworks"} directory.
7830 Includes of subframework headers can only appear in a header of a
7831 framework that contains the subframework, or in a sibling subframework
7832 header.  Two subframeworks are siblings if they occur in the same
7833 framework.  A subframework should not have the same name as a
7834 framework, a warning will be issued if this is violated.  Currently a
7835 subframework cannot have subframeworks, in the future, the mechanism
7836 may be extended to support this.  The standard frameworks can be found
7837 in @samp{"/System/Library/Frameworks"} and
7838 @samp{"/Library/Frameworks"}.  An example include looks like
7839 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
7840 the name of the framework and header.h is found in the
7841 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
7842
7843 @item -gused
7844 @opindex gused
7845 Emit debugging information for symbols that are used.  For STABS
7846 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
7847 This is by default ON@.
7848
7849 @item -gfull
7850 @opindex gfull
7851 Emit debugging information for all symbols and types.
7852
7853 @item -mmacosx-version-min=@var{version}
7854 The earliest version of MacOS X that this executable will run on
7855 is @var{version}.  Typical values of @var{version} include @code{10.1},
7856 @code{10.2}, and @code{10.3.9}.
7857
7858 The default for this option is to make choices that seem to be most
7859 useful.  
7860
7861 @item -mkernel
7862 @opindex mkernel
7863 Enable kernel development mode.  The @option{-mkernel} option sets
7864 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
7865 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
7866 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
7867 applicable.  This mode also sets @option{-mno-altivec},
7868 @option{-msoft-float}, @option{-fno-builtin} and
7869 @option{-mlong-branch} for PowerPC targets.
7870
7871 @item -mone-byte-bool
7872 @opindex mone-byte-bool
7873 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
7874 By default @samp{sizeof(bool)} is @samp{4} when compiling for
7875 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
7876 option has no effect on x86.
7877
7878 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
7879 to generate code that is not binary compatible with code generated
7880 without that switch.  Using this switch may require recompiling all
7881 other modules in a program, including system libraries.  Use this
7882 switch to conform to a non-default data model.
7883
7884 @item -mfix-and-continue
7885 @itemx -ffix-and-continue
7886 @itemx -findirect-data
7887 @opindex mfix-and-continue
7888 @opindex ffix-and-continue
7889 @opindex findirect-data
7890 Generate code suitable for fast turn around development.  Needed to
7891 enable gdb to dynamically load @code{.o} files into already running
7892 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
7893 are provided for backwards compatibility.
7894
7895 @item -all_load
7896 @opindex all_load
7897 Loads all members of static archive libraries.
7898 See man ld(1) for more information.
7899
7900 @item -arch_errors_fatal
7901 @opindex arch_errors_fatal
7902 Cause the errors having to do with files that have the wrong architecture
7903 to be fatal.
7904
7905 @item -bind_at_load
7906 @opindex bind_at_load
7907 Causes the output file to be marked such that the dynamic linker will
7908 bind all undefined references when the file is loaded or launched.
7909
7910 @item -bundle
7911 @opindex bundle
7912 Produce a Mach-o bundle format file.
7913 See man ld(1) for more information.
7914
7915 @item -bundle_loader @var{executable}
7916 @opindex bundle_loader
7917 This option specifies the @var{executable} that will be loading the build
7918 output file being linked.  See man ld(1) for more information.
7919
7920 @item -dynamiclib
7921 @opindex dynamiclib
7922 When passed this option, GCC will produce a dynamic library instead of
7923 an executable when linking, using the Darwin @file{libtool} command.
7924
7925 @item -force_cpusubtype_ALL
7926 @opindex force_cpusubtype_ALL
7927 This causes GCC's output file to have the @var{ALL} subtype, instead of
7928 one controlled by the @option{-mcpu} or @option{-march} option.
7929
7930 @item -allowable_client  @var{client_name}
7931 @itemx -client_name
7932 @itemx -compatibility_version
7933 @itemx -current_version
7934 @itemx -dead_strip
7935 @itemx -dependency-file
7936 @itemx -dylib_file
7937 @itemx -dylinker_install_name
7938 @itemx -dynamic
7939 @itemx -exported_symbols_list
7940 @itemx -filelist
7941 @itemx -flat_namespace
7942 @itemx -force_flat_namespace
7943 @itemx -headerpad_max_install_names
7944 @itemx -image_base
7945 @itemx -init
7946 @itemx -install_name
7947 @itemx -keep_private_externs
7948 @itemx -multi_module
7949 @itemx -multiply_defined
7950 @itemx -multiply_defined_unused
7951 @itemx -noall_load
7952 @itemx -no_dead_strip_inits_and_terms
7953 @itemx -nofixprebinding
7954 @itemx -nomultidefs
7955 @itemx -noprebind
7956 @itemx -noseglinkedit
7957 @itemx -pagezero_size
7958 @itemx -prebind
7959 @itemx -prebind_all_twolevel_modules
7960 @itemx -private_bundle
7961 @itemx -read_only_relocs
7962 @itemx -sectalign
7963 @itemx -sectobjectsymbols
7964 @itemx -whyload
7965 @itemx -seg1addr
7966 @itemx -sectcreate
7967 @itemx -sectobjectsymbols
7968 @itemx -sectorder
7969 @itemx -segaddr
7970 @itemx -segs_read_only_addr
7971 @itemx -segs_read_write_addr
7972 @itemx -seg_addr_table
7973 @itemx -seg_addr_table_filename
7974 @itemx -seglinkedit
7975 @itemx -segprot
7976 @itemx -segs_read_only_addr
7977 @itemx -segs_read_write_addr
7978 @itemx -single_module
7979 @itemx -static
7980 @itemx -sub_library
7981 @itemx -sub_umbrella
7982 @itemx -twolevel_namespace
7983 @itemx -umbrella
7984 @itemx -undefined
7985 @itemx -unexported_symbols_list
7986 @itemx -weak_reference_mismatches
7987 @itemx -whatsloaded
7988
7989 @opindex allowable_client
7990 @opindex client_name
7991 @opindex compatibility_version
7992 @opindex current_version
7993 @opindex dead_strip
7994 @opindex dependency-file
7995 @opindex dylib_file
7996 @opindex dylinker_install_name
7997 @opindex dynamic
7998 @opindex exported_symbols_list
7999 @opindex filelist
8000 @opindex flat_namespace
8001 @opindex force_flat_namespace
8002 @opindex headerpad_max_install_names
8003 @opindex image_base
8004 @opindex init
8005 @opindex install_name
8006 @opindex keep_private_externs
8007 @opindex multi_module
8008 @opindex multiply_defined
8009 @opindex multiply_defined_unused
8010 @opindex noall_load
8011 @opindex no_dead_strip_inits_and_terms
8012 @opindex nofixprebinding
8013 @opindex nomultidefs
8014 @opindex noprebind
8015 @opindex noseglinkedit
8016 @opindex pagezero_size
8017 @opindex prebind
8018 @opindex prebind_all_twolevel_modules
8019 @opindex private_bundle
8020 @opindex read_only_relocs
8021 @opindex sectalign
8022 @opindex sectobjectsymbols
8023 @opindex whyload
8024 @opindex seg1addr
8025 @opindex sectcreate
8026 @opindex sectobjectsymbols
8027 @opindex sectorder
8028 @opindex segaddr
8029 @opindex segs_read_only_addr
8030 @opindex segs_read_write_addr
8031 @opindex seg_addr_table
8032 @opindex seg_addr_table_filename
8033 @opindex seglinkedit
8034 @opindex segprot
8035 @opindex segs_read_only_addr
8036 @opindex segs_read_write_addr
8037 @opindex single_module
8038 @opindex static
8039 @opindex sub_library
8040 @opindex sub_umbrella
8041 @opindex twolevel_namespace
8042 @opindex umbrella
8043 @opindex undefined
8044 @opindex unexported_symbols_list
8045 @opindex weak_reference_mismatches
8046 @opindex whatsloaded
8047
8048 These options are passed to the Darwin linker.  The Darwin linker man page
8049 describes them in detail.
8050 @end table
8051
8052 @node DEC Alpha Options
8053 @subsection DEC Alpha Options
8054
8055 These @samp{-m} options are defined for the DEC Alpha implementations:
8056
8057 @table @gcctabopt
8058 @item -mno-soft-float
8059 @itemx -msoft-float
8060 @opindex mno-soft-float
8061 @opindex msoft-float
8062 Use (do not use) the hardware floating-point instructions for
8063 floating-point operations.  When @option{-msoft-float} is specified,
8064 functions in @file{libgcc.a} will be used to perform floating-point
8065 operations.  Unless they are replaced by routines that emulate the
8066 floating-point operations, or compiled in such a way as to call such
8067 emulations routines, these routines will issue floating-point
8068 operations.   If you are compiling for an Alpha without floating-point
8069 operations, you must ensure that the library is built so as not to call
8070 them.
8071
8072 Note that Alpha implementations without floating-point operations are
8073 required to have floating-point registers.
8074
8075 @item -mfp-reg
8076 @itemx -mno-fp-regs
8077 @opindex mfp-reg
8078 @opindex mno-fp-regs
8079 Generate code that uses (does not use) the floating-point register set.
8080 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8081 register set is not used, floating point operands are passed in integer
8082 registers as if they were integers and floating-point results are passed
8083 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8084 so any function with a floating-point argument or return value called by code
8085 compiled with @option{-mno-fp-regs} must also be compiled with that
8086 option.
8087
8088 A typical use of this option is building a kernel that does not use,
8089 and hence need not save and restore, any floating-point registers.
8090
8091 @item -mieee
8092 @opindex mieee
8093 The Alpha architecture implements floating-point hardware optimized for
8094 maximum performance.  It is mostly compliant with the IEEE floating
8095 point standard.  However, for full compliance, software assistance is
8096 required.  This option generates code fully IEEE compliant code
8097 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8098 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8099 defined during compilation.  The resulting code is less efficient but is
8100 able to correctly support denormalized numbers and exceptional IEEE
8101 values such as not-a-number and plus/minus infinity.  Other Alpha
8102 compilers call this option @option{-ieee_with_no_inexact}.
8103
8104 @item -mieee-with-inexact
8105 @opindex mieee-with-inexact
8106 This is like @option{-mieee} except the generated code also maintains
8107 the IEEE @var{inexact-flag}.  Turning on this option causes the
8108 generated code to implement fully-compliant IEEE math.  In addition to
8109 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8110 macro.  On some Alpha implementations the resulting code may execute
8111 significantly slower than the code generated by default.  Since there is
8112 very little code that depends on the @var{inexact-flag}, you should
8113 normally not specify this option.  Other Alpha compilers call this
8114 option @option{-ieee_with_inexact}.
8115
8116 @item -mfp-trap-mode=@var{trap-mode}
8117 @opindex mfp-trap-mode
8118 This option controls what floating-point related traps are enabled.
8119 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8120 The trap mode can be set to one of four values:
8121
8122 @table @samp
8123 @item n
8124 This is the default (normal) setting.  The only traps that are enabled
8125 are the ones that cannot be disabled in software (e.g., division by zero
8126 trap).
8127
8128 @item u
8129 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8130 as well.
8131
8132 @item su
8133 Like @samp{u}, but the instructions are marked to be safe for software
8134 completion (see Alpha architecture manual for details).
8135
8136 @item sui
8137 Like @samp{su}, but inexact traps are enabled as well.
8138 @end table
8139
8140 @item -mfp-rounding-mode=@var{rounding-mode}
8141 @opindex mfp-rounding-mode
8142 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8143 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8144 of:
8145
8146 @table @samp
8147 @item n
8148 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8149 the nearest machine number or towards the even machine number in case
8150 of a tie.
8151
8152 @item m
8153 Round towards minus infinity.
8154
8155 @item c
8156 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8157
8158 @item d
8159 Dynamic rounding mode.  A field in the floating point control register
8160 (@var{fpcr}, see Alpha architecture reference manual) controls the
8161 rounding mode in effect.  The C library initializes this register for
8162 rounding towards plus infinity.  Thus, unless your program modifies the
8163 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8164 @end table
8165
8166 @item -mtrap-precision=@var{trap-precision}
8167 @opindex mtrap-precision
8168 In the Alpha architecture, floating point traps are imprecise.  This
8169 means without software assistance it is impossible to recover from a
8170 floating trap and program execution normally needs to be terminated.
8171 GCC can generate code that can assist operating system trap handlers
8172 in determining the exact location that caused a floating point trap.
8173 Depending on the requirements of an application, different levels of
8174 precisions can be selected:
8175
8176 @table @samp
8177 @item p
8178 Program precision.  This option is the default and means a trap handler
8179 can only identify which program caused a floating point exception.
8180
8181 @item f
8182 Function precision.  The trap handler can determine the function that
8183 caused a floating point exception.
8184
8185 @item i
8186 Instruction precision.  The trap handler can determine the exact
8187 instruction that caused a floating point exception.
8188 @end table
8189
8190 Other Alpha compilers provide the equivalent options called
8191 @option{-scope_safe} and @option{-resumption_safe}.
8192
8193 @item -mieee-conformant
8194 @opindex mieee-conformant
8195 This option marks the generated code as IEEE conformant.  You must not
8196 use this option unless you also specify @option{-mtrap-precision=i} and either
8197 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8198 is to emit the line @samp{.eflag 48} in the function prologue of the
8199 generated assembly file.  Under DEC Unix, this has the effect that
8200 IEEE-conformant math library routines will be linked in.
8201
8202 @item -mbuild-constants
8203 @opindex mbuild-constants
8204 Normally GCC examines a 32- or 64-bit integer constant to
8205 see if it can construct it from smaller constants in two or three
8206 instructions.  If it cannot, it will output the constant as a literal and
8207 generate code to load it from the data segment at runtime.
8208
8209 Use this option to require GCC to construct @emph{all} integer constants
8210 using code, even if it takes more instructions (the maximum is six).
8211
8212 You would typically use this option to build a shared library dynamic
8213 loader.  Itself a shared library, it must relocate itself in memory
8214 before it can find the variables and constants in its own data segment.
8215
8216 @item -malpha-as
8217 @itemx -mgas
8218 @opindex malpha-as
8219 @opindex mgas
8220 Select whether to generate code to be assembled by the vendor-supplied
8221 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8222
8223 @item -mbwx
8224 @itemx -mno-bwx
8225 @itemx -mcix
8226 @itemx -mno-cix
8227 @itemx -mfix
8228 @itemx -mno-fix
8229 @itemx -mmax
8230 @itemx -mno-max
8231 @opindex mbwx
8232 @opindex mno-bwx
8233 @opindex mcix
8234 @opindex mno-cix
8235 @opindex mfix
8236 @opindex mno-fix
8237 @opindex mmax
8238 @opindex mno-max
8239 Indicate whether GCC should generate code to use the optional BWX,
8240 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8241 sets supported by the CPU type specified via @option{-mcpu=} option or that
8242 of the CPU on which GCC was built if none was specified.
8243
8244 @item -mfloat-vax
8245 @itemx -mfloat-ieee
8246 @opindex mfloat-vax
8247 @opindex mfloat-ieee
8248 Generate code that uses (does not use) VAX F and G floating point
8249 arithmetic instead of IEEE single and double precision.
8250
8251 @item -mexplicit-relocs
8252 @itemx -mno-explicit-relocs
8253 @opindex mexplicit-relocs
8254 @opindex mno-explicit-relocs
8255 Older Alpha assemblers provided no way to generate symbol relocations
8256 except via assembler macros.  Use of these macros does not allow
8257 optimal instruction scheduling.  GNU binutils as of version 2.12
8258 supports a new syntax that allows the compiler to explicitly mark
8259 which relocations should apply to which instructions.  This option
8260 is mostly useful for debugging, as GCC detects the capabilities of
8261 the assembler when it is built and sets the default accordingly.
8262
8263 @item -msmall-data
8264 @itemx -mlarge-data
8265 @opindex msmall-data
8266 @opindex mlarge-data
8267 When @option{-mexplicit-relocs} is in effect, static data is
8268 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
8269 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
8270 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
8271 16-bit relocations off of the @code{$gp} register.  This limits the
8272 size of the small data area to 64KB, but allows the variables to be
8273 directly accessed via a single instruction.
8274
8275 The default is @option{-mlarge-data}.  With this option the data area
8276 is limited to just below 2GB@.  Programs that require more than 2GB of
8277 data must use @code{malloc} or @code{mmap} to allocate the data in the
8278 heap instead of in the program's data segment.
8279
8280 When generating code for shared libraries, @option{-fpic} implies
8281 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
8282
8283 @item -msmall-text
8284 @itemx -mlarge-text
8285 @opindex msmall-text
8286 @opindex mlarge-text
8287 When @option{-msmall-text} is used, the compiler assumes that the
8288 code of the entire program (or shared library) fits in 4MB, and is
8289 thus reachable with a branch instruction.  When @option{-msmall-data}
8290 is used, the compiler can assume that all local symbols share the
8291 same @code{$gp} value, and thus reduce the number of instructions
8292 required for a function call from 4 to 1.
8293
8294 The default is @option{-mlarge-text}.
8295
8296 @item -mcpu=@var{cpu_type}
8297 @opindex mcpu
8298 Set the instruction set and instruction scheduling parameters for
8299 machine type @var{cpu_type}.  You can specify either the @samp{EV}
8300 style name or the corresponding chip number.  GCC supports scheduling
8301 parameters for the EV4, EV5 and EV6 family of processors and will
8302 choose the default values for the instruction set from the processor
8303 you specify.  If you do not specify a processor type, GCC will default
8304 to the processor on which the compiler was built.
8305
8306 Supported values for @var{cpu_type} are
8307
8308 @table @samp
8309 @item ev4
8310 @itemx ev45
8311 @itemx 21064
8312 Schedules as an EV4 and has no instruction set extensions.
8313
8314 @item ev5
8315 @itemx 21164
8316 Schedules as an EV5 and has no instruction set extensions.
8317
8318 @item ev56
8319 @itemx 21164a
8320 Schedules as an EV5 and supports the BWX extension.
8321
8322 @item pca56
8323 @itemx 21164pc
8324 @itemx 21164PC
8325 Schedules as an EV5 and supports the BWX and MAX extensions.
8326
8327 @item ev6
8328 @itemx 21264
8329 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
8330
8331 @item ev67
8332 @itemx 21264a
8333 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
8334 @end table
8335
8336 @item -mtune=@var{cpu_type}
8337 @opindex mtune
8338 Set only the instruction scheduling parameters for machine type
8339 @var{cpu_type}.  The instruction set is not changed.
8340
8341 @item -mmemory-latency=@var{time}
8342 @opindex mmemory-latency
8343 Sets the latency the scheduler should assume for typical memory
8344 references as seen by the application.  This number is highly
8345 dependent on the memory access patterns used by the application
8346 and the size of the external cache on the machine.
8347
8348 Valid options for @var{time} are
8349
8350 @table @samp
8351 @item @var{number}
8352 A decimal number representing clock cycles.
8353
8354 @item L1
8355 @itemx L2
8356 @itemx L3
8357 @itemx main
8358 The compiler contains estimates of the number of clock cycles for
8359 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
8360 (also called Dcache, Scache, and Bcache), as well as to main memory.
8361 Note that L3 is only valid for EV5.
8362
8363 @end table
8364 @end table
8365
8366 @node DEC Alpha/VMS Options
8367 @subsection DEC Alpha/VMS Options
8368
8369 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
8370
8371 @table @gcctabopt
8372 @item -mvms-return-codes
8373 @opindex mvms-return-codes
8374 Return VMS condition codes from main.  The default is to return POSIX
8375 style condition (e.g.@ error) codes.
8376 @end table
8377
8378 @node FRV Options
8379 @subsection FRV Options
8380 @cindex FRV Options
8381
8382 @table @gcctabopt
8383 @item -mgpr-32
8384 @opindex mgpr-32
8385
8386 Only use the first 32 general purpose registers.
8387
8388 @item -mgpr-64
8389 @opindex mgpr-64
8390
8391 Use all 64 general purpose registers.
8392
8393 @item -mfpr-32
8394 @opindex mfpr-32
8395
8396 Use only the first 32 floating point registers.
8397
8398 @item -mfpr-64
8399 @opindex mfpr-64
8400
8401 Use all 64 floating point registers
8402
8403 @item -mhard-float
8404 @opindex mhard-float
8405
8406 Use hardware instructions for floating point operations.
8407
8408 @item -msoft-float
8409 @opindex msoft-float
8410
8411 Use library routines for floating point operations.
8412
8413 @item -malloc-cc
8414 @opindex malloc-cc
8415
8416 Dynamically allocate condition code registers.
8417
8418 @item -mfixed-cc
8419 @opindex mfixed-cc
8420
8421 Do not try to dynamically allocate condition code registers, only
8422 use @code{icc0} and @code{fcc0}.
8423
8424 @item -mdword
8425 @opindex mdword
8426
8427 Change ABI to use double word insns.
8428
8429 @item -mno-dword
8430 @opindex mno-dword
8431
8432 Do not use double word instructions.
8433
8434 @item -mdouble
8435 @opindex mdouble
8436
8437 Use floating point double instructions.
8438
8439 @item -mno-double
8440 @opindex mno-double
8441
8442 Do not use floating point double instructions.
8443
8444 @item -mmedia
8445 @opindex mmedia
8446
8447 Use media instructions.
8448
8449 @item -mno-media
8450 @opindex mno-media
8451
8452 Do not use media instructions.
8453
8454 @item -mmuladd
8455 @opindex mmuladd
8456
8457 Use multiply and add/subtract instructions.
8458
8459 @item -mno-muladd
8460 @opindex mno-muladd
8461
8462 Do not use multiply and add/subtract instructions.
8463
8464 @item -mfdpic
8465 @opindex mfdpic
8466
8467 Select the FDPIC ABI, that uses function descriptors to represent
8468 pointers to functions.  Without any PIC/PIE-related options, it
8469 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
8470 assumes GOT entries and small data are within a 12-bit range from the
8471 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
8472 are computed with 32 bits.
8473
8474 @item -minline-plt
8475 @opindex minline-plt
8476
8477 Enable inlining of PLT entries in function calls to functions that are
8478 not known to bind locally.  It has no effect without @option{-mfdpic}.
8479 It's enabled by default if optimizing for speed and compiling for
8480 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
8481 optimization option such as @option{-O3} or above is present in the
8482 command line.
8483
8484 @item -mTLS
8485 @opindex TLS
8486
8487 Assume a large TLS segment when generating thread-local code.
8488
8489 @item -mtls
8490 @opindex tls
8491
8492 Do not assume a large TLS segment when generating thread-local code.
8493
8494 @item -mgprel-ro
8495 @opindex mgprel-ro
8496
8497 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
8498 that is known to be in read-only sections.  It's enabled by default,
8499 except for @option{-fpic} or @option{-fpie}: even though it may help
8500 make the global offset table smaller, it trades 1 instruction for 4.
8501 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
8502 one of which may be shared by multiple symbols, and it avoids the need
8503 for a GOT entry for the referenced symbol, so it's more likely to be a
8504 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
8505
8506 @item -multilib-library-pic
8507 @opindex multilib-library-pic
8508
8509 Link with the (library, not FD) pic libraries.  It's implied by
8510 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
8511 @option{-fpic} without @option{-mfdpic}.  You should never have to use
8512 it explicitly.
8513
8514 @item -mlinked-fp
8515 @opindex mlinked-fp
8516
8517 Follow the EABI requirement of always creating a frame pointer whenever
8518 a stack frame is allocated.  This option is enabled by default and can
8519 be disabled with @option{-mno-linked-fp}.
8520
8521 @item -mlong-calls
8522 @opindex mlong-calls
8523
8524 Use indirect addressing to call functions outside the current
8525 compilation unit.  This allows the functions to be placed anywhere
8526 within the 32-bit address space.
8527
8528 @item -malign-labels
8529 @opindex malign-labels
8530
8531 Try to align labels to an 8-byte boundary by inserting nops into the
8532 previous packet.  This option only has an effect when VLIW packing
8533 is enabled.  It doesn't create new packets; it merely adds nops to
8534 existing ones.
8535
8536 @item -mlibrary-pic
8537 @opindex mlibrary-pic
8538
8539 Generate position-independent EABI code.
8540
8541 @item -macc-4
8542 @opindex macc-4
8543
8544 Use only the first four media accumulator registers.
8545
8546 @item -macc-8
8547 @opindex macc-8
8548
8549 Use all eight media accumulator registers.
8550
8551 @item -mpack
8552 @opindex mpack
8553
8554 Pack VLIW instructions.
8555
8556 @item -mno-pack
8557 @opindex mno-pack
8558
8559 Do not pack VLIW instructions.
8560
8561 @item -mno-eflags
8562 @opindex mno-eflags
8563
8564 Do not mark ABI switches in e_flags.
8565
8566 @item -mcond-move
8567 @opindex mcond-move
8568
8569 Enable the use of conditional-move instructions (default).
8570
8571 This switch is mainly for debugging the compiler and will likely be removed
8572 in a future version.
8573
8574 @item -mno-cond-move
8575 @opindex mno-cond-move
8576
8577 Disable the use of conditional-move instructions.
8578
8579 This switch is mainly for debugging the compiler and will likely be removed
8580 in a future version.
8581
8582 @item -mscc
8583 @opindex mscc
8584
8585 Enable the use of conditional set instructions (default).
8586
8587 This switch is mainly for debugging the compiler and will likely be removed
8588 in a future version.
8589
8590 @item -mno-scc
8591 @opindex mno-scc
8592
8593 Disable the use of conditional set instructions.
8594
8595 This switch is mainly for debugging the compiler and will likely be removed
8596 in a future version.
8597
8598 @item -mcond-exec
8599 @opindex mcond-exec
8600
8601 Enable the use of conditional execution (default).
8602
8603 This switch is mainly for debugging the compiler and will likely be removed
8604 in a future version.
8605
8606 @item -mno-cond-exec
8607 @opindex mno-cond-exec
8608
8609 Disable the use of conditional execution.
8610
8611 This switch is mainly for debugging the compiler and will likely be removed
8612 in a future version.
8613
8614 @item -mvliw-branch
8615 @opindex mvliw-branch
8616
8617 Run a pass to pack branches into VLIW instructions (default).
8618
8619 This switch is mainly for debugging the compiler and will likely be removed
8620 in a future version.
8621
8622 @item -mno-vliw-branch
8623 @opindex mno-vliw-branch
8624
8625 Do not run a pass to pack branches into VLIW instructions.
8626
8627 This switch is mainly for debugging the compiler and will likely be removed
8628 in a future version.
8629
8630 @item -mmulti-cond-exec
8631 @opindex mmulti-cond-exec
8632
8633 Enable optimization of @code{&&} and @code{||} in conditional execution
8634 (default).
8635
8636 This switch is mainly for debugging the compiler and will likely be removed
8637 in a future version.
8638
8639 @item -mno-multi-cond-exec
8640 @opindex mno-multi-cond-exec
8641
8642 Disable optimization of @code{&&} and @code{||} in conditional execution.
8643
8644 This switch is mainly for debugging the compiler and will likely be removed
8645 in a future version.
8646
8647 @item -mnested-cond-exec
8648 @opindex mnested-cond-exec
8649
8650 Enable nested conditional execution optimizations (default).
8651
8652 This switch is mainly for debugging the compiler and will likely be removed
8653 in a future version.
8654
8655 @item -mno-nested-cond-exec
8656 @opindex mno-nested-cond-exec
8657
8658 Disable nested conditional execution optimizations.
8659
8660 This switch is mainly for debugging the compiler and will likely be removed
8661 in a future version.
8662
8663 @item -moptimize-membar
8664 @opindex moptimize-membar
8665
8666 This switch removes redundant @code{membar} instructions from the
8667 compiler generated code.  It is enabled by default.
8668
8669 @item -mno-optimize-membar
8670 @opindex mno-optimize-membar
8671
8672 This switch disables the automatic removal of redundant @code{membar}
8673 instructions from the generated code.
8674
8675 @item -mtomcat-stats
8676 @opindex mtomcat-stats
8677
8678 Cause gas to print out tomcat statistics.
8679
8680 @item -mcpu=@var{cpu}
8681 @opindex mcpu
8682
8683 Select the processor type for which to generate code.  Possible values are
8684 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
8685 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
8686
8687 @end table
8688
8689 @node GNU/Linux Options
8690 @subsection GNU/Linux Options
8691
8692 These @samp{-m} options are defined for GNU/Linux targets:
8693
8694 @table @gcctabopt
8695 @item -mglibc
8696 @opindex mglibc
8697 Use the GNU C library instead of uClibc.  This is the default except
8698 on @samp{*-*-linux-*uclibc*} targets.
8699
8700 @item -muclibc
8701 @opindex muclibc
8702 Use uClibc instead of the GNU C library.  This is the default on
8703 @samp{*-*-linux-*uclibc*} targets.
8704 @end table
8705
8706 @node H8/300 Options
8707 @subsection H8/300 Options
8708
8709 These @samp{-m} options are defined for the H8/300 implementations:
8710
8711 @table @gcctabopt
8712 @item -mrelax
8713 @opindex mrelax
8714 Shorten some address references at link time, when possible; uses the
8715 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
8716 ld, Using ld}, for a fuller description.
8717
8718 @item -mh
8719 @opindex mh
8720 Generate code for the H8/300H@.
8721
8722 @item -ms
8723 @opindex ms
8724 Generate code for the H8S@.
8725
8726 @item -mn
8727 @opindex mn
8728 Generate code for the H8S and H8/300H in the normal mode.  This switch
8729 must be used either with @option{-mh} or @option{-ms}.
8730
8731 @item -ms2600
8732 @opindex ms2600
8733 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
8734
8735 @item -mint32
8736 @opindex mint32
8737 Make @code{int} data 32 bits by default.
8738
8739 @item -malign-300
8740 @opindex malign-300
8741 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
8742 The default for the H8/300H and H8S is to align longs and floats on 4
8743 byte boundaries.
8744 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
8745 This option has no effect on the H8/300.
8746 @end table
8747
8748 @node HPPA Options
8749 @subsection HPPA Options
8750 @cindex HPPA Options
8751
8752 These @samp{-m} options are defined for the HPPA family of computers:
8753
8754 @table @gcctabopt
8755 @item -march=@var{architecture-type}
8756 @opindex march
8757 Generate code for the specified architecture.  The choices for
8758 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
8759 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
8760 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
8761 architecture option for your machine.  Code compiled for lower numbered
8762 architectures will run on higher numbered architectures, but not the
8763 other way around.
8764
8765 @item -mpa-risc-1-0
8766 @itemx -mpa-risc-1-1
8767 @itemx -mpa-risc-2-0
8768 @opindex mpa-risc-1-0
8769 @opindex mpa-risc-1-1
8770 @opindex mpa-risc-2-0
8771 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
8772
8773 @item -mbig-switch
8774 @opindex mbig-switch
8775 Generate code suitable for big switch tables.  Use this option only if
8776 the assembler/linker complain about out of range branches within a switch
8777 table.
8778
8779 @item -mjump-in-delay
8780 @opindex mjump-in-delay
8781 Fill delay slots of function calls with unconditional jump instructions
8782 by modifying the return pointer for the function call to be the target
8783 of the conditional jump.
8784
8785 @item -mdisable-fpregs
8786 @opindex mdisable-fpregs
8787 Prevent floating point registers from being used in any manner.  This is
8788 necessary for compiling kernels which perform lazy context switching of
8789 floating point registers.  If you use this option and attempt to perform
8790 floating point operations, the compiler will abort.
8791
8792 @item -mdisable-indexing
8793 @opindex mdisable-indexing
8794 Prevent the compiler from using indexing address modes.  This avoids some
8795 rather obscure problems when compiling MIG generated code under MACH@.
8796
8797 @item -mno-space-regs
8798 @opindex mno-space-regs
8799 Generate code that assumes the target has no space registers.  This allows
8800 GCC to generate faster indirect calls and use unscaled index address modes.
8801
8802 Such code is suitable for level 0 PA systems and kernels.
8803
8804 @item -mfast-indirect-calls
8805 @opindex mfast-indirect-calls
8806 Generate code that assumes calls never cross space boundaries.  This
8807 allows GCC to emit code which performs faster indirect calls.
8808
8809 This option will not work in the presence of shared libraries or nested
8810 functions.
8811
8812 @item -mfixed-range=@var{register-range}
8813 @opindex mfixed-range
8814 Generate code treating the given register range as fixed registers.
8815 A fixed register is one that the register allocator can not use.  This is
8816 useful when compiling kernel code.  A register range is specified as
8817 two registers separated by a dash.  Multiple register ranges can be
8818 specified separated by a comma.
8819
8820 @item -mlong-load-store
8821 @opindex mlong-load-store
8822 Generate 3-instruction load and store sequences as sometimes required by
8823 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
8824 the HP compilers.
8825
8826 @item -mportable-runtime
8827 @opindex mportable-runtime
8828 Use the portable calling conventions proposed by HP for ELF systems.
8829
8830 @item -mgas
8831 @opindex mgas
8832 Enable the use of assembler directives only GAS understands.
8833
8834 @item -mschedule=@var{cpu-type}
8835 @opindex mschedule
8836 Schedule code according to the constraints for the machine type
8837 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
8838 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
8839 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
8840 proper scheduling option for your machine.  The default scheduling is
8841 @samp{8000}.
8842
8843 @item -mlinker-opt
8844 @opindex mlinker-opt
8845 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
8846 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
8847 linkers in which they give bogus error messages when linking some programs.
8848
8849 @item -msoft-float
8850 @opindex msoft-float
8851 Generate output containing library calls for floating point.
8852 @strong{Warning:} the requisite libraries are not available for all HPPA
8853 targets.  Normally the facilities of the machine's usual C compiler are
8854 used, but this cannot be done directly in cross-compilation.  You must make
8855 your own arrangements to provide suitable library functions for
8856 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
8857 does provide software floating point support.
8858
8859 @option{-msoft-float} changes the calling convention in the output file;
8860 therefore, it is only useful if you compile @emph{all} of a program with
8861 this option.  In particular, you need to compile @file{libgcc.a}, the
8862 library that comes with GCC, with @option{-msoft-float} in order for
8863 this to work.
8864
8865 @item -msio
8866 @opindex msio
8867 Generate the predefine, @code{_SIO}, for server IO@.  The default is
8868 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
8869 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
8870 options are available under HP-UX and HI-UX@.
8871
8872 @item -mgnu-ld
8873 @opindex gnu-ld
8874 Use GNU ld specific options.  This passes @option{-shared} to ld when
8875 building a shared library.  It is the default when GCC is configured,
8876 explicitly or implicitly, with the GNU linker.  This option does not
8877 have any affect on which ld is called, it only changes what parameters
8878 are passed to that ld.  The ld that is called is determined by the
8879 @option{--with-ld} configure option, GCC's program search path, and
8880 finally by the user's @env{PATH}.  The linker used by GCC can be printed
8881 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
8882 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
8883
8884 @item -mhp-ld
8885 @opindex hp-ld
8886 Use HP ld specific options.  This passes @option{-b} to ld when building
8887 a shared library and passes @option{+Accept TypeMismatch} to ld on all
8888 links.  It is the default when GCC is configured, explicitly or
8889 implicitly, with the HP linker.  This option does not have any affect on
8890 which ld is called, it only changes what parameters are passed to that
8891 ld.  The ld that is called is determined by the @option{--with-ld}
8892 configure option, GCC's program search path, and finally by the user's
8893 @env{PATH}.  The linker used by GCC can be printed using @samp{which
8894 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
8895 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
8896
8897 @item -mlong-calls
8898 @opindex mno-long-calls
8899 Generate code that uses long call sequences.  This ensures that a call
8900 is always able to reach linker generated stubs.  The default is to generate
8901 long calls only when the distance from the call site to the beginning
8902 of the function or translation unit, as the case may be, exceeds a
8903 predefined limit set by the branch type being used.  The limits for
8904 normal calls are 7,600,000 and 240,000 bytes, respectively for the
8905 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
8906 240,000 bytes.
8907
8908 Distances are measured from the beginning of functions when using the
8909 @option{-ffunction-sections} option, or when using the @option{-mgas}
8910 and @option{-mno-portable-runtime} options together under HP-UX with
8911 the SOM linker.
8912
8913 It is normally not desirable to use this option as it will degrade
8914 performance.  However, it may be useful in large applications,
8915 particularly when partial linking is used to build the application.
8916
8917 The types of long calls used depends on the capabilities of the
8918 assembler and linker, and the type of code being generated.  The
8919 impact on systems that support long absolute calls, and long pic
8920 symbol-difference or pc-relative calls should be relatively small.
8921 However, an indirect call is used on 32-bit ELF systems in pic code
8922 and it is quite long.
8923
8924 @item -munix=@var{unix-std}
8925 @opindex march
8926 Generate compiler predefines and select a startfile for the specified
8927 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
8928 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
8929 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
8930 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
8931 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
8932 and later.
8933
8934 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
8935 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
8936 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
8937 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
8938 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
8939 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
8940
8941 It is @emph{important} to note that this option changes the interfaces
8942 for various library routines.  It also affects the operational behavior
8943 of the C library.  Thus, @emph{extreme} care is needed in using this
8944 option.
8945
8946 Library code that is intended to operate with more than one UNIX
8947 standard must test, set and restore the variable @var{__xpg4_extended_mask}
8948 as appropriate.  Most GNU software doesn't provide this capability.
8949
8950 @item -nolibdld
8951 @opindex nolibdld
8952 Suppress the generation of link options to search libdld.sl when the
8953 @option{-static} option is specified on HP-UX 10 and later.
8954
8955 @item -static
8956 @opindex static
8957 The HP-UX implementation of setlocale in libc has a dependency on
8958 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
8959 when the @option{-static} option is specified, special link options
8960 are needed to resolve this dependency.
8961
8962 On HP-UX 10 and later, the GCC driver adds the necessary options to
8963 link with libdld.sl when the @option{-static} option is specified.
8964 This causes the resulting binary to be dynamic.  On the 64-bit port,
8965 the linkers generate dynamic binaries by default in any case.  The
8966 @option{-nolibdld} option can be used to prevent the GCC driver from
8967 adding these link options.
8968
8969 @item -threads
8970 @opindex threads
8971 Add support for multithreading with the @dfn{dce thread} library
8972 under HP-UX@.  This option sets flags for both the preprocessor and
8973 linker.
8974 @end table
8975
8976 @node i386 and x86-64 Options
8977 @subsection Intel 386 and AMD x86-64 Options
8978 @cindex i386 Options
8979 @cindex x86-64 Options
8980 @cindex Intel 386 Options
8981 @cindex AMD x86-64 Options
8982
8983 These @samp{-m} options are defined for the i386 and x86-64 family of
8984 computers:
8985
8986 @table @gcctabopt
8987 @item -mtune=@var{cpu-type}
8988 @opindex mtune
8989 Tune to @var{cpu-type} everything applicable about the generated code, except
8990 for the ABI and the set of available instructions.  The choices for
8991 @var{cpu-type} are:
8992 @table @emph
8993 @item generic
8994 Produce code optimized for the most common IA32/AMD64/EM64T processors.
8995 If you know the CPU on which your code will run, then you should use
8996 the corresponding @option{-mtune} option instead of
8997 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
8998 of your application will have, then you should use this option.
8999
9000 As new processors are deployed in the marketplace, the behavior of this
9001 option will change.  Therefore, if you upgrade to a newer version of
9002 GCC, the code generated option will change to reflect the processors
9003 that were most common when that version of GCC was released.
9004
9005 There is no @option{-march=generic} option because @option{-march}
9006 indicates the instruction set the compiler can use, and there is no
9007 generic instruction set applicable to all processors.  In contrast,
9008 @option{-mtune} indicates the processor (or, in this case, collection of
9009 processors) for which the code is optimized.
9010 @item native
9011 This selects the CPU to tune for at compilation time by determining
9012 the processor type of the compiling machine.  Using @option{-mtune=native}
9013 will produce code optimized for the local machine under the constraints
9014 of the selected instruction set.  Using @option{-march=native} will
9015 enable all instruction subsets supported by the local machine (hence
9016 the result might not run on different machines).
9017 @item i386
9018 Original Intel's i386 CPU@.
9019 @item i486
9020 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9021 @item i586, pentium
9022 Intel Pentium CPU with no MMX support.
9023 @item pentium-mmx
9024 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9025 @item pentiumpro
9026 Intel PentiumPro CPU@.
9027 @item i686
9028 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9029 instruction set will be used, so the code will run on all i686 family chips.
9030 @item pentium2
9031 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9032 @item pentium3, pentium3m
9033 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9034 support.
9035 @item pentium-m
9036 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9037 support.  Used by Centrino notebooks.
9038 @item pentium4, pentium4m
9039 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9040 @item prescott
9041 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9042 set support.
9043 @item nocona
9044 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9045 SSE2 and SSE3 instruction set support.
9046 @item core2
9047 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9048 instruction set support.
9049 @item k6
9050 AMD K6 CPU with MMX instruction set support.
9051 @item k6-2, k6-3
9052 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9053 @item athlon, athlon-tbird
9054 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9055 support.
9056 @item athlon-4, athlon-xp, athlon-mp
9057 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9058 instruction set support.
9059 @item k8, opteron, athlon64, athlon-fx
9060 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9061 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9062 @item k8-sse3, opteron-sse3, athlon64-sse3
9063 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
9064 @item amdfam10, barcelona
9065 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
9066 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
9067 instruction set extensions.)
9068 @item winchip-c6
9069 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9070 set support.
9071 @item winchip2
9072 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9073 instruction set support.
9074 @item c3
9075 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9076 implemented for this chip.)
9077 @item c3-2
9078 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9079 implemented for this chip.)
9080 @item geode
9081 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9082 @end table
9083
9084 While picking a specific @var{cpu-type} will schedule things appropriately
9085 for that particular chip, the compiler will not generate any code that
9086 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9087 being used.
9088
9089 @item -march=@var{cpu-type}
9090 @opindex march
9091 Generate instructions for the machine type @var{cpu-type}.  The choices
9092 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9093 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9094
9095 @item -mcpu=@var{cpu-type}
9096 @opindex mcpu
9097 A deprecated synonym for @option{-mtune}.
9098
9099 @item -m386
9100 @itemx -m486
9101 @itemx -mpentium
9102 @itemx -mpentiumpro
9103 @opindex m386
9104 @opindex m486
9105 @opindex mpentium
9106 @opindex mpentiumpro
9107 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9108 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9109 These synonyms are deprecated.
9110
9111 @item -mfpmath=@var{unit}
9112 @opindex march
9113 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9114 for @var{unit} are:
9115
9116 @table @samp
9117 @item 387
9118 Use the standard 387 floating point coprocessor present majority of chips and
9119 emulated otherwise.  Code compiled with this option will run almost everywhere.
9120 The temporary results are computed in 80bit precision instead of precision
9121 specified by the type resulting in slightly different results compared to most
9122 of other chips.  See @option{-ffloat-store} for more detailed description.
9123
9124 This is the default choice for i386 compiler.
9125
9126 @item sse
9127 Use scalar floating point instructions present in the SSE instruction set.
9128 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9129 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9130 instruction set supports only single precision arithmetics, thus the double and
9131 extended precision arithmetics is still done using 387.  Later version, present
9132 only in Pentium4 and the future AMD x86-64 chips supports double precision
9133 arithmetics too.
9134
9135 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9136 or @option{-msse2} switches to enable SSE extensions and make this option
9137 effective.  For the x86-64 compiler, these extensions are enabled by default.
9138
9139 The resulting code should be considerably faster in the majority of cases and avoid
9140 the numerical instability problems of 387 code, but may break some existing
9141 code that expects temporaries to be 80bit.
9142
9143 This is the default choice for the x86-64 compiler.
9144
9145 @item sse,387
9146 Attempt to utilize both instruction sets at once.  This effectively double the
9147 amount of available registers and on chips with separate execution units for
9148 387 and SSE the execution resources too.  Use this option with care, as it is
9149 still experimental, because the GCC register allocator does not model separate
9150 functional units well resulting in instable performance.
9151 @end table
9152
9153 @item -masm=@var{dialect}
9154 @opindex masm=@var{dialect}
9155 Output asm instructions using selected @var{dialect}.  Supported
9156 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9157 not support @samp{intel}.
9158
9159 @item -mieee-fp
9160 @itemx -mno-ieee-fp
9161 @opindex mieee-fp
9162 @opindex mno-ieee-fp
9163 Control whether or not the compiler uses IEEE floating point
9164 comparisons.  These handle correctly the case where the result of a
9165 comparison is unordered.
9166
9167 @item -msoft-float
9168 @opindex msoft-float
9169 Generate output containing library calls for floating point.
9170 @strong{Warning:} the requisite libraries are not part of GCC@.
9171 Normally the facilities of the machine's usual C compiler are used, but
9172 this can't be done directly in cross-compilation.  You must make your
9173 own arrangements to provide suitable library functions for
9174 cross-compilation.
9175
9176 On machines where a function returns floating point results in the 80387
9177 register stack, some floating point opcodes may be emitted even if
9178 @option{-msoft-float} is used.
9179
9180 @item -mno-fp-ret-in-387
9181 @opindex mno-fp-ret-in-387
9182 Do not use the FPU registers for return values of functions.
9183
9184 The usual calling convention has functions return values of types
9185 @code{float} and @code{double} in an FPU register, even if there
9186 is no FPU@.  The idea is that the operating system should emulate
9187 an FPU@.
9188
9189 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9190 in ordinary CPU registers instead.
9191
9192 @item -mno-fancy-math-387
9193 @opindex mno-fancy-math-387
9194 Some 387 emulators do not support the @code{sin}, @code{cos} and
9195 @code{sqrt} instructions for the 387.  Specify this option to avoid
9196 generating those instructions.  This option is the default on
9197 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9198 indicates that the target cpu will always have an FPU and so the
9199 instruction will not need emulation.  As of revision 2.6.1, these
9200 instructions are not generated unless you also use the
9201 @option{-funsafe-math-optimizations} switch.
9202
9203 @item -malign-double
9204 @itemx -mno-align-double
9205 @opindex malign-double
9206 @opindex mno-align-double
9207 Control whether GCC aligns @code{double}, @code{long double}, and
9208 @code{long long} variables on a two word boundary or a one word
9209 boundary.  Aligning @code{double} variables on a two word boundary will
9210 produce code that runs somewhat faster on a @samp{Pentium} at the
9211 expense of more memory.
9212
9213 On x86-64, @option{-malign-double} is enabled by default.
9214
9215 @strong{Warning:} if you use the @option{-malign-double} switch,
9216 structures containing the above types will be aligned differently than
9217 the published application binary interface specifications for the 386
9218 and will not be binary compatible with structures in code compiled
9219 without that switch.
9220
9221 @item -m96bit-long-double
9222 @itemx -m128bit-long-double
9223 @opindex m96bit-long-double
9224 @opindex m128bit-long-double
9225 These switches control the size of @code{long double} type.  The i386
9226 application binary interface specifies the size to be 96 bits,
9227 so @option{-m96bit-long-double} is the default in 32 bit mode.
9228
9229 Modern architectures (Pentium and newer) would prefer @code{long double}
9230 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9231 conforming to the ABI, this would not be possible.  So specifying a
9232 @option{-m128bit-long-double} will align @code{long double}
9233 to a 16 byte boundary by padding the @code{long double} with an additional
9234 32 bit zero.
9235
9236 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9237 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9238
9239 Notice that neither of these options enable any extra precision over the x87
9240 standard of 80 bits for a @code{long double}.
9241
9242 @strong{Warning:} if you override the default value for your target ABI, the
9243 structures and arrays containing @code{long double} variables will change
9244 their size as well as function calling convention for function taking
9245 @code{long double} will be modified.  Hence they will not be binary
9246 compatible with arrays or structures in code compiled without that switch.
9247
9248 @item -mmlarge-data-threshold=@var{number}
9249 @opindex mlarge-data-threshold=@var{number}
9250 When @option{-mcmodel=medium} is specified, the data greater than
9251 @var{threshold} are placed in large data section.  This value must be the
9252 same across all object linked into the binary and defaults to 65535.
9253
9254 @item -msvr3-shlib
9255 @itemx -mno-svr3-shlib
9256 @opindex msvr3-shlib
9257 @opindex mno-svr3-shlib
9258 Control whether GCC places uninitialized local variables into the
9259 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9260 into @code{bss}.  These options are meaningful only on System V Release 3.
9261
9262 @item -mrtd
9263 @opindex mrtd
9264 Use a different function-calling convention, in which functions that
9265 take a fixed number of arguments return with the @code{ret} @var{num}
9266 instruction, which pops their arguments while returning.  This saves one
9267 instruction in the caller since there is no need to pop the arguments
9268 there.
9269
9270 You can specify that an individual function is called with this calling
9271 sequence with the function attribute @samp{stdcall}.  You can also
9272 override the @option{-mrtd} option by using the function attribute
9273 @samp{cdecl}.  @xref{Function Attributes}.
9274
9275 @strong{Warning:} this calling convention is incompatible with the one
9276 normally used on Unix, so you cannot use it if you need to call
9277 libraries compiled with the Unix compiler.
9278
9279 Also, you must provide function prototypes for all functions that
9280 take variable numbers of arguments (including @code{printf});
9281 otherwise incorrect code will be generated for calls to those
9282 functions.
9283
9284 In addition, seriously incorrect code will result if you call a
9285 function with too many arguments.  (Normally, extra arguments are
9286 harmlessly ignored.)
9287
9288 @item -mregparm=@var{num}
9289 @opindex mregparm
9290 Control how many registers are used to pass integer arguments.  By
9291 default, no registers are used to pass arguments, and at most 3
9292 registers can be used.  You can control this behavior for a specific
9293 function by using the function attribute @samp{regparm}.
9294 @xref{Function Attributes}.
9295
9296 @strong{Warning:} if you use this switch, and
9297 @var{num} is nonzero, then you must build all modules with the same
9298 value, including any libraries.  This includes the system libraries and
9299 startup modules.
9300
9301 @item -msseregparm
9302 @opindex msseregparm
9303 Use SSE register passing conventions for float and double arguments
9304 and return values.  You can control this behavior for a specific
9305 function by using the function attribute @samp{sseregparm}.
9306 @xref{Function Attributes}.
9307
9308 @strong{Warning:} if you use this switch then you must build all
9309 modules with the same value, including any libraries.  This includes
9310 the system libraries and startup modules.
9311
9312 @item -mstackrealign
9313 @opindex mstackrealign
9314 Realign the stack at entry.  On the Intel x86, the
9315 @option{-mstackrealign} option will generate an alternate prologue and
9316 epilogue that realigns the runtime stack.  This supports mixing legacy
9317 codes that keep a 4-byte aligned stack with modern codes that keep a
9318 16-byte stack for SSE compatibility.  The alternate prologue and
9319 epilogue are slower and bigger than the regular ones, and the
9320 alternate prologue requires an extra scratch register; this lowers the
9321 number of registers available if used in conjunction with the
9322 @code{regparm} attribute.  The @option{-mstackrealign} option is
9323 incompatible with the nested function prologue; this is considered a
9324 hard error.  See also the attribute @code{force_align_arg_pointer},
9325 applicable to individual functions.
9326
9327 @item -mpreferred-stack-boundary=@var{num}
9328 @opindex mpreferred-stack-boundary
9329 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
9330 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
9331 the default is 4 (16 bytes or 128 bits).
9332
9333 On Pentium and PentiumPro, @code{double} and @code{long double} values
9334 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
9335 suffer significant run time performance penalties.  On Pentium III, the
9336 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
9337 properly if it is not 16 byte aligned.
9338
9339 To ensure proper alignment of this values on the stack, the stack boundary
9340 must be as aligned as that required by any value stored on the stack.
9341 Further, every function must be generated such that it keeps the stack
9342 aligned.  Thus calling a function compiled with a higher preferred
9343 stack boundary from a function compiled with a lower preferred stack
9344 boundary will most likely misalign the stack.  It is recommended that
9345 libraries that use callbacks always use the default setting.
9346
9347 This extra alignment does consume extra stack space, and generally
9348 increases code size.  Code that is sensitive to stack space usage, such
9349 as embedded systems and operating system kernels, may want to reduce the
9350 preferred alignment to @option{-mpreferred-stack-boundary=2}.
9351
9352 @item -mmmx
9353 @itemx -mno-mmx
9354 @item -msse
9355 @itemx -mno-sse
9356 @item -msse2
9357 @itemx -mno-sse2
9358 @item -msse3
9359 @itemx -mno-sse3
9360 @item -mssse3
9361 @itemx -mno-ssse3
9362 @item -msse4a
9363 @item -mno-sse4a
9364 @item -m3dnow
9365 @itemx -mno-3dnow
9366 @item -mpopcnt
9367 @itemx -mno-popcnt
9368 @item -mabm
9369 @itemx -mno-abm
9370 @opindex mmmx
9371 @opindex mno-mmx
9372 @opindex msse
9373 @opindex mno-sse
9374 @opindex m3dnow
9375 @opindex mno-3dnow
9376 These switches enable or disable the use of instructions in the MMX,
9377 SSE, SSE2, SSE3, SSSE3, SSE4A, ABM or 3DNow! extended instruction sets.
9378 These extensions are also available as built-in functions: see
9379 @ref{X86 Built-in Functions}, for details of the functions enabled and
9380 disabled by these switches.
9381
9382 To have SSE/SSE2 instructions generated automatically from floating-point
9383 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
9384
9385 These options will enable GCC to use these extended instructions in
9386 generated code, even without @option{-mfpmath=sse}.  Applications which
9387 perform runtime CPU detection must compile separate files for each
9388 supported architecture, using the appropriate flags.  In particular,
9389 the file containing the CPU detection code should be compiled without
9390 these options.
9391
9392 @item -mpush-args
9393 @itemx -mno-push-args
9394 @opindex mpush-args
9395 @opindex mno-push-args
9396 Use PUSH operations to store outgoing parameters.  This method is shorter
9397 and usually equally fast as method using SUB/MOV operations and is enabled
9398 by default.  In some cases disabling it may improve performance because of
9399 improved scheduling and reduced dependencies.
9400
9401 @item -maccumulate-outgoing-args
9402 @opindex maccumulate-outgoing-args
9403 If enabled, the maximum amount of space required for outgoing arguments will be
9404 computed in the function prologue.  This is faster on most modern CPUs
9405 because of reduced dependencies, improved scheduling and reduced stack usage
9406 when preferred stack boundary is not equal to 2.  The drawback is a notable
9407 increase in code size.  This switch implies @option{-mno-push-args}.
9408
9409 @item -mthreads
9410 @opindex mthreads
9411 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
9412 on thread-safe exception handling must compile and link all code with the
9413 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
9414 @option{-D_MT}; when linking, it links in a special thread helper library
9415 @option{-lmingwthrd} which cleans up per thread exception handling data.
9416
9417 @item -mno-align-stringops
9418 @opindex mno-align-stringops
9419 Do not align destination of inlined string operations.  This switch reduces
9420 code size and improves performance in case the destination is already aligned,
9421 but GCC doesn't know about it.
9422
9423 @item -minline-all-stringops
9424 @opindex minline-all-stringops
9425 By default GCC inlines string operations only when destination is known to be
9426 aligned at least to 4 byte boundary.  This enables more inlining, increase code
9427 size, but may improve performance of code that depends on fast memcpy, strlen
9428 and memset for short lengths.
9429
9430 @item -momit-leaf-frame-pointer
9431 @opindex momit-leaf-frame-pointer
9432 Don't keep the frame pointer in a register for leaf functions.  This
9433 avoids the instructions to save, set up and restore frame pointers and
9434 makes an extra register available in leaf functions.  The option
9435 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9436 which might make debugging harder.
9437
9438 @item -mtls-direct-seg-refs
9439 @itemx -mno-tls-direct-seg-refs
9440 @opindex mtls-direct-seg-refs
9441 Controls whether TLS variables may be accessed with offsets from the
9442 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
9443 or whether the thread base pointer must be added.  Whether or not this
9444 is legal depends on the operating system, and whether it maps the
9445 segment to cover the entire TLS area.
9446
9447 For systems that use GNU libc, the default is on.
9448 @end table
9449
9450 These @samp{-m} switches are supported in addition to the above
9451 on AMD x86-64 processors in 64-bit environments.
9452
9453 @table @gcctabopt
9454 @item -m32
9455 @itemx -m64
9456 @opindex m32
9457 @opindex m64
9458 Generate code for a 32-bit or 64-bit environment.
9459 The 32-bit environment sets int, long and pointer to 32 bits and
9460 generates code that runs on any i386 system.
9461 The 64-bit environment sets int to 32 bits and long and pointer
9462 to 64 bits and generates code for AMD's x86-64 architecture. For
9463 darwin only the -m64 option turns off the @option{-fno-pic} and
9464 @option{-mdynamic-no-pic} options.
9465
9466 @item -mno-red-zone
9467 @opindex no-red-zone
9468 Do not use a so called red zone for x86-64 code.  The red zone is mandated
9469 by the x86-64 ABI, it is a 128-byte area beyond the location of the
9470 stack pointer that will not be modified by signal or interrupt handlers
9471 and therefore can be used for temporary data without adjusting the stack
9472 pointer.  The flag @option{-mno-red-zone} disables this red zone.
9473
9474 @item -mcmodel=small
9475 @opindex mcmodel=small
9476 Generate code for the small code model: the program and its symbols must
9477 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
9478 Programs can be statically or dynamically linked.  This is the default
9479 code model.
9480
9481 @item -mcmodel=kernel
9482 @opindex mcmodel=kernel
9483 Generate code for the kernel code model.  The kernel runs in the
9484 negative 2 GB of the address space.
9485 This model has to be used for Linux kernel code.
9486
9487 @item -mcmodel=medium
9488 @opindex mcmodel=medium
9489 Generate code for the medium model: The program is linked in the lower 2
9490 GB of the address space but symbols can be located anywhere in the
9491 address space.  Programs can be statically or dynamically linked, but
9492 building of shared libraries are not supported with the medium model.
9493
9494 @item -mcmodel=large
9495 @opindex mcmodel=large
9496 Generate code for the large model: This model makes no assumptions
9497 about addresses and sizes of sections.  Currently GCC does not implement
9498 this model.
9499 @end table
9500
9501 @node IA-64 Options
9502 @subsection IA-64 Options
9503 @cindex IA-64 Options
9504
9505 These are the @samp{-m} options defined for the Intel IA-64 architecture.
9506
9507 @table @gcctabopt
9508 @item -mbig-endian
9509 @opindex mbig-endian
9510 Generate code for a big endian target.  This is the default for HP-UX@.
9511
9512 @item -mlittle-endian
9513 @opindex mlittle-endian
9514 Generate code for a little endian target.  This is the default for AIX5
9515 and GNU/Linux.
9516
9517 @item -mgnu-as
9518 @itemx -mno-gnu-as
9519 @opindex mgnu-as
9520 @opindex mno-gnu-as
9521 Generate (or don't) code for the GNU assembler.  This is the default.
9522 @c Also, this is the default if the configure option @option{--with-gnu-as}
9523 @c is used.
9524
9525 @item -mgnu-ld
9526 @itemx -mno-gnu-ld
9527 @opindex mgnu-ld
9528 @opindex mno-gnu-ld
9529 Generate (or don't) code for the GNU linker.  This is the default.
9530 @c Also, this is the default if the configure option @option{--with-gnu-ld}
9531 @c is used.
9532
9533 @item -mno-pic
9534 @opindex mno-pic
9535 Generate code that does not use a global pointer register.  The result
9536 is not position independent code, and violates the IA-64 ABI@.
9537
9538 @item -mvolatile-asm-stop
9539 @itemx -mno-volatile-asm-stop
9540 @opindex mvolatile-asm-stop
9541 @opindex mno-volatile-asm-stop
9542 Generate (or don't) a stop bit immediately before and after volatile asm
9543 statements.
9544
9545 @item -mregister-names
9546 @itemx -mno-register-names
9547 @opindex mregister-names
9548 @opindex mno-register-names
9549 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
9550 the stacked registers.  This may make assembler output more readable.
9551
9552 @item -mno-sdata
9553 @itemx -msdata
9554 @opindex mno-sdata
9555 @opindex msdata
9556 Disable (or enable) optimizations that use the small data section.  This may
9557 be useful for working around optimizer bugs.
9558
9559 @item -mconstant-gp
9560 @opindex mconstant-gp
9561 Generate code that uses a single constant global pointer value.  This is
9562 useful when compiling kernel code.
9563
9564 @item -mauto-pic
9565 @opindex mauto-pic
9566 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
9567 This is useful when compiling firmware code.
9568
9569 @item -minline-float-divide-min-latency
9570 @opindex minline-float-divide-min-latency
9571 Generate code for inline divides of floating point values
9572 using the minimum latency algorithm.
9573
9574 @item -minline-float-divide-max-throughput
9575 @opindex minline-float-divide-max-throughput
9576 Generate code for inline divides of floating point values
9577 using the maximum throughput algorithm.
9578
9579 @item -minline-int-divide-min-latency
9580 @opindex minline-int-divide-min-latency
9581 Generate code for inline divides of integer values
9582 using the minimum latency algorithm.
9583
9584 @item -minline-int-divide-max-throughput
9585 @opindex minline-int-divide-max-throughput
9586 Generate code for inline divides of integer values
9587 using the maximum throughput algorithm.
9588
9589 @item -minline-sqrt-min-latency
9590 @opindex minline-sqrt-min-latency
9591 Generate code for inline square roots
9592 using the minimum latency algorithm.
9593
9594 @item -minline-sqrt-max-throughput
9595 @opindex minline-sqrt-max-throughput
9596 Generate code for inline square roots
9597 using the maximum throughput algorithm.
9598
9599 @item -mno-dwarf2-asm
9600 @itemx -mdwarf2-asm
9601 @opindex mno-dwarf2-asm
9602 @opindex mdwarf2-asm
9603 Don't (or do) generate assembler code for the DWARF2 line number debugging
9604 info.  This may be useful when not using the GNU assembler.
9605
9606 @item -mearly-stop-bits
9607 @itemx -mno-early-stop-bits
9608 @opindex mearly-stop-bits
9609 @opindex mno-early-stop-bits
9610 Allow stop bits to be placed earlier than immediately preceding the
9611 instruction that triggered the stop bit.  This can improve instruction
9612 scheduling, but does not always do so.
9613
9614 @item -mfixed-range=@var{register-range}
9615 @opindex mfixed-range
9616 Generate code treating the given register range as fixed registers.
9617 A fixed register is one that the register allocator can not use.  This is
9618 useful when compiling kernel code.  A register range is specified as
9619 two registers separated by a dash.  Multiple register ranges can be
9620 specified separated by a comma.
9621
9622 @item -mtls-size=@var{tls-size}
9623 @opindex mtls-size
9624 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
9625 64.
9626
9627 @item -mtune=@var{cpu-type}
9628 @opindex mtune
9629 Tune the instruction scheduling for a particular CPU, Valid values are
9630 itanium, itanium1, merced, itanium2, and mckinley.
9631
9632 @item -mt
9633 @itemx -pthread
9634 @opindex mt
9635 @opindex pthread
9636 Add support for multithreading using the POSIX threads library.  This
9637 option sets flags for both the preprocessor and linker.  It does
9638 not affect the thread safety of object code produced by the compiler or
9639 that of libraries supplied with it.  These are HP-UX specific flags.
9640
9641 @item -milp32
9642 @itemx -mlp64
9643 @opindex milp32
9644 @opindex mlp64
9645 Generate code for a 32-bit or 64-bit environment.
9646 The 32-bit environment sets int, long and pointer to 32 bits.
9647 The 64-bit environment sets int to 32 bits and long and pointer
9648 to 64 bits.  These are HP-UX specific flags.
9649
9650 @item -mno-sched-br-data-spec
9651 @itemx -msched-br-data-spec
9652 @opindex mno-sched-br-data-spec
9653 @opindex msched-br-data-spec
9654 (Dis/En)able data speculative scheduling before reload.
9655 This will result in generation of the ld.a instructions and
9656 the corresponding check instructions (ld.c / chk.a).
9657 The default is 'disable'.
9658
9659 @item -msched-ar-data-spec
9660 @itemx -mno-sched-ar-data-spec
9661 @opindex msched-ar-data-spec
9662 @opindex mno-sched-ar-data-spec
9663 (En/Dis)able data speculative scheduling after reload.
9664 This will result in generation of the ld.a instructions and
9665 the corresponding check instructions (ld.c / chk.a).
9666 The default is 'enable'.
9667
9668 @item -mno-sched-control-spec
9669 @itemx -msched-control-spec
9670 @opindex mno-sched-control-spec
9671 @opindex msched-control-spec
9672 (Dis/En)able control speculative scheduling.  This feature is
9673 available only during region scheduling (i.e. before reload).
9674 This will result in generation of the ld.s instructions and
9675 the corresponding check instructions chk.s .
9676 The default is 'disable'.
9677
9678 @item -msched-br-in-data-spec
9679 @itemx -mno-sched-br-in-data-spec
9680 @opindex msched-br-in-data-spec
9681 @opindex mno-sched-br-in-data-spec
9682 (En/Dis)able speculative scheduling of the instructions that
9683 are dependent on the data speculative loads before reload.
9684 This is effective only with @option{-msched-br-data-spec} enabled.
9685 The default is 'enable'.
9686
9687 @item -msched-ar-in-data-spec
9688 @itemx -mno-sched-ar-in-data-spec
9689 @opindex msched-ar-in-data-spec
9690 @opindex mno-sched-ar-in-data-spec
9691 (En/Dis)able speculative scheduling of the instructions that
9692 are dependent on the data speculative loads after reload.
9693 This is effective only with @option{-msched-ar-data-spec} enabled.
9694 The default is 'enable'.
9695
9696 @item -msched-in-control-spec
9697 @itemx -mno-sched-in-control-spec
9698 @opindex msched-in-control-spec
9699 @opindex mno-sched-in-control-spec
9700 (En/Dis)able speculative scheduling of the instructions that
9701 are dependent on the control speculative loads.
9702 This is effective only with @option{-msched-control-spec} enabled.
9703 The default is 'enable'.
9704
9705 @item -msched-ldc
9706 @itemx -mno-sched-ldc
9707 @opindex msched-ldc
9708 @opindex mno-sched-ldc
9709 (En/Dis)able use of simple data speculation checks ld.c .
9710 If disabled, only chk.a instructions will be emitted to check
9711 data speculative loads.
9712 The default is 'enable'.
9713
9714 @item -mno-sched-control-ldc
9715 @itemx -msched-control-ldc
9716 @opindex mno-sched-control-ldc
9717 @opindex msched-control-ldc 
9718 (Dis/En)able use of ld.c instructions to check control speculative loads.
9719 If enabled, in case of control speculative load with no speculatively
9720 scheduled dependent instructions this load will be emitted as ld.sa and
9721 ld.c will be used to check it.
9722 The default is 'disable'.
9723
9724 @item -mno-sched-spec-verbose
9725 @itemx -msched-spec-verbose
9726 @opindex mno-sched-spec-verbose
9727 @opindex msched-spec-verbose
9728 (Dis/En)able printing of the information about speculative motions.
9729
9730 @item -mno-sched-prefer-non-data-spec-insns
9731 @itemx -msched-prefer-non-data-spec-insns
9732 @opindex mno-sched-prefer-non-data-spec-insns
9733 @opindex msched-prefer-non-data-spec-insns
9734 If enabled, data speculative instructions will be chosen for schedule
9735 only if there are no other choices at the moment.  This will make
9736 the use of the data speculation much more conservative.
9737 The default is 'disable'.
9738
9739 @item -mno-sched-prefer-non-control-spec-insns
9740 @itemx -msched-prefer-non-control-spec-insns
9741 @opindex mno-sched-prefer-non-control-spec-insns
9742 @opindex msched-prefer-non-control-spec-insns
9743 If enabled, control speculative instructions will be chosen for schedule
9744 only if there are no other choices at the moment.  This will make
9745 the use of the control speculation much more conservative.
9746 The default is 'disable'.
9747
9748 @item -mno-sched-count-spec-in-critical-path
9749 @itemx -msched-count-spec-in-critical-path
9750 @opindex mno-sched-count-spec-in-critical-path
9751 @opindex msched-count-spec-in-critical-path
9752 If enabled, speculative dependencies will be considered during
9753 computation of the instructions priorities.  This will make the use of the
9754 speculation a bit more conservative.
9755 The default is 'disable'.
9756
9757 @end table
9758
9759 @node M32C Options
9760 @subsection M32C Options
9761 @cindex M32C options
9762
9763 @table @gcctabopt
9764 @item -mcpu=@var{name}
9765 @opindex mcpu=
9766 Select the CPU for which code is generated.  @var{name} may be one of
9767 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
9768 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
9769 the M32C/80 series.
9770
9771 @item -msim
9772 @opindex msim
9773 Specifies that the program will be run on the simulator.  This causes
9774 an alternate runtime library to be linked in which supports, for
9775 example, file I/O.  You must not use this option when generating
9776 programs that will run on real hardware; you must provide your own
9777 runtime library for whatever I/O functions are needed.
9778
9779 @item -memregs=@var{number}
9780 @opindex memregs=
9781 Specifies the number of memory-based pseudo-registers GCC will use
9782 during code generation.  These pseudo-registers will be used like real
9783 registers, so there is a tradeoff between GCC's ability to fit the
9784 code into available registers, and the performance penalty of using
9785 memory instead of registers.  Note that all modules in a program must
9786 be compiled with the same value for this option.  Because of that, you
9787 must not use this option with the default runtime libraries gcc
9788 builds.
9789
9790 @end table
9791
9792 @node M32R/D Options
9793 @subsection M32R/D Options
9794 @cindex M32R/D options
9795
9796 These @option{-m} options are defined for Renesas M32R/D architectures:
9797
9798 @table @gcctabopt
9799 @item -m32r2
9800 @opindex m32r2
9801 Generate code for the M32R/2@.
9802
9803 @item -m32rx
9804 @opindex m32rx
9805 Generate code for the M32R/X@.
9806
9807 @item -m32r
9808 @opindex m32r
9809 Generate code for the M32R@.  This is the default.
9810
9811 @item -mmodel=small
9812 @opindex mmodel=small
9813 Assume all objects live in the lower 16MB of memory (so that their addresses
9814 can be loaded with the @code{ld24} instruction), and assume all subroutines
9815 are reachable with the @code{bl} instruction.
9816 This is the default.
9817
9818 The addressability of a particular object can be set with the
9819 @code{model} attribute.
9820
9821 @item -mmodel=medium
9822 @opindex mmodel=medium
9823 Assume objects may be anywhere in the 32-bit address space (the compiler
9824 will generate @code{seth/add3} instructions to load their addresses), and
9825 assume all subroutines are reachable with the @code{bl} instruction.
9826
9827 @item -mmodel=large
9828 @opindex mmodel=large
9829 Assume objects may be anywhere in the 32-bit address space (the compiler
9830 will generate @code{seth/add3} instructions to load their addresses), and
9831 assume subroutines may not be reachable with the @code{bl} instruction
9832 (the compiler will generate the much slower @code{seth/add3/jl}
9833 instruction sequence).
9834
9835 @item -msdata=none
9836 @opindex msdata=none
9837 Disable use of the small data area.  Variables will be put into
9838 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
9839 @code{section} attribute has been specified).
9840 This is the default.
9841
9842 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
9843 Objects may be explicitly put in the small data area with the
9844 @code{section} attribute using one of these sections.
9845
9846 @item -msdata=sdata
9847 @opindex msdata=sdata
9848 Put small global and static data in the small data area, but do not
9849 generate special code to reference them.
9850
9851 @item -msdata=use
9852 @opindex msdata=use
9853 Put small global and static data in the small data area, and generate
9854 special instructions to reference them.
9855
9856 @item -G @var{num}
9857 @opindex G
9858 @cindex smaller data references
9859 Put global and static objects less than or equal to @var{num} bytes
9860 into the small data or bss sections instead of the normal data or bss
9861 sections.  The default value of @var{num} is 8.
9862 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
9863 for this option to have any effect.
9864
9865 All modules should be compiled with the same @option{-G @var{num}} value.
9866 Compiling with different values of @var{num} may or may not work; if it
9867 doesn't the linker will give an error message---incorrect code will not be
9868 generated.
9869
9870 @item -mdebug
9871 @opindex mdebug
9872 Makes the M32R specific code in the compiler display some statistics
9873 that might help in debugging programs.
9874
9875 @item -malign-loops
9876 @opindex malign-loops
9877 Align all loops to a 32-byte boundary.
9878
9879 @item -mno-align-loops
9880 @opindex mno-align-loops
9881 Do not enforce a 32-byte alignment for loops.  This is the default.
9882
9883 @item -missue-rate=@var{number}
9884 @opindex missue-rate=@var{number}
9885 Issue @var{number} instructions per cycle.  @var{number} can only be 1
9886 or 2.
9887
9888 @item -mbranch-cost=@var{number}
9889 @opindex mbranch-cost=@var{number}
9890 @var{number} can only be 1 or 2.  If it is 1 then branches will be
9891 preferred over conditional code, if it is 2, then the opposite will
9892 apply.
9893
9894 @item -mflush-trap=@var{number}
9895 @opindex mflush-trap=@var{number}
9896 Specifies the trap number to use to flush the cache.  The default is
9897 12.  Valid numbers are between 0 and 15 inclusive.
9898
9899 @item -mno-flush-trap
9900 @opindex mno-flush-trap
9901 Specifies that the cache cannot be flushed by using a trap.
9902
9903 @item -mflush-func=@var{name}
9904 @opindex mflush-func=@var{name}
9905 Specifies the name of the operating system function to call to flush
9906 the cache.  The default is @emph{_flush_cache}, but a function call
9907 will only be used if a trap is not available.
9908
9909 @item -mno-flush-func
9910 @opindex mno-flush-func
9911 Indicates that there is no OS function for flushing the cache.
9912
9913 @end table
9914
9915 @node M680x0 Options
9916 @subsection M680x0 Options
9917 @cindex M680x0 options
9918
9919 These are the @samp{-m} options defined for the 68000 series.  The default
9920 values for these options depends on which style of 68000 was selected when
9921 the compiler was configured; the defaults for the most common choices are
9922 given below.
9923
9924 @table @gcctabopt
9925 @item -m68000
9926 @itemx -mc68000
9927 @opindex m68000
9928 @opindex mc68000
9929 Generate output for a 68000.  This is the default
9930 when the compiler is configured for 68000-based systems.
9931
9932 Use this option for microcontrollers with a 68000 or EC000 core,
9933 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
9934
9935 @item -m68020
9936 @itemx -mc68020
9937 @opindex m68020
9938 @opindex mc68020
9939 Generate output for a 68020.  This is the default
9940 when the compiler is configured for 68020-based systems.
9941
9942 @item -m68881
9943 @opindex m68881
9944 Generate output containing 68881 instructions for floating point.
9945 This is the default for most 68020 systems unless @option{--nfp} was
9946 specified when the compiler was configured.
9947
9948 @item -m68030
9949 @opindex m68030
9950 Generate output for a 68030.  This is the default when the compiler is
9951 configured for 68030-based systems.
9952
9953 @item -m68040
9954 @opindex m68040
9955 Generate output for a 68040.  This is the default when the compiler is
9956 configured for 68040-based systems.
9957
9958 This option inhibits the use of 68881/68882 instructions that have to be
9959 emulated by software on the 68040.  Use this option if your 68040 does not
9960 have code to emulate those instructions.
9961
9962 @item -m68060
9963 @opindex m68060
9964 Generate output for a 68060.  This is the default when the compiler is
9965 configured for 68060-based systems.
9966
9967 This option inhibits the use of 68020 and 68881/68882 instructions that
9968 have to be emulated by software on the 68060.  Use this option if your 68060
9969 does not have code to emulate those instructions.
9970
9971 @item -mcpu32
9972 @opindex mcpu32
9973 Generate output for a CPU32.  This is the default
9974 when the compiler is configured for CPU32-based systems.
9975
9976 Use this option for microcontrollers with a
9977 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
9978 68336, 68340, 68341, 68349 and 68360.
9979
9980 @item -m5200
9981 @opindex m5200
9982 Generate output for a 520X ``coldfire'' family cpu.  This is the default
9983 when the compiler is configured for 520X-based systems.
9984
9985 Use this option for microcontroller with a 5200 core, including
9986 the MCF5202, MCF5203, MCF5204 and MCF5202.
9987
9988 @item -mcfv4e
9989 @opindex mcfv4e
9990 Generate output for a ColdFire V4e family cpu (e.g.@: 547x/548x).
9991 This includes use of hardware floating point instructions.
9992
9993 @item -m68020-40
9994 @opindex m68020-40
9995 Generate output for a 68040, without using any of the new instructions.
9996 This results in code which can run relatively efficiently on either a
9997 68020/68881 or a 68030 or a 68040.  The generated code does use the
9998 68881 instructions that are emulated on the 68040.
9999
10000 @item -m68020-60
10001 @opindex m68020-60
10002 Generate output for a 68060, without using any of the new instructions.
10003 This results in code which can run relatively efficiently on either a
10004 68020/68881 or a 68030 or a 68040.  The generated code does use the
10005 68881 instructions that are emulated on the 68060.
10006
10007 @item -msoft-float
10008 @opindex msoft-float
10009 Generate output containing library calls for floating point.
10010 @strong{Warning:} the requisite libraries are not available for all m68k
10011 targets.  Normally the facilities of the machine's usual C compiler are
10012 used, but this can't be done directly in cross-compilation.  You must
10013 make your own arrangements to provide suitable library functions for
10014 cross-compilation.  The embedded targets @samp{m68k-*-aout} and
10015 @samp{m68k-*-coff} do provide software floating point support.
10016
10017 @item -mshort
10018 @opindex mshort
10019 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10020 Additionally, parameters passed on the stack are also aligned to a
10021 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10022
10023 @item -mnobitfield
10024 @opindex mnobitfield
10025 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10026 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10027
10028 @item -mbitfield
10029 @opindex mbitfield
10030 Do use the bit-field instructions.  The @option{-m68020} option implies
10031 @option{-mbitfield}.  This is the default if you use a configuration
10032 designed for a 68020.
10033
10034 @item -mrtd
10035 @opindex mrtd
10036 Use a different function-calling convention, in which functions
10037 that take a fixed number of arguments return with the @code{rtd}
10038 instruction, which pops their arguments while returning.  This
10039 saves one instruction in the caller since there is no need to pop
10040 the arguments there.
10041
10042 This calling convention is incompatible with the one normally
10043 used on Unix, so you cannot use it if you need to call libraries
10044 compiled with the Unix compiler.
10045
10046 Also, you must provide function prototypes for all functions that
10047 take variable numbers of arguments (including @code{printf});
10048 otherwise incorrect code will be generated for calls to those
10049 functions.
10050
10051 In addition, seriously incorrect code will result if you call a
10052 function with too many arguments.  (Normally, extra arguments are
10053 harmlessly ignored.)
10054
10055 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10056 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10057
10058 @item -malign-int
10059 @itemx -mno-align-int
10060 @opindex malign-int
10061 @opindex mno-align-int
10062 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10063 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10064 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10065 Aligning variables on 32-bit boundaries produces code that runs somewhat
10066 faster on processors with 32-bit busses at the expense of more memory.
10067
10068 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
10069 align structures containing the above types  differently than
10070 most published application binary interface specifications for the m68k.
10071
10072 @item -mpcrel
10073 @opindex mpcrel
10074 Use the pc-relative addressing mode of the 68000 directly, instead of
10075 using a global offset table.  At present, this option implies @option{-fpic},
10076 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
10077 not presently supported with @option{-mpcrel}, though this could be supported for
10078 68020 and higher processors.
10079
10080 @item -mno-strict-align
10081 @itemx -mstrict-align
10082 @opindex mno-strict-align
10083 @opindex mstrict-align
10084 Do not (do) assume that unaligned memory references will be handled by
10085 the system.
10086
10087 @item -msep-data
10088 Generate code that allows the data segment to be located in a different
10089 area of memory from the text segment.  This allows for execute in place in
10090 an environment without virtual memory management.  This option implies
10091 @option{-fPIC}.
10092
10093 @item -mno-sep-data
10094 Generate code that assumes that the data segment follows the text segment.
10095 This is the default.
10096
10097 @item -mid-shared-library
10098 Generate code that supports shared libraries via the library ID method.
10099 This allows for execute in place and shared libraries in an environment
10100 without virtual memory management.  This option implies @option{-fPIC}.
10101
10102 @item -mno-id-shared-library
10103 Generate code that doesn't assume ID based shared libraries are being used.
10104 This is the default.
10105
10106 @item -mshared-library-id=n
10107 Specified the identification number of the ID based shared library being
10108 compiled.  Specifying a value of 0 will generate more compact code, specifying
10109 other values will force the allocation of that number to the current
10110 library but is no more space or time efficient than omitting this option.
10111
10112 @end table
10113
10114 @node M68hc1x Options
10115 @subsection M68hc1x Options
10116 @cindex M68hc1x options
10117
10118 These are the @samp{-m} options defined for the 68hc11 and 68hc12
10119 microcontrollers.  The default values for these options depends on
10120 which style of microcontroller was selected when the compiler was configured;
10121 the defaults for the most common choices are given below.
10122
10123 @table @gcctabopt
10124 @item -m6811
10125 @itemx -m68hc11
10126 @opindex m6811
10127 @opindex m68hc11
10128 Generate output for a 68HC11.  This is the default
10129 when the compiler is configured for 68HC11-based systems.
10130
10131 @item -m6812
10132 @itemx -m68hc12
10133 @opindex m6812
10134 @opindex m68hc12
10135 Generate output for a 68HC12.  This is the default
10136 when the compiler is configured for 68HC12-based systems.
10137
10138 @item -m68S12
10139 @itemx -m68hcs12
10140 @opindex m68S12
10141 @opindex m68hcs12
10142 Generate output for a 68HCS12.
10143
10144 @item -mauto-incdec
10145 @opindex mauto-incdec
10146 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
10147 addressing modes.
10148
10149 @item -minmax
10150 @itemx -nominmax
10151 @opindex minmax
10152 @opindex mnominmax
10153 Enable the use of 68HC12 min and max instructions.
10154
10155 @item -mlong-calls
10156 @itemx -mno-long-calls
10157 @opindex mlong-calls
10158 @opindex mno-long-calls
10159 Treat all calls as being far away (near).  If calls are assumed to be
10160 far away, the compiler will use the @code{call} instruction to
10161 call a function and the @code{rtc} instruction for returning.
10162
10163 @item -mshort
10164 @opindex mshort
10165 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10166
10167 @item -msoft-reg-count=@var{count}
10168 @opindex msoft-reg-count
10169 Specify the number of pseudo-soft registers which are used for the
10170 code generation.  The maximum number is 32.  Using more pseudo-soft
10171 register may or may not result in better code depending on the program.
10172 The default is 4 for 68HC11 and 2 for 68HC12.
10173
10174 @end table
10175
10176 @node MCore Options
10177 @subsection MCore Options
10178 @cindex MCore options
10179
10180 These are the @samp{-m} options defined for the Motorola M*Core
10181 processors.
10182
10183 @table @gcctabopt
10184
10185 @item -mhardlit
10186 @itemx -mno-hardlit
10187 @opindex mhardlit
10188 @opindex mno-hardlit
10189 Inline constants into the code stream if it can be done in two
10190 instructions or less.
10191
10192 @item -mdiv
10193 @itemx -mno-div
10194 @opindex mdiv
10195 @opindex mno-div
10196 Use the divide instruction.  (Enabled by default).
10197
10198 @item -mrelax-immediate
10199 @itemx -mno-relax-immediate
10200 @opindex mrelax-immediate
10201 @opindex mno-relax-immediate
10202 Allow arbitrary sized immediates in bit operations.
10203
10204 @item -mwide-bitfields
10205 @itemx -mno-wide-bitfields
10206 @opindex mwide-bitfields
10207 @opindex mno-wide-bitfields
10208 Always treat bit-fields as int-sized.
10209
10210 @item -m4byte-functions
10211 @itemx -mno-4byte-functions
10212 @opindex m4byte-functions
10213 @opindex mno-4byte-functions
10214 Force all functions to be aligned to a four byte boundary.
10215
10216 @item -mcallgraph-data
10217 @itemx -mno-callgraph-data
10218 @opindex mcallgraph-data
10219 @opindex mno-callgraph-data
10220 Emit callgraph information.
10221
10222 @item -mslow-bytes
10223 @itemx -mno-slow-bytes
10224 @opindex mslow-bytes
10225 @opindex mno-slow-bytes
10226 Prefer word access when reading byte quantities.
10227
10228 @item -mlittle-endian
10229 @itemx -mbig-endian
10230 @opindex mlittle-endian
10231 @opindex mbig-endian
10232 Generate code for a little endian target.
10233
10234 @item -m210
10235 @itemx -m340
10236 @opindex m210
10237 @opindex m340
10238 Generate code for the 210 processor.
10239 @end table
10240
10241 @node MIPS Options
10242 @subsection MIPS Options
10243 @cindex MIPS options
10244
10245 @table @gcctabopt
10246
10247 @item -EB
10248 @opindex EB
10249 Generate big-endian code.
10250
10251 @item -EL
10252 @opindex EL
10253 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
10254 configurations.
10255
10256 @item -march=@var{arch}
10257 @opindex march
10258 Generate code that will run on @var{arch}, which can be the name of a
10259 generic MIPS ISA, or the name of a particular processor.
10260 The ISA names are:
10261 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
10262 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
10263 The processor names are:
10264 @samp{4kc}, @samp{4km}, @samp{4kp},
10265 @samp{5kc}, @samp{5kf},
10266 @samp{20kc},
10267 @samp{24k}, @samp{24kc}, @samp{24kf}, @samp{24kx},
10268 @samp{m4k},
10269 @samp{orion},
10270 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
10271 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
10272 @samp{rm7000}, @samp{rm9000},
10273 @samp{sb1},
10274 @samp{sr71000},
10275 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
10276 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
10277 The special value @samp{from-abi} selects the
10278 most compatible architecture for the selected ABI (that is,
10279 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
10280
10281 In processor names, a final @samp{000} can be abbreviated as @samp{k}
10282 (for example, @samp{-march=r2k}).  Prefixes are optional, and
10283 @samp{vr} may be written @samp{r}.
10284
10285 GCC defines two macros based on the value of this option.  The first
10286 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
10287 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
10288 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
10289 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
10290 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
10291
10292 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
10293 above.  In other words, it will have the full prefix and will not
10294 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
10295 the macro names the resolved architecture (either @samp{"mips1"} or
10296 @samp{"mips3"}).  It names the default architecture when no
10297 @option{-march} option is given.
10298
10299 @item -mtune=@var{arch}
10300 @opindex mtune
10301 Optimize for @var{arch}.  Among other things, this option controls
10302 the way instructions are scheduled, and the perceived cost of arithmetic
10303 operations.  The list of @var{arch} values is the same as for
10304 @option{-march}.
10305
10306 When this option is not used, GCC will optimize for the processor
10307 specified by @option{-march}.  By using @option{-march} and
10308 @option{-mtune} together, it is possible to generate code that will
10309 run on a family of processors, but optimize the code for one
10310 particular member of that family.
10311
10312 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
10313 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
10314 @samp{-march} ones described above.
10315
10316 @item -mips1
10317 @opindex mips1
10318 Equivalent to @samp{-march=mips1}.
10319
10320 @item -mips2
10321 @opindex mips2
10322 Equivalent to @samp{-march=mips2}.
10323
10324 @item -mips3
10325 @opindex mips3
10326 Equivalent to @samp{-march=mips3}.
10327
10328 @item -mips4
10329 @opindex mips4
10330 Equivalent to @samp{-march=mips4}.
10331
10332 @item -mips32
10333 @opindex mips32
10334 Equivalent to @samp{-march=mips32}.
10335
10336 @item -mips32r2
10337 @opindex mips32r2
10338 Equivalent to @samp{-march=mips32r2}.
10339
10340 @item -mips64
10341 @opindex mips64
10342 Equivalent to @samp{-march=mips64}.
10343
10344 @item -mips16
10345 @itemx -mno-mips16
10346 @opindex mips16
10347 @opindex mno-mips16
10348 Generate (do not generate) MIPS16 code.  If GCC is targetting a
10349 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
10350
10351 @item -mabi=32
10352 @itemx -mabi=o64
10353 @itemx -mabi=n32
10354 @itemx -mabi=64
10355 @itemx -mabi=eabi
10356 @opindex mabi=32
10357 @opindex mabi=o64
10358 @opindex mabi=n32
10359 @opindex mabi=64
10360 @opindex mabi=eabi
10361 Generate code for the given ABI@.
10362
10363 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
10364 generates 64-bit code when you select a 64-bit architecture, but you
10365 can use @option{-mgp32} to get 32-bit code instead.
10366
10367 For information about the O64 ABI, see
10368 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
10369
10370 @item -mabicalls
10371 @itemx -mno-abicalls
10372 @opindex mabicalls
10373 @opindex mno-abicalls
10374 Generate (do not generate) code that is suitable for SVR4-style
10375 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
10376 systems.
10377
10378 @item -mshared
10379 @itemx -mno-shared
10380 Generate (do not generate) code that is fully position-independent,
10381 and that can therefore be linked into shared libraries.  This option
10382 only affects @option{-mabicalls}.
10383
10384 All @option{-mabicalls} code has traditionally been position-independent,
10385 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
10386 as an extension, the GNU toolchain allows executables to use absolute
10387 accesses for locally-binding symbols.  It can also use shorter GP
10388 initialization sequences and generate direct calls to locally-defined
10389 functions.  This mode is selected by @option{-mno-shared}.
10390
10391 @option{-mno-shared} depends on binutils 2.16 or higher and generates
10392 objects that can only be linked by the GNU linker.  However, the option
10393 does not affect the ABI of the final executable; it only affects the ABI
10394 of relocatable objects.  Using @option{-mno-shared} will generally make
10395 executables both smaller and quicker.
10396
10397 @option{-mshared} is the default.
10398
10399 @item -mxgot
10400 @itemx -mno-xgot
10401 @opindex mxgot
10402 @opindex mno-xgot
10403 Lift (do not lift) the usual restrictions on the size of the global
10404 offset table.
10405
10406 GCC normally uses a single instruction to load values from the GOT@.
10407 While this is relatively efficient, it will only work if the GOT
10408 is smaller than about 64k.  Anything larger will cause the linker
10409 to report an error such as:
10410
10411 @cindex relocation truncated to fit (MIPS)
10412 @smallexample
10413 relocation truncated to fit: R_MIPS_GOT16 foobar
10414 @end smallexample
10415
10416 If this happens, you should recompile your code with @option{-mxgot}.
10417 It should then work with very large GOTs, although it will also be
10418 less efficient, since it will take three instructions to fetch the
10419 value of a global symbol.
10420
10421 Note that some linkers can create multiple GOTs.  If you have such a
10422 linker, you should only need to use @option{-mxgot} when a single object
10423 file accesses more than 64k's worth of GOT entries.  Very few do.
10424
10425 These options have no effect unless GCC is generating position
10426 independent code.
10427
10428 @item -mgp32
10429 @opindex mgp32
10430 Assume that general-purpose registers are 32 bits wide.
10431
10432 @item -mgp64
10433 @opindex mgp64
10434 Assume that general-purpose registers are 64 bits wide.
10435
10436 @item -mfp32
10437 @opindex mfp32
10438 Assume that floating-point registers are 32 bits wide.
10439
10440 @item -mfp64
10441 @opindex mfp64
10442 Assume that floating-point registers are 64 bits wide.
10443
10444 @item -mhard-float
10445 @opindex mhard-float
10446 Use floating-point coprocessor instructions.
10447
10448 @item -msoft-float
10449 @opindex msoft-float
10450 Do not use floating-point coprocessor instructions.  Implement
10451 floating-point calculations using library calls instead.
10452
10453 @item -msingle-float
10454 @opindex msingle-float
10455 Assume that the floating-point coprocessor only supports single-precision
10456 operations.
10457
10458 @itemx -mdouble-float
10459 @opindex mdouble-float
10460 Assume that the floating-point coprocessor supports double-precision
10461 operations.  This is the default.
10462
10463 @itemx -mdsp
10464 @itemx -mno-dsp
10465 @opindex mdsp
10466 @opindex mno-dsp
10467 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
10468
10469 @itemx -mpaired-single
10470 @itemx -mno-paired-single
10471 @opindex mpaired-single
10472 @opindex mno-paired-single
10473 Use (do not use) paired-single floating-point instructions.
10474 @xref{MIPS Paired-Single Support}.  This option can only be used
10475 when generating 64-bit code and requires hardware floating-point
10476 support to be enabled.
10477
10478 @itemx -mips3d
10479 @itemx -mno-mips3d
10480 @opindex mips3d
10481 @opindex mno-mips3d
10482 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
10483 The option @option{-mips3d} implies @option{-mpaired-single}.
10484
10485 @item -mlong64
10486 @opindex mlong64
10487 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
10488 an explanation of the default and the way that the pointer size is
10489 determined.
10490
10491 @item -mlong32
10492 @opindex mlong32
10493 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
10494
10495 The default size of @code{int}s, @code{long}s and pointers depends on
10496 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
10497 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
10498 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
10499 or the same size as integer registers, whichever is smaller.
10500
10501 @item -msym32
10502 @itemx -mno-sym32
10503 @opindex msym32
10504 @opindex mno-sym32
10505 Assume (do not assume) that all symbols have 32-bit values, regardless
10506 of the selected ABI@.  This option is useful in combination with
10507 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
10508 to generate shorter and faster references to symbolic addresses.
10509
10510 @item -G @var{num}
10511 @opindex G
10512 @cindex smaller data references (MIPS)
10513 @cindex gp-relative references (MIPS)
10514 Put global and static items less than or equal to @var{num} bytes into
10515 the small data or bss section instead of the normal data or bss section.
10516 This allows the data to be accessed using a single instruction.
10517
10518 All modules should be compiled with the same @option{-G @var{num}}
10519 value.
10520
10521 @item -membedded-data
10522 @itemx -mno-embedded-data
10523 @opindex membedded-data
10524 @opindex mno-embedded-data
10525 Allocate variables to the read-only data section first if possible, then
10526 next in the small data section if possible, otherwise in data.  This gives
10527 slightly slower code than the default, but reduces the amount of RAM required
10528 when executing, and thus may be preferred for some embedded systems.
10529
10530 @item -muninit-const-in-rodata
10531 @itemx -mno-uninit-const-in-rodata
10532 @opindex muninit-const-in-rodata
10533 @opindex mno-uninit-const-in-rodata
10534 Put uninitialized @code{const} variables in the read-only data section.
10535 This option is only meaningful in conjunction with @option{-membedded-data}.
10536
10537 @item -msplit-addresses
10538 @itemx -mno-split-addresses
10539 @opindex msplit-addresses
10540 @opindex mno-split-addresses
10541 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
10542 relocation operators.  This option has been superseded by
10543 @option{-mexplicit-relocs} but is retained for backwards compatibility.
10544
10545 @item -mexplicit-relocs
10546 @itemx -mno-explicit-relocs
10547 @opindex mexplicit-relocs
10548 @opindex mno-explicit-relocs
10549 Use (do not use) assembler relocation operators when dealing with symbolic
10550 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
10551 is to use assembler macros instead.
10552
10553 @option{-mexplicit-relocs} is the default if GCC was configured
10554 to use an assembler that supports relocation operators.
10555
10556 @item -mcheck-zero-division
10557 @itemx -mno-check-zero-division
10558 @opindex mcheck-zero-division
10559 @opindex mno-check-zero-division
10560 Trap (do not trap) on integer division by zero.  The default is
10561 @option{-mcheck-zero-division}.
10562
10563 @item -mdivide-traps
10564 @itemx -mdivide-breaks
10565 @opindex mdivide-traps
10566 @opindex mdivide-breaks
10567 MIPS systems check for division by zero by generating either a
10568 conditional trap or a break instruction.  Using traps results in
10569 smaller code, but is only supported on MIPS II and later.  Also, some
10570 versions of the Linux kernel have a bug that prevents trap from
10571 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
10572 allow conditional traps on architectures that support them and
10573 @option{-mdivide-breaks} to force the use of breaks.
10574
10575 The default is usually @option{-mdivide-traps}, but this can be
10576 overridden at configure time using @option{--with-divide=breaks}.
10577 Divide-by-zero checks can be completely disabled using
10578 @option{-mno-check-zero-division}.
10579
10580 @item -mmemcpy
10581 @itemx -mno-memcpy
10582 @opindex mmemcpy
10583 @opindex mno-memcpy
10584 Force (do not force) the use of @code{memcpy()} for non-trivial block
10585 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
10586 most constant-sized copies.
10587
10588 @item -mlong-calls
10589 @itemx -mno-long-calls
10590 @opindex mlong-calls
10591 @opindex mno-long-calls
10592 Disable (do not disable) use of the @code{jal} instruction.  Calling
10593 functions using @code{jal} is more efficient but requires the caller
10594 and callee to be in the same 256 megabyte segment.
10595
10596 This option has no effect on abicalls code.  The default is
10597 @option{-mno-long-calls}.
10598
10599 @item -mmad
10600 @itemx -mno-mad
10601 @opindex mmad
10602 @opindex mno-mad
10603 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
10604 instructions, as provided by the R4650 ISA@.
10605
10606 @item -mfused-madd
10607 @itemx -mno-fused-madd
10608 @opindex mfused-madd
10609 @opindex mno-fused-madd
10610 Enable (disable) use of the floating point multiply-accumulate
10611 instructions, when they are available.  The default is
10612 @option{-mfused-madd}.
10613
10614 When multiply-accumulate instructions are used, the intermediate
10615 product is calculated to infinite precision and is not subject to
10616 the FCSR Flush to Zero bit.  This may be undesirable in some
10617 circumstances.
10618
10619 @item -nocpp
10620 @opindex nocpp
10621 Tell the MIPS assembler to not run its preprocessor over user
10622 assembler files (with a @samp{.s} suffix) when assembling them.
10623
10624 @item -mfix-r4000
10625 @itemx -mno-fix-r4000
10626 @opindex mfix-r4000
10627 @opindex mno-fix-r4000
10628 Work around certain R4000 CPU errata:
10629 @itemize @minus
10630 @item
10631 A double-word or a variable shift may give an incorrect result if executed
10632 immediately after starting an integer division.
10633 @item
10634 A double-word or a variable shift may give an incorrect result if executed
10635 while an integer multiplication is in progress.
10636 @item
10637 An integer division may give an incorrect result if started in a delay slot
10638 of a taken branch or a jump.
10639 @end itemize
10640
10641 @item -mfix-r4400
10642 @itemx -mno-fix-r4400
10643 @opindex mfix-r4400
10644 @opindex mno-fix-r4400
10645 Work around certain R4400 CPU errata:
10646 @itemize @minus
10647 @item
10648 A double-word or a variable shift may give an incorrect result if executed
10649 immediately after starting an integer division.
10650 @end itemize
10651
10652 @item -mfix-vr4120
10653 @itemx -mno-fix-vr4120
10654 @opindex mfix-vr4120
10655 Work around certain VR4120 errata:
10656 @itemize @minus
10657 @item
10658 @code{dmultu} does not always produce the correct result.
10659 @item
10660 @code{div} and @code{ddiv} do not always produce the correct result if one
10661 of the operands is negative.
10662 @end itemize
10663 The workarounds for the division errata rely on special functions in
10664 @file{libgcc.a}.  At present, these functions are only provided by
10665 the @code{mips64vr*-elf} configurations.
10666
10667 Other VR4120 errata require a nop to be inserted between certain pairs of
10668 instructions.  These errata are handled by the assembler, not by GCC itself.
10669
10670 @item -mfix-vr4130
10671 @opindex mfix-vr4130
10672 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
10673 workarounds are implemented by the assembler rather than by GCC,
10674 although GCC will avoid using @code{mflo} and @code{mfhi} if the
10675 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
10676 instructions are available instead.
10677
10678 @item -mfix-sb1
10679 @itemx -mno-fix-sb1
10680 @opindex mfix-sb1
10681 Work around certain SB-1 CPU core errata.
10682 (This flag currently works around the SB-1 revision 2
10683 ``F1'' and ``F2'' floating point errata.)
10684
10685 @item -mflush-func=@var{func}
10686 @itemx -mno-flush-func
10687 @opindex mflush-func
10688 Specifies the function to call to flush the I and D caches, or to not
10689 call any such function.  If called, the function must take the same
10690 arguments as the common @code{_flush_func()}, that is, the address of the
10691 memory range for which the cache is being flushed, the size of the
10692 memory range, and the number 3 (to flush both caches).  The default
10693 depends on the target GCC was configured for, but commonly is either
10694 @samp{_flush_func} or @samp{__cpu_flush}.
10695
10696 @item -mbranch-likely
10697 @itemx -mno-branch-likely
10698 @opindex mbranch-likely
10699 @opindex mno-branch-likely
10700 Enable or disable use of Branch Likely instructions, regardless of the
10701 default for the selected architecture.  By default, Branch Likely
10702 instructions may be generated if they are supported by the selected
10703 architecture.  An exception is for the MIPS32 and MIPS64 architectures
10704 and processors which implement those architectures; for those, Branch
10705 Likely instructions will not be generated by default because the MIPS32
10706 and MIPS64 architectures specifically deprecate their use.
10707
10708 @item -mfp-exceptions
10709 @itemx -mno-fp-exceptions
10710 @opindex mfp-exceptions
10711 Specifies whether FP exceptions are enabled.  This affects how we schedule
10712 FP instructions for some processors.  The default is that FP exceptions are
10713 enabled.
10714
10715 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
10716 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
10717 FP pipe.
10718
10719 @item -mvr4130-align
10720 @itemx -mno-vr4130-align
10721 @opindex mvr4130-align
10722 The VR4130 pipeline is two-way superscalar, but can only issue two
10723 instructions together if the first one is 8-byte aligned.  When this
10724 option is enabled, GCC will align pairs of instructions that it
10725 thinks should execute in parallel.
10726
10727 This option only has an effect when optimizing for the VR4130.
10728 It normally makes code faster, but at the expense of making it bigger.
10729 It is enabled by default at optimization level @option{-O3}.
10730 @end table
10731
10732 @node MMIX Options
10733 @subsection MMIX Options
10734 @cindex MMIX Options
10735
10736 These options are defined for the MMIX:
10737
10738 @table @gcctabopt
10739 @item -mlibfuncs
10740 @itemx -mno-libfuncs
10741 @opindex mlibfuncs
10742 @opindex mno-libfuncs
10743 Specify that intrinsic library functions are being compiled, passing all
10744 values in registers, no matter the size.
10745
10746 @item -mepsilon
10747 @itemx -mno-epsilon
10748 @opindex mepsilon
10749 @opindex mno-epsilon
10750 Generate floating-point comparison instructions that compare with respect
10751 to the @code{rE} epsilon register.
10752
10753 @item -mabi=mmixware
10754 @itemx -mabi=gnu
10755 @opindex mabi-mmixware
10756 @opindex mabi=gnu
10757 Generate code that passes function parameters and return values that (in
10758 the called function) are seen as registers @code{$0} and up, as opposed to
10759 the GNU ABI which uses global registers @code{$231} and up.
10760
10761 @item -mzero-extend
10762 @itemx -mno-zero-extend
10763 @opindex mzero-extend
10764 @opindex mno-zero-extend
10765 When reading data from memory in sizes shorter than 64 bits, use (do not
10766 use) zero-extending load instructions by default, rather than
10767 sign-extending ones.
10768
10769 @item -mknuthdiv
10770 @itemx -mno-knuthdiv
10771 @opindex mknuthdiv
10772 @opindex mno-knuthdiv
10773 Make the result of a division yielding a remainder have the same sign as
10774 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
10775 remainder follows the sign of the dividend.  Both methods are
10776 arithmetically valid, the latter being almost exclusively used.
10777
10778 @item -mtoplevel-symbols
10779 @itemx -mno-toplevel-symbols
10780 @opindex mtoplevel-symbols
10781 @opindex mno-toplevel-symbols
10782 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
10783 code can be used with the @code{PREFIX} assembly directive.
10784
10785 @item -melf
10786 @opindex melf
10787 Generate an executable in the ELF format, rather than the default
10788 @samp{mmo} format used by the @command{mmix} simulator.
10789
10790 @item -mbranch-predict
10791 @itemx -mno-branch-predict
10792 @opindex mbranch-predict
10793 @opindex mno-branch-predict
10794 Use (do not use) the probable-branch instructions, when static branch
10795 prediction indicates a probable branch.
10796
10797 @item -mbase-addresses
10798 @itemx -mno-base-addresses
10799 @opindex mbase-addresses
10800 @opindex mno-base-addresses
10801 Generate (do not generate) code that uses @emph{base addresses}.  Using a
10802 base address automatically generates a request (handled by the assembler
10803 and the linker) for a constant to be set up in a global register.  The
10804 register is used for one or more base address requests within the range 0
10805 to 255 from the value held in the register.  The generally leads to short
10806 and fast code, but the number of different data items that can be
10807 addressed is limited.  This means that a program that uses lots of static
10808 data may require @option{-mno-base-addresses}.
10809
10810 @item -msingle-exit
10811 @itemx -mno-single-exit
10812 @opindex msingle-exit
10813 @opindex mno-single-exit
10814 Force (do not force) generated code to have a single exit point in each
10815 function.
10816 @end table
10817
10818 @node MN10300 Options
10819 @subsection MN10300 Options
10820 @cindex MN10300 options
10821
10822 These @option{-m} options are defined for Matsushita MN10300 architectures:
10823
10824 @table @gcctabopt
10825 @item -mmult-bug
10826 @opindex mmult-bug
10827 Generate code to avoid bugs in the multiply instructions for the MN10300
10828 processors.  This is the default.
10829
10830 @item -mno-mult-bug
10831 @opindex mno-mult-bug
10832 Do not generate code to avoid bugs in the multiply instructions for the
10833 MN10300 processors.
10834
10835 @item -mam33
10836 @opindex mam33
10837 Generate code which uses features specific to the AM33 processor.
10838
10839 @item -mno-am33
10840 @opindex mno-am33
10841 Do not generate code which uses features specific to the AM33 processor.  This
10842 is the default.
10843
10844 @item -mreturn-pointer-on-d0
10845 @opindex mreturn-pointer-on-d0
10846 When generating a function which returns a pointer, return the pointer
10847 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
10848 only in a0, and attempts to call such functions without a prototype
10849 would result in errors.  Note that this option is on by default; use
10850 @option{-mno-return-pointer-on-d0} to disable it.
10851
10852 @item -mno-crt0
10853 @opindex mno-crt0
10854 Do not link in the C run-time initialization object file.
10855
10856 @item -mrelax
10857 @opindex mrelax
10858 Indicate to the linker that it should perform a relaxation optimization pass
10859 to shorten branches, calls and absolute memory addresses.  This option only
10860 has an effect when used on the command line for the final link step.
10861
10862 This option makes symbolic debugging impossible.
10863 @end table
10864
10865 @node MT Options
10866 @subsection MT Options
10867 @cindex MT options
10868
10869 These @option{-m} options are defined for Morpho MT architectures:
10870
10871 @table @gcctabopt
10872
10873 @item -march=@var{cpu-type}
10874 @opindex march
10875 Generate code that will run on @var{cpu-type}, which is the name of a system
10876 representing a certain processor type.  Possible values for
10877 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
10878 @samp{ms1-16-003} and @samp{ms2}.
10879
10880 When this option is not used, the default is @option{-march=ms1-16-002}.
10881
10882 @item -mbacc
10883 @opindex mbacc
10884 Use byte loads and stores when generating code.
10885
10886 @item -mno-bacc
10887 @opindex mno-bacc
10888 Do not use byte loads and stores when generating code.
10889
10890 @item -msim
10891 @opindex msim
10892 Use simulator runtime
10893
10894 @item -mno-crt0
10895 @opindex mno-crt0
10896 Do not link in the C run-time initialization object file
10897 @file{crti.o}.  Other run-time initialization and termination files
10898 such as @file{startup.o} and @file{exit.o} are still included on the
10899 linker command line.
10900
10901 @end table
10902
10903 @node PDP-11 Options
10904 @subsection PDP-11 Options
10905 @cindex PDP-11 Options
10906
10907 These options are defined for the PDP-11:
10908
10909 @table @gcctabopt
10910 @item -mfpu
10911 @opindex mfpu
10912 Use hardware FPP floating point.  This is the default.  (FIS floating
10913 point on the PDP-11/40 is not supported.)
10914
10915 @item -msoft-float
10916 @opindex msoft-float
10917 Do not use hardware floating point.
10918
10919 @item -mac0
10920 @opindex mac0
10921 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
10922
10923 @item -mno-ac0
10924 @opindex mno-ac0
10925 Return floating-point results in memory.  This is the default.
10926
10927 @item -m40
10928 @opindex m40
10929 Generate code for a PDP-11/40.
10930
10931 @item -m45
10932 @opindex m45
10933 Generate code for a PDP-11/45.  This is the default.
10934
10935 @item -m10
10936 @opindex m10
10937 Generate code for a PDP-11/10.
10938
10939 @item -mbcopy-builtin
10940 @opindex bcopy-builtin
10941 Use inline @code{movmemhi} patterns for copying memory.  This is the
10942 default.
10943
10944 @item -mbcopy
10945 @opindex mbcopy
10946 Do not use inline @code{movmemhi} patterns for copying memory.
10947
10948 @item -mint16
10949 @itemx -mno-int32
10950 @opindex mint16
10951 @opindex mno-int32
10952 Use 16-bit @code{int}.  This is the default.
10953
10954 @item -mint32
10955 @itemx -mno-int16
10956 @opindex mint32
10957 @opindex mno-int16
10958 Use 32-bit @code{int}.
10959
10960 @item -mfloat64
10961 @itemx -mno-float32
10962 @opindex mfloat64
10963 @opindex mno-float32
10964 Use 64-bit @code{float}.  This is the default.
10965
10966 @item -mfloat32
10967 @itemx -mno-float64
10968 @opindex mfloat32
10969 @opindex mno-float64
10970 Use 32-bit @code{float}.
10971
10972 @item -mabshi
10973 @opindex mabshi
10974 Use @code{abshi2} pattern.  This is the default.
10975
10976 @item -mno-abshi
10977 @opindex mno-abshi
10978 Do not use @code{abshi2} pattern.
10979
10980 @item -mbranch-expensive
10981 @opindex mbranch-expensive
10982 Pretend that branches are expensive.  This is for experimenting with
10983 code generation only.
10984
10985 @item -mbranch-cheap
10986 @opindex mbranch-cheap
10987 Do not pretend that branches are expensive.  This is the default.
10988
10989 @item -msplit
10990 @opindex msplit
10991 Generate code for a system with split I&D@.
10992
10993 @item -mno-split
10994 @opindex mno-split
10995 Generate code for a system without split I&D@.  This is the default.
10996
10997 @item -munix-asm
10998 @opindex munix-asm
10999 Use Unix assembler syntax.  This is the default when configured for
11000 @samp{pdp11-*-bsd}.
11001
11002 @item -mdec-asm
11003 @opindex mdec-asm
11004 Use DEC assembler syntax.  This is the default when configured for any
11005 PDP-11 target other than @samp{pdp11-*-bsd}.
11006 @end table
11007
11008 @node PowerPC Options
11009 @subsection PowerPC Options
11010 @cindex PowerPC options
11011
11012 These are listed under @xref{RS/6000 and PowerPC Options}.
11013
11014 @node RS/6000 and PowerPC Options
11015 @subsection IBM RS/6000 and PowerPC Options
11016 @cindex RS/6000 and PowerPC Options
11017 @cindex IBM RS/6000 and PowerPC Options
11018
11019 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11020 @table @gcctabopt
11021 @item -mpower
11022 @itemx -mno-power
11023 @itemx -mpower2
11024 @itemx -mno-power2
11025 @itemx -mpowerpc
11026 @itemx -mno-powerpc
11027 @itemx -mpowerpc-gpopt
11028 @itemx -mno-powerpc-gpopt
11029 @itemx -mpowerpc-gfxopt
11030 @itemx -mno-powerpc-gfxopt
11031 @itemx -mpowerpc64
11032 @itemx -mno-powerpc64
11033 @itemx -mmfcrf
11034 @itemx -mno-mfcrf
11035 @itemx -mpopcntb
11036 @itemx -mno-popcntb
11037 @itemx -mfprnd
11038 @itemx -mno-fprnd
11039 @opindex mpower
11040 @opindex mno-power
11041 @opindex mpower2
11042 @opindex mno-power2
11043 @opindex mpowerpc
11044 @opindex mno-powerpc
11045 @opindex mpowerpc-gpopt
11046 @opindex mno-powerpc-gpopt
11047 @opindex mpowerpc-gfxopt
11048 @opindex mno-powerpc-gfxopt
11049 @opindex mpowerpc64
11050 @opindex mno-powerpc64
11051 @opindex mmfcrf
11052 @opindex mno-mfcrf
11053 @opindex mpopcntb
11054 @opindex mno-popcntb
11055 @opindex mfprnd
11056 @opindex mno-fprnd
11057 GCC supports two related instruction set architectures for the
11058 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
11059 instructions supported by the @samp{rios} chip set used in the original
11060 RS/6000 systems and the @dfn{PowerPC} instruction set is the
11061 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
11062 the IBM 4xx, 6xx, and follow-on microprocessors.
11063
11064 Neither architecture is a subset of the other.  However there is a
11065 large common subset of instructions supported by both.  An MQ
11066 register is included in processors supporting the POWER architecture.
11067
11068 You use these options to specify which instructions are available on the
11069 processor you are using.  The default value of these options is
11070 determined when configuring GCC@.  Specifying the
11071 @option{-mcpu=@var{cpu_type}} overrides the specification of these
11072 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
11073 rather than the options listed above.
11074
11075 The @option{-mpower} option allows GCC to generate instructions that
11076 are found only in the POWER architecture and to use the MQ register.
11077 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
11078 to generate instructions that are present in the POWER2 architecture but
11079 not the original POWER architecture.
11080
11081 The @option{-mpowerpc} option allows GCC to generate instructions that
11082 are found only in the 32-bit subset of the PowerPC architecture.
11083 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
11084 GCC to use the optional PowerPC architecture instructions in the
11085 General Purpose group, including floating-point square root.  Specifying
11086 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
11087 use the optional PowerPC architecture instructions in the Graphics
11088 group, including floating-point select.
11089
11090 The @option{-mmfcrf} option allows GCC to generate the move from
11091 condition register field instruction implemented on the POWER4
11092 processor and other processors that support the PowerPC V2.01
11093 architecture.
11094 The @option{-mpopcntb} option allows GCC to generate the popcount and
11095 double precision FP reciprocal estimate instruction implemented on the
11096 POWER5 processor and other processors that support the PowerPC V2.02
11097 architecture.
11098 The @option{-mfprnd} option allows GCC to generate the FP round to
11099 integer instructions implemented on the POWER5+ processor and other
11100 processors that support the PowerPC V2.03 architecture.
11101
11102 The @option{-mpowerpc64} option allows GCC to generate the additional
11103 64-bit instructions that are found in the full PowerPC64 architecture
11104 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
11105 @option{-mno-powerpc64}.
11106
11107 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
11108 will use only the instructions in the common subset of both
11109 architectures plus some special AIX common-mode calls, and will not use
11110 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
11111 permits GCC to use any instruction from either architecture and to
11112 allow use of the MQ register; specify this for the Motorola MPC601.
11113
11114 @item -mnew-mnemonics
11115 @itemx -mold-mnemonics
11116 @opindex mnew-mnemonics
11117 @opindex mold-mnemonics
11118 Select which mnemonics to use in the generated assembler code.  With
11119 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
11120 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
11121 assembler mnemonics defined for the POWER architecture.  Instructions
11122 defined in only one architecture have only one mnemonic; GCC uses that
11123 mnemonic irrespective of which of these options is specified.
11124
11125 GCC defaults to the mnemonics appropriate for the architecture in
11126 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
11127 value of these option.  Unless you are building a cross-compiler, you
11128 should normally not specify either @option{-mnew-mnemonics} or
11129 @option{-mold-mnemonics}, but should instead accept the default.
11130
11131 @item -mcpu=@var{cpu_type}
11132 @opindex mcpu
11133 Set architecture type, register usage, choice of mnemonics, and
11134 instruction scheduling parameters for machine type @var{cpu_type}.
11135 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
11136 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
11137 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
11138 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
11139 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
11140 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
11141 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
11142 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
11143 @samp{common}, @samp{powerpc}, @samp{powerpc64},
11144 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
11145
11146 @option{-mcpu=common} selects a completely generic processor.  Code
11147 generated under this option will run on any POWER or PowerPC processor.
11148 GCC will use only the instructions in the common subset of both
11149 architectures, and will not use the MQ register.  GCC assumes a generic
11150 processor model for scheduling purposes.
11151
11152 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
11153 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
11154 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
11155 types, with an appropriate, generic processor model assumed for
11156 scheduling purposes.
11157
11158 The other options specify a specific processor.  Code generated under
11159 those options will run best on that processor, and may not run at all on
11160 others.
11161
11162 The @option{-mcpu} options automatically enable or disable the
11163 following options: @option{-maltivec}, @option{-mfprnd},
11164 @option{-mhard-float}, @option{-mmfcrf}, @option{-mmultiple},
11165 @option{-mnew-mnemonics}, @option{-mpopcntb}, @option{-mpower},
11166 @option{-mpower2}, @option{-mpowerpc64}, @option{-mpowerpc-gpopt},
11167 @option{-mpowerpc-gfxopt}, @option{-mstring}, @option{-mmulhw}, @option{-mdlmzb}.
11168 The particular options
11169 set for any particular CPU will vary between compiler versions,
11170 depending on what setting seems to produce optimal code for that CPU;
11171 it doesn't necessarily reflect the actual hardware's capabilities.  If
11172 you wish to set an individual option to a particular value, you may
11173 specify it after the @option{-mcpu} option, like @samp{-mcpu=970
11174 -mno-altivec}.
11175
11176 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
11177 not enabled or disabled by the @option{-mcpu} option at present because
11178 AIX does not have full support for these options.  You may still
11179 enable or disable them individually if you're sure it'll work in your
11180 environment.
11181
11182 @item -mtune=@var{cpu_type}
11183 @opindex mtune
11184 Set the instruction scheduling parameters for machine type
11185 @var{cpu_type}, but do not set the architecture type, register usage, or
11186 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
11187 values for @var{cpu_type} are used for @option{-mtune} as for
11188 @option{-mcpu}.  If both are specified, the code generated will use the
11189 architecture, registers, and mnemonics set by @option{-mcpu}, but the
11190 scheduling parameters set by @option{-mtune}.
11191
11192 @item -mswdiv
11193 @itemx -mno-swdiv
11194 @opindex mswdiv
11195 @opindex mno-swdiv
11196 Generate code to compute division as reciprocal estimate and iterative
11197 refinement, creating opportunities for increased throughput.  This
11198 feature requires: optional PowerPC Graphics instruction set for single
11199 precision and FRE instruction for double precision, assuming divides
11200 cannot generate user-visible traps, and the domain values not include
11201 Infinities, denormals or zero denominator.
11202
11203 @item -maltivec
11204 @itemx -mno-altivec
11205 @opindex maltivec
11206 @opindex mno-altivec
11207 Generate code that uses (does not use) AltiVec instructions, and also
11208 enable the use of built-in functions that allow more direct access to
11209 the AltiVec instruction set.  You may also need to set
11210 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
11211 enhancements.
11212
11213 @item -mvrsave
11214 @item -mno-vrsave
11215 @opindex mvrsave
11216 @opindex mno-vrsave
11217 Generate VRSAVE instructions when generating AltiVec code.
11218
11219 @item -msecure-plt
11220 @opindex msecure-plt
11221 Generate code that allows ld and ld.so to build executables and shared
11222 libraries with non-exec .plt and .got sections.  This is a PowerPC
11223 32-bit SYSV ABI option.
11224
11225 @item -mbss-plt
11226 @opindex mbss-plt
11227 Generate code that uses a BSS .plt section that ld.so fills in, and
11228 requires .plt and .got sections that are both writable and executable.
11229 This is a PowerPC 32-bit SYSV ABI option.
11230
11231 @item -misel
11232 @itemx -mno-isel
11233 @opindex misel
11234 @opindex mno-isel
11235 This switch enables or disables the generation of ISEL instructions.
11236
11237 @item -misel=@var{yes/no}
11238 This switch has been deprecated.  Use @option{-misel} and
11239 @option{-mno-isel} instead.
11240
11241 @item -mspe
11242 @itemx -mno-spe
11243 @opindex mspe
11244 @opindex mno-spe
11245 This switch enables or disables the generation of SPE simd
11246 instructions.
11247
11248 @item -mspe=@var{yes/no}
11249 This option has been deprecated.  Use @option{-mspe} and
11250 @option{-mno-spe} instead.
11251
11252 @item -mfloat-gprs=@var{yes/single/double/no}
11253 @itemx -mfloat-gprs
11254 @opindex mfloat-gprs
11255 This switch enables or disables the generation of floating point
11256 operations on the general purpose registers for architectures that
11257 support it.
11258
11259 The argument @var{yes} or @var{single} enables the use of
11260 single-precision floating point operations.
11261
11262 The argument @var{double} enables the use of single and
11263 double-precision floating point operations.
11264
11265 The argument @var{no} disables floating point operations on the
11266 general purpose registers.
11267
11268 This option is currently only available on the MPC854x.
11269
11270 @item -m32
11271 @itemx -m64
11272 @opindex m32
11273 @opindex m64
11274 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
11275 targets (including GNU/Linux).  The 32-bit environment sets int, long
11276 and pointer to 32 bits and generates code that runs on any PowerPC
11277 variant.  The 64-bit environment sets int to 32 bits and long and
11278 pointer to 64 bits, and generates code for PowerPC64, as for
11279 @option{-mpowerpc64}.
11280
11281 @item -mfull-toc
11282 @itemx -mno-fp-in-toc
11283 @itemx -mno-sum-in-toc
11284 @itemx -mminimal-toc
11285 @opindex mfull-toc
11286 @opindex mno-fp-in-toc
11287 @opindex mno-sum-in-toc
11288 @opindex mminimal-toc
11289 Modify generation of the TOC (Table Of Contents), which is created for
11290 every executable file.  The @option{-mfull-toc} option is selected by
11291 default.  In that case, GCC will allocate at least one TOC entry for
11292 each unique non-automatic variable reference in your program.  GCC
11293 will also place floating-point constants in the TOC@.  However, only
11294 16,384 entries are available in the TOC@.
11295
11296 If you receive a linker error message that saying you have overflowed
11297 the available TOC space, you can reduce the amount of TOC space used
11298 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
11299 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
11300 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
11301 generate code to calculate the sum of an address and a constant at
11302 run-time instead of putting that sum into the TOC@.  You may specify one
11303 or both of these options.  Each causes GCC to produce very slightly
11304 slower and larger code at the expense of conserving TOC space.
11305
11306 If you still run out of space in the TOC even when you specify both of
11307 these options, specify @option{-mminimal-toc} instead.  This option causes
11308 GCC to make only one TOC entry for every file.  When you specify this
11309 option, GCC will produce code that is slower and larger but which
11310 uses extremely little TOC space.  You may wish to use this option
11311 only on files that contain less frequently executed code.
11312
11313 @item -maix64
11314 @itemx -maix32
11315 @opindex maix64
11316 @opindex maix32
11317 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
11318 @code{long} type, and the infrastructure needed to support them.
11319 Specifying @option{-maix64} implies @option{-mpowerpc64} and
11320 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
11321 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
11322
11323 @item -mxl-compat
11324 @itemx -mno-xl-compat
11325 @opindex mxl-compat
11326 @opindex mno-xl-compat
11327 Produce code that conforms more closely to IBM XL compiler semantics
11328 when using AIX-compatible ABI.  Pass floating-point arguments to
11329 prototyped functions beyond the register save area (RSA) on the stack
11330 in addition to argument FPRs.  Do not assume that most significant
11331 double in 128-bit long double value is properly rounded when comparing
11332 values and converting to double.  Use XL symbol names for long double
11333 support routines.
11334
11335 The AIX calling convention was extended but not initially documented to
11336 handle an obscure K&R C case of calling a function that takes the
11337 address of its arguments with fewer arguments than declared.  IBM XL
11338 compilers access floating point arguments which do not fit in the
11339 RSA from the stack when a subroutine is compiled without
11340 optimization.  Because always storing floating-point arguments on the
11341 stack is inefficient and rarely needed, this option is not enabled by
11342 default and only is necessary when calling subroutines compiled by IBM
11343 XL compilers without optimization.
11344
11345 @item -mpe
11346 @opindex mpe
11347 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
11348 application written to use message passing with special startup code to
11349 enable the application to run.  The system must have PE installed in the
11350 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
11351 must be overridden with the @option{-specs=} option to specify the
11352 appropriate directory location.  The Parallel Environment does not
11353 support threads, so the @option{-mpe} option and the @option{-pthread}
11354 option are incompatible.
11355
11356 @item -malign-natural
11357 @itemx -malign-power
11358 @opindex malign-natural
11359 @opindex malign-power
11360 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
11361 @option{-malign-natural} overrides the ABI-defined alignment of larger
11362 types, such as floating-point doubles, on their natural size-based boundary.
11363 The option @option{-malign-power} instructs GCC to follow the ABI-specified
11364 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
11365
11366 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
11367 is not supported.
11368
11369 @item -msoft-float
11370 @itemx -mhard-float
11371 @opindex msoft-float
11372 @opindex mhard-float
11373 Generate code that does not use (uses) the floating-point register set.
11374 Software floating point emulation is provided if you use the
11375 @option{-msoft-float} option, and pass the option to GCC when linking.
11376
11377 @item -mmultiple
11378 @itemx -mno-multiple
11379 @opindex mmultiple
11380 @opindex mno-multiple
11381 Generate code that uses (does not use) the load multiple word
11382 instructions and the store multiple word instructions.  These
11383 instructions are generated by default on POWER systems, and not
11384 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
11385 endian PowerPC systems, since those instructions do not work when the
11386 processor is in little endian mode.  The exceptions are PPC740 and
11387 PPC750 which permit the instructions usage in little endian mode.
11388
11389 @item -mstring
11390 @itemx -mno-string
11391 @opindex mstring
11392 @opindex mno-string
11393 Generate code that uses (does not use) the load string instructions
11394 and the store string word instructions to save multiple registers and
11395 do small block moves.  These instructions are generated by default on
11396 POWER systems, and not generated on PowerPC systems.  Do not use
11397 @option{-mstring} on little endian PowerPC systems, since those
11398 instructions do not work when the processor is in little endian mode.
11399 The exceptions are PPC740 and PPC750 which permit the instructions
11400 usage in little endian mode.
11401
11402 @item -mupdate
11403 @itemx -mno-update
11404 @opindex mupdate
11405 @opindex mno-update
11406 Generate code that uses (does not use) the load or store instructions
11407 that update the base register to the address of the calculated memory
11408 location.  These instructions are generated by default.  If you use
11409 @option{-mno-update}, there is a small window between the time that the
11410 stack pointer is updated and the address of the previous frame is
11411 stored, which means code that walks the stack frame across interrupts or
11412 signals may get corrupted data.
11413
11414 @item -mfused-madd
11415 @itemx -mno-fused-madd
11416 @opindex mfused-madd
11417 @opindex mno-fused-madd
11418 Generate code that uses (does not use) the floating point multiply and
11419 accumulate instructions.  These instructions are generated by default if
11420 hardware floating is used.
11421
11422 @item -mmulhw
11423 @itemx -mno-mulhw
11424 @opindex mmulhw
11425 @opindex mno-mulhw
11426 Generate code that uses (does not use) the half-word multiply and
11427 multiply-accumulate instructions on the IBM 405 and 440 processors.
11428 These instructions are generated by default when targetting those
11429 processors.
11430
11431 @item -mdlmzb
11432 @itemx -mno-dlmzb
11433 @opindex mdlmzb
11434 @opindex mno-dlmzb
11435 Generate code that uses (does not use) the string-search @samp{dlmzb}
11436 instruction on the IBM 405 and 440 processors.  This instruction is
11437 generated by default when targetting those processors.
11438
11439 @item -mno-bit-align
11440 @itemx -mbit-align
11441 @opindex mno-bit-align
11442 @opindex mbit-align
11443 On System V.4 and embedded PowerPC systems do not (do) force structures
11444 and unions that contain bit-fields to be aligned to the base type of the
11445 bit-field.
11446
11447 For example, by default a structure containing nothing but 8
11448 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
11449 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
11450 the structure would be aligned to a 1 byte boundary and be one byte in
11451 size.
11452
11453 @item -mno-strict-align
11454 @itemx -mstrict-align
11455 @opindex mno-strict-align
11456 @opindex mstrict-align
11457 On System V.4 and embedded PowerPC systems do not (do) assume that
11458 unaligned memory references will be handled by the system.
11459
11460 @item -mrelocatable
11461 @itemx -mno-relocatable
11462 @opindex mrelocatable
11463 @opindex mno-relocatable
11464 On embedded PowerPC systems generate code that allows (does not allow)
11465 the program to be relocated to a different address at runtime.  If you
11466 use @option{-mrelocatable} on any module, all objects linked together must
11467 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
11468
11469 @item -mrelocatable-lib
11470 @itemx -mno-relocatable-lib
11471 @opindex mrelocatable-lib
11472 @opindex mno-relocatable-lib
11473 On embedded PowerPC systems generate code that allows (does not allow)
11474 the program to be relocated to a different address at runtime.  Modules
11475 compiled with @option{-mrelocatable-lib} can be linked with either modules
11476 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
11477 with modules compiled with the @option{-mrelocatable} options.
11478
11479 @item -mno-toc
11480 @itemx -mtoc
11481 @opindex mno-toc
11482 @opindex mtoc
11483 On System V.4 and embedded PowerPC systems do not (do) assume that
11484 register 2 contains a pointer to a global area pointing to the addresses
11485 used in the program.
11486
11487 @item -mlittle
11488 @itemx -mlittle-endian
11489 @opindex mlittle
11490 @opindex mlittle-endian
11491 On System V.4 and embedded PowerPC systems compile code for the
11492 processor in little endian mode.  The @option{-mlittle-endian} option is
11493 the same as @option{-mlittle}.
11494
11495 @item -mbig
11496 @itemx -mbig-endian
11497 @opindex mbig
11498 @opindex mbig-endian
11499 On System V.4 and embedded PowerPC systems compile code for the
11500 processor in big endian mode.  The @option{-mbig-endian} option is
11501 the same as @option{-mbig}.
11502
11503 @item -mdynamic-no-pic
11504 @opindex mdynamic-no-pic
11505 On Darwin and Mac OS X systems, compile code so that it is not
11506 relocatable, but that its external references are relocatable.  The
11507 resulting code is suitable for applications, but not shared
11508 libraries.
11509
11510 @item -mprioritize-restricted-insns=@var{priority}
11511 @opindex mprioritize-restricted-insns
11512 This option controls the priority that is assigned to
11513 dispatch-slot restricted instructions during the second scheduling
11514 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
11515 @var{no/highest/second-highest} priority to dispatch slot restricted
11516 instructions.
11517
11518 @item -msched-costly-dep=@var{dependence_type}
11519 @opindex msched-costly-dep
11520 This option controls which dependences are considered costly
11521 by the target during instruction scheduling.  The argument
11522 @var{dependence_type} takes one of the following values:
11523 @var{no}: no dependence is costly,
11524 @var{all}: all dependences are costly,
11525 @var{true_store_to_load}: a true dependence from store to load is costly,
11526 @var{store_to_load}: any dependence from store to load is costly,
11527 @var{number}: any dependence which latency >= @var{number} is costly.
11528
11529 @item -minsert-sched-nops=@var{scheme}
11530 @opindex minsert-sched-nops
11531 This option controls which nop insertion scheme will be used during
11532 the second scheduling pass.  The argument @var{scheme} takes one of the
11533 following values:
11534 @var{no}: Don't insert nops.
11535 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
11536 according to the scheduler's grouping.
11537 @var{regroup_exact}: Insert nops to force costly dependent insns into
11538 separate groups.  Insert exactly as many nops as needed to force an insn
11539 to a new group, according to the estimated processor grouping.
11540 @var{number}: Insert nops to force costly dependent insns into
11541 separate groups.  Insert @var{number} nops to force an insn to a new group.
11542
11543 @item -mcall-sysv
11544 @opindex mcall-sysv
11545 On System V.4 and embedded PowerPC systems compile code using calling
11546 conventions that adheres to the March 1995 draft of the System V
11547 Application Binary Interface, PowerPC processor supplement.  This is the
11548 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
11549
11550 @item -mcall-sysv-eabi
11551 @opindex mcall-sysv-eabi
11552 Specify both @option{-mcall-sysv} and @option{-meabi} options.
11553
11554 @item -mcall-sysv-noeabi
11555 @opindex mcall-sysv-noeabi
11556 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
11557
11558 @item -mcall-solaris
11559 @opindex mcall-solaris
11560 On System V.4 and embedded PowerPC systems compile code for the Solaris
11561 operating system.
11562
11563 @item -mcall-linux
11564 @opindex mcall-linux
11565 On System V.4 and embedded PowerPC systems compile code for the
11566 Linux-based GNU system.
11567
11568 @item -mcall-gnu
11569 @opindex mcall-gnu
11570 On System V.4 and embedded PowerPC systems compile code for the
11571 Hurd-based GNU system.
11572
11573 @item -mcall-netbsd
11574 @opindex mcall-netbsd
11575 On System V.4 and embedded PowerPC systems compile code for the
11576 NetBSD operating system.
11577
11578 @item -maix-struct-return
11579 @opindex maix-struct-return
11580 Return all structures in memory (as specified by the AIX ABI)@.
11581
11582 @item -msvr4-struct-return
11583 @opindex msvr4-struct-return
11584 Return structures smaller than 8 bytes in registers (as specified by the
11585 SVR4 ABI)@.
11586
11587 @item -mabi=@var{abi-type}
11588 @opindex mabi
11589 Extend the current ABI with a particular extension, or remove such extension.
11590 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
11591 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
11592
11593 @item -mabi=spe
11594 @opindex mabi=spe
11595 Extend the current ABI with SPE ABI extensions.  This does not change
11596 the default ABI, instead it adds the SPE ABI extensions to the current
11597 ABI@.
11598
11599 @item -mabi=no-spe
11600 @opindex mabi=no-spe
11601 Disable Booke SPE ABI extensions for the current ABI@.
11602
11603 @item -mabi=ibmlongdouble
11604 @opindex mabi=ibmlongdouble
11605 Change the current ABI to use IBM extended precision long double.
11606 This is a PowerPC 32-bit SYSV ABI option.
11607
11608 @item -mabi=ieeelongdouble
11609 @opindex mabi=ieeelongdouble
11610 Change the current ABI to use IEEE extended precision long double.
11611 This is a PowerPC 32-bit Linux ABI option.
11612
11613 @item -mprototype
11614 @itemx -mno-prototype
11615 @opindex mprototype
11616 @opindex mno-prototype
11617 On System V.4 and embedded PowerPC systems assume that all calls to
11618 variable argument functions are properly prototyped.  Otherwise, the
11619 compiler must insert an instruction before every non prototyped call to
11620 set or clear bit 6 of the condition code register (@var{CR}) to
11621 indicate whether floating point values were passed in the floating point
11622 registers in case the function takes a variable arguments.  With
11623 @option{-mprototype}, only calls to prototyped variable argument functions
11624 will set or clear the bit.
11625
11626 @item -msim
11627 @opindex msim
11628 On embedded PowerPC systems, assume that the startup module is called
11629 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
11630 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
11631 configurations.
11632
11633 @item -mmvme
11634 @opindex mmvme
11635 On embedded PowerPC systems, assume that the startup module is called
11636 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
11637 @file{libc.a}.
11638
11639 @item -mads
11640 @opindex mads
11641 On embedded PowerPC systems, assume that the startup module is called
11642 @file{crt0.o} and the standard C libraries are @file{libads.a} and
11643 @file{libc.a}.
11644
11645 @item -myellowknife
11646 @opindex myellowknife
11647 On embedded PowerPC systems, assume that the startup module is called
11648 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
11649 @file{libc.a}.
11650
11651 @item -mvxworks
11652 @opindex mvxworks
11653 On System V.4 and embedded PowerPC systems, specify that you are
11654 compiling for a VxWorks system.
11655
11656 @item -mwindiss
11657 @opindex mwindiss
11658 Specify that you are compiling for the WindISS simulation environment.
11659
11660 @item -memb
11661 @opindex memb
11662 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
11663 header to indicate that @samp{eabi} extended relocations are used.
11664
11665 @item -meabi
11666 @itemx -mno-eabi
11667 @opindex meabi
11668 @opindex mno-eabi
11669 On System V.4 and embedded PowerPC systems do (do not) adhere to the
11670 Embedded Applications Binary Interface (eabi) which is a set of
11671 modifications to the System V.4 specifications.  Selecting @option{-meabi}
11672 means that the stack is aligned to an 8 byte boundary, a function
11673 @code{__eabi} is called to from @code{main} to set up the eabi
11674 environment, and the @option{-msdata} option can use both @code{r2} and
11675 @code{r13} to point to two separate small data areas.  Selecting
11676 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
11677 do not call an initialization function from @code{main}, and the
11678 @option{-msdata} option will only use @code{r13} to point to a single
11679 small data area.  The @option{-meabi} option is on by default if you
11680 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
11681
11682 @item -msdata=eabi
11683 @opindex msdata=eabi
11684 On System V.4 and embedded PowerPC systems, put small initialized
11685 @code{const} global and static data in the @samp{.sdata2} section, which
11686 is pointed to by register @code{r2}.  Put small initialized
11687 non-@code{const} global and static data in the @samp{.sdata} section,
11688 which is pointed to by register @code{r13}.  Put small uninitialized
11689 global and static data in the @samp{.sbss} section, which is adjacent to
11690 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
11691 incompatible with the @option{-mrelocatable} option.  The
11692 @option{-msdata=eabi} option also sets the @option{-memb} option.
11693
11694 @item -msdata=sysv
11695 @opindex msdata=sysv
11696 On System V.4 and embedded PowerPC systems, put small global and static
11697 data in the @samp{.sdata} section, which is pointed to by register
11698 @code{r13}.  Put small uninitialized global and static data in the
11699 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
11700 The @option{-msdata=sysv} option is incompatible with the
11701 @option{-mrelocatable} option.
11702
11703 @item -msdata=default
11704 @itemx -msdata
11705 @opindex msdata=default
11706 @opindex msdata
11707 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
11708 compile code the same as @option{-msdata=eabi}, otherwise compile code the
11709 same as @option{-msdata=sysv}.
11710
11711 @item -msdata-data
11712 @opindex msdata-data
11713 On System V.4 and embedded PowerPC systems, put small global
11714 data in the @samp{.sdata} section.  Put small uninitialized global
11715 data in the @samp{.sbss} section.  Do not use register @code{r13}
11716 to address small data however.  This is the default behavior unless
11717 other @option{-msdata} options are used.
11718
11719 @item -msdata=none
11720 @itemx -mno-sdata
11721 @opindex msdata=none
11722 @opindex mno-sdata
11723 On embedded PowerPC systems, put all initialized global and static data
11724 in the @samp{.data} section, and all uninitialized data in the
11725 @samp{.bss} section.
11726
11727 @item -G @var{num}
11728 @opindex G
11729 @cindex smaller data references (PowerPC)
11730 @cindex .sdata/.sdata2 references (PowerPC)
11731 On embedded PowerPC systems, put global and static items less than or
11732 equal to @var{num} bytes into the small data or bss sections instead of
11733 the normal data or bss section.  By default, @var{num} is 8.  The
11734 @option{-G @var{num}} switch is also passed to the linker.
11735 All modules should be compiled with the same @option{-G @var{num}} value.
11736
11737 @item -mregnames
11738 @itemx -mno-regnames
11739 @opindex mregnames
11740 @opindex mno-regnames
11741 On System V.4 and embedded PowerPC systems do (do not) emit register
11742 names in the assembly language output using symbolic forms.
11743
11744 @item -mlongcall
11745 @itemx -mno-longcall
11746 @opindex mlongcall
11747 @opindex mno-longcall
11748 By default assume that all calls are far away so that a longer more
11749 expensive calling sequence is required.  This is required for calls
11750 further than 32 megabytes (33,554,432 bytes) from the current location.
11751 A short call will be generated if the compiler knows
11752 the call cannot be that far away.  This setting can be overridden by
11753 the @code{shortcall} function attribute, or by @code{#pragma
11754 longcall(0)}.
11755
11756 Some linkers are capable of detecting out-of-range calls and generating
11757 glue code on the fly.  On these systems, long calls are unnecessary and
11758 generate slower code.  As of this writing, the AIX linker can do this,
11759 as can the GNU linker for PowerPC/64.  It is planned to add this feature
11760 to the GNU linker for 32-bit PowerPC systems as well.
11761
11762 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
11763 callee, L42'', plus a ``branch island'' (glue code).  The two target
11764 addresses represent the callee and the ``branch island''.  The
11765 Darwin/PPC linker will prefer the first address and generate a ``bl
11766 callee'' if the PPC ``bl'' instruction will reach the callee directly;
11767 otherwise, the linker will generate ``bl L42'' to call the ``branch
11768 island''.  The ``branch island'' is appended to the body of the
11769 calling function; it computes the full 32-bit address of the callee
11770 and jumps to it.
11771
11772 On Mach-O (Darwin) systems, this option directs the compiler emit to
11773 the glue for every direct call, and the Darwin linker decides whether
11774 to use or discard it.
11775
11776 In the future, we may cause GCC to ignore all longcall specifications
11777 when the linker is known to generate glue.
11778
11779 @item -pthread
11780 @opindex pthread
11781 Adds support for multithreading with the @dfn{pthreads} library.
11782 This option sets flags for both the preprocessor and linker.
11783
11784 @end table
11785
11786 @node S/390 and zSeries Options
11787 @subsection S/390 and zSeries Options
11788 @cindex S/390 and zSeries Options
11789
11790 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
11791
11792 @table @gcctabopt
11793 @item -mhard-float
11794 @itemx -msoft-float
11795 @opindex mhard-float
11796 @opindex msoft-float
11797 Use (do not use) the hardware floating-point instructions and registers
11798 for floating-point operations.  When @option{-msoft-float} is specified,
11799 functions in @file{libgcc.a} will be used to perform floating-point
11800 operations.  When @option{-mhard-float} is specified, the compiler
11801 generates IEEE floating-point instructions.  This is the default.
11802
11803 @item -mlong-double-64
11804 @itemx -mlong-double-128
11805 @opindex mlong-double-64
11806 @opindex mlong-double-128
11807 These switches control the size of @code{long double} type. A size
11808 of 64bit makes the @code{long double} type equivalent to the @code{double}
11809 type. This is the default.
11810
11811 @item -mbackchain
11812 @itemx -mno-backchain
11813 @opindex mbackchain
11814 @opindex mno-backchain
11815 Store (do not store) the address of the caller's frame as backchain pointer
11816 into the callee's stack frame.
11817 A backchain may be needed to allow debugging using tools that do not understand
11818 DWARF-2 call frame information.
11819 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
11820 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
11821 the backchain is placed into the topmost word of the 96/160 byte register
11822 save area.
11823
11824 In general, code compiled with @option{-mbackchain} is call-compatible with
11825 code compiled with @option{-mmo-backchain}; however, use of the backchain
11826 for debugging purposes usually requires that the whole binary is built with
11827 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
11828 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
11829 to build a linux kernel use @option{-msoft-float}.
11830
11831 The default is to not maintain the backchain.
11832
11833 @item -mpacked-stack
11834 @item -mno-packed-stack
11835 @opindex mpacked-stack
11836 @opindex mno-packed-stack
11837 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
11838 specified, the compiler uses the all fields of the 96/160 byte register save
11839 area only for their default purpose; unused fields still take up stack space.
11840 When @option{-mpacked-stack} is specified, register save slots are densely
11841 packed at the top of the register save area; unused space is reused for other
11842 purposes, allowing for more efficient use of the available stack space.
11843 However, when @option{-mbackchain} is also in effect, the topmost word of
11844 the save area is always used to store the backchain, and the return address
11845 register is always saved two words below the backchain.
11846
11847 As long as the stack frame backchain is not used, code generated with
11848 @option{-mpacked-stack} is call-compatible with code generated with
11849 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
11850 S/390 or zSeries generated code that uses the stack frame backchain at run
11851 time, not just for debugging purposes.  Such code is not call-compatible
11852 with code compiled with @option{-mpacked-stack}.  Also, note that the
11853 combination of @option{-mbackchain},
11854 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
11855 to build a linux kernel use @option{-msoft-float}.
11856
11857 The default is to not use the packed stack layout.
11858
11859 @item -msmall-exec
11860 @itemx -mno-small-exec
11861 @opindex msmall-exec
11862 @opindex mno-small-exec
11863 Generate (or do not generate) code using the @code{bras} instruction
11864 to do subroutine calls.
11865 This only works reliably if the total executable size does not
11866 exceed 64k.  The default is to use the @code{basr} instruction instead,
11867 which does not have this limitation.
11868
11869 @item -m64
11870 @itemx -m31
11871 @opindex m64
11872 @opindex m31
11873 When @option{-m31} is specified, generate code compliant to the
11874 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
11875 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
11876 particular to generate 64-bit instructions.  For the @samp{s390}
11877 targets, the default is @option{-m31}, while the @samp{s390x}
11878 targets default to @option{-m64}.
11879
11880 @item -mzarch
11881 @itemx -mesa
11882 @opindex mzarch
11883 @opindex mesa
11884 When @option{-mzarch} is specified, generate code using the
11885 instructions available on z/Architecture.
11886 When @option{-mesa} is specified, generate code using the
11887 instructions available on ESA/390.  Note that @option{-mesa} is
11888 not possible with @option{-m64}.
11889 When generating code compliant to the GNU/Linux for S/390 ABI,
11890 the default is @option{-mesa}.  When generating code compliant
11891 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
11892
11893 @item -mmvcle
11894 @itemx -mno-mvcle
11895 @opindex mmvcle
11896 @opindex mno-mvcle
11897 Generate (or do not generate) code using the @code{mvcle} instruction
11898 to perform block moves.  When @option{-mno-mvcle} is specified,
11899 use a @code{mvc} loop instead.  This is the default unless optimizing for
11900 size.
11901
11902 @item -mdebug
11903 @itemx -mno-debug
11904 @opindex mdebug
11905 @opindex mno-debug
11906 Print (or do not print) additional debug information when compiling.
11907 The default is to not print debug information.
11908
11909 @item -march=@var{cpu-type}
11910 @opindex march
11911 Generate code that will run on @var{cpu-type}, which is the name of a system
11912 representing a certain processor type.  Possible values for
11913 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
11914 When generating code using the instructions available on z/Architecture,
11915 the default is @option{-march=z900}.  Otherwise, the default is
11916 @option{-march=g5}.
11917
11918 @item -mtune=@var{cpu-type}
11919 @opindex mtune
11920 Tune to @var{cpu-type} everything applicable about the generated code,
11921 except for the ABI and the set of available instructions.
11922 The list of @var{cpu-type} values is the same as for @option{-march}.
11923 The default is the value used for @option{-march}.
11924
11925 @item -mtpf-trace
11926 @itemx -mno-tpf-trace
11927 @opindex mtpf-trace
11928 @opindex mno-tpf-trace
11929 Generate code that adds (does not add) in TPF OS specific branches to trace
11930 routines in the operating system.  This option is off by default, even
11931 when compiling for the TPF OS@.
11932
11933 @item -mfused-madd
11934 @itemx -mno-fused-madd
11935 @opindex mfused-madd
11936 @opindex mno-fused-madd
11937 Generate code that uses (does not use) the floating point multiply and
11938 accumulate instructions.  These instructions are generated by default if
11939 hardware floating point is used.
11940
11941 @item -mwarn-framesize=@var{framesize}
11942 @opindex mwarn-framesize
11943 Emit a warning if the current function exceeds the given frame size.  Because
11944 this is a compile time check it doesn't need to be a real problem when the program
11945 runs.  It is intended to identify functions which most probably cause
11946 a stack overflow.  It is useful to be used in an environment with limited stack
11947 size e.g.@: the linux kernel.
11948
11949 @item -mwarn-dynamicstack
11950 @opindex mwarn-dynamicstack
11951 Emit a warning if the function calls alloca or uses dynamically
11952 sized arrays.  This is generally a bad idea with a limited stack size.
11953
11954 @item -mstack-guard=@var{stack-guard}
11955 @item -mstack-size=@var{stack-size}
11956 @opindex mstack-guard
11957 @opindex mstack-size
11958 These arguments always have to be used in conjunction.  If they are present the s390
11959 back end emits additional instructions in the function prologue which trigger a trap
11960 if the stack size is @var{stack-guard} bytes above the @var{stack-size}
11961 (remember that the stack on s390 grows downward).  These options are intended to
11962 be used to help debugging stack overflow problems.  The additionally emitted code
11963 causes only little overhead and hence can also be used in production like systems
11964 without greater performance degradation.  The given values have to be exact
11965 powers of 2 and @var{stack-size} has to be greater than @var{stack-guard} without
11966 exceeding 64k.
11967 In order to be efficient the extra code makes the assumption that the stack starts
11968 at an address aligned to the value given by @var{stack-size}.
11969 @end table
11970
11971 @node Score Options
11972 @subsection Score Options
11973 @cindex Score Options
11974
11975 These options are defined for Score implementations:
11976
11977 @table @gcctabopt
11978 @item -meb
11979 @opindex meb
11980 Compile code for big endian mode.  This is the default.
11981
11982 @item -mel
11983 @opindex mel
11984 Compile code for little endian mode. 
11985
11986 @item -mnhwloop
11987 @opindex mnhwloop
11988 Disable generate bcnz instruction.
11989
11990 @item -muls
11991 @opindex muls
11992 Enable generate unaligned load and store instruction.
11993
11994 @item -mmac
11995 @opindex mmac
11996 Enable the use of multiply-accumulate instructions. Disabled by default. 
11997
11998 @item -mscore5
11999 @opindex mscore5
12000 Specify the SCORE5 as the target architecture.
12001
12002 @item -mscore5u
12003 @opindex mscore5u
12004 Specify the SCORE5U of the target architecture.
12005
12006 @item -mscore7
12007 @opindex mscore7
12008 Specify the SCORE7 as the target architecture. This is the default.
12009
12010 @item -mscore7d
12011 @opindex mscore7d
12012 Specify the SCORE7D as the target architecture.
12013 @end table
12014
12015 @node SH Options
12016 @subsection SH Options
12017
12018 These @samp{-m} options are defined for the SH implementations:
12019
12020 @table @gcctabopt
12021 @item -m1
12022 @opindex m1
12023 Generate code for the SH1.
12024
12025 @item -m2
12026 @opindex m2
12027 Generate code for the SH2.
12028
12029 @item -m2e
12030 Generate code for the SH2e.
12031
12032 @item -m3
12033 @opindex m3
12034 Generate code for the SH3.
12035
12036 @item -m3e
12037 @opindex m3e
12038 Generate code for the SH3e.
12039
12040 @item -m4-nofpu
12041 @opindex m4-nofpu
12042 Generate code for the SH4 without a floating-point unit.
12043
12044 @item -m4-single-only
12045 @opindex m4-single-only
12046 Generate code for the SH4 with a floating-point unit that only
12047 supports single-precision arithmetic.
12048
12049 @item -m4-single
12050 @opindex m4-single
12051 Generate code for the SH4 assuming the floating-point unit is in
12052 single-precision mode by default.
12053
12054 @item -m4
12055 @opindex m4
12056 Generate code for the SH4.
12057
12058 @item -m4a-nofpu
12059 @opindex m4a-nofpu
12060 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
12061 floating-point unit is not used.
12062
12063 @item -m4a-single-only
12064 @opindex m4a-single-only
12065 Generate code for the SH4a, in such a way that no double-precision
12066 floating point operations are used.
12067
12068 @item -m4a-single
12069 @opindex m4a-single
12070 Generate code for the SH4a assuming the floating-point unit is in
12071 single-precision mode by default.
12072
12073 @item -m4a
12074 @opindex m4a
12075 Generate code for the SH4a.
12076
12077 @item -m4al
12078 @opindex m4al
12079 Same as @option{-m4a-nofpu}, except that it implicitly passes
12080 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
12081 instructions at the moment.
12082
12083 @item -mb
12084 @opindex mb
12085 Compile code for the processor in big endian mode.
12086
12087 @item -ml
12088 @opindex ml
12089 Compile code for the processor in little endian mode.
12090
12091 @item -mdalign
12092 @opindex mdalign
12093 Align doubles at 64-bit boundaries.  Note that this changes the calling
12094 conventions, and thus some functions from the standard C library will
12095 not work unless you recompile it first with @option{-mdalign}.
12096
12097 @item -mrelax
12098 @opindex mrelax
12099 Shorten some address references at link time, when possible; uses the
12100 linker option @option{-relax}.
12101
12102 @item -mbigtable
12103 @opindex mbigtable
12104 Use 32-bit offsets in @code{switch} tables.  The default is to use
12105 16-bit offsets.
12106
12107 @item -mfmovd
12108 @opindex mfmovd
12109 Enable the use of the instruction @code{fmovd}.
12110
12111 @item -mhitachi
12112 @opindex mhitachi
12113 Comply with the calling conventions defined by Renesas.
12114
12115 @item -mrenesas
12116 @opindex mhitachi
12117 Comply with the calling conventions defined by Renesas.
12118
12119 @item -mno-renesas
12120 @opindex mhitachi
12121 Comply with the calling conventions defined for GCC before the Renesas
12122 conventions were available.  This option is the default for all
12123 targets of the SH toolchain except for @samp{sh-symbianelf}.
12124
12125 @item -mnomacsave
12126 @opindex mnomacsave
12127 Mark the @code{MAC} register as call-clobbered, even if
12128 @option{-mhitachi} is given.
12129
12130 @item -mieee
12131 @opindex mieee
12132 Increase IEEE-compliance of floating-point code.
12133 At the moment, this is equivalent to @option{-fno-finite-math-only}.
12134 When generating 16 bit SH opcodes, getting IEEE-conforming results for
12135 comparisons of NANs / infinities incurs extra overhead in every
12136 floating point comparison, therefore the default is set to
12137 @option{-ffinite-math-only}.
12138
12139 @item -misize
12140 @opindex misize
12141 Dump instruction size and location in the assembly code.
12142
12143 @item -mpadstruct
12144 @opindex mpadstruct
12145 This option is deprecated.  It pads structures to multiple of 4 bytes,
12146 which is incompatible with the SH ABI@.
12147
12148 @item -mspace
12149 @opindex mspace
12150 Optimize for space instead of speed.  Implied by @option{-Os}.
12151
12152 @item -mprefergot
12153 @opindex mprefergot
12154 When generating position-independent code, emit function calls using
12155 the Global Offset Table instead of the Procedure Linkage Table.
12156
12157 @item -musermode
12158 @opindex musermode
12159 Generate a library function call to invalidate instruction cache
12160 entries, after fixing up a trampoline.  This library function call
12161 doesn't assume it can write to the whole memory address space.  This
12162 is the default when the target is @code{sh-*-linux*}.
12163
12164 @item -multcost=@var{number}
12165 @opindex multcost=@var{number}
12166 Set the cost to assume for a multiply insn.
12167
12168 @item -mdiv=@var{strategy}
12169 @opindex mdiv=@var{strategy}
12170 Set the division strategy to use for SHmedia code.  @var{strategy} must be
12171 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
12172 inv:call2, inv:fp .
12173 "fp" performs the operation in floating point.  This has a very high latency,
12174 but needs only a few instructions, so it might be a good choice if
12175 your code has enough easily exploitable ILP to allow the compiler to
12176 schedule the floating point instructions together with other instructions.
12177 Division by zero causes a floating point exception.
12178 "inv" uses integer operations to calculate the inverse of the divisor,
12179 and then multiplies the dividend with the inverse.  This strategy allows
12180 cse and hoisting of the inverse calculation.  Division by zero calculates
12181 an unspecified result, but does not trap.
12182 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
12183 have been found, or if the entire operation has been hoisted to the same
12184 place, the last stages of the inverse calculation are intertwined with the
12185 final multiply to reduce the overall latency, at the expense of using a few
12186 more instructions, and thus offering fewer scheduling opportunities with
12187 other code.
12188 "call" calls a library function that usually implements the inv:minlat
12189 strategy.
12190 This gives high code density for m5-*media-nofpu compilations.
12191 "call2" uses a different entry point of the same library function, where it
12192 assumes that a pointer to a lookup table has already been set up, which
12193 exposes the pointer load to cse / code hoisting optimizations.
12194 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
12195 code generation, but if the code stays unoptimized, revert to the "call",
12196 "call2", or "fp" strategies, respectively.  Note that the
12197 potentially-trapping side effect of division by zero is carried by a
12198 separate instruction, so it is possible that all the integer instructions
12199 are hoisted out, but the marker for the side effect stays where it is.
12200 A recombination to fp operations or a call is not possible in that case.
12201 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
12202 that the inverse calculation was nor separated from the multiply, they speed
12203 up division where the dividend fits into 20 bits (plus sign where applicable),
12204 by inserting a test to skip a number of operations in this case; this test
12205 slows down the case of larger dividends.  inv20u assumes the case of a such
12206 a small dividend to be unlikely, and inv20l assumes it to be likely.
12207
12208 @item -mdivsi3_libfunc=@var{name}
12209 @opindex mdivsi3_libfunc=@var{name}
12210 Set the name of the library function used for 32 bit signed division to
12211 @var{name}.  This only affect the name used in the call and inv:call
12212 division strategies, and the compiler will still expect the same
12213 sets of input/output/clobbered registers as if this option was not present.
12214
12215 @item -madjust-unroll
12216 @opindex madjust-unroll
12217 Throttle unrolling to avoid thrashing target registers.
12218 This option only has an effect if the gcc code base supports the
12219 TARGET_ADJUST_UNROLL_MAX target hook.
12220
12221 @item -mindexed-addressing
12222 @opindex mindexed-addressing
12223 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
12224 This is only safe if the hardware and/or OS implement 32 bit wrap-around
12225 semantics for the indexed addressing mode.  The architecture allows the
12226 implementation of processors with 64 bit MMU, which the OS could use to
12227 get 32 bit addressing, but since no current hardware implementation supports
12228 this or any other way to make the indexed addressing mode safe to use in
12229 the 32 bit ABI, the default is -mno-indexed-addressing.
12230
12231 @item -mgettrcost=@var{number}
12232 @opindex mgettrcost=@var{number}
12233 Set the cost assumed for the gettr instruction to @var{number}.
12234 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
12235
12236 @item -mpt-fixed
12237 @opindex mpt-fixed
12238 Assume pt* instructions won't trap.  This will generally generate better
12239 scheduled code, but is unsafe on current hardware.  The current architecture
12240 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
12241 This has the unintentional effect of making it unsafe to schedule ptabs /
12242 ptrel before a branch, or hoist it out of a loop.  For example,
12243 __do_global_ctors, a part of libgcc that runs constructors at program
12244 startup, calls functions in a list which is delimited by -1.  With the
12245 -mpt-fixed option, the ptabs will be done before testing against -1.
12246 That means that all the constructors will be run a bit quicker, but when
12247 the loop comes to the end of the list, the program crashes because ptabs
12248 loads -1 into a target register.  Since this option is unsafe for any
12249 hardware implementing the current architecture specification, the default
12250 is -mno-pt-fixed.  Unless the user specifies a specific cost with
12251 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
12252 this deters register allocation using target registers for storing
12253 ordinary integers.
12254
12255 @item -minvalid-symbols
12256 @opindex minvalid-symbols
12257 Assume symbols might be invalid.  Ordinary function symbols generated by
12258 the compiler will always be valid to load with movi/shori/ptabs or
12259 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
12260 to generate symbols that will cause ptabs / ptrel to trap.
12261 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
12262 It will then prevent cross-basic-block cse, hoisting and most scheduling
12263 of symbol loads.  The default is @option{-mno-invalid-symbols}.
12264 @end table
12265
12266 @node SPARC Options
12267 @subsection SPARC Options
12268 @cindex SPARC options
12269
12270 These @samp{-m} options are supported on the SPARC:
12271
12272 @table @gcctabopt
12273 @item -mno-app-regs
12274 @itemx -mapp-regs
12275 @opindex mno-app-regs
12276 @opindex mapp-regs
12277 Specify @option{-mapp-regs} to generate output using the global registers
12278 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
12279 is the default.
12280
12281 To be fully SVR4 ABI compliant at the cost of some performance loss,
12282 specify @option{-mno-app-regs}.  You should compile libraries and system
12283 software with this option.
12284
12285 @item -mfpu
12286 @itemx -mhard-float
12287 @opindex mfpu
12288 @opindex mhard-float
12289 Generate output containing floating point instructions.  This is the
12290 default.
12291
12292 @item -mno-fpu
12293 @itemx -msoft-float
12294 @opindex mno-fpu
12295 @opindex msoft-float
12296 Generate output containing library calls for floating point.
12297 @strong{Warning:} the requisite libraries are not available for all SPARC
12298 targets.  Normally the facilities of the machine's usual C compiler are
12299 used, but this cannot be done directly in cross-compilation.  You must make
12300 your own arrangements to provide suitable library functions for
12301 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
12302 @samp{sparclite-*-*} do provide software floating point support.
12303
12304 @option{-msoft-float} changes the calling convention in the output file;
12305 therefore, it is only useful if you compile @emph{all} of a program with
12306 this option.  In particular, you need to compile @file{libgcc.a}, the
12307 library that comes with GCC, with @option{-msoft-float} in order for
12308 this to work.
12309
12310 @item -mhard-quad-float
12311 @opindex mhard-quad-float
12312 Generate output containing quad-word (long double) floating point
12313 instructions.
12314
12315 @item -msoft-quad-float
12316 @opindex msoft-quad-float
12317 Generate output containing library calls for quad-word (long double)
12318 floating point instructions.  The functions called are those specified
12319 in the SPARC ABI@.  This is the default.
12320
12321 As of this writing, there are no SPARC implementations that have hardware
12322 support for the quad-word floating point instructions.  They all invoke
12323 a trap handler for one of these instructions, and then the trap handler
12324 emulates the effect of the instruction.  Because of the trap handler overhead,
12325 this is much slower than calling the ABI library routines.  Thus the
12326 @option{-msoft-quad-float} option is the default.
12327
12328 @item -mno-unaligned-doubles
12329 @itemx -munaligned-doubles
12330 @opindex mno-unaligned-doubles
12331 @opindex munaligned-doubles
12332 Assume that doubles have 8 byte alignment.  This is the default.
12333
12334 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
12335 alignment only if they are contained in another type, or if they have an
12336 absolute address.  Otherwise, it assumes they have 4 byte alignment.
12337 Specifying this option avoids some rare compatibility problems with code
12338 generated by other compilers.  It is not the default because it results
12339 in a performance loss, especially for floating point code.
12340
12341 @item -mno-faster-structs
12342 @itemx -mfaster-structs
12343 @opindex mno-faster-structs
12344 @opindex mfaster-structs
12345 With @option{-mfaster-structs}, the compiler assumes that structures
12346 should have 8 byte alignment.  This enables the use of pairs of
12347 @code{ldd} and @code{std} instructions for copies in structure
12348 assignment, in place of twice as many @code{ld} and @code{st} pairs.
12349 However, the use of this changed alignment directly violates the SPARC
12350 ABI@.  Thus, it's intended only for use on targets where the developer
12351 acknowledges that their resulting code will not be directly in line with
12352 the rules of the ABI@.
12353
12354 @item -mimpure-text
12355 @opindex mimpure-text
12356 @option{-mimpure-text}, used in addition to @option{-shared}, tells
12357 the compiler to not pass @option{-z text} to the linker when linking a
12358 shared object.  Using this option, you can link position-dependent
12359 code into a shared object.
12360
12361 @option{-mimpure-text} suppresses the ``relocations remain against
12362 allocatable but non-writable sections'' linker error message.
12363 However, the necessary relocations will trigger copy-on-write, and the
12364 shared object is not actually shared across processes.  Instead of
12365 using @option{-mimpure-text}, you should compile all source code with
12366 @option{-fpic} or @option{-fPIC}.
12367
12368 This option is only available on SunOS and Solaris.
12369
12370 @item -mcpu=@var{cpu_type}
12371 @opindex mcpu
12372 Set the instruction set, register set, and instruction scheduling parameters
12373 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
12374 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
12375 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
12376 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
12377 @samp{ultrasparc3}, and @samp{niagara}.
12378
12379 Default instruction scheduling parameters are used for values that select
12380 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
12381 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
12382
12383 Here is a list of each supported architecture and their supported
12384 implementations.
12385
12386 @smallexample
12387     v7:             cypress
12388     v8:             supersparc, hypersparc
12389     sparclite:      f930, f934, sparclite86x
12390     sparclet:       tsc701
12391     v9:             ultrasparc, ultrasparc3, niagara
12392 @end smallexample
12393
12394 By default (unless configured otherwise), GCC generates code for the V7
12395 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
12396 additionally optimizes it for the Cypress CY7C602 chip, as used in the
12397 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
12398 SPARCStation 1, 2, IPX etc.
12399
12400 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
12401 architecture.  The only difference from V7 code is that the compiler emits
12402 the integer multiply and integer divide instructions which exist in SPARC-V8
12403 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
12404 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
12405 2000 series.
12406
12407 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
12408 the SPARC architecture.  This adds the integer multiply, integer divide step
12409 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
12410 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
12411 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
12412 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
12413 MB86934 chip, which is the more recent SPARClite with FPU@.
12414
12415 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
12416 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
12417 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
12418 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
12419 optimizes it for the TEMIC SPARClet chip.
12420
12421 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
12422 architecture.  This adds 64-bit integer and floating-point move instructions,
12423 3 additional floating-point condition code registers and conditional move
12424 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
12425 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
12426 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
12427 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
12428 @option{-mcpu=niagara}, the compiler additionally optimizes it for
12429 Sun UltraSPARC T1 chips.
12430
12431 @item -mtune=@var{cpu_type}
12432 @opindex mtune
12433 Set the instruction scheduling parameters for machine type
12434 @var{cpu_type}, but do not set the instruction set or register set that the
12435 option @option{-mcpu=@var{cpu_type}} would.
12436
12437 The same values for @option{-mcpu=@var{cpu_type}} can be used for
12438 @option{-mtune=@var{cpu_type}}, but the only useful values are those
12439 that select a particular cpu implementation.  Those are @samp{cypress},
12440 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
12441 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
12442 @samp{ultrasparc3}, and @samp{niagara}.
12443
12444 @item -mv8plus
12445 @itemx -mno-v8plus
12446 @opindex mv8plus
12447 @opindex mno-v8plus
12448 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
12449 difference from the V8 ABI is that the global and out registers are
12450 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
12451 mode for all SPARC-V9 processors.
12452
12453 @item -mvis
12454 @itemx -mno-vis
12455 @opindex mvis
12456 @opindex mno-vis
12457 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
12458 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
12459 @end table
12460
12461 These @samp{-m} options are supported in addition to the above
12462 on SPARC-V9 processors in 64-bit environments:
12463
12464 @table @gcctabopt
12465 @item -mlittle-endian
12466 @opindex mlittle-endian
12467 Generate code for a processor running in little-endian mode.  It is only
12468 available for a few configurations and most notably not on Solaris and Linux.
12469
12470 @item -m32
12471 @itemx -m64
12472 @opindex m32
12473 @opindex m64
12474 Generate code for a 32-bit or 64-bit environment.
12475 The 32-bit environment sets int, long and pointer to 32 bits.
12476 The 64-bit environment sets int to 32 bits and long and pointer
12477 to 64 bits.
12478
12479 @item -mcmodel=medlow
12480 @opindex mcmodel=medlow
12481 Generate code for the Medium/Low code model: 64-bit addresses, programs
12482 must be linked in the low 32 bits of memory.  Programs can be statically
12483 or dynamically linked.
12484
12485 @item -mcmodel=medmid
12486 @opindex mcmodel=medmid
12487 Generate code for the Medium/Middle code model: 64-bit addresses, programs
12488 must be linked in the low 44 bits of memory, the text and data segments must
12489 be less than 2GB in size and the data segment must be located within 2GB of
12490 the text segment.
12491
12492 @item -mcmodel=medany
12493 @opindex mcmodel=medany
12494 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
12495 may be linked anywhere in memory, the text and data segments must be less
12496 than 2GB in size and the data segment must be located within 2GB of the
12497 text segment.
12498
12499 @item -mcmodel=embmedany
12500 @opindex mcmodel=embmedany
12501 Generate code for the Medium/Anywhere code model for embedded systems:
12502 64-bit addresses, the text and data segments must be less than 2GB in
12503 size, both starting anywhere in memory (determined at link time).  The
12504 global register %g4 points to the base of the data segment.  Programs
12505 are statically linked and PIC is not supported.
12506
12507 @item -mstack-bias
12508 @itemx -mno-stack-bias
12509 @opindex mstack-bias
12510 @opindex mno-stack-bias
12511 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
12512 frame pointer if present, are offset by @minus{}2047 which must be added back
12513 when making stack frame references.  This is the default in 64-bit mode.
12514 Otherwise, assume no such offset is present.
12515 @end table
12516
12517 These switches are supported in addition to the above on Solaris:
12518
12519 @table @gcctabopt
12520 @item -threads
12521 @opindex threads
12522 Add support for multithreading using the Solaris threads library.  This
12523 option sets flags for both the preprocessor and linker.  This option does
12524 not affect the thread safety of object code produced by the compiler or
12525 that of libraries supplied with it.
12526
12527 @item -pthreads
12528 @opindex pthreads
12529 Add support for multithreading using the POSIX threads library.  This
12530 option sets flags for both the preprocessor and linker.  This option does
12531 not affect the thread safety of object code produced  by the compiler or
12532 that of libraries supplied with it.
12533
12534 @item -pthread
12535 @opindex pthread
12536 This is a synonym for @option{-pthreads}.
12537 @end table
12538
12539 @node System V Options
12540 @subsection Options for System V
12541
12542 These additional options are available on System V Release 4 for
12543 compatibility with other compilers on those systems:
12544
12545 @table @gcctabopt
12546 @item -G
12547 @opindex G
12548 Create a shared object.
12549 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
12550
12551 @item -Qy
12552 @opindex Qy
12553 Identify the versions of each tool used by the compiler, in a
12554 @code{.ident} assembler directive in the output.
12555
12556 @item -Qn
12557 @opindex Qn
12558 Refrain from adding @code{.ident} directives to the output file (this is
12559 the default).
12560
12561 @item -YP,@var{dirs}
12562 @opindex YP
12563 Search the directories @var{dirs}, and no others, for libraries
12564 specified with @option{-l}.
12565
12566 @item -Ym,@var{dir}
12567 @opindex Ym
12568 Look in the directory @var{dir} to find the M4 preprocessor.
12569 The assembler uses this option.
12570 @c This is supposed to go with a -Yd for predefined M4 macro files, but
12571 @c the generic assembler that comes with Solaris takes just -Ym.
12572 @end table
12573
12574 @node TMS320C3x/C4x Options
12575 @subsection TMS320C3x/C4x Options
12576 @cindex TMS320C3x/C4x Options
12577
12578 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
12579
12580 @table @gcctabopt
12581
12582 @item -mcpu=@var{cpu_type}
12583 @opindex mcpu
12584 Set the instruction set, register set, and instruction scheduling
12585 parameters for machine type @var{cpu_type}.  Supported values for
12586 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
12587 @samp{c44}.  The default is @samp{c40} to generate code for the
12588 TMS320C40.
12589
12590 @item -mbig-memory
12591 @itemx -mbig
12592 @itemx -msmall-memory
12593 @itemx -msmall
12594 @opindex mbig-memory
12595 @opindex mbig
12596 @opindex msmall-memory
12597 @opindex msmall
12598 Generates code for the big or small memory model.  The small memory
12599 model assumed that all data fits into one 64K word page.  At run-time
12600 the data page (DP) register must be set to point to the 64K page
12601 containing the .bss and .data program sections.  The big memory model is
12602 the default and requires reloading of the DP register for every direct
12603 memory access.
12604
12605 @item -mbk
12606 @itemx -mno-bk
12607 @opindex mbk
12608 @opindex mno-bk
12609 Allow (disallow) allocation of general integer operands into the block
12610 count register BK@.
12611
12612 @item -mdb
12613 @itemx -mno-db
12614 @opindex mdb
12615 @opindex mno-db
12616 Enable (disable) generation of code using decrement and branch,
12617 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
12618 on the safe side, this is disabled for the C3x, since the maximum
12619 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
12620 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
12621 that it can utilize the decrement and branch instruction, but will give
12622 up if there is more than one memory reference in the loop.  Thus a loop
12623 where the loop counter is decremented can generate slightly more
12624 efficient code, in cases where the RPTB instruction cannot be utilized.
12625
12626 @item -mdp-isr-reload
12627 @itemx -mparanoid
12628 @opindex mdp-isr-reload
12629 @opindex mparanoid
12630 Force the DP register to be saved on entry to an interrupt service
12631 routine (ISR), reloaded to point to the data section, and restored on
12632 exit from the ISR@.  This should not be required unless someone has
12633 violated the small memory model by modifying the DP register, say within
12634 an object library.
12635
12636 @item -mmpyi
12637 @itemx -mno-mpyi
12638 @opindex mmpyi
12639 @opindex mno-mpyi
12640 For the C3x use the 24-bit MPYI instruction for integer multiplies
12641 instead of a library call to guarantee 32-bit results.  Note that if one
12642 of the operands is a constant, then the multiplication will be performed
12643 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
12644 then squaring operations are performed inline instead of a library call.
12645
12646 @item -mfast-fix
12647 @itemx -mno-fast-fix
12648 @opindex mfast-fix
12649 @opindex mno-fast-fix
12650 The C3x/C4x FIX instruction to convert a floating point value to an
12651 integer value chooses the nearest integer less than or equal to the
12652 floating point value rather than to the nearest integer.  Thus if the
12653 floating point number is negative, the result will be incorrectly
12654 truncated an additional code is necessary to detect and correct this
12655 case.  This option can be used to disable generation of the additional
12656 code required to correct the result.
12657
12658 @item -mrptb
12659 @itemx -mno-rptb
12660 @opindex mrptb
12661 @opindex mno-rptb
12662 Enable (disable) generation of repeat block sequences using the RPTB
12663 instruction for zero overhead looping.  The RPTB construct is only used
12664 for innermost loops that do not call functions or jump across the loop
12665 boundaries.  There is no advantage having nested RPTB loops due to the
12666 overhead required to save and restore the RC, RS, and RE registers.
12667 This is enabled by default with @option{-O2}.
12668
12669 @item -mrpts=@var{count}
12670 @itemx -mno-rpts
12671 @opindex mrpts
12672 @opindex mno-rpts
12673 Enable (disable) the use of the single instruction repeat instruction
12674 RPTS@.  If a repeat block contains a single instruction, and the loop
12675 count can be guaranteed to be less than the value @var{count}, GCC will
12676 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
12677 then a RPTS will be emitted even if the loop count cannot be determined
12678 at compile time.  Note that the repeated instruction following RPTS does
12679 not have to be reloaded from memory each iteration, thus freeing up the
12680 CPU buses for operands.  However, since interrupts are blocked by this
12681 instruction, it is disabled by default.
12682
12683 @item -mloop-unsigned
12684 @itemx -mno-loop-unsigned
12685 @opindex mloop-unsigned
12686 @opindex mno-loop-unsigned
12687 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
12688 is @math{2^{31} + 1} since these instructions test if the iteration count is
12689 negative to terminate the loop.  If the iteration count is unsigned
12690 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
12691 exceeded.  This switch allows an unsigned iteration count.
12692
12693 @item -mti
12694 @opindex mti
12695 Try to emit an assembler syntax that the TI assembler (asm30) is happy
12696 with.  This also enforces compatibility with the API employed by the TI
12697 C3x C compiler.  For example, long doubles are passed as structures
12698 rather than in floating point registers.
12699
12700 @item -mregparm
12701 @itemx -mmemparm
12702 @opindex mregparm
12703 @opindex mmemparm
12704 Generate code that uses registers (stack) for passing arguments to functions.
12705 By default, arguments are passed in registers where possible rather
12706 than by pushing arguments on to the stack.
12707
12708 @item -mparallel-insns
12709 @itemx -mno-parallel-insns
12710 @opindex mparallel-insns
12711 @opindex mno-parallel-insns
12712 Allow the generation of parallel instructions.  This is enabled by
12713 default with @option{-O2}.
12714
12715 @item -mparallel-mpy
12716 @itemx -mno-parallel-mpy
12717 @opindex mparallel-mpy
12718 @opindex mno-parallel-mpy
12719 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
12720 provided @option{-mparallel-insns} is also specified.  These instructions have
12721 tight register constraints which can pessimize the code generation
12722 of large functions.
12723
12724 @end table
12725
12726 @node V850 Options
12727 @subsection V850 Options
12728 @cindex V850 Options
12729
12730 These @samp{-m} options are defined for V850 implementations:
12731
12732 @table @gcctabopt
12733 @item -mlong-calls
12734 @itemx -mno-long-calls
12735 @opindex mlong-calls
12736 @opindex mno-long-calls
12737 Treat all calls as being far away (near).  If calls are assumed to be
12738 far away, the compiler will always load the functions address up into a
12739 register, and call indirect through the pointer.
12740
12741 @item -mno-ep
12742 @itemx -mep
12743 @opindex mno-ep
12744 @opindex mep
12745 Do not optimize (do optimize) basic blocks that use the same index
12746 pointer 4 or more times to copy pointer into the @code{ep} register, and
12747 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
12748 option is on by default if you optimize.
12749
12750 @item -mno-prolog-function
12751 @itemx -mprolog-function
12752 @opindex mno-prolog-function
12753 @opindex mprolog-function
12754 Do not use (do use) external functions to save and restore registers
12755 at the prologue and epilogue of a function.  The external functions
12756 are slower, but use less code space if more than one function saves
12757 the same number of registers.  The @option{-mprolog-function} option
12758 is on by default if you optimize.
12759
12760 @item -mspace
12761 @opindex mspace
12762 Try to make the code as small as possible.  At present, this just turns
12763 on the @option{-mep} and @option{-mprolog-function} options.
12764
12765 @item -mtda=@var{n}
12766 @opindex mtda
12767 Put static or global variables whose size is @var{n} bytes or less into
12768 the tiny data area that register @code{ep} points to.  The tiny data
12769 area can hold up to 256 bytes in total (128 bytes for byte references).
12770
12771 @item -msda=@var{n}
12772 @opindex msda
12773 Put static or global variables whose size is @var{n} bytes or less into
12774 the small data area that register @code{gp} points to.  The small data
12775 area can hold up to 64 kilobytes.
12776
12777 @item -mzda=@var{n}
12778 @opindex mzda
12779 Put static or global variables whose size is @var{n} bytes or less into
12780 the first 32 kilobytes of memory.
12781
12782 @item -mv850
12783 @opindex mv850
12784 Specify that the target processor is the V850.
12785
12786 @item -mbig-switch
12787 @opindex mbig-switch
12788 Generate code suitable for big switch tables.  Use this option only if
12789 the assembler/linker complain about out of range branches within a switch
12790 table.
12791
12792 @item -mapp-regs
12793 @opindex mapp-regs
12794 This option will cause r2 and r5 to be used in the code generated by
12795 the compiler.  This setting is the default.
12796
12797 @item -mno-app-regs
12798 @opindex mno-app-regs
12799 This option will cause r2 and r5 to be treated as fixed registers.
12800
12801 @item -mv850e1
12802 @opindex mv850e1
12803 Specify that the target processor is the V850E1.  The preprocessor
12804 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
12805 this option is used.
12806
12807 @item -mv850e
12808 @opindex mv850e
12809 Specify that the target processor is the V850E@.  The preprocessor
12810 constant @samp{__v850e__} will be defined if this option is used.
12811
12812 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
12813 are defined then a default target processor will be chosen and the
12814 relevant @samp{__v850*__} preprocessor constant will be defined.
12815
12816 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
12817 defined, regardless of which processor variant is the target.
12818
12819 @item -mdisable-callt
12820 @opindex mdisable-callt
12821 This option will suppress generation of the CALLT instruction for the
12822 v850e and v850e1 flavors of the v850 architecture.  The default is
12823 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
12824
12825 @end table
12826
12827 @node VAX Options
12828 @subsection VAX Options
12829 @cindex VAX options
12830
12831 These @samp{-m} options are defined for the VAX:
12832
12833 @table @gcctabopt
12834 @item -munix
12835 @opindex munix
12836 Do not output certain jump instructions (@code{aobleq} and so on)
12837 that the Unix assembler for the VAX cannot handle across long
12838 ranges.
12839
12840 @item -mgnu
12841 @opindex mgnu
12842 Do output those jump instructions, on the assumption that you
12843 will assemble with the GNU assembler.
12844
12845 @item -mg
12846 @opindex mg
12847 Output code for g-format floating point numbers instead of d-format.
12848 @end table
12849
12850 @node x86-64 Options
12851 @subsection x86-64 Options
12852 @cindex x86-64 options
12853
12854 These are listed under @xref{i386 and x86-64 Options}.
12855
12856 @node Xstormy16 Options
12857 @subsection Xstormy16 Options
12858 @cindex Xstormy16 Options
12859
12860 These options are defined for Xstormy16:
12861
12862 @table @gcctabopt
12863 @item -msim
12864 @opindex msim
12865 Choose startup files and linker script suitable for the simulator.
12866 @end table
12867
12868 @node Xtensa Options
12869 @subsection Xtensa Options
12870 @cindex Xtensa Options
12871
12872 These options are supported for Xtensa targets:
12873
12874 @table @gcctabopt
12875 @item -mconst16
12876 @itemx -mno-const16
12877 @opindex mconst16
12878 @opindex mno-const16
12879 Enable or disable use of @code{CONST16} instructions for loading
12880 constant values.  The @code{CONST16} instruction is currently not a
12881 standard option from Tensilica.  When enabled, @code{CONST16}
12882 instructions are always used in place of the standard @code{L32R}
12883 instructions.  The use of @code{CONST16} is enabled by default only if
12884 the @code{L32R} instruction is not available.
12885
12886 @item -mfused-madd
12887 @itemx -mno-fused-madd
12888 @opindex mfused-madd
12889 @opindex mno-fused-madd
12890 Enable or disable use of fused multiply/add and multiply/subtract
12891 instructions in the floating-point option.  This has no effect if the
12892 floating-point option is not also enabled.  Disabling fused multiply/add
12893 and multiply/subtract instructions forces the compiler to use separate
12894 instructions for the multiply and add/subtract operations.  This may be
12895 desirable in some cases where strict IEEE 754-compliant results are
12896 required: the fused multiply add/subtract instructions do not round the
12897 intermediate result, thereby producing results with @emph{more} bits of
12898 precision than specified by the IEEE standard.  Disabling fused multiply
12899 add/subtract instructions also ensures that the program output is not
12900 sensitive to the compiler's ability to combine multiply and add/subtract
12901 operations.
12902
12903 @item -mtext-section-literals
12904 @itemx -mno-text-section-literals
12905 @opindex mtext-section-literals
12906 @opindex mno-text-section-literals
12907 Control the treatment of literal pools.  The default is
12908 @option{-mno-text-section-literals}, which places literals in a separate
12909 section in the output file.  This allows the literal pool to be placed
12910 in a data RAM/ROM, and it also allows the linker to combine literal
12911 pools from separate object files to remove redundant literals and
12912 improve code size.  With @option{-mtext-section-literals}, the literals
12913 are interspersed in the text section in order to keep them as close as
12914 possible to their references.  This may be necessary for large assembly
12915 files.
12916
12917 @item -mtarget-align
12918 @itemx -mno-target-align
12919 @opindex mtarget-align
12920 @opindex mno-target-align
12921 When this option is enabled, GCC instructs the assembler to
12922 automatically align instructions to reduce branch penalties at the
12923 expense of some code density.  The assembler attempts to widen density
12924 instructions to align branch targets and the instructions following call
12925 instructions.  If there are not enough preceding safe density
12926 instructions to align a target, no widening will be performed.  The
12927 default is @option{-mtarget-align}.  These options do not affect the
12928 treatment of auto-aligned instructions like @code{LOOP}, which the
12929 assembler will always align, either by widening density instructions or
12930 by inserting no-op instructions.
12931
12932 @item -mlongcalls
12933 @itemx -mno-longcalls
12934 @opindex mlongcalls
12935 @opindex mno-longcalls
12936 When this option is enabled, GCC instructs the assembler to translate
12937 direct calls to indirect calls unless it can determine that the target
12938 of a direct call is in the range allowed by the call instruction.  This
12939 translation typically occurs for calls to functions in other source
12940 files.  Specifically, the assembler translates a direct @code{CALL}
12941 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
12942 The default is @option{-mno-longcalls}.  This option should be used in
12943 programs where the call target can potentially be out of range.  This
12944 option is implemented in the assembler, not the compiler, so the
12945 assembly code generated by GCC will still show direct call
12946 instructions---look at the disassembled object code to see the actual
12947 instructions.  Note that the assembler will use an indirect call for
12948 every cross-file call, not just those that really will be out of range.
12949 @end table
12950
12951 @node zSeries Options
12952 @subsection zSeries Options
12953 @cindex zSeries options
12954
12955 These are listed under @xref{S/390 and zSeries Options}.
12956
12957 @node Code Gen Options
12958 @section Options for Code Generation Conventions
12959 @cindex code generation conventions
12960 @cindex options, code generation
12961 @cindex run-time options
12962
12963 These machine-independent options control the interface conventions
12964 used in code generation.
12965
12966 Most of them have both positive and negative forms; the negative form
12967 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
12968 one of the forms is listed---the one which is not the default.  You
12969 can figure out the other form by either removing @samp{no-} or adding
12970 it.
12971
12972 @table @gcctabopt
12973 @item -fbounds-check
12974 @opindex fbounds-check
12975 For front-ends that support it, generate additional code to check that
12976 indices used to access arrays are within the declared range.  This is
12977 currently only supported by the Java and Fortran front-ends, where
12978 this option defaults to true and false respectively.
12979
12980 @item -ftrapv
12981 @opindex ftrapv
12982 This option generates traps for signed overflow on addition, subtraction,
12983 multiplication operations.
12984
12985 @item -fwrapv
12986 @opindex fwrapv
12987 This option instructs the compiler to assume that signed arithmetic
12988 overflow of addition, subtraction and multiplication wraps around
12989 using twos-complement representation.  This flag enables some optimizations
12990 and disables others.  This option is enabled by default for the Java
12991 front-end, as required by the Java language specification.
12992
12993 @item -fexceptions
12994 @opindex fexceptions
12995 Enable exception handling.  Generates extra code needed to propagate
12996 exceptions.  For some targets, this implies GCC will generate frame
12997 unwind information for all functions, which can produce significant data
12998 size overhead, although it does not affect execution.  If you do not
12999 specify this option, GCC will enable it by default for languages like
13000 C++ which normally require exception handling, and disable it for
13001 languages like C that do not normally require it.  However, you may need
13002 to enable this option when compiling C code that needs to interoperate
13003 properly with exception handlers written in C++.  You may also wish to
13004 disable this option if you are compiling older C++ programs that don't
13005 use exception handling.
13006
13007 @item -fnon-call-exceptions
13008 @opindex fnon-call-exceptions
13009 Generate code that allows trapping instructions to throw exceptions.
13010 Note that this requires platform-specific runtime support that does
13011 not exist everywhere.  Moreover, it only allows @emph{trapping}
13012 instructions to throw exceptions, i.e.@: memory references or floating
13013 point instructions.  It does not allow exceptions to be thrown from
13014 arbitrary signal handlers such as @code{SIGALRM}.
13015
13016 @item -funwind-tables
13017 @opindex funwind-tables
13018 Similar to @option{-fexceptions}, except that it will just generate any needed
13019 static data, but will not affect the generated code in any other way.
13020 You will normally not enable this option; instead, a language processor
13021 that needs this handling would enable it on your behalf.
13022
13023 @item -fasynchronous-unwind-tables
13024 @opindex fasynchronous-unwind-tables
13025 Generate unwind table in dwarf2 format, if supported by target machine.  The
13026 table is exact at each instruction boundary, so it can be used for stack
13027 unwinding from asynchronous events (such as debugger or garbage collector).
13028
13029 @item -fpcc-struct-return
13030 @opindex fpcc-struct-return
13031 Return ``short'' @code{struct} and @code{union} values in memory like
13032 longer ones, rather than in registers.  This convention is less
13033 efficient, but it has the advantage of allowing intercallability between
13034 GCC-compiled files and files compiled with other compilers, particularly
13035 the Portable C Compiler (pcc).
13036
13037 The precise convention for returning structures in memory depends
13038 on the target configuration macros.
13039
13040 Short structures and unions are those whose size and alignment match
13041 that of some integer type.
13042
13043 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13044 switch is not binary compatible with code compiled with the
13045 @option{-freg-struct-return} switch.
13046 Use it to conform to a non-default application binary interface.
13047
13048 @item -freg-struct-return
13049 @opindex freg-struct-return
13050 Return @code{struct} and @code{union} values in registers when possible.
13051 This is more efficient for small structures than
13052 @option{-fpcc-struct-return}.
13053
13054 If you specify neither @option{-fpcc-struct-return} nor
13055 @option{-freg-struct-return}, GCC defaults to whichever convention is
13056 standard for the target.  If there is no standard convention, GCC
13057 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
13058 the principal compiler.  In those cases, we can choose the standard, and
13059 we chose the more efficient register return alternative.
13060
13061 @strong{Warning:} code compiled with the @option{-freg-struct-return}
13062 switch is not binary compatible with code compiled with the
13063 @option{-fpcc-struct-return} switch.
13064 Use it to conform to a non-default application binary interface.
13065
13066 @item -fshort-enums
13067 @opindex fshort-enums
13068 Allocate to an @code{enum} type only as many bytes as it needs for the
13069 declared range of possible values.  Specifically, the @code{enum} type
13070 will be equivalent to the smallest integer type which has enough room.
13071
13072 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
13073 code that is not binary compatible with code generated without that switch.
13074 Use it to conform to a non-default application binary interface.
13075
13076 @item -fshort-double
13077 @opindex fshort-double
13078 Use the same size for @code{double} as for @code{float}.
13079
13080 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
13081 code that is not binary compatible with code generated without that switch.
13082 Use it to conform to a non-default application binary interface.
13083
13084 @item -fshort-wchar
13085 @opindex fshort-wchar
13086 Override the underlying type for @samp{wchar_t} to be @samp{short
13087 unsigned int} instead of the default for the target.  This option is
13088 useful for building programs to run under WINE@.
13089
13090 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
13091 code that is not binary compatible with code generated without that switch.
13092 Use it to conform to a non-default application binary interface.
13093
13094 @item -fno-common
13095 @opindex fno-common
13096 In C, allocate even uninitialized global variables in the data section of the
13097 object file, rather than generating them as common blocks.  This has the
13098 effect that if the same variable is declared (without @code{extern}) in
13099 two different compilations, you will get an error when you link them.
13100 The only reason this might be useful is if you wish to verify that the
13101 program will work on other systems which always work this way.
13102
13103 @item -fno-ident
13104 @opindex fno-ident
13105 Ignore the @samp{#ident} directive.
13106
13107 @item -finhibit-size-directive
13108 @opindex finhibit-size-directive
13109 Don't output a @code{.size} assembler directive, or anything else that
13110 would cause trouble if the function is split in the middle, and the
13111 two halves are placed at locations far apart in memory.  This option is
13112 used when compiling @file{crtstuff.c}; you should not need to use it
13113 for anything else.
13114
13115 @item -fverbose-asm
13116 @opindex fverbose-asm
13117 Put extra commentary information in the generated assembly code to
13118 make it more readable.  This option is generally only of use to those
13119 who actually need to read the generated assembly code (perhaps while
13120 debugging the compiler itself).
13121
13122 @option{-fno-verbose-asm}, the default, causes the
13123 extra information to be omitted and is useful when comparing two assembler
13124 files.
13125
13126 @item -fpic
13127 @opindex fpic
13128 @cindex global offset table
13129 @cindex PIC
13130 Generate position-independent code (PIC) suitable for use in a shared
13131 library, if supported for the target machine.  Such code accesses all
13132 constant addresses through a global offset table (GOT)@.  The dynamic
13133 loader resolves the GOT entries when the program starts (the dynamic
13134 loader is not part of GCC; it is part of the operating system).  If
13135 the GOT size for the linked executable exceeds a machine-specific
13136 maximum size, you get an error message from the linker indicating that
13137 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
13138 instead.  (These maximums are 8k on the SPARC and 32k
13139 on the m68k and RS/6000.  The 386 has no such limit.)
13140
13141 Position-independent code requires special support, and therefore works
13142 only on certain machines.  For the 386, GCC supports PIC for System V
13143 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
13144 position-independent.
13145
13146 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13147 are defined to 1.
13148
13149 @item -fPIC
13150 @opindex fPIC
13151 If supported for the target machine, emit position-independent code,
13152 suitable for dynamic linking and avoiding any limit on the size of the
13153 global offset table.  This option makes a difference on the m68k,
13154 PowerPC and SPARC@.
13155
13156 Position-independent code requires special support, and therefore works
13157 only on certain machines.
13158
13159 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13160 are defined to 2.
13161
13162 @item -fpie
13163 @itemx -fPIE
13164 @opindex fpie
13165 @opindex fPIE
13166 These options are similar to @option{-fpic} and @option{-fPIC}, but
13167 generated position independent code can be only linked into executables.
13168 Usually these options are used when @option{-pie} GCC option will be
13169 used during linking.
13170
13171 @item -fno-jump-tables
13172 @opindex fno-jump-tables
13173 Do not use jump tables for switch statements even where it would be
13174 more efficient than other code generation strategies.  This option is
13175 of use in conjunction with @option{-fpic} or @option{-fPIC} for
13176 building code which forms part of a dynamic linker and cannot
13177 reference the address of a jump table.  On some targets, jump tables
13178 do not require a GOT and this option is not needed.
13179
13180 @item -ffixed-@var{reg}
13181 @opindex ffixed
13182 Treat the register named @var{reg} as a fixed register; generated code
13183 should never refer to it (except perhaps as a stack pointer, frame
13184 pointer or in some other fixed role).
13185
13186 @var{reg} must be the name of a register.  The register names accepted
13187 are machine-specific and are defined in the @code{REGISTER_NAMES}
13188 macro in the machine description macro file.
13189
13190 This flag does not have a negative form, because it specifies a
13191 three-way choice.
13192
13193 @item -fcall-used-@var{reg}
13194 @opindex fcall-used
13195 Treat the register named @var{reg} as an allocable register that is
13196 clobbered by function calls.  It may be allocated for temporaries or
13197 variables that do not live across a call.  Functions compiled this way
13198 will not save and restore the register @var{reg}.
13199
13200 It is an error to used this flag with the frame pointer or stack pointer.
13201 Use of this flag for other registers that have fixed pervasive roles in
13202 the machine's execution model will produce disastrous results.
13203
13204 This flag does not have a negative form, because it specifies a
13205 three-way choice.
13206
13207 @item -fcall-saved-@var{reg}
13208 @opindex fcall-saved
13209 Treat the register named @var{reg} as an allocable register saved by
13210 functions.  It may be allocated even for temporaries or variables that
13211 live across a call.  Functions compiled this way will save and restore
13212 the register @var{reg} if they use it.
13213
13214 It is an error to used this flag with the frame pointer or stack pointer.
13215 Use of this flag for other registers that have fixed pervasive roles in
13216 the machine's execution model will produce disastrous results.
13217
13218 A different sort of disaster will result from the use of this flag for
13219 a register in which function values may be returned.
13220
13221 This flag does not have a negative form, because it specifies a
13222 three-way choice.
13223
13224 @item -fpack-struct[=@var{n}]
13225 @opindex fpack-struct
13226 Without a value specified, pack all structure members together without
13227 holes.  When a value is specified (which must be a small power of two), pack
13228 structure members according to this value, representing the maximum
13229 alignment (that is, objects with default alignment requirements larger than
13230 this will be output potentially unaligned at the next fitting location.
13231
13232 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
13233 code that is not binary compatible with code generated without that switch.
13234 Additionally, it makes the code suboptimal.
13235 Use it to conform to a non-default application binary interface.
13236
13237 @item -finstrument-functions
13238 @opindex finstrument-functions
13239 Generate instrumentation calls for entry and exit to functions.  Just
13240 after function entry and just before function exit, the following
13241 profiling functions will be called with the address of the current
13242 function and its call site.  (On some platforms,
13243 @code{__builtin_return_address} does not work beyond the current
13244 function, so the call site information may not be available to the
13245 profiling functions otherwise.)
13246
13247 @smallexample
13248 void __cyg_profile_func_enter (void *this_fn,
13249                                void *call_site);
13250 void __cyg_profile_func_exit  (void *this_fn,
13251                                void *call_site);
13252 @end smallexample
13253
13254 The first argument is the address of the start of the current function,
13255 which may be looked up exactly in the symbol table.
13256
13257 This instrumentation is also done for functions expanded inline in other
13258 functions.  The profiling calls will indicate where, conceptually, the
13259 inline function is entered and exited.  This means that addressable
13260 versions of such functions must be available.  If all your uses of a
13261 function are expanded inline, this may mean an additional expansion of
13262 code size.  If you use @samp{extern inline} in your C code, an
13263 addressable version of such functions must be provided.  (This is
13264 normally the case anyways, but if you get lucky and the optimizer always
13265 expands the functions inline, you might have gotten away without
13266 providing static copies.)
13267
13268 A function may be given the attribute @code{no_instrument_function}, in
13269 which case this instrumentation will not be done.  This can be used, for
13270 example, for the profiling functions listed above, high-priority
13271 interrupt routines, and any functions from which the profiling functions
13272 cannot safely be called (perhaps signal handlers, if the profiling
13273 routines generate output or allocate memory).
13274
13275 @item -fstack-check
13276 @opindex fstack-check
13277 Generate code to verify that you do not go beyond the boundary of the
13278 stack.  You should specify this flag if you are running in an
13279 environment with multiple threads, but only rarely need to specify it in
13280 a single-threaded environment since stack overflow is automatically
13281 detected on nearly all systems if there is only one stack.
13282
13283 Note that this switch does not actually cause checking to be done; the
13284 operating system must do that.  The switch causes generation of code
13285 to ensure that the operating system sees the stack being extended.
13286
13287 @item -fstack-limit-register=@var{reg}
13288 @itemx -fstack-limit-symbol=@var{sym}
13289 @itemx -fno-stack-limit
13290 @opindex fstack-limit-register
13291 @opindex fstack-limit-symbol
13292 @opindex fno-stack-limit
13293 Generate code to ensure that the stack does not grow beyond a certain value,
13294 either the value of a register or the address of a symbol.  If the stack
13295 would grow beyond the value, a signal is raised.  For most targets,
13296 the signal is raised before the stack overruns the boundary, so
13297 it is possible to catch the signal without taking special precautions.
13298
13299 For instance, if the stack starts at absolute address @samp{0x80000000}
13300 and grows downwards, you can use the flags
13301 @option{-fstack-limit-symbol=__stack_limit} and
13302 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
13303 of 128KB@.  Note that this may only work with the GNU linker.
13304
13305 @cindex aliasing of parameters
13306 @cindex parameters, aliased
13307 @item -fargument-alias
13308 @itemx -fargument-noalias
13309 @itemx -fargument-noalias-global
13310 @itemx -fargument-noalias-anything
13311 @opindex fargument-alias
13312 @opindex fargument-noalias
13313 @opindex fargument-noalias-global
13314 @opindex fargument-noalias-anything
13315 Specify the possible relationships among parameters and between
13316 parameters and global data.
13317
13318 @option{-fargument-alias} specifies that arguments (parameters) may
13319 alias each other and may alias global storage.@*
13320 @option{-fargument-noalias} specifies that arguments do not alias
13321 each other, but may alias global storage.@*
13322 @option{-fargument-noalias-global} specifies that arguments do not
13323 alias each other and do not alias global storage.
13324 @option{-fargument-noalias-anything} specifies that arguments do not
13325 alias any other storage.
13326
13327 Each language will automatically use whatever option is required by
13328 the language standard.  You should not need to use these options yourself.
13329
13330 @item -fleading-underscore
13331 @opindex fleading-underscore
13332 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
13333 change the way C symbols are represented in the object file.  One use
13334 is to help link with legacy assembly code.
13335
13336 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
13337 generate code that is not binary compatible with code generated without that
13338 switch.  Use it to conform to a non-default application binary interface.
13339 Not all targets provide complete support for this switch.
13340
13341 @item -ftls-model=@var{model}
13342 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
13343 The @var{model} argument should be one of @code{global-dynamic},
13344 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
13345
13346 The default without @option{-fpic} is @code{initial-exec}; with
13347 @option{-fpic} the default is @code{global-dynamic}.
13348
13349 @item -fvisibility=@var{default|internal|hidden|protected}
13350 @opindex fvisibility
13351 Set the default ELF image symbol visibility to the specified option---all
13352 symbols will be marked with this unless overridden within the code.
13353 Using this feature can very substantially improve linking and
13354 load times of shared object libraries, produce more optimized
13355 code, provide near-perfect API export and prevent symbol clashes.
13356 It is @strong{strongly} recommended that you use this in any shared objects
13357 you distribute.
13358
13359 Despite the nomenclature, @code{default} always means public ie;
13360 available to be linked against from outside the shared object.
13361 @code{protected} and @code{internal} are pretty useless in real-world
13362 usage so the only other commonly used option will be @code{hidden}.
13363 The default if @option{-fvisibility} isn't specified is
13364 @code{default}, i.e., make every
13365 symbol public---this causes the same behavior as previous versions of
13366 GCC@.
13367
13368 A good explanation of the benefits offered by ensuring ELF
13369 symbols have the correct visibility is given by ``How To Write
13370 Shared Libraries'' by Ulrich Drepper (which can be found at
13371 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
13372 solution made possible by this option to marking things hidden when
13373 the default is public is to make the default hidden and mark things
13374 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
13375 and @code{__attribute__ ((visibility("default")))} instead of
13376 @code{__declspec(dllexport)} you get almost identical semantics with
13377 identical syntax.  This is a great boon to those working with
13378 cross-platform projects.
13379
13380 For those adding visibility support to existing code, you may find
13381 @samp{#pragma GCC visibility} of use.  This works by you enclosing
13382 the declarations you wish to set visibility for with (for example)
13383 @samp{#pragma GCC visibility push(hidden)} and
13384 @samp{#pragma GCC visibility pop}.
13385 Bear in mind that symbol visibility should be viewed @strong{as
13386 part of the API interface contract} and thus all new code should
13387 always specify visibility when it is not the default ie; declarations
13388 only for use within the local DSO should @strong{always} be marked explicitly
13389 as hidden as so to avoid PLT indirection overheads---making this
13390 abundantly clear also aids readability and self-documentation of the code.
13391 Note that due to ISO C++ specification requirements, operator new and
13392 operator delete must always be of default visibility.
13393
13394 Be aware that headers from outside your project, in particular system
13395 headers and headers from any other library you use, may not be
13396 expecting to be compiled with visibility other than the default.  You
13397 may need to explicitly say @samp{#pragma GCC visibility push(default)}
13398 before including any such headers.
13399
13400 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
13401 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
13402 no modifications.  However, this means that calls to @samp{extern}
13403 functions with no explicit visibility will use the PLT, so it is more
13404 effective to use @samp{__attribute ((visibility))} and/or
13405 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
13406 declarations should be treated as hidden.
13407
13408 Note that @samp{-fvisibility} does affect C++ vague linkage
13409 entities. This means that, for instance, an exception class that will
13410 be thrown between DSOs must be explicitly marked with default
13411 visibility so that the @samp{type_info} nodes will be unified between
13412 the DSOs.
13413
13414 An overview of these techniques, their benefits and how to use them
13415 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
13416
13417 @end table
13418
13419 @c man end
13420
13421 @node Environment Variables
13422 @section Environment Variables Affecting GCC
13423 @cindex environment variables
13424
13425 @c man begin ENVIRONMENT
13426 This section describes several environment variables that affect how GCC
13427 operates.  Some of them work by specifying directories or prefixes to use
13428 when searching for various kinds of files.  Some are used to specify other
13429 aspects of the compilation environment.
13430
13431 Note that you can also specify places to search using options such as
13432 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
13433 take precedence over places specified using environment variables, which
13434 in turn take precedence over those specified by the configuration of GCC@.
13435 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
13436 GNU Compiler Collection (GCC) Internals}.
13437
13438 @table @env
13439 @item LANG
13440 @itemx LC_CTYPE
13441 @c @itemx LC_COLLATE
13442 @itemx LC_MESSAGES
13443 @c @itemx LC_MONETARY
13444 @c @itemx LC_NUMERIC
13445 @c @itemx LC_TIME
13446 @itemx LC_ALL
13447 @findex LANG
13448 @findex LC_CTYPE
13449 @c @findex LC_COLLATE
13450 @findex LC_MESSAGES
13451 @c @findex LC_MONETARY
13452 @c @findex LC_NUMERIC
13453 @c @findex LC_TIME
13454 @findex LC_ALL
13455 @cindex locale
13456 These environment variables control the way that GCC uses
13457 localization information that allow GCC to work with different
13458 national conventions.  GCC inspects the locale categories
13459 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
13460 so.  These locale categories can be set to any value supported by your
13461 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
13462 Kingdom encoded in UTF-8.
13463
13464 The @env{LC_CTYPE} environment variable specifies character
13465 classification.  GCC uses it to determine the character boundaries in
13466 a string; this is needed for some multibyte encodings that contain quote
13467 and escape characters that would otherwise be interpreted as a string
13468 end or escape.
13469
13470 The @env{LC_MESSAGES} environment variable specifies the language to
13471 use in diagnostic messages.
13472
13473 If the @env{LC_ALL} environment variable is set, it overrides the value
13474 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
13475 and @env{LC_MESSAGES} default to the value of the @env{LANG}
13476 environment variable.  If none of these variables are set, GCC
13477 defaults to traditional C English behavior.
13478
13479 @item TMPDIR
13480 @findex TMPDIR
13481 If @env{TMPDIR} is set, it specifies the directory to use for temporary
13482 files.  GCC uses temporary files to hold the output of one stage of
13483 compilation which is to be used as input to the next stage: for example,
13484 the output of the preprocessor, which is the input to the compiler
13485 proper.
13486
13487 @item GCC_EXEC_PREFIX
13488 @findex GCC_EXEC_PREFIX
13489 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
13490 names of the subprograms executed by the compiler.  No slash is added
13491 when this prefix is combined with the name of a subprogram, but you can
13492 specify a prefix that ends with a slash if you wish.
13493
13494 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
13495 an appropriate prefix to use based on the pathname it was invoked with.
13496
13497 If GCC cannot find the subprogram using the specified prefix, it
13498 tries looking in the usual places for the subprogram.
13499
13500 The default value of @env{GCC_EXEC_PREFIX} is
13501 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the value
13502 of @code{prefix} when you ran the @file{configure} script.
13503
13504 Other prefixes specified with @option{-B} take precedence over this prefix.
13505
13506 This prefix is also used for finding files such as @file{crt0.o} that are
13507 used for linking.
13508
13509 In addition, the prefix is used in an unusual way in finding the
13510 directories to search for header files.  For each of the standard
13511 directories whose name normally begins with @samp{/usr/local/lib/gcc}
13512 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
13513 replacing that beginning with the specified prefix to produce an
13514 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
13515 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
13516 These alternate directories are searched first; the standard directories
13517 come next.
13518
13519 @item COMPILER_PATH
13520 @findex COMPILER_PATH
13521 The value of @env{COMPILER_PATH} is a colon-separated list of
13522 directories, much like @env{PATH}.  GCC tries the directories thus
13523 specified when searching for subprograms, if it can't find the
13524 subprograms using @env{GCC_EXEC_PREFIX}.
13525
13526 @item LIBRARY_PATH
13527 @findex LIBRARY_PATH
13528 The value of @env{LIBRARY_PATH} is a colon-separated list of
13529 directories, much like @env{PATH}.  When configured as a native compiler,
13530 GCC tries the directories thus specified when searching for special
13531 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
13532 using GCC also uses these directories when searching for ordinary
13533 libraries for the @option{-l} option (but directories specified with
13534 @option{-L} come first).
13535
13536 @item LANG
13537 @findex LANG
13538 @cindex locale definition
13539 This variable is used to pass locale information to the compiler.  One way in
13540 which this information is used is to determine the character set to be used
13541 when character literals, string literals and comments are parsed in C and C++.
13542 When the compiler is configured to allow multibyte characters,
13543 the following values for @env{LANG} are recognized:
13544
13545 @table @samp
13546 @item C-JIS
13547 Recognize JIS characters.
13548 @item C-SJIS
13549 Recognize SJIS characters.
13550 @item C-EUCJP
13551 Recognize EUCJP characters.
13552 @end table
13553
13554 If @env{LANG} is not defined, or if it has some other value, then the
13555 compiler will use mblen and mbtowc as defined by the default locale to
13556 recognize and translate multibyte characters.
13557 @end table
13558
13559 @noindent
13560 Some additional environments variables affect the behavior of the
13561 preprocessor.
13562
13563 @include cppenv.texi
13564
13565 @c man end
13566
13567 @node Precompiled Headers
13568 @section Using Precompiled Headers
13569 @cindex precompiled headers
13570 @cindex speed of compilation
13571
13572 Often large projects have many header files that are included in every
13573 source file.  The time the compiler takes to process these header files
13574 over and over again can account for nearly all of the time required to
13575 build the project.  To make builds faster, GCC allows users to
13576 `precompile' a header file; then, if builds can use the precompiled
13577 header file they will be much faster.
13578
13579 To create a precompiled header file, simply compile it as you would any
13580 other file, if necessary using the @option{-x} option to make the driver
13581 treat it as a C or C++ header file.  You will probably want to use a
13582 tool like @command{make} to keep the precompiled header up-to-date when
13583 the headers it contains change.
13584
13585 A precompiled header file will be searched for when @code{#include} is
13586 seen in the compilation.  As it searches for the included file
13587 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
13588 compiler looks for a precompiled header in each directory just before it
13589 looks for the include file in that directory.  The name searched for is
13590 the name specified in the @code{#include} with @samp{.gch} appended.  If
13591 the precompiled header file can't be used, it is ignored.
13592
13593 For instance, if you have @code{#include "all.h"}, and you have
13594 @file{all.h.gch} in the same directory as @file{all.h}, then the
13595 precompiled header file will be used if possible, and the original
13596 header will be used otherwise.
13597
13598 Alternatively, you might decide to put the precompiled header file in a
13599 directory and use @option{-I} to ensure that directory is searched
13600 before (or instead of) the directory containing the original header.
13601 Then, if you want to check that the precompiled header file is always
13602 used, you can put a file of the same name as the original header in this
13603 directory containing an @code{#error} command.
13604
13605 This also works with @option{-include}.  So yet another way to use
13606 precompiled headers, good for projects not designed with precompiled
13607 header files in mind, is to simply take most of the header files used by
13608 a project, include them from another header file, precompile that header
13609 file, and @option{-include} the precompiled header.  If the header files
13610 have guards against multiple inclusion, they will be skipped because
13611 they've already been included (in the precompiled header).
13612
13613 If you need to precompile the same header file for different
13614 languages, targets, or compiler options, you can instead make a
13615 @emph{directory} named like @file{all.h.gch}, and put each precompiled
13616 header in the directory, perhaps using @option{-o}.  It doesn't matter
13617 what you call the files in the directory, every precompiled header in
13618 the directory will be considered.  The first precompiled header
13619 encountered in the directory that is valid for this compilation will
13620 be used; they're searched in no particular order.
13621
13622 There are many other possibilities, limited only by your imagination,
13623 good sense, and the constraints of your build system.
13624
13625 A precompiled header file can be used only when these conditions apply:
13626
13627 @itemize
13628 @item
13629 Only one precompiled header can be used in a particular compilation.
13630
13631 @item
13632 A precompiled header can't be used once the first C token is seen.  You
13633 can have preprocessor directives before a precompiled header; you can
13634 even include a precompiled header from inside another header, so long as
13635 there are no C tokens before the @code{#include}.
13636
13637 @item
13638 The precompiled header file must be produced for the same language as
13639 the current compilation.  You can't use a C precompiled header for a C++
13640 compilation.
13641
13642 @item
13643 The precompiled header file must have been produced by the same compiler
13644 binary as the current compilation is using.
13645
13646 @item
13647 Any macros defined before the precompiled header is included must
13648 either be defined in the same way as when the precompiled header was
13649 generated, or must not affect the precompiled header, which usually
13650 means that they don't appear in the precompiled header at all.
13651
13652 The @option{-D} option is one way to define a macro before a
13653 precompiled header is included; using a @code{#define} can also do it.
13654 There are also some options that define macros implicitly, like
13655 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
13656 defined this way.
13657
13658 @item If debugging information is output when using the precompiled
13659 header, using @option{-g} or similar, the same kind of debugging information
13660 must have been output when building the precompiled header.  However,
13661 a precompiled header built using @option{-g} can be used in a compilation
13662 when no debugging information is being output.
13663
13664 @item The same @option{-m} options must generally be used when building
13665 and using the precompiled header.  @xref{Submodel Options},
13666 for any cases where this rule is relaxed.
13667
13668 @item Each of the following options must be the same when building and using
13669 the precompiled header:
13670
13671 @gccoptlist{-fexceptions -funit-at-a-time}
13672
13673 @item
13674 Some other command-line options starting with @option{-f},
13675 @option{-p}, or @option{-O} must be defined in the same way as when
13676 the precompiled header was generated.  At present, it's not clear
13677 which options are safe to change and which are not; the safest choice
13678 is to use exactly the same options when generating and using the
13679 precompiled header.  The following are known to be safe:
13680
13681 @gccoptlist{-fmessage-length= -fpreprocessed
13682 -fsched-interblock -fsched-spec -fsched-spec-load -fsched-spec-load-dangerous
13683 -fsched-verbose=<number> -fschedule-insns -fvisibility=
13684 -pedantic-errors}
13685
13686 @end itemize
13687
13688 For all of these except the last, the compiler will automatically
13689 ignore the precompiled header if the conditions aren't met.  If you
13690 find an option combination that doesn't work and doesn't cause the
13691 precompiled header to be ignored, please consider filing a bug report,
13692 see @ref{Bugs}.
13693
13694 If you do use differing options when generating and using the
13695 precompiled header, the actual behavior will be a mixture of the
13696 behavior for the options.  For instance, if you use @option{-g} to
13697 generate the precompiled header but not when using it, you may or may
13698 not get debugging information for routines in the precompiled header.
13699
13700 @node Running Protoize
13701 @section Running Protoize
13702
13703 The program @code{protoize} is an optional part of GCC@.  You can use
13704 it to add prototypes to a program, thus converting the program to ISO
13705 C in one respect.  The companion program @code{unprotoize} does the
13706 reverse: it removes argument types from any prototypes that are found.
13707
13708 When you run these programs, you must specify a set of source files as
13709 command line arguments.  The conversion programs start out by compiling
13710 these files to see what functions they define.  The information gathered
13711 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
13712
13713 After scanning comes actual conversion.  The specified files are all
13714 eligible to be converted; any files they include (whether sources or
13715 just headers) are eligible as well.
13716
13717 But not all the eligible files are converted.  By default,
13718 @code{protoize} and @code{unprotoize} convert only source and header
13719 files in the current directory.  You can specify additional directories
13720 whose files should be converted with the @option{-d @var{directory}}
13721 option.  You can also specify particular files to exclude with the
13722 @option{-x @var{file}} option.  A file is converted if it is eligible, its
13723 directory name matches one of the specified directory names, and its
13724 name within the directory has not been excluded.
13725
13726 Basic conversion with @code{protoize} consists of rewriting most
13727 function definitions and function declarations to specify the types of
13728 the arguments.  The only ones not rewritten are those for varargs
13729 functions.
13730
13731 @code{protoize} optionally inserts prototype declarations at the
13732 beginning of the source file, to make them available for any calls that
13733 precede the function's definition.  Or it can insert prototype
13734 declarations with block scope in the blocks where undeclared functions
13735 are called.
13736
13737 Basic conversion with @code{unprotoize} consists of rewriting most
13738 function declarations to remove any argument types, and rewriting
13739 function definitions to the old-style pre-ISO form.
13740
13741 Both conversion programs print a warning for any function declaration or
13742 definition that they can't convert.  You can suppress these warnings
13743 with @option{-q}.
13744
13745 The output from @code{protoize} or @code{unprotoize} replaces the
13746 original source file.  The original file is renamed to a name ending
13747 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
13748 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
13749 for DOS) file already exists, then the source file is simply discarded.
13750
13751 @code{protoize} and @code{unprotoize} both depend on GCC itself to
13752 scan the program and collect information about the functions it uses.
13753 So neither of these programs will work until GCC is installed.
13754
13755 Here is a table of the options you can use with @code{protoize} and
13756 @code{unprotoize}.  Each option works with both programs unless
13757 otherwise stated.
13758
13759 @table @code
13760 @item -B @var{directory}
13761 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
13762 usual directory (normally @file{/usr/local/lib}).  This file contains
13763 prototype information about standard system functions.  This option
13764 applies only to @code{protoize}.
13765
13766 @item -c @var{compilation-options}
13767 Use @var{compilation-options} as the options when running @command{gcc} to
13768 produce the @samp{.X} files.  The special option @option{-aux-info} is
13769 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
13770
13771 Note that the compilation options must be given as a single argument to
13772 @code{protoize} or @code{unprotoize}.  If you want to specify several
13773 @command{gcc} options, you must quote the entire set of compilation options
13774 to make them a single word in the shell.
13775
13776 There are certain @command{gcc} arguments that you cannot use, because they
13777 would produce the wrong kind of output.  These include @option{-g},
13778 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
13779 the @var{compilation-options}, they are ignored.
13780
13781 @item -C
13782 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
13783 systems) instead of @samp{.c}.  This is convenient if you are converting
13784 a C program to C++.  This option applies only to @code{protoize}.
13785
13786 @item -g
13787 Add explicit global declarations.  This means inserting explicit
13788 declarations at the beginning of each source file for each function
13789 that is called in the file and was not declared.  These declarations
13790 precede the first function definition that contains a call to an
13791 undeclared function.  This option applies only to @code{protoize}.
13792
13793 @item -i @var{string}
13794 Indent old-style parameter declarations with the string @var{string}.
13795 This option applies only to @code{protoize}.
13796
13797 @code{unprotoize} converts prototyped function definitions to old-style
13798 function definitions, where the arguments are declared between the
13799 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
13800 uses five spaces as the indentation.  If you want to indent with just
13801 one space instead, use @option{-i " "}.
13802
13803 @item -k
13804 Keep the @samp{.X} files.  Normally, they are deleted after conversion
13805 is finished.
13806
13807 @item -l
13808 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
13809 a prototype declaration for each function in each block which calls the
13810 function without any declaration.  This option applies only to
13811 @code{protoize}.
13812
13813 @item -n
13814 Make no real changes.  This mode just prints information about the conversions
13815 that would have been done without @option{-n}.
13816
13817 @item -N
13818 Make no @samp{.save} files.  The original files are simply deleted.
13819 Use this option with caution.
13820
13821 @item -p @var{program}
13822 Use the program @var{program} as the compiler.  Normally, the name
13823 @file{gcc} is used.
13824
13825 @item -q
13826 Work quietly.  Most warnings are suppressed.
13827
13828 @item -v
13829 Print the version number, just like @option{-v} for @command{gcc}.
13830 @end table
13831
13832 If you need special compiler options to compile one of your program's
13833 source files, then you should generate that file's @samp{.X} file
13834 specially, by running @command{gcc} on that source file with the
13835 appropriate options and the option @option{-aux-info}.  Then run
13836 @code{protoize} on the entire set of files.  @code{protoize} will use
13837 the existing @samp{.X} file because it is newer than the source file.
13838 For example:
13839
13840 @smallexample
13841 gcc -Dfoo=bar file1.c -aux-info file1.X
13842 protoize *.c
13843 @end smallexample
13844
13845 @noindent
13846 You need to include the special files along with the rest in the
13847 @code{protoize} command, even though their @samp{.X} files already
13848 exist, because otherwise they won't get converted.
13849
13850 @xref{Protoize Caveats}, for more information on how to use
13851 @code{protoize} successfully.