]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - contrib/gcc/doc/invoke.texi
Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
[FreeBSD/releng/9.0.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 -m3dnow @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 winchip-c6
9065 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9066 set support.
9067 @item winchip2
9068 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9069 instruction set support.
9070 @item c3
9071 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9072 implemented for this chip.)
9073 @item c3-2
9074 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9075 implemented for this chip.)
9076 @item geode
9077 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9078 @end table
9079
9080 While picking a specific @var{cpu-type} will schedule things appropriately
9081 for that particular chip, the compiler will not generate any code that
9082 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9083 being used.
9084
9085 @item -march=@var{cpu-type}
9086 @opindex march
9087 Generate instructions for the machine type @var{cpu-type}.  The choices
9088 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9089 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9090
9091 @item -mcpu=@var{cpu-type}
9092 @opindex mcpu
9093 A deprecated synonym for @option{-mtune}.
9094
9095 @item -m386
9096 @itemx -m486
9097 @itemx -mpentium
9098 @itemx -mpentiumpro
9099 @opindex m386
9100 @opindex m486
9101 @opindex mpentium
9102 @opindex mpentiumpro
9103 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9104 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9105 These synonyms are deprecated.
9106
9107 @item -mfpmath=@var{unit}
9108 @opindex march
9109 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9110 for @var{unit} are:
9111
9112 @table @samp
9113 @item 387
9114 Use the standard 387 floating point coprocessor present majority of chips and
9115 emulated otherwise.  Code compiled with this option will run almost everywhere.
9116 The temporary results are computed in 80bit precision instead of precision
9117 specified by the type resulting in slightly different results compared to most
9118 of other chips.  See @option{-ffloat-store} for more detailed description.
9119
9120 This is the default choice for i386 compiler.
9121
9122 @item sse
9123 Use scalar floating point instructions present in the SSE instruction set.
9124 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9125 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9126 instruction set supports only single precision arithmetics, thus the double and
9127 extended precision arithmetics is still done using 387.  Later version, present
9128 only in Pentium4 and the future AMD x86-64 chips supports double precision
9129 arithmetics too.
9130
9131 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9132 or @option{-msse2} switches to enable SSE extensions and make this option
9133 effective.  For the x86-64 compiler, these extensions are enabled by default.
9134
9135 The resulting code should be considerably faster in the majority of cases and avoid
9136 the numerical instability problems of 387 code, but may break some existing
9137 code that expects temporaries to be 80bit.
9138
9139 This is the default choice for the x86-64 compiler.
9140
9141 @item sse,387
9142 Attempt to utilize both instruction sets at once.  This effectively double the
9143 amount of available registers and on chips with separate execution units for
9144 387 and SSE the execution resources too.  Use this option with care, as it is
9145 still experimental, because the GCC register allocator does not model separate
9146 functional units well resulting in instable performance.
9147 @end table
9148
9149 @item -masm=@var{dialect}
9150 @opindex masm=@var{dialect}
9151 Output asm instructions using selected @var{dialect}.  Supported
9152 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9153 not support @samp{intel}.
9154
9155 @item -mieee-fp
9156 @itemx -mno-ieee-fp
9157 @opindex mieee-fp
9158 @opindex mno-ieee-fp
9159 Control whether or not the compiler uses IEEE floating point
9160 comparisons.  These handle correctly the case where the result of a
9161 comparison is unordered.
9162
9163 @item -msoft-float
9164 @opindex msoft-float
9165 Generate output containing library calls for floating point.
9166 @strong{Warning:} the requisite libraries are not part of GCC@.
9167 Normally the facilities of the machine's usual C compiler are used, but
9168 this can't be done directly in cross-compilation.  You must make your
9169 own arrangements to provide suitable library functions for
9170 cross-compilation.
9171
9172 On machines where a function returns floating point results in the 80387
9173 register stack, some floating point opcodes may be emitted even if
9174 @option{-msoft-float} is used.
9175
9176 @item -mno-fp-ret-in-387
9177 @opindex mno-fp-ret-in-387
9178 Do not use the FPU registers for return values of functions.
9179
9180 The usual calling convention has functions return values of types
9181 @code{float} and @code{double} in an FPU register, even if there
9182 is no FPU@.  The idea is that the operating system should emulate
9183 an FPU@.
9184
9185 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9186 in ordinary CPU registers instead.
9187
9188 @item -mno-fancy-math-387
9189 @opindex mno-fancy-math-387
9190 Some 387 emulators do not support the @code{sin}, @code{cos} and
9191 @code{sqrt} instructions for the 387.  Specify this option to avoid
9192 generating those instructions.  This option is the default on
9193 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9194 indicates that the target cpu will always have an FPU and so the
9195 instruction will not need emulation.  As of revision 2.6.1, these
9196 instructions are not generated unless you also use the
9197 @option{-funsafe-math-optimizations} switch.
9198
9199 @item -malign-double
9200 @itemx -mno-align-double
9201 @opindex malign-double
9202 @opindex mno-align-double
9203 Control whether GCC aligns @code{double}, @code{long double}, and
9204 @code{long long} variables on a two word boundary or a one word
9205 boundary.  Aligning @code{double} variables on a two word boundary will
9206 produce code that runs somewhat faster on a @samp{Pentium} at the
9207 expense of more memory.
9208
9209 On x86-64, @option{-malign-double} is enabled by default.
9210
9211 @strong{Warning:} if you use the @option{-malign-double} switch,
9212 structures containing the above types will be aligned differently than
9213 the published application binary interface specifications for the 386
9214 and will not be binary compatible with structures in code compiled
9215 without that switch.
9216
9217 @item -m96bit-long-double
9218 @itemx -m128bit-long-double
9219 @opindex m96bit-long-double
9220 @opindex m128bit-long-double
9221 These switches control the size of @code{long double} type.  The i386
9222 application binary interface specifies the size to be 96 bits,
9223 so @option{-m96bit-long-double} is the default in 32 bit mode.
9224
9225 Modern architectures (Pentium and newer) would prefer @code{long double}
9226 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9227 conforming to the ABI, this would not be possible.  So specifying a
9228 @option{-m128bit-long-double} will align @code{long double}
9229 to a 16 byte boundary by padding the @code{long double} with an additional
9230 32 bit zero.
9231
9232 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9233 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9234
9235 Notice that neither of these options enable any extra precision over the x87
9236 standard of 80 bits for a @code{long double}.
9237
9238 @strong{Warning:} if you override the default value for your target ABI, the
9239 structures and arrays containing @code{long double} variables will change
9240 their size as well as function calling convention for function taking
9241 @code{long double} will be modified.  Hence they will not be binary
9242 compatible with arrays or structures in code compiled without that switch.
9243
9244 @item -mmlarge-data-threshold=@var{number}
9245 @opindex mlarge-data-threshold=@var{number}
9246 When @option{-mcmodel=medium} is specified, the data greater than
9247 @var{threshold} are placed in large data section.  This value must be the
9248 same across all object linked into the binary and defaults to 65535.
9249
9250 @item -msvr3-shlib
9251 @itemx -mno-svr3-shlib
9252 @opindex msvr3-shlib
9253 @opindex mno-svr3-shlib
9254 Control whether GCC places uninitialized local variables into the
9255 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9256 into @code{bss}.  These options are meaningful only on System V Release 3.
9257
9258 @item -mrtd
9259 @opindex mrtd
9260 Use a different function-calling convention, in which functions that
9261 take a fixed number of arguments return with the @code{ret} @var{num}
9262 instruction, which pops their arguments while returning.  This saves one
9263 instruction in the caller since there is no need to pop the arguments
9264 there.
9265
9266 You can specify that an individual function is called with this calling
9267 sequence with the function attribute @samp{stdcall}.  You can also
9268 override the @option{-mrtd} option by using the function attribute
9269 @samp{cdecl}.  @xref{Function Attributes}.
9270
9271 @strong{Warning:} this calling convention is incompatible with the one
9272 normally used on Unix, so you cannot use it if you need to call
9273 libraries compiled with the Unix compiler.
9274
9275 Also, you must provide function prototypes for all functions that
9276 take variable numbers of arguments (including @code{printf});
9277 otherwise incorrect code will be generated for calls to those
9278 functions.
9279
9280 In addition, seriously incorrect code will result if you call a
9281 function with too many arguments.  (Normally, extra arguments are
9282 harmlessly ignored.)
9283
9284 @item -mregparm=@var{num}
9285 @opindex mregparm
9286 Control how many registers are used to pass integer arguments.  By
9287 default, no registers are used to pass arguments, and at most 3
9288 registers can be used.  You can control this behavior for a specific
9289 function by using the function attribute @samp{regparm}.
9290 @xref{Function Attributes}.
9291
9292 @strong{Warning:} if you use this switch, and
9293 @var{num} is nonzero, then you must build all modules with the same
9294 value, including any libraries.  This includes the system libraries and
9295 startup modules.
9296
9297 @item -msseregparm
9298 @opindex msseregparm
9299 Use SSE register passing conventions for float and double arguments
9300 and return values.  You can control this behavior for a specific
9301 function by using the function attribute @samp{sseregparm}.
9302 @xref{Function Attributes}.
9303
9304 @strong{Warning:} if you use this switch then you must build all
9305 modules with the same value, including any libraries.  This includes
9306 the system libraries and startup modules.
9307
9308 @item -mstackrealign
9309 @opindex mstackrealign
9310 Realign the stack at entry.  On the Intel x86, the
9311 @option{-mstackrealign} option will generate an alternate prologue and
9312 epilogue that realigns the runtime stack.  This supports mixing legacy
9313 codes that keep a 4-byte aligned stack with modern codes that keep a
9314 16-byte stack for SSE compatibility.  The alternate prologue and
9315 epilogue are slower and bigger than the regular ones, and the
9316 alternate prologue requires an extra scratch register; this lowers the
9317 number of registers available if used in conjunction with the
9318 @code{regparm} attribute.  The @option{-mstackrealign} option is
9319 incompatible with the nested function prologue; this is considered a
9320 hard error.  See also the attribute @code{force_align_arg_pointer},
9321 applicable to individual functions.
9322
9323 @item -mpreferred-stack-boundary=@var{num}
9324 @opindex mpreferred-stack-boundary
9325 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
9326 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
9327 the default is 4 (16 bytes or 128 bits).
9328
9329 On Pentium and PentiumPro, @code{double} and @code{long double} values
9330 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
9331 suffer significant run time performance penalties.  On Pentium III, the
9332 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
9333 properly if it is not 16 byte aligned.
9334
9335 To ensure proper alignment of this values on the stack, the stack boundary
9336 must be as aligned as that required by any value stored on the stack.
9337 Further, every function must be generated such that it keeps the stack
9338 aligned.  Thus calling a function compiled with a higher preferred
9339 stack boundary from a function compiled with a lower preferred stack
9340 boundary will most likely misalign the stack.  It is recommended that
9341 libraries that use callbacks always use the default setting.
9342
9343 This extra alignment does consume extra stack space, and generally
9344 increases code size.  Code that is sensitive to stack space usage, such
9345 as embedded systems and operating system kernels, may want to reduce the
9346 preferred alignment to @option{-mpreferred-stack-boundary=2}.
9347
9348 @item -mmmx
9349 @itemx -mno-mmx
9350 @item -msse
9351 @itemx -mno-sse
9352 @item -msse2
9353 @itemx -mno-sse2
9354 @item -msse3
9355 @itemx -mno-sse3
9356 @item -mssse3
9357 @itemx -mno-ssse3
9358 @item -m3dnow
9359 @itemx -mno-3dnow
9360 @opindex mmmx
9361 @opindex mno-mmx
9362 @opindex msse
9363 @opindex mno-sse
9364 @opindex m3dnow
9365 @opindex mno-3dnow
9366 These switches enable or disable the use of instructions in the MMX,
9367 SSE, SSE2, SSE3, SSSE3 or 3DNow! extended instruction sets.
9368 These extensions are also available as built-in functions: see
9369 @ref{X86 Built-in Functions}, for details of the functions enabled and
9370 disabled by these switches.
9371
9372 To have SSE/SSE2 instructions generated automatically from floating-point
9373 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
9374
9375 These options will enable GCC to use these extended instructions in
9376 generated code, even without @option{-mfpmath=sse}.  Applications which
9377 perform runtime CPU detection must compile separate files for each
9378 supported architecture, using the appropriate flags.  In particular,
9379 the file containing the CPU detection code should be compiled without
9380 these options.
9381
9382 @item -mpush-args
9383 @itemx -mno-push-args
9384 @opindex mpush-args
9385 @opindex mno-push-args
9386 Use PUSH operations to store outgoing parameters.  This method is shorter
9387 and usually equally fast as method using SUB/MOV operations and is enabled
9388 by default.  In some cases disabling it may improve performance because of
9389 improved scheduling and reduced dependencies.
9390
9391 @item -maccumulate-outgoing-args
9392 @opindex maccumulate-outgoing-args
9393 If enabled, the maximum amount of space required for outgoing arguments will be
9394 computed in the function prologue.  This is faster on most modern CPUs
9395 because of reduced dependencies, improved scheduling and reduced stack usage
9396 when preferred stack boundary is not equal to 2.  The drawback is a notable
9397 increase in code size.  This switch implies @option{-mno-push-args}.
9398
9399 @item -mthreads
9400 @opindex mthreads
9401 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
9402 on thread-safe exception handling must compile and link all code with the
9403 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
9404 @option{-D_MT}; when linking, it links in a special thread helper library
9405 @option{-lmingwthrd} which cleans up per thread exception handling data.
9406
9407 @item -mno-align-stringops
9408 @opindex mno-align-stringops
9409 Do not align destination of inlined string operations.  This switch reduces
9410 code size and improves performance in case the destination is already aligned,
9411 but GCC doesn't know about it.
9412
9413 @item -minline-all-stringops
9414 @opindex minline-all-stringops
9415 By default GCC inlines string operations only when destination is known to be
9416 aligned at least to 4 byte boundary.  This enables more inlining, increase code
9417 size, but may improve performance of code that depends on fast memcpy, strlen
9418 and memset for short lengths.
9419
9420 @item -momit-leaf-frame-pointer
9421 @opindex momit-leaf-frame-pointer
9422 Don't keep the frame pointer in a register for leaf functions.  This
9423 avoids the instructions to save, set up and restore frame pointers and
9424 makes an extra register available in leaf functions.  The option
9425 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9426 which might make debugging harder.
9427
9428 @item -mtls-direct-seg-refs
9429 @itemx -mno-tls-direct-seg-refs
9430 @opindex mtls-direct-seg-refs
9431 Controls whether TLS variables may be accessed with offsets from the
9432 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
9433 or whether the thread base pointer must be added.  Whether or not this
9434 is legal depends on the operating system, and whether it maps the
9435 segment to cover the entire TLS area.
9436
9437 For systems that use GNU libc, the default is on.
9438 @end table
9439
9440 These @samp{-m} switches are supported in addition to the above
9441 on AMD x86-64 processors in 64-bit environments.
9442
9443 @table @gcctabopt
9444 @item -m32
9445 @itemx -m64
9446 @opindex m32
9447 @opindex m64
9448 Generate code for a 32-bit or 64-bit environment.
9449 The 32-bit environment sets int, long and pointer to 32 bits and
9450 generates code that runs on any i386 system.
9451 The 64-bit environment sets int to 32 bits and long and pointer
9452 to 64 bits and generates code for AMD's x86-64 architecture. For
9453 darwin only the -m64 option turns off the @option{-fno-pic} and
9454 @option{-mdynamic-no-pic} options.
9455
9456 @item -mno-red-zone
9457 @opindex no-red-zone
9458 Do not use a so called red zone for x86-64 code.  The red zone is mandated
9459 by the x86-64 ABI, it is a 128-byte area beyond the location of the
9460 stack pointer that will not be modified by signal or interrupt handlers
9461 and therefore can be used for temporary data without adjusting the stack
9462 pointer.  The flag @option{-mno-red-zone} disables this red zone.
9463
9464 @item -mcmodel=small
9465 @opindex mcmodel=small
9466 Generate code for the small code model: the program and its symbols must
9467 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
9468 Programs can be statically or dynamically linked.  This is the default
9469 code model.
9470
9471 @item -mcmodel=kernel
9472 @opindex mcmodel=kernel
9473 Generate code for the kernel code model.  The kernel runs in the
9474 negative 2 GB of the address space.
9475 This model has to be used for Linux kernel code.
9476
9477 @item -mcmodel=medium
9478 @opindex mcmodel=medium
9479 Generate code for the medium model: The program is linked in the lower 2
9480 GB of the address space but symbols can be located anywhere in the
9481 address space.  Programs can be statically or dynamically linked, but
9482 building of shared libraries are not supported with the medium model.
9483
9484 @item -mcmodel=large
9485 @opindex mcmodel=large
9486 Generate code for the large model: This model makes no assumptions
9487 about addresses and sizes of sections.  Currently GCC does not implement
9488 this model.
9489 @end table
9490
9491 @node IA-64 Options
9492 @subsection IA-64 Options
9493 @cindex IA-64 Options
9494
9495 These are the @samp{-m} options defined for the Intel IA-64 architecture.
9496
9497 @table @gcctabopt
9498 @item -mbig-endian
9499 @opindex mbig-endian
9500 Generate code for a big endian target.  This is the default for HP-UX@.
9501
9502 @item -mlittle-endian
9503 @opindex mlittle-endian
9504 Generate code for a little endian target.  This is the default for AIX5
9505 and GNU/Linux.
9506
9507 @item -mgnu-as
9508 @itemx -mno-gnu-as
9509 @opindex mgnu-as
9510 @opindex mno-gnu-as
9511 Generate (or don't) code for the GNU assembler.  This is the default.
9512 @c Also, this is the default if the configure option @option{--with-gnu-as}
9513 @c is used.
9514
9515 @item -mgnu-ld
9516 @itemx -mno-gnu-ld
9517 @opindex mgnu-ld
9518 @opindex mno-gnu-ld
9519 Generate (or don't) code for the GNU linker.  This is the default.
9520 @c Also, this is the default if the configure option @option{--with-gnu-ld}
9521 @c is used.
9522
9523 @item -mno-pic
9524 @opindex mno-pic
9525 Generate code that does not use a global pointer register.  The result
9526 is not position independent code, and violates the IA-64 ABI@.
9527
9528 @item -mvolatile-asm-stop
9529 @itemx -mno-volatile-asm-stop
9530 @opindex mvolatile-asm-stop
9531 @opindex mno-volatile-asm-stop
9532 Generate (or don't) a stop bit immediately before and after volatile asm
9533 statements.
9534
9535 @item -mregister-names
9536 @itemx -mno-register-names
9537 @opindex mregister-names
9538 @opindex mno-register-names
9539 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
9540 the stacked registers.  This may make assembler output more readable.
9541
9542 @item -mno-sdata
9543 @itemx -msdata
9544 @opindex mno-sdata
9545 @opindex msdata
9546 Disable (or enable) optimizations that use the small data section.  This may
9547 be useful for working around optimizer bugs.
9548
9549 @item -mconstant-gp
9550 @opindex mconstant-gp
9551 Generate code that uses a single constant global pointer value.  This is
9552 useful when compiling kernel code.
9553
9554 @item -mauto-pic
9555 @opindex mauto-pic
9556 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
9557 This is useful when compiling firmware code.
9558
9559 @item -minline-float-divide-min-latency
9560 @opindex minline-float-divide-min-latency
9561 Generate code for inline divides of floating point values
9562 using the minimum latency algorithm.
9563
9564 @item -minline-float-divide-max-throughput
9565 @opindex minline-float-divide-max-throughput
9566 Generate code for inline divides of floating point values
9567 using the maximum throughput algorithm.
9568
9569 @item -minline-int-divide-min-latency
9570 @opindex minline-int-divide-min-latency
9571 Generate code for inline divides of integer values
9572 using the minimum latency algorithm.
9573
9574 @item -minline-int-divide-max-throughput
9575 @opindex minline-int-divide-max-throughput
9576 Generate code for inline divides of integer values
9577 using the maximum throughput algorithm.
9578
9579 @item -minline-sqrt-min-latency
9580 @opindex minline-sqrt-min-latency
9581 Generate code for inline square roots
9582 using the minimum latency algorithm.
9583
9584 @item -minline-sqrt-max-throughput
9585 @opindex minline-sqrt-max-throughput
9586 Generate code for inline square roots
9587 using the maximum throughput algorithm.
9588
9589 @item -mno-dwarf2-asm
9590 @itemx -mdwarf2-asm
9591 @opindex mno-dwarf2-asm
9592 @opindex mdwarf2-asm
9593 Don't (or do) generate assembler code for the DWARF2 line number debugging
9594 info.  This may be useful when not using the GNU assembler.
9595
9596 @item -mearly-stop-bits
9597 @itemx -mno-early-stop-bits
9598 @opindex mearly-stop-bits
9599 @opindex mno-early-stop-bits
9600 Allow stop bits to be placed earlier than immediately preceding the
9601 instruction that triggered the stop bit.  This can improve instruction
9602 scheduling, but does not always do so.
9603
9604 @item -mfixed-range=@var{register-range}
9605 @opindex mfixed-range
9606 Generate code treating the given register range as fixed registers.
9607 A fixed register is one that the register allocator can not use.  This is
9608 useful when compiling kernel code.  A register range is specified as
9609 two registers separated by a dash.  Multiple register ranges can be
9610 specified separated by a comma.
9611
9612 @item -mtls-size=@var{tls-size}
9613 @opindex mtls-size
9614 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
9615 64.
9616
9617 @item -mtune=@var{cpu-type}
9618 @opindex mtune
9619 Tune the instruction scheduling for a particular CPU, Valid values are
9620 itanium, itanium1, merced, itanium2, and mckinley.
9621
9622 @item -mt
9623 @itemx -pthread
9624 @opindex mt
9625 @opindex pthread
9626 Add support for multithreading using the POSIX threads library.  This
9627 option sets flags for both the preprocessor and linker.  It does
9628 not affect the thread safety of object code produced by the compiler or
9629 that of libraries supplied with it.  These are HP-UX specific flags.
9630
9631 @item -milp32
9632 @itemx -mlp64
9633 @opindex milp32
9634 @opindex mlp64
9635 Generate code for a 32-bit or 64-bit environment.
9636 The 32-bit environment sets int, long and pointer to 32 bits.
9637 The 64-bit environment sets int to 32 bits and long and pointer
9638 to 64 bits.  These are HP-UX specific flags.
9639
9640 @item -mno-sched-br-data-spec
9641 @itemx -msched-br-data-spec
9642 @opindex mno-sched-br-data-spec
9643 @opindex msched-br-data-spec
9644 (Dis/En)able data speculative scheduling before reload.
9645 This will result in generation of the ld.a instructions and
9646 the corresponding check instructions (ld.c / chk.a).
9647 The default is 'disable'.
9648
9649 @item -msched-ar-data-spec
9650 @itemx -mno-sched-ar-data-spec
9651 @opindex msched-ar-data-spec
9652 @opindex mno-sched-ar-data-spec
9653 (En/Dis)able data speculative scheduling after reload.
9654 This will result in generation of the ld.a instructions and
9655 the corresponding check instructions (ld.c / chk.a).
9656 The default is 'enable'.
9657
9658 @item -mno-sched-control-spec
9659 @itemx -msched-control-spec
9660 @opindex mno-sched-control-spec
9661 @opindex msched-control-spec
9662 (Dis/En)able control speculative scheduling.  This feature is
9663 available only during region scheduling (i.e. before reload).
9664 This will result in generation of the ld.s instructions and
9665 the corresponding check instructions chk.s .
9666 The default is 'disable'.
9667
9668 @item -msched-br-in-data-spec
9669 @itemx -mno-sched-br-in-data-spec
9670 @opindex msched-br-in-data-spec
9671 @opindex mno-sched-br-in-data-spec
9672 (En/Dis)able speculative scheduling of the instructions that
9673 are dependent on the data speculative loads before reload.
9674 This is effective only with @option{-msched-br-data-spec} enabled.
9675 The default is 'enable'.
9676
9677 @item -msched-ar-in-data-spec
9678 @itemx -mno-sched-ar-in-data-spec
9679 @opindex msched-ar-in-data-spec
9680 @opindex mno-sched-ar-in-data-spec
9681 (En/Dis)able speculative scheduling of the instructions that
9682 are dependent on the data speculative loads after reload.
9683 This is effective only with @option{-msched-ar-data-spec} enabled.
9684 The default is 'enable'.
9685
9686 @item -msched-in-control-spec
9687 @itemx -mno-sched-in-control-spec
9688 @opindex msched-in-control-spec
9689 @opindex mno-sched-in-control-spec
9690 (En/Dis)able speculative scheduling of the instructions that
9691 are dependent on the control speculative loads.
9692 This is effective only with @option{-msched-control-spec} enabled.
9693 The default is 'enable'.
9694
9695 @item -msched-ldc
9696 @itemx -mno-sched-ldc
9697 @opindex msched-ldc
9698 @opindex mno-sched-ldc
9699 (En/Dis)able use of simple data speculation checks ld.c .
9700 If disabled, only chk.a instructions will be emitted to check
9701 data speculative loads.
9702 The default is 'enable'.
9703
9704 @item -mno-sched-control-ldc
9705 @itemx -msched-control-ldc
9706 @opindex mno-sched-control-ldc
9707 @opindex msched-control-ldc 
9708 (Dis/En)able use of ld.c instructions to check control speculative loads.
9709 If enabled, in case of control speculative load with no speculatively
9710 scheduled dependent instructions this load will be emitted as ld.sa and
9711 ld.c will be used to check it.
9712 The default is 'disable'.
9713
9714 @item -mno-sched-spec-verbose
9715 @itemx -msched-spec-verbose
9716 @opindex mno-sched-spec-verbose
9717 @opindex msched-spec-verbose
9718 (Dis/En)able printing of the information about speculative motions.
9719
9720 @item -mno-sched-prefer-non-data-spec-insns
9721 @itemx -msched-prefer-non-data-spec-insns
9722 @opindex mno-sched-prefer-non-data-spec-insns
9723 @opindex msched-prefer-non-data-spec-insns
9724 If enabled, data speculative instructions will be chosen for schedule
9725 only if there are no other choices at the moment.  This will make
9726 the use of the data speculation much more conservative.
9727 The default is 'disable'.
9728
9729 @item -mno-sched-prefer-non-control-spec-insns
9730 @itemx -msched-prefer-non-control-spec-insns
9731 @opindex mno-sched-prefer-non-control-spec-insns
9732 @opindex msched-prefer-non-control-spec-insns
9733 If enabled, control speculative instructions will be chosen for schedule
9734 only if there are no other choices at the moment.  This will make
9735 the use of the control speculation much more conservative.
9736 The default is 'disable'.
9737
9738 @item -mno-sched-count-spec-in-critical-path
9739 @itemx -msched-count-spec-in-critical-path
9740 @opindex mno-sched-count-spec-in-critical-path
9741 @opindex msched-count-spec-in-critical-path
9742 If enabled, speculative dependencies will be considered during
9743 computation of the instructions priorities.  This will make the use of the
9744 speculation a bit more conservative.
9745 The default is 'disable'.
9746
9747 @end table
9748
9749 @node M32C Options
9750 @subsection M32C Options
9751 @cindex M32C options
9752
9753 @table @gcctabopt
9754 @item -mcpu=@var{name}
9755 @opindex mcpu=
9756 Select the CPU for which code is generated.  @var{name} may be one of
9757 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
9758 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
9759 the M32C/80 series.
9760
9761 @item -msim
9762 @opindex msim
9763 Specifies that the program will be run on the simulator.  This causes
9764 an alternate runtime library to be linked in which supports, for
9765 example, file I/O.  You must not use this option when generating
9766 programs that will run on real hardware; you must provide your own
9767 runtime library for whatever I/O functions are needed.
9768
9769 @item -memregs=@var{number}
9770 @opindex memregs=
9771 Specifies the number of memory-based pseudo-registers GCC will use
9772 during code generation.  These pseudo-registers will be used like real
9773 registers, so there is a tradeoff between GCC's ability to fit the
9774 code into available registers, and the performance penalty of using
9775 memory instead of registers.  Note that all modules in a program must
9776 be compiled with the same value for this option.  Because of that, you
9777 must not use this option with the default runtime libraries gcc
9778 builds.
9779
9780 @end table
9781
9782 @node M32R/D Options
9783 @subsection M32R/D Options
9784 @cindex M32R/D options
9785
9786 These @option{-m} options are defined for Renesas M32R/D architectures:
9787
9788 @table @gcctabopt
9789 @item -m32r2
9790 @opindex m32r2
9791 Generate code for the M32R/2@.
9792
9793 @item -m32rx
9794 @opindex m32rx
9795 Generate code for the M32R/X@.
9796
9797 @item -m32r
9798 @opindex m32r
9799 Generate code for the M32R@.  This is the default.
9800
9801 @item -mmodel=small
9802 @opindex mmodel=small
9803 Assume all objects live in the lower 16MB of memory (so that their addresses
9804 can be loaded with the @code{ld24} instruction), and assume all subroutines
9805 are reachable with the @code{bl} instruction.
9806 This is the default.
9807
9808 The addressability of a particular object can be set with the
9809 @code{model} attribute.
9810
9811 @item -mmodel=medium
9812 @opindex mmodel=medium
9813 Assume objects may be anywhere in the 32-bit address space (the compiler
9814 will generate @code{seth/add3} instructions to load their addresses), and
9815 assume all subroutines are reachable with the @code{bl} instruction.
9816
9817 @item -mmodel=large
9818 @opindex mmodel=large
9819 Assume objects may be anywhere in the 32-bit address space (the compiler
9820 will generate @code{seth/add3} instructions to load their addresses), and
9821 assume subroutines may not be reachable with the @code{bl} instruction
9822 (the compiler will generate the much slower @code{seth/add3/jl}
9823 instruction sequence).
9824
9825 @item -msdata=none
9826 @opindex msdata=none
9827 Disable use of the small data area.  Variables will be put into
9828 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
9829 @code{section} attribute has been specified).
9830 This is the default.
9831
9832 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
9833 Objects may be explicitly put in the small data area with the
9834 @code{section} attribute using one of these sections.
9835
9836 @item -msdata=sdata
9837 @opindex msdata=sdata
9838 Put small global and static data in the small data area, but do not
9839 generate special code to reference them.
9840
9841 @item -msdata=use
9842 @opindex msdata=use
9843 Put small global and static data in the small data area, and generate
9844 special instructions to reference them.
9845
9846 @item -G @var{num}
9847 @opindex G
9848 @cindex smaller data references
9849 Put global and static objects less than or equal to @var{num} bytes
9850 into the small data or bss sections instead of the normal data or bss
9851 sections.  The default value of @var{num} is 8.
9852 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
9853 for this option to have any effect.
9854
9855 All modules should be compiled with the same @option{-G @var{num}} value.
9856 Compiling with different values of @var{num} may or may not work; if it
9857 doesn't the linker will give an error message---incorrect code will not be
9858 generated.
9859
9860 @item -mdebug
9861 @opindex mdebug
9862 Makes the M32R specific code in the compiler display some statistics
9863 that might help in debugging programs.
9864
9865 @item -malign-loops
9866 @opindex malign-loops
9867 Align all loops to a 32-byte boundary.
9868
9869 @item -mno-align-loops
9870 @opindex mno-align-loops
9871 Do not enforce a 32-byte alignment for loops.  This is the default.
9872
9873 @item -missue-rate=@var{number}
9874 @opindex missue-rate=@var{number}
9875 Issue @var{number} instructions per cycle.  @var{number} can only be 1
9876 or 2.
9877
9878 @item -mbranch-cost=@var{number}
9879 @opindex mbranch-cost=@var{number}
9880 @var{number} can only be 1 or 2.  If it is 1 then branches will be
9881 preferred over conditional code, if it is 2, then the opposite will
9882 apply.
9883
9884 @item -mflush-trap=@var{number}
9885 @opindex mflush-trap=@var{number}
9886 Specifies the trap number to use to flush the cache.  The default is
9887 12.  Valid numbers are between 0 and 15 inclusive.
9888
9889 @item -mno-flush-trap
9890 @opindex mno-flush-trap
9891 Specifies that the cache cannot be flushed by using a trap.
9892
9893 @item -mflush-func=@var{name}
9894 @opindex mflush-func=@var{name}
9895 Specifies the name of the operating system function to call to flush
9896 the cache.  The default is @emph{_flush_cache}, but a function call
9897 will only be used if a trap is not available.
9898
9899 @item -mno-flush-func
9900 @opindex mno-flush-func
9901 Indicates that there is no OS function for flushing the cache.
9902
9903 @end table
9904
9905 @node M680x0 Options
9906 @subsection M680x0 Options
9907 @cindex M680x0 options
9908
9909 These are the @samp{-m} options defined for the 68000 series.  The default
9910 values for these options depends on which style of 68000 was selected when
9911 the compiler was configured; the defaults for the most common choices are
9912 given below.
9913
9914 @table @gcctabopt
9915 @item -m68000
9916 @itemx -mc68000
9917 @opindex m68000
9918 @opindex mc68000
9919 Generate output for a 68000.  This is the default
9920 when the compiler is configured for 68000-based systems.
9921
9922 Use this option for microcontrollers with a 68000 or EC000 core,
9923 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
9924
9925 @item -m68020
9926 @itemx -mc68020
9927 @opindex m68020
9928 @opindex mc68020
9929 Generate output for a 68020.  This is the default
9930 when the compiler is configured for 68020-based systems.
9931
9932 @item -m68881
9933 @opindex m68881
9934 Generate output containing 68881 instructions for floating point.
9935 This is the default for most 68020 systems unless @option{--nfp} was
9936 specified when the compiler was configured.
9937
9938 @item -m68030
9939 @opindex m68030
9940 Generate output for a 68030.  This is the default when the compiler is
9941 configured for 68030-based systems.
9942
9943 @item -m68040
9944 @opindex m68040
9945 Generate output for a 68040.  This is the default when the compiler is
9946 configured for 68040-based systems.
9947
9948 This option inhibits the use of 68881/68882 instructions that have to be
9949 emulated by software on the 68040.  Use this option if your 68040 does not
9950 have code to emulate those instructions.
9951
9952 @item -m68060
9953 @opindex m68060
9954 Generate output for a 68060.  This is the default when the compiler is
9955 configured for 68060-based systems.
9956
9957 This option inhibits the use of 68020 and 68881/68882 instructions that
9958 have to be emulated by software on the 68060.  Use this option if your 68060
9959 does not have code to emulate those instructions.
9960
9961 @item -mcpu32
9962 @opindex mcpu32
9963 Generate output for a CPU32.  This is the default
9964 when the compiler is configured for CPU32-based systems.
9965
9966 Use this option for microcontrollers with a
9967 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
9968 68336, 68340, 68341, 68349 and 68360.
9969
9970 @item -m5200
9971 @opindex m5200
9972 Generate output for a 520X ``coldfire'' family cpu.  This is the default
9973 when the compiler is configured for 520X-based systems.
9974
9975 Use this option for microcontroller with a 5200 core, including
9976 the MCF5202, MCF5203, MCF5204 and MCF5202.
9977
9978 @item -mcfv4e
9979 @opindex mcfv4e
9980 Generate output for a ColdFire V4e family cpu (e.g.@: 547x/548x).
9981 This includes use of hardware floating point instructions.
9982
9983 @item -m68020-40
9984 @opindex m68020-40
9985 Generate output for a 68040, without using any of the new instructions.
9986 This results in code which can run relatively efficiently on either a
9987 68020/68881 or a 68030 or a 68040.  The generated code does use the
9988 68881 instructions that are emulated on the 68040.
9989
9990 @item -m68020-60
9991 @opindex m68020-60
9992 Generate output for a 68060, without using any of the new instructions.
9993 This results in code which can run relatively efficiently on either a
9994 68020/68881 or a 68030 or a 68040.  The generated code does use the
9995 68881 instructions that are emulated on the 68060.
9996
9997 @item -msoft-float
9998 @opindex msoft-float
9999 Generate output containing library calls for floating point.
10000 @strong{Warning:} the requisite libraries are not available for all m68k
10001 targets.  Normally the facilities of the machine's usual C compiler are
10002 used, but this can't be done directly in cross-compilation.  You must
10003 make your own arrangements to provide suitable library functions for
10004 cross-compilation.  The embedded targets @samp{m68k-*-aout} and
10005 @samp{m68k-*-coff} do provide software floating point support.
10006
10007 @item -mshort
10008 @opindex mshort
10009 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10010 Additionally, parameters passed on the stack are also aligned to a
10011 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10012
10013 @item -mnobitfield
10014 @opindex mnobitfield
10015 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10016 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10017
10018 @item -mbitfield
10019 @opindex mbitfield
10020 Do use the bit-field instructions.  The @option{-m68020} option implies
10021 @option{-mbitfield}.  This is the default if you use a configuration
10022 designed for a 68020.
10023
10024 @item -mrtd
10025 @opindex mrtd
10026 Use a different function-calling convention, in which functions
10027 that take a fixed number of arguments return with the @code{rtd}
10028 instruction, which pops their arguments while returning.  This
10029 saves one instruction in the caller since there is no need to pop
10030 the arguments there.
10031
10032 This calling convention is incompatible with the one normally
10033 used on Unix, so you cannot use it if you need to call libraries
10034 compiled with the Unix compiler.
10035
10036 Also, you must provide function prototypes for all functions that
10037 take variable numbers of arguments (including @code{printf});
10038 otherwise incorrect code will be generated for calls to those
10039 functions.
10040
10041 In addition, seriously incorrect code will result if you call a
10042 function with too many arguments.  (Normally, extra arguments are
10043 harmlessly ignored.)
10044
10045 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10046 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10047
10048 @item -malign-int
10049 @itemx -mno-align-int
10050 @opindex malign-int
10051 @opindex mno-align-int
10052 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10053 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10054 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10055 Aligning variables on 32-bit boundaries produces code that runs somewhat
10056 faster on processors with 32-bit busses at the expense of more memory.
10057
10058 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
10059 align structures containing the above types  differently than
10060 most published application binary interface specifications for the m68k.
10061
10062 @item -mpcrel
10063 @opindex mpcrel
10064 Use the pc-relative addressing mode of the 68000 directly, instead of
10065 using a global offset table.  At present, this option implies @option{-fpic},
10066 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
10067 not presently supported with @option{-mpcrel}, though this could be supported for
10068 68020 and higher processors.
10069
10070 @item -mno-strict-align
10071 @itemx -mstrict-align
10072 @opindex mno-strict-align
10073 @opindex mstrict-align
10074 Do not (do) assume that unaligned memory references will be handled by
10075 the system.
10076
10077 @item -msep-data
10078 Generate code that allows the data segment to be located in a different
10079 area of memory from the text segment.  This allows for execute in place in
10080 an environment without virtual memory management.  This option implies
10081 @option{-fPIC}.
10082
10083 @item -mno-sep-data
10084 Generate code that assumes that the data segment follows the text segment.
10085 This is the default.
10086
10087 @item -mid-shared-library
10088 Generate code that supports shared libraries via the library ID method.
10089 This allows for execute in place and shared libraries in an environment
10090 without virtual memory management.  This option implies @option{-fPIC}.
10091
10092 @item -mno-id-shared-library
10093 Generate code that doesn't assume ID based shared libraries are being used.
10094 This is the default.
10095
10096 @item -mshared-library-id=n
10097 Specified the identification number of the ID based shared library being
10098 compiled.  Specifying a value of 0 will generate more compact code, specifying
10099 other values will force the allocation of that number to the current
10100 library but is no more space or time efficient than omitting this option.
10101
10102 @end table
10103
10104 @node M68hc1x Options
10105 @subsection M68hc1x Options
10106 @cindex M68hc1x options
10107
10108 These are the @samp{-m} options defined for the 68hc11 and 68hc12
10109 microcontrollers.  The default values for these options depends on
10110 which style of microcontroller was selected when the compiler was configured;
10111 the defaults for the most common choices are given below.
10112
10113 @table @gcctabopt
10114 @item -m6811
10115 @itemx -m68hc11
10116 @opindex m6811
10117 @opindex m68hc11
10118 Generate output for a 68HC11.  This is the default
10119 when the compiler is configured for 68HC11-based systems.
10120
10121 @item -m6812
10122 @itemx -m68hc12
10123 @opindex m6812
10124 @opindex m68hc12
10125 Generate output for a 68HC12.  This is the default
10126 when the compiler is configured for 68HC12-based systems.
10127
10128 @item -m68S12
10129 @itemx -m68hcs12
10130 @opindex m68S12
10131 @opindex m68hcs12
10132 Generate output for a 68HCS12.
10133
10134 @item -mauto-incdec
10135 @opindex mauto-incdec
10136 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
10137 addressing modes.
10138
10139 @item -minmax
10140 @itemx -nominmax
10141 @opindex minmax
10142 @opindex mnominmax
10143 Enable the use of 68HC12 min and max instructions.
10144
10145 @item -mlong-calls
10146 @itemx -mno-long-calls
10147 @opindex mlong-calls
10148 @opindex mno-long-calls
10149 Treat all calls as being far away (near).  If calls are assumed to be
10150 far away, the compiler will use the @code{call} instruction to
10151 call a function and the @code{rtc} instruction for returning.
10152
10153 @item -mshort
10154 @opindex mshort
10155 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10156
10157 @item -msoft-reg-count=@var{count}
10158 @opindex msoft-reg-count
10159 Specify the number of pseudo-soft registers which are used for the
10160 code generation.  The maximum number is 32.  Using more pseudo-soft
10161 register may or may not result in better code depending on the program.
10162 The default is 4 for 68HC11 and 2 for 68HC12.
10163
10164 @end table
10165
10166 @node MCore Options
10167 @subsection MCore Options
10168 @cindex MCore options
10169
10170 These are the @samp{-m} options defined for the Motorola M*Core
10171 processors.
10172
10173 @table @gcctabopt
10174
10175 @item -mhardlit
10176 @itemx -mno-hardlit
10177 @opindex mhardlit
10178 @opindex mno-hardlit
10179 Inline constants into the code stream if it can be done in two
10180 instructions or less.
10181
10182 @item -mdiv
10183 @itemx -mno-div
10184 @opindex mdiv
10185 @opindex mno-div
10186 Use the divide instruction.  (Enabled by default).
10187
10188 @item -mrelax-immediate
10189 @itemx -mno-relax-immediate
10190 @opindex mrelax-immediate
10191 @opindex mno-relax-immediate
10192 Allow arbitrary sized immediates in bit operations.
10193
10194 @item -mwide-bitfields
10195 @itemx -mno-wide-bitfields
10196 @opindex mwide-bitfields
10197 @opindex mno-wide-bitfields
10198 Always treat bit-fields as int-sized.
10199
10200 @item -m4byte-functions
10201 @itemx -mno-4byte-functions
10202 @opindex m4byte-functions
10203 @opindex mno-4byte-functions
10204 Force all functions to be aligned to a four byte boundary.
10205
10206 @item -mcallgraph-data
10207 @itemx -mno-callgraph-data
10208 @opindex mcallgraph-data
10209 @opindex mno-callgraph-data
10210 Emit callgraph information.
10211
10212 @item -mslow-bytes
10213 @itemx -mno-slow-bytes
10214 @opindex mslow-bytes
10215 @opindex mno-slow-bytes
10216 Prefer word access when reading byte quantities.
10217
10218 @item -mlittle-endian
10219 @itemx -mbig-endian
10220 @opindex mlittle-endian
10221 @opindex mbig-endian
10222 Generate code for a little endian target.
10223
10224 @item -m210
10225 @itemx -m340
10226 @opindex m210
10227 @opindex m340
10228 Generate code for the 210 processor.
10229 @end table
10230
10231 @node MIPS Options
10232 @subsection MIPS Options
10233 @cindex MIPS options
10234
10235 @table @gcctabopt
10236
10237 @item -EB
10238 @opindex EB
10239 Generate big-endian code.
10240
10241 @item -EL
10242 @opindex EL
10243 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
10244 configurations.
10245
10246 @item -march=@var{arch}
10247 @opindex march
10248 Generate code that will run on @var{arch}, which can be the name of a
10249 generic MIPS ISA, or the name of a particular processor.
10250 The ISA names are:
10251 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
10252 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
10253 The processor names are:
10254 @samp{4kc}, @samp{4km}, @samp{4kp},
10255 @samp{5kc}, @samp{5kf},
10256 @samp{20kc},
10257 @samp{24k}, @samp{24kc}, @samp{24kf}, @samp{24kx},
10258 @samp{m4k},
10259 @samp{orion},
10260 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
10261 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
10262 @samp{rm7000}, @samp{rm9000},
10263 @samp{sb1},
10264 @samp{sr71000},
10265 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
10266 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
10267 The special value @samp{from-abi} selects the
10268 most compatible architecture for the selected ABI (that is,
10269 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
10270
10271 In processor names, a final @samp{000} can be abbreviated as @samp{k}
10272 (for example, @samp{-march=r2k}).  Prefixes are optional, and
10273 @samp{vr} may be written @samp{r}.
10274
10275 GCC defines two macros based on the value of this option.  The first
10276 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
10277 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
10278 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
10279 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
10280 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
10281
10282 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
10283 above.  In other words, it will have the full prefix and will not
10284 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
10285 the macro names the resolved architecture (either @samp{"mips1"} or
10286 @samp{"mips3"}).  It names the default architecture when no
10287 @option{-march} option is given.
10288
10289 @item -mtune=@var{arch}
10290 @opindex mtune
10291 Optimize for @var{arch}.  Among other things, this option controls
10292 the way instructions are scheduled, and the perceived cost of arithmetic
10293 operations.  The list of @var{arch} values is the same as for
10294 @option{-march}.
10295
10296 When this option is not used, GCC will optimize for the processor
10297 specified by @option{-march}.  By using @option{-march} and
10298 @option{-mtune} together, it is possible to generate code that will
10299 run on a family of processors, but optimize the code for one
10300 particular member of that family.
10301
10302 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
10303 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
10304 @samp{-march} ones described above.
10305
10306 @item -mips1
10307 @opindex mips1
10308 Equivalent to @samp{-march=mips1}.
10309
10310 @item -mips2
10311 @opindex mips2
10312 Equivalent to @samp{-march=mips2}.
10313
10314 @item -mips3
10315 @opindex mips3
10316 Equivalent to @samp{-march=mips3}.
10317
10318 @item -mips4
10319 @opindex mips4
10320 Equivalent to @samp{-march=mips4}.
10321
10322 @item -mips32
10323 @opindex mips32
10324 Equivalent to @samp{-march=mips32}.
10325
10326 @item -mips32r2
10327 @opindex mips32r2
10328 Equivalent to @samp{-march=mips32r2}.
10329
10330 @item -mips64
10331 @opindex mips64
10332 Equivalent to @samp{-march=mips64}.
10333
10334 @item -mips16
10335 @itemx -mno-mips16
10336 @opindex mips16
10337 @opindex mno-mips16
10338 Generate (do not generate) MIPS16 code.  If GCC is targetting a
10339 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
10340
10341 @item -mabi=32
10342 @itemx -mabi=o64
10343 @itemx -mabi=n32
10344 @itemx -mabi=64
10345 @itemx -mabi=eabi
10346 @opindex mabi=32
10347 @opindex mabi=o64
10348 @opindex mabi=n32
10349 @opindex mabi=64
10350 @opindex mabi=eabi
10351 Generate code for the given ABI@.
10352
10353 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
10354 generates 64-bit code when you select a 64-bit architecture, but you
10355 can use @option{-mgp32} to get 32-bit code instead.
10356
10357 For information about the O64 ABI, see
10358 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
10359
10360 @item -mabicalls
10361 @itemx -mno-abicalls
10362 @opindex mabicalls
10363 @opindex mno-abicalls
10364 Generate (do not generate) code that is suitable for SVR4-style
10365 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
10366 systems.
10367
10368 @item -mshared
10369 @itemx -mno-shared
10370 Generate (do not generate) code that is fully position-independent,
10371 and that can therefore be linked into shared libraries.  This option
10372 only affects @option{-mabicalls}.
10373
10374 All @option{-mabicalls} code has traditionally been position-independent,
10375 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
10376 as an extension, the GNU toolchain allows executables to use absolute
10377 accesses for locally-binding symbols.  It can also use shorter GP
10378 initialization sequences and generate direct calls to locally-defined
10379 functions.  This mode is selected by @option{-mno-shared}.
10380
10381 @option{-mno-shared} depends on binutils 2.16 or higher and generates
10382 objects that can only be linked by the GNU linker.  However, the option
10383 does not affect the ABI of the final executable; it only affects the ABI
10384 of relocatable objects.  Using @option{-mno-shared} will generally make
10385 executables both smaller and quicker.
10386
10387 @option{-mshared} is the default.
10388
10389 @item -mxgot
10390 @itemx -mno-xgot
10391 @opindex mxgot
10392 @opindex mno-xgot
10393 Lift (do not lift) the usual restrictions on the size of the global
10394 offset table.
10395
10396 GCC normally uses a single instruction to load values from the GOT@.
10397 While this is relatively efficient, it will only work if the GOT
10398 is smaller than about 64k.  Anything larger will cause the linker
10399 to report an error such as:
10400
10401 @cindex relocation truncated to fit (MIPS)
10402 @smallexample
10403 relocation truncated to fit: R_MIPS_GOT16 foobar
10404 @end smallexample
10405
10406 If this happens, you should recompile your code with @option{-mxgot}.
10407 It should then work with very large GOTs, although it will also be
10408 less efficient, since it will take three instructions to fetch the
10409 value of a global symbol.
10410
10411 Note that some linkers can create multiple GOTs.  If you have such a
10412 linker, you should only need to use @option{-mxgot} when a single object
10413 file accesses more than 64k's worth of GOT entries.  Very few do.
10414
10415 These options have no effect unless GCC is generating position
10416 independent code.
10417
10418 @item -mgp32
10419 @opindex mgp32
10420 Assume that general-purpose registers are 32 bits wide.
10421
10422 @item -mgp64
10423 @opindex mgp64
10424 Assume that general-purpose registers are 64 bits wide.
10425
10426 @item -mfp32
10427 @opindex mfp32
10428 Assume that floating-point registers are 32 bits wide.
10429
10430 @item -mfp64
10431 @opindex mfp64
10432 Assume that floating-point registers are 64 bits wide.
10433
10434 @item -mhard-float
10435 @opindex mhard-float
10436 Use floating-point coprocessor instructions.
10437
10438 @item -msoft-float
10439 @opindex msoft-float
10440 Do not use floating-point coprocessor instructions.  Implement
10441 floating-point calculations using library calls instead.
10442
10443 @item -msingle-float
10444 @opindex msingle-float
10445 Assume that the floating-point coprocessor only supports single-precision
10446 operations.
10447
10448 @itemx -mdouble-float
10449 @opindex mdouble-float
10450 Assume that the floating-point coprocessor supports double-precision
10451 operations.  This is the default.
10452
10453 @itemx -mdsp
10454 @itemx -mno-dsp
10455 @opindex mdsp
10456 @opindex mno-dsp
10457 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
10458
10459 @itemx -mpaired-single
10460 @itemx -mno-paired-single
10461 @opindex mpaired-single
10462 @opindex mno-paired-single
10463 Use (do not use) paired-single floating-point instructions.
10464 @xref{MIPS Paired-Single Support}.  This option can only be used
10465 when generating 64-bit code and requires hardware floating-point
10466 support to be enabled.
10467
10468 @itemx -mips3d
10469 @itemx -mno-mips3d
10470 @opindex mips3d
10471 @opindex mno-mips3d
10472 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
10473 The option @option{-mips3d} implies @option{-mpaired-single}.
10474
10475 @item -mlong64
10476 @opindex mlong64
10477 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
10478 an explanation of the default and the way that the pointer size is
10479 determined.
10480
10481 @item -mlong32
10482 @opindex mlong32
10483 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
10484
10485 The default size of @code{int}s, @code{long}s and pointers depends on
10486 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
10487 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
10488 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
10489 or the same size as integer registers, whichever is smaller.
10490
10491 @item -msym32
10492 @itemx -mno-sym32
10493 @opindex msym32
10494 @opindex mno-sym32
10495 Assume (do not assume) that all symbols have 32-bit values, regardless
10496 of the selected ABI@.  This option is useful in combination with
10497 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
10498 to generate shorter and faster references to symbolic addresses.
10499
10500 @item -G @var{num}
10501 @opindex G
10502 @cindex smaller data references (MIPS)
10503 @cindex gp-relative references (MIPS)
10504 Put global and static items less than or equal to @var{num} bytes into
10505 the small data or bss section instead of the normal data or bss section.
10506 This allows the data to be accessed using a single instruction.
10507
10508 All modules should be compiled with the same @option{-G @var{num}}
10509 value.
10510
10511 @item -membedded-data
10512 @itemx -mno-embedded-data
10513 @opindex membedded-data
10514 @opindex mno-embedded-data
10515 Allocate variables to the read-only data section first if possible, then
10516 next in the small data section if possible, otherwise in data.  This gives
10517 slightly slower code than the default, but reduces the amount of RAM required
10518 when executing, and thus may be preferred for some embedded systems.
10519
10520 @item -muninit-const-in-rodata
10521 @itemx -mno-uninit-const-in-rodata
10522 @opindex muninit-const-in-rodata
10523 @opindex mno-uninit-const-in-rodata
10524 Put uninitialized @code{const} variables in the read-only data section.
10525 This option is only meaningful in conjunction with @option{-membedded-data}.
10526
10527 @item -msplit-addresses
10528 @itemx -mno-split-addresses
10529 @opindex msplit-addresses
10530 @opindex mno-split-addresses
10531 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
10532 relocation operators.  This option has been superseded by
10533 @option{-mexplicit-relocs} but is retained for backwards compatibility.
10534
10535 @item -mexplicit-relocs
10536 @itemx -mno-explicit-relocs
10537 @opindex mexplicit-relocs
10538 @opindex mno-explicit-relocs
10539 Use (do not use) assembler relocation operators when dealing with symbolic
10540 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
10541 is to use assembler macros instead.
10542
10543 @option{-mexplicit-relocs} is the default if GCC was configured
10544 to use an assembler that supports relocation operators.
10545
10546 @item -mcheck-zero-division
10547 @itemx -mno-check-zero-division
10548 @opindex mcheck-zero-division
10549 @opindex mno-check-zero-division
10550 Trap (do not trap) on integer division by zero.  The default is
10551 @option{-mcheck-zero-division}.
10552
10553 @item -mdivide-traps
10554 @itemx -mdivide-breaks
10555 @opindex mdivide-traps
10556 @opindex mdivide-breaks
10557 MIPS systems check for division by zero by generating either a
10558 conditional trap or a break instruction.  Using traps results in
10559 smaller code, but is only supported on MIPS II and later.  Also, some
10560 versions of the Linux kernel have a bug that prevents trap from
10561 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
10562 allow conditional traps on architectures that support them and
10563 @option{-mdivide-breaks} to force the use of breaks.
10564
10565 The default is usually @option{-mdivide-traps}, but this can be
10566 overridden at configure time using @option{--with-divide=breaks}.
10567 Divide-by-zero checks can be completely disabled using
10568 @option{-mno-check-zero-division}.
10569
10570 @item -mmemcpy
10571 @itemx -mno-memcpy
10572 @opindex mmemcpy
10573 @opindex mno-memcpy
10574 Force (do not force) the use of @code{memcpy()} for non-trivial block
10575 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
10576 most constant-sized copies.
10577
10578 @item -mlong-calls
10579 @itemx -mno-long-calls
10580 @opindex mlong-calls
10581 @opindex mno-long-calls
10582 Disable (do not disable) use of the @code{jal} instruction.  Calling
10583 functions using @code{jal} is more efficient but requires the caller
10584 and callee to be in the same 256 megabyte segment.
10585
10586 This option has no effect on abicalls code.  The default is
10587 @option{-mno-long-calls}.
10588
10589 @item -mmad
10590 @itemx -mno-mad
10591 @opindex mmad
10592 @opindex mno-mad
10593 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
10594 instructions, as provided by the R4650 ISA@.
10595
10596 @item -mfused-madd
10597 @itemx -mno-fused-madd
10598 @opindex mfused-madd
10599 @opindex mno-fused-madd
10600 Enable (disable) use of the floating point multiply-accumulate
10601 instructions, when they are available.  The default is
10602 @option{-mfused-madd}.
10603
10604 When multiply-accumulate instructions are used, the intermediate
10605 product is calculated to infinite precision and is not subject to
10606 the FCSR Flush to Zero bit.  This may be undesirable in some
10607 circumstances.
10608
10609 @item -nocpp
10610 @opindex nocpp
10611 Tell the MIPS assembler to not run its preprocessor over user
10612 assembler files (with a @samp{.s} suffix) when assembling them.
10613
10614 @item -mfix-r4000
10615 @itemx -mno-fix-r4000
10616 @opindex mfix-r4000
10617 @opindex mno-fix-r4000
10618 Work around certain R4000 CPU errata:
10619 @itemize @minus
10620 @item
10621 A double-word or a variable shift may give an incorrect result if executed
10622 immediately after starting an integer division.
10623 @item
10624 A double-word or a variable shift may give an incorrect result if executed
10625 while an integer multiplication is in progress.
10626 @item
10627 An integer division may give an incorrect result if started in a delay slot
10628 of a taken branch or a jump.
10629 @end itemize
10630
10631 @item -mfix-r4400
10632 @itemx -mno-fix-r4400
10633 @opindex mfix-r4400
10634 @opindex mno-fix-r4400
10635 Work around certain R4400 CPU errata:
10636 @itemize @minus
10637 @item
10638 A double-word or a variable shift may give an incorrect result if executed
10639 immediately after starting an integer division.
10640 @end itemize
10641
10642 @item -mfix-vr4120
10643 @itemx -mno-fix-vr4120
10644 @opindex mfix-vr4120
10645 Work around certain VR4120 errata:
10646 @itemize @minus
10647 @item
10648 @code{dmultu} does not always produce the correct result.
10649 @item
10650 @code{div} and @code{ddiv} do not always produce the correct result if one
10651 of the operands is negative.
10652 @end itemize
10653 The workarounds for the division errata rely on special functions in
10654 @file{libgcc.a}.  At present, these functions are only provided by
10655 the @code{mips64vr*-elf} configurations.
10656
10657 Other VR4120 errata require a nop to be inserted between certain pairs of
10658 instructions.  These errata are handled by the assembler, not by GCC itself.
10659
10660 @item -mfix-vr4130
10661 @opindex mfix-vr4130
10662 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
10663 workarounds are implemented by the assembler rather than by GCC,
10664 although GCC will avoid using @code{mflo} and @code{mfhi} if the
10665 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
10666 instructions are available instead.
10667
10668 @item -mfix-sb1
10669 @itemx -mno-fix-sb1
10670 @opindex mfix-sb1
10671 Work around certain SB-1 CPU core errata.
10672 (This flag currently works around the SB-1 revision 2
10673 ``F1'' and ``F2'' floating point errata.)
10674
10675 @item -mflush-func=@var{func}
10676 @itemx -mno-flush-func
10677 @opindex mflush-func
10678 Specifies the function to call to flush the I and D caches, or to not
10679 call any such function.  If called, the function must take the same
10680 arguments as the common @code{_flush_func()}, that is, the address of the
10681 memory range for which the cache is being flushed, the size of the
10682 memory range, and the number 3 (to flush both caches).  The default
10683 depends on the target GCC was configured for, but commonly is either
10684 @samp{_flush_func} or @samp{__cpu_flush}.
10685
10686 @item -mbranch-likely
10687 @itemx -mno-branch-likely
10688 @opindex mbranch-likely
10689 @opindex mno-branch-likely
10690 Enable or disable use of Branch Likely instructions, regardless of the
10691 default for the selected architecture.  By default, Branch Likely
10692 instructions may be generated if they are supported by the selected
10693 architecture.  An exception is for the MIPS32 and MIPS64 architectures
10694 and processors which implement those architectures; for those, Branch
10695 Likely instructions will not be generated by default because the MIPS32
10696 and MIPS64 architectures specifically deprecate their use.
10697
10698 @item -mfp-exceptions
10699 @itemx -mno-fp-exceptions
10700 @opindex mfp-exceptions
10701 Specifies whether FP exceptions are enabled.  This affects how we schedule
10702 FP instructions for some processors.  The default is that FP exceptions are
10703 enabled.
10704
10705 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
10706 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
10707 FP pipe.
10708
10709 @item -mvr4130-align
10710 @itemx -mno-vr4130-align
10711 @opindex mvr4130-align
10712 The VR4130 pipeline is two-way superscalar, but can only issue two
10713 instructions together if the first one is 8-byte aligned.  When this
10714 option is enabled, GCC will align pairs of instructions that it
10715 thinks should execute in parallel.
10716
10717 This option only has an effect when optimizing for the VR4130.
10718 It normally makes code faster, but at the expense of making it bigger.
10719 It is enabled by default at optimization level @option{-O3}.
10720 @end table
10721
10722 @node MMIX Options
10723 @subsection MMIX Options
10724 @cindex MMIX Options
10725
10726 These options are defined for the MMIX:
10727
10728 @table @gcctabopt
10729 @item -mlibfuncs
10730 @itemx -mno-libfuncs
10731 @opindex mlibfuncs
10732 @opindex mno-libfuncs
10733 Specify that intrinsic library functions are being compiled, passing all
10734 values in registers, no matter the size.
10735
10736 @item -mepsilon
10737 @itemx -mno-epsilon
10738 @opindex mepsilon
10739 @opindex mno-epsilon
10740 Generate floating-point comparison instructions that compare with respect
10741 to the @code{rE} epsilon register.
10742
10743 @item -mabi=mmixware
10744 @itemx -mabi=gnu
10745 @opindex mabi-mmixware
10746 @opindex mabi=gnu
10747 Generate code that passes function parameters and return values that (in
10748 the called function) are seen as registers @code{$0} and up, as opposed to
10749 the GNU ABI which uses global registers @code{$231} and up.
10750
10751 @item -mzero-extend
10752 @itemx -mno-zero-extend
10753 @opindex mzero-extend
10754 @opindex mno-zero-extend
10755 When reading data from memory in sizes shorter than 64 bits, use (do not
10756 use) zero-extending load instructions by default, rather than
10757 sign-extending ones.
10758
10759 @item -mknuthdiv
10760 @itemx -mno-knuthdiv
10761 @opindex mknuthdiv
10762 @opindex mno-knuthdiv
10763 Make the result of a division yielding a remainder have the same sign as
10764 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
10765 remainder follows the sign of the dividend.  Both methods are
10766 arithmetically valid, the latter being almost exclusively used.
10767
10768 @item -mtoplevel-symbols
10769 @itemx -mno-toplevel-symbols
10770 @opindex mtoplevel-symbols
10771 @opindex mno-toplevel-symbols
10772 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
10773 code can be used with the @code{PREFIX} assembly directive.
10774
10775 @item -melf
10776 @opindex melf
10777 Generate an executable in the ELF format, rather than the default
10778 @samp{mmo} format used by the @command{mmix} simulator.
10779
10780 @item -mbranch-predict
10781 @itemx -mno-branch-predict
10782 @opindex mbranch-predict
10783 @opindex mno-branch-predict
10784 Use (do not use) the probable-branch instructions, when static branch
10785 prediction indicates a probable branch.
10786
10787 @item -mbase-addresses
10788 @itemx -mno-base-addresses
10789 @opindex mbase-addresses
10790 @opindex mno-base-addresses
10791 Generate (do not generate) code that uses @emph{base addresses}.  Using a
10792 base address automatically generates a request (handled by the assembler
10793 and the linker) for a constant to be set up in a global register.  The
10794 register is used for one or more base address requests within the range 0
10795 to 255 from the value held in the register.  The generally leads to short
10796 and fast code, but the number of different data items that can be
10797 addressed is limited.  This means that a program that uses lots of static
10798 data may require @option{-mno-base-addresses}.
10799
10800 @item -msingle-exit
10801 @itemx -mno-single-exit
10802 @opindex msingle-exit
10803 @opindex mno-single-exit
10804 Force (do not force) generated code to have a single exit point in each
10805 function.
10806 @end table
10807
10808 @node MN10300 Options
10809 @subsection MN10300 Options
10810 @cindex MN10300 options
10811
10812 These @option{-m} options are defined for Matsushita MN10300 architectures:
10813
10814 @table @gcctabopt
10815 @item -mmult-bug
10816 @opindex mmult-bug
10817 Generate code to avoid bugs in the multiply instructions for the MN10300
10818 processors.  This is the default.
10819
10820 @item -mno-mult-bug
10821 @opindex mno-mult-bug
10822 Do not generate code to avoid bugs in the multiply instructions for the
10823 MN10300 processors.
10824
10825 @item -mam33
10826 @opindex mam33
10827 Generate code which uses features specific to the AM33 processor.
10828
10829 @item -mno-am33
10830 @opindex mno-am33
10831 Do not generate code which uses features specific to the AM33 processor.  This
10832 is the default.
10833
10834 @item -mreturn-pointer-on-d0
10835 @opindex mreturn-pointer-on-d0
10836 When generating a function which returns a pointer, return the pointer
10837 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
10838 only in a0, and attempts to call such functions without a prototype
10839 would result in errors.  Note that this option is on by default; use
10840 @option{-mno-return-pointer-on-d0} to disable it.
10841
10842 @item -mno-crt0
10843 @opindex mno-crt0
10844 Do not link in the C run-time initialization object file.
10845
10846 @item -mrelax
10847 @opindex mrelax
10848 Indicate to the linker that it should perform a relaxation optimization pass
10849 to shorten branches, calls and absolute memory addresses.  This option only
10850 has an effect when used on the command line for the final link step.
10851
10852 This option makes symbolic debugging impossible.
10853 @end table
10854
10855 @node MT Options
10856 @subsection MT Options
10857 @cindex MT options
10858
10859 These @option{-m} options are defined for Morpho MT architectures:
10860
10861 @table @gcctabopt
10862
10863 @item -march=@var{cpu-type}
10864 @opindex march
10865 Generate code that will run on @var{cpu-type}, which is the name of a system
10866 representing a certain processor type.  Possible values for
10867 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
10868 @samp{ms1-16-003} and @samp{ms2}.
10869
10870 When this option is not used, the default is @option{-march=ms1-16-002}.
10871
10872 @item -mbacc
10873 @opindex mbacc
10874 Use byte loads and stores when generating code.
10875
10876 @item -mno-bacc
10877 @opindex mno-bacc
10878 Do not use byte loads and stores when generating code.
10879
10880 @item -msim
10881 @opindex msim
10882 Use simulator runtime
10883
10884 @item -mno-crt0
10885 @opindex mno-crt0
10886 Do not link in the C run-time initialization object file
10887 @file{crti.o}.  Other run-time initialization and termination files
10888 such as @file{startup.o} and @file{exit.o} are still included on the
10889 linker command line.
10890
10891 @end table
10892
10893 @node PDP-11 Options
10894 @subsection PDP-11 Options
10895 @cindex PDP-11 Options
10896
10897 These options are defined for the PDP-11:
10898
10899 @table @gcctabopt
10900 @item -mfpu
10901 @opindex mfpu
10902 Use hardware FPP floating point.  This is the default.  (FIS floating
10903 point on the PDP-11/40 is not supported.)
10904
10905 @item -msoft-float
10906 @opindex msoft-float
10907 Do not use hardware floating point.
10908
10909 @item -mac0
10910 @opindex mac0
10911 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
10912
10913 @item -mno-ac0
10914 @opindex mno-ac0
10915 Return floating-point results in memory.  This is the default.
10916
10917 @item -m40
10918 @opindex m40
10919 Generate code for a PDP-11/40.
10920
10921 @item -m45
10922 @opindex m45
10923 Generate code for a PDP-11/45.  This is the default.
10924
10925 @item -m10
10926 @opindex m10
10927 Generate code for a PDP-11/10.
10928
10929 @item -mbcopy-builtin
10930 @opindex bcopy-builtin
10931 Use inline @code{movmemhi} patterns for copying memory.  This is the
10932 default.
10933
10934 @item -mbcopy
10935 @opindex mbcopy
10936 Do not use inline @code{movmemhi} patterns for copying memory.
10937
10938 @item -mint16
10939 @itemx -mno-int32
10940 @opindex mint16
10941 @opindex mno-int32
10942 Use 16-bit @code{int}.  This is the default.
10943
10944 @item -mint32
10945 @itemx -mno-int16
10946 @opindex mint32
10947 @opindex mno-int16
10948 Use 32-bit @code{int}.
10949
10950 @item -mfloat64
10951 @itemx -mno-float32
10952 @opindex mfloat64
10953 @opindex mno-float32
10954 Use 64-bit @code{float}.  This is the default.
10955
10956 @item -mfloat32
10957 @itemx -mno-float64
10958 @opindex mfloat32
10959 @opindex mno-float64
10960 Use 32-bit @code{float}.
10961
10962 @item -mabshi
10963 @opindex mabshi
10964 Use @code{abshi2} pattern.  This is the default.
10965
10966 @item -mno-abshi
10967 @opindex mno-abshi
10968 Do not use @code{abshi2} pattern.
10969
10970 @item -mbranch-expensive
10971 @opindex mbranch-expensive
10972 Pretend that branches are expensive.  This is for experimenting with
10973 code generation only.
10974
10975 @item -mbranch-cheap
10976 @opindex mbranch-cheap
10977 Do not pretend that branches are expensive.  This is the default.
10978
10979 @item -msplit
10980 @opindex msplit
10981 Generate code for a system with split I&D@.
10982
10983 @item -mno-split
10984 @opindex mno-split
10985 Generate code for a system without split I&D@.  This is the default.
10986
10987 @item -munix-asm
10988 @opindex munix-asm
10989 Use Unix assembler syntax.  This is the default when configured for
10990 @samp{pdp11-*-bsd}.
10991
10992 @item -mdec-asm
10993 @opindex mdec-asm
10994 Use DEC assembler syntax.  This is the default when configured for any
10995 PDP-11 target other than @samp{pdp11-*-bsd}.
10996 @end table
10997
10998 @node PowerPC Options
10999 @subsection PowerPC Options
11000 @cindex PowerPC options
11001
11002 These are listed under @xref{RS/6000 and PowerPC Options}.
11003
11004 @node RS/6000 and PowerPC Options
11005 @subsection IBM RS/6000 and PowerPC Options
11006 @cindex RS/6000 and PowerPC Options
11007 @cindex IBM RS/6000 and PowerPC Options
11008
11009 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11010 @table @gcctabopt
11011 @item -mpower
11012 @itemx -mno-power
11013 @itemx -mpower2
11014 @itemx -mno-power2
11015 @itemx -mpowerpc
11016 @itemx -mno-powerpc
11017 @itemx -mpowerpc-gpopt
11018 @itemx -mno-powerpc-gpopt
11019 @itemx -mpowerpc-gfxopt
11020 @itemx -mno-powerpc-gfxopt
11021 @itemx -mpowerpc64
11022 @itemx -mno-powerpc64
11023 @itemx -mmfcrf
11024 @itemx -mno-mfcrf
11025 @itemx -mpopcntb
11026 @itemx -mno-popcntb
11027 @itemx -mfprnd
11028 @itemx -mno-fprnd
11029 @opindex mpower
11030 @opindex mno-power
11031 @opindex mpower2
11032 @opindex mno-power2
11033 @opindex mpowerpc
11034 @opindex mno-powerpc
11035 @opindex mpowerpc-gpopt
11036 @opindex mno-powerpc-gpopt
11037 @opindex mpowerpc-gfxopt
11038 @opindex mno-powerpc-gfxopt
11039 @opindex mpowerpc64
11040 @opindex mno-powerpc64
11041 @opindex mmfcrf
11042 @opindex mno-mfcrf
11043 @opindex mpopcntb
11044 @opindex mno-popcntb
11045 @opindex mfprnd
11046 @opindex mno-fprnd
11047 GCC supports two related instruction set architectures for the
11048 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
11049 instructions supported by the @samp{rios} chip set used in the original
11050 RS/6000 systems and the @dfn{PowerPC} instruction set is the
11051 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
11052 the IBM 4xx, 6xx, and follow-on microprocessors.
11053
11054 Neither architecture is a subset of the other.  However there is a
11055 large common subset of instructions supported by both.  An MQ
11056 register is included in processors supporting the POWER architecture.
11057
11058 You use these options to specify which instructions are available on the
11059 processor you are using.  The default value of these options is
11060 determined when configuring GCC@.  Specifying the
11061 @option{-mcpu=@var{cpu_type}} overrides the specification of these
11062 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
11063 rather than the options listed above.
11064
11065 The @option{-mpower} option allows GCC to generate instructions that
11066 are found only in the POWER architecture and to use the MQ register.
11067 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
11068 to generate instructions that are present in the POWER2 architecture but
11069 not the original POWER architecture.
11070
11071 The @option{-mpowerpc} option allows GCC to generate instructions that
11072 are found only in the 32-bit subset of the PowerPC architecture.
11073 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
11074 GCC to use the optional PowerPC architecture instructions in the
11075 General Purpose group, including floating-point square root.  Specifying
11076 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
11077 use the optional PowerPC architecture instructions in the Graphics
11078 group, including floating-point select.
11079
11080 The @option{-mmfcrf} option allows GCC to generate the move from
11081 condition register field instruction implemented on the POWER4
11082 processor and other processors that support the PowerPC V2.01
11083 architecture.
11084 The @option{-mpopcntb} option allows GCC to generate the popcount and
11085 double precision FP reciprocal estimate instruction implemented on the
11086 POWER5 processor and other processors that support the PowerPC V2.02
11087 architecture.
11088 The @option{-mfprnd} option allows GCC to generate the FP round to
11089 integer instructions implemented on the POWER5+ processor and other
11090 processors that support the PowerPC V2.03 architecture.
11091
11092 The @option{-mpowerpc64} option allows GCC to generate the additional
11093 64-bit instructions that are found in the full PowerPC64 architecture
11094 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
11095 @option{-mno-powerpc64}.
11096
11097 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
11098 will use only the instructions in the common subset of both
11099 architectures plus some special AIX common-mode calls, and will not use
11100 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
11101 permits GCC to use any instruction from either architecture and to
11102 allow use of the MQ register; specify this for the Motorola MPC601.
11103
11104 @item -mnew-mnemonics
11105 @itemx -mold-mnemonics
11106 @opindex mnew-mnemonics
11107 @opindex mold-mnemonics
11108 Select which mnemonics to use in the generated assembler code.  With
11109 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
11110 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
11111 assembler mnemonics defined for the POWER architecture.  Instructions
11112 defined in only one architecture have only one mnemonic; GCC uses that
11113 mnemonic irrespective of which of these options is specified.
11114
11115 GCC defaults to the mnemonics appropriate for the architecture in
11116 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
11117 value of these option.  Unless you are building a cross-compiler, you
11118 should normally not specify either @option{-mnew-mnemonics} or
11119 @option{-mold-mnemonics}, but should instead accept the default.
11120
11121 @item -mcpu=@var{cpu_type}
11122 @opindex mcpu
11123 Set architecture type, register usage, choice of mnemonics, and
11124 instruction scheduling parameters for machine type @var{cpu_type}.
11125 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
11126 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
11127 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
11128 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
11129 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
11130 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
11131 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
11132 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
11133 @samp{common}, @samp{powerpc}, @samp{powerpc64},
11134 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
11135
11136 @option{-mcpu=common} selects a completely generic processor.  Code
11137 generated under this option will run on any POWER or PowerPC processor.
11138 GCC will use only the instructions in the common subset of both
11139 architectures, and will not use the MQ register.  GCC assumes a generic
11140 processor model for scheduling purposes.
11141
11142 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
11143 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
11144 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
11145 types, with an appropriate, generic processor model assumed for
11146 scheduling purposes.
11147
11148 The other options specify a specific processor.  Code generated under
11149 those options will run best on that processor, and may not run at all on
11150 others.
11151
11152 The @option{-mcpu} options automatically enable or disable the
11153 following options: @option{-maltivec}, @option{-mfprnd},
11154 @option{-mhard-float}, @option{-mmfcrf}, @option{-mmultiple},
11155 @option{-mnew-mnemonics}, @option{-mpopcntb}, @option{-mpower},
11156 @option{-mpower2}, @option{-mpowerpc64}, @option{-mpowerpc-gpopt},
11157 @option{-mpowerpc-gfxopt}, @option{-mstring}, @option{-mmulhw}, @option{-mdlmzb}.
11158 The particular options
11159 set for any particular CPU will vary between compiler versions,
11160 depending on what setting seems to produce optimal code for that CPU;
11161 it doesn't necessarily reflect the actual hardware's capabilities.  If
11162 you wish to set an individual option to a particular value, you may
11163 specify it after the @option{-mcpu} option, like @samp{-mcpu=970
11164 -mno-altivec}.
11165
11166 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
11167 not enabled or disabled by the @option{-mcpu} option at present because
11168 AIX does not have full support for these options.  You may still
11169 enable or disable them individually if you're sure it'll work in your
11170 environment.
11171
11172 @item -mtune=@var{cpu_type}
11173 @opindex mtune
11174 Set the instruction scheduling parameters for machine type
11175 @var{cpu_type}, but do not set the architecture type, register usage, or
11176 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
11177 values for @var{cpu_type} are used for @option{-mtune} as for
11178 @option{-mcpu}.  If both are specified, the code generated will use the
11179 architecture, registers, and mnemonics set by @option{-mcpu}, but the
11180 scheduling parameters set by @option{-mtune}.
11181
11182 @item -mswdiv
11183 @itemx -mno-swdiv
11184 @opindex mswdiv
11185 @opindex mno-swdiv
11186 Generate code to compute division as reciprocal estimate and iterative
11187 refinement, creating opportunities for increased throughput.  This
11188 feature requires: optional PowerPC Graphics instruction set for single
11189 precision and FRE instruction for double precision, assuming divides
11190 cannot generate user-visible traps, and the domain values not include
11191 Infinities, denormals or zero denominator.
11192
11193 @item -maltivec
11194 @itemx -mno-altivec
11195 @opindex maltivec
11196 @opindex mno-altivec
11197 Generate code that uses (does not use) AltiVec instructions, and also
11198 enable the use of built-in functions that allow more direct access to
11199 the AltiVec instruction set.  You may also need to set
11200 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
11201 enhancements.
11202
11203 @item -mvrsave
11204 @item -mno-vrsave
11205 @opindex mvrsave
11206 @opindex mno-vrsave
11207 Generate VRSAVE instructions when generating AltiVec code.
11208
11209 @item -msecure-plt
11210 @opindex msecure-plt
11211 Generate code that allows ld and ld.so to build executables and shared
11212 libraries with non-exec .plt and .got sections.  This is a PowerPC
11213 32-bit SYSV ABI option.
11214
11215 @item -mbss-plt
11216 @opindex mbss-plt
11217 Generate code that uses a BSS .plt section that ld.so fills in, and
11218 requires .plt and .got sections that are both writable and executable.
11219 This is a PowerPC 32-bit SYSV ABI option.
11220
11221 @item -misel
11222 @itemx -mno-isel
11223 @opindex misel
11224 @opindex mno-isel
11225 This switch enables or disables the generation of ISEL instructions.
11226
11227 @item -misel=@var{yes/no}
11228 This switch has been deprecated.  Use @option{-misel} and
11229 @option{-mno-isel} instead.
11230
11231 @item -mspe
11232 @itemx -mno-spe
11233 @opindex mspe
11234 @opindex mno-spe
11235 This switch enables or disables the generation of SPE simd
11236 instructions.
11237
11238 @item -mspe=@var{yes/no}
11239 This option has been deprecated.  Use @option{-mspe} and
11240 @option{-mno-spe} instead.
11241
11242 @item -mfloat-gprs=@var{yes/single/double/no}
11243 @itemx -mfloat-gprs
11244 @opindex mfloat-gprs
11245 This switch enables or disables the generation of floating point
11246 operations on the general purpose registers for architectures that
11247 support it.
11248
11249 The argument @var{yes} or @var{single} enables the use of
11250 single-precision floating point operations.
11251
11252 The argument @var{double} enables the use of single and
11253 double-precision floating point operations.
11254
11255 The argument @var{no} disables floating point operations on the
11256 general purpose registers.
11257
11258 This option is currently only available on the MPC854x.
11259
11260 @item -m32
11261 @itemx -m64
11262 @opindex m32
11263 @opindex m64
11264 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
11265 targets (including GNU/Linux).  The 32-bit environment sets int, long
11266 and pointer to 32 bits and generates code that runs on any PowerPC
11267 variant.  The 64-bit environment sets int to 32 bits and long and
11268 pointer to 64 bits, and generates code for PowerPC64, as for
11269 @option{-mpowerpc64}.
11270
11271 @item -mfull-toc
11272 @itemx -mno-fp-in-toc
11273 @itemx -mno-sum-in-toc
11274 @itemx -mminimal-toc
11275 @opindex mfull-toc
11276 @opindex mno-fp-in-toc
11277 @opindex mno-sum-in-toc
11278 @opindex mminimal-toc
11279 Modify generation of the TOC (Table Of Contents), which is created for
11280 every executable file.  The @option{-mfull-toc} option is selected by
11281 default.  In that case, GCC will allocate at least one TOC entry for
11282 each unique non-automatic variable reference in your program.  GCC
11283 will also place floating-point constants in the TOC@.  However, only
11284 16,384 entries are available in the TOC@.
11285
11286 If you receive a linker error message that saying you have overflowed
11287 the available TOC space, you can reduce the amount of TOC space used
11288 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
11289 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
11290 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
11291 generate code to calculate the sum of an address and a constant at
11292 run-time instead of putting that sum into the TOC@.  You may specify one
11293 or both of these options.  Each causes GCC to produce very slightly
11294 slower and larger code at the expense of conserving TOC space.
11295
11296 If you still run out of space in the TOC even when you specify both of
11297 these options, specify @option{-mminimal-toc} instead.  This option causes
11298 GCC to make only one TOC entry for every file.  When you specify this
11299 option, GCC will produce code that is slower and larger but which
11300 uses extremely little TOC space.  You may wish to use this option
11301 only on files that contain less frequently executed code.
11302
11303 @item -maix64
11304 @itemx -maix32
11305 @opindex maix64
11306 @opindex maix32
11307 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
11308 @code{long} type, and the infrastructure needed to support them.
11309 Specifying @option{-maix64} implies @option{-mpowerpc64} and
11310 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
11311 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
11312
11313 @item -mxl-compat
11314 @itemx -mno-xl-compat
11315 @opindex mxl-compat
11316 @opindex mno-xl-compat
11317 Produce code that conforms more closely to IBM XL compiler semantics
11318 when using AIX-compatible ABI.  Pass floating-point arguments to
11319 prototyped functions beyond the register save area (RSA) on the stack
11320 in addition to argument FPRs.  Do not assume that most significant
11321 double in 128-bit long double value is properly rounded when comparing
11322 values and converting to double.  Use XL symbol names for long double
11323 support routines.
11324
11325 The AIX calling convention was extended but not initially documented to
11326 handle an obscure K&R C case of calling a function that takes the
11327 address of its arguments with fewer arguments than declared.  IBM XL
11328 compilers access floating point arguments which do not fit in the
11329 RSA from the stack when a subroutine is compiled without
11330 optimization.  Because always storing floating-point arguments on the
11331 stack is inefficient and rarely needed, this option is not enabled by
11332 default and only is necessary when calling subroutines compiled by IBM
11333 XL compilers without optimization.
11334
11335 @item -mpe
11336 @opindex mpe
11337 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
11338 application written to use message passing with special startup code to
11339 enable the application to run.  The system must have PE installed in the
11340 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
11341 must be overridden with the @option{-specs=} option to specify the
11342 appropriate directory location.  The Parallel Environment does not
11343 support threads, so the @option{-mpe} option and the @option{-pthread}
11344 option are incompatible.
11345
11346 @item -malign-natural
11347 @itemx -malign-power
11348 @opindex malign-natural
11349 @opindex malign-power
11350 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
11351 @option{-malign-natural} overrides the ABI-defined alignment of larger
11352 types, such as floating-point doubles, on their natural size-based boundary.
11353 The option @option{-malign-power} instructs GCC to follow the ABI-specified
11354 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
11355
11356 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
11357 is not supported.
11358
11359 @item -msoft-float
11360 @itemx -mhard-float
11361 @opindex msoft-float
11362 @opindex mhard-float
11363 Generate code that does not use (uses) the floating-point register set.
11364 Software floating point emulation is provided if you use the
11365 @option{-msoft-float} option, and pass the option to GCC when linking.
11366
11367 @item -mmultiple
11368 @itemx -mno-multiple
11369 @opindex mmultiple
11370 @opindex mno-multiple
11371 Generate code that uses (does not use) the load multiple word
11372 instructions and the store multiple word instructions.  These
11373 instructions are generated by default on POWER systems, and not
11374 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
11375 endian PowerPC systems, since those instructions do not work when the
11376 processor is in little endian mode.  The exceptions are PPC740 and
11377 PPC750 which permit the instructions usage in little endian mode.
11378
11379 @item -mstring
11380 @itemx -mno-string
11381 @opindex mstring
11382 @opindex mno-string
11383 Generate code that uses (does not use) the load string instructions
11384 and the store string word instructions to save multiple registers and
11385 do small block moves.  These instructions are generated by default on
11386 POWER systems, and not generated on PowerPC systems.  Do not use
11387 @option{-mstring} on little endian PowerPC systems, since those
11388 instructions do not work when the processor is in little endian mode.
11389 The exceptions are PPC740 and PPC750 which permit the instructions
11390 usage in little endian mode.
11391
11392 @item -mupdate
11393 @itemx -mno-update
11394 @opindex mupdate
11395 @opindex mno-update
11396 Generate code that uses (does not use) the load or store instructions
11397 that update the base register to the address of the calculated memory
11398 location.  These instructions are generated by default.  If you use
11399 @option{-mno-update}, there is a small window between the time that the
11400 stack pointer is updated and the address of the previous frame is
11401 stored, which means code that walks the stack frame across interrupts or
11402 signals may get corrupted data.
11403
11404 @item -mfused-madd
11405 @itemx -mno-fused-madd
11406 @opindex mfused-madd
11407 @opindex mno-fused-madd
11408 Generate code that uses (does not use) the floating point multiply and
11409 accumulate instructions.  These instructions are generated by default if
11410 hardware floating is used.
11411
11412 @item -mmulhw
11413 @itemx -mno-mulhw
11414 @opindex mmulhw
11415 @opindex mno-mulhw
11416 Generate code that uses (does not use) the half-word multiply and
11417 multiply-accumulate instructions on the IBM 405 and 440 processors.
11418 These instructions are generated by default when targetting those
11419 processors.
11420
11421 @item -mdlmzb
11422 @itemx -mno-dlmzb
11423 @opindex mdlmzb
11424 @opindex mno-dlmzb
11425 Generate code that uses (does not use) the string-search @samp{dlmzb}
11426 instruction on the IBM 405 and 440 processors.  This instruction is
11427 generated by default when targetting those processors.
11428
11429 @item -mno-bit-align
11430 @itemx -mbit-align
11431 @opindex mno-bit-align
11432 @opindex mbit-align
11433 On System V.4 and embedded PowerPC systems do not (do) force structures
11434 and unions that contain bit-fields to be aligned to the base type of the
11435 bit-field.
11436
11437 For example, by default a structure containing nothing but 8
11438 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
11439 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
11440 the structure would be aligned to a 1 byte boundary and be one byte in
11441 size.
11442
11443 @item -mno-strict-align
11444 @itemx -mstrict-align
11445 @opindex mno-strict-align
11446 @opindex mstrict-align
11447 On System V.4 and embedded PowerPC systems do not (do) assume that
11448 unaligned memory references will be handled by the system.
11449
11450 @item -mrelocatable
11451 @itemx -mno-relocatable
11452 @opindex mrelocatable
11453 @opindex mno-relocatable
11454 On embedded PowerPC systems generate code that allows (does not allow)
11455 the program to be relocated to a different address at runtime.  If you
11456 use @option{-mrelocatable} on any module, all objects linked together must
11457 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
11458
11459 @item -mrelocatable-lib
11460 @itemx -mno-relocatable-lib
11461 @opindex mrelocatable-lib
11462 @opindex mno-relocatable-lib
11463 On embedded PowerPC systems generate code that allows (does not allow)
11464 the program to be relocated to a different address at runtime.  Modules
11465 compiled with @option{-mrelocatable-lib} can be linked with either modules
11466 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
11467 with modules compiled with the @option{-mrelocatable} options.
11468
11469 @item -mno-toc
11470 @itemx -mtoc
11471 @opindex mno-toc
11472 @opindex mtoc
11473 On System V.4 and embedded PowerPC systems do not (do) assume that
11474 register 2 contains a pointer to a global area pointing to the addresses
11475 used in the program.
11476
11477 @item -mlittle
11478 @itemx -mlittle-endian
11479 @opindex mlittle
11480 @opindex mlittle-endian
11481 On System V.4 and embedded PowerPC systems compile code for the
11482 processor in little endian mode.  The @option{-mlittle-endian} option is
11483 the same as @option{-mlittle}.
11484
11485 @item -mbig
11486 @itemx -mbig-endian
11487 @opindex mbig
11488 @opindex mbig-endian
11489 On System V.4 and embedded PowerPC systems compile code for the
11490 processor in big endian mode.  The @option{-mbig-endian} option is
11491 the same as @option{-mbig}.
11492
11493 @item -mdynamic-no-pic
11494 @opindex mdynamic-no-pic
11495 On Darwin and Mac OS X systems, compile code so that it is not
11496 relocatable, but that its external references are relocatable.  The
11497 resulting code is suitable for applications, but not shared
11498 libraries.
11499
11500 @item -mprioritize-restricted-insns=@var{priority}
11501 @opindex mprioritize-restricted-insns
11502 This option controls the priority that is assigned to
11503 dispatch-slot restricted instructions during the second scheduling
11504 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
11505 @var{no/highest/second-highest} priority to dispatch slot restricted
11506 instructions.
11507
11508 @item -msched-costly-dep=@var{dependence_type}
11509 @opindex msched-costly-dep
11510 This option controls which dependences are considered costly
11511 by the target during instruction scheduling.  The argument
11512 @var{dependence_type} takes one of the following values:
11513 @var{no}: no dependence is costly,
11514 @var{all}: all dependences are costly,
11515 @var{true_store_to_load}: a true dependence from store to load is costly,
11516 @var{store_to_load}: any dependence from store to load is costly,
11517 @var{number}: any dependence which latency >= @var{number} is costly.
11518
11519 @item -minsert-sched-nops=@var{scheme}
11520 @opindex minsert-sched-nops
11521 This option controls which nop insertion scheme will be used during
11522 the second scheduling pass.  The argument @var{scheme} takes one of the
11523 following values:
11524 @var{no}: Don't insert nops.
11525 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
11526 according to the scheduler's grouping.
11527 @var{regroup_exact}: Insert nops to force costly dependent insns into
11528 separate groups.  Insert exactly as many nops as needed to force an insn
11529 to a new group, according to the estimated processor grouping.
11530 @var{number}: Insert nops to force costly dependent insns into
11531 separate groups.  Insert @var{number} nops to force an insn to a new group.
11532
11533 @item -mcall-sysv
11534 @opindex mcall-sysv
11535 On System V.4 and embedded PowerPC systems compile code using calling
11536 conventions that adheres to the March 1995 draft of the System V
11537 Application Binary Interface, PowerPC processor supplement.  This is the
11538 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
11539
11540 @item -mcall-sysv-eabi
11541 @opindex mcall-sysv-eabi
11542 Specify both @option{-mcall-sysv} and @option{-meabi} options.
11543
11544 @item -mcall-sysv-noeabi
11545 @opindex mcall-sysv-noeabi
11546 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
11547
11548 @item -mcall-solaris
11549 @opindex mcall-solaris
11550 On System V.4 and embedded PowerPC systems compile code for the Solaris
11551 operating system.
11552
11553 @item -mcall-linux
11554 @opindex mcall-linux
11555 On System V.4 and embedded PowerPC systems compile code for the
11556 Linux-based GNU system.
11557
11558 @item -mcall-gnu
11559 @opindex mcall-gnu
11560 On System V.4 and embedded PowerPC systems compile code for the
11561 Hurd-based GNU system.
11562
11563 @item -mcall-netbsd
11564 @opindex mcall-netbsd
11565 On System V.4 and embedded PowerPC systems compile code for the
11566 NetBSD operating system.
11567
11568 @item -maix-struct-return
11569 @opindex maix-struct-return
11570 Return all structures in memory (as specified by the AIX ABI)@.
11571
11572 @item -msvr4-struct-return
11573 @opindex msvr4-struct-return
11574 Return structures smaller than 8 bytes in registers (as specified by the
11575 SVR4 ABI)@.
11576
11577 @item -mabi=@var{abi-type}
11578 @opindex mabi
11579 Extend the current ABI with a particular extension, or remove such extension.
11580 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
11581 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
11582
11583 @item -mabi=spe
11584 @opindex mabi=spe
11585 Extend the current ABI with SPE ABI extensions.  This does not change
11586 the default ABI, instead it adds the SPE ABI extensions to the current
11587 ABI@.
11588
11589 @item -mabi=no-spe
11590 @opindex mabi=no-spe
11591 Disable Booke SPE ABI extensions for the current ABI@.
11592
11593 @item -mabi=ibmlongdouble
11594 @opindex mabi=ibmlongdouble
11595 Change the current ABI to use IBM extended precision long double.
11596 This is a PowerPC 32-bit SYSV ABI option.
11597
11598 @item -mabi=ieeelongdouble
11599 @opindex mabi=ieeelongdouble
11600 Change the current ABI to use IEEE extended precision long double.
11601 This is a PowerPC 32-bit Linux ABI option.
11602
11603 @item -mprototype
11604 @itemx -mno-prototype
11605 @opindex mprototype
11606 @opindex mno-prototype
11607 On System V.4 and embedded PowerPC systems assume that all calls to
11608 variable argument functions are properly prototyped.  Otherwise, the
11609 compiler must insert an instruction before every non prototyped call to
11610 set or clear bit 6 of the condition code register (@var{CR}) to
11611 indicate whether floating point values were passed in the floating point
11612 registers in case the function takes a variable arguments.  With
11613 @option{-mprototype}, only calls to prototyped variable argument functions
11614 will set or clear the bit.
11615
11616 @item -msim
11617 @opindex msim
11618 On embedded PowerPC systems, assume that the startup module is called
11619 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
11620 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
11621 configurations.
11622
11623 @item -mmvme
11624 @opindex mmvme
11625 On embedded PowerPC systems, assume that the startup module is called
11626 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
11627 @file{libc.a}.
11628
11629 @item -mads
11630 @opindex mads
11631 On embedded PowerPC systems, assume that the startup module is called
11632 @file{crt0.o} and the standard C libraries are @file{libads.a} and
11633 @file{libc.a}.
11634
11635 @item -myellowknife
11636 @opindex myellowknife
11637 On embedded PowerPC systems, assume that the startup module is called
11638 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
11639 @file{libc.a}.
11640
11641 @item -mvxworks
11642 @opindex mvxworks
11643 On System V.4 and embedded PowerPC systems, specify that you are
11644 compiling for a VxWorks system.
11645
11646 @item -mwindiss
11647 @opindex mwindiss
11648 Specify that you are compiling for the WindISS simulation environment.
11649
11650 @item -memb
11651 @opindex memb
11652 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
11653 header to indicate that @samp{eabi} extended relocations are used.
11654
11655 @item -meabi
11656 @itemx -mno-eabi
11657 @opindex meabi
11658 @opindex mno-eabi
11659 On System V.4 and embedded PowerPC systems do (do not) adhere to the
11660 Embedded Applications Binary Interface (eabi) which is a set of
11661 modifications to the System V.4 specifications.  Selecting @option{-meabi}
11662 means that the stack is aligned to an 8 byte boundary, a function
11663 @code{__eabi} is called to from @code{main} to set up the eabi
11664 environment, and the @option{-msdata} option can use both @code{r2} and
11665 @code{r13} to point to two separate small data areas.  Selecting
11666 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
11667 do not call an initialization function from @code{main}, and the
11668 @option{-msdata} option will only use @code{r13} to point to a single
11669 small data area.  The @option{-meabi} option is on by default if you
11670 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
11671
11672 @item -msdata=eabi
11673 @opindex msdata=eabi
11674 On System V.4 and embedded PowerPC systems, put small initialized
11675 @code{const} global and static data in the @samp{.sdata2} section, which
11676 is pointed to by register @code{r2}.  Put small initialized
11677 non-@code{const} global and static data in the @samp{.sdata} section,
11678 which is pointed to by register @code{r13}.  Put small uninitialized
11679 global and static data in the @samp{.sbss} section, which is adjacent to
11680 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
11681 incompatible with the @option{-mrelocatable} option.  The
11682 @option{-msdata=eabi} option also sets the @option{-memb} option.
11683
11684 @item -msdata=sysv
11685 @opindex msdata=sysv
11686 On System V.4 and embedded PowerPC systems, put small global and static
11687 data in the @samp{.sdata} section, which is pointed to by register
11688 @code{r13}.  Put small uninitialized global and static data in the
11689 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
11690 The @option{-msdata=sysv} option is incompatible with the
11691 @option{-mrelocatable} option.
11692
11693 @item -msdata=default
11694 @itemx -msdata
11695 @opindex msdata=default
11696 @opindex msdata
11697 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
11698 compile code the same as @option{-msdata=eabi}, otherwise compile code the
11699 same as @option{-msdata=sysv}.
11700
11701 @item -msdata-data
11702 @opindex msdata-data
11703 On System V.4 and embedded PowerPC systems, put small global
11704 data in the @samp{.sdata} section.  Put small uninitialized global
11705 data in the @samp{.sbss} section.  Do not use register @code{r13}
11706 to address small data however.  This is the default behavior unless
11707 other @option{-msdata} options are used.
11708
11709 @item -msdata=none
11710 @itemx -mno-sdata
11711 @opindex msdata=none
11712 @opindex mno-sdata
11713 On embedded PowerPC systems, put all initialized global and static data
11714 in the @samp{.data} section, and all uninitialized data in the
11715 @samp{.bss} section.
11716
11717 @item -G @var{num}
11718 @opindex G
11719 @cindex smaller data references (PowerPC)
11720 @cindex .sdata/.sdata2 references (PowerPC)
11721 On embedded PowerPC systems, put global and static items less than or
11722 equal to @var{num} bytes into the small data or bss sections instead of
11723 the normal data or bss section.  By default, @var{num} is 8.  The
11724 @option{-G @var{num}} switch is also passed to the linker.
11725 All modules should be compiled with the same @option{-G @var{num}} value.
11726
11727 @item -mregnames
11728 @itemx -mno-regnames
11729 @opindex mregnames
11730 @opindex mno-regnames
11731 On System V.4 and embedded PowerPC systems do (do not) emit register
11732 names in the assembly language output using symbolic forms.
11733
11734 @item -mlongcall
11735 @itemx -mno-longcall
11736 @opindex mlongcall
11737 @opindex mno-longcall
11738 By default assume that all calls are far away so that a longer more
11739 expensive calling sequence is required.  This is required for calls
11740 further than 32 megabytes (33,554,432 bytes) from the current location.
11741 A short call will be generated if the compiler knows
11742 the call cannot be that far away.  This setting can be overridden by
11743 the @code{shortcall} function attribute, or by @code{#pragma
11744 longcall(0)}.
11745
11746 Some linkers are capable of detecting out-of-range calls and generating
11747 glue code on the fly.  On these systems, long calls are unnecessary and
11748 generate slower code.  As of this writing, the AIX linker can do this,
11749 as can the GNU linker for PowerPC/64.  It is planned to add this feature
11750 to the GNU linker for 32-bit PowerPC systems as well.
11751
11752 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
11753 callee, L42'', plus a ``branch island'' (glue code).  The two target
11754 addresses represent the callee and the ``branch island''.  The
11755 Darwin/PPC linker will prefer the first address and generate a ``bl
11756 callee'' if the PPC ``bl'' instruction will reach the callee directly;
11757 otherwise, the linker will generate ``bl L42'' to call the ``branch
11758 island''.  The ``branch island'' is appended to the body of the
11759 calling function; it computes the full 32-bit address of the callee
11760 and jumps to it.
11761
11762 On Mach-O (Darwin) systems, this option directs the compiler emit to
11763 the glue for every direct call, and the Darwin linker decides whether
11764 to use or discard it.
11765
11766 In the future, we may cause GCC to ignore all longcall specifications
11767 when the linker is known to generate glue.
11768
11769 @item -pthread
11770 @opindex pthread
11771 Adds support for multithreading with the @dfn{pthreads} library.
11772 This option sets flags for both the preprocessor and linker.
11773
11774 @end table
11775
11776 @node S/390 and zSeries Options
11777 @subsection S/390 and zSeries Options
11778 @cindex S/390 and zSeries Options
11779
11780 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
11781
11782 @table @gcctabopt
11783 @item -mhard-float
11784 @itemx -msoft-float
11785 @opindex mhard-float
11786 @opindex msoft-float
11787 Use (do not use) the hardware floating-point instructions and registers
11788 for floating-point operations.  When @option{-msoft-float} is specified,
11789 functions in @file{libgcc.a} will be used to perform floating-point
11790 operations.  When @option{-mhard-float} is specified, the compiler
11791 generates IEEE floating-point instructions.  This is the default.
11792
11793 @item -mlong-double-64
11794 @itemx -mlong-double-128
11795 @opindex mlong-double-64
11796 @opindex mlong-double-128
11797 These switches control the size of @code{long double} type. A size
11798 of 64bit makes the @code{long double} type equivalent to the @code{double}
11799 type. This is the default.
11800
11801 @item -mbackchain
11802 @itemx -mno-backchain
11803 @opindex mbackchain
11804 @opindex mno-backchain
11805 Store (do not store) the address of the caller's frame as backchain pointer
11806 into the callee's stack frame.
11807 A backchain may be needed to allow debugging using tools that do not understand
11808 DWARF-2 call frame information.
11809 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
11810 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
11811 the backchain is placed into the topmost word of the 96/160 byte register
11812 save area.
11813
11814 In general, code compiled with @option{-mbackchain} is call-compatible with
11815 code compiled with @option{-mmo-backchain}; however, use of the backchain
11816 for debugging purposes usually requires that the whole binary is built with
11817 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
11818 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
11819 to build a linux kernel use @option{-msoft-float}.
11820
11821 The default is to not maintain the backchain.
11822
11823 @item -mpacked-stack
11824 @item -mno-packed-stack
11825 @opindex mpacked-stack
11826 @opindex mno-packed-stack
11827 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
11828 specified, the compiler uses the all fields of the 96/160 byte register save
11829 area only for their default purpose; unused fields still take up stack space.
11830 When @option{-mpacked-stack} is specified, register save slots are densely
11831 packed at the top of the register save area; unused space is reused for other
11832 purposes, allowing for more efficient use of the available stack space.
11833 However, when @option{-mbackchain} is also in effect, the topmost word of
11834 the save area is always used to store the backchain, and the return address
11835 register is always saved two words below the backchain.
11836
11837 As long as the stack frame backchain is not used, code generated with
11838 @option{-mpacked-stack} is call-compatible with code generated with
11839 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
11840 S/390 or zSeries generated code that uses the stack frame backchain at run
11841 time, not just for debugging purposes.  Such code is not call-compatible
11842 with code compiled with @option{-mpacked-stack}.  Also, note that the
11843 combination of @option{-mbackchain},
11844 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
11845 to build a linux kernel use @option{-msoft-float}.
11846
11847 The default is to not use the packed stack layout.
11848
11849 @item -msmall-exec
11850 @itemx -mno-small-exec
11851 @opindex msmall-exec
11852 @opindex mno-small-exec
11853 Generate (or do not generate) code using the @code{bras} instruction
11854 to do subroutine calls.
11855 This only works reliably if the total executable size does not
11856 exceed 64k.  The default is to use the @code{basr} instruction instead,
11857 which does not have this limitation.
11858
11859 @item -m64
11860 @itemx -m31
11861 @opindex m64
11862 @opindex m31
11863 When @option{-m31} is specified, generate code compliant to the
11864 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
11865 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
11866 particular to generate 64-bit instructions.  For the @samp{s390}
11867 targets, the default is @option{-m31}, while the @samp{s390x}
11868 targets default to @option{-m64}.
11869
11870 @item -mzarch
11871 @itemx -mesa
11872 @opindex mzarch
11873 @opindex mesa
11874 When @option{-mzarch} is specified, generate code using the
11875 instructions available on z/Architecture.
11876 When @option{-mesa} is specified, generate code using the
11877 instructions available on ESA/390.  Note that @option{-mesa} is
11878 not possible with @option{-m64}.
11879 When generating code compliant to the GNU/Linux for S/390 ABI,
11880 the default is @option{-mesa}.  When generating code compliant
11881 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
11882
11883 @item -mmvcle
11884 @itemx -mno-mvcle
11885 @opindex mmvcle
11886 @opindex mno-mvcle
11887 Generate (or do not generate) code using the @code{mvcle} instruction
11888 to perform block moves.  When @option{-mno-mvcle} is specified,
11889 use a @code{mvc} loop instead.  This is the default unless optimizing for
11890 size.
11891
11892 @item -mdebug
11893 @itemx -mno-debug
11894 @opindex mdebug
11895 @opindex mno-debug
11896 Print (or do not print) additional debug information when compiling.
11897 The default is to not print debug information.
11898
11899 @item -march=@var{cpu-type}
11900 @opindex march
11901 Generate code that will run on @var{cpu-type}, which is the name of a system
11902 representing a certain processor type.  Possible values for
11903 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
11904 When generating code using the instructions available on z/Architecture,
11905 the default is @option{-march=z900}.  Otherwise, the default is
11906 @option{-march=g5}.
11907
11908 @item -mtune=@var{cpu-type}
11909 @opindex mtune
11910 Tune to @var{cpu-type} everything applicable about the generated code,
11911 except for the ABI and the set of available instructions.
11912 The list of @var{cpu-type} values is the same as for @option{-march}.
11913 The default is the value used for @option{-march}.
11914
11915 @item -mtpf-trace
11916 @itemx -mno-tpf-trace
11917 @opindex mtpf-trace
11918 @opindex mno-tpf-trace
11919 Generate code that adds (does not add) in TPF OS specific branches to trace
11920 routines in the operating system.  This option is off by default, even
11921 when compiling for the TPF OS@.
11922
11923 @item -mfused-madd
11924 @itemx -mno-fused-madd
11925 @opindex mfused-madd
11926 @opindex mno-fused-madd
11927 Generate code that uses (does not use) the floating point multiply and
11928 accumulate instructions.  These instructions are generated by default if
11929 hardware floating point is used.
11930
11931 @item -mwarn-framesize=@var{framesize}
11932 @opindex mwarn-framesize
11933 Emit a warning if the current function exceeds the given frame size.  Because
11934 this is a compile time check it doesn't need to be a real problem when the program
11935 runs.  It is intended to identify functions which most probably cause
11936 a stack overflow.  It is useful to be used in an environment with limited stack
11937 size e.g.@: the linux kernel.
11938
11939 @item -mwarn-dynamicstack
11940 @opindex mwarn-dynamicstack
11941 Emit a warning if the function calls alloca or uses dynamically
11942 sized arrays.  This is generally a bad idea with a limited stack size.
11943
11944 @item -mstack-guard=@var{stack-guard}
11945 @item -mstack-size=@var{stack-size}
11946 @opindex mstack-guard
11947 @opindex mstack-size
11948 These arguments always have to be used in conjunction.  If they are present the s390
11949 back end emits additional instructions in the function prologue which trigger a trap
11950 if the stack size is @var{stack-guard} bytes above the @var{stack-size}
11951 (remember that the stack on s390 grows downward).  These options are intended to
11952 be used to help debugging stack overflow problems.  The additionally emitted code
11953 causes only little overhead and hence can also be used in production like systems
11954 without greater performance degradation.  The given values have to be exact
11955 powers of 2 and @var{stack-size} has to be greater than @var{stack-guard} without
11956 exceeding 64k.
11957 In order to be efficient the extra code makes the assumption that the stack starts
11958 at an address aligned to the value given by @var{stack-size}.
11959 @end table
11960
11961 @node Score Options
11962 @subsection Score Options
11963 @cindex Score Options
11964
11965 These options are defined for Score implementations:
11966
11967 @table @gcctabopt
11968 @item -meb
11969 @opindex meb
11970 Compile code for big endian mode.  This is the default.
11971
11972 @item -mel
11973 @opindex mel
11974 Compile code for little endian mode. 
11975
11976 @item -mnhwloop
11977 @opindex mnhwloop
11978 Disable generate bcnz instruction.
11979
11980 @item -muls
11981 @opindex muls
11982 Enable generate unaligned load and store instruction.
11983
11984 @item -mmac
11985 @opindex mmac
11986 Enable the use of multiply-accumulate instructions. Disabled by default. 
11987
11988 @item -mscore5
11989 @opindex mscore5
11990 Specify the SCORE5 as the target architecture.
11991
11992 @item -mscore5u
11993 @opindex mscore5u
11994 Specify the SCORE5U of the target architecture.
11995
11996 @item -mscore7
11997 @opindex mscore7
11998 Specify the SCORE7 as the target architecture. This is the default.
11999
12000 @item -mscore7d
12001 @opindex mscore7d
12002 Specify the SCORE7D as the target architecture.
12003 @end table
12004
12005 @node SH Options
12006 @subsection SH Options
12007
12008 These @samp{-m} options are defined for the SH implementations:
12009
12010 @table @gcctabopt
12011 @item -m1
12012 @opindex m1
12013 Generate code for the SH1.
12014
12015 @item -m2
12016 @opindex m2
12017 Generate code for the SH2.
12018
12019 @item -m2e
12020 Generate code for the SH2e.
12021
12022 @item -m3
12023 @opindex m3
12024 Generate code for the SH3.
12025
12026 @item -m3e
12027 @opindex m3e
12028 Generate code for the SH3e.
12029
12030 @item -m4-nofpu
12031 @opindex m4-nofpu
12032 Generate code for the SH4 without a floating-point unit.
12033
12034 @item -m4-single-only
12035 @opindex m4-single-only
12036 Generate code for the SH4 with a floating-point unit that only
12037 supports single-precision arithmetic.
12038
12039 @item -m4-single
12040 @opindex m4-single
12041 Generate code for the SH4 assuming the floating-point unit is in
12042 single-precision mode by default.
12043
12044 @item -m4
12045 @opindex m4
12046 Generate code for the SH4.
12047
12048 @item -m4a-nofpu
12049 @opindex m4a-nofpu
12050 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
12051 floating-point unit is not used.
12052
12053 @item -m4a-single-only
12054 @opindex m4a-single-only
12055 Generate code for the SH4a, in such a way that no double-precision
12056 floating point operations are used.
12057
12058 @item -m4a-single
12059 @opindex m4a-single
12060 Generate code for the SH4a assuming the floating-point unit is in
12061 single-precision mode by default.
12062
12063 @item -m4a
12064 @opindex m4a
12065 Generate code for the SH4a.
12066
12067 @item -m4al
12068 @opindex m4al
12069 Same as @option{-m4a-nofpu}, except that it implicitly passes
12070 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
12071 instructions at the moment.
12072
12073 @item -mb
12074 @opindex mb
12075 Compile code for the processor in big endian mode.
12076
12077 @item -ml
12078 @opindex ml
12079 Compile code for the processor in little endian mode.
12080
12081 @item -mdalign
12082 @opindex mdalign
12083 Align doubles at 64-bit boundaries.  Note that this changes the calling
12084 conventions, and thus some functions from the standard C library will
12085 not work unless you recompile it first with @option{-mdalign}.
12086
12087 @item -mrelax
12088 @opindex mrelax
12089 Shorten some address references at link time, when possible; uses the
12090 linker option @option{-relax}.
12091
12092 @item -mbigtable
12093 @opindex mbigtable
12094 Use 32-bit offsets in @code{switch} tables.  The default is to use
12095 16-bit offsets.
12096
12097 @item -mfmovd
12098 @opindex mfmovd
12099 Enable the use of the instruction @code{fmovd}.
12100
12101 @item -mhitachi
12102 @opindex mhitachi
12103 Comply with the calling conventions defined by Renesas.
12104
12105 @item -mrenesas
12106 @opindex mhitachi
12107 Comply with the calling conventions defined by Renesas.
12108
12109 @item -mno-renesas
12110 @opindex mhitachi
12111 Comply with the calling conventions defined for GCC before the Renesas
12112 conventions were available.  This option is the default for all
12113 targets of the SH toolchain except for @samp{sh-symbianelf}.
12114
12115 @item -mnomacsave
12116 @opindex mnomacsave
12117 Mark the @code{MAC} register as call-clobbered, even if
12118 @option{-mhitachi} is given.
12119
12120 @item -mieee
12121 @opindex mieee
12122 Increase IEEE-compliance of floating-point code.
12123 At the moment, this is equivalent to @option{-fno-finite-math-only}.
12124 When generating 16 bit SH opcodes, getting IEEE-conforming results for
12125 comparisons of NANs / infinities incurs extra overhead in every
12126 floating point comparison, therefore the default is set to
12127 @option{-ffinite-math-only}.
12128
12129 @item -misize
12130 @opindex misize
12131 Dump instruction size and location in the assembly code.
12132
12133 @item -mpadstruct
12134 @opindex mpadstruct
12135 This option is deprecated.  It pads structures to multiple of 4 bytes,
12136 which is incompatible with the SH ABI@.
12137
12138 @item -mspace
12139 @opindex mspace
12140 Optimize for space instead of speed.  Implied by @option{-Os}.
12141
12142 @item -mprefergot
12143 @opindex mprefergot
12144 When generating position-independent code, emit function calls using
12145 the Global Offset Table instead of the Procedure Linkage Table.
12146
12147 @item -musermode
12148 @opindex musermode
12149 Generate a library function call to invalidate instruction cache
12150 entries, after fixing up a trampoline.  This library function call
12151 doesn't assume it can write to the whole memory address space.  This
12152 is the default when the target is @code{sh-*-linux*}.
12153
12154 @item -multcost=@var{number}
12155 @opindex multcost=@var{number}
12156 Set the cost to assume for a multiply insn.
12157
12158 @item -mdiv=@var{strategy}
12159 @opindex mdiv=@var{strategy}
12160 Set the division strategy to use for SHmedia code.  @var{strategy} must be
12161 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
12162 inv:call2, inv:fp .
12163 "fp" performs the operation in floating point.  This has a very high latency,
12164 but needs only a few instructions, so it might be a good choice if
12165 your code has enough easily exploitable ILP to allow the compiler to
12166 schedule the floating point instructions together with other instructions.
12167 Division by zero causes a floating point exception.
12168 "inv" uses integer operations to calculate the inverse of the divisor,
12169 and then multiplies the dividend with the inverse.  This strategy allows
12170 cse and hoisting of the inverse calculation.  Division by zero calculates
12171 an unspecified result, but does not trap.
12172 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
12173 have been found, or if the entire operation has been hoisted to the same
12174 place, the last stages of the inverse calculation are intertwined with the
12175 final multiply to reduce the overall latency, at the expense of using a few
12176 more instructions, and thus offering fewer scheduling opportunities with
12177 other code.
12178 "call" calls a library function that usually implements the inv:minlat
12179 strategy.
12180 This gives high code density for m5-*media-nofpu compilations.
12181 "call2" uses a different entry point of the same library function, where it
12182 assumes that a pointer to a lookup table has already been set up, which
12183 exposes the pointer load to cse / code hoisting optimizations.
12184 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
12185 code generation, but if the code stays unoptimized, revert to the "call",
12186 "call2", or "fp" strategies, respectively.  Note that the
12187 potentially-trapping side effect of division by zero is carried by a
12188 separate instruction, so it is possible that all the integer instructions
12189 are hoisted out, but the marker for the side effect stays where it is.
12190 A recombination to fp operations or a call is not possible in that case.
12191 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
12192 that the inverse calculation was nor separated from the multiply, they speed
12193 up division where the dividend fits into 20 bits (plus sign where applicable),
12194 by inserting a test to skip a number of operations in this case; this test
12195 slows down the case of larger dividends.  inv20u assumes the case of a such
12196 a small dividend to be unlikely, and inv20l assumes it to be likely.
12197
12198 @item -mdivsi3_libfunc=@var{name}
12199 @opindex mdivsi3_libfunc=@var{name}
12200 Set the name of the library function used for 32 bit signed division to
12201 @var{name}.  This only affect the name used in the call and inv:call
12202 division strategies, and the compiler will still expect the same
12203 sets of input/output/clobbered registers as if this option was not present.
12204
12205 @item -madjust-unroll
12206 @opindex madjust-unroll
12207 Throttle unrolling to avoid thrashing target registers.
12208 This option only has an effect if the gcc code base supports the
12209 TARGET_ADJUST_UNROLL_MAX target hook.
12210
12211 @item -mindexed-addressing
12212 @opindex mindexed-addressing
12213 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
12214 This is only safe if the hardware and/or OS implement 32 bit wrap-around
12215 semantics for the indexed addressing mode.  The architecture allows the
12216 implementation of processors with 64 bit MMU, which the OS could use to
12217 get 32 bit addressing, but since no current hardware implementation supports
12218 this or any other way to make the indexed addressing mode safe to use in
12219 the 32 bit ABI, the default is -mno-indexed-addressing.
12220
12221 @item -mgettrcost=@var{number}
12222 @opindex mgettrcost=@var{number}
12223 Set the cost assumed for the gettr instruction to @var{number}.
12224 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
12225
12226 @item -mpt-fixed
12227 @opindex mpt-fixed
12228 Assume pt* instructions won't trap.  This will generally generate better
12229 scheduled code, but is unsafe on current hardware.  The current architecture
12230 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
12231 This has the unintentional effect of making it unsafe to schedule ptabs /
12232 ptrel before a branch, or hoist it out of a loop.  For example,
12233 __do_global_ctors, a part of libgcc that runs constructors at program
12234 startup, calls functions in a list which is delimited by -1.  With the
12235 -mpt-fixed option, the ptabs will be done before testing against -1.
12236 That means that all the constructors will be run a bit quicker, but when
12237 the loop comes to the end of the list, the program crashes because ptabs
12238 loads -1 into a target register.  Since this option is unsafe for any
12239 hardware implementing the current architecture specification, the default
12240 is -mno-pt-fixed.  Unless the user specifies a specific cost with
12241 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
12242 this deters register allocation using target registers for storing
12243 ordinary integers.
12244
12245 @item -minvalid-symbols
12246 @opindex minvalid-symbols
12247 Assume symbols might be invalid.  Ordinary function symbols generated by
12248 the compiler will always be valid to load with movi/shori/ptabs or
12249 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
12250 to generate symbols that will cause ptabs / ptrel to trap.
12251 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
12252 It will then prevent cross-basic-block cse, hoisting and most scheduling
12253 of symbol loads.  The default is @option{-mno-invalid-symbols}.
12254 @end table
12255
12256 @node SPARC Options
12257 @subsection SPARC Options
12258 @cindex SPARC options
12259
12260 These @samp{-m} options are supported on the SPARC:
12261
12262 @table @gcctabopt
12263 @item -mno-app-regs
12264 @itemx -mapp-regs
12265 @opindex mno-app-regs
12266 @opindex mapp-regs
12267 Specify @option{-mapp-regs} to generate output using the global registers
12268 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
12269 is the default.
12270
12271 To be fully SVR4 ABI compliant at the cost of some performance loss,
12272 specify @option{-mno-app-regs}.  You should compile libraries and system
12273 software with this option.
12274
12275 @item -mfpu
12276 @itemx -mhard-float
12277 @opindex mfpu
12278 @opindex mhard-float
12279 Generate output containing floating point instructions.  This is the
12280 default.
12281
12282 @item -mno-fpu
12283 @itemx -msoft-float
12284 @opindex mno-fpu
12285 @opindex msoft-float
12286 Generate output containing library calls for floating point.
12287 @strong{Warning:} the requisite libraries are not available for all SPARC
12288 targets.  Normally the facilities of the machine's usual C compiler are
12289 used, but this cannot be done directly in cross-compilation.  You must make
12290 your own arrangements to provide suitable library functions for
12291 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
12292 @samp{sparclite-*-*} do provide software floating point support.
12293
12294 @option{-msoft-float} changes the calling convention in the output file;
12295 therefore, it is only useful if you compile @emph{all} of a program with
12296 this option.  In particular, you need to compile @file{libgcc.a}, the
12297 library that comes with GCC, with @option{-msoft-float} in order for
12298 this to work.
12299
12300 @item -mhard-quad-float
12301 @opindex mhard-quad-float
12302 Generate output containing quad-word (long double) floating point
12303 instructions.
12304
12305 @item -msoft-quad-float
12306 @opindex msoft-quad-float
12307 Generate output containing library calls for quad-word (long double)
12308 floating point instructions.  The functions called are those specified
12309 in the SPARC ABI@.  This is the default.
12310
12311 As of this writing, there are no SPARC implementations that have hardware
12312 support for the quad-word floating point instructions.  They all invoke
12313 a trap handler for one of these instructions, and then the trap handler
12314 emulates the effect of the instruction.  Because of the trap handler overhead,
12315 this is much slower than calling the ABI library routines.  Thus the
12316 @option{-msoft-quad-float} option is the default.
12317
12318 @item -mno-unaligned-doubles
12319 @itemx -munaligned-doubles
12320 @opindex mno-unaligned-doubles
12321 @opindex munaligned-doubles
12322 Assume that doubles have 8 byte alignment.  This is the default.
12323
12324 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
12325 alignment only if they are contained in another type, or if they have an
12326 absolute address.  Otherwise, it assumes they have 4 byte alignment.
12327 Specifying this option avoids some rare compatibility problems with code
12328 generated by other compilers.  It is not the default because it results
12329 in a performance loss, especially for floating point code.
12330
12331 @item -mno-faster-structs
12332 @itemx -mfaster-structs
12333 @opindex mno-faster-structs
12334 @opindex mfaster-structs
12335 With @option{-mfaster-structs}, the compiler assumes that structures
12336 should have 8 byte alignment.  This enables the use of pairs of
12337 @code{ldd} and @code{std} instructions for copies in structure
12338 assignment, in place of twice as many @code{ld} and @code{st} pairs.
12339 However, the use of this changed alignment directly violates the SPARC
12340 ABI@.  Thus, it's intended only for use on targets where the developer
12341 acknowledges that their resulting code will not be directly in line with
12342 the rules of the ABI@.
12343
12344 @item -mimpure-text
12345 @opindex mimpure-text
12346 @option{-mimpure-text}, used in addition to @option{-shared}, tells
12347 the compiler to not pass @option{-z text} to the linker when linking a
12348 shared object.  Using this option, you can link position-dependent
12349 code into a shared object.
12350
12351 @option{-mimpure-text} suppresses the ``relocations remain against
12352 allocatable but non-writable sections'' linker error message.
12353 However, the necessary relocations will trigger copy-on-write, and the
12354 shared object is not actually shared across processes.  Instead of
12355 using @option{-mimpure-text}, you should compile all source code with
12356 @option{-fpic} or @option{-fPIC}.
12357
12358 This option is only available on SunOS and Solaris.
12359
12360 @item -mcpu=@var{cpu_type}
12361 @opindex mcpu
12362 Set the instruction set, register set, and instruction scheduling parameters
12363 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
12364 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
12365 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
12366 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
12367 @samp{ultrasparc3}, and @samp{niagara}.
12368
12369 Default instruction scheduling parameters are used for values that select
12370 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
12371 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
12372
12373 Here is a list of each supported architecture and their supported
12374 implementations.
12375
12376 @smallexample
12377     v7:             cypress
12378     v8:             supersparc, hypersparc
12379     sparclite:      f930, f934, sparclite86x
12380     sparclet:       tsc701
12381     v9:             ultrasparc, ultrasparc3, niagara
12382 @end smallexample
12383
12384 By default (unless configured otherwise), GCC generates code for the V7
12385 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
12386 additionally optimizes it for the Cypress CY7C602 chip, as used in the
12387 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
12388 SPARCStation 1, 2, IPX etc.
12389
12390 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
12391 architecture.  The only difference from V7 code is that the compiler emits
12392 the integer multiply and integer divide instructions which exist in SPARC-V8
12393 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
12394 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
12395 2000 series.
12396
12397 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
12398 the SPARC architecture.  This adds the integer multiply, integer divide step
12399 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
12400 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
12401 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
12402 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
12403 MB86934 chip, which is the more recent SPARClite with FPU@.
12404
12405 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
12406 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
12407 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
12408 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
12409 optimizes it for the TEMIC SPARClet chip.
12410
12411 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
12412 architecture.  This adds 64-bit integer and floating-point move instructions,
12413 3 additional floating-point condition code registers and conditional move
12414 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
12415 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
12416 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
12417 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
12418 @option{-mcpu=niagara}, the compiler additionally optimizes it for
12419 Sun UltraSPARC T1 chips.
12420
12421 @item -mtune=@var{cpu_type}
12422 @opindex mtune
12423 Set the instruction scheduling parameters for machine type
12424 @var{cpu_type}, but do not set the instruction set or register set that the
12425 option @option{-mcpu=@var{cpu_type}} would.
12426
12427 The same values for @option{-mcpu=@var{cpu_type}} can be used for
12428 @option{-mtune=@var{cpu_type}}, but the only useful values are those
12429 that select a particular cpu implementation.  Those are @samp{cypress},
12430 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
12431 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
12432 @samp{ultrasparc3}, and @samp{niagara}.
12433
12434 @item -mv8plus
12435 @itemx -mno-v8plus
12436 @opindex mv8plus
12437 @opindex mno-v8plus
12438 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
12439 difference from the V8 ABI is that the global and out registers are
12440 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
12441 mode for all SPARC-V9 processors.
12442
12443 @item -mvis
12444 @itemx -mno-vis
12445 @opindex mvis
12446 @opindex mno-vis
12447 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
12448 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
12449 @end table
12450
12451 These @samp{-m} options are supported in addition to the above
12452 on SPARC-V9 processors in 64-bit environments:
12453
12454 @table @gcctabopt
12455 @item -mlittle-endian
12456 @opindex mlittle-endian
12457 Generate code for a processor running in little-endian mode.  It is only
12458 available for a few configurations and most notably not on Solaris and Linux.
12459
12460 @item -m32
12461 @itemx -m64
12462 @opindex m32
12463 @opindex m64
12464 Generate code for a 32-bit or 64-bit environment.
12465 The 32-bit environment sets int, long and pointer to 32 bits.
12466 The 64-bit environment sets int to 32 bits and long and pointer
12467 to 64 bits.
12468
12469 @item -mcmodel=medlow
12470 @opindex mcmodel=medlow
12471 Generate code for the Medium/Low code model: 64-bit addresses, programs
12472 must be linked in the low 32 bits of memory.  Programs can be statically
12473 or dynamically linked.
12474
12475 @item -mcmodel=medmid
12476 @opindex mcmodel=medmid
12477 Generate code for the Medium/Middle code model: 64-bit addresses, programs
12478 must be linked in the low 44 bits of memory, the text and data segments must
12479 be less than 2GB in size and the data segment must be located within 2GB of
12480 the text segment.
12481
12482 @item -mcmodel=medany
12483 @opindex mcmodel=medany
12484 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
12485 may be linked anywhere in memory, the text and data segments must be less
12486 than 2GB in size and the data segment must be located within 2GB of the
12487 text segment.
12488
12489 @item -mcmodel=embmedany
12490 @opindex mcmodel=embmedany
12491 Generate code for the Medium/Anywhere code model for embedded systems:
12492 64-bit addresses, the text and data segments must be less than 2GB in
12493 size, both starting anywhere in memory (determined at link time).  The
12494 global register %g4 points to the base of the data segment.  Programs
12495 are statically linked and PIC is not supported.
12496
12497 @item -mstack-bias
12498 @itemx -mno-stack-bias
12499 @opindex mstack-bias
12500 @opindex mno-stack-bias
12501 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
12502 frame pointer if present, are offset by @minus{}2047 which must be added back
12503 when making stack frame references.  This is the default in 64-bit mode.
12504 Otherwise, assume no such offset is present.
12505 @end table
12506
12507 These switches are supported in addition to the above on Solaris:
12508
12509 @table @gcctabopt
12510 @item -threads
12511 @opindex threads
12512 Add support for multithreading using the Solaris threads library.  This
12513 option sets flags for both the preprocessor and linker.  This option does
12514 not affect the thread safety of object code produced by the compiler or
12515 that of libraries supplied with it.
12516
12517 @item -pthreads
12518 @opindex pthreads
12519 Add support for multithreading using the POSIX threads library.  This
12520 option sets flags for both the preprocessor and linker.  This option does
12521 not affect the thread safety of object code produced  by the compiler or
12522 that of libraries supplied with it.
12523
12524 @item -pthread
12525 @opindex pthread
12526 This is a synonym for @option{-pthreads}.
12527 @end table
12528
12529 @node System V Options
12530 @subsection Options for System V
12531
12532 These additional options are available on System V Release 4 for
12533 compatibility with other compilers on those systems:
12534
12535 @table @gcctabopt
12536 @item -G
12537 @opindex G
12538 Create a shared object.
12539 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
12540
12541 @item -Qy
12542 @opindex Qy
12543 Identify the versions of each tool used by the compiler, in a
12544 @code{.ident} assembler directive in the output.
12545
12546 @item -Qn
12547 @opindex Qn
12548 Refrain from adding @code{.ident} directives to the output file (this is
12549 the default).
12550
12551 @item -YP,@var{dirs}
12552 @opindex YP
12553 Search the directories @var{dirs}, and no others, for libraries
12554 specified with @option{-l}.
12555
12556 @item -Ym,@var{dir}
12557 @opindex Ym
12558 Look in the directory @var{dir} to find the M4 preprocessor.
12559 The assembler uses this option.
12560 @c This is supposed to go with a -Yd for predefined M4 macro files, but
12561 @c the generic assembler that comes with Solaris takes just -Ym.
12562 @end table
12563
12564 @node TMS320C3x/C4x Options
12565 @subsection TMS320C3x/C4x Options
12566 @cindex TMS320C3x/C4x Options
12567
12568 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
12569
12570 @table @gcctabopt
12571
12572 @item -mcpu=@var{cpu_type}
12573 @opindex mcpu
12574 Set the instruction set, register set, and instruction scheduling
12575 parameters for machine type @var{cpu_type}.  Supported values for
12576 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
12577 @samp{c44}.  The default is @samp{c40} to generate code for the
12578 TMS320C40.
12579
12580 @item -mbig-memory
12581 @itemx -mbig
12582 @itemx -msmall-memory
12583 @itemx -msmall
12584 @opindex mbig-memory
12585 @opindex mbig
12586 @opindex msmall-memory
12587 @opindex msmall
12588 Generates code for the big or small memory model.  The small memory
12589 model assumed that all data fits into one 64K word page.  At run-time
12590 the data page (DP) register must be set to point to the 64K page
12591 containing the .bss and .data program sections.  The big memory model is
12592 the default and requires reloading of the DP register for every direct
12593 memory access.
12594
12595 @item -mbk
12596 @itemx -mno-bk
12597 @opindex mbk
12598 @opindex mno-bk
12599 Allow (disallow) allocation of general integer operands into the block
12600 count register BK@.
12601
12602 @item -mdb
12603 @itemx -mno-db
12604 @opindex mdb
12605 @opindex mno-db
12606 Enable (disable) generation of code using decrement and branch,
12607 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
12608 on the safe side, this is disabled for the C3x, since the maximum
12609 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
12610 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
12611 that it can utilize the decrement and branch instruction, but will give
12612 up if there is more than one memory reference in the loop.  Thus a loop
12613 where the loop counter is decremented can generate slightly more
12614 efficient code, in cases where the RPTB instruction cannot be utilized.
12615
12616 @item -mdp-isr-reload
12617 @itemx -mparanoid
12618 @opindex mdp-isr-reload
12619 @opindex mparanoid
12620 Force the DP register to be saved on entry to an interrupt service
12621 routine (ISR), reloaded to point to the data section, and restored on
12622 exit from the ISR@.  This should not be required unless someone has
12623 violated the small memory model by modifying the DP register, say within
12624 an object library.
12625
12626 @item -mmpyi
12627 @itemx -mno-mpyi
12628 @opindex mmpyi
12629 @opindex mno-mpyi
12630 For the C3x use the 24-bit MPYI instruction for integer multiplies
12631 instead of a library call to guarantee 32-bit results.  Note that if one
12632 of the operands is a constant, then the multiplication will be performed
12633 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
12634 then squaring operations are performed inline instead of a library call.
12635
12636 @item -mfast-fix
12637 @itemx -mno-fast-fix
12638 @opindex mfast-fix
12639 @opindex mno-fast-fix
12640 The C3x/C4x FIX instruction to convert a floating point value to an
12641 integer value chooses the nearest integer less than or equal to the
12642 floating point value rather than to the nearest integer.  Thus if the
12643 floating point number is negative, the result will be incorrectly
12644 truncated an additional code is necessary to detect and correct this
12645 case.  This option can be used to disable generation of the additional
12646 code required to correct the result.
12647
12648 @item -mrptb
12649 @itemx -mno-rptb
12650 @opindex mrptb
12651 @opindex mno-rptb
12652 Enable (disable) generation of repeat block sequences using the RPTB
12653 instruction for zero overhead looping.  The RPTB construct is only used
12654 for innermost loops that do not call functions or jump across the loop
12655 boundaries.  There is no advantage having nested RPTB loops due to the
12656 overhead required to save and restore the RC, RS, and RE registers.
12657 This is enabled by default with @option{-O2}.
12658
12659 @item -mrpts=@var{count}
12660 @itemx -mno-rpts
12661 @opindex mrpts
12662 @opindex mno-rpts
12663 Enable (disable) the use of the single instruction repeat instruction
12664 RPTS@.  If a repeat block contains a single instruction, and the loop
12665 count can be guaranteed to be less than the value @var{count}, GCC will
12666 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
12667 then a RPTS will be emitted even if the loop count cannot be determined
12668 at compile time.  Note that the repeated instruction following RPTS does
12669 not have to be reloaded from memory each iteration, thus freeing up the
12670 CPU buses for operands.  However, since interrupts are blocked by this
12671 instruction, it is disabled by default.
12672
12673 @item -mloop-unsigned
12674 @itemx -mno-loop-unsigned
12675 @opindex mloop-unsigned
12676 @opindex mno-loop-unsigned
12677 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
12678 is @math{2^{31} + 1} since these instructions test if the iteration count is
12679 negative to terminate the loop.  If the iteration count is unsigned
12680 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
12681 exceeded.  This switch allows an unsigned iteration count.
12682
12683 @item -mti
12684 @opindex mti
12685 Try to emit an assembler syntax that the TI assembler (asm30) is happy
12686 with.  This also enforces compatibility with the API employed by the TI
12687 C3x C compiler.  For example, long doubles are passed as structures
12688 rather than in floating point registers.
12689
12690 @item -mregparm
12691 @itemx -mmemparm
12692 @opindex mregparm
12693 @opindex mmemparm
12694 Generate code that uses registers (stack) for passing arguments to functions.
12695 By default, arguments are passed in registers where possible rather
12696 than by pushing arguments on to the stack.
12697
12698 @item -mparallel-insns
12699 @itemx -mno-parallel-insns
12700 @opindex mparallel-insns
12701 @opindex mno-parallel-insns
12702 Allow the generation of parallel instructions.  This is enabled by
12703 default with @option{-O2}.
12704
12705 @item -mparallel-mpy
12706 @itemx -mno-parallel-mpy
12707 @opindex mparallel-mpy
12708 @opindex mno-parallel-mpy
12709 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
12710 provided @option{-mparallel-insns} is also specified.  These instructions have
12711 tight register constraints which can pessimize the code generation
12712 of large functions.
12713
12714 @end table
12715
12716 @node V850 Options
12717 @subsection V850 Options
12718 @cindex V850 Options
12719
12720 These @samp{-m} options are defined for V850 implementations:
12721
12722 @table @gcctabopt
12723 @item -mlong-calls
12724 @itemx -mno-long-calls
12725 @opindex mlong-calls
12726 @opindex mno-long-calls
12727 Treat all calls as being far away (near).  If calls are assumed to be
12728 far away, the compiler will always load the functions address up into a
12729 register, and call indirect through the pointer.
12730
12731 @item -mno-ep
12732 @itemx -mep
12733 @opindex mno-ep
12734 @opindex mep
12735 Do not optimize (do optimize) basic blocks that use the same index
12736 pointer 4 or more times to copy pointer into the @code{ep} register, and
12737 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
12738 option is on by default if you optimize.
12739
12740 @item -mno-prolog-function
12741 @itemx -mprolog-function
12742 @opindex mno-prolog-function
12743 @opindex mprolog-function
12744 Do not use (do use) external functions to save and restore registers
12745 at the prologue and epilogue of a function.  The external functions
12746 are slower, but use less code space if more than one function saves
12747 the same number of registers.  The @option{-mprolog-function} option
12748 is on by default if you optimize.
12749
12750 @item -mspace
12751 @opindex mspace
12752 Try to make the code as small as possible.  At present, this just turns
12753 on the @option{-mep} and @option{-mprolog-function} options.
12754
12755 @item -mtda=@var{n}
12756 @opindex mtda
12757 Put static or global variables whose size is @var{n} bytes or less into
12758 the tiny data area that register @code{ep} points to.  The tiny data
12759 area can hold up to 256 bytes in total (128 bytes for byte references).
12760
12761 @item -msda=@var{n}
12762 @opindex msda
12763 Put static or global variables whose size is @var{n} bytes or less into
12764 the small data area that register @code{gp} points to.  The small data
12765 area can hold up to 64 kilobytes.
12766
12767 @item -mzda=@var{n}
12768 @opindex mzda
12769 Put static or global variables whose size is @var{n} bytes or less into
12770 the first 32 kilobytes of memory.
12771
12772 @item -mv850
12773 @opindex mv850
12774 Specify that the target processor is the V850.
12775
12776 @item -mbig-switch
12777 @opindex mbig-switch
12778 Generate code suitable for big switch tables.  Use this option only if
12779 the assembler/linker complain about out of range branches within a switch
12780 table.
12781
12782 @item -mapp-regs
12783 @opindex mapp-regs
12784 This option will cause r2 and r5 to be used in the code generated by
12785 the compiler.  This setting is the default.
12786
12787 @item -mno-app-regs
12788 @opindex mno-app-regs
12789 This option will cause r2 and r5 to be treated as fixed registers.
12790
12791 @item -mv850e1
12792 @opindex mv850e1
12793 Specify that the target processor is the V850E1.  The preprocessor
12794 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
12795 this option is used.
12796
12797 @item -mv850e
12798 @opindex mv850e
12799 Specify that the target processor is the V850E@.  The preprocessor
12800 constant @samp{__v850e__} will be defined if this option is used.
12801
12802 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
12803 are defined then a default target processor will be chosen and the
12804 relevant @samp{__v850*__} preprocessor constant will be defined.
12805
12806 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
12807 defined, regardless of which processor variant is the target.
12808
12809 @item -mdisable-callt
12810 @opindex mdisable-callt
12811 This option will suppress generation of the CALLT instruction for the
12812 v850e and v850e1 flavors of the v850 architecture.  The default is
12813 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
12814
12815 @end table
12816
12817 @node VAX Options
12818 @subsection VAX Options
12819 @cindex VAX options
12820
12821 These @samp{-m} options are defined for the VAX:
12822
12823 @table @gcctabopt
12824 @item -munix
12825 @opindex munix
12826 Do not output certain jump instructions (@code{aobleq} and so on)
12827 that the Unix assembler for the VAX cannot handle across long
12828 ranges.
12829
12830 @item -mgnu
12831 @opindex mgnu
12832 Do output those jump instructions, on the assumption that you
12833 will assemble with the GNU assembler.
12834
12835 @item -mg
12836 @opindex mg
12837 Output code for g-format floating point numbers instead of d-format.
12838 @end table
12839
12840 @node x86-64 Options
12841 @subsection x86-64 Options
12842 @cindex x86-64 options
12843
12844 These are listed under @xref{i386 and x86-64 Options}.
12845
12846 @node Xstormy16 Options
12847 @subsection Xstormy16 Options
12848 @cindex Xstormy16 Options
12849
12850 These options are defined for Xstormy16:
12851
12852 @table @gcctabopt
12853 @item -msim
12854 @opindex msim
12855 Choose startup files and linker script suitable for the simulator.
12856 @end table
12857
12858 @node Xtensa Options
12859 @subsection Xtensa Options
12860 @cindex Xtensa Options
12861
12862 These options are supported for Xtensa targets:
12863
12864 @table @gcctabopt
12865 @item -mconst16
12866 @itemx -mno-const16
12867 @opindex mconst16
12868 @opindex mno-const16
12869 Enable or disable use of @code{CONST16} instructions for loading
12870 constant values.  The @code{CONST16} instruction is currently not a
12871 standard option from Tensilica.  When enabled, @code{CONST16}
12872 instructions are always used in place of the standard @code{L32R}
12873 instructions.  The use of @code{CONST16} is enabled by default only if
12874 the @code{L32R} instruction is not available.
12875
12876 @item -mfused-madd
12877 @itemx -mno-fused-madd
12878 @opindex mfused-madd
12879 @opindex mno-fused-madd
12880 Enable or disable use of fused multiply/add and multiply/subtract
12881 instructions in the floating-point option.  This has no effect if the
12882 floating-point option is not also enabled.  Disabling fused multiply/add
12883 and multiply/subtract instructions forces the compiler to use separate
12884 instructions for the multiply and add/subtract operations.  This may be
12885 desirable in some cases where strict IEEE 754-compliant results are
12886 required: the fused multiply add/subtract instructions do not round the
12887 intermediate result, thereby producing results with @emph{more} bits of
12888 precision than specified by the IEEE standard.  Disabling fused multiply
12889 add/subtract instructions also ensures that the program output is not
12890 sensitive to the compiler's ability to combine multiply and add/subtract
12891 operations.
12892
12893 @item -mtext-section-literals
12894 @itemx -mno-text-section-literals
12895 @opindex mtext-section-literals
12896 @opindex mno-text-section-literals
12897 Control the treatment of literal pools.  The default is
12898 @option{-mno-text-section-literals}, which places literals in a separate
12899 section in the output file.  This allows the literal pool to be placed
12900 in a data RAM/ROM, and it also allows the linker to combine literal
12901 pools from separate object files to remove redundant literals and
12902 improve code size.  With @option{-mtext-section-literals}, the literals
12903 are interspersed in the text section in order to keep them as close as
12904 possible to their references.  This may be necessary for large assembly
12905 files.
12906
12907 @item -mtarget-align
12908 @itemx -mno-target-align
12909 @opindex mtarget-align
12910 @opindex mno-target-align
12911 When this option is enabled, GCC instructs the assembler to
12912 automatically align instructions to reduce branch penalties at the
12913 expense of some code density.  The assembler attempts to widen density
12914 instructions to align branch targets and the instructions following call
12915 instructions.  If there are not enough preceding safe density
12916 instructions to align a target, no widening will be performed.  The
12917 default is @option{-mtarget-align}.  These options do not affect the
12918 treatment of auto-aligned instructions like @code{LOOP}, which the
12919 assembler will always align, either by widening density instructions or
12920 by inserting no-op instructions.
12921
12922 @item -mlongcalls
12923 @itemx -mno-longcalls
12924 @opindex mlongcalls
12925 @opindex mno-longcalls
12926 When this option is enabled, GCC instructs the assembler to translate
12927 direct calls to indirect calls unless it can determine that the target
12928 of a direct call is in the range allowed by the call instruction.  This
12929 translation typically occurs for calls to functions in other source
12930 files.  Specifically, the assembler translates a direct @code{CALL}
12931 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
12932 The default is @option{-mno-longcalls}.  This option should be used in
12933 programs where the call target can potentially be out of range.  This
12934 option is implemented in the assembler, not the compiler, so the
12935 assembly code generated by GCC will still show direct call
12936 instructions---look at the disassembled object code to see the actual
12937 instructions.  Note that the assembler will use an indirect call for
12938 every cross-file call, not just those that really will be out of range.
12939 @end table
12940
12941 @node zSeries Options
12942 @subsection zSeries Options
12943 @cindex zSeries options
12944
12945 These are listed under @xref{S/390 and zSeries Options}.
12946
12947 @node Code Gen Options
12948 @section Options for Code Generation Conventions
12949 @cindex code generation conventions
12950 @cindex options, code generation
12951 @cindex run-time options
12952
12953 These machine-independent options control the interface conventions
12954 used in code generation.
12955
12956 Most of them have both positive and negative forms; the negative form
12957 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
12958 one of the forms is listed---the one which is not the default.  You
12959 can figure out the other form by either removing @samp{no-} or adding
12960 it.
12961
12962 @table @gcctabopt
12963 @item -fbounds-check
12964 @opindex fbounds-check
12965 For front-ends that support it, generate additional code to check that
12966 indices used to access arrays are within the declared range.  This is
12967 currently only supported by the Java and Fortran front-ends, where
12968 this option defaults to true and false respectively.
12969
12970 @item -ftrapv
12971 @opindex ftrapv
12972 This option generates traps for signed overflow on addition, subtraction,
12973 multiplication operations.
12974
12975 @item -fwrapv
12976 @opindex fwrapv
12977 This option instructs the compiler to assume that signed arithmetic
12978 overflow of addition, subtraction and multiplication wraps around
12979 using twos-complement representation.  This flag enables some optimizations
12980 and disables others.  This option is enabled by default for the Java
12981 front-end, as required by the Java language specification.
12982
12983 @item -fexceptions
12984 @opindex fexceptions
12985 Enable exception handling.  Generates extra code needed to propagate
12986 exceptions.  For some targets, this implies GCC will generate frame
12987 unwind information for all functions, which can produce significant data
12988 size overhead, although it does not affect execution.  If you do not
12989 specify this option, GCC will enable it by default for languages like
12990 C++ which normally require exception handling, and disable it for
12991 languages like C that do not normally require it.  However, you may need
12992 to enable this option when compiling C code that needs to interoperate
12993 properly with exception handlers written in C++.  You may also wish to
12994 disable this option if you are compiling older C++ programs that don't
12995 use exception handling.
12996
12997 @item -fnon-call-exceptions
12998 @opindex fnon-call-exceptions
12999 Generate code that allows trapping instructions to throw exceptions.
13000 Note that this requires platform-specific runtime support that does
13001 not exist everywhere.  Moreover, it only allows @emph{trapping}
13002 instructions to throw exceptions, i.e.@: memory references or floating
13003 point instructions.  It does not allow exceptions to be thrown from
13004 arbitrary signal handlers such as @code{SIGALRM}.
13005
13006 @item -funwind-tables
13007 @opindex funwind-tables
13008 Similar to @option{-fexceptions}, except that it will just generate any needed
13009 static data, but will not affect the generated code in any other way.
13010 You will normally not enable this option; instead, a language processor
13011 that needs this handling would enable it on your behalf.
13012
13013 @item -fasynchronous-unwind-tables
13014 @opindex fasynchronous-unwind-tables
13015 Generate unwind table in dwarf2 format, if supported by target machine.  The
13016 table is exact at each instruction boundary, so it can be used for stack
13017 unwinding from asynchronous events (such as debugger or garbage collector).
13018
13019 @item -fpcc-struct-return
13020 @opindex fpcc-struct-return
13021 Return ``short'' @code{struct} and @code{union} values in memory like
13022 longer ones, rather than in registers.  This convention is less
13023 efficient, but it has the advantage of allowing intercallability between
13024 GCC-compiled files and files compiled with other compilers, particularly
13025 the Portable C Compiler (pcc).
13026
13027 The precise convention for returning structures in memory depends
13028 on the target configuration macros.
13029
13030 Short structures and unions are those whose size and alignment match
13031 that of some integer type.
13032
13033 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13034 switch is not binary compatible with code compiled with the
13035 @option{-freg-struct-return} switch.
13036 Use it to conform to a non-default application binary interface.
13037
13038 @item -freg-struct-return
13039 @opindex freg-struct-return
13040 Return @code{struct} and @code{union} values in registers when possible.
13041 This is more efficient for small structures than
13042 @option{-fpcc-struct-return}.
13043
13044 If you specify neither @option{-fpcc-struct-return} nor
13045 @option{-freg-struct-return}, GCC defaults to whichever convention is
13046 standard for the target.  If there is no standard convention, GCC
13047 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
13048 the principal compiler.  In those cases, we can choose the standard, and
13049 we chose the more efficient register return alternative.
13050
13051 @strong{Warning:} code compiled with the @option{-freg-struct-return}
13052 switch is not binary compatible with code compiled with the
13053 @option{-fpcc-struct-return} switch.
13054 Use it to conform to a non-default application binary interface.
13055
13056 @item -fshort-enums
13057 @opindex fshort-enums
13058 Allocate to an @code{enum} type only as many bytes as it needs for the
13059 declared range of possible values.  Specifically, the @code{enum} type
13060 will be equivalent to the smallest integer type which has enough room.
13061
13062 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
13063 code that is not binary compatible with code generated without that switch.
13064 Use it to conform to a non-default application binary interface.
13065
13066 @item -fshort-double
13067 @opindex fshort-double
13068 Use the same size for @code{double} as for @code{float}.
13069
13070 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
13071 code that is not binary compatible with code generated without that switch.
13072 Use it to conform to a non-default application binary interface.
13073
13074 @item -fshort-wchar
13075 @opindex fshort-wchar
13076 Override the underlying type for @samp{wchar_t} to be @samp{short
13077 unsigned int} instead of the default for the target.  This option is
13078 useful for building programs to run under WINE@.
13079
13080 @strong{Warning:} the @option{-fshort-wchar} 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 -fno-common
13085 @opindex fno-common
13086 In C, allocate even uninitialized global variables in the data section of the
13087 object file, rather than generating them as common blocks.  This has the
13088 effect that if the same variable is declared (without @code{extern}) in
13089 two different compilations, you will get an error when you link them.
13090 The only reason this might be useful is if you wish to verify that the
13091 program will work on other systems which always work this way.
13092
13093 @item -fno-ident
13094 @opindex fno-ident
13095 Ignore the @samp{#ident} directive.
13096
13097 @item -finhibit-size-directive
13098 @opindex finhibit-size-directive
13099 Don't output a @code{.size} assembler directive, or anything else that
13100 would cause trouble if the function is split in the middle, and the
13101 two halves are placed at locations far apart in memory.  This option is
13102 used when compiling @file{crtstuff.c}; you should not need to use it
13103 for anything else.
13104
13105 @item -fverbose-asm
13106 @opindex fverbose-asm
13107 Put extra commentary information in the generated assembly code to
13108 make it more readable.  This option is generally only of use to those
13109 who actually need to read the generated assembly code (perhaps while
13110 debugging the compiler itself).
13111
13112 @option{-fno-verbose-asm}, the default, causes the
13113 extra information to be omitted and is useful when comparing two assembler
13114 files.
13115
13116 @item -fpic
13117 @opindex fpic
13118 @cindex global offset table
13119 @cindex PIC
13120 Generate position-independent code (PIC) suitable for use in a shared
13121 library, if supported for the target machine.  Such code accesses all
13122 constant addresses through a global offset table (GOT)@.  The dynamic
13123 loader resolves the GOT entries when the program starts (the dynamic
13124 loader is not part of GCC; it is part of the operating system).  If
13125 the GOT size for the linked executable exceeds a machine-specific
13126 maximum size, you get an error message from the linker indicating that
13127 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
13128 instead.  (These maximums are 8k on the SPARC and 32k
13129 on the m68k and RS/6000.  The 386 has no such limit.)
13130
13131 Position-independent code requires special support, and therefore works
13132 only on certain machines.  For the 386, GCC supports PIC for System V
13133 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
13134 position-independent.
13135
13136 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13137 are defined to 1.
13138
13139 @item -fPIC
13140 @opindex fPIC
13141 If supported for the target machine, emit position-independent code,
13142 suitable for dynamic linking and avoiding any limit on the size of the
13143 global offset table.  This option makes a difference on the m68k,
13144 PowerPC and SPARC@.
13145
13146 Position-independent code requires special support, and therefore works
13147 only on certain machines.
13148
13149 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13150 are defined to 2.
13151
13152 @item -fpie
13153 @itemx -fPIE
13154 @opindex fpie
13155 @opindex fPIE
13156 These options are similar to @option{-fpic} and @option{-fPIC}, but
13157 generated position independent code can be only linked into executables.
13158 Usually these options are used when @option{-pie} GCC option will be
13159 used during linking.
13160
13161 @item -fno-jump-tables
13162 @opindex fno-jump-tables
13163 Do not use jump tables for switch statements even where it would be
13164 more efficient than other code generation strategies.  This option is
13165 of use in conjunction with @option{-fpic} or @option{-fPIC} for
13166 building code which forms part of a dynamic linker and cannot
13167 reference the address of a jump table.  On some targets, jump tables
13168 do not require a GOT and this option is not needed.
13169
13170 @item -ffixed-@var{reg}
13171 @opindex ffixed
13172 Treat the register named @var{reg} as a fixed register; generated code
13173 should never refer to it (except perhaps as a stack pointer, frame
13174 pointer or in some other fixed role).
13175
13176 @var{reg} must be the name of a register.  The register names accepted
13177 are machine-specific and are defined in the @code{REGISTER_NAMES}
13178 macro in the machine description macro file.
13179
13180 This flag does not have a negative form, because it specifies a
13181 three-way choice.
13182
13183 @item -fcall-used-@var{reg}
13184 @opindex fcall-used
13185 Treat the register named @var{reg} as an allocable register that is
13186 clobbered by function calls.  It may be allocated for temporaries or
13187 variables that do not live across a call.  Functions compiled this way
13188 will not save and restore the register @var{reg}.
13189
13190 It is an error to used this flag with the frame pointer or stack pointer.
13191 Use of this flag for other registers that have fixed pervasive roles in
13192 the machine's execution model will produce disastrous results.
13193
13194 This flag does not have a negative form, because it specifies a
13195 three-way choice.
13196
13197 @item -fcall-saved-@var{reg}
13198 @opindex fcall-saved
13199 Treat the register named @var{reg} as an allocable register saved by
13200 functions.  It may be allocated even for temporaries or variables that
13201 live across a call.  Functions compiled this way will save and restore
13202 the register @var{reg} if they use it.
13203
13204 It is an error to used this flag with the frame pointer or stack pointer.
13205 Use of this flag for other registers that have fixed pervasive roles in
13206 the machine's execution model will produce disastrous results.
13207
13208 A different sort of disaster will result from the use of this flag for
13209 a register in which function values may be returned.
13210
13211 This flag does not have a negative form, because it specifies a
13212 three-way choice.
13213
13214 @item -fpack-struct[=@var{n}]
13215 @opindex fpack-struct
13216 Without a value specified, pack all structure members together without
13217 holes.  When a value is specified (which must be a small power of two), pack
13218 structure members according to this value, representing the maximum
13219 alignment (that is, objects with default alignment requirements larger than
13220 this will be output potentially unaligned at the next fitting location.
13221
13222 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
13223 code that is not binary compatible with code generated without that switch.
13224 Additionally, it makes the code suboptimal.
13225 Use it to conform to a non-default application binary interface.
13226
13227 @item -finstrument-functions
13228 @opindex finstrument-functions
13229 Generate instrumentation calls for entry and exit to functions.  Just
13230 after function entry and just before function exit, the following
13231 profiling functions will be called with the address of the current
13232 function and its call site.  (On some platforms,
13233 @code{__builtin_return_address} does not work beyond the current
13234 function, so the call site information may not be available to the
13235 profiling functions otherwise.)
13236
13237 @smallexample
13238 void __cyg_profile_func_enter (void *this_fn,
13239                                void *call_site);
13240 void __cyg_profile_func_exit  (void *this_fn,
13241                                void *call_site);
13242 @end smallexample
13243
13244 The first argument is the address of the start of the current function,
13245 which may be looked up exactly in the symbol table.
13246
13247 This instrumentation is also done for functions expanded inline in other
13248 functions.  The profiling calls will indicate where, conceptually, the
13249 inline function is entered and exited.  This means that addressable
13250 versions of such functions must be available.  If all your uses of a
13251 function are expanded inline, this may mean an additional expansion of
13252 code size.  If you use @samp{extern inline} in your C code, an
13253 addressable version of such functions must be provided.  (This is
13254 normally the case anyways, but if you get lucky and the optimizer always
13255 expands the functions inline, you might have gotten away without
13256 providing static copies.)
13257
13258 A function may be given the attribute @code{no_instrument_function}, in
13259 which case this instrumentation will not be done.  This can be used, for
13260 example, for the profiling functions listed above, high-priority
13261 interrupt routines, and any functions from which the profiling functions
13262 cannot safely be called (perhaps signal handlers, if the profiling
13263 routines generate output or allocate memory).
13264
13265 @item -fstack-check
13266 @opindex fstack-check
13267 Generate code to verify that you do not go beyond the boundary of the
13268 stack.  You should specify this flag if you are running in an
13269 environment with multiple threads, but only rarely need to specify it in
13270 a single-threaded environment since stack overflow is automatically
13271 detected on nearly all systems if there is only one stack.
13272
13273 Note that this switch does not actually cause checking to be done; the
13274 operating system must do that.  The switch causes generation of code
13275 to ensure that the operating system sees the stack being extended.
13276
13277 @item -fstack-limit-register=@var{reg}
13278 @itemx -fstack-limit-symbol=@var{sym}
13279 @itemx -fno-stack-limit
13280 @opindex fstack-limit-register
13281 @opindex fstack-limit-symbol
13282 @opindex fno-stack-limit
13283 Generate code to ensure that the stack does not grow beyond a certain value,
13284 either the value of a register or the address of a symbol.  If the stack
13285 would grow beyond the value, a signal is raised.  For most targets,
13286 the signal is raised before the stack overruns the boundary, so
13287 it is possible to catch the signal without taking special precautions.
13288
13289 For instance, if the stack starts at absolute address @samp{0x80000000}
13290 and grows downwards, you can use the flags
13291 @option{-fstack-limit-symbol=__stack_limit} and
13292 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
13293 of 128KB@.  Note that this may only work with the GNU linker.
13294
13295 @cindex aliasing of parameters
13296 @cindex parameters, aliased
13297 @item -fargument-alias
13298 @itemx -fargument-noalias
13299 @itemx -fargument-noalias-global
13300 @itemx -fargument-noalias-anything
13301 @opindex fargument-alias
13302 @opindex fargument-noalias
13303 @opindex fargument-noalias-global
13304 @opindex fargument-noalias-anything
13305 Specify the possible relationships among parameters and between
13306 parameters and global data.
13307
13308 @option{-fargument-alias} specifies that arguments (parameters) may
13309 alias each other and may alias global storage.@*
13310 @option{-fargument-noalias} specifies that arguments do not alias
13311 each other, but may alias global storage.@*
13312 @option{-fargument-noalias-global} specifies that arguments do not
13313 alias each other and do not alias global storage.
13314 @option{-fargument-noalias-anything} specifies that arguments do not
13315 alias any other storage.
13316
13317 Each language will automatically use whatever option is required by
13318 the language standard.  You should not need to use these options yourself.
13319
13320 @item -fleading-underscore
13321 @opindex fleading-underscore
13322 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
13323 change the way C symbols are represented in the object file.  One use
13324 is to help link with legacy assembly code.
13325
13326 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
13327 generate code that is not binary compatible with code generated without that
13328 switch.  Use it to conform to a non-default application binary interface.
13329 Not all targets provide complete support for this switch.
13330
13331 @item -ftls-model=@var{model}
13332 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
13333 The @var{model} argument should be one of @code{global-dynamic},
13334 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
13335
13336 The default without @option{-fpic} is @code{initial-exec}; with
13337 @option{-fpic} the default is @code{global-dynamic}.
13338
13339 @item -fvisibility=@var{default|internal|hidden|protected}
13340 @opindex fvisibility
13341 Set the default ELF image symbol visibility to the specified option---all
13342 symbols will be marked with this unless overridden within the code.
13343 Using this feature can very substantially improve linking and
13344 load times of shared object libraries, produce more optimized
13345 code, provide near-perfect API export and prevent symbol clashes.
13346 It is @strong{strongly} recommended that you use this in any shared objects
13347 you distribute.
13348
13349 Despite the nomenclature, @code{default} always means public ie;
13350 available to be linked against from outside the shared object.
13351 @code{protected} and @code{internal} are pretty useless in real-world
13352 usage so the only other commonly used option will be @code{hidden}.
13353 The default if @option{-fvisibility} isn't specified is
13354 @code{default}, i.e., make every
13355 symbol public---this causes the same behavior as previous versions of
13356 GCC@.
13357
13358 A good explanation of the benefits offered by ensuring ELF
13359 symbols have the correct visibility is given by ``How To Write
13360 Shared Libraries'' by Ulrich Drepper (which can be found at
13361 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
13362 solution made possible by this option to marking things hidden when
13363 the default is public is to make the default hidden and mark things
13364 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
13365 and @code{__attribute__ ((visibility("default")))} instead of
13366 @code{__declspec(dllexport)} you get almost identical semantics with
13367 identical syntax.  This is a great boon to those working with
13368 cross-platform projects.
13369
13370 For those adding visibility support to existing code, you may find
13371 @samp{#pragma GCC visibility} of use.  This works by you enclosing
13372 the declarations you wish to set visibility for with (for example)
13373 @samp{#pragma GCC visibility push(hidden)} and
13374 @samp{#pragma GCC visibility pop}.
13375 Bear in mind that symbol visibility should be viewed @strong{as
13376 part of the API interface contract} and thus all new code should
13377 always specify visibility when it is not the default ie; declarations
13378 only for use within the local DSO should @strong{always} be marked explicitly
13379 as hidden as so to avoid PLT indirection overheads---making this
13380 abundantly clear also aids readability and self-documentation of the code.
13381 Note that due to ISO C++ specification requirements, operator new and
13382 operator delete must always be of default visibility.
13383
13384 Be aware that headers from outside your project, in particular system
13385 headers and headers from any other library you use, may not be
13386 expecting to be compiled with visibility other than the default.  You
13387 may need to explicitly say @samp{#pragma GCC visibility push(default)}
13388 before including any such headers.
13389
13390 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
13391 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
13392 no modifications.  However, this means that calls to @samp{extern}
13393 functions with no explicit visibility will use the PLT, so it is more
13394 effective to use @samp{__attribute ((visibility))} and/or
13395 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
13396 declarations should be treated as hidden.
13397
13398 Note that @samp{-fvisibility} does affect C++ vague linkage
13399 entities. This means that, for instance, an exception class that will
13400 be thrown between DSOs must be explicitly marked with default
13401 visibility so that the @samp{type_info} nodes will be unified between
13402 the DSOs.
13403
13404 An overview of these techniques, their benefits and how to use them
13405 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
13406
13407 @end table
13408
13409 @c man end
13410
13411 @node Environment Variables
13412 @section Environment Variables Affecting GCC
13413 @cindex environment variables
13414
13415 @c man begin ENVIRONMENT
13416 This section describes several environment variables that affect how GCC
13417 operates.  Some of them work by specifying directories or prefixes to use
13418 when searching for various kinds of files.  Some are used to specify other
13419 aspects of the compilation environment.
13420
13421 Note that you can also specify places to search using options such as
13422 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
13423 take precedence over places specified using environment variables, which
13424 in turn take precedence over those specified by the configuration of GCC@.
13425 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
13426 GNU Compiler Collection (GCC) Internals}.
13427
13428 @table @env
13429 @item LANG
13430 @itemx LC_CTYPE
13431 @c @itemx LC_COLLATE
13432 @itemx LC_MESSAGES
13433 @c @itemx LC_MONETARY
13434 @c @itemx LC_NUMERIC
13435 @c @itemx LC_TIME
13436 @itemx LC_ALL
13437 @findex LANG
13438 @findex LC_CTYPE
13439 @c @findex LC_COLLATE
13440 @findex LC_MESSAGES
13441 @c @findex LC_MONETARY
13442 @c @findex LC_NUMERIC
13443 @c @findex LC_TIME
13444 @findex LC_ALL
13445 @cindex locale
13446 These environment variables control the way that GCC uses
13447 localization information that allow GCC to work with different
13448 national conventions.  GCC inspects the locale categories
13449 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
13450 so.  These locale categories can be set to any value supported by your
13451 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
13452 Kingdom encoded in UTF-8.
13453
13454 The @env{LC_CTYPE} environment variable specifies character
13455 classification.  GCC uses it to determine the character boundaries in
13456 a string; this is needed for some multibyte encodings that contain quote
13457 and escape characters that would otherwise be interpreted as a string
13458 end or escape.
13459
13460 The @env{LC_MESSAGES} environment variable specifies the language to
13461 use in diagnostic messages.
13462
13463 If the @env{LC_ALL} environment variable is set, it overrides the value
13464 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
13465 and @env{LC_MESSAGES} default to the value of the @env{LANG}
13466 environment variable.  If none of these variables are set, GCC
13467 defaults to traditional C English behavior.
13468
13469 @item TMPDIR
13470 @findex TMPDIR
13471 If @env{TMPDIR} is set, it specifies the directory to use for temporary
13472 files.  GCC uses temporary files to hold the output of one stage of
13473 compilation which is to be used as input to the next stage: for example,
13474 the output of the preprocessor, which is the input to the compiler
13475 proper.
13476
13477 @item GCC_EXEC_PREFIX
13478 @findex GCC_EXEC_PREFIX
13479 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
13480 names of the subprograms executed by the compiler.  No slash is added
13481 when this prefix is combined with the name of a subprogram, but you can
13482 specify a prefix that ends with a slash if you wish.
13483
13484 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
13485 an appropriate prefix to use based on the pathname it was invoked with.
13486
13487 If GCC cannot find the subprogram using the specified prefix, it
13488 tries looking in the usual places for the subprogram.
13489
13490 The default value of @env{GCC_EXEC_PREFIX} is
13491 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the value
13492 of @code{prefix} when you ran the @file{configure} script.
13493
13494 Other prefixes specified with @option{-B} take precedence over this prefix.
13495
13496 This prefix is also used for finding files such as @file{crt0.o} that are
13497 used for linking.
13498
13499 In addition, the prefix is used in an unusual way in finding the
13500 directories to search for header files.  For each of the standard
13501 directories whose name normally begins with @samp{/usr/local/lib/gcc}
13502 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
13503 replacing that beginning with the specified prefix to produce an
13504 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
13505 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
13506 These alternate directories are searched first; the standard directories
13507 come next.
13508
13509 @item COMPILER_PATH
13510 @findex COMPILER_PATH
13511 The value of @env{COMPILER_PATH} is a colon-separated list of
13512 directories, much like @env{PATH}.  GCC tries the directories thus
13513 specified when searching for subprograms, if it can't find the
13514 subprograms using @env{GCC_EXEC_PREFIX}.
13515
13516 @item LIBRARY_PATH
13517 @findex LIBRARY_PATH
13518 The value of @env{LIBRARY_PATH} is a colon-separated list of
13519 directories, much like @env{PATH}.  When configured as a native compiler,
13520 GCC tries the directories thus specified when searching for special
13521 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
13522 using GCC also uses these directories when searching for ordinary
13523 libraries for the @option{-l} option (but directories specified with
13524 @option{-L} come first).
13525
13526 @item LANG
13527 @findex LANG
13528 @cindex locale definition
13529 This variable is used to pass locale information to the compiler.  One way in
13530 which this information is used is to determine the character set to be used
13531 when character literals, string literals and comments are parsed in C and C++.
13532 When the compiler is configured to allow multibyte characters,
13533 the following values for @env{LANG} are recognized:
13534
13535 @table @samp
13536 @item C-JIS
13537 Recognize JIS characters.
13538 @item C-SJIS
13539 Recognize SJIS characters.
13540 @item C-EUCJP
13541 Recognize EUCJP characters.
13542 @end table
13543
13544 If @env{LANG} is not defined, or if it has some other value, then the
13545 compiler will use mblen and mbtowc as defined by the default locale to
13546 recognize and translate multibyte characters.
13547 @end table
13548
13549 @noindent
13550 Some additional environments variables affect the behavior of the
13551 preprocessor.
13552
13553 @include cppenv.texi
13554
13555 @c man end
13556
13557 @node Precompiled Headers
13558 @section Using Precompiled Headers
13559 @cindex precompiled headers
13560 @cindex speed of compilation
13561
13562 Often large projects have many header files that are included in every
13563 source file.  The time the compiler takes to process these header files
13564 over and over again can account for nearly all of the time required to
13565 build the project.  To make builds faster, GCC allows users to
13566 `precompile' a header file; then, if builds can use the precompiled
13567 header file they will be much faster.
13568
13569 To create a precompiled header file, simply compile it as you would any
13570 other file, if necessary using the @option{-x} option to make the driver
13571 treat it as a C or C++ header file.  You will probably want to use a
13572 tool like @command{make} to keep the precompiled header up-to-date when
13573 the headers it contains change.
13574
13575 A precompiled header file will be searched for when @code{#include} is
13576 seen in the compilation.  As it searches for the included file
13577 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
13578 compiler looks for a precompiled header in each directory just before it
13579 looks for the include file in that directory.  The name searched for is
13580 the name specified in the @code{#include} with @samp{.gch} appended.  If
13581 the precompiled header file can't be used, it is ignored.
13582
13583 For instance, if you have @code{#include "all.h"}, and you have
13584 @file{all.h.gch} in the same directory as @file{all.h}, then the
13585 precompiled header file will be used if possible, and the original
13586 header will be used otherwise.
13587
13588 Alternatively, you might decide to put the precompiled header file in a
13589 directory and use @option{-I} to ensure that directory is searched
13590 before (or instead of) the directory containing the original header.
13591 Then, if you want to check that the precompiled header file is always
13592 used, you can put a file of the same name as the original header in this
13593 directory containing an @code{#error} command.
13594
13595 This also works with @option{-include}.  So yet another way to use
13596 precompiled headers, good for projects not designed with precompiled
13597 header files in mind, is to simply take most of the header files used by
13598 a project, include them from another header file, precompile that header
13599 file, and @option{-include} the precompiled header.  If the header files
13600 have guards against multiple inclusion, they will be skipped because
13601 they've already been included (in the precompiled header).
13602
13603 If you need to precompile the same header file for different
13604 languages, targets, or compiler options, you can instead make a
13605 @emph{directory} named like @file{all.h.gch}, and put each precompiled
13606 header in the directory, perhaps using @option{-o}.  It doesn't matter
13607 what you call the files in the directory, every precompiled header in
13608 the directory will be considered.  The first precompiled header
13609 encountered in the directory that is valid for this compilation will
13610 be used; they're searched in no particular order.
13611
13612 There are many other possibilities, limited only by your imagination,
13613 good sense, and the constraints of your build system.
13614
13615 A precompiled header file can be used only when these conditions apply:
13616
13617 @itemize
13618 @item
13619 Only one precompiled header can be used in a particular compilation.
13620
13621 @item
13622 A precompiled header can't be used once the first C token is seen.  You
13623 can have preprocessor directives before a precompiled header; you can
13624 even include a precompiled header from inside another header, so long as
13625 there are no C tokens before the @code{#include}.
13626
13627 @item
13628 The precompiled header file must be produced for the same language as
13629 the current compilation.  You can't use a C precompiled header for a C++
13630 compilation.
13631
13632 @item
13633 The precompiled header file must have been produced by the same compiler
13634 binary as the current compilation is using.
13635
13636 @item
13637 Any macros defined before the precompiled header is included must
13638 either be defined in the same way as when the precompiled header was
13639 generated, or must not affect the precompiled header, which usually
13640 means that they don't appear in the precompiled header at all.
13641
13642 The @option{-D} option is one way to define a macro before a
13643 precompiled header is included; using a @code{#define} can also do it.
13644 There are also some options that define macros implicitly, like
13645 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
13646 defined this way.
13647
13648 @item If debugging information is output when using the precompiled
13649 header, using @option{-g} or similar, the same kind of debugging information
13650 must have been output when building the precompiled header.  However,
13651 a precompiled header built using @option{-g} can be used in a compilation
13652 when no debugging information is being output.
13653
13654 @item The same @option{-m} options must generally be used when building
13655 and using the precompiled header.  @xref{Submodel Options},
13656 for any cases where this rule is relaxed.
13657
13658 @item Each of the following options must be the same when building and using
13659 the precompiled header:
13660
13661 @gccoptlist{-fexceptions -funit-at-a-time}
13662
13663 @item
13664 Some other command-line options starting with @option{-f},
13665 @option{-p}, or @option{-O} must be defined in the same way as when
13666 the precompiled header was generated.  At present, it's not clear
13667 which options are safe to change and which are not; the safest choice
13668 is to use exactly the same options when generating and using the
13669 precompiled header.  The following are known to be safe:
13670
13671 @gccoptlist{-fmessage-length= -fpreprocessed
13672 -fsched-interblock -fsched-spec -fsched-spec-load -fsched-spec-load-dangerous
13673 -fsched-verbose=<number> -fschedule-insns -fvisibility=
13674 -pedantic-errors}
13675
13676 @end itemize
13677
13678 For all of these except the last, the compiler will automatically
13679 ignore the precompiled header if the conditions aren't met.  If you
13680 find an option combination that doesn't work and doesn't cause the
13681 precompiled header to be ignored, please consider filing a bug report,
13682 see @ref{Bugs}.
13683
13684 If you do use differing options when generating and using the
13685 precompiled header, the actual behavior will be a mixture of the
13686 behavior for the options.  For instance, if you use @option{-g} to
13687 generate the precompiled header but not when using it, you may or may
13688 not get debugging information for routines in the precompiled header.
13689
13690 @node Running Protoize
13691 @section Running Protoize
13692
13693 The program @code{protoize} is an optional part of GCC@.  You can use
13694 it to add prototypes to a program, thus converting the program to ISO
13695 C in one respect.  The companion program @code{unprotoize} does the
13696 reverse: it removes argument types from any prototypes that are found.
13697
13698 When you run these programs, you must specify a set of source files as
13699 command line arguments.  The conversion programs start out by compiling
13700 these files to see what functions they define.  The information gathered
13701 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
13702
13703 After scanning comes actual conversion.  The specified files are all
13704 eligible to be converted; any files they include (whether sources or
13705 just headers) are eligible as well.
13706
13707 But not all the eligible files are converted.  By default,
13708 @code{protoize} and @code{unprotoize} convert only source and header
13709 files in the current directory.  You can specify additional directories
13710 whose files should be converted with the @option{-d @var{directory}}
13711 option.  You can also specify particular files to exclude with the
13712 @option{-x @var{file}} option.  A file is converted if it is eligible, its
13713 directory name matches one of the specified directory names, and its
13714 name within the directory has not been excluded.
13715
13716 Basic conversion with @code{protoize} consists of rewriting most
13717 function definitions and function declarations to specify the types of
13718 the arguments.  The only ones not rewritten are those for varargs
13719 functions.
13720
13721 @code{protoize} optionally inserts prototype declarations at the
13722 beginning of the source file, to make them available for any calls that
13723 precede the function's definition.  Or it can insert prototype
13724 declarations with block scope in the blocks where undeclared functions
13725 are called.
13726
13727 Basic conversion with @code{unprotoize} consists of rewriting most
13728 function declarations to remove any argument types, and rewriting
13729 function definitions to the old-style pre-ISO form.
13730
13731 Both conversion programs print a warning for any function declaration or
13732 definition that they can't convert.  You can suppress these warnings
13733 with @option{-q}.
13734
13735 The output from @code{protoize} or @code{unprotoize} replaces the
13736 original source file.  The original file is renamed to a name ending
13737 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
13738 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
13739 for DOS) file already exists, then the source file is simply discarded.
13740
13741 @code{protoize} and @code{unprotoize} both depend on GCC itself to
13742 scan the program and collect information about the functions it uses.
13743 So neither of these programs will work until GCC is installed.
13744
13745 Here is a table of the options you can use with @code{protoize} and
13746 @code{unprotoize}.  Each option works with both programs unless
13747 otherwise stated.
13748
13749 @table @code
13750 @item -B @var{directory}
13751 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
13752 usual directory (normally @file{/usr/local/lib}).  This file contains
13753 prototype information about standard system functions.  This option
13754 applies only to @code{protoize}.
13755
13756 @item -c @var{compilation-options}
13757 Use @var{compilation-options} as the options when running @command{gcc} to
13758 produce the @samp{.X} files.  The special option @option{-aux-info} is
13759 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
13760
13761 Note that the compilation options must be given as a single argument to
13762 @code{protoize} or @code{unprotoize}.  If you want to specify several
13763 @command{gcc} options, you must quote the entire set of compilation options
13764 to make them a single word in the shell.
13765
13766 There are certain @command{gcc} arguments that you cannot use, because they
13767 would produce the wrong kind of output.  These include @option{-g},
13768 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
13769 the @var{compilation-options}, they are ignored.
13770
13771 @item -C
13772 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
13773 systems) instead of @samp{.c}.  This is convenient if you are converting
13774 a C program to C++.  This option applies only to @code{protoize}.
13775
13776 @item -g
13777 Add explicit global declarations.  This means inserting explicit
13778 declarations at the beginning of each source file for each function
13779 that is called in the file and was not declared.  These declarations
13780 precede the first function definition that contains a call to an
13781 undeclared function.  This option applies only to @code{protoize}.
13782
13783 @item -i @var{string}
13784 Indent old-style parameter declarations with the string @var{string}.
13785 This option applies only to @code{protoize}.
13786
13787 @code{unprotoize} converts prototyped function definitions to old-style
13788 function definitions, where the arguments are declared between the
13789 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
13790 uses five spaces as the indentation.  If you want to indent with just
13791 one space instead, use @option{-i " "}.
13792
13793 @item -k
13794 Keep the @samp{.X} files.  Normally, they are deleted after conversion
13795 is finished.
13796
13797 @item -l
13798 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
13799 a prototype declaration for each function in each block which calls the
13800 function without any declaration.  This option applies only to
13801 @code{protoize}.
13802
13803 @item -n
13804 Make no real changes.  This mode just prints information about the conversions
13805 that would have been done without @option{-n}.
13806
13807 @item -N
13808 Make no @samp{.save} files.  The original files are simply deleted.
13809 Use this option with caution.
13810
13811 @item -p @var{program}
13812 Use the program @var{program} as the compiler.  Normally, the name
13813 @file{gcc} is used.
13814
13815 @item -q
13816 Work quietly.  Most warnings are suppressed.
13817
13818 @item -v
13819 Print the version number, just like @option{-v} for @command{gcc}.
13820 @end table
13821
13822 If you need special compiler options to compile one of your program's
13823 source files, then you should generate that file's @samp{.X} file
13824 specially, by running @command{gcc} on that source file with the
13825 appropriate options and the option @option{-aux-info}.  Then run
13826 @code{protoize} on the entire set of files.  @code{protoize} will use
13827 the existing @samp{.X} file because it is newer than the source file.
13828 For example:
13829
13830 @smallexample
13831 gcc -Dfoo=bar file1.c -aux-info file1.X
13832 protoize *.c
13833 @end smallexample
13834
13835 @noindent
13836 You need to include the special files along with the rest in the
13837 @code{protoize} command, even though their @samp{.X} files already
13838 exist, because otherwise they won't get converted.
13839
13840 @xref{Protoize Caveats}, for more information on how to use
13841 @code{protoize} successfully.