OSDN Git Service

* doc/extend.texi (MIPS DSP Built-in Functions): Document the DSP
[pf3gnuchains/gcc-fork.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
6
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
11
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
15
16 Permission is granted to copy, distribute and/or modify this document
17 under the terms of the GNU Free Documentation License, Version 1.2 or
18 any later version published by the Free Software Foundation; with the
19 Invariant Sections being ``GNU General Public License'' and ``Funding
20 Free Software'', the Front-Cover texts being (a) (see below), and with
21 the Back-Cover Texts being (b) (see below).  A copy of the license is
22 included in the gfdl(7) man page.
23
24 (a) The FSF's Front-Cover Text is:
25
26      A GNU Manual
27
28 (b) The FSF's Back-Cover Text is:
29
30      You have freedom to copy and modify this GNU Manual, like GNU
31      software.  Copies published by the Free Software Foundation raise
32      funds for GNU development.
33 @c man end
34 @c Set file name and title for the man page.
35 @setfilename gcc
36 @settitle GNU project C and C++ compiler
37 @c man begin SYNOPSIS
38 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
39     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
40     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
41     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
42     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
43     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
44     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
45
46 Only the most useful options are listed here; see below for the
47 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
48 @c man end
49 @c man begin SEEALSO
50 gpl(7), gfdl(7), fsf-funding(7),
51 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
52 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
53 @file{ld}, @file{binutils} and @file{gdb}.
54 @c man end
55 @c man begin BUGS
56 For instructions on reporting bugs, see
57 @w{@uref{http://gcc.gnu.org/bugs.html}}.
58 @c man end
59 @c man begin AUTHOR
60 See the Info entry for @command{gcc}, or
61 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
62 for contributors to GCC@.
63 @c man end
64 @end ignore
65
66 @node Invoking GCC
67 @chapter GCC Command Options
68 @cindex GCC command options
69 @cindex command options
70 @cindex options, GCC command
71
72 @c man begin DESCRIPTION
73 When you invoke GCC, it normally does preprocessing, compilation,
74 assembly and linking.  The ``overall options'' allow you to stop this
75 process at an intermediate stage.  For example, the @option{-c} option
76 says not to run the linker.  Then the output consists of object files
77 output by the assembler.
78
79 Other options are passed on to one stage of processing.  Some options
80 control the preprocessor and others the compiler itself.  Yet other
81 options control the assembler and linker; most of these are not
82 documented here, since you rarely need to use any of them.
83
84 @cindex C compilation options
85 Most of the command line options that you can use with GCC are useful
86 for C programs; when an option is only useful with another language
87 (usually C++), the explanation says so explicitly.  If the description
88 for a particular option does not mention a source language, you can use
89 that option with all supported languages.
90
91 @cindex C++ compilation options
92 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
93 options for compiling C++ programs.
94
95 @cindex grouping options
96 @cindex options, grouping
97 The @command{gcc} program accepts options and file names as operands.  Many
98 options have multi-letter names; therefore multiple single-letter options
99 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
100 -r}}.
101
102 @cindex order of options
103 @cindex options, order
104 You can mix options and other arguments.  For the most part, the order
105 you use doesn't matter.  Order does matter when you use several options
106 of the same kind; for example, if you specify @option{-L} more than once,
107 the directories are searched in the order specified.
108
109 Many options have long names starting with @samp{-f} or with
110 @samp{-W}---for example, 
111 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
112 these have both positive and negative forms; the negative form of
113 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
114 only one of these two forms, whichever one is not the default.
115
116 @c man end
117
118 @xref{Option Index}, for an index to GCC's options.
119
120 @menu
121 * Option Summary::      Brief list of all options, without explanations.
122 * Overall Options::     Controlling the kind of output:
123                         an executable, object files, assembler files,
124                         or preprocessed source.
125 * Invoking G++::        Compiling C++ programs.
126 * C Dialect Options::   Controlling the variant of C language compiled.
127 * C++ Dialect Options:: Variations on C++.
128 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
129                         and Objective-C++.
130 * Language Independent Options:: Controlling how diagnostics should be
131                         formatted.
132 * Warning Options::     How picky should the compiler be?
133 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
134 * Optimize Options::    How much optimization?
135 * Preprocessor Options:: Controlling header files and macro definitions.
136                          Also, getting dependency information for Make.
137 * Assembler Options::   Passing options to the assembler.
138 * Link Options::        Specifying libraries and so on.
139 * Directory Options::   Where to find header files and libraries.
140                         Where to find the compiler executable files.
141 * Spec Files::          How to pass switches to sub-processes.
142 * Target Options::      Running a cross-compiler, or an old version of GCC.
143 * Submodel Options::    Specifying minor hardware or convention variations,
144                         such as 68010 vs 68020.
145 * Code Gen Options::    Specifying conventions for function calls, data layout
146                         and register usage.
147 * Environment Variables:: Env vars that affect GCC.
148 * Precompiled Headers:: Compiling a header once, and using it many times.
149 * Running Protoize::    Automatically adding or removing function prototypes.
150 @end menu
151
152 @c man begin OPTIONS
153
154 @node Option Summary
155 @section Option Summary
156
157 Here is a summary of all the options, grouped by type.  Explanations are
158 in the following sections.
159
160 @table @emph
161 @item Overall Options
162 @xref{Overall Options,,Options Controlling the Kind of Output}.
163 @gccoptlist{-c  -S  -E  -o @var{file}  -combine  -pipe  -pass-exit-codes  @gol
164 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{]}  --target-help  @gol 
165 --version @@@var{file}}
166
167 @item C Language Options
168 @xref{C Dialect Options,,Options Controlling C Dialect}.
169 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
170 -aux-info @var{filename} @gol
171 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
172 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
173 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
174 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
175 -fsigned-bitfields  -fsigned-char @gol
176 -funsigned-bitfields  -funsigned-char}
177
178 @item C++ Language Options
179 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
180 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
181 -fconserve-space  -ffriend-injection @gol
182 -fno-elide-constructors @gol
183 -fno-enforce-eh-specs @gol
184 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
185 -fno-implicit-templates @gol
186 -fno-implicit-inline-templates @gol
187 -fno-implement-inlines  -fms-extensions @gol
188 -fno-nonansi-builtins  -fno-operator-names @gol
189 -fno-optional-diags  -fpermissive @gol
190 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
191 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
192 -fno-default-inline  -fvisibility-inlines-hidden @gol
193 -Wabi  -Wctor-dtor-privacy @gol
194 -Wnon-virtual-dtor  -Wreorder @gol
195 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
196 -Wno-non-template-friend  -Wold-style-cast @gol
197 -Woverloaded-virtual  -Wno-pmf-conversions @gol
198 -Wsign-promo}
199
200 @item Objective-C and Objective-C++ Language Options
201 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
202 Objective-C and Objective-C++ Dialects}.
203 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
204 -fgnu-runtime  -fnext-runtime @gol
205 -fno-nil-receivers @gol
206 -fobjc-call-cxx-cdtors @gol
207 -fobjc-direct-dispatch @gol
208 -fobjc-exceptions @gol
209 -fobjc-gc @gol
210 -freplace-objc-classes @gol
211 -fzero-link @gol
212 -gen-decls @gol
213 -Wassign-intercept @gol
214 -Wno-protocol  -Wselector @gol
215 -Wstrict-selector-match @gol
216 -Wundeclared-selector}
217
218 @item Language Independent Options
219 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
220 @gccoptlist{-fmessage-length=@var{n}  @gol
221 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
222 -fdiagnostics-show-option}
223
224 @item Warning Options
225 @xref{Warning Options,,Options to Request or Suppress Warnings}.
226 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
227 -w  -Wextra  -Wall  -Waddress  -Waggregate-return -Warray-bounds @gol
228 -Wno-attributes -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
229 -Wchar-subscripts -Wclobbered  -Wcomment @gol
230 -Wconversion -Wcoverage-mismatch -Wno-deprecated-declarations @gol
231 -Wdisabled-optimization  -Wno-div-by-zero  @gol
232 -Wempty-body  -Wno-endif-labels @gol
233 -Werror  -Werror=* @gol
234 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
235 -Wno-format-extra-args -Wformat-nonliteral @gol
236 -Wformat-security  -Wformat-y2k @gol
237 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
238 -Wimport  -Wno-import  -Winit-self  -Winline @gol
239 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
240 -Winvalid-pch -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations @gol
241 -Wlogical-op -Wlong-long @gol
242 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
243 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
244 -Wmissing-noreturn @gol
245 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
246 -Woverlength-strings  -Wpacked  -Wpadded @gol
247 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
248 -Wredundant-decls @gol
249 -Wreturn-type  -Wsequence-point  -Wshadow @gol
250 -Wsign-compare  -Wstack-protector @gol
251 -Wstrict-aliasing -Wstrict-aliasing=2 @gol
252 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
253 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
254 -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
255 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
256 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
257 -Wunused-value  -Wunused-variable  -Wvariadic-macros @gol
258 -Wvolatile-register-var  -Wwrite-strings}
259
260 @item C-only Warning Options
261 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
262 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
263 -Wold-style-declaration  -Wold-style-definition @gol
264 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
265 -Wdeclaration-after-statement -Wpointer-sign}
266
267 @item Debugging Options
268 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
269 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
270 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
271 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
272 -fdump-ipa-all -fdump-ipa-cgraph @gol
273 -fdump-tree-all @gol
274 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
275 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
276 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
277 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
278 -fdump-tree-ch @gol
279 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
280 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
281 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
282 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
283 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
284 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
285 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-nrv -fdump-tree-vect @gol
288 -fdump-tree-sink @gol
289 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
290 -fdump-tree-salias @gol
291 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
293 -ftree-vectorizer-verbose=@var{n} @gol
294 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
295 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
296 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
297 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
298 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
299 -ftest-coverage  -ftime-report -fvar-tracking @gol
300 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
301 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
302 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
303 -print-multi-directory  -print-multi-lib @gol
304 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
305 -print-sysroot-headers-suffix @gol
306 -save-temps  -time}
307
308 @item Optimization Options
309 @xref{Optimize Options,,Options that Control Optimization}.
310 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
311 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
312 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
313 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
314 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
315 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
316 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
317 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
318 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
319 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
320 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
321 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
322 -finline-functions  -finline-functions-called-once @gol
323 -finline-limit=@var{n}  -fkeep-inline-functions @gol
324 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
325 -fmodulo-sched -fno-branch-count-reg @gol
326 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
327 -fno-function-cse  -fno-guess-branch-probability @gol
328 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
329 -funsafe-math-optimizations  -funsafe-loop-optimizations @gol
330 -ffinite-math-only  -fno-signed-zeros @gol
331 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
332 -fomit-frame-pointer  -foptimize-register-move @gol
333 -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
334 -fprofile-generate -fprofile-use @gol
335 -fregmove  -frename-registers @gol
336 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
337 -frerun-cse-after-loop @gol
338 -frounding-math -frtl-abstract-sequences @gol
339 -fschedule-insns  -fschedule-insns2 @gol
340 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
341 -fsched-spec-load-dangerous  @gol
342 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
343 -fsched2-use-superblocks @gol
344 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
345 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
346 -fno-split-wide-types -fstack-protector  -fstack-protector-all @gol
347 -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps @gol
348 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
349 -fsplit-ivs-in-unroller -funswitch-loops @gol
350 -fvariable-expansion-in-unroller @gol
351 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
352 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
353 -fcheck-data-deps @gol
354 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
355 -ftree-ch -ftree-sra -ftree-ter -ftree-fre -ftree-vectorize @gol
356 -ftree-vect-loop-version -ftree-salias -fipa-pta -fweb @gol
357 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
358 --param @var{name}=@var{value}
359 -O  -O0  -O1  -O2  -O3  -Os}
360
361 @item Preprocessor Options
362 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
363 @gccoptlist{-A@var{question}=@var{answer} @gol
364 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
365 -C  -dD  -dI  -dM  -dN @gol
366 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
367 -idirafter @var{dir} @gol
368 -include @var{file}  -imacros @var{file} @gol
369 -iprefix @var{file}  -iwithprefix @var{dir} @gol
370 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
371 -imultilib @var{dir} -isysroot @var{dir} @gol
372 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
373 -P  -fworking-directory  -remap @gol
374 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
375 -Xpreprocessor @var{option}}
376
377 @item Assembler Option
378 @xref{Assembler Options,,Passing Options to the Assembler}.
379 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
380
381 @item Linker Options
382 @xref{Link Options,,Options for Linking}.
383 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
384 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
385 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
386 -Wl,@var{option}  -Xlinker @var{option} @gol
387 -u @var{symbol}}
388
389 @item Directory Options
390 @xref{Directory Options,,Options for Directory Search}.
391 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
392 -specs=@var{file}  -I- --sysroot=@var{dir}}
393
394 @item Target Options
395 @c I wrote this xref this way to avoid overfull hbox. -- rms
396 @xref{Target Options}.
397 @gccoptlist{-V @var{version}  -b @var{machine}}
398
399 @item Machine Dependent Options
400 @xref{Submodel Options,,Hardware Models and Configurations}.
401 @c This list is ordered alphanumerically by subsection name.
402 @c Try and put the significant identifier (CPU or system) first,
403 @c so users have a clue at guessing where the ones they want will be.
404
405 @emph{ARC Options}
406 @gccoptlist{-EB  -EL @gol
407 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
408 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
409
410 @emph{ARM Options}
411 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
412 -mabi=@var{name} @gol
413 -mapcs-stack-check  -mno-apcs-stack-check @gol
414 -mapcs-float  -mno-apcs-float @gol
415 -mapcs-reentrant  -mno-apcs-reentrant @gol
416 -msched-prolog  -mno-sched-prolog @gol
417 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
418 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
419 -mthumb-interwork  -mno-thumb-interwork @gol
420 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
421 -mstructure-size-boundary=@var{n} @gol
422 -mabort-on-noreturn @gol
423 -mlong-calls  -mno-long-calls @gol
424 -msingle-pic-base  -mno-single-pic-base @gol
425 -mpic-register=@var{reg} @gol
426 -mnop-fun-dllimport @gol
427 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
428 -mpoke-function-name @gol
429 -mthumb  -marm @gol
430 -mtpcs-frame  -mtpcs-leaf-frame @gol
431 -mcaller-super-interworking  -mcallee-super-interworking @gol
432 -mtp=@var{name}}
433
434 @emph{AVR Options}
435 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
436 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
437
438 @emph{Blackfin Options}
439 @gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol
440 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly @gol
441 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
442 -mno-id-shared-library -mshared-library-id=@var{n} @gol
443 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
444 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls}
445
446 @emph{CRIS Options}
447 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
448 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
449 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
450 -mstack-align  -mdata-align  -mconst-align @gol
451 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
452 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
453 -mmul-bug-workaround  -mno-mul-bug-workaround}
454
455 @emph{CRX Options}
456 @gccoptlist{-mmac -mpush-args}
457
458 @emph{Darwin Options}
459 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
460 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
461 -client_name  -compatibility_version  -current_version @gol
462 -dead_strip @gol
463 -dependency-file  -dylib_file  -dylinker_install_name @gol
464 -dynamic  -dynamiclib  -exported_symbols_list @gol
465 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
466 -force_flat_namespace  -headerpad_max_install_names @gol
467 -iframework @gol
468 -image_base  -init  -install_name  -keep_private_externs @gol
469 -multi_module  -multiply_defined  -multiply_defined_unused @gol
470 -noall_load   -no_dead_strip_inits_and_terms @gol
471 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
472 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
473 -private_bundle  -read_only_relocs  -sectalign @gol
474 -sectobjectsymbols  -whyload  -seg1addr @gol
475 -sectcreate  -sectobjectsymbols  -sectorder @gol
476 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
477 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
478 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
479 -single_module  -static  -sub_library  -sub_umbrella @gol
480 -twolevel_namespace  -umbrella  -undefined @gol
481 -unexported_symbols_list  -weak_reference_mismatches @gol
482 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
483 -mkernel -mone-byte-bool}
484
485 @emph{DEC Alpha Options}
486 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
487 -mieee  -mieee-with-inexact  -mieee-conformant @gol
488 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
489 -mtrap-precision=@var{mode}  -mbuild-constants @gol
490 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
491 -mbwx  -mmax  -mfix  -mcix @gol
492 -mfloat-vax  -mfloat-ieee @gol
493 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
494 -msmall-text  -mlarge-text @gol
495 -mmemory-latency=@var{time}}
496
497 @emph{DEC Alpha/VMS Options}
498 @gccoptlist{-mvms-return-codes}
499
500 @emph{FRV Options}
501 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
502 -mhard-float  -msoft-float @gol
503 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
504 -mdouble  -mno-double @gol
505 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
506 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
507 -mlinked-fp  -mlong-calls  -malign-labels @gol
508 -mlibrary-pic  -macc-4  -macc-8 @gol
509 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
510 -moptimize-membar -mno-optimize-membar @gol
511 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
512 -mvliw-branch  -mno-vliw-branch @gol
513 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
514 -mno-nested-cond-exec  -mtomcat-stats @gol
515 -mTLS -mtls @gol
516 -mcpu=@var{cpu}}
517
518 @emph{GNU/Linux Options}
519 @gccoptlist{-muclibc}
520
521 @emph{H8/300 Options}
522 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
523
524 @emph{HPPA Options}
525 @gccoptlist{-march=@var{architecture-type} @gol
526 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
527 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
528 -mfixed-range=@var{register-range} @gol
529 -mjump-in-delay -mlinker-opt -mlong-calls @gol
530 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
531 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
532 -mno-jump-in-delay  -mno-long-load-store @gol
533 -mno-portable-runtime  -mno-soft-float @gol
534 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
535 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
536 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
537 -munix=@var{unix-std}  -nolibdld  -static  -threads}
538
539 @emph{i386 and x86-64 Options}
540 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
541 -mfpmath=@var{unit} @gol
542 -masm=@var{dialect}  -mno-fancy-math-387 @gol
543 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
544 -mno-wide-multiply  -mrtd  -malign-double @gol
545 -mpreferred-stack-boundary=@var{num} @gol
546 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4a -m3dnow -mpopcnt -mabm @gol
547 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
548 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
549 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
550 -mstackrealign @gol
551 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
552 -mcmodel=@var{code-model} @gol
553 -m32  -m64 -mlarge-data-threshold=@var{num}}
554
555 @emph{IA-64 Options}
556 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
557 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
558 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
559 -minline-float-divide-max-throughput @gol
560 -minline-int-divide-min-latency @gol
561 -minline-int-divide-max-throughput  @gol
562 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
563 -mno-dwarf2-asm -mearly-stop-bits @gol
564 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
565 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
566 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
567 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
568 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
569 -mno-sched-prefer-non-data-spec-insns @gol
570 -mno-sched-prefer-non-control-spec-insns @gol
571 -mno-sched-count-spec-in-critical-path}
572
573 @emph{M32R/D Options}
574 @gccoptlist{-m32r2 -m32rx -m32r @gol
575 -mdebug @gol
576 -malign-loops -mno-align-loops @gol
577 -missue-rate=@var{number} @gol
578 -mbranch-cost=@var{number} @gol
579 -mmodel=@var{code-size-model-type} @gol
580 -msdata=@var{sdata-type} @gol
581 -mno-flush-func -mflush-func=@var{name} @gol
582 -mno-flush-trap -mflush-trap=@var{number} @gol
583 -G @var{num}}
584
585 @emph{M32C Options}
586 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
587
588 @emph{M680x0 Options}
589 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
590 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
591 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
592 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
593 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
594 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
595 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
596 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
597
598 @emph{M68hc1x Options}
599 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
600 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
601 -msoft-reg-count=@var{count}}
602
603 @emph{MCore Options}
604 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
605 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
606 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
607 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
608 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
609
610 @emph{MIPS Options}
611 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
612 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
613 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
614 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64  @gol
615 -mfp32  -mfp64  -mhard-float  -msoft-float  @gol
616 -msingle-float  -mdouble-float  -mdsp  -mdspr2  -mpaired-single  -mips3d @gol
617 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
618 -G@var{num}  -membedded-data  -mno-embedded-data @gol
619 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
620 -msplit-addresses  -mno-split-addresses  @gol
621 -mexplicit-relocs  -mno-explicit-relocs  @gol
622 -mcheck-zero-division  -mno-check-zero-division @gol
623 -mdivide-traps  -mdivide-breaks @gol
624 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
625 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
626 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
627 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130 @gol
628 -mfix-sb1  -mno-fix-sb1 @gol
629 -mflush-func=@var{func}  -mno-flush-func @gol
630 -mbranch-likely  -mno-branch-likely @gol
631 -mfp-exceptions -mno-fp-exceptions @gol
632 -mvr4130-align -mno-vr4130-align}
633
634 @emph{MMIX Options}
635 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
636 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
637 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
638 -mno-base-addresses  -msingle-exit  -mno-single-exit}
639
640 @emph{MN10300 Options}
641 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
642 -mam33  -mno-am33 @gol
643 -mam33-2  -mno-am33-2 @gol
644 -mreturn-pointer-on-d0 @gol
645 -mno-crt0  -mrelax}
646
647 @emph{MT Options}
648 @gccoptlist{-mno-crt0 -mbacc -msim @gol
649 -march=@var{cpu-type} }
650
651 @emph{PDP-11 Options}
652 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
653 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
654 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
655 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
656 -mbranch-expensive  -mbranch-cheap @gol
657 -msplit  -mno-split  -munix-asm  -mdec-asm}
658
659 @emph{PowerPC Options}
660 See RS/6000 and PowerPC Options.
661
662 @emph{RS/6000 and PowerPC Options}
663 @gccoptlist{-mcpu=@var{cpu-type} @gol
664 -mtune=@var{cpu-type} @gol
665 -mpower  -mno-power  -mpower2  -mno-power2 @gol
666 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
667 -maltivec  -mno-altivec @gol
668 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
669 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
670 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
671 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mdfp -mno-dfp @gol
672 -mnew-mnemonics  -mold-mnemonics @gol
673 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
674 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
675 -malign-power  -malign-natural @gol
676 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
677 -mstring  -mno-string  -mupdate  -mno-update @gol
678 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
679 -mstrict-align  -mno-strict-align  -mrelocatable @gol
680 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
681 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
682 -mdynamic-no-pic  -maltivec  -mswdiv @gol
683 -mprioritize-restricted-insns=@var{priority} @gol
684 -msched-costly-dep=@var{dependence_type} @gol
685 -minsert-sched-nops=@var{scheme} @gol
686 -mcall-sysv  -mcall-netbsd @gol
687 -maix-struct-return  -msvr4-struct-return @gol
688 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
689 -misel -mno-isel @gol
690 -misel=yes  -misel=no @gol
691 -mspe -mno-spe @gol
692 -mspe=yes  -mspe=no @gol
693 -mvrsave -mno-vrsave @gol
694 -mmulhw -mno-mulhw @gol
695 -mdlmzb -mno-dlmzb @gol
696 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
697 -mprototype  -mno-prototype @gol
698 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
699 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
700
701 @emph{S/390 and zSeries Options}
702 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
703 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
704 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
705 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
706 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
707 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
708 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
709
710 @emph{Score Options}
711 @gccoptlist{-mel -mel @gol
712 -mmac @gol
713 -mscore5u -mscore7}
714  
715 @emph{SH Options}
716 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
717 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
718 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
719 -m5-64media  -m5-64media-nofpu @gol
720 -m5-32media  -m5-32media-nofpu @gol
721 -m5-compact  -m5-compact-nofpu @gol
722 -mb  -ml  -mdalign  -mrelax @gol
723 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
724 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
725 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
726 -mdivsi3_libfunc=@var{name}  @gol
727 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
728  -minvalid-symbols}
729
730 @emph{SPARC Options}
731 @gccoptlist{-mcpu=@var{cpu-type} @gol
732 -mtune=@var{cpu-type} @gol
733 -mcmodel=@var{code-model} @gol
734 -m32  -m64  -mapp-regs  -mno-app-regs @gol
735 -mfaster-structs  -mno-faster-structs @gol
736 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
737 -mhard-quad-float  -msoft-quad-float @gol
738 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
739 -mstack-bias  -mno-stack-bias @gol
740 -munaligned-doubles  -mno-unaligned-doubles @gol
741 -mv8plus  -mno-v8plus  -mvis  -mno-vis
742 -threads -pthreads -pthread}
743
744 @emph{SPU Options}
745 @gccoptlist{-mwarn-reloc -merror-reloc @gol
746 -msafe-dma -munsafe-dma @gol
747 -mbranch-hints @gol
748 -msmall-mem -mlarge-mem -mstdmain @gol
749 -mfixed-range=@var{register-range}}
750
751 @emph{System V Options}
752 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
753
754 @emph{TMS320C3x/C4x Options}
755 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
756 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
757 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
758 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
759
760 @emph{V850 Options}
761 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
762 -mprolog-function  -mno-prolog-function  -mspace @gol
763 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
764 -mapp-regs  -mno-app-regs @gol
765 -mdisable-callt  -mno-disable-callt @gol
766 -mv850e1 @gol
767 -mv850e @gol
768 -mv850  -mbig-switch}
769
770 @emph{VAX Options}
771 @gccoptlist{-mg  -mgnu  -munix}
772
773 @emph{x86-64 Options}
774 See i386 and x86-64 Options.
775
776 @emph{Xstormy16 Options}
777 @gccoptlist{-msim}
778
779 @emph{Xtensa Options}
780 @gccoptlist{-mconst16 -mno-const16 @gol
781 -mfused-madd  -mno-fused-madd @gol
782 -mtext-section-literals  -mno-text-section-literals @gol
783 -mtarget-align  -mno-target-align @gol
784 -mlongcalls  -mno-longcalls}
785
786 @emph{zSeries Options}
787 See S/390 and zSeries Options.
788
789 @item Code Generation Options
790 @xref{Code Gen Options,,Options for Code Generation Conventions}.
791 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
792 -ffixed-@var{reg}  -fexceptions @gol
793 -fnon-call-exceptions  -funwind-tables @gol
794 -fasynchronous-unwind-tables @gol
795 -finhibit-size-directive  -finstrument-functions @gol
796 -fno-common  -fno-ident @gol
797 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
798 -fno-jump-tables @gol
799 -frecord-gcc-switches @gol
800 -freg-struct-return  -fshort-enums @gol
801 -fshort-double  -fshort-wchar @gol
802 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
803 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
804 -fargument-alias  -fargument-noalias @gol
805 -fargument-noalias-global  -fargument-noalias-anything
806 -fleading-underscore  -ftls-model=@var{model} @gol
807 -ftrapv  -fwrapv  -fbounds-check @gol
808 -fvisibility}
809 @end table
810
811 @menu
812 * Overall Options::     Controlling the kind of output:
813                         an executable, object files, assembler files,
814                         or preprocessed source.
815 * C Dialect Options::   Controlling the variant of C language compiled.
816 * C++ Dialect Options:: Variations on C++.
817 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
818                         and Objective-C++.
819 * Language Independent Options:: Controlling how diagnostics should be
820                         formatted.
821 * Warning Options::     How picky should the compiler be?
822 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
823 * Optimize Options::    How much optimization?
824 * Preprocessor Options:: Controlling header files and macro definitions.
825                          Also, getting dependency information for Make.
826 * Assembler Options::   Passing options to the assembler.
827 * Link Options::        Specifying libraries and so on.
828 * Directory Options::   Where to find header files and libraries.
829                         Where to find the compiler executable files.
830 * Spec Files::          How to pass switches to sub-processes.
831 * Target Options::      Running a cross-compiler, or an old version of GCC.
832 @end menu
833
834 @node Overall Options
835 @section Options Controlling the Kind of Output
836
837 Compilation can involve up to four stages: preprocessing, compilation
838 proper, assembly and linking, always in that order.  GCC is capable of
839 preprocessing and compiling several files either into several
840 assembler input files, or into one assembler input file; then each
841 assembler input file produces an object file, and linking combines all
842 the object files (those newly compiled, and those specified as input)
843 into an executable file.
844
845 @cindex file name suffix
846 For any given input file, the file name suffix determines what kind of
847 compilation is done:
848
849 @table @gcctabopt
850 @item @var{file}.c
851 C source code which must be preprocessed.
852
853 @item @var{file}.i
854 C source code which should not be preprocessed.
855
856 @item @var{file}.ii
857 C++ source code which should not be preprocessed.
858
859 @item @var{file}.m
860 Objective-C source code.  Note that you must link with the @file{libobjc}
861 library to make an Objective-C program work.
862
863 @item @var{file}.mi
864 Objective-C source code which should not be preprocessed.
865
866 @item @var{file}.mm
867 @itemx @var{file}.M
868 Objective-C++ source code.  Note that you must link with the @file{libobjc}
869 library to make an Objective-C++ program work.  Note that @samp{.M} refers
870 to a literal capital M@.
871
872 @item @var{file}.mii
873 Objective-C++ source code which should not be preprocessed.
874
875 @item @var{file}.h
876 C, C++, Objective-C or Objective-C++ header file to be turned into a
877 precompiled header.
878
879 @item @var{file}.cc
880 @itemx @var{file}.cp
881 @itemx @var{file}.cxx
882 @itemx @var{file}.cpp
883 @itemx @var{file}.CPP
884 @itemx @var{file}.c++
885 @itemx @var{file}.C
886 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
887 the last two letters must both be literally @samp{x}.  Likewise,
888 @samp{.C} refers to a literal capital C@.
889
890 @item @var{file}.mm
891 @itemx @var{file}.M
892 Objective-C++ source code which must be preprocessed.
893
894 @item @var{file}.mii
895 Objective-C++ source code which should not be preprocessed.
896
897 @item @var{file}.hh
898 @itemx @var{file}.H
899 C++ header file to be turned into a precompiled header.
900
901 @item @var{file}.f
902 @itemx @var{file}.for
903 @itemx @var{file}.FOR
904 Fixed form Fortran source code which should not be preprocessed.
905
906 @item @var{file}.F
907 @itemx @var{file}.fpp
908 @itemx @var{file}.FPP
909 Fixed form Fortran source code which must be preprocessed (with the traditional
910 preprocessor).
911
912 @item @var{file}.f90
913 @itemx @var{file}.f95
914 Free form Fortran source code which should not be preprocessed.
915
916 @item @var{file}.F90
917 @itemx @var{file}.F95
918 Free form Fortran source code which must be preprocessed (with the
919 traditional preprocessor).
920
921 @c FIXME: Descriptions of Java file types.
922 @c @var{file}.java
923 @c @var{file}.class
924 @c @var{file}.zip
925 @c @var{file}.jar
926
927 @item @var{file}.ads
928 Ada source code file which contains a library unit declaration (a
929 declaration of a package, subprogram, or generic, or a generic
930 instantiation), or a library unit renaming declaration (a package,
931 generic, or subprogram renaming declaration).  Such files are also
932 called @dfn{specs}.
933
934 @itemx @var{file}.adb
935 Ada source code file containing a library unit body (a subprogram or
936 package body).  Such files are also called @dfn{bodies}.
937
938 @c GCC also knows about some suffixes for languages not yet included:
939 @c Pascal:
940 @c @var{file}.p
941 @c @var{file}.pas
942 @c Ratfor:
943 @c @var{file}.r
944
945 @item @var{file}.s
946 Assembler code.
947
948 @item @var{file}.S
949 Assembler code which must be preprocessed.
950
951 @item @var{other}
952 An object file to be fed straight into linking.
953 Any file name with no recognized suffix is treated this way.
954 @end table
955
956 @opindex x
957 You can specify the input language explicitly with the @option{-x} option:
958
959 @table @gcctabopt
960 @item -x @var{language}
961 Specify explicitly the @var{language} for the following input files
962 (rather than letting the compiler choose a default based on the file
963 name suffix).  This option applies to all following input files until
964 the next @option{-x} option.  Possible values for @var{language} are:
965 @smallexample
966 c  c-header  c-cpp-output
967 c++  c++-header  c++-cpp-output
968 objective-c  objective-c-header  objective-c-cpp-output
969 objective-c++ objective-c++-header objective-c++-cpp-output
970 assembler  assembler-with-cpp
971 ada
972 f95  f95-cpp-input
973 java
974 treelang
975 @end smallexample
976
977 @item -x none
978 Turn off any specification of a language, so that subsequent files are
979 handled according to their file name suffixes (as they are if @option{-x}
980 has not been used at all).
981
982 @item -pass-exit-codes
983 @opindex pass-exit-codes
984 Normally the @command{gcc} program will exit with the code of 1 if any
985 phase of the compiler returns a non-success return code.  If you specify
986 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
987 numerically highest error produced by any phase that returned an error
988 indication.  The C, C++, and Fortran frontends return 4, if an internal
989 compiler error is encountered.
990 @end table
991
992 If you only want some of the stages of compilation, you can use
993 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
994 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
995 @command{gcc} is to stop.  Note that some combinations (for example,
996 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
997
998 @table @gcctabopt
999 @item -c
1000 @opindex c
1001 Compile or assemble the source files, but do not link.  The linking
1002 stage simply is not done.  The ultimate output is in the form of an
1003 object file for each source file.
1004
1005 By default, the object file name for a source file is made by replacing
1006 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1007
1008 Unrecognized input files, not requiring compilation or assembly, are
1009 ignored.
1010
1011 @item -S
1012 @opindex S
1013 Stop after the stage of compilation proper; do not assemble.  The output
1014 is in the form of an assembler code file for each non-assembler input
1015 file specified.
1016
1017 By default, the assembler file name for a source file is made by
1018 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1019
1020 Input files that don't require compilation are ignored.
1021
1022 @item -E
1023 @opindex E
1024 Stop after the preprocessing stage; do not run the compiler proper.  The
1025 output is in the form of preprocessed source code, which is sent to the
1026 standard output.
1027
1028 Input files which don't require preprocessing are ignored.
1029
1030 @cindex output file option
1031 @item -o @var{file}
1032 @opindex o
1033 Place output in file @var{file}.  This applies regardless to whatever
1034 sort of output is being produced, whether it be an executable file,
1035 an object file, an assembler file or preprocessed C code.
1036
1037 If @option{-o} is not specified, the default is to put an executable
1038 file in @file{a.out}, the object file for
1039 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1040 assembler file in @file{@var{source}.s}, a precompiled header file in
1041 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1042 standard output.
1043
1044 @item -v
1045 @opindex v
1046 Print (on standard error output) the commands executed to run the stages
1047 of compilation.  Also print the version number of the compiler driver
1048 program and of the preprocessor and the compiler proper.
1049
1050 @item -###
1051 @opindex ###
1052 Like @option{-v} except the commands are not executed and all command
1053 arguments are quoted.  This is useful for shell scripts to capture the
1054 driver-generated command lines.
1055
1056 @item -pipe
1057 @opindex pipe
1058 Use pipes rather than temporary files for communication between the
1059 various stages of compilation.  This fails to work on some systems where
1060 the assembler is unable to read from a pipe; but the GNU assembler has
1061 no trouble.
1062
1063 @item -combine
1064 @opindex combine
1065 If you are compiling multiple source files, this option tells the driver
1066 to pass all the source files to the compiler at once (for those
1067 languages for which the compiler can handle this).  This will allow
1068 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1069 language for which this is supported is C@.  If you pass source files for
1070 multiple languages to the driver, using this option, the driver will invoke
1071 the compiler(s) that support IMA once each, passing each compiler all the
1072 source files appropriate for it.  For those languages that do not support
1073 IMA this option will be ignored, and the compiler will be invoked once for
1074 each source file in that language.  If you use this option in conjunction
1075 with @option{-save-temps}, the compiler will generate multiple
1076 pre-processed files
1077 (one for each source file), but only one (combined) @file{.o} or
1078 @file{.s} file.
1079
1080 @item --help
1081 @opindex help
1082 Print (on the standard output) a description of the command line options
1083 understood by @command{gcc}.  If the @option{-v} option is also specified
1084 then @option{--help} will also be passed on to the various processes
1085 invoked by @command{gcc}, so that they can display the command line options
1086 they accept.  If the @option{-Wextra} option has also been specified
1087 (prior to the @option{--help} option), then command line options which
1088 have no documentation associated with them will also be displayed.
1089
1090 @item --target-help
1091 @opindex target-help
1092 Print (on the standard output) a description of target-specific command
1093 line options for each tool.
1094
1095 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1096 Print (on the standard output) a description of the command line
1097 options understood by the compiler that fit into a specific class.
1098 The class can be one of @var{optimizers}, @var{warnings}, @var{target}
1099 or @var{params}:
1100
1101 @table @gcctabopt
1102 @item @var{optimizers}
1103 This will display all of the optimization options supported by the
1104 compiler.
1105
1106 @item @var{warnings}
1107 This will display all of the options controlling warning messages
1108 produced by the compiler.
1109
1110 @item @var{target}
1111 This will display target-specific options.  Unlike the
1112 @option{--target-help} option however, target-specific options of the
1113 linker and assembler will not be displayed.  This is because those
1114 tools do not currently support the extended @option{--help=} syntax.
1115
1116 @item @var{params}
1117 This will display the values recognized by the @option{--param}
1118 option.
1119 @end table
1120
1121 It is possible to further refine the output of the @option{--help=}
1122 option by adding a comma separated list of qualifiers after the
1123 class.  These can be any from the following list:
1124
1125 @table @gcctabopt
1126 @item undocumented
1127 Display only those options which are undocumented.
1128
1129 @item joined
1130 Display options which take an argument that appears after an equal
1131 sign in the same continuous piece of text, such as:
1132 @samp{--help=target}.
1133
1134 @item separate
1135 Display options which take an argument that appears as a separate word
1136 following the original option, such as: @samp{-o output-file}.
1137 @end table
1138
1139 Thus for example to display all the undocumented target-specific
1140 switches supported by the compiler the following can be used:
1141
1142 @smallexample
1143 --help=target,undocumented
1144 @end smallexample
1145
1146 The sense of a qualifier can be inverted by prefixing it with the
1147 @var{^} character, so for example to display all binary warning
1148 options (i.e. ones that are either on or off and that do not take an
1149 argument), which have a description the following can be used:
1150
1151 @smallexample
1152 --help=warnings,^joined,^undocumented
1153 @end smallexample
1154
1155 A class can also be used as a qualifier, although this usually
1156 restricts the output by so much that there is nothing to display.  One
1157 case where it does work however is when one of the classes is
1158 @var{target}.  So for example to display all the target-specific
1159 optimization options the following can be used:
1160
1161 @smallexample
1162 --help=target,optimizers
1163 @end smallexample
1164
1165 The @option{--help=} option can be repeated on the command line.  Each
1166 successive use will display its requested class of options, skipping
1167 those that have already been displayed.
1168
1169 If the @option{-Q} option appears on the command line before the
1170 @option{--help=} option, then the descriptive text displayed by
1171 @option{--help=} is changed.  Instead of describing the displayed
1172 options, an indication is given as to whether the option is enabled,
1173 disabled or set to a specific value (assuming that the compiler
1174 knows this at the point where the @option{--help=} option is used).
1175
1176 Here is a truncated example from the ARM port of @command{gcc}:
1177
1178 @smallexample
1179   % gcc -Q -mabi=2 --help=target -c
1180   The following options are target specific:
1181   -mabi=                                2
1182   -mabort-on-noreturn                   [disabled]
1183   -mapcs                                [disabled]
1184 @end smallexample
1185
1186 The output is sensitive to the effects of previous command line
1187 options, so for example it is possible to find out which optimizations
1188 are enabled at @option{-O2} by using:
1189
1190 @smallexample
1191 -O2 --help=optimizers
1192 @end smallexample
1193
1194 Alternatively you can discover which binary optimizations are enabled
1195 by @option{-O3} by using:
1196
1197 @smallexample
1198 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1199 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1200 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1201 @end smallexample
1202
1203 @item --version
1204 @opindex version
1205 Display the version number and copyrights of the invoked GCC@.
1206
1207 @include @value{srcdir}/../libiberty/at-file.texi
1208 @end table
1209
1210 @node Invoking G++
1211 @section Compiling C++ Programs
1212
1213 @cindex suffixes for C++ source
1214 @cindex C++ source file suffixes
1215 C++ source files conventionally use one of the suffixes @samp{.C},
1216 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1217 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1218 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1219 files with these names and compiles them as C++ programs even if you
1220 call the compiler the same way as for compiling C programs (usually
1221 with the name @command{gcc}).
1222
1223 @findex g++
1224 @findex c++
1225 However, the use of @command{gcc} does not add the C++ library.
1226 @command{g++} is a program that calls GCC and treats @samp{.c},
1227 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1228 files unless @option{-x} is used, and automatically specifies linking
1229 against the C++ library.  This program is also useful when
1230 precompiling a C header file with a @samp{.h} extension for use in C++
1231 compilations.  On many systems, @command{g++} is also installed with
1232 the name @command{c++}.
1233
1234 @cindex invoking @command{g++}
1235 When you compile C++ programs, you may specify many of the same
1236 command-line options that you use for compiling programs in any
1237 language; or command-line options meaningful for C and related
1238 languages; or options that are meaningful only for C++ programs.
1239 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1240 explanations of options for languages related to C@.
1241 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1242 explanations of options that are meaningful only for C++ programs.
1243
1244 @node C Dialect Options
1245 @section Options Controlling C Dialect
1246 @cindex dialect options
1247 @cindex language dialect options
1248 @cindex options, dialect
1249
1250 The following options control the dialect of C (or languages derived
1251 from C, such as C++, Objective-C and Objective-C++) that the compiler
1252 accepts:
1253
1254 @table @gcctabopt
1255 @cindex ANSI support
1256 @cindex ISO support
1257 @item -ansi
1258 @opindex ansi
1259 In C mode, support all ISO C90 programs.  In C++ mode,
1260 remove GNU extensions that conflict with ISO C++.
1261
1262 This turns off certain features of GCC that are incompatible with ISO
1263 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1264 such as the @code{asm} and @code{typeof} keywords, and
1265 predefined macros such as @code{unix} and @code{vax} that identify the
1266 type of system you are using.  It also enables the undesirable and
1267 rarely used ISO trigraph feature.  For the C compiler,
1268 it disables recognition of C++ style @samp{//} comments as well as
1269 the @code{inline} keyword.
1270
1271 The alternate keywords @code{__asm__}, @code{__extension__},
1272 @code{__inline__} and @code{__typeof__} continue to work despite
1273 @option{-ansi}.  You would not want to use them in an ISO C program, of
1274 course, but it is useful to put them in header files that might be included
1275 in compilations done with @option{-ansi}.  Alternate predefined macros
1276 such as @code{__unix__} and @code{__vax__} are also available, with or
1277 without @option{-ansi}.
1278
1279 The @option{-ansi} option does not cause non-ISO programs to be
1280 rejected gratuitously.  For that, @option{-pedantic} is required in
1281 addition to @option{-ansi}.  @xref{Warning Options}.
1282
1283 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1284 option is used.  Some header files may notice this macro and refrain
1285 from declaring certain functions or defining certain macros that the
1286 ISO standard doesn't call for; this is to avoid interfering with any
1287 programs that might use these names for other things.
1288
1289 Functions which would normally be built in but do not have semantics
1290 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1291 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1292 built-in functions provided by GCC}, for details of the functions
1293 affected.
1294
1295 @item -std=
1296 @opindex std
1297 Determine the language standard.  This option is currently only
1298 supported when compiling C or C++.  A value for this option must be
1299 provided; possible values are
1300
1301 @table @samp
1302 @item c89
1303 @itemx iso9899:1990
1304 ISO C90 (same as @option{-ansi}).
1305
1306 @item iso9899:199409
1307 ISO C90 as modified in amendment 1.
1308
1309 @item c99
1310 @itemx c9x
1311 @itemx iso9899:1999
1312 @itemx iso9899:199x
1313 ISO C99.  Note that this standard is not yet fully supported; see
1314 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1315 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1316
1317 @item gnu89
1318 Default, ISO C90 plus GNU extensions (including some C99 features).
1319
1320 @item gnu99
1321 @itemx gnu9x
1322 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1323 this will become the default.  The name @samp{gnu9x} is deprecated.
1324
1325 @item c++98
1326 The 1998 ISO C++ standard plus amendments.
1327
1328 @item gnu++98
1329 The same as @option{-std=c++98} plus GNU extensions.  This is the
1330 default for C++ code.
1331
1332 @item c++0x
1333 The working draft of the upcoming ISO C++0x standard. This option
1334 enables experimental features that are likely to be included in
1335 C++0x. The working draft is constantly changing, and any feature that is
1336 enabled by this flag may be removed from future versions of GCC if it is
1337 not part of the C++0x standard.
1338
1339 @item gnu++0x
1340 The same as @option{-std=c++0x} plus GNU extensions. As with
1341 @option{-std=c++0x}, this option enables experimental features that may
1342 be removed in future versions of GCC.
1343 @end table
1344
1345 Even when this option is not specified, you can still use some of the
1346 features of newer standards in so far as they do not conflict with
1347 previous C standards.  For example, you may use @code{__restrict__} even
1348 when @option{-std=c99} is not specified.
1349
1350 The @option{-std} options specifying some version of ISO C have the same
1351 effects as @option{-ansi}, except that features that were not in ISO C90
1352 but are in the specified version (for example, @samp{//} comments and
1353 the @code{inline} keyword in ISO C99) are not disabled.
1354
1355 @xref{Standards,,Language Standards Supported by GCC}, for details of
1356 these standard versions.
1357
1358 @item -fgnu89-inline
1359 @opindex fgnu89-inline
1360 The option @option{-fgnu89-inline} tells GCC to use the traditional
1361 GNU semantics for @code{inline} functions when in C99 mode.
1362 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1363 is accepted and ignored by GCC versions 4.1.3 up to but not including
1364 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1365 C99 mode.  Using this option is roughly equivalent to adding the
1366 @code{gnu_inline} function attribute to all inline functions
1367 (@pxref{Function Attributes}).
1368
1369 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1370 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1371 specifies the default behavior).  This option was first supported in
1372 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1373
1374 The preprocesor macros @code{__GNUC_GNU_INLINE__} and
1375 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1376 in effect for @code{inline} functions.  @xref{Common Predefined
1377 Macros,,,cpp.info,The C Preprocessor}.
1378
1379 @item -aux-info @var{filename}
1380 @opindex aux-info
1381 Output to the given filename prototyped declarations for all functions
1382 declared and/or defined in a translation unit, including those in header
1383 files.  This option is silently ignored in any language other than C@.
1384
1385 Besides declarations, the file indicates, in comments, the origin of
1386 each declaration (source file and line), whether the declaration was
1387 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1388 @samp{O} for old, respectively, in the first character after the line
1389 number and the colon), and whether it came from a declaration or a
1390 definition (@samp{C} or @samp{F}, respectively, in the following
1391 character).  In the case of function definitions, a K&R-style list of
1392 arguments followed by their declarations is also provided, inside
1393 comments, after the declaration.
1394
1395 @item -fno-asm
1396 @opindex fno-asm
1397 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1398 keyword, so that code can use these words as identifiers.  You can use
1399 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1400 instead.  @option{-ansi} implies @option{-fno-asm}.
1401
1402 In C++, this switch only affects the @code{typeof} keyword, since
1403 @code{asm} and @code{inline} are standard keywords.  You may want to
1404 use the @option{-fno-gnu-keywords} flag instead, which has the same
1405 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1406 switch only affects the @code{asm} and @code{typeof} keywords, since
1407 @code{inline} is a standard keyword in ISO C99.
1408
1409 @item -fno-builtin
1410 @itemx -fno-builtin-@var{function}
1411 @opindex fno-builtin
1412 @cindex built-in functions
1413 Don't recognize built-in functions that do not begin with
1414 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1415 functions provided by GCC}, for details of the functions affected,
1416 including those which are not built-in functions when @option{-ansi} or
1417 @option{-std} options for strict ISO C conformance are used because they
1418 do not have an ISO standard meaning.
1419
1420 GCC normally generates special code to handle certain built-in functions
1421 more efficiently; for instance, calls to @code{alloca} may become single
1422 instructions that adjust the stack directly, and calls to @code{memcpy}
1423 may become inline copy loops.  The resulting code is often both smaller
1424 and faster, but since the function calls no longer appear as such, you
1425 cannot set a breakpoint on those calls, nor can you change the behavior
1426 of the functions by linking with a different library.  In addition,
1427 when a function is recognized as a built-in function, GCC may use
1428 information about that function to warn about problems with calls to
1429 that function, or to generate more efficient code, even if the
1430 resulting code still contains calls to that function.  For example,
1431 warnings are given with @option{-Wformat} for bad calls to
1432 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1433 known not to modify global memory.
1434
1435 With the @option{-fno-builtin-@var{function}} option
1436 only the built-in function @var{function} is
1437 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1438 function is named this is not built-in in this version of GCC, this
1439 option is ignored.  There is no corresponding
1440 @option{-fbuiltin-@var{function}} option; if you wish to enable
1441 built-in functions selectively when using @option{-fno-builtin} or
1442 @option{-ffreestanding}, you may define macros such as:
1443
1444 @smallexample
1445 #define abs(n)          __builtin_abs ((n))
1446 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1447 @end smallexample
1448
1449 @item -fhosted
1450 @opindex fhosted
1451 @cindex hosted environment
1452
1453 Assert that compilation takes place in a hosted environment.  This implies
1454 @option{-fbuiltin}.  A hosted environment is one in which the
1455 entire standard library is available, and in which @code{main} has a return
1456 type of @code{int}.  Examples are nearly everything except a kernel.
1457 This is equivalent to @option{-fno-freestanding}.
1458
1459 @item -ffreestanding
1460 @opindex ffreestanding
1461 @cindex hosted environment
1462
1463 Assert that compilation takes place in a freestanding environment.  This
1464 implies @option{-fno-builtin}.  A freestanding environment
1465 is one in which the standard library may not exist, and program startup may
1466 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1467 This is equivalent to @option{-fno-hosted}.
1468
1469 @xref{Standards,,Language Standards Supported by GCC}, for details of
1470 freestanding and hosted environments.
1471
1472 @item -fopenmp
1473 @opindex fopenmp
1474 @cindex openmp parallel
1475 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1476 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1477 compiler generates parallel code according to the OpenMP Application
1478 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1479
1480 @item -fms-extensions
1481 @opindex fms-extensions
1482 Accept some non-standard constructs used in Microsoft header files.
1483
1484 Some cases of unnamed fields in structures and unions are only
1485 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1486 fields within structs/unions}, for details.
1487
1488 @item -trigraphs
1489 @opindex trigraphs
1490 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1491 options for strict ISO C conformance) implies @option{-trigraphs}.
1492
1493 @item -no-integrated-cpp
1494 @opindex no-integrated-cpp
1495 Performs a compilation in two passes: preprocessing and compiling.  This
1496 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1497 @option{-B} option.  The user supplied compilation step can then add in
1498 an additional preprocessing step after normal preprocessing but before
1499 compiling.  The default is to use the integrated cpp (internal cpp)
1500
1501 The semantics of this option will change if "cc1", "cc1plus", and
1502 "cc1obj" are merged.
1503
1504 @cindex traditional C language
1505 @cindex C language, traditional
1506 @item -traditional
1507 @itemx -traditional-cpp
1508 @opindex traditional-cpp
1509 @opindex traditional
1510 Formerly, these options caused GCC to attempt to emulate a pre-standard
1511 C compiler.  They are now only supported with the @option{-E} switch.
1512 The preprocessor continues to support a pre-standard mode.  See the GNU
1513 CPP manual for details.
1514
1515 @item -fcond-mismatch
1516 @opindex fcond-mismatch
1517 Allow conditional expressions with mismatched types in the second and
1518 third arguments.  The value of such an expression is void.  This option
1519 is not supported for C++.
1520
1521 @item -flax-vector-conversions
1522 @opindex flax-vector-conversions
1523 Allow implicit conversions between vectors with differing numbers of
1524 elements and/or incompatible element types.  This option should not be
1525 used for new code.
1526
1527 @item -funsigned-char
1528 @opindex funsigned-char
1529 Let the type @code{char} be unsigned, like @code{unsigned char}.
1530
1531 Each kind of machine has a default for what @code{char} should
1532 be.  It is either like @code{unsigned char} by default or like
1533 @code{signed char} by default.
1534
1535 Ideally, a portable program should always use @code{signed char} or
1536 @code{unsigned char} when it depends on the signedness of an object.
1537 But many programs have been written to use plain @code{char} and
1538 expect it to be signed, or expect it to be unsigned, depending on the
1539 machines they were written for.  This option, and its inverse, let you
1540 make such a program work with the opposite default.
1541
1542 The type @code{char} is always a distinct type from each of
1543 @code{signed char} or @code{unsigned char}, even though its behavior
1544 is always just like one of those two.
1545
1546 @item -fsigned-char
1547 @opindex fsigned-char
1548 Let the type @code{char} be signed, like @code{signed char}.
1549
1550 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1551 the negative form of @option{-funsigned-char}.  Likewise, the option
1552 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1553
1554 @item -fsigned-bitfields
1555 @itemx -funsigned-bitfields
1556 @itemx -fno-signed-bitfields
1557 @itemx -fno-unsigned-bitfields
1558 @opindex fsigned-bitfields
1559 @opindex funsigned-bitfields
1560 @opindex fno-signed-bitfields
1561 @opindex fno-unsigned-bitfields
1562 These options control whether a bit-field is signed or unsigned, when the
1563 declaration does not use either @code{signed} or @code{unsigned}.  By
1564 default, such a bit-field is signed, because this is consistent: the
1565 basic integer types such as @code{int} are signed types.
1566 @end table
1567
1568 @node C++ Dialect Options
1569 @section Options Controlling C++ Dialect
1570
1571 @cindex compiler options, C++
1572 @cindex C++ options, command line
1573 @cindex options, C++
1574 This section describes the command-line options that are only meaningful
1575 for C++ programs; but you can also use most of the GNU compiler options
1576 regardless of what language your program is in.  For example, you
1577 might compile a file @code{firstClass.C} like this:
1578
1579 @smallexample
1580 g++ -g -frepo -O -c firstClass.C
1581 @end smallexample
1582
1583 @noindent
1584 In this example, only @option{-frepo} is an option meant
1585 only for C++ programs; you can use the other options with any
1586 language supported by GCC@.
1587
1588 Here is a list of options that are @emph{only} for compiling C++ programs:
1589
1590 @table @gcctabopt
1591
1592 @item -fabi-version=@var{n}
1593 @opindex fabi-version
1594 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1595 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1596 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1597 the version that conforms most closely to the C++ ABI specification.
1598 Therefore, the ABI obtained using version 0 will change as ABI bugs
1599 are fixed.
1600
1601 The default is version 2.
1602
1603 @item -fno-access-control
1604 @opindex fno-access-control
1605 Turn off all access checking.  This switch is mainly useful for working
1606 around bugs in the access control code.
1607
1608 @item -fcheck-new
1609 @opindex fcheck-new
1610 Check that the pointer returned by @code{operator new} is non-null
1611 before attempting to modify the storage allocated.  This check is
1612 normally unnecessary because the C++ standard specifies that
1613 @code{operator new} will only return @code{0} if it is declared
1614 @samp{throw()}, in which case the compiler will always check the
1615 return value even without this option.  In all other cases, when
1616 @code{operator new} has a non-empty exception specification, memory
1617 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1618 @samp{new (nothrow)}.
1619
1620 @item -fconserve-space
1621 @opindex fconserve-space
1622 Put uninitialized or runtime-initialized global variables into the
1623 common segment, as C does.  This saves space in the executable at the
1624 cost of not diagnosing duplicate definitions.  If you compile with this
1625 flag and your program mysteriously crashes after @code{main()} has
1626 completed, you may have an object that is being destroyed twice because
1627 two definitions were merged.
1628
1629 This option is no longer useful on most targets, now that support has
1630 been added for putting variables into BSS without making them common.
1631
1632 @item -ffriend-injection
1633 @opindex ffriend-injection
1634 Inject friend functions into the enclosing namespace, so that they are
1635 visible outside the scope of the class in which they are declared.
1636 Friend functions were documented to work this way in the old Annotated
1637 C++ Reference Manual, and versions of G++ before 4.1 always worked
1638 that way.  However, in ISO C++ a friend function which is not declared
1639 in an enclosing scope can only be found using argument dependent
1640 lookup.  This option causes friends to be injected as they were in
1641 earlier releases.
1642
1643 This option is for compatibility, and may be removed in a future
1644 release of G++.
1645
1646 @item -fno-elide-constructors
1647 @opindex fno-elide-constructors
1648 The C++ standard allows an implementation to omit creating a temporary
1649 which is only used to initialize another object of the same type.
1650 Specifying this option disables that optimization, and forces G++ to
1651 call the copy constructor in all cases.
1652
1653 @item -fno-enforce-eh-specs
1654 @opindex fno-enforce-eh-specs
1655 Don't generate code to check for violation of exception specifications
1656 at runtime.  This option violates the C++ standard, but may be useful
1657 for reducing code size in production builds, much like defining
1658 @samp{NDEBUG}.  This does not give user code permission to throw
1659 exceptions in violation of the exception specifications; the compiler
1660 will still optimize based on the specifications, so throwing an
1661 unexpected exception will result in undefined behavior.
1662
1663 @item -ffor-scope
1664 @itemx -fno-for-scope
1665 @opindex ffor-scope
1666 @opindex fno-for-scope
1667 If @option{-ffor-scope} is specified, the scope of variables declared in
1668 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1669 as specified by the C++ standard.
1670 If @option{-fno-for-scope} is specified, the scope of variables declared in
1671 a @i{for-init-statement} extends to the end of the enclosing scope,
1672 as was the case in old versions of G++, and other (traditional)
1673 implementations of C++.
1674
1675 The default if neither flag is given to follow the standard,
1676 but to allow and give a warning for old-style code that would
1677 otherwise be invalid, or have different behavior.
1678
1679 @item -fno-gnu-keywords
1680 @opindex fno-gnu-keywords
1681 Do not recognize @code{typeof} as a keyword, so that code can use this
1682 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1683 @option{-ansi} implies @option{-fno-gnu-keywords}.
1684
1685 @item -fno-implicit-templates
1686 @opindex fno-implicit-templates
1687 Never emit code for non-inline templates which are instantiated
1688 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1689 @xref{Template Instantiation}, for more information.
1690
1691 @item -fno-implicit-inline-templates
1692 @opindex fno-implicit-inline-templates
1693 Don't emit code for implicit instantiations of inline templates, either.
1694 The default is to handle inlines differently so that compiles with and
1695 without optimization will need the same set of explicit instantiations.
1696
1697 @item -fno-implement-inlines
1698 @opindex fno-implement-inlines
1699 To save space, do not emit out-of-line copies of inline functions
1700 controlled by @samp{#pragma implementation}.  This will cause linker
1701 errors if these functions are not inlined everywhere they are called.
1702
1703 @item -fms-extensions
1704 @opindex fms-extensions
1705 Disable pedantic warnings about constructs used in MFC, such as implicit
1706 int and getting a pointer to member function via non-standard syntax.
1707
1708 @item -fno-nonansi-builtins
1709 @opindex fno-nonansi-builtins
1710 Disable built-in declarations of functions that are not mandated by
1711 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1712 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1713
1714 @item -fno-operator-names
1715 @opindex fno-operator-names
1716 Do not treat the operator name keywords @code{and}, @code{bitand},
1717 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1718 synonyms as keywords.
1719
1720 @item -fno-optional-diags
1721 @opindex fno-optional-diags
1722 Disable diagnostics that the standard says a compiler does not need to
1723 issue.  Currently, the only such diagnostic issued by G++ is the one for
1724 a name having multiple meanings within a class.
1725
1726 @item -fpermissive
1727 @opindex fpermissive
1728 Downgrade some diagnostics about nonconformant code from errors to
1729 warnings.  Thus, using @option{-fpermissive} will allow some
1730 nonconforming code to compile.
1731
1732 @item -frepo
1733 @opindex frepo
1734 Enable automatic template instantiation at link time.  This option also
1735 implies @option{-fno-implicit-templates}.  @xref{Template
1736 Instantiation}, for more information.
1737
1738 @item -fno-rtti
1739 @opindex fno-rtti
1740 Disable generation of information about every class with virtual
1741 functions for use by the C++ runtime type identification features
1742 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1743 of the language, you can save some space by using this flag.  Note that
1744 exception handling uses the same information, but it will generate it as
1745 needed. The @samp{dynamic_cast} operator can still be used for casts that
1746 do not require runtime type information, i.e. casts to @code{void *} or to
1747 unambiguous base classes.
1748
1749 @item -fstats
1750 @opindex fstats
1751 Emit statistics about front-end processing at the end of the compilation.
1752 This information is generally only useful to the G++ development team.
1753
1754 @item -ftemplate-depth-@var{n}
1755 @opindex ftemplate-depth
1756 Set the maximum instantiation depth for template classes to @var{n}.
1757 A limit on the template instantiation depth is needed to detect
1758 endless recursions during template class instantiation.  ANSI/ISO C++
1759 conforming programs must not rely on a maximum depth greater than 17.
1760
1761 @item -fno-threadsafe-statics
1762 @opindex fno-threadsafe-statics
1763 Do not emit the extra code to use the routines specified in the C++
1764 ABI for thread-safe initialization of local statics.  You can use this
1765 option to reduce code size slightly in code that doesn't need to be
1766 thread-safe.
1767
1768 @item -fuse-cxa-atexit
1769 @opindex fuse-cxa-atexit
1770 Register destructors for objects with static storage duration with the
1771 @code{__cxa_atexit} function rather than the @code{atexit} function.
1772 This option is required for fully standards-compliant handling of static
1773 destructors, but will only work if your C library supports
1774 @code{__cxa_atexit}.
1775
1776 @item -fno-use-cxa-get-exception-ptr
1777 @opindex fno-use-cxa-get-exception-ptr
1778 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1779 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1780 if the runtime routine is not available.
1781
1782 @item -fvisibility-inlines-hidden
1783 @opindex fvisibility-inlines-hidden
1784 This switch declares that the user does not attempt to compare
1785 pointers to inline methods where the addresses of the two functions
1786 were taken in different shared objects.
1787
1788 The effect of this is that GCC may, effectively, mark inline methods with
1789 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1790 appear in the export table of a DSO and do not require a PLT indirection
1791 when used within the DSO@.  Enabling this option can have a dramatic effect
1792 on load and link times of a DSO as it massively reduces the size of the
1793 dynamic export table when the library makes heavy use of templates.
1794
1795 The behavior of this switch is not quite the same as marking the
1796 methods as hidden directly, because it does not affect static variables
1797 local to the function or cause the compiler to deduce that
1798 the function is defined in only one shared object.
1799
1800 You may mark a method as having a visibility explicitly to negate the
1801 effect of the switch for that method.  For example, if you do want to
1802 compare pointers to a particular inline method, you might mark it as
1803 having default visibility.  Marking the enclosing class with explicit
1804 visibility will have no effect.
1805
1806 Explicitly instantiated inline methods are unaffected by this option
1807 as their linkage might otherwise cross a shared library boundary.
1808 @xref{Template Instantiation}.
1809
1810 @item -fno-weak
1811 @opindex fno-weak
1812 Do not use weak symbol support, even if it is provided by the linker.
1813 By default, G++ will use weak symbols if they are available.  This
1814 option exists only for testing, and should not be used by end-users;
1815 it will result in inferior code and has no benefits.  This option may
1816 be removed in a future release of G++.
1817
1818 @item -nostdinc++
1819 @opindex nostdinc++
1820 Do not search for header files in the standard directories specific to
1821 C++, but do still search the other standard directories.  (This option
1822 is used when building the C++ library.)
1823 @end table
1824
1825 In addition, these optimization, warning, and code generation options
1826 have meanings only for C++ programs:
1827
1828 @table @gcctabopt
1829 @item -fno-default-inline
1830 @opindex fno-default-inline
1831 Do not assume @samp{inline} for functions defined inside a class scope.
1832 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1833 functions will have linkage like inline functions; they just won't be
1834 inlined by default.
1835
1836 @item -Wabi @r{(C++ only)}
1837 @opindex Wabi
1838 Warn when G++ generates code that is probably not compatible with the
1839 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1840 all such cases, there are probably some cases that are not warned about,
1841 even though G++ is generating incompatible code.  There may also be
1842 cases where warnings are emitted even though the code that is generated
1843 will be compatible.
1844
1845 You should rewrite your code to avoid these warnings if you are
1846 concerned about the fact that code generated by G++ may not be binary
1847 compatible with code generated by other compilers.
1848
1849 The known incompatibilities at this point include:
1850
1851 @itemize @bullet
1852
1853 @item
1854 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1855 pack data into the same byte as a base class.  For example:
1856
1857 @smallexample
1858 struct A @{ virtual void f(); int f1 : 1; @};
1859 struct B : public A @{ int f2 : 1; @};
1860 @end smallexample
1861
1862 @noindent
1863 In this case, G++ will place @code{B::f2} into the same byte
1864 as@code{A::f1}; other compilers will not.  You can avoid this problem
1865 by explicitly padding @code{A} so that its size is a multiple of the
1866 byte size on your platform; that will cause G++ and other compilers to
1867 layout @code{B} identically.
1868
1869 @item
1870 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1871 tail padding when laying out virtual bases.  For example:
1872
1873 @smallexample
1874 struct A @{ virtual void f(); char c1; @};
1875 struct B @{ B(); char c2; @};
1876 struct C : public A, public virtual B @{@};
1877 @end smallexample
1878
1879 @noindent
1880 In this case, G++ will not place @code{B} into the tail-padding for
1881 @code{A}; other compilers will.  You can avoid this problem by
1882 explicitly padding @code{A} so that its size is a multiple of its
1883 alignment (ignoring virtual base classes); that will cause G++ and other
1884 compilers to layout @code{C} identically.
1885
1886 @item
1887 Incorrect handling of bit-fields with declared widths greater than that
1888 of their underlying types, when the bit-fields appear in a union.  For
1889 example:
1890
1891 @smallexample
1892 union U @{ int i : 4096; @};
1893 @end smallexample
1894
1895 @noindent
1896 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1897 union too small by the number of bits in an @code{int}.
1898
1899 @item
1900 Empty classes can be placed at incorrect offsets.  For example:
1901
1902 @smallexample
1903 struct A @{@};
1904
1905 struct B @{
1906   A a;
1907   virtual void f ();
1908 @};
1909
1910 struct C : public B, public A @{@};
1911 @end smallexample
1912
1913 @noindent
1914 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1915 it should be placed at offset zero.  G++ mistakenly believes that the
1916 @code{A} data member of @code{B} is already at offset zero.
1917
1918 @item
1919 Names of template functions whose types involve @code{typename} or
1920 template template parameters can be mangled incorrectly.
1921
1922 @smallexample
1923 template <typename Q>
1924 void f(typename Q::X) @{@}
1925
1926 template <template <typename> class Q>
1927 void f(typename Q<int>::X) @{@}
1928 @end smallexample
1929
1930 @noindent
1931 Instantiations of these templates may be mangled incorrectly.
1932
1933 @end itemize
1934
1935 @item -Wctor-dtor-privacy @r{(C++ only)}
1936 @opindex Wctor-dtor-privacy
1937 Warn when a class seems unusable because all the constructors or
1938 destructors in that class are private, and it has neither friends nor
1939 public static member functions.
1940
1941 @item -Wnon-virtual-dtor @r{(C++ only)}
1942 @opindex Wnon-virtual-dtor
1943 Warn when a class appears to be polymorphic, thereby requiring a virtual
1944 destructor, yet it declares a non-virtual one.  This warning is also
1945 enabled if -Weffc++ is specified.
1946
1947 @item -Wreorder @r{(C++ only)}
1948 @opindex Wreorder
1949 @cindex reordering, warning
1950 @cindex warning for reordering of member initializers
1951 Warn when the order of member initializers given in the code does not
1952 match the order in which they must be executed.  For instance:
1953
1954 @smallexample
1955 struct A @{
1956   int i;
1957   int j;
1958   A(): j (0), i (1) @{ @}
1959 @};
1960 @end smallexample
1961
1962 The compiler will rearrange the member initializers for @samp{i}
1963 and @samp{j} to match the declaration order of the members, emitting
1964 a warning to that effect.  This warning is enabled by @option{-Wall}.
1965 @end table
1966
1967 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1968
1969 @table @gcctabopt
1970 @item -Weffc++ @r{(C++ only)}
1971 @opindex Weffc++
1972 Warn about violations of the following style guidelines from Scott Meyers'
1973 @cite{Effective C++} book:
1974
1975 @itemize @bullet
1976 @item
1977 Item 11:  Define a copy constructor and an assignment operator for classes
1978 with dynamically allocated memory.
1979
1980 @item
1981 Item 12:  Prefer initialization to assignment in constructors.
1982
1983 @item
1984 Item 14:  Make destructors virtual in base classes.
1985
1986 @item
1987 Item 15:  Have @code{operator=} return a reference to @code{*this}.
1988
1989 @item
1990 Item 23:  Don't try to return a reference when you must return an object.
1991
1992 @end itemize
1993
1994 Also warn about violations of the following style guidelines from
1995 Scott Meyers' @cite{More Effective C++} book:
1996
1997 @itemize @bullet
1998 @item
1999 Item 6:  Distinguish between prefix and postfix forms of increment and
2000 decrement operators.
2001
2002 @item
2003 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2004
2005 @end itemize
2006
2007 When selecting this option, be aware that the standard library
2008 headers do not obey all of these guidelines; use @samp{grep -v}
2009 to filter out those warnings.
2010
2011 @item -Wno-deprecated @r{(C++ only)}
2012 @opindex Wno-deprecated
2013 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
2014
2015 @item -Wstrict-null-sentinel @r{(C++ only)}
2016 @opindex Wstrict-null-sentinel
2017 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2018 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2019 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2020 it is guaranteed to of the same size as a pointer.  But this use is
2021 not portable across different compilers.
2022
2023 @item -Wno-non-template-friend @r{(C++ only)}
2024 @opindex Wno-non-template-friend
2025 Disable warnings when non-templatized friend functions are declared
2026 within a template.  Since the advent of explicit template specification
2027 support in G++, if the name of the friend is an unqualified-id (i.e.,
2028 @samp{friend foo(int)}), the C++ language specification demands that the
2029 friend declare or define an ordinary, nontemplate function.  (Section
2030 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2031 could be interpreted as a particular specialization of a templatized
2032 function.  Because this non-conforming behavior is no longer the default
2033 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2034 check existing code for potential trouble spots and is on by default.
2035 This new compiler behavior can be turned off with
2036 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2037 but disables the helpful warning.
2038
2039 @item -Wold-style-cast @r{(C++ only)}
2040 @opindex Wold-style-cast
2041 Warn if an old-style (C-style) cast to a non-void type is used within
2042 a C++ program.  The new-style casts (@samp{dynamic_cast},
2043 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2044 less vulnerable to unintended effects and much easier to search for.
2045
2046 @item -Woverloaded-virtual @r{(C++ only)}
2047 @opindex Woverloaded-virtual
2048 @cindex overloaded virtual fn, warning
2049 @cindex warning for overloaded virtual fn
2050 Warn when a function declaration hides virtual functions from a
2051 base class.  For example, in:
2052
2053 @smallexample
2054 struct A @{
2055   virtual void f();
2056 @};
2057
2058 struct B: public A @{
2059   void f(int);
2060 @};
2061 @end smallexample
2062
2063 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2064 like:
2065
2066 @smallexample
2067 B* b;
2068 b->f();
2069 @end smallexample
2070
2071 will fail to compile.
2072
2073 @item -Wno-pmf-conversions @r{(C++ only)}
2074 @opindex Wno-pmf-conversions
2075 Disable the diagnostic for converting a bound pointer to member function
2076 to a plain pointer.
2077
2078 @item -Wsign-promo @r{(C++ only)}
2079 @opindex Wsign-promo
2080 Warn when overload resolution chooses a promotion from unsigned or
2081 enumerated type to a signed type, over a conversion to an unsigned type of
2082 the same size.  Previous versions of G++ would try to preserve
2083 unsignedness, but the standard mandates the current behavior.
2084
2085 @smallexample
2086 struct A @{
2087   operator int ();
2088   A& operator = (int);
2089 @};
2090
2091 main ()
2092 @{
2093   A a,b;
2094   a = b;
2095 @}
2096 @end smallexample
2097
2098 In this example, G++ will synthesize a default @samp{A& operator =
2099 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2100 @end table
2101
2102 @node Objective-C and Objective-C++ Dialect Options
2103 @section Options Controlling Objective-C and Objective-C++ Dialects
2104
2105 @cindex compiler options, Objective-C and Objective-C++
2106 @cindex Objective-C and Objective-C++ options, command line
2107 @cindex options, Objective-C and Objective-C++
2108 (NOTE: This manual does not describe the Objective-C and Objective-C++
2109 languages themselves.  See @xref{Standards,,Language Standards
2110 Supported by GCC}, for references.)
2111
2112 This section describes the command-line options that are only meaningful
2113 for Objective-C and Objective-C++ programs, but you can also use most of
2114 the language-independent GNU compiler options.
2115 For example, you might compile a file @code{some_class.m} like this:
2116
2117 @smallexample
2118 gcc -g -fgnu-runtime -O -c some_class.m
2119 @end smallexample
2120
2121 @noindent
2122 In this example, @option{-fgnu-runtime} is an option meant only for
2123 Objective-C and Objective-C++ programs; you can use the other options with
2124 any language supported by GCC@.
2125
2126 Note that since Objective-C is an extension of the C language, Objective-C
2127 compilations may also use options specific to the C front-end (e.g.,
2128 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2129 C++-specific options (e.g., @option{-Wabi}).
2130
2131 Here is a list of options that are @emph{only} for compiling Objective-C
2132 and Objective-C++ programs:
2133
2134 @table @gcctabopt
2135 @item -fconstant-string-class=@var{class-name}
2136 @opindex fconstant-string-class
2137 Use @var{class-name} as the name of the class to instantiate for each
2138 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2139 class name is @code{NXConstantString} if the GNU runtime is being used, and
2140 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2141 @option{-fconstant-cfstrings} option, if also present, will override the
2142 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2143 to be laid out as constant CoreFoundation strings.
2144
2145 @item -fgnu-runtime
2146 @opindex fgnu-runtime
2147 Generate object code compatible with the standard GNU Objective-C
2148 runtime.  This is the default for most types of systems.
2149
2150 @item -fnext-runtime
2151 @opindex fnext-runtime
2152 Generate output compatible with the NeXT runtime.  This is the default
2153 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2154 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2155 used.
2156
2157 @item -fno-nil-receivers
2158 @opindex fno-nil-receivers
2159 Assume that all Objective-C message dispatches (e.g.,
2160 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2161 is not @code{nil}.  This allows for more efficient entry points in the runtime
2162 to be used.  Currently, this option is only available in conjunction with
2163 the NeXT runtime on Mac OS X 10.3 and later.
2164
2165 @item -fobjc-call-cxx-cdtors
2166 @opindex fobjc-call-cxx-cdtors
2167 For each Objective-C class, check if any of its instance variables is a
2168 C++ object with a non-trivial default constructor.  If so, synthesize a
2169 special @code{- (id) .cxx_construct} instance method that will run
2170 non-trivial default constructors on any such instance variables, in order,
2171 and then return @code{self}.  Similarly, check if any instance variable
2172 is a C++ object with a non-trivial destructor, and if so, synthesize a
2173 special @code{- (void) .cxx_destruct} method that will run
2174 all such default destructors, in reverse order.
2175
2176 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2177 thusly generated will only operate on instance variables declared in the
2178 current Objective-C class, and not those inherited from superclasses.  It
2179 is the responsibility of the Objective-C runtime to invoke all such methods
2180 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2181 will be invoked by the runtime immediately after a new object
2182 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2183 be invoked immediately before the runtime deallocates an object instance.
2184
2185 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2186 support for invoking the @code{- (id) .cxx_construct} and
2187 @code{- (void) .cxx_destruct} methods.
2188
2189 @item -fobjc-direct-dispatch
2190 @opindex fobjc-direct-dispatch
2191 Allow fast jumps to the message dispatcher.  On Darwin this is
2192 accomplished via the comm page.
2193
2194 @item -fobjc-exceptions
2195 @opindex fobjc-exceptions
2196 Enable syntactic support for structured exception handling in Objective-C,
2197 similar to what is offered by C++ and Java.  This option is
2198 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2199 earlier.
2200
2201 @smallexample
2202   @@try @{
2203     @dots{}
2204        @@throw expr;
2205     @dots{}
2206   @}
2207   @@catch (AnObjCClass *exc) @{
2208     @dots{}
2209       @@throw expr;
2210     @dots{}
2211       @@throw;
2212     @dots{}
2213   @}
2214   @@catch (AnotherClass *exc) @{
2215     @dots{}
2216   @}
2217   @@catch (id allOthers) @{
2218     @dots{}
2219   @}
2220   @@finally @{
2221     @dots{}
2222       @@throw expr;
2223     @dots{}
2224   @}
2225 @end smallexample
2226
2227 The @code{@@throw} statement may appear anywhere in an Objective-C or
2228 Objective-C++ program; when used inside of a @code{@@catch} block, the
2229 @code{@@throw} may appear without an argument (as shown above), in which case
2230 the object caught by the @code{@@catch} will be rethrown.
2231
2232 Note that only (pointers to) Objective-C objects may be thrown and
2233 caught using this scheme.  When an object is thrown, it will be caught
2234 by the nearest @code{@@catch} clause capable of handling objects of that type,
2235 analogously to how @code{catch} blocks work in C++ and Java.  A
2236 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2237 any and all Objective-C exceptions not caught by previous @code{@@catch}
2238 clauses (if any).
2239
2240 The @code{@@finally} clause, if present, will be executed upon exit from the
2241 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2242 regardless of whether any exceptions are thrown, caught or rethrown
2243 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2244 of the @code{finally} clause in Java.
2245
2246 There are several caveats to using the new exception mechanism:
2247
2248 @itemize @bullet
2249 @item
2250 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2251 idioms provided by the @code{NSException} class, the new
2252 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2253 systems, due to additional functionality needed in the (NeXT) Objective-C
2254 runtime.
2255
2256 @item
2257 As mentioned above, the new exceptions do not support handling
2258 types other than Objective-C objects.   Furthermore, when used from
2259 Objective-C++, the Objective-C exception model does not interoperate with C++
2260 exceptions at this time.  This means you cannot @code{@@throw} an exception
2261 from Objective-C and @code{catch} it in C++, or vice versa
2262 (i.e., @code{throw @dots{} @@catch}).
2263 @end itemize
2264
2265 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2266 blocks for thread-safe execution:
2267
2268 @smallexample
2269   @@synchronized (ObjCClass *guard) @{
2270     @dots{}
2271   @}
2272 @end smallexample
2273
2274 Upon entering the @code{@@synchronized} block, a thread of execution shall
2275 first check whether a lock has been placed on the corresponding @code{guard}
2276 object by another thread.  If it has, the current thread shall wait until
2277 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2278 the current thread will place its own lock on it, execute the code contained in
2279 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2280 making @code{guard} available to other threads).
2281
2282 Unlike Java, Objective-C does not allow for entire methods to be marked
2283 @code{@@synchronized}.  Note that throwing exceptions out of
2284 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2285 to be unlocked properly.
2286
2287 @item -fobjc-gc
2288 @opindex fobjc-gc
2289 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2290
2291 @item -freplace-objc-classes
2292 @opindex freplace-objc-classes
2293 Emit a special marker instructing @command{ld(1)} not to statically link in
2294 the resulting object file, and allow @command{dyld(1)} to load it in at
2295 run time instead.  This is used in conjunction with the Fix-and-Continue
2296 debugging mode, where the object file in question may be recompiled and
2297 dynamically reloaded in the course of program execution, without the need
2298 to restart the program itself.  Currently, Fix-and-Continue functionality
2299 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2300 and later.
2301
2302 @item -fzero-link
2303 @opindex fzero-link
2304 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2305 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2306 compile time) with static class references that get initialized at load time,
2307 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2308 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2309 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2310 for individual class implementations to be modified during program execution.
2311
2312 @item -gen-decls
2313 @opindex gen-decls
2314 Dump interface declarations for all classes seen in the source file to a
2315 file named @file{@var{sourcename}.decl}.
2316
2317 @item -Wassign-intercept
2318 @opindex Wassign-intercept
2319 Warn whenever an Objective-C assignment is being intercepted by the
2320 garbage collector.
2321
2322 @item -Wno-protocol
2323 @opindex Wno-protocol
2324 If a class is declared to implement a protocol, a warning is issued for
2325 every method in the protocol that is not implemented by the class.  The
2326 default behavior is to issue a warning for every method not explicitly
2327 implemented in the class, even if a method implementation is inherited
2328 from the superclass.  If you use the @option{-Wno-protocol} option, then
2329 methods inherited from the superclass are considered to be implemented,
2330 and no warning is issued for them.
2331
2332 @item -Wselector
2333 @opindex Wselector
2334 Warn if multiple methods of different types for the same selector are
2335 found during compilation.  The check is performed on the list of methods
2336 in the final stage of compilation.  Additionally, a check is performed
2337 for each selector appearing in a @code{@@selector(@dots{})}
2338 expression, and a corresponding method for that selector has been found
2339 during compilation.  Because these checks scan the method table only at
2340 the end of compilation, these warnings are not produced if the final
2341 stage of compilation is not reached, for example because an error is
2342 found during compilation, or because the @option{-fsyntax-only} option is
2343 being used.
2344
2345 @item -Wstrict-selector-match
2346 @opindex Wstrict-selector-match
2347 Warn if multiple methods with differing argument and/or return types are
2348 found for a given selector when attempting to send a message using this
2349 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2350 is off (which is the default behavior), the compiler will omit such warnings
2351 if any differences found are confined to types which share the same size
2352 and alignment.
2353
2354 @item -Wundeclared-selector
2355 @opindex Wundeclared-selector
2356 Warn if a @code{@@selector(@dots{})} expression referring to an
2357 undeclared selector is found.  A selector is considered undeclared if no
2358 method with that name has been declared before the
2359 @code{@@selector(@dots{})} expression, either explicitly in an
2360 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2361 an @code{@@implementation} section.  This option always performs its
2362 checks as soon as a @code{@@selector(@dots{})} expression is found,
2363 while @option{-Wselector} only performs its checks in the final stage of
2364 compilation.  This also enforces the coding style convention
2365 that methods and selectors must be declared before being used.
2366
2367 @item -print-objc-runtime-info
2368 @opindex print-objc-runtime-info
2369 Generate C header describing the largest structure that is passed by
2370 value, if any.
2371
2372 @end table
2373
2374 @node Language Independent Options
2375 @section Options to Control Diagnostic Messages Formatting
2376 @cindex options to control diagnostics formatting
2377 @cindex diagnostic messages
2378 @cindex message formatting
2379
2380 Traditionally, diagnostic messages have been formatted irrespective of
2381 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2382 below can be used to control the diagnostic messages formatting
2383 algorithm, e.g.@: how many characters per line, how often source location
2384 information should be reported.  Right now, only the C++ front end can
2385 honor these options.  However it is expected, in the near future, that
2386 the remaining front ends would be able to digest them correctly.
2387
2388 @table @gcctabopt
2389 @item -fmessage-length=@var{n}
2390 @opindex fmessage-length
2391 Try to format error messages so that they fit on lines of about @var{n}
2392 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2393 the front ends supported by GCC@.  If @var{n} is zero, then no
2394 line-wrapping will be done; each error message will appear on a single
2395 line.
2396
2397 @opindex fdiagnostics-show-location
2398 @item -fdiagnostics-show-location=once
2399 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2400 reporter to emit @emph{once} source location information; that is, in
2401 case the message is too long to fit on a single physical line and has to
2402 be wrapped, the source location won't be emitted (as prefix) again,
2403 over and over, in subsequent continuation lines.  This is the default
2404 behavior.
2405
2406 @item -fdiagnostics-show-location=every-line
2407 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2408 messages reporter to emit the same source location information (as
2409 prefix) for physical lines that result from the process of breaking
2410 a message which is too long to fit on a single line.
2411
2412 @item -fdiagnostics-show-option
2413 @opindex fdiagnostics-show-option
2414 This option instructs the diagnostic machinery to add text to each
2415 diagnostic emitted, which indicates which command line option directly
2416 controls that diagnostic, when such an option is known to the
2417 diagnostic machinery.
2418
2419 @item -Wcoverage-mismatch
2420 @opindex Wcoverage-mismatch
2421 Warn if feedback profiles do not match when using the
2422 @option{-fprofile-use} option.
2423 If a source file was changed between @option{-fprofile-gen} and
2424 @option{-fprofile-use}, the files with the profile feedback can fail
2425 to match the source file and GCC can not use the profile feedback
2426 information.  By default, GCC emits an error message in this case.
2427 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2428 error.  GCC does not use appropriate feedback profiles, so using this
2429 option can result in poorly optimized code.  This option is useful
2430 only in the case of very minor changes such as bug fixes to an
2431 existing code-base.
2432
2433 @end table
2434
2435 @node Warning Options
2436 @section Options to Request or Suppress Warnings
2437 @cindex options to control warnings
2438 @cindex warning messages
2439 @cindex messages, warning
2440 @cindex suppressing warnings
2441
2442 Warnings are diagnostic messages that report constructions which
2443 are not inherently erroneous but which are risky or suggest there
2444 may have been an error.
2445
2446 You can request many specific warnings with options beginning @samp{-W},
2447 for example @option{-Wimplicit} to request warnings on implicit
2448 declarations.  Each of these specific warning options also has a
2449 negative form beginning @samp{-Wno-} to turn off warnings;
2450 for example, @option{-Wno-implicit}.  This manual lists only one of the
2451 two forms, whichever is not the default.
2452
2453 The following options control the amount and kinds of warnings produced
2454 by GCC; for further, language-specific options also refer to
2455 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2456 Options}.
2457
2458 @table @gcctabopt
2459 @cindex syntax checking
2460 @item -fsyntax-only
2461 @opindex fsyntax-only
2462 Check the code for syntax errors, but don't do anything beyond that.
2463
2464 @item -pedantic
2465 @opindex pedantic
2466 Issue all the warnings demanded by strict ISO C and ISO C++;
2467 reject all programs that use forbidden extensions, and some other
2468 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2469 version of the ISO C standard specified by any @option{-std} option used.
2470
2471 Valid ISO C and ISO C++ programs should compile properly with or without
2472 this option (though a rare few will require @option{-ansi} or a
2473 @option{-std} option specifying the required version of ISO C)@.  However,
2474 without this option, certain GNU extensions and traditional C and C++
2475 features are supported as well.  With this option, they are rejected.
2476
2477 @option{-pedantic} does not cause warning messages for use of the
2478 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2479 warnings are also disabled in the expression that follows
2480 @code{__extension__}.  However, only system header files should use
2481 these escape routes; application programs should avoid them.
2482 @xref{Alternate Keywords}.
2483
2484 Some users try to use @option{-pedantic} to check programs for strict ISO
2485 C conformance.  They soon find that it does not do quite what they want:
2486 it finds some non-ISO practices, but not all---only those for which
2487 ISO C @emph{requires} a diagnostic, and some others for which
2488 diagnostics have been added.
2489
2490 A feature to report any failure to conform to ISO C might be useful in
2491 some instances, but would require considerable additional work and would
2492 be quite different from @option{-pedantic}.  We don't have plans to
2493 support such a feature in the near future.
2494
2495 Where the standard specified with @option{-std} represents a GNU
2496 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2497 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2498 extended dialect is based.  Warnings from @option{-pedantic} are given
2499 where they are required by the base standard.  (It would not make sense
2500 for such warnings to be given only for features not in the specified GNU
2501 C dialect, since by definition the GNU dialects of C include all
2502 features the compiler supports with the given option, and there would be
2503 nothing to warn about.)
2504
2505 @item -pedantic-errors
2506 @opindex pedantic-errors
2507 Like @option{-pedantic}, except that errors are produced rather than
2508 warnings.
2509
2510 @item -w
2511 @opindex w
2512 Inhibit all warning messages.
2513
2514 @item -Wno-import
2515 @opindex Wno-import
2516 Inhibit warning messages about the use of @samp{#import}.
2517
2518 @item -Wchar-subscripts
2519 @opindex Wchar-subscripts
2520 Warn if an array subscript has type @code{char}.  This is a common cause
2521 of error, as programmers often forget that this type is signed on some
2522 machines.
2523 This warning is enabled by @option{-Wall}.
2524
2525 @item -Wcomment
2526 @opindex Wcomment
2527 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2528 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2529 This warning is enabled by @option{-Wall}.
2530
2531 @item -Wfatal-errors
2532 @opindex Wfatal-errors
2533 This option causes the compiler to abort compilation on the first error
2534 occurred rather than trying to keep going and printing further error
2535 messages.
2536
2537 @item -Wformat
2538 @opindex Wformat
2539 @opindex ffreestanding
2540 @opindex fno-builtin
2541 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2542 the arguments supplied have types appropriate to the format string
2543 specified, and that the conversions specified in the format string make
2544 sense.  This includes standard functions, and others specified by format
2545 attributes (@pxref{Function Attributes}), in the @code{printf},
2546 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2547 not in the C standard) families (or other target-specific families).
2548 Which functions are checked without format attributes having been
2549 specified depends on the standard version selected, and such checks of
2550 functions without the attribute specified are disabled by
2551 @option{-ffreestanding} or @option{-fno-builtin}.
2552
2553 The formats are checked against the format features supported by GNU
2554 libc version 2.2.  These include all ISO C90 and C99 features, as well
2555 as features from the Single Unix Specification and some BSD and GNU
2556 extensions.  Other library implementations may not support all these
2557 features; GCC does not support warning about features that go beyond a
2558 particular library's limitations.  However, if @option{-pedantic} is used
2559 with @option{-Wformat}, warnings will be given about format features not
2560 in the selected standard version (but not for @code{strfmon} formats,
2561 since those are not in any version of the C standard).  @xref{C Dialect
2562 Options,,Options Controlling C Dialect}.
2563
2564 Since @option{-Wformat} also checks for null format arguments for
2565 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2566
2567 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2568 aspects of format checking, the options @option{-Wformat-y2k},
2569 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2570 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2571 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2572
2573 @item -Wformat-y2k
2574 @opindex Wformat-y2k
2575 If @option{-Wformat} is specified, also warn about @code{strftime}
2576 formats which may yield only a two-digit year.
2577
2578 @item -Wno-format-extra-args
2579 @opindex Wno-format-extra-args
2580 If @option{-Wformat} is specified, do not warn about excess arguments to a
2581 @code{printf} or @code{scanf} format function.  The C standard specifies
2582 that such arguments are ignored.
2583
2584 Where the unused arguments lie between used arguments that are
2585 specified with @samp{$} operand number specifications, normally
2586 warnings are still given, since the implementation could not know what
2587 type to pass to @code{va_arg} to skip the unused arguments.  However,
2588 in the case of @code{scanf} formats, this option will suppress the
2589 warning if the unused arguments are all pointers, since the Single
2590 Unix Specification says that such unused arguments are allowed.
2591
2592 @item -Wno-format-zero-length
2593 @opindex Wno-format-zero-length
2594 If @option{-Wformat} is specified, do not warn about zero-length formats.
2595 The C standard specifies that zero-length formats are allowed.
2596
2597 @item -Wformat-nonliteral
2598 @opindex Wformat-nonliteral
2599 If @option{-Wformat} is specified, also warn if the format string is not a
2600 string literal and so cannot be checked, unless the format function
2601 takes its format arguments as a @code{va_list}.
2602
2603 @item -Wformat-security
2604 @opindex Wformat-security
2605 If @option{-Wformat} is specified, also warn about uses of format
2606 functions that represent possible security problems.  At present, this
2607 warns about calls to @code{printf} and @code{scanf} functions where the
2608 format string is not a string literal and there are no format arguments,
2609 as in @code{printf (foo);}.  This may be a security hole if the format
2610 string came from untrusted input and contains @samp{%n}.  (This is
2611 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2612 in future warnings may be added to @option{-Wformat-security} that are not
2613 included in @option{-Wformat-nonliteral}.)
2614
2615 @item -Wformat=2
2616 @opindex Wformat=2
2617 Enable @option{-Wformat} plus format checks not included in
2618 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2619 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2620
2621 @item -Wnonnull
2622 @opindex Wnonnull
2623 Warn about passing a null pointer for arguments marked as
2624 requiring a non-null value by the @code{nonnull} function attribute.
2625
2626 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2627 can be disabled with the @option{-Wno-nonnull} option.
2628
2629 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2630 @opindex Winit-self
2631 Warn about uninitialized variables which are initialized with themselves.
2632 Note this option can only be used with the @option{-Wuninitialized} option,
2633 which in turn only works with @option{-O1} and above.
2634
2635 For example, GCC will warn about @code{i} being uninitialized in the
2636 following snippet only when @option{-Winit-self} has been specified:
2637 @smallexample
2638 @group
2639 int f()
2640 @{
2641   int i = i;
2642   return i;
2643 @}
2644 @end group
2645 @end smallexample
2646
2647 @item -Wimplicit-int
2648 @opindex Wimplicit-int
2649 Warn when a declaration does not specify a type.
2650 This warning is enabled by @option{-Wall}.
2651
2652 @item -Wimplicit-function-declaration
2653 @opindex Wimplicit-function-declaration
2654 @opindex Wno-implicit-function-declaration
2655 Give a warning whenever a function is used before being declared. In
2656 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2657 enabled by default and it is made into an error by
2658 @option{-pedantic-errors}. This warning is also enabled by
2659 @option{-Wall}.
2660
2661 @item -Wimplicit
2662 @opindex Wimplicit
2663 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2664 This warning is enabled by @option{-Wall}.
2665
2666 @item -Wmain
2667 @opindex Wmain
2668 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2669 function with external linkage, returning int, taking either zero
2670 arguments, two, or three arguments of appropriate types.
2671 This warning is enabled by @option{-Wall}.
2672
2673 @item -Wmissing-braces
2674 @opindex Wmissing-braces
2675 Warn if an aggregate or union initializer is not fully bracketed.  In
2676 the following example, the initializer for @samp{a} is not fully
2677 bracketed, but that for @samp{b} is fully bracketed.
2678
2679 @smallexample
2680 int a[2][2] = @{ 0, 1, 2, 3 @};
2681 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2682 @end smallexample
2683
2684 This warning is enabled by @option{-Wall}.
2685
2686 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2687 @opindex Wmissing-include-dirs
2688 Warn if a user-supplied include directory does not exist.
2689
2690 @item -Wparentheses
2691 @opindex Wparentheses
2692 Warn if parentheses are omitted in certain contexts, such
2693 as when there is an assignment in a context where a truth value
2694 is expected, or when operators are nested whose precedence people
2695 often get confused about.
2696
2697 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2698 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2699 interpretation from that of ordinary mathematical notation.
2700
2701 Also warn about constructions where there may be confusion to which
2702 @code{if} statement an @code{else} branch belongs.  Here is an example of
2703 such a case:
2704
2705 @smallexample
2706 @group
2707 @{
2708   if (a)
2709     if (b)
2710       foo ();
2711   else
2712     bar ();
2713 @}
2714 @end group
2715 @end smallexample
2716
2717 In C/C++, every @code{else} branch belongs to the innermost possible
2718 @code{if} statement, which in this example is @code{if (b)}.  This is
2719 often not what the programmer expected, as illustrated in the above
2720 example by indentation the programmer chose.  When there is the
2721 potential for this confusion, GCC will issue a warning when this flag
2722 is specified.  To eliminate the warning, add explicit braces around
2723 the innermost @code{if} statement so there is no way the @code{else}
2724 could belong to the enclosing @code{if}.  The resulting code would
2725 look like this:
2726
2727 @smallexample
2728 @group
2729 @{
2730   if (a)
2731     @{
2732       if (b)
2733         foo ();
2734       else
2735         bar ();
2736     @}
2737 @}
2738 @end group
2739 @end smallexample
2740
2741 This warning is enabled by @option{-Wall}.
2742
2743 @item -Wsequence-point
2744 @opindex Wsequence-point
2745 Warn about code that may have undefined semantics because of violations
2746 of sequence point rules in the C and C++ standards.
2747
2748 The C and C++ standards defines the order in which expressions in a C/C++
2749 program are evaluated in terms of @dfn{sequence points}, which represent
2750 a partial ordering between the execution of parts of the program: those
2751 executed before the sequence point, and those executed after it.  These
2752 occur after the evaluation of a full expression (one which is not part
2753 of a larger expression), after the evaluation of the first operand of a
2754 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2755 function is called (but after the evaluation of its arguments and the
2756 expression denoting the called function), and in certain other places.
2757 Other than as expressed by the sequence point rules, the order of
2758 evaluation of subexpressions of an expression is not specified.  All
2759 these rules describe only a partial order rather than a total order,
2760 since, for example, if two functions are called within one expression
2761 with no sequence point between them, the order in which the functions
2762 are called is not specified.  However, the standards committee have
2763 ruled that function calls do not overlap.
2764
2765 It is not specified when between sequence points modifications to the
2766 values of objects take effect.  Programs whose behavior depends on this
2767 have undefined behavior; the C and C++ standards specify that ``Between
2768 the previous and next sequence point an object shall have its stored
2769 value modified at most once by the evaluation of an expression.  
2770 Furthermore, the prior value shall be read only to determine the value
2771 to be stored.''.  If a program breaks these rules, the results on any
2772 particular implementation are entirely unpredictable.
2773
2774 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2775 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2776 diagnosed by this option, and it may give an occasional false positive
2777 result, but in general it has been found fairly effective at detecting
2778 this sort of problem in programs.
2779
2780 The standard is worded confusingly, therefore there is some debate
2781 over the precise meaning of the sequence point rules in subtle cases.
2782 Links to discussions of the problem, including proposed formal
2783 definitions, may be found on the GCC readings page, at
2784 @w{@uref{http://gcc.gnu.org/readings.html}}.
2785
2786 This warning is enabled by @option{-Wall} for C and C++.
2787
2788 @item -Wreturn-type
2789 @opindex Wreturn-type
2790 Warn whenever a function is defined with a return-type that defaults to
2791 @code{int}.  Also warn about any @code{return} statement with no
2792 return-value in a function whose return-type is not @code{void}.
2793
2794 Also warn if the return type of a function has a type qualifier
2795 such as @code{const}.  For ISO C such a type qualifier has no effect,
2796 since the value returned by a function is not an lvalue.
2797 For C++, the warning is only emitted for scalar types or @code{void}.
2798 ISO C prohibits qualified @code{void} return types on function
2799 definitions, so such return types always receive a warning
2800 even without this option.
2801
2802 For C++, a function without return type always produces a diagnostic
2803 message, even when @option{-Wno-return-type} is specified.  The only
2804 exceptions are @samp{main} and functions defined in system headers.
2805
2806 This warning is enabled by @option{-Wall}.
2807
2808 @item -Wswitch
2809 @opindex Wswitch
2810 Warn whenever a @code{switch} statement has an index of enumerated type
2811 and lacks a @code{case} for one or more of the named codes of that
2812 enumeration.  (The presence of a @code{default} label prevents this
2813 warning.)  @code{case} labels outside the enumeration range also
2814 provoke warnings when this option is used.
2815 This warning is enabled by @option{-Wall}.
2816
2817 @item -Wswitch-default
2818 @opindex Wswitch-switch
2819 Warn whenever a @code{switch} statement does not have a @code{default}
2820 case.
2821
2822 @item -Wswitch-enum
2823 @opindex Wswitch-enum
2824 Warn whenever a @code{switch} statement has an index of enumerated type
2825 and lacks a @code{case} for one or more of the named codes of that
2826 enumeration.  @code{case} labels outside the enumeration range also
2827 provoke warnings when this option is used.
2828
2829 @item -Wtrigraphs
2830 @opindex Wtrigraphs
2831 Warn if any trigraphs are encountered that might change the meaning of
2832 the program (trigraphs within comments are not warned about).
2833 This warning is enabled by @option{-Wall}.
2834
2835 @item -Wunused-function
2836 @opindex Wunused-function
2837 Warn whenever a static function is declared but not defined or a
2838 non-inline static function is unused.
2839 This warning is enabled by @option{-Wall}.
2840
2841 @item -Wunused-label
2842 @opindex Wunused-label
2843 Warn whenever a label is declared but not used.
2844 This warning is enabled by @option{-Wall}.
2845
2846 To suppress this warning use the @samp{unused} attribute
2847 (@pxref{Variable Attributes}).
2848
2849 @item -Wunused-parameter
2850 @opindex Wunused-parameter
2851 Warn whenever a function parameter is unused aside from its declaration.
2852
2853 To suppress this warning use the @samp{unused} attribute
2854 (@pxref{Variable Attributes}).
2855
2856 @item -Wunused-variable
2857 @opindex Wunused-variable
2858 Warn whenever a local variable or non-constant static variable is unused
2859 aside from its declaration.
2860 This warning is enabled by @option{-Wall}.
2861
2862 To suppress this warning use the @samp{unused} attribute
2863 (@pxref{Variable Attributes}).
2864
2865 @item -Wunused-value
2866 @opindex Wunused-value
2867 Warn whenever a statement computes a result that is explicitly not
2868 used. To suppress this warning cast the unused expression to
2869 @samp{void}. This includes an expression-statement or the left-hand
2870 side of a comma expression that contains no side effects. For example,
2871 an expression such as @samp{x[i,j]} will cause a warning, while
2872 @samp{x[(void)i,j]} will not.
2873
2874 This warning is enabled by @option{-Wall}.
2875
2876 @item -Wunused
2877 @opindex Wunused
2878 All the above @option{-Wunused} options combined.
2879
2880 In order to get a warning about an unused function parameter, you must
2881 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2882 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2883
2884 @item -Wuninitialized
2885 @opindex Wuninitialized
2886 Warn if an automatic variable is used without first being initialized or
2887 if a variable may be clobbered by a @code{setjmp} call.
2888
2889 These warnings are possible only in optimizing compilation,
2890 because they require data flow information that is computed only
2891 when optimizing.  If you do not specify @option{-O}, you will not get
2892 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2893 requiring @option{-O}.
2894
2895 If you want to warn about code which uses the uninitialized value of the
2896 variable in its own initializer, use the @option{-Winit-self} option.
2897
2898 These warnings occur for individual uninitialized or clobbered
2899 elements of structure, union or array variables as well as for
2900 variables which are uninitialized or clobbered as a whole.  They do
2901 not occur for variables or elements declared @code{volatile}.  Because
2902 these warnings depend on optimization, the exact variables or elements
2903 for which there are warnings will depend on the precise optimization
2904 options and version of GCC used.
2905
2906 Note that there may be no warning about a variable that is used only
2907 to compute a value that itself is never used, because such
2908 computations may be deleted by data flow analysis before the warnings
2909 are printed.
2910
2911 These warnings are made optional because GCC is not smart
2912 enough to see all the reasons why the code might be correct
2913 despite appearing to have an error.  Here is one example of how
2914 this can happen:
2915
2916 @smallexample
2917 @group
2918 @{
2919   int x;
2920   switch (y)
2921     @{
2922     case 1: x = 1;
2923       break;
2924     case 2: x = 4;
2925       break;
2926     case 3: x = 5;
2927     @}
2928   foo (x);
2929 @}
2930 @end group
2931 @end smallexample
2932
2933 @noindent
2934 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2935 always initialized, but GCC doesn't know this.  Here is
2936 another common case:
2937
2938 @smallexample
2939 @{
2940   int save_y;
2941   if (change_y) save_y = y, y = new_y;
2942   @dots{}
2943   if (change_y) y = save_y;
2944 @}
2945 @end smallexample
2946
2947 @noindent
2948 This has no bug because @code{save_y} is used only if it is set.
2949
2950 @cindex @code{longjmp} warnings
2951 This option also warns when a non-volatile automatic variable might be
2952 changed by a call to @code{longjmp}.  These warnings as well are possible
2953 only in optimizing compilation.
2954
2955 The compiler sees only the calls to @code{setjmp}.  It cannot know
2956 where @code{longjmp} will be called; in fact, a signal handler could
2957 call it at any point in the code.  As a result, you may get a warning
2958 even when there is in fact no problem because @code{longjmp} cannot
2959 in fact be called at the place which would cause a problem.
2960
2961 Some spurious warnings can be avoided if you declare all the functions
2962 you use that never return as @code{noreturn}.  @xref{Function
2963 Attributes}.
2964
2965 This warning is enabled by @option{-Wall}.
2966
2967 @item -Wunknown-pragmas
2968 @opindex Wunknown-pragmas
2969 @cindex warning for unknown pragmas
2970 @cindex unknown pragmas, warning
2971 @cindex pragmas, warning of unknown
2972 Warn when a #pragma directive is encountered which is not understood by
2973 GCC@.  If this command line option is used, warnings will even be issued
2974 for unknown pragmas in system header files.  This is not the case if
2975 the warnings were only enabled by the @option{-Wall} command line option.
2976
2977 @item -Wno-pragmas
2978 @opindex Wno-pragmas
2979 @opindex Wpragmas
2980 Do not warn about misuses of pragmas, such as incorrect parameters,
2981 invalid syntax, or conflicts between pragmas.  See also
2982 @samp{-Wunknown-pragmas}.
2983
2984 @item -Wstrict-aliasing
2985 @opindex Wstrict-aliasing
2986 This option is only active when @option{-fstrict-aliasing} is active.
2987 It warns about code which might break the strict aliasing rules that the
2988 compiler is using for optimization.  The warning does not catch all
2989 cases, but does attempt to catch the more common pitfalls.  It is
2990 included in @option{-Wall}.
2991
2992 @item -Wstrict-aliasing=2
2993 @opindex Wstrict-aliasing=2
2994 This option is only active when @option{-fstrict-aliasing} is active.
2995 It warns about code which might break the strict aliasing rules that the
2996 compiler is using for optimization.  This warning catches more cases than
2997 @option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
2998 cases that are safe.
2999
3000 @item -Wstrict-overflow
3001 @item -Wstrict-overflow=@var{n}
3002 @opindex -Wstrict-overflow
3003 This option is only active when @option{-fstrict-overflow} is active.
3004 It warns about cases where the compiler optimizes based on the
3005 assumption that signed overflow does not occur.  Note that it does not
3006 warn about all cases where the code might overflow: it only warns
3007 about cases where the compiler implements some optimization.  Thus
3008 this warning depends on the optimization level.
3009
3010 An optimization which assumes that signed overflow does not occur is
3011 perfectly safe if the values of the variables involved are such that
3012 overflow never does, in fact, occur.  Therefore this warning can
3013 easily give a false positive: a warning about code which is not
3014 actually a problem.  To help focus on important issues, several
3015 warning levels are defined.
3016
3017 @table @option
3018 @item -Wstrict-overflow=1
3019 Warn about cases which are both questionable and easy to avoid.  For
3020 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3021 compiler will simplify this to @code{1}.  This level of
3022 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3023 are not, and must be explicitly requested.
3024
3025 @item -Wstrict-overflow=2
3026 Also warn about other cases where a comparison is simplified to a
3027 constant.  For example: @code{abs (x) >= 0}.  This can only be
3028 simplified when @option{-fstrict-overflow} is in effect, because
3029 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3030 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3031 @option{-Wstrict-overflow=2}.
3032
3033 @item -Wstrict-overflow=3
3034 Also warn about other cases where a comparison is simplified.  For
3035 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3036
3037 @item -Wstrict-overflow=4
3038 Also warn about other simplifications not covered by the above cases.
3039 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3040
3041 @item -Wstrict-overflow=5
3042 Also warn about cases where the compiler reduces the magnitude of a
3043 constant involved in a comparison.  For example: @code{x + 2 > y} will
3044 be simplified to @code{x + 1 >= y}.  This is reported only at the
3045 highest warning level because this simplification applies to many
3046 comparisons, so this warning level will give a very large number of
3047 false positives.
3048 @end table
3049
3050 @item -Warray-bounds
3051 @opindex Wno-array-bounds
3052 @opindex Warray-bounds
3053 This option is only active when @option{-ftree-vrp} is active
3054 (default for -O2 and above). It warns about subscripts to arrays
3055 that are always out of bounds. This warning is enabled by @option{-Wall}.
3056
3057 @item -Wall
3058 @opindex Wall
3059 All of the above @samp{-W} options combined.  This enables all the
3060 warnings about constructions that some users consider questionable, and
3061 that are easy to avoid (or modify to prevent the warning), even in
3062 conjunction with macros.  This also enables some language-specific
3063 warnings described in @ref{C++ Dialect Options} and
3064 @ref{Objective-C and Objective-C++ Dialect Options}.
3065 @end table
3066
3067 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
3068 Some of them warn about constructions that users generally do not
3069 consider questionable, but which occasionally you might wish to check
3070 for; others warn about constructions that are necessary or hard to avoid
3071 in some cases, and there is no simple way to modify the code to suppress
3072 the warning.
3073
3074 @table @gcctabopt
3075 @item -Wextra
3076 @opindex W
3077 @opindex Wextra
3078 (This option used to be called @option{-W}.  The older name is still
3079 supported, but the newer name is more descriptive.)  Print extra warning
3080 messages for these events:
3081
3082 @itemize @bullet
3083 @item
3084 A function can return either with or without a value.  (Falling
3085 off the end of the function body is considered returning without
3086 a value.)  For example, this function would evoke such a
3087 warning:
3088
3089 @smallexample
3090 @group
3091 foo (a)
3092 @{
3093   if (a > 0)
3094     return a;
3095 @}
3096 @end group
3097 @end smallexample
3098
3099 @item
3100 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
3101
3102 @item @r{(C only)}
3103 Storage-class specifiers like @code{static} are not the first things
3104 in a declaration.  According to the C Standard, this usage is
3105 obsolescent.  This warning can be independently controlled by
3106 @option{-Wold-style-declaration}.
3107
3108 @item
3109 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
3110 arguments.
3111
3112 @item
3113 A comparison between signed and unsigned values could produce an
3114 incorrect result when the signed value is converted to unsigned.
3115 (But don't warn if @option{-Wno-sign-compare} is also specified.)
3116
3117 @item
3118 An aggregate has an initializer which does not initialize all members.
3119 This warning can be independently controlled by
3120 @option{-Wmissing-field-initializers}.
3121
3122 @item
3123 An initialized field without side effects is overridden when using
3124 designated initializers (@pxref{Designated Inits, , Designated
3125 Initializers}).  This warning can be independently controlled by
3126 @option{-Woverride-init}.
3127
3128 @item @r{(C only)}
3129 A function parameter is declared without a type specifier in K&R-style
3130 functions.  This warning can be independently controlled by
3131 @option{-Wmissing-parameter-type}.
3132
3133 @item
3134 An empty body occurs in an @samp{if} or @samp{else} statement. This
3135 warning can be independently controlled by @option{-Wempty-body}.
3136
3137 @item
3138 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3139 @samp{>}, or @samp{>=}.
3140
3141 @item
3142 A variable might be changed by @samp{longjmp} or @samp{vfork}.
3143 This warning can be independently controlled by @option{-Wclobbered}.
3144
3145 @item @r{(C++ only)}
3146 An enumerator and a non-enumerator both appear in a conditional expression.
3147
3148 @item @r{(C++ only)}
3149 A non-static reference or non-static @samp{const} member appears in a
3150 class without constructors.
3151
3152 @item @r{(C++ only)}
3153 Ambiguous virtual bases.
3154
3155 @item @r{(C++ only)}
3156 Subscripting an array which has been declared @samp{register}.
3157
3158 @item @r{(C++ only)}
3159 Taking the address of a variable which has been declared @samp{register}.
3160
3161 @item @r{(C++ only)}
3162 A base class is not initialized in a derived class' copy constructor.
3163 @end itemize
3164
3165 @item -Wno-div-by-zero
3166 @opindex Wno-div-by-zero
3167 @opindex Wdiv-by-zero
3168 Do not warn about compile-time integer division by zero.  Floating point
3169 division by zero is not warned about, as it can be a legitimate way of
3170 obtaining infinities and NaNs.
3171
3172 @item -Wsystem-headers
3173 @opindex Wsystem-headers
3174 @cindex warnings from system headers
3175 @cindex system headers, warnings from
3176 Print warning messages for constructs found in system header files.
3177 Warnings from system headers are normally suppressed, on the assumption
3178 that they usually do not indicate real problems and would only make the
3179 compiler output harder to read.  Using this command line option tells
3180 GCC to emit warnings from system headers as if they occurred in user
3181 code.  However, note that using @option{-Wall} in conjunction with this
3182 option will @emph{not} warn about unknown pragmas in system
3183 headers---for that, @option{-Wunknown-pragmas} must also be used.
3184
3185 @item -Wfloat-equal
3186 @opindex Wfloat-equal
3187 Warn if floating point values are used in equality comparisons.
3188
3189 The idea behind this is that sometimes it is convenient (for the
3190 programmer) to consider floating-point values as approximations to
3191 infinitely precise real numbers.  If you are doing this, then you need
3192 to compute (by analyzing the code, or in some other way) the maximum or
3193 likely maximum error that the computation introduces, and allow for it
3194 when performing comparisons (and when producing output, but that's a
3195 different problem).  In particular, instead of testing for equality, you
3196 would check to see whether the two values have ranges that overlap; and
3197 this is done with the relational operators, so equality comparisons are
3198 probably mistaken.
3199
3200 @item -Wtraditional @r{(C only)}
3201 @opindex Wtraditional
3202 Warn about certain constructs that behave differently in traditional and
3203 ISO C@.  Also warn about ISO C constructs that have no traditional C
3204 equivalent, and/or problematic constructs which should be avoided.
3205
3206 @itemize @bullet
3207 @item
3208 Macro parameters that appear within string literals in the macro body.
3209 In traditional C macro replacement takes place within string literals,
3210 but does not in ISO C@.
3211
3212 @item
3213 In traditional C, some preprocessor directives did not exist.
3214 Traditional preprocessors would only consider a line to be a directive
3215 if the @samp{#} appeared in column 1 on the line.  Therefore
3216 @option{-Wtraditional} warns about directives that traditional C
3217 understands but would ignore because the @samp{#} does not appear as the
3218 first character on the line.  It also suggests you hide directives like
3219 @samp{#pragma} not understood by traditional C by indenting them.  Some
3220 traditional implementations would not recognize @samp{#elif}, so it
3221 suggests avoiding it altogether.
3222
3223 @item
3224 A function-like macro that appears without arguments.
3225
3226 @item
3227 The unary plus operator.
3228
3229 @item
3230 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3231 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3232 constants.)  Note, these suffixes appear in macros defined in the system
3233 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3234 Use of these macros in user code might normally lead to spurious
3235 warnings, however GCC's integrated preprocessor has enough context to
3236 avoid warning in these cases.
3237
3238 @item
3239 A function declared external in one block and then used after the end of
3240 the block.
3241
3242 @item
3243 A @code{switch} statement has an operand of type @code{long}.
3244
3245 @item
3246 A non-@code{static} function declaration follows a @code{static} one.
3247 This construct is not accepted by some traditional C compilers.
3248
3249 @item
3250 The ISO type of an integer constant has a different width or
3251 signedness from its traditional type.  This warning is only issued if
3252 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3253 typically represent bit patterns, are not warned about.
3254
3255 @item
3256 Usage of ISO string concatenation is detected.
3257
3258 @item
3259 Initialization of automatic aggregates.
3260
3261 @item
3262 Identifier conflicts with labels.  Traditional C lacks a separate
3263 namespace for labels.
3264
3265 @item
3266 Initialization of unions.  If the initializer is zero, the warning is
3267 omitted.  This is done under the assumption that the zero initializer in
3268 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3269 initializer warnings and relies on default initialization to zero in the
3270 traditional C case.
3271
3272 @item
3273 Conversions by prototypes between fixed/floating point values and vice
3274 versa.  The absence of these prototypes when compiling with traditional
3275 C would cause serious problems.  This is a subset of the possible
3276 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3277
3278 @item
3279 Use of ISO C style function definitions.  This warning intentionally is
3280 @emph{not} issued for prototype declarations or variadic functions
3281 because these ISO C features will appear in your code when using
3282 libiberty's traditional C compatibility macros, @code{PARAMS} and
3283 @code{VPARAMS}.  This warning is also bypassed for nested functions
3284 because that feature is already a GCC extension and thus not relevant to
3285 traditional C compatibility.
3286 @end itemize
3287
3288 @item -Wtraditional-conversion @r{(C only)}
3289 @opindex Wtraditional-conversion
3290 Warn if a prototype causes a type conversion that is different from what
3291 would happen to the same argument in the absence of a prototype.  This
3292 includes conversions of fixed point to floating and vice versa, and
3293 conversions changing the width or signedness of a fixed point argument
3294 except when the same as the default promotion.
3295
3296 @item -Wdeclaration-after-statement @r{(C only)}
3297 @opindex Wdeclaration-after-statement
3298 Warn when a declaration is found after a statement in a block.  This
3299 construct, known from C++, was introduced with ISO C99 and is by default
3300 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3301 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3302
3303 @item -Wundef
3304 @opindex Wundef
3305 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3306
3307 @item -Wno-endif-labels
3308 @opindex Wno-endif-labels
3309 @opindex Wendif-labels
3310 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3311
3312 @item -Wshadow
3313 @opindex Wshadow
3314 Warn whenever a local variable shadows another local variable, parameter or
3315 global variable or whenever a built-in function is shadowed.
3316
3317 @item -Wlarger-than-@var{len}
3318 @opindex Wlarger-than
3319 Warn whenever an object of larger than @var{len} bytes is defined.
3320
3321 @item -Wunsafe-loop-optimizations
3322 @opindex Wunsafe-loop-optimizations
3323 Warn if the loop cannot be optimized because the compiler could not
3324 assume anything on the bounds of the loop indices.  With
3325 @option{-funsafe-loop-optimizations} warn if the compiler made
3326 such assumptions.
3327
3328 @item -Wpointer-arith
3329 @opindex Wpointer-arith
3330 Warn about anything that depends on the ``size of'' a function type or
3331 of @code{void}.  GNU C assigns these types a size of 1, for
3332 convenience in calculations with @code{void *} pointers and pointers
3333 to functions.  In C++, warn also when an arithmetic operation involves
3334 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3335
3336 @item -Wbad-function-cast @r{(C only)}
3337 @opindex Wbad-function-cast
3338 Warn whenever a function call is cast to a non-matching type.
3339 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3340
3341 @item -Wc++-compat
3342 Warn about ISO C constructs that are outside of the common subset of
3343 ISO C and ISO C++, e.g.@: request for implicit conversion from
3344 @code{void *} to a pointer to non-@code{void} type.
3345
3346 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3347 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3348 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords 
3349 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3350
3351 @item -Wcast-qual
3352 @opindex Wcast-qual
3353 Warn whenever a pointer is cast so as to remove a type qualifier from
3354 the target type.  For example, warn if a @code{const char *} is cast
3355 to an ordinary @code{char *}.
3356
3357 @item -Wcast-align
3358 @opindex Wcast-align
3359 Warn whenever a pointer is cast such that the required alignment of the
3360 target is increased.  For example, warn if a @code{char *} is cast to
3361 an @code{int *} on machines where integers can only be accessed at
3362 two- or four-byte boundaries.
3363
3364 @item -Wwrite-strings
3365 @opindex Wwrite-strings
3366 When compiling C, give string constants the type @code{const
3367 char[@var{length}]} so that
3368 copying the address of one into a non-@code{const} @code{char *}
3369 pointer will get a warning; when compiling C++, warn about the
3370 deprecated conversion from string literals to @code{char *}.  This
3371 warning, by default, is enabled for C++ programs.
3372 These warnings will help you find at
3373 compile time code that can try to write into a string constant, but
3374 only if you have been very careful about using @code{const} in
3375 declarations and prototypes.  Otherwise, it will just be a nuisance;
3376 this is why we did not make @option{-Wall} request these warnings.
3377
3378 @item -Wclobbered
3379 @opindex Wclobbered
3380 Warn for variables that might be changed by @samp{longjmp} or
3381 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3382
3383 @item -Wconversion
3384 @opindex Wconversion
3385 Warn for implicit conversions that may alter a value. This includes
3386 conversions between real and integer, like @code{abs (x)} when
3387 @code{x} is @code{double}; conversions between signed and unsigned,
3388 like @code{unsigned ui = -1}; and conversions to smaller types, like
3389 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3390 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3391 changed by the conversion like in @code{abs (2.0)}.
3392
3393 @item -Wempty-body
3394 @opindex Wempty-body
3395 An empty body occurs in an @samp{if} or @samp{else} statement. 
3396 This warning is also enabled by @option{-Wextra}.
3397
3398 @item -Wsign-compare
3399 @opindex Wsign-compare
3400 @cindex warning for comparison of signed and unsigned values
3401 @cindex comparison of signed and unsigned values, warning
3402 @cindex signed and unsigned values, comparison warning
3403 Warn when a comparison between signed and unsigned values could produce
3404 an incorrect result when the signed value is converted to unsigned.
3405 This warning is also enabled by @option{-Wextra}; to get the other warnings
3406 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3407
3408 @item -Waddress
3409 @opindex Waddress
3410 @opindex Wno-address
3411 Warn about suspicious uses of memory addresses. These include using
3412 the address of a function in a conditional expression, such as
3413 @code{void func(void); if (func)}, and comparisons against the memory
3414 address of a string literal, such as @code{if (x == "abc")}.  Such
3415 uses typically indicate a programmer error: the address of a function
3416 always evaluates to true, so their use in a conditional usually
3417 indicate that the programmer forgot the parentheses in a function
3418 call; and comparisons against string literals result in unspecified
3419 behavior and are not portable in C, so they usually indicate that the
3420 programmer intended to use @code{strcmp}.  This warning is enabled by
3421 @option{-Wall}.
3422
3423 @item -Wlogical-op
3424 @opindex Wlogical-op
3425 @opindex Wno-logical-op
3426 Warn about suspicious uses of logical operators in expressions.
3427 This includes using logical operators in contexts where a
3428 bit-wise operator is likely to be expected.
3429
3430 @item -Waggregate-return
3431 @opindex Waggregate-return
3432 Warn if any functions that return structures or unions are defined or
3433 called.  (In languages where you can return an array, this also elicits
3434 a warning.)
3435
3436 @item -Wno-attributes
3437 @opindex Wno-attributes
3438 @opindex Wattributes
3439 Do not warn if an unexpected @code{__attribute__} is used, such as
3440 unrecognized attributes, function attributes applied to variables,
3441 etc.  This will not stop errors for incorrect use of supported
3442 attributes.
3443
3444 @item -Wstrict-prototypes @r{(C only)}
3445 @opindex Wstrict-prototypes
3446 Warn if a function is declared or defined without specifying the
3447 argument types.  (An old-style function definition is permitted without
3448 a warning if preceded by a declaration which specifies the argument
3449 types.)
3450
3451 @item -Wold-style-declaration @r{(C only)}
3452 @opindex Wold-style-declaration
3453 Warn for obsolescent usages, according to the C Standard, in a
3454 declaration. For example, warn if storage-class specifiers like
3455 @code{static} are not the first things in a declaration.  This warning
3456 is also enabled by @option{-Wextra}.
3457
3458 @item -Wold-style-definition @r{(C only)}
3459 @opindex Wold-style-definition
3460 Warn if an old-style function definition is used.  A warning is given
3461 even if there is a previous prototype.
3462
3463 @item -Wmissing-parameter-type @r{(C only)}
3464 @opindex Wmissing-parameter-type
3465 A function parameter is declared without a type specifier in K&R-style
3466 functions:
3467
3468 @smallexample
3469 void foo(bar) @{ @}
3470 @end smallexample
3471
3472 This warning is also enabled by @option{-Wextra}.
3473
3474 @item -Wmissing-prototypes @r{(C only)}
3475 @opindex Wmissing-prototypes
3476 Warn if a global function is defined without a previous prototype
3477 declaration.  This warning is issued even if the definition itself
3478 provides a prototype.  The aim is to detect global functions that fail
3479 to be declared in header files.
3480
3481 @item -Wmissing-declarations @r{(C and C++ only)}
3482 @opindex Wmissing-declarations
3483 Warn if a global function is defined without a previous declaration.
3484 Do so even if the definition itself provides a prototype.
3485 Use this option to detect global functions that are not declared in
3486 header files.  In C++, no warnings are issued for function templates,
3487 or for inline functions, or for functions in anonymous namespaces.
3488
3489 @item -Wmissing-field-initializers
3490 @opindex Wmissing-field-initializers
3491 @opindex W
3492 @opindex Wextra
3493 Warn if a structure's initializer has some fields missing.  For
3494 example, the following code would cause such a warning, because
3495 @code{x.h} is implicitly zero:
3496
3497 @smallexample
3498 struct s @{ int f, g, h; @};
3499 struct s x = @{ 3, 4 @};
3500 @end smallexample
3501
3502 This option does not warn about designated initializers, so the following
3503 modification would not trigger a warning:
3504
3505 @smallexample
3506 struct s @{ int f, g, h; @};
3507 struct s x = @{ .f = 3, .g = 4 @};
3508 @end smallexample
3509
3510 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3511 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3512
3513 @item -Wmissing-noreturn
3514 @opindex Wmissing-noreturn
3515 Warn about functions which might be candidates for attribute @code{noreturn}.
3516 Note these are only possible candidates, not absolute ones.  Care should
3517 be taken to manually verify functions actually do not ever return before
3518 adding the @code{noreturn} attribute, otherwise subtle code generation
3519 bugs could be introduced.  You will not get a warning for @code{main} in
3520 hosted C environments.
3521
3522 @item -Wmissing-format-attribute
3523 @opindex Wmissing-format-attribute
3524 @opindex Wformat
3525 Warn about function pointers which might be candidates for @code{format}
3526 attributes.  Note these are only possible candidates, not absolute ones.
3527 GCC will guess that function pointers with @code{format} attributes that
3528 are used in assignment, initialization, parameter passing or return
3529 statements should have a corresponding @code{format} attribute in the
3530 resulting type.  I.e.@: the left-hand side of the assignment or
3531 initialization, the type of the parameter variable, or the return type
3532 of the containing function respectively should also have a @code{format}
3533 attribute to avoid the warning.
3534
3535 GCC will also warn about function definitions which might be
3536 candidates for @code{format} attributes.  Again, these are only
3537 possible candidates.  GCC will guess that @code{format} attributes
3538 might be appropriate for any function that calls a function like
3539 @code{vprintf} or @code{vscanf}, but this might not always be the
3540 case, and some functions for which @code{format} attributes are
3541 appropriate may not be detected.
3542
3543 @item -Wno-multichar
3544 @opindex Wno-multichar
3545 @opindex Wmultichar
3546 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3547 Usually they indicate a typo in the user's code, as they have
3548 implementation-defined values, and should not be used in portable code.
3549
3550 @item -Wnormalized=<none|id|nfc|nfkc>
3551 @opindex Wnormalized
3552 @cindex NFC
3553 @cindex NFKC
3554 @cindex character set, input normalization
3555 In ISO C and ISO C++, two identifiers are different if they are
3556 different sequences of characters.  However, sometimes when characters
3557 outside the basic ASCII character set are used, you can have two
3558 different character sequences that look the same.  To avoid confusion,
3559 the ISO 10646 standard sets out some @dfn{normalization rules} which
3560 when applied ensure that two sequences that look the same are turned into
3561 the same sequence.  GCC can warn you if you are using identifiers which
3562 have not been normalized; this option controls that warning.
3563
3564 There are four levels of warning that GCC supports.  The default is
3565 @option{-Wnormalized=nfc}, which warns about any identifier which is
3566 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3567 recommended form for most uses.
3568
3569 Unfortunately, there are some characters which ISO C and ISO C++ allow
3570 in identifiers that when turned into NFC aren't allowable as
3571 identifiers.  That is, there's no way to use these symbols in portable
3572 ISO C or C++ and have all your identifiers in NFC.
3573 @option{-Wnormalized=id} suppresses the warning for these characters.
3574 It is hoped that future versions of the standards involved will correct
3575 this, which is why this option is not the default.
3576
3577 You can switch the warning off for all characters by writing
3578 @option{-Wnormalized=none}.  You would only want to do this if you
3579 were using some other normalization scheme (like ``D''), because
3580 otherwise you can easily create bugs that are literally impossible to see.
3581
3582 Some characters in ISO 10646 have distinct meanings but look identical
3583 in some fonts or display methodologies, especially once formatting has
3584 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3585 LETTER N'', will display just like a regular @code{n} which has been
3586 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3587 normalization scheme to convert all these into a standard form as
3588 well, and GCC will warn if your code is not in NFKC if you use
3589 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3590 about every identifier that contains the letter O because it might be
3591 confused with the digit 0, and so is not the default, but may be
3592 useful as a local coding convention if the programming environment is
3593 unable to be fixed to display these characters distinctly.
3594
3595 @item -Wno-deprecated-declarations
3596 @opindex Wno-deprecated-declarations
3597 Do not warn about uses of functions (@pxref{Function Attributes}),
3598 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3599 Attributes}) marked as deprecated by using the @code{deprecated}
3600 attribute.
3601
3602 @item -Wno-overflow
3603 @opindex Wno-overflow
3604 Do not warn about compile-time overflow in constant expressions.
3605
3606 @item -Woverride-init
3607 @opindex Woverride-init
3608 @opindex W
3609 @opindex Wextra
3610 Warn if an initialized field without side effects is overridden when
3611 using designated initializers (@pxref{Designated Inits, , Designated
3612 Initializers}).
3613
3614 This warning is included in @option{-Wextra}.  To get other
3615 @option{-Wextra} warnings without this one, use @samp{-Wextra
3616 -Wno-override-init}.
3617
3618 @item -Wpacked
3619 @opindex Wpacked
3620 Warn if a structure is given the packed attribute, but the packed
3621 attribute has no effect on the layout or size of the structure.
3622 Such structures may be mis-aligned for little benefit.  For
3623 instance, in this code, the variable @code{f.x} in @code{struct bar}
3624 will be misaligned even though @code{struct bar} does not itself
3625 have the packed attribute:
3626
3627 @smallexample
3628 @group
3629 struct foo @{
3630   int x;
3631   char a, b, c, d;
3632 @} __attribute__((packed));
3633 struct bar @{
3634   char z;
3635   struct foo f;
3636 @};
3637 @end group
3638 @end smallexample
3639
3640 @item -Wpadded
3641 @opindex Wpadded
3642 Warn if padding is included in a structure, either to align an element
3643 of the structure or to align the whole structure.  Sometimes when this
3644 happens it is possible to rearrange the fields of the structure to
3645 reduce the padding and so make the structure smaller.
3646
3647 @item -Wredundant-decls
3648 @opindex Wredundant-decls
3649 Warn if anything is declared more than once in the same scope, even in
3650 cases where multiple declaration is valid and changes nothing.
3651
3652 @item -Wnested-externs @r{(C only)}
3653 @opindex Wnested-externs
3654 Warn if an @code{extern} declaration is encountered within a function.
3655
3656 @item -Wunreachable-code
3657 @opindex Wunreachable-code
3658 Warn if the compiler detects that code will never be executed.
3659
3660 This option is intended to warn when the compiler detects that at
3661 least a whole line of source code will never be executed, because
3662 some condition is never satisfied or because it is after a
3663 procedure that never returns.
3664
3665 It is possible for this option to produce a warning even though there
3666 are circumstances under which part of the affected line can be executed,
3667 so care should be taken when removing apparently-unreachable code.
3668
3669 For instance, when a function is inlined, a warning may mean that the
3670 line is unreachable in only one inlined copy of the function.
3671
3672 This option is not made part of @option{-Wall} because in a debugging
3673 version of a program there is often substantial code which checks
3674 correct functioning of the program and is, hopefully, unreachable
3675 because the program does work.  Another common use of unreachable
3676 code is to provide behavior which is selectable at compile-time.
3677
3678 @item -Winline
3679 @opindex Winline
3680 Warn if a function can not be inlined and it was declared as inline.
3681 Even with this option, the compiler will not warn about failures to
3682 inline functions declared in system headers.
3683
3684 The compiler uses a variety of heuristics to determine whether or not
3685 to inline a function.  For example, the compiler takes into account
3686 the size of the function being inlined and the amount of inlining
3687 that has already been done in the current function.  Therefore,
3688 seemingly insignificant changes in the source program can cause the
3689 warnings produced by @option{-Winline} to appear or disappear.
3690
3691 @item -Wno-invalid-offsetof @r{(C++ only)}
3692 @opindex Wno-invalid-offsetof
3693 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3694 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3695 to a non-POD type is undefined.  In existing C++ implementations,
3696 however, @samp{offsetof} typically gives meaningful results even when
3697 applied to certain kinds of non-POD types. (Such as a simple
3698 @samp{struct} that fails to be a POD type only by virtue of having a
3699 constructor.)  This flag is for users who are aware that they are
3700 writing nonportable code and who have deliberately chosen to ignore the
3701 warning about it.
3702
3703 The restrictions on @samp{offsetof} may be relaxed in a future version
3704 of the C++ standard.
3705
3706 @item -Wno-int-to-pointer-cast @r{(C only)}
3707 @opindex Wno-int-to-pointer-cast
3708 Suppress warnings from casts to pointer type of an integer of a
3709 different size.
3710
3711 @item -Wno-pointer-to-int-cast @r{(C only)}
3712 @opindex Wno-pointer-to-int-cast
3713 Suppress warnings from casts from a pointer to an integer type of a
3714 different size.
3715
3716 @item -Winvalid-pch
3717 @opindex Winvalid-pch
3718 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3719 the search path but can't be used.
3720
3721 @item -Wlong-long
3722 @opindex Wlong-long
3723 @opindex Wno-long-long
3724 Warn if @samp{long long} type is used.  This is default.  To inhibit
3725 the warning messages, use @option{-Wno-long-long}.  Flags
3726 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3727 only when @option{-pedantic} flag is used.
3728
3729 @item -Wvariadic-macros
3730 @opindex Wvariadic-macros
3731 @opindex Wno-variadic-macros
3732 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3733 alternate syntax when in pedantic ISO C99 mode.  This is default.
3734 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3735
3736 @item -Wvolatile-register-var
3737 @opindex Wvolatile-register-var
3738 @opindex Wno-volatile-register-var
3739 Warn if a register variable is declared volatile.  The volatile
3740 modifier does not inhibit all optimizations that may eliminate reads
3741 and/or writes to register variables.
3742
3743 @item -Wdisabled-optimization
3744 @opindex Wdisabled-optimization
3745 Warn if a requested optimization pass is disabled.  This warning does
3746 not generally indicate that there is anything wrong with your code; it
3747 merely indicates that GCC's optimizers were unable to handle the code
3748 effectively.  Often, the problem is that your code is too big or too
3749 complex; GCC will refuse to optimize programs when the optimization
3750 itself is likely to take inordinate amounts of time.
3751
3752 @item -Wpointer-sign
3753 @opindex Wpointer-sign
3754 @opindex Wno-pointer-sign
3755 Warn for pointer argument passing or assignment with different signedness.
3756 This option is only supported for C and Objective-C@.  It is implied by
3757 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3758 @option{-Wno-pointer-sign}.
3759
3760 @item -Werror
3761 @opindex Werror
3762 Make all warnings into errors.
3763
3764 @item -Werror=
3765 @opindex Werror=
3766 Make the specified warning into an errors.  The specifier for a
3767 warning is appended, for example @option{-Werror=switch} turns the
3768 warnings controlled by @option{-Wswitch} into errors.  This switch
3769 takes a negative form, to be used to negate @option{-Werror} for
3770 specific warnings, for example @option{-Wno-error=switch} makes
3771 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3772 is in effect.  You can use the @option{-fdiagnostics-show-option}
3773 option to have each controllable warning amended with the option which
3774 controls it, to determine what to use with this option.
3775
3776 Note that specifying @option{-Werror=}@var{foo} automatically implies
3777 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3778 imply anything.
3779
3780 @item -Wstack-protector
3781 @opindex Wstack-protector
3782 This option is only active when @option{-fstack-protector} is active.  It
3783 warns about functions that will not be protected against stack smashing.
3784
3785 @item -Woverlength-strings
3786 @opindex Woverlength-strings
3787 Warn about string constants which are longer than the ``minimum
3788 maximum'' length specified in the C standard.  Modern compilers
3789 generally allow string constants which are much longer than the
3790 standard's minimum limit, but very portable programs should avoid
3791 using longer strings.
3792
3793 The limit applies @emph{after} string constant concatenation, and does
3794 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3795 C99, it was raised to 4095.  C++98 does not specify a normative
3796 minimum maximum, so we do not diagnose overlength strings in C++@.
3797
3798 This option is implied by @option{-pedantic}, and can be disabled with
3799 @option{-Wno-overlength-strings}.
3800 @end table
3801
3802 @node Debugging Options
3803 @section Options for Debugging Your Program or GCC
3804 @cindex options, debugging
3805 @cindex debugging information options
3806
3807 GCC has various special options that are used for debugging
3808 either your program or GCC:
3809
3810 @table @gcctabopt
3811 @item -g
3812 @opindex g
3813 Produce debugging information in the operating system's native format
3814 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3815 information.
3816
3817 On most systems that use stabs format, @option{-g} enables use of extra
3818 debugging information that only GDB can use; this extra information
3819 makes debugging work better in GDB but will probably make other debuggers
3820 crash or
3821 refuse to read the program.  If you want to control for certain whether
3822 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3823 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3824
3825 GCC allows you to use @option{-g} with
3826 @option{-O}.  The shortcuts taken by optimized code may occasionally
3827 produce surprising results: some variables you declared may not exist
3828 at all; flow of control may briefly move where you did not expect it;
3829 some statements may not be executed because they compute constant
3830 results or their values were already at hand; some statements may
3831 execute in different places because they were moved out of loops.
3832
3833 Nevertheless it proves possible to debug optimized output.  This makes
3834 it reasonable to use the optimizer for programs that might have bugs.
3835
3836 The following options are useful when GCC is generated with the
3837 capability for more than one debugging format.
3838
3839 @item -ggdb
3840 @opindex ggdb
3841 Produce debugging information for use by GDB@.  This means to use the
3842 most expressive format available (DWARF 2, stabs, or the native format
3843 if neither of those are supported), including GDB extensions if at all
3844 possible.
3845
3846 @item -gstabs
3847 @opindex gstabs
3848 Produce debugging information in stabs format (if that is supported),
3849 without GDB extensions.  This is the format used by DBX on most BSD
3850 systems.  On MIPS, Alpha and System V Release 4 systems this option
3851 produces stabs debugging output which is not understood by DBX or SDB@.
3852 On System V Release 4 systems this option requires the GNU assembler.
3853
3854 @item -feliminate-unused-debug-symbols
3855 @opindex feliminate-unused-debug-symbols
3856 Produce debugging information in stabs format (if that is supported),
3857 for only symbols that are actually used.
3858
3859 @item -femit-class-debug-always
3860 Instead of emitting debugging information for a C++ class in only one
3861 object file, emit it in all object files using the class.  This option
3862 should be used only with debuggers that are unable to handle the way GCC
3863 normally emits debugging information for classes because using this
3864 option will increase the size of debugging information by as much as a
3865 factor of two.
3866
3867 @item -gstabs+
3868 @opindex gstabs+
3869 Produce debugging information in stabs format (if that is supported),
3870 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3871 use of these extensions is likely to make other debuggers crash or
3872 refuse to read the program.
3873
3874 @item -gcoff
3875 @opindex gcoff
3876 Produce debugging information in COFF format (if that is supported).
3877 This is the format used by SDB on most System V systems prior to
3878 System V Release 4.
3879
3880 @item -gxcoff
3881 @opindex gxcoff
3882 Produce debugging information in XCOFF format (if that is supported).
3883 This is the format used by the DBX debugger on IBM RS/6000 systems.
3884
3885 @item -gxcoff+
3886 @opindex gxcoff+
3887 Produce debugging information in XCOFF format (if that is supported),
3888 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3889 use of these extensions is likely to make other debuggers crash or
3890 refuse to read the program, and may cause assemblers other than the GNU
3891 assembler (GAS) to fail with an error.
3892
3893 @item -gdwarf-2
3894 @opindex gdwarf-2
3895 Produce debugging information in DWARF version 2 format (if that is
3896 supported).  This is the format used by DBX on IRIX 6.  With this
3897 option, GCC uses features of DWARF version 3 when they are useful;
3898 version 3 is upward compatible with version 2, but may still cause
3899 problems for older debuggers.
3900
3901 @item -gvms
3902 @opindex gvms
3903 Produce debugging information in VMS debug format (if that is
3904 supported).  This is the format used by DEBUG on VMS systems.
3905
3906 @item -g@var{level}
3907 @itemx -ggdb@var{level}
3908 @itemx -gstabs@var{level}
3909 @itemx -gcoff@var{level}
3910 @itemx -gxcoff@var{level}
3911 @itemx -gvms@var{level}
3912 Request debugging information and also use @var{level} to specify how
3913 much information.  The default level is 2.
3914
3915 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
3916 @option{-g}.
3917
3918 Level 1 produces minimal information, enough for making backtraces in
3919 parts of the program that you don't plan to debug.  This includes
3920 descriptions of functions and external variables, but no information
3921 about local variables and no line numbers.
3922
3923 Level 3 includes extra information, such as all the macro definitions
3924 present in the program.  Some debuggers support macro expansion when
3925 you use @option{-g3}.
3926
3927 @option{-gdwarf-2} does not accept a concatenated debug level, because
3928 GCC used to support an option @option{-gdwarf} that meant to generate
3929 debug information in version 1 of the DWARF format (which is very
3930 different from version 2), and it would have been too confusing.  That
3931 debug format is long obsolete, but the option cannot be changed now.
3932 Instead use an additional @option{-g@var{level}} option to change the
3933 debug level for DWARF2.
3934
3935 @item -feliminate-dwarf2-dups
3936 @opindex feliminate-dwarf2-dups
3937 Compress DWARF2 debugging information by eliminating duplicated
3938 information about each symbol.  This option only makes sense when
3939 generating DWARF2 debugging information with @option{-gdwarf-2}.
3940
3941 @cindex @command{prof}
3942 @item -p
3943 @opindex p
3944 Generate extra code to write profile information suitable for the
3945 analysis program @command{prof}.  You must use this option when compiling
3946 the source files you want data about, and you must also use it when
3947 linking.
3948
3949 @cindex @command{gprof}
3950 @item -pg
3951 @opindex pg
3952 Generate extra code to write profile information suitable for the
3953 analysis program @command{gprof}.  You must use this option when compiling
3954 the source files you want data about, and you must also use it when
3955 linking.
3956
3957 @item -Q
3958 @opindex Q
3959 Makes the compiler print out each function name as it is compiled, and
3960 print some statistics about each pass when it finishes.
3961
3962 @item -ftime-report
3963 @opindex ftime-report
3964 Makes the compiler print some statistics about the time consumed by each
3965 pass when it finishes.
3966
3967 @item -fmem-report
3968 @opindex fmem-report
3969 Makes the compiler print some statistics about permanent memory
3970 allocation when it finishes.
3971
3972 @item -fpre-ipa-mem-report
3973 @opindex fpre-ipa-mem-report
3974 @item -fpost-ipa-mem-report
3975 @opindex fpost-ipa-mem-report
3976 Makes the compiler print some statistics about permanent memory
3977 allocation before or after interprocedural optimization.
3978
3979 @item -fprofile-arcs
3980 @opindex fprofile-arcs
3981 Add code so that program flow @dfn{arcs} are instrumented.  During
3982 execution the program records how many times each branch and call is
3983 executed and how many times it is taken or returns.  When the compiled
3984 program exits it saves this data to a file called
3985 @file{@var{auxname}.gcda} for each source file.  The data may be used for
3986 profile-directed optimizations (@option{-fbranch-probabilities}), or for
3987 test coverage analysis (@option{-ftest-coverage}).  Each object file's
3988 @var{auxname} is generated from the name of the output file, if
3989 explicitly specified and it is not the final executable, otherwise it is
3990 the basename of the source file.  In both cases any suffix is removed
3991 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
3992 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
3993 @xref{Cross-profiling}.
3994
3995 @cindex @command{gcov}
3996 @item --coverage
3997 @opindex coverage
3998
3999 This option is used to compile and link code instrumented for coverage
4000 analysis.  The option is a synonym for @option{-fprofile-arcs}
4001 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4002 linking).  See the documentation for those options for more details.
4003
4004 @itemize
4005
4006 @item
4007 Compile the source files with @option{-fprofile-arcs} plus optimization
4008 and code generation options.  For test coverage analysis, use the
4009 additional @option{-ftest-coverage} option.  You do not need to profile
4010 every source file in a program.
4011
4012 @item
4013 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4014 (the latter implies the former).
4015
4016 @item
4017 Run the program on a representative workload to generate the arc profile
4018 information.  This may be repeated any number of times.  You can run
4019 concurrent instances of your program, and provided that the file system
4020 supports locking, the data files will be correctly updated.  Also
4021 @code{fork} calls are detected and correctly handled (double counting
4022 will not happen).
4023
4024 @item
4025 For profile-directed optimizations, compile the source files again with
4026 the same optimization and code generation options plus
4027 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4028 Control Optimization}).
4029
4030 @item
4031 For test coverage analysis, use @command{gcov} to produce human readable
4032 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4033 @command{gcov} documentation for further information.
4034
4035 @end itemize
4036
4037 With @option{-fprofile-arcs}, for each function of your program GCC
4038 creates a program flow graph, then finds a spanning tree for the graph.
4039 Only arcs that are not on the spanning tree have to be instrumented: the
4040 compiler adds code to count the number of times that these arcs are
4041 executed.  When an arc is the only exit or only entrance to a block, the
4042 instrumentation code can be added to the block; otherwise, a new basic
4043 block must be created to hold the instrumentation code.
4044
4045 @need 2000
4046 @item -ftest-coverage
4047 @opindex ftest-coverage
4048 Produce a notes file that the @command{gcov} code-coverage utility
4049 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4050 show program coverage.  Each source file's note file is called
4051 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4052 above for a description of @var{auxname} and instructions on how to
4053 generate test coverage data.  Coverage data will match the source files
4054 more closely, if you do not optimize.
4055
4056 @item -d@var{letters}
4057 @item -fdump-rtl-@var{pass}
4058 @opindex d
4059 Says to make debugging dumps during compilation at times specified by
4060 @var{letters}.    This is used for debugging the RTL-based passes of the
4061 compiler.  The file names for most of the dumps are made by appending a
4062 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4063 from the name of the output file, if explicitly specified and it is not
4064 an executable, otherwise it is the basename of the source file.
4065
4066 Most debug dumps can be enabled either passing a letter to the @option{-d}
4067 option, or with a long @option{-fdump-rtl} switch; here are the possible
4068 letters for use in @var{letters} and @var{pass}, and their meanings:
4069
4070 @table @gcctabopt
4071 @item -dA
4072 @opindex dA
4073 Annotate the assembler output with miscellaneous debugging information.
4074
4075 @item -dB
4076 @itemx -fdump-rtl-bbro
4077 @opindex dB
4078 @opindex fdump-rtl-bbro
4079 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4080
4081 @item -dc
4082 @itemx -fdump-rtl-combine
4083 @opindex dc
4084 @opindex fdump-rtl-combine
4085 Dump after the RTL instruction combination pass, to the file
4086 @file{@var{file}.129r.combine}.
4087
4088 @item -dC
4089 @itemx -fdump-rtl-ce1
4090 @itemx -fdump-rtl-ce2
4091 @opindex dC
4092 @opindex fdump-rtl-ce1
4093 @opindex fdump-rtl-ce2
4094 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4095 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4096 and @option{-fdump-rtl-ce2} enable dumping after the second if
4097 conversion, to the file @file{@var{file}.130r.ce2}.
4098
4099 @item -dd
4100 @itemx -fdump-rtl-btl
4101 @itemx -fdump-rtl-dbr
4102 @opindex dd
4103 @opindex fdump-rtl-btl
4104 @opindex fdump-rtl-dbr
4105 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4106 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4107 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4108 scheduling, to @file{@var{file}.36.dbr}.
4109
4110 @item -dD
4111 @opindex dD
4112 Dump all macro definitions, at the end of preprocessing, in addition to
4113 normal output.
4114
4115 @item -dE
4116 @itemx -fdump-rtl-ce3
4117 @opindex dE
4118 @opindex fdump-rtl-ce3
4119 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4120
4121 @item -df
4122 @itemx -fdump-rtl-cfg
4123 @itemx -fdump-rtl-life
4124 @opindex df
4125 @opindex fdump-rtl-cfg
4126 @opindex fdump-rtl-life
4127 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4128 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4129 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4130 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4131
4132 @item -dg
4133 @itemx -fdump-rtl-greg
4134 @opindex dg
4135 @opindex fdump-rtl-greg
4136 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4137
4138 @item -dG
4139 @itemx -fdump-rtl-gcse
4140 @itemx -fdump-rtl-bypass
4141 @opindex dG
4142 @opindex fdump-rtl-gcse
4143 @opindex fdump-rtl-bypass
4144 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4145 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4146 enable dumping after jump bypassing and control flow optimizations, to
4147 @file{@var{file}.115r.bypass}.
4148
4149 @item -dh
4150 @itemx -fdump-rtl-eh
4151 @opindex dh
4152 @opindex fdump-rtl-eh
4153 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4154
4155 @item -di
4156 @itemx -fdump-rtl-sibling
4157 @opindex di
4158 @opindex fdump-rtl-sibling
4159 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4160
4161 @item -dj
4162 @itemx -fdump-rtl-jump
4163 @opindex dj
4164 @opindex fdump-rtl-jump
4165 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4166
4167 @item -dk
4168 @itemx -fdump-rtl-stack
4169 @opindex dk
4170 @opindex fdump-rtl-stack
4171 Dump after conversion from GCC's "flat register file" registers to the
4172 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4173
4174 @item -dl
4175 @itemx -fdump-rtl-lreg
4176 @opindex dl
4177 @opindex fdump-rtl-lreg
4178 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4179
4180 @item -dL
4181 @itemx -fdump-rtl-loop2
4182 @opindex dL
4183 @opindex fdump-rtl-loop2
4184 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4185 loop optimization pass, to @file{@var{file}.119r.loop2},
4186 @file{@var{file}.120r.loop2_init},
4187 @file{@var{file}.121r.loop2_invariant}, and
4188 @file{@var{file}.125r.loop2_done}.
4189
4190 @item -dm
4191 @itemx -fdump-rtl-sms
4192 @opindex dm
4193 @opindex fdump-rtl-sms
4194 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4195
4196 @item -dM
4197 @itemx -fdump-rtl-mach
4198 @opindex dM
4199 @opindex fdump-rtl-mach
4200 Dump after performing the machine dependent reorganization pass, to
4201 @file{@var{file}.155r.mach}.
4202
4203 @item -dn
4204 @itemx -fdump-rtl-rnreg
4205 @opindex dn
4206 @opindex fdump-rtl-rnreg
4207 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4208
4209 @item -dN
4210 @itemx -fdump-rtl-regmove
4211 @opindex dN
4212 @opindex fdump-rtl-regmove
4213 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4214
4215 @item -do
4216 @itemx -fdump-rtl-postreload
4217 @opindex do
4218 @opindex fdump-rtl-postreload
4219 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4220
4221 @item -dr
4222 @itemx -fdump-rtl-expand
4223 @opindex dr
4224 @opindex fdump-rtl-expand
4225 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4226
4227 @item -dR
4228 @itemx -fdump-rtl-sched2
4229 @opindex dR
4230 @opindex fdump-rtl-sched2
4231 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4232
4233 @item -ds
4234 @itemx -fdump-rtl-cse
4235 @opindex ds
4236 @opindex fdump-rtl-cse
4237 Dump after CSE (including the jump optimization that sometimes follows
4238 CSE), to @file{@var{file}.113r.cse}.
4239
4240 @item -dS
4241 @itemx -fdump-rtl-sched1
4242 @opindex dS
4243 @opindex fdump-rtl-sched1
4244 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4245
4246 @item -dt
4247 @itemx -fdump-rtl-cse2
4248 @opindex dt
4249 @opindex fdump-rtl-cse2
4250 Dump after the second CSE pass (including the jump optimization that
4251 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4252
4253 @item -dT
4254 @itemx -fdump-rtl-tracer
4255 @opindex dT
4256 @opindex fdump-rtl-tracer
4257 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4258
4259 @item -dV
4260 @itemx -fdump-rtl-vpt
4261 @itemx -fdump-rtl-vartrack
4262 @opindex dV
4263 @opindex fdump-rtl-vpt
4264 @opindex fdump-rtl-vartrack
4265 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4266 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4267 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4268 to @file{@var{file}.154r.vartrack}.
4269
4270 @item -dw
4271 @itemx -fdump-rtl-flow2
4272 @opindex dw
4273 @opindex fdump-rtl-flow2
4274 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4275
4276 @item -dz
4277 @itemx -fdump-rtl-peephole2
4278 @opindex dz
4279 @opindex fdump-rtl-peephole2
4280 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4281
4282 @item -dZ
4283 @itemx -fdump-rtl-web
4284 @opindex dZ
4285 @opindex fdump-rtl-web
4286 Dump after live range splitting, to @file{@var{file}.126r.web}.
4287
4288 @item -da
4289 @itemx -fdump-rtl-all
4290 @opindex da
4291 @opindex fdump-rtl-all
4292 Produce all the dumps listed above.
4293
4294 @item -dH
4295 @opindex dH
4296 Produce a core dump whenever an error occurs.
4297
4298 @item -dm
4299 @opindex dm
4300 Print statistics on memory usage, at the end of the run, to
4301 standard error.
4302
4303 @item -dp
4304 @opindex dp
4305 Annotate the assembler output with a comment indicating which
4306 pattern and alternative was used.  The length of each instruction is
4307 also printed.
4308
4309 @item -dP
4310 @opindex dP
4311 Dump the RTL in the assembler output as a comment before each instruction.
4312 Also turns on @option{-dp} annotation.
4313
4314 @item -dv
4315 @opindex dv
4316 For each of the other indicated dump files (either with @option{-d} or
4317 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4318 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4319
4320 @item -dx
4321 @opindex dx
4322 Just generate RTL for a function instead of compiling it.  Usually used
4323 with @samp{r} (@option{-fdump-rtl-expand}).
4324
4325 @item -dy
4326 @opindex dy
4327 Dump debugging information during parsing, to standard error.
4328 @end table
4329
4330 @item -fdump-noaddr
4331 @opindex fdump-noaddr
4332 When doing debugging dumps (see @option{-d} option above), suppress
4333 address output.  This makes it more feasible to use diff on debugging
4334 dumps for compiler invocations with different compiler binaries and/or
4335 different text / bss / data / heap / stack / dso start locations.
4336
4337 @item -fdump-unnumbered
4338 @opindex fdump-unnumbered
4339 When doing debugging dumps (see @option{-d} option above), suppress instruction
4340 numbers, line number note and address output.  This makes it more feasible to
4341 use diff on debugging dumps for compiler invocations with different
4342 options, in particular with and without @option{-g}.
4343
4344 @item -fdump-translation-unit @r{(C++ only)}
4345 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4346 @opindex fdump-translation-unit
4347 Dump a representation of the tree structure for the entire translation
4348 unit to a file.  The file name is made by appending @file{.tu} to the
4349 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4350 controls the details of the dump as described for the
4351 @option{-fdump-tree} options.
4352
4353 @item -fdump-class-hierarchy @r{(C++ only)}
4354 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4355 @opindex fdump-class-hierarchy
4356 Dump a representation of each class's hierarchy and virtual function
4357 table layout to a file.  The file name is made by appending @file{.class}
4358 to the source file name.  If the @samp{-@var{options}} form is used,
4359 @var{options} controls the details of the dump as described for the
4360 @option{-fdump-tree} options.
4361
4362 @item -fdump-ipa-@var{switch}
4363 @opindex fdump-ipa
4364 Control the dumping at various stages of inter-procedural analysis
4365 language tree to a file.  The file name is generated by appending a switch
4366 specific suffix to the source file name.  The following dumps are possible:
4367
4368 @table @samp
4369 @item all
4370 Enables all inter-procedural analysis dumps; currently the only produced
4371 dump is the @samp{cgraph} dump.
4372
4373 @item cgraph
4374 Dumps information about call-graph optimization, unused function removal,
4375 and inlining decisions.
4376 @end table
4377
4378 @item -fdump-tree-@var{switch}
4379 @itemx -fdump-tree-@var{switch}-@var{options}
4380 @opindex fdump-tree
4381 Control the dumping at various stages of processing the intermediate
4382 language tree to a file.  The file name is generated by appending a switch
4383 specific suffix to the source file name.  If the @samp{-@var{options}}
4384 form is used, @var{options} is a list of @samp{-} separated options that
4385 control the details of the dump.  Not all options are applicable to all
4386 dumps, those which are not meaningful will be ignored.  The following
4387 options are available
4388
4389 @table @samp
4390 @item address
4391 Print the address of each node.  Usually this is not meaningful as it
4392 changes according to the environment and source file.  Its primary use
4393 is for tying up a dump file with a debug environment.
4394 @item slim
4395 Inhibit dumping of members of a scope or body of a function merely
4396 because that scope has been reached.  Only dump such items when they
4397 are directly reachable by some other path.  When dumping pretty-printed
4398 trees, this option inhibits dumping the bodies of control structures.
4399 @item raw
4400 Print a raw representation of the tree.  By default, trees are
4401 pretty-printed into a C-like representation.
4402 @item details
4403 Enable more detailed dumps (not honored by every dump option).
4404 @item stats
4405 Enable dumping various statistics about the pass (not honored by every dump
4406 option).
4407 @item blocks
4408 Enable showing basic block boundaries (disabled in raw dumps).
4409 @item vops
4410 Enable showing virtual operands for every statement.
4411 @item lineno
4412 Enable showing line numbers for statements.
4413 @item uid
4414 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4415 @item all
4416 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4417 @end table
4418
4419 The following tree dumps are possible:
4420 @table @samp
4421
4422 @item original
4423 Dump before any tree based optimization, to @file{@var{file}.original}.
4424
4425 @item optimized
4426 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4427
4428 @item inlined
4429 Dump after function inlining, to @file{@var{file}.inlined}.
4430
4431 @item gimple
4432 @opindex fdump-tree-gimple
4433 Dump each function before and after the gimplification pass to a file.  The
4434 file name is made by appending @file{.gimple} to the source file name.
4435
4436 @item cfg
4437 @opindex fdump-tree-cfg
4438 Dump the control flow graph of each function to a file.  The file name is
4439 made by appending @file{.cfg} to the source file name.
4440
4441 @item vcg
4442 @opindex fdump-tree-vcg
4443 Dump the control flow graph of each function to a file in VCG format.  The
4444 file name is made by appending @file{.vcg} to the source file name.  Note
4445 that if the file contains more than one function, the generated file cannot
4446 be used directly by VCG@.  You will need to cut and paste each function's
4447 graph into its own separate file first.
4448
4449 @item ch
4450 @opindex fdump-tree-ch
4451 Dump each function after copying loop headers.  The file name is made by
4452 appending @file{.ch} to the source file name.
4453
4454 @item ssa
4455 @opindex fdump-tree-ssa
4456 Dump SSA related information to a file.  The file name is made by appending
4457 @file{.ssa} to the source file name.
4458
4459 @item salias
4460 @opindex fdump-tree-salias
4461 Dump structure aliasing variable information to a file.  This file name
4462 is made by appending @file{.salias} to the source file name.
4463
4464 @item alias
4465 @opindex fdump-tree-alias
4466 Dump aliasing information for each function.  The file name is made by
4467 appending @file{.alias} to the source file name.
4468
4469 @item ccp
4470 @opindex fdump-tree-ccp
4471 Dump each function after CCP@.  The file name is made by appending
4472 @file{.ccp} to the source file name.
4473
4474 @item storeccp
4475 @opindex fdump-tree-storeccp
4476 Dump each function after STORE-CCP.  The file name is made by appending
4477 @file{.storeccp} to the source file name.
4478
4479 @item pre
4480 @opindex fdump-tree-pre
4481 Dump trees after partial redundancy elimination.  The file name is made
4482 by appending @file{.pre} to the source file name.
4483
4484 @item fre
4485 @opindex fdump-tree-fre
4486 Dump trees after full redundancy elimination.  The file name is made
4487 by appending @file{.fre} to the source file name.
4488
4489 @item copyprop
4490 @opindex fdump-tree-copyprop
4491 Dump trees after copy propagation.  The file name is made
4492 by appending @file{.copyprop} to the source file name.
4493
4494 @item store_copyprop
4495 @opindex fdump-tree-store_copyprop
4496 Dump trees after store copy-propagation.  The file name is made
4497 by appending @file{.store_copyprop} to the source file name.
4498
4499 @item dce
4500 @opindex fdump-tree-dce
4501 Dump each function after dead code elimination.  The file name is made by
4502 appending @file{.dce} to the source file name.
4503
4504 @item mudflap
4505 @opindex fdump-tree-mudflap
4506 Dump each function after adding mudflap instrumentation.  The file name is
4507 made by appending @file{.mudflap} to the source file name.
4508
4509 @item sra
4510 @opindex fdump-tree-sra
4511 Dump each function after performing scalar replacement of aggregates.  The
4512 file name is made by appending @file{.sra} to the source file name.
4513
4514 @item sink
4515 @opindex fdump-tree-sink
4516 Dump each function after performing code sinking.  The file name is made
4517 by appending @file{.sink} to the source file name. 
4518
4519 @item dom
4520 @opindex fdump-tree-dom
4521 Dump each function after applying dominator tree optimizations.  The file
4522 name is made by appending @file{.dom} to the source file name.
4523
4524 @item dse
4525 @opindex fdump-tree-dse
4526 Dump each function after applying dead store elimination.  The file
4527 name is made by appending @file{.dse} to the source file name.
4528
4529 @item phiopt
4530 @opindex fdump-tree-phiopt
4531 Dump each function after optimizing PHI nodes into straightline code.  The file
4532 name is made by appending @file{.phiopt} to the source file name.
4533
4534 @item forwprop
4535 @opindex fdump-tree-forwprop
4536 Dump each function after forward propagating single use variables.  The file
4537 name is made by appending @file{.forwprop} to the source file name.
4538
4539 @item copyrename
4540 @opindex fdump-tree-copyrename
4541 Dump each function after applying the copy rename optimization.  The file
4542 name is made by appending @file{.copyrename} to the source file name.
4543
4544 @item nrv
4545 @opindex fdump-tree-nrv
4546 Dump each function after applying the named return value optimization on
4547 generic trees.  The file name is made by appending @file{.nrv} to the source
4548 file name.
4549
4550 @item vect
4551 @opindex fdump-tree-vect
4552 Dump each function after applying vectorization of loops.  The file name is
4553 made by appending @file{.vect} to the source file name.
4554
4555 @item vrp
4556 @opindex fdump-tree-vrp
4557 Dump each function after Value Range Propagation (VRP).  The file name
4558 is made by appending @file{.vrp} to the source file name.
4559
4560 @item all
4561 @opindex fdump-tree-all
4562 Enable all the available tree dumps with the flags provided in this option.
4563 @end table
4564
4565 @item -ftree-vectorizer-verbose=@var{n}
4566 @opindex ftree-vectorizer-verbose
4567 This option controls the amount of debugging output the vectorizer prints.
4568 This information is written to standard error, unless 
4569 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified, 
4570 in which case it is output to the usual dump listing file, @file{.vect}.
4571 For @var{n}=0 no diagnostic information is reported.
4572 If @var{n}=1 the vectorizer reports each loop that got vectorized, 
4573 and the total number of loops that got vectorized.
4574 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed 
4575 the first analysis phase (vect_analyze_loop_form) - i.e. countable, 
4576 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity 
4577 level that @option{-fdump-tree-vect-stats} uses.
4578 Higher verbosity levels mean either more information dumped for each 
4579 reported loop, or same amount of information reported for more loops:
4580 If @var{n}=3, alignment related information is added to the reports.
4581 If @var{n}=4, data-references related information (e.g. memory dependences, 
4582 memory access-patterns) is added to the reports.
4583 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops 
4584 that did not pass the first analysis phase (i.e. may not be countable, or 
4585 may have complicated control-flow).
4586 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4587 For @var{n}=7, all the information the vectorizer generates during its 
4588 analysis and transformation is reported.  This is the same verbosity level
4589 that @option{-fdump-tree-vect-details} uses.
4590
4591 @item -frandom-seed=@var{string}
4592 @opindex frandom-string
4593 This option provides a seed that GCC uses when it would otherwise use
4594 random numbers.  It is used to generate certain symbol names
4595 that have to be different in every compiled file.  It is also used to
4596 place unique stamps in coverage data files and the object files that
4597 produce them.  You can use the @option{-frandom-seed} option to produce
4598 reproducibly identical object files.
4599
4600 The @var{string} should be different for every file you compile.
4601
4602 @item -fsched-verbose=@var{n}
4603 @opindex fsched-verbose
4604 On targets that use instruction scheduling, this option controls the
4605 amount of debugging output the scheduler prints.  This information is
4606 written to standard error, unless @option{-dS} or @option{-dR} is
4607 specified, in which case it is output to the usual dump
4608 listing file, @file{.sched} or @file{.sched2} respectively.  However
4609 for @var{n} greater than nine, the output is always printed to standard
4610 error.
4611
4612 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4613 same information as @option{-dRS}.  For @var{n} greater than one, it
4614 also output basic block probabilities, detailed ready list information
4615 and unit/insn info.  For @var{n} greater than two, it includes RTL
4616 at abort point, control-flow and regions info.  And for @var{n} over
4617 four, @option{-fsched-verbose} also includes dependence info.
4618
4619 @item -save-temps
4620 @opindex save-temps
4621 Store the usual ``temporary'' intermediate files permanently; place them
4622 in the current directory and name them based on the source file.  Thus,
4623 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4624 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4625 preprocessed @file{foo.i} output file even though the compiler now
4626 normally uses an integrated preprocessor.
4627
4628 When used in combination with the @option{-x} command line option,
4629 @option{-save-temps} is sensible enough to avoid over writing an
4630 input source file with the same extension as an intermediate file.
4631 The corresponding intermediate file may be obtained by renaming the
4632 source file before using @option{-save-temps}.
4633
4634 @item -time
4635 @opindex time
4636 Report the CPU time taken by each subprocess in the compilation
4637 sequence.  For C source files, this is the compiler proper and assembler
4638 (plus the linker if linking is done).  The output looks like this:
4639
4640 @smallexample
4641 # cc1 0.12 0.01
4642 # as 0.00 0.01
4643 @end smallexample
4644
4645 The first number on each line is the ``user time'', that is time spent
4646 executing the program itself.  The second number is ``system time'',
4647 time spent executing operating system routines on behalf of the program.
4648 Both numbers are in seconds.
4649
4650 @item -fvar-tracking
4651 @opindex fvar-tracking
4652 Run variable tracking pass.  It computes where variables are stored at each
4653 position in code.  Better debugging information is then generated
4654 (if the debugging information format supports this information).
4655
4656 It is enabled by default when compiling with optimization (@option{-Os},
4657 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4658 the debug info format supports it.
4659
4660 @item -print-file-name=@var{library}
4661 @opindex print-file-name
4662 Print the full absolute name of the library file @var{library} that
4663 would be used when linking---and don't do anything else.  With this
4664 option, GCC does not compile or link anything; it just prints the
4665 file name.
4666
4667 @item -print-multi-directory
4668 @opindex print-multi-directory
4669 Print the directory name corresponding to the multilib selected by any
4670 other switches present in the command line.  This directory is supposed
4671 to exist in @env{GCC_EXEC_PREFIX}.
4672
4673 @item -print-multi-lib
4674 @opindex print-multi-lib
4675 Print the mapping from multilib directory names to compiler switches
4676 that enable them.  The directory name is separated from the switches by
4677 @samp{;}, and each switch starts with an @samp{@@} instead of the
4678 @samp{-}, without spaces between multiple switches.  This is supposed to
4679 ease shell-processing.
4680
4681 @item -print-prog-name=@var{program}
4682 @opindex print-prog-name
4683 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4684
4685 @item -print-libgcc-file-name
4686 @opindex print-libgcc-file-name
4687 Same as @option{-print-file-name=libgcc.a}.
4688
4689 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4690 but you do want to link with @file{libgcc.a}.  You can do
4691
4692 @smallexample
4693 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4694 @end smallexample
4695
4696 @item -print-search-dirs
4697 @opindex print-search-dirs
4698 Print the name of the configured installation directory and a list of
4699 program and library directories @command{gcc} will search---and don't do anything else.
4700
4701 This is useful when @command{gcc} prints the error message
4702 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4703 To resolve this you either need to put @file{cpp0} and the other compiler
4704 components where @command{gcc} expects to find them, or you can set the environment
4705 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4706 Don't forget the trailing @samp{/}.
4707 @xref{Environment Variables}.
4708
4709 @item -print-sysroot-headers-suffix
4710 @opindex print-sysroot-headers-suffix
4711 Print the suffix added to the target sysroot when searching for
4712 headers, or give an error if the compiler is not configured with such
4713 a suffix---and don't do anything else.
4714
4715 @item -dumpmachine
4716 @opindex dumpmachine
4717 Print the compiler's target machine (for example,
4718 @samp{i686-pc-linux-gnu})---and don't do anything else.
4719
4720 @item -dumpversion
4721 @opindex dumpversion
4722 Print the compiler version (for example, @samp{3.0})---and don't do
4723 anything else.
4724
4725 @item -dumpspecs
4726 @opindex dumpspecs
4727 Print the compiler's built-in specs---and don't do anything else.  (This
4728 is used when GCC itself is being built.)  @xref{Spec Files}.
4729
4730 @item -feliminate-unused-debug-types
4731 @opindex feliminate-unused-debug-types
4732 Normally, when producing DWARF2 output, GCC will emit debugging
4733 information for all types declared in a compilation
4734 unit, regardless of whether or not they are actually used
4735 in that compilation unit.  Sometimes this is useful, such as
4736 if, in the debugger, you want to cast a value to a type that is
4737 not actually used in your program (but is declared).  More often,
4738 however, this results in a significant amount of wasted space.
4739 With this option, GCC will avoid producing debug symbol output
4740 for types that are nowhere used in the source file being compiled.
4741 @end table
4742
4743 @node Optimize Options
4744 @section Options That Control Optimization
4745 @cindex optimize options
4746 @cindex options, optimization
4747
4748 These options control various sorts of optimizations.
4749
4750 Without any optimization option, the compiler's goal is to reduce the
4751 cost of compilation and to make debugging produce the expected
4752 results.  Statements are independent: if you stop the program with a
4753 breakpoint between statements, you can then assign a new value to any
4754 variable or change the program counter to any other statement in the
4755 function and get exactly the results you would expect from the source
4756 code.
4757
4758 Turning on optimization flags makes the compiler attempt to improve
4759 the performance and/or code size at the expense of compilation time
4760 and possibly the ability to debug the program.
4761
4762 The compiler performs optimization based on the knowledge it has of
4763 the program.  Optimization levels @option{-O} and above, in
4764 particular, enable @emph{unit-at-a-time} mode, which allows the
4765 compiler to consider information gained from later functions in
4766 the file when compiling a function.  Compiling multiple files at
4767 once to a single output file in @emph{unit-at-a-time} mode allows
4768 the compiler to use information gained from all of the files when
4769 compiling each of them.
4770
4771 Not all optimizations are controlled directly by a flag.  Only
4772 optimizations that have a flag are listed.
4773
4774 @table @gcctabopt
4775 @item -O
4776 @itemx -O1
4777 @opindex O
4778 @opindex O1
4779 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4780 more memory for a large function.
4781
4782 With @option{-O}, the compiler tries to reduce code size and execution
4783 time, without performing any optimizations that take a great deal of
4784 compilation time.
4785
4786 @option{-O} turns on the following optimization flags:
4787 @gccoptlist{-fdefer-pop @gol
4788 -fdelayed-branch @gol
4789 -fguess-branch-probability @gol
4790 -fcprop-registers @gol
4791 -fif-conversion @gol
4792 -fif-conversion2 @gol
4793 -fsplit-wide-types @gol
4794 -ftree-ccp @gol
4795 -ftree-dce @gol
4796 -ftree-dominator-opts @gol
4797 -ftree-dse @gol
4798 -ftree-ter @gol
4799 -ftree-sra @gol
4800 -ftree-copyrename @gol
4801 -ftree-fre @gol
4802 -ftree-ch @gol
4803 -funit-at-a-time @gol
4804 -fmerge-constants}
4805
4806 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4807 where doing so does not interfere with debugging.
4808
4809 @item -O2
4810 @opindex O2
4811 Optimize even more.  GCC performs nearly all supported optimizations
4812 that do not involve a space-speed tradeoff.  The compiler does not
4813 perform loop unrolling or function inlining when you specify @option{-O2}.
4814 As compared to @option{-O}, this option increases both compilation time
4815 and the performance of the generated code.
4816
4817 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4818 also turns on the following optimization flags:
4819 @gccoptlist{-fthread-jumps @gol
4820 -fcrossjumping @gol
4821 -foptimize-sibling-calls @gol
4822 -fcse-follow-jumps  -fcse-skip-blocks @gol
4823 -fgcse  -fgcse-lm  @gol
4824 -fexpensive-optimizations @gol
4825 -frerun-cse-after-loop  @gol
4826 -fcaller-saves @gol
4827 -fpeephole2 @gol
4828 -fschedule-insns  -fschedule-insns2 @gol
4829 -fsched-interblock  -fsched-spec @gol
4830 -fregmove @gol
4831 -fstrict-aliasing -fstrict-overflow @gol
4832 -fdelete-null-pointer-checks @gol
4833 -freorder-blocks  -freorder-functions @gol
4834 -falign-functions  -falign-jumps @gol
4835 -falign-loops  -falign-labels @gol
4836 -ftree-vrp @gol
4837 -ftree-pre}
4838
4839 Please note the warning under @option{-fgcse} about
4840 invoking @option{-O2} on programs that use computed gotos.
4841
4842 @item -O3
4843 @opindex O3
4844 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4845 @option{-O2} and also turns on the @option{-finline-functions},
4846 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4847
4848 @item -O0
4849 @opindex O0
4850 Reduce compilation time and make debugging produce the expected
4851 results.  This is the default.
4852
4853 @item -Os
4854 @opindex Os
4855 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4856 do not typically increase code size.  It also performs further
4857 optimizations designed to reduce code size.
4858
4859 @option{-Os} disables the following optimization flags:
4860 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4861 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
4862 -fprefetch-loop-arrays  -ftree-vect-loop-version}
4863
4864 If you use multiple @option{-O} options, with or without level numbers,
4865 the last such option is the one that is effective.
4866 @end table
4867
4868 Options of the form @option{-f@var{flag}} specify machine-independent
4869 flags.  Most flags have both positive and negative forms; the negative
4870 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4871 below, only one of the forms is listed---the one you typically will
4872 use.  You can figure out the other form by either removing @samp{no-}
4873 or adding it.
4874
4875 The following options control specific optimizations.  They are either
4876 activated by @option{-O} options or are related to ones that are.  You
4877 can use the following flags in the rare cases when ``fine-tuning'' of
4878 optimizations to be performed is desired.
4879
4880 @table @gcctabopt
4881 @item -fno-default-inline
4882 @opindex fno-default-inline
4883 Do not make member functions inline by default merely because they are
4884 defined inside the class scope (C++ only).  Otherwise, when you specify
4885 @w{@option{-O}}, member functions defined inside class scope are compiled
4886 inline by default; i.e., you don't need to add @samp{inline} in front of
4887 the member function name.
4888
4889 @item -fno-defer-pop
4890 @opindex fno-defer-pop
4891 Always pop the arguments to each function call as soon as that function
4892 returns.  For machines which must pop arguments after a function call,
4893 the compiler normally lets arguments accumulate on the stack for several
4894 function calls and pops them all at once.
4895
4896 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4897
4898 @item -fforce-addr
4899 @opindex fforce-addr
4900 Force memory address constants to be copied into registers before
4901 doing arithmetic on them.
4902
4903 @item -fforward-propagate
4904 @opindex fforward-propagate
4905 Perform a forward propagation pass on RTL.  The pass tries to combine two
4906 instructions and checks if the result can be simplified.  If loop unrolling
4907 is active, two passes are performed and the second is scheduled after
4908 loop unrolling.
4909
4910 This option is enabled by default at optimization levels @option{-O2},
4911 @option{-O3}, @option{-Os}.
4912
4913 @item -fomit-frame-pointer
4914 @opindex fomit-frame-pointer
4915 Don't keep the frame pointer in a register for functions that
4916 don't need one.  This avoids the instructions to save, set up and
4917 restore frame pointers; it also makes an extra register available
4918 in many functions.  @strong{It also makes debugging impossible on
4919 some machines.}
4920
4921 On some machines, such as the VAX, this flag has no effect, because
4922 the standard calling sequence automatically handles the frame pointer
4923 and nothing is saved by pretending it doesn't exist.  The
4924 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4925 whether a target machine supports this flag.  @xref{Registers,,Register
4926 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4927
4928 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4929
4930 @item -foptimize-sibling-calls
4931 @opindex foptimize-sibling-calls
4932 Optimize sibling and tail recursive calls.
4933
4934 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4935
4936 @item -fno-inline
4937 @opindex fno-inline
4938 Don't pay attention to the @code{inline} keyword.  Normally this option
4939 is used to keep the compiler from expanding any functions inline.
4940 Note that if you are not optimizing, no functions can be expanded inline.
4941
4942 @item -finline-functions
4943 @opindex finline-functions
4944 Integrate all simple functions into their callers.  The compiler
4945 heuristically decides which functions are simple enough to be worth
4946 integrating in this way.
4947
4948 If all calls to a given function are integrated, and the function is
4949 declared @code{static}, then the function is normally not output as
4950 assembler code in its own right.
4951
4952 Enabled at level @option{-O3}.
4953
4954 @item -finline-functions-called-once
4955 @opindex finline-functions-called-once
4956 Consider all @code{static} functions called once for inlining into their
4957 caller even if they are not marked @code{inline}.  If a call to a given
4958 function is integrated, then the function is not output as assembler code
4959 in its own right.
4960
4961 Enabled if @option{-funit-at-a-time} is enabled.
4962
4963 @item -fearly-inlining
4964 @opindex fearly-inlining
4965 Inline functions marked by @code{always_inline} and functions whose body seems
4966 smaller than the function call overhead early before doing
4967 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4968 makes profiling significantly cheaper and usually inlining faster on programs
4969 having large chains of nested wrapper functions.
4970
4971 Enabled by default.
4972
4973 @item -finline-limit=@var{n}
4974 @opindex finline-limit
4975 By default, GCC limits the size of functions that can be inlined.  This flag
4976 allows the control of this limit for functions that are explicitly marked as
4977 inline (i.e., marked with the inline keyword or defined within the class
4978 definition in c++).  @var{n} is the size of functions that can be inlined in
4979 number of pseudo instructions (not counting parameter handling).  The default
4980 value of @var{n} is 600.
4981 Increasing this value can result in more inlined code at
4982 the cost of compilation time and memory consumption.  Decreasing usually makes
4983 the compilation faster and less code will be inlined (which presumably
4984 means slower programs).  This option is particularly useful for programs that
4985 use inlining heavily such as those based on recursive templates with C++.
4986
4987 Inlining is actually controlled by a number of parameters, which may be
4988 specified individually by using @option{--param @var{name}=@var{value}}.
4989 The @option{-finline-limit=@var{n}} option sets some of these parameters
4990 as follows:
4991
4992 @table @gcctabopt
4993 @item max-inline-insns-single
4994  is set to @var{n}/2.
4995 @item max-inline-insns-auto
4996  is set to @var{n}/2.
4997 @item min-inline-insns
4998  is set to 130 or @var{n}/4, whichever is smaller.
4999 @item max-inline-insns-rtl
5000  is set to @var{n}.
5001 @end table
5002
5003 See below for a documentation of the individual
5004 parameters controlling inlining.
5005
5006 @emph{Note:} pseudo instruction represents, in this particular context, an
5007 abstract measurement of function's size.  In no way does it represent a count
5008 of assembly instructions and as such its exact meaning might change from one
5009 release to an another.
5010
5011 @item -fkeep-inline-functions
5012 @opindex fkeep-inline-functions
5013 In C, emit @code{static} functions that are declared @code{inline}
5014 into the object file, even if the function has been inlined into all
5015 of its callers.  This switch does not affect functions using the
5016 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5017 inline functions into the object file.
5018
5019 @item -fkeep-static-consts
5020 @opindex fkeep-static-consts
5021 Emit variables declared @code{static const} when optimization isn't turned
5022 on, even if the variables aren't referenced.
5023
5024 GCC enables this option by default.  If you want to force the compiler to
5025 check if the variable was referenced, regardless of whether or not
5026 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5027
5028 @item -fmerge-constants
5029 Attempt to merge identical constants (string constants and floating point
5030 constants) across compilation units.
5031
5032 This option is the default for optimized compilation if the assembler and
5033 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5034 behavior.
5035
5036 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5037
5038 @item -fmerge-all-constants
5039 Attempt to merge identical constants and identical variables.
5040
5041 This option implies @option{-fmerge-constants}.  In addition to
5042 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5043 arrays or initialized constant variables with integral or floating point
5044 types.  Languages like C or C++ require each non-automatic variable to
5045 have distinct location, so using this option will result in non-conforming
5046 behavior.
5047
5048 @item -fmodulo-sched
5049 @opindex fmodulo-sched
5050 Perform swing modulo scheduling immediately before the first scheduling
5051 pass.  This pass looks at innermost loops and reorders their
5052 instructions by overlapping different iterations.
5053
5054 @item -fno-branch-count-reg
5055 @opindex fno-branch-count-reg
5056 Do not use ``decrement and branch'' instructions on a count register,
5057 but instead generate a sequence of instructions that decrement a
5058 register, compare it against zero, then branch based upon the result.
5059 This option is only meaningful on architectures that support such
5060 instructions, which include x86, PowerPC, IA-64 and S/390.
5061
5062 The default is @option{-fbranch-count-reg}.
5063
5064 @item -fno-function-cse
5065 @opindex fno-function-cse
5066 Do not put function addresses in registers; make each instruction that
5067 calls a constant function contain the function's address explicitly.
5068
5069 This option results in less efficient code, but some strange hacks
5070 that alter the assembler output may be confused by the optimizations
5071 performed when this option is not used.
5072
5073 The default is @option{-ffunction-cse}
5074
5075 @item -fno-zero-initialized-in-bss
5076 @opindex fno-zero-initialized-in-bss
5077 If the target supports a BSS section, GCC by default puts variables that
5078 are initialized to zero into BSS@.  This can save space in the resulting
5079 code.
5080
5081 This option turns off this behavior because some programs explicitly
5082 rely on variables going to the data section.  E.g., so that the
5083 resulting executable can find the beginning of that section and/or make
5084 assumptions based on that.
5085
5086 The default is @option{-fzero-initialized-in-bss}.
5087
5088 @item -fbounds-check
5089 @opindex fbounds-check
5090 For front-ends that support it, generate additional code to check that
5091 indices used to access arrays are within the declared range.  This is
5092 currently only supported by the Java and Fortran front-ends, where
5093 this option defaults to true and false respectively.
5094
5095 @item -fmudflap -fmudflapth -fmudflapir
5096 @opindex fmudflap
5097 @opindex fmudflapth
5098 @opindex fmudflapir
5099 @cindex bounds checking
5100 @cindex mudflap
5101 For front-ends that support it (C and C++), instrument all risky
5102 pointer/array dereferencing operations, some standard library
5103 string/heap functions, and some other associated constructs with
5104 range/validity tests.  Modules so instrumented should be immune to
5105 buffer overflows, invalid heap use, and some other classes of C/C++
5106 programming errors.  The instrumentation relies on a separate runtime
5107 library (@file{libmudflap}), which will be linked into a program if
5108 @option{-fmudflap} is given at link time.  Run-time behavior of the
5109 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5110 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5111 for its options.
5112
5113 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5114 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5115 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5116 instrumentation should ignore pointer reads.  This produces less
5117 instrumentation (and therefore faster execution) and still provides
5118 some protection against outright memory corrupting writes, but allows
5119 erroneously read data to propagate within a program.
5120
5121 @item -fthread-jumps
5122 @opindex fthread-jumps
5123 Perform optimizations where we check to see if a jump branches to a
5124 location where another comparison subsumed by the first is found.  If
5125 so, the first branch is redirected to either the destination of the
5126 second branch or a point immediately following it, depending on whether
5127 the condition is known to be true or false.
5128
5129 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5130
5131 @item -fsplit-wide-types
5132 @opindex -fsplit-wide-types
5133 When using a type that occupies multiple registers, such as @code{long
5134 long} on a 32-bit system, split the registers apart and allocate them
5135 independently.  This normally generates better code for those types,
5136 but may make debugging more difficult.
5137
5138 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5139 @option{-Os}.
5140
5141 @item -fcse-follow-jumps
5142 @opindex fcse-follow-jumps
5143 In common subexpression elimination, scan through jump instructions
5144 when the target of the jump is not reached by any other path.  For
5145 example, when CSE encounters an @code{if} statement with an
5146 @code{else} clause, CSE will follow the jump when the condition
5147 tested is false.
5148
5149 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5150
5151 @item -fcse-skip-blocks
5152 @opindex fcse-skip-blocks
5153 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5154 follow jumps which conditionally skip over blocks.  When CSE
5155 encounters a simple @code{if} statement with no else clause,
5156 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5157 body of the @code{if}.
5158
5159 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5160
5161 @item -frerun-cse-after-loop
5162 @opindex frerun-cse-after-loop
5163 Re-run common subexpression elimination after loop optimizations has been
5164 performed.
5165
5166 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5167
5168 @item -fgcse
5169 @opindex fgcse
5170 Perform a global common subexpression elimination pass.
5171 This pass also performs global constant and copy propagation.
5172
5173 @emph{Note:} When compiling a program using computed gotos, a GCC
5174 extension, you may get better runtime performance if you disable
5175 the global common subexpression elimination pass by adding
5176 @option{-fno-gcse} to the command line.
5177
5178 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5179
5180 @item -fgcse-lm
5181 @opindex fgcse-lm
5182 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5183 attempt to move loads which are only killed by stores into themselves.  This
5184 allows a loop containing a load/store sequence to be changed to a load outside
5185 the loop, and a copy/store within the loop.
5186
5187 Enabled by default when gcse is enabled.
5188
5189 @item -fgcse-sm
5190 @opindex fgcse-sm
5191 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5192 global common subexpression elimination.  This pass will attempt to move
5193 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5194 loops containing a load/store sequence can be changed to a load before
5195 the loop and a store after the loop.
5196
5197 Not enabled at any optimization level.
5198
5199 @item -fgcse-las
5200 @opindex fgcse-las
5201 When @option{-fgcse-las} is enabled, the global common subexpression
5202 elimination pass eliminates redundant loads that come after stores to the
5203 same memory location (both partial and full redundancies).
5204
5205 Not enabled at any optimization level.
5206
5207 @item -fgcse-after-reload
5208 @opindex fgcse-after-reload
5209 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5210 pass is performed after reload.  The purpose of this pass is to cleanup
5211 redundant spilling.
5212
5213 @item -funsafe-loop-optimizations
5214 @opindex funsafe-loop-optimizations
5215 If given, the loop optimizer will assume that loop indices do not
5216 overflow, and that the loops with nontrivial exit condition are not
5217 infinite.  This enables a wider range of loop optimizations even if
5218 the loop optimizer itself cannot prove that these assumptions are valid.
5219 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5220 if it finds this kind of loop.
5221
5222 @item -fcrossjumping
5223 @opindex crossjumping
5224 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5225 resulting code may or may not perform better than without cross-jumping.
5226
5227 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5228
5229 @item -fif-conversion
5230 @opindex if-conversion
5231 Attempt to transform conditional jumps into branch-less equivalents.  This
5232 include use of conditional moves, min, max, set flags and abs instructions, and
5233 some tricks doable by standard arithmetics.  The use of conditional execution
5234 on chips where it is available is controlled by @code{if-conversion2}.
5235
5236 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5237
5238 @item -fif-conversion2
5239 @opindex if-conversion2
5240 Use conditional execution (where available) to transform conditional jumps into
5241 branch-less equivalents.
5242
5243 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5244
5245 @item -fdelete-null-pointer-checks
5246 @opindex fdelete-null-pointer-checks
5247 Use global dataflow analysis to identify and eliminate useless checks
5248 for null pointers.  The compiler assumes that dereferencing a null
5249 pointer would have halted the program.  If a pointer is checked after
5250 it has already been dereferenced, it cannot be null.
5251
5252 In some environments, this assumption is not true, and programs can
5253 safely dereference null pointers.  Use
5254 @option{-fno-delete-null-pointer-checks} to disable this optimization
5255 for programs which depend on that behavior.
5256
5257 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5258
5259 @item -fexpensive-optimizations
5260 @opindex fexpensive-optimizations
5261 Perform a number of minor optimizations that are relatively expensive.
5262
5263 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5264
5265 @item -foptimize-register-move
5266 @itemx -fregmove
5267 @opindex foptimize-register-move
5268 @opindex fregmove
5269 Attempt to reassign register numbers in move instructions and as
5270 operands of other simple instructions in order to maximize the amount of
5271 register tying.  This is especially helpful on machines with two-operand
5272 instructions.
5273
5274 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5275 optimization.
5276
5277 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5278
5279 @item -fdelayed-branch
5280 @opindex fdelayed-branch
5281 If supported for the target machine, attempt to reorder instructions
5282 to exploit instruction slots available after delayed branch
5283 instructions.
5284
5285 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5286
5287 @item -fschedule-insns
5288 @opindex fschedule-insns
5289 If supported for the target machine, attempt to reorder instructions to
5290 eliminate execution stalls due to required data being unavailable.  This
5291 helps machines that have slow floating point or memory load instructions
5292 by allowing other instructions to be issued until the result of the load
5293 or floating point instruction is required.
5294
5295 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5296
5297 @item -fschedule-insns2
5298 @opindex fschedule-insns2
5299 Similar to @option{-fschedule-insns}, but requests an additional pass of
5300 instruction scheduling after register allocation has been done.  This is
5301 especially useful on machines with a relatively small number of
5302 registers and where memory load instructions take more than one cycle.
5303
5304 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5305
5306 @item -fno-sched-interblock
5307 @opindex fno-sched-interblock
5308 Don't schedule instructions across basic blocks.  This is normally
5309 enabled by default when scheduling before register allocation, i.e.@:
5310 with @option{-fschedule-insns} or at @option{-O2} or higher.
5311
5312 @item -fno-sched-spec
5313 @opindex fno-sched-spec
5314 Don't allow speculative motion of non-load instructions.  This is normally
5315 enabled by default when scheduling before register allocation, i.e.@:
5316 with @option{-fschedule-insns} or at @option{-O2} or higher.
5317
5318 @item -fsched-spec-load
5319 @opindex fsched-spec-load
5320 Allow speculative motion of some load instructions.  This only makes
5321 sense when scheduling before register allocation, i.e.@: with
5322 @option{-fschedule-insns} or at @option{-O2} or higher.
5323
5324 @item -fsched-spec-load-dangerous
5325 @opindex fsched-spec-load-dangerous
5326 Allow speculative motion of more load instructions.  This only makes
5327 sense when scheduling before register allocation, i.e.@: with
5328 @option{-fschedule-insns} or at @option{-O2} or higher.
5329
5330 @item -fsched-stalled-insns=@var{n}
5331 @opindex fsched-stalled-insns
5332 Define how many insns (if any) can be moved prematurely from the queue
5333 of stalled insns into the ready list, during the second scheduling pass.
5334
5335 @item -fsched-stalled-insns-dep=@var{n}
5336 @opindex fsched-stalled-insns-dep
5337 Define how many insn groups (cycles) will be examined for a dependency
5338 on a stalled insn that is candidate for premature removal from the queue
5339 of stalled insns.  Has an effect only during the second scheduling pass,
5340 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5341
5342 @item -fsched2-use-superblocks
5343 @opindex fsched2-use-superblocks
5344 When scheduling after register allocation, do use superblock scheduling
5345 algorithm.  Superblock scheduling allows motion across basic block boundaries
5346 resulting on faster schedules.  This option is experimental, as not all machine
5347 descriptions used by GCC model the CPU closely enough to avoid unreliable
5348 results from the algorithm.
5349
5350 This only makes sense when scheduling after register allocation, i.e.@: with
5351 @option{-fschedule-insns2} or at @option{-O2} or higher.
5352
5353 @item -fsched2-use-traces
5354 @opindex fsched2-use-traces
5355 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5356 allocation and additionally perform code duplication in order to increase the
5357 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5358 trace formation.
5359
5360 This mode should produce faster but significantly longer programs.  Also
5361 without @option{-fbranch-probabilities} the traces constructed may not
5362 match the reality and hurt the performance.  This only makes
5363 sense when scheduling after register allocation, i.e.@: with
5364 @option{-fschedule-insns2} or at @option{-O2} or higher.
5365
5366 @item -fsee
5367 @opindex fsee
5368 Eliminates redundant extension instructions and move the non redundant
5369 ones to optimal placement using LCM.
5370
5371 @item -freschedule-modulo-scheduled-loops
5372 @opindex fscheduling-in-modulo-scheduled-loops
5373 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5374 we may want to prevent the later scheduling passes from changing its schedule, we use this
5375 option to control that.
5376
5377 @item -fcaller-saves
5378 @opindex fcaller-saves
5379 Enable values to be allocated in registers that will be clobbered by
5380 function calls, by emitting extra instructions to save and restore the
5381 registers around such calls.  Such allocation is done only when it
5382 seems to result in better code than would otherwise be produced.
5383
5384 This option is always enabled by default on certain machines, usually
5385 those which have no call-preserved registers to use instead.
5386
5387 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5388
5389 @item -ftree-pre
5390 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5391 enabled by default at @option{-O2} and @option{-O3}.
5392
5393 @item -ftree-fre
5394 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5395 between FRE and PRE is that FRE only considers expressions
5396 that are computed on all paths leading to the redundant computation.
5397 This analysis faster than PRE, though it exposes fewer redundancies.
5398 This flag is enabled by default at @option{-O} and higher.
5399
5400 @item -ftree-copy-prop
5401 Perform copy propagation on trees.  This pass eliminates unnecessary
5402 copy operations.  This flag is enabled by default at @option{-O} and
5403 higher.
5404
5405 @item -ftree-store-copy-prop
5406 Perform copy propagation of memory loads and stores.  This pass
5407 eliminates unnecessary copy operations in memory references
5408 (structures, global variables, arrays, etc).  This flag is enabled by
5409 default at @option{-O2} and higher.
5410
5411 @item -ftree-salias
5412 Perform structural alias analysis on trees.  This flag
5413 is enabled by default at @option{-O} and higher.
5414
5415 @item -fipa-pta
5416 Perform interprocedural pointer analysis.
5417
5418 @item -ftree-sink
5419 Perform forward store motion  on trees.  This flag is
5420 enabled by default at @option{-O} and higher.
5421
5422 @item -ftree-ccp
5423 Perform sparse conditional constant propagation (CCP) on trees.  This
5424 pass only operates on local scalar variables and is enabled by default
5425 at @option{-O} and higher.
5426
5427 @item -ftree-store-ccp
5428 Perform sparse conditional constant propagation (CCP) on trees.  This
5429 pass operates on both local scalar variables and memory stores and
5430 loads (global variables, structures, arrays, etc).  This flag is
5431 enabled by default at @option{-O2} and higher.
5432
5433 @item -ftree-dce
5434 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5435 default at @option{-O} and higher.
5436
5437 @item -ftree-dominator-opts
5438 Perform a variety of simple scalar cleanups (constant/copy
5439 propagation, redundancy elimination, range propagation and expression
5440 simplification) based on a dominator tree traversal.  This also
5441 performs jump threading (to reduce jumps to jumps). This flag is
5442 enabled by default at @option{-O} and higher.
5443
5444 @item -ftree-ch
5445 Perform loop header copying on trees.  This is beneficial since it increases
5446 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5447 is enabled by default at @option{-O} and higher.  It is not enabled
5448 for @option{-Os}, since it usually increases code size.
5449
5450 @item -ftree-loop-optimize
5451 Perform loop optimizations on trees.  This flag is enabled by default
5452 at @option{-O} and higher.
5453
5454 @item -ftree-loop-linear
5455 Perform linear loop transformations on tree.  This flag can improve cache
5456 performance and allow further loop optimizations to take place.
5457
5458 @item -fcheck-data-deps
5459 Compare the results of several data dependence analyzers.  This option
5460 is used for debugging the data dependence analyzers.
5461
5462 @item -ftree-loop-im
5463 Perform loop invariant motion on trees.  This pass moves only invariants that
5464 would be hard to handle at RTL level (function calls, operations that expand to
5465 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5466 operands of conditions that are invariant out of the loop, so that we can use
5467 just trivial invariantness analysis in loop unswitching.  The pass also includes
5468 store motion.
5469
5470 @item -ftree-loop-ivcanon
5471 Create a canonical counter for number of iterations in the loop for that
5472 determining number of iterations requires complicated analysis.  Later
5473 optimizations then may determine the number easily.  Useful especially
5474 in connection with unrolling.
5475
5476 @item -fivopts
5477 Perform induction variable optimizations (strength reduction, induction
5478 variable merging and induction variable elimination) on trees.
5479
5480 @item -ftree-sra
5481 Perform scalar replacement of aggregates.  This pass replaces structure
5482 references with scalars to prevent committing structures to memory too
5483 early.  This flag is enabled by default at @option{-O} and higher.
5484
5485 @item -ftree-copyrename
5486 Perform copy renaming on trees.  This pass attempts to rename compiler
5487 temporaries to other variables at copy locations, usually resulting in
5488 variable names which more closely resemble the original variables.  This flag
5489 is enabled by default at @option{-O} and higher.
5490
5491 @item -ftree-ter
5492 Perform temporary expression replacement during the SSA->normal phase.  Single
5493 use/single def temporaries are replaced at their use location with their
5494 defining expression.  This results in non-GIMPLE code, but gives the expanders
5495 much more complex trees to work on resulting in better RTL generation.  This is
5496 enabled by default at @option{-O} and higher.
5497
5498 @item -ftree-vectorize
5499 Perform loop vectorization on trees.
5500
5501 @item -ftree-vect-loop-version
5502 @opindex ftree-vect-loop-version
5503 Perform loop versioning when doing loop vectorization on trees.  When a loop
5504 appears to be vectorizable except that data alignment or data dependence cannot
5505 be determined at compile time then vectorized and non-vectorized versions of
5506 the loop are generated along with runtime checks for alignment or dependence
5507 to control which version is executed.  This option is enabled by default
5508 except at level @option{-Os} where it is disabled.
5509
5510 @item -ftree-vrp
5511 Perform Value Range Propagation on trees.  This is similar to the
5512 constant propagation pass, but instead of values, ranges of values are
5513 propagated.  This allows the optimizers to remove unnecessary range
5514 checks like array bound checks and null pointer checks.  This is
5515 enabled by default at @option{-O2} and higher.  Null pointer check
5516 elimination is only done if @option{-fdelete-null-pointer-checks} is
5517 enabled.
5518
5519 @item -ftracer
5520 @opindex ftracer
5521 Perform tail duplication to enlarge superblock size.  This transformation
5522 simplifies the control flow of the function allowing other optimizations to do
5523 better job.
5524
5525 @item -funroll-loops
5526 @opindex funroll-loops
5527 Unroll loops whose number of iterations can be determined at compile
5528 time or upon entry to the loop.  @option{-funroll-loops} implies
5529 @option{-frerun-cse-after-loop}.  This option makes code larger,
5530 and may or may not make it run faster.
5531
5532 @item -funroll-all-loops
5533 @opindex funroll-all-loops
5534 Unroll all loops, even if their number of iterations is uncertain when
5535 the loop is entered.  This usually makes programs run more slowly.
5536 @option{-funroll-all-loops} implies the same options as
5537 @option{-funroll-loops},
5538
5539 @item -fsplit-ivs-in-unroller
5540 @opindex -fsplit-ivs-in-unroller
5541 Enables expressing of values of induction variables in later iterations
5542 of the unrolled loop using the value in the first iteration.  This breaks
5543 long dependency chains, thus improving efficiency of the scheduling passes.
5544
5545 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5546 same effect.  However in cases the loop body is more complicated than
5547 a single basic block, this is not reliable.  It also does not work at all
5548 on some of the architectures due to restrictions in the CSE pass.
5549
5550 This optimization is enabled by default.
5551
5552 @item -fvariable-expansion-in-unroller
5553 @opindex -fvariable-expansion-in-unroller
5554 With this option, the compiler will create multiple copies of some
5555 local variables when unrolling a loop which can result in superior code.
5556
5557 @item -fprefetch-loop-arrays
5558 @opindex fprefetch-loop-arrays
5559 If supported by the target machine, generate instructions to prefetch
5560 memory to improve the performance of loops that access large arrays.
5561
5562 This option may generate better or worse code; results are highly
5563 dependent on the structure of loops within the source code.
5564
5565 Disabled at level @option{-Os}.
5566
5567 @item -fno-peephole
5568 @itemx -fno-peephole2
5569 @opindex fno-peephole
5570 @opindex fno-peephole2
5571 Disable any machine-specific peephole optimizations.  The difference
5572 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5573 are implemented in the compiler; some targets use one, some use the
5574 other, a few use both.
5575
5576 @option{-fpeephole} is enabled by default.
5577 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5578
5579 @item -fno-guess-branch-probability
5580 @opindex fno-guess-branch-probability
5581 Do not guess branch probabilities using heuristics.
5582
5583 GCC will use heuristics to guess branch probabilities if they are
5584 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5585 heuristics are based on the control flow graph.  If some branch probabilities
5586 are specified by @samp{__builtin_expect}, then the heuristics will be
5587 used to guess branch probabilities for the rest of the control flow graph,
5588 taking the @samp{__builtin_expect} info into account.  The interactions
5589 between the heuristics and @samp{__builtin_expect} can be complex, and in
5590 some cases, it may be useful to disable the heuristics so that the effects
5591 of @samp{__builtin_expect} are easier to understand.
5592
5593 The default is @option{-fguess-branch-probability} at levels
5594 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5595
5596 @item -freorder-blocks
5597 @opindex freorder-blocks
5598 Reorder basic blocks in the compiled function in order to reduce number of
5599 taken branches and improve code locality.
5600
5601 Enabled at levels @option{-O2}, @option{-O3}.
5602
5603 @item -freorder-blocks-and-partition
5604 @opindex freorder-blocks-and-partition
5605 In addition to reordering basic blocks in the compiled function, in order
5606 to reduce number of taken branches, partitions hot and cold basic blocks
5607 into separate sections of the assembly and .o files, to improve
5608 paging and cache locality performance.
5609
5610 This optimization is automatically turned off in the presence of
5611 exception handling, for linkonce sections, for functions with a user-defined
5612 section attribute and on any architecture that does not support named
5613 sections.
5614
5615 @item -freorder-functions
5616 @opindex freorder-functions
5617 Reorder functions in the object file in order to
5618 improve code locality.  This is implemented by using special
5619 subsections @code{.text.hot} for most frequently executed functions and
5620 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5621 the linker so object file format must support named sections and linker must
5622 place them in a reasonable way.
5623
5624 Also profile feedback must be available in to make this option effective.  See
5625 @option{-fprofile-arcs} for details.
5626
5627 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5628
5629 @item -fstrict-aliasing
5630 @opindex fstrict-aliasing
5631 Allows the compiler to assume the strictest aliasing rules applicable to
5632 the language being compiled.  For C (and C++), this activates
5633 optimizations based on the type of expressions.  In particular, an
5634 object of one type is assumed never to reside at the same address as an
5635 object of a different type, unless the types are almost the same.  For
5636 example, an @code{unsigned int} can alias an @code{int}, but not a
5637 @code{void*} or a @code{double}.  A character type may alias any other
5638 type.
5639
5640 Pay special attention to code like this:
5641 @smallexample
5642 union a_union @{
5643   int i;
5644   double d;
5645 @};
5646
5647 int f() @{
5648   a_union t;
5649   t.d = 3.0;
5650   return t.i;
5651 @}
5652 @end smallexample
5653 The practice of reading from a different union member than the one most
5654 recently written to (called ``type-punning'') is common.  Even with
5655 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5656 is accessed through the union type.  So, the code above will work as
5657 expected.  However, this code might not:
5658 @smallexample
5659 int f() @{
5660   a_union t;
5661   int* ip;
5662   t.d = 3.0;
5663   ip = &t.i;
5664   return *ip;
5665 @}
5666 @end smallexample
5667
5668 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5669
5670 @item -fstrict-overflow
5671 @opindex fstrict-overflow
5672 Allow the compiler to assume strict signed overflow rules, depending
5673 on the language being compiled.  For C (and C++) this means that
5674 overflow when doing arithmetic with signed numbers is undefined, which
5675 means that the compiler may assume that it will not happen.  This
5676 permits various optimizations.  For example, the compiler will assume
5677 that an expression like @code{i + 10 > i} will always be true for
5678 signed @code{i}.  This assumption is only valid if signed overflow is
5679 undefined, as the expression is false if @code{i + 10} overflows when
5680 using twos complement arithmetic.  When this option is in effect any
5681 attempt to determine whether an operation on signed numbers will
5682 overflow must be written carefully to not actually involve overflow.
5683
5684 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5685 that signed overflow is fully defined: it wraps.  When
5686 @option{-fwrapv} is used, there is no difference between
5687 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5688 @option{-fwrapv} certain types of overflow are permitted.  For
5689 example, if the compiler gets an overflow when doing arithmetic on
5690 constants, the overflowed value can still be used with
5691 @option{-fwrapv}, but not otherwise.
5692
5693 The @option{-fstrict-overflow} option is enabled at levels
5694 @option{-O2}, @option{-O3}, @option{-Os}.
5695
5696 @item -falign-functions
5697 @itemx -falign-functions=@var{n}
5698 @opindex falign-functions
5699 Align the start of functions to the next power-of-two greater than
5700 @var{n}, skipping up to @var{n} bytes.  For instance,
5701 @option{-falign-functions=32} aligns functions to the next 32-byte
5702 boundary, but @option{-falign-functions=24} would align to the next
5703 32-byte boundary only if this can be done by skipping 23 bytes or less.
5704
5705 @option{-fno-align-functions} and @option{-falign-functions=1} are
5706 equivalent and mean that functions will not be aligned.
5707
5708 Some assemblers only support this flag when @var{n} is a power of two;
5709 in that case, it is rounded up.
5710
5711 If @var{n} is not specified or is zero, use a machine-dependent default.
5712
5713 Enabled at levels @option{-O2}, @option{-O3}.
5714
5715 @item -falign-labels
5716 @itemx -falign-labels=@var{n}
5717 @opindex falign-labels
5718 Align all branch targets to a power-of-two boundary, skipping up to
5719 @var{n} bytes like @option{-falign-functions}.  This option can easily
5720 make code slower, because it must insert dummy operations for when the
5721 branch target is reached in the usual flow of the code.
5722
5723 @option{-fno-align-labels} and @option{-falign-labels=1} are
5724 equivalent and mean that labels will not be aligned.
5725
5726 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5727 are greater than this value, then their values are used instead.
5728
5729 If @var{n} is not specified or is zero, use a machine-dependent default
5730 which is very likely to be @samp{1}, meaning no alignment.
5731
5732 Enabled at levels @option{-O2}, @option{-O3}.
5733
5734 @item -falign-loops
5735 @itemx -falign-loops=@var{n}
5736 @opindex falign-loops
5737 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5738 like @option{-falign-functions}.  The hope is that the loop will be
5739 executed many times, which will make up for any execution of the dummy
5740 operations.
5741
5742 @option{-fno-align-loops} and @option{-falign-loops=1} are
5743 equivalent and mean that loops will not be aligned.
5744
5745 If @var{n} is not specified or is zero, use a machine-dependent default.
5746
5747 Enabled at levels @option{-O2}, @option{-O3}.
5748
5749 @item -falign-jumps
5750 @itemx -falign-jumps=@var{n}
5751 @opindex falign-jumps
5752 Align branch targets to a power-of-two boundary, for branch targets
5753 where the targets can only be reached by jumping, skipping up to @var{n}
5754 bytes like @option{-falign-functions}.  In this case, no dummy operations
5755 need be executed.
5756
5757 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5758 equivalent and mean that loops will not be aligned.
5759
5760 If @var{n} is not specified or is zero, use a machine-dependent default.
5761
5762 Enabled at levels @option{-O2}, @option{-O3}.
5763
5764 @item -funit-at-a-time
5765 @opindex funit-at-a-time
5766 Parse the whole compilation unit before starting to produce code.
5767 This allows some extra optimizations to take place but consumes
5768 more memory (in general).  There are some compatibility issues
5769 with @emph{unit-at-a-time} mode:
5770 @itemize @bullet
5771 @item
5772 enabling @emph{unit-at-a-time} mode may change the order
5773 in which functions, variables, and top-level @code{asm} statements
5774 are emitted, and will likely break code relying on some particular
5775 ordering.  The majority of such top-level @code{asm} statements,
5776 though, can be replaced by @code{section} attributes.  The
5777 @option{fno-toplevel-reorder} option may be used to keep the ordering
5778 used in the input file, at the cost of some optimizations.
5779
5780 @item
5781 @emph{unit-at-a-time} mode removes unreferenced static variables
5782 and functions.  This may result in undefined references
5783 when an @code{asm} statement refers directly to variables or functions
5784 that are otherwise unused.  In that case either the variable/function
5785 shall be listed as an operand of the @code{asm} statement operand or,
5786 in the case of top-level @code{asm} statements the attribute @code{used}
5787 shall be used on the declaration.
5788
5789 @item
5790 Static functions now can use non-standard passing conventions that
5791 may break @code{asm} statements calling functions directly.  Again,
5792 attribute @code{used} will prevent this behavior.
5793 @end itemize
5794
5795 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5796 but this scheme may not be supported by future releases of GCC@.
5797
5798 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5799
5800 @item -fno-toplevel-reorder
5801 Do not reorder top-level functions, variables, and @code{asm}
5802 statements.  Output them in the same order that they appear in the
5803 input file.  When this option is used, unreferenced static variables
5804 will not be removed.  This option is intended to support existing code
5805 which relies on a particular ordering.  For new code, it is better to
5806 use attributes.
5807
5808 @item -fweb
5809 @opindex fweb
5810 Constructs webs as commonly used for register allocation purposes and assign
5811 each web individual pseudo register.  This allows the register allocation pass
5812 to operate on pseudos directly, but also strengthens several other optimization
5813 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5814 however, make debugging impossible, since variables will no longer stay in a
5815 ``home register''.
5816
5817 Enabled by default with @option{-funroll-loops}.
5818
5819 @item -fwhole-program
5820 @opindex fwhole-program
5821 Assume that the current compilation unit represents whole program being
5822 compiled.  All public functions and variables with the exception of @code{main}
5823 and those merged by attribute @code{externally_visible} become static functions
5824 and in a affect gets more aggressively optimized by interprocedural optimizers.
5825 While this option is equivalent to proper use of @code{static} keyword for
5826 programs consisting of single file, in combination with option
5827 @option{--combine} this flag can be used to compile most of smaller scale C
5828 programs since the functions and variables become local for the whole combined
5829 compilation unit, not for the single source file itself.
5830
5831
5832 @item -fno-cprop-registers
5833 @opindex fno-cprop-registers
5834 After register allocation and post-register allocation instruction splitting,
5835 we perform a copy-propagation pass to try to reduce scheduling dependencies
5836 and occasionally eliminate the copy.
5837
5838 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5839
5840 @item -fprofile-generate
5841 @opindex fprofile-generate
5842
5843 Enable options usually used for instrumenting application to produce
5844 profile useful for later recompilation with profile feedback based
5845 optimization.  You must use @option{-fprofile-generate} both when
5846 compiling and when linking your program.
5847
5848 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5849
5850 @item -fprofile-use
5851 @opindex fprofile-use
5852 Enable profile feedback directed optimizations, and optimizations
5853 generally profitable only with profile feedback available.
5854
5855 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5856 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
5857
5858 By default, GCC emits an error message if the feedback profiles do not
5859 match the source code.  This error can be turned into a warning by using
5860 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
5861 code.
5862 @end table
5863
5864 The following options control compiler behavior regarding floating
5865 point arithmetic.  These options trade off between speed and
5866 correctness.  All must be specifically enabled.
5867
5868 @table @gcctabopt
5869 @item -ffloat-store
5870 @opindex ffloat-store
5871 Do not store floating point variables in registers, and inhibit other
5872 options that might change whether a floating point value is taken from a
5873 register or memory.
5874
5875 @cindex floating point precision
5876 This option prevents undesirable excess precision on machines such as
5877 the 68000 where the floating registers (of the 68881) keep more
5878 precision than a @code{double} is supposed to have.  Similarly for the
5879 x86 architecture.  For most programs, the excess precision does only
5880 good, but a few programs rely on the precise definition of IEEE floating
5881 point.  Use @option{-ffloat-store} for such programs, after modifying
5882 them to store all pertinent intermediate computations into variables.
5883
5884 @item -ffast-math
5885 @opindex ffast-math
5886 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5887 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5888 @option{-fno-rounding-math}, @option{-fno-signaling-nans},
5889 @option{-fno-signed-zeros} and @option{fcx-limited-range}.
5890
5891 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5892
5893 This option should never be turned on by any @option{-O} option since
5894 it can result in incorrect output for programs which depend on
5895 an exact implementation of IEEE or ISO rules/specifications for
5896 math functions.
5897
5898 @item -fno-math-errno
5899 @opindex fno-math-errno
5900 Do not set ERRNO after calling math functions that are executed
5901 with a single instruction, e.g., sqrt.  A program that relies on
5902 IEEE exceptions for math error handling may want to use this flag
5903 for speed while maintaining IEEE arithmetic compatibility.
5904
5905 This option should never be turned on by any @option{-O} option since
5906 it can result in incorrect output for programs which depend on
5907 an exact implementation of IEEE or ISO rules/specifications for
5908 math functions.
5909
5910 The default is @option{-fmath-errno}.
5911
5912 On Darwin systems, the math library never sets @code{errno}.  There is
5913 therefore no reason for the compiler to consider the possibility that
5914 it might, and @option{-fno-math-errno} is the default.
5915
5916 @item -funsafe-math-optimizations
5917 @opindex funsafe-math-optimizations
5918 Allow optimizations for floating-point arithmetic that (a) assume
5919 that arguments and results are valid and (b) may violate IEEE or
5920 ANSI standards.  When used at link-time, it may include libraries
5921 or startup files that change the default FPU control word or other
5922 similar optimizations.
5923
5924 This option should never be turned on by any @option{-O} option since
5925 it can result in incorrect output for programs which depend on
5926 an exact implementation of IEEE or ISO rules/specifications for
5927 math functions.
5928
5929 The default is @option{-fno-unsafe-math-optimizations}.
5930
5931 @item -ffinite-math-only
5932 @opindex ffinite-math-only
5933 Allow optimizations for floating-point arithmetic that assume
5934 that arguments and results are not NaNs or +-Infs.
5935
5936 This option should never be turned on by any @option{-O} option since
5937 it can result in incorrect output for programs which depend on
5938 an exact implementation of IEEE or ISO rules/specifications.
5939
5940 The default is @option{-fno-finite-math-only}.
5941
5942 @item -fno-signed-zeros
5943 @opindex fno-signed-zeros
5944 Allow optimizations for floating point arithmetic that ignore the
5945 signedness of zero.  IEEE arithmetic specifies the behavior of
5946 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
5947 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
5948 This option implies that the sign of a zero result isn't significant.
5949
5950 The default is @option{-fsigned-zeros}.
5951
5952 @item -fno-trapping-math
5953 @opindex fno-trapping-math
5954 Compile code assuming that floating-point operations cannot generate
5955 user-visible traps.  These traps include division by zero, overflow,
5956 underflow, inexact result and invalid operation.  This option implies
5957 @option{-fno-signaling-nans}.  Setting this option may allow faster
5958 code if one relies on ``non-stop'' IEEE arithmetic, for example.
5959
5960 This option should never be turned on by any @option{-O} option since
5961 it can result in incorrect output for programs which depend on
5962 an exact implementation of IEEE or ISO rules/specifications for
5963 math functions.
5964
5965 The default is @option{-ftrapping-math}.
5966
5967 @item -frounding-math
5968 @opindex frounding-math
5969 Disable transformations and optimizations that assume default floating
5970 point rounding behavior.  This is round-to-zero for all floating point
5971 to integer conversions, and round-to-nearest for all other arithmetic
5972 truncations.  This option should be specified for programs that change
5973 the FP rounding mode dynamically, or that may be executed with a
5974 non-default rounding mode.  This option disables constant folding of
5975 floating point expressions at compile-time (which may be affected by
5976 rounding mode) and arithmetic transformations that are unsafe in the
5977 presence of sign-dependent rounding modes.
5978
5979 The default is @option{-fno-rounding-math}.
5980
5981 This option is experimental and does not currently guarantee to
5982 disable all GCC optimizations that are affected by rounding mode.
5983 Future versions of GCC may provide finer control of this setting
5984 using C99's @code{FENV_ACCESS} pragma.  This command line option
5985 will be used to specify the default state for @code{FENV_ACCESS}.
5986
5987 @item -frtl-abstract-sequences
5988 @opindex frtl-abstract-sequences
5989 It is a size optimization method. This option is to find identical
5990 sequences of code, which can be turned into pseudo-procedures  and
5991 then  replace  all  occurrences with  calls to  the  newly created
5992 subroutine. It is kind of an opposite of @option{-finline-functions}.
5993 This optimization runs at RTL level.
5994
5995 @item -fsignaling-nans
5996 @opindex fsignaling-nans
5997 Compile code assuming that IEEE signaling NaNs may generate user-visible
5998 traps during floating-point operations.  Setting this option disables
5999 optimizations that may change the number of exceptions visible with
6000 signaling NaNs.  This option implies @option{-ftrapping-math}.
6001
6002 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6003 be defined.
6004
6005 The default is @option{-fno-signaling-nans}.
6006
6007 This option is experimental and does not currently guarantee to
6008 disable all GCC optimizations that affect signaling NaN behavior.
6009
6010 @item -fsingle-precision-constant
6011 @opindex fsingle-precision-constant
6012 Treat floating point constant as single precision constant instead of
6013 implicitly converting it to double precision constant.
6014
6015 @item -fcx-limited-range
6016 @itemx -fno-cx-limited-range
6017 @opindex fcx-limited-range
6018 @opindex fno-cx-limited-range
6019 When enabled, this option states that a range reduction step is not
6020 needed when performing complex division.  The default is
6021 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
6022
6023 This option controls the default setting of the ISO C99 
6024 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6025 all languages.
6026
6027 @end table
6028
6029 The following options control optimizations that may improve
6030 performance, but are not enabled by any @option{-O} options.  This
6031 section includes experimental options that may produce broken code.
6032
6033 @table @gcctabopt
6034 @item -fbranch-probabilities
6035 @opindex fbranch-probabilities
6036 After running a program compiled with @option{-fprofile-arcs}
6037 (@pxref{Debugging Options,, Options for Debugging Your Program or
6038 @command{gcc}}), you can compile it a second time using
6039 @option{-fbranch-probabilities}, to improve optimizations based on
6040 the number of times each branch was taken.  When the program
6041 compiled with @option{-fprofile-arcs} exits it saves arc execution
6042 counts to a file called @file{@var{sourcename}.gcda} for each source
6043 file.  The information in this data file is very dependent on the
6044 structure of the generated code, so you must use the same source code
6045 and the same optimization options for both compilations.
6046
6047 With @option{-fbranch-probabilities}, GCC puts a
6048 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6049 These can be used to improve optimization.  Currently, they are only
6050 used in one place: in @file{reorg.c}, instead of guessing which path a
6051 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6052 exactly determine which path is taken more often.
6053
6054 @item -fprofile-values
6055 @opindex fprofile-values
6056 If combined with @option{-fprofile-arcs}, it adds code so that some
6057 data about values of expressions in the program is gathered.
6058
6059 With @option{-fbranch-probabilities}, it reads back the data gathered
6060 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6061 notes to instructions for their later usage in optimizations.
6062
6063 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6064
6065 @item -fvpt
6066 @opindex fvpt
6067 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6068 a code to gather information about values of expressions.
6069
6070 With @option{-fbranch-probabilities}, it reads back the data gathered
6071 and actually performs the optimizations based on them.
6072 Currently the optimizations include specialization of division operation
6073 using the knowledge about the value of the denominator.
6074
6075 @item -frename-registers
6076 @opindex frename-registers
6077 Attempt to avoid false dependencies in scheduled code by making use
6078 of registers left over after register allocation.  This optimization
6079 will most benefit processors with lots of registers.  Depending on the
6080 debug information format adopted by the target, however, it can
6081 make debugging impossible, since variables will no longer stay in
6082 a ``home register''.
6083
6084 Enabled by default with @option{-funroll-loops}.
6085
6086 @item -ftracer
6087 @opindex ftracer
6088 Perform tail duplication to enlarge superblock size.  This transformation
6089 simplifies the control flow of the function allowing other optimizations to do
6090 better job.
6091
6092 Enabled with @option{-fprofile-use}.
6093
6094 @item -funroll-loops
6095 @opindex funroll-loops
6096 Unroll loops whose number of iterations can be determined at compile time or
6097 upon entry to the loop.  @option{-funroll-loops} implies
6098 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}. 
6099 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6100 small constant number of iterations).  This option makes code larger, and may
6101 or may not make it run faster.
6102
6103 Enabled with @option{-fprofile-use}.
6104
6105 @item -funroll-all-loops
6106 @opindex funroll-all-loops
6107 Unroll all loops, even if their number of iterations is uncertain when
6108 the loop is entered.  This usually makes programs run more slowly.
6109 @option{-funroll-all-loops} implies the same options as
6110 @option{-funroll-loops}.
6111
6112 @item -fpeel-loops
6113 @opindex fpeel-loops
6114 Peels the loops for that there is enough information that they do not
6115 roll much (from profile feedback).  It also turns on complete loop peeling
6116 (i.e.@: complete removal of loops with small constant number of iterations).
6117
6118 Enabled with @option{-fprofile-use}.
6119
6120 @item -fmove-loop-invariants
6121 @opindex fmove-loop-invariants
6122 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6123 at level @option{-O1}
6124
6125 @item -funswitch-loops
6126 @opindex funswitch-loops
6127 Move branches with loop invariant conditions out of the loop, with duplicates
6128 of the loop on both branches (modified according to result of the condition).
6129
6130 @item -ffunction-sections
6131 @itemx -fdata-sections
6132 @opindex ffunction-sections
6133 @opindex fdata-sections
6134 Place each function or data item into its own section in the output
6135 file if the target supports arbitrary sections.  The name of the
6136 function or the name of the data item determines the section's name
6137 in the output file.
6138
6139 Use these options on systems where the linker can perform optimizations
6140 to improve locality of reference in the instruction space.  Most systems
6141 using the ELF object format and SPARC processors running Solaris 2 have
6142 linkers with such optimizations.  AIX may have these optimizations in
6143 the future.
6144
6145 Only use these options when there are significant benefits from doing
6146 so.  When you specify these options, the assembler and linker will
6147 create larger object and executable files and will also be slower.
6148 You will not be able to use @code{gprof} on all systems if you
6149 specify this option and you may have problems with debugging if
6150 you specify both this option and @option{-g}.
6151
6152 @item -fbranch-target-load-optimize
6153 @opindex fbranch-target-load-optimize
6154 Perform branch target register load optimization before prologue / epilogue
6155 threading.
6156 The use of target registers can typically be exposed only during reload,
6157 thus hoisting loads out of loops and doing inter-block scheduling needs
6158 a separate optimization pass.
6159
6160 @item -fbranch-target-load-optimize2
6161 @opindex fbranch-target-load-optimize2
6162 Perform branch target register load optimization after prologue / epilogue
6163 threading.
6164
6165 @item -fbtr-bb-exclusive
6166 @opindex fbtr-bb-exclusive
6167 When performing branch target register load optimization, don't reuse
6168 branch target registers in within any basic block.
6169
6170 @item -fstack-protector
6171 Emit extra code to check for buffer overflows, such as stack smashing
6172 attacks.  This is done by adding a guard variable to functions with
6173 vulnerable objects.  This includes functions that call alloca, and
6174 functions with buffers larger than 8 bytes.  The guards are initialized
6175 when a function is entered and then checked when the function exits.
6176 If a guard check fails, an error message is printed and the program exits.
6177
6178 @item -fstack-protector-all
6179 Like @option{-fstack-protector} except that all functions are protected.
6180
6181 @item -fsection-anchors
6182 @opindex fsection-anchors
6183 Try to reduce the number of symbolic address calculations by using
6184 shared ``anchor'' symbols to address nearby objects.  This transformation
6185 can help to reduce the number of GOT entries and GOT accesses on some
6186 targets.
6187
6188 For example, the implementation of the following function @code{foo}:
6189
6190 @smallexample
6191 static int a, b, c;
6192 int foo (void) @{ return a + b + c; @}
6193 @end smallexample
6194
6195 would usually calculate the addresses of all three variables, but if you
6196 compile it with @option{-fsection-anchors}, it will access the variables
6197 from a common anchor point instead.  The effect is similar to the
6198 following pseudocode (which isn't valid C):
6199
6200 @smallexample
6201 int foo (void)
6202 @{
6203   register int *xr = &x;
6204   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6205 @}
6206 @end smallexample
6207
6208 Not all targets support this option.
6209
6210 @item --param @var{name}=@var{value}
6211 @opindex param
6212 In some places, GCC uses various constants to control the amount of
6213 optimization that is done.  For example, GCC will not inline functions
6214 that contain more that a certain number of instructions.  You can
6215 control some of these constants on the command-line using the
6216 @option{--param} option.
6217
6218 The names of specific parameters, and the meaning of the values, are
6219 tied to the internals of the compiler, and are subject to change
6220 without notice in future releases.
6221
6222 In each case, the @var{value} is an integer.  The allowable choices for
6223 @var{name} are given in the following table:
6224
6225 @table @gcctabopt
6226 @item salias-max-implicit-fields
6227 The maximum number of fields in a variable without direct
6228 structure accesses for which structure aliasing will consider trying 
6229 to track each field.  The default is 5
6230
6231 @item salias-max-array-elements
6232 The maximum number of elements an array can have and its elements
6233 still be tracked individually by structure aliasing. The default is 4
6234
6235 @item sra-max-structure-size
6236 The maximum structure size, in bytes, at which the scalar replacement
6237 of aggregates (SRA) optimization will perform block copies.  The
6238 default value, 0, implies that GCC will select the most appropriate
6239 size itself.
6240
6241 @item sra-field-structure-ratio
6242 The threshold ratio (as a percentage) between instantiated fields and
6243 the complete structure size.  We say that if the ratio of the number
6244 of bytes in instantiated fields to the number of bytes in the complete
6245 structure exceeds this parameter, then block copies are not used.  The
6246 default is 75.
6247
6248 @item max-crossjump-edges
6249 The maximum number of incoming edges to consider for crossjumping.
6250 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6251 the number of edges incoming to each block.  Increasing values mean
6252 more aggressive optimization, making the compile time increase with
6253 probably small improvement in executable size.
6254
6255 @item min-crossjump-insns
6256 The minimum number of instructions which must be matched at the end
6257 of two blocks before crossjumping will be performed on them.  This
6258 value is ignored in the case where all instructions in the block being
6259 crossjumped from are matched.  The default value is 5.
6260
6261 @item max-grow-copy-bb-insns
6262 The maximum code size expansion factor when copying basic blocks
6263 instead of jumping.  The expansion is relative to a jump instruction.
6264 The default value is 8.
6265
6266 @item max-goto-duplication-insns
6267 The maximum number of instructions to duplicate to a block that jumps
6268 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6269 passes, GCC factors computed gotos early in the compilation process,
6270 and unfactors them as late as possible.  Only computed jumps at the
6271 end of a basic blocks with no more than max-goto-duplication-insns are
6272 unfactored.  The default value is 8.
6273
6274 @item max-delay-slot-insn-search
6275 The maximum number of instructions to consider when looking for an
6276 instruction to fill a delay slot.  If more than this arbitrary number of
6277 instructions is searched, the time savings from filling the delay slot
6278 will be minimal so stop searching.  Increasing values mean more
6279 aggressive optimization, making the compile time increase with probably
6280 small improvement in executable run time.
6281
6282 @item max-delay-slot-live-search
6283 When trying to fill delay slots, the maximum number of instructions to
6284 consider when searching for a block with valid live register
6285 information.  Increasing this arbitrarily chosen value means more
6286 aggressive optimization, increasing the compile time.  This parameter
6287 should be removed when the delay slot code is rewritten to maintain the
6288 control-flow graph.
6289
6290 @item max-gcse-memory
6291 The approximate maximum amount of memory that will be allocated in
6292 order to perform the global common subexpression elimination
6293 optimization.  If more memory than specified is required, the
6294 optimization will not be done.
6295
6296 @item max-gcse-passes
6297 The maximum number of passes of GCSE to run.  The default is 1.
6298
6299 @item max-pending-list-length
6300 The maximum number of pending dependencies scheduling will allow
6301 before flushing the current state and starting over.  Large functions
6302 with few branches or calls can create excessively large lists which
6303 needlessly consume memory and resources.
6304
6305 @item max-inline-insns-single
6306 Several parameters control the tree inliner used in gcc.
6307 This number sets the maximum number of instructions (counted in GCC's
6308 internal representation) in a single function that the tree inliner
6309 will consider for inlining.  This only affects functions declared
6310 inline and methods implemented in a class declaration (C++).
6311 The default value is 450.
6312
6313 @item max-inline-insns-auto
6314 When you use @option{-finline-functions} (included in @option{-O3}),
6315 a lot of functions that would otherwise not be considered for inlining
6316 by the compiler will be investigated.  To those functions, a different
6317 (more restrictive) limit compared to functions declared inline can
6318 be applied.
6319 The default value is 90.
6320
6321 @item large-function-insns
6322 The limit specifying really large functions.  For functions larger than this
6323 limit after inlining inlining is constrained by
6324 @option{--param large-function-growth}.  This parameter is useful primarily
6325 to avoid extreme compilation time caused by non-linear algorithms used by the
6326 backend.
6327 This parameter is ignored when @option{-funit-at-a-time} is not used.
6328 The default value is 2700.
6329
6330 @item large-function-growth
6331 Specifies maximal growth of large function caused by inlining in percents.
6332 This parameter is ignored when @option{-funit-at-a-time} is not used.
6333 The default value is 100 which limits large function growth to 2.0 times
6334 the original size.
6335
6336 @item large-unit-insns
6337 The limit specifying large translation unit.  Growth caused by inlining of
6338 units larger than this limit is limited by @option{--param inline-unit-growth}.
6339 For small units this might be too tight (consider unit consisting of function A
6340 that is inline and B that just calls A three time.  If B is small relative to
6341 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6342 large units consisting of small inlininable functions however the overall unit
6343 growth limit is needed to avoid exponential explosion of code size.  Thus for
6344 smaller units, the size is increased to @option{--param large-unit-insns}
6345 before applying @option{--param inline-unit-growth}.  The default is 10000
6346
6347 @item inline-unit-growth
6348 Specifies maximal overall growth of the compilation unit caused by inlining.
6349 This parameter is ignored when @option{-funit-at-a-time} is not used.
6350 The default value is 30 which limits unit growth to 1.3 times the original
6351 size.
6352
6353 @item large-stack-frame
6354 The limit specifying large stack frames.  While inlining the algorithm is trying
6355 to not grow past this limit too much.  Default value is 256 bytes.
6356
6357 @item large-stack-frame-growth
6358 Specifies maximal growth of large stack frames caused by inlining in percents.
6359 The default value is 1000 which limits large stack frame growth to 11 times
6360 the original size.
6361
6362 @item max-inline-insns-recursive
6363 @itemx max-inline-insns-recursive-auto
6364 Specifies maximum number of instructions out-of-line copy of self recursive inline
6365 function can grow into by performing recursive inlining.
6366
6367 For functions declared inline @option{--param max-inline-insns-recursive} is
6368 taken into account.  For function not declared inline, recursive inlining
6369 happens only when @option{-finline-functions} (included in @option{-O3}) is
6370 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6371 default value is 450.
6372
6373 @item max-inline-recursive-depth
6374 @itemx max-inline-recursive-depth-auto
6375 Specifies maximum recursion depth used by the recursive inlining.
6376
6377 For functions declared inline @option{--param max-inline-recursive-depth} is
6378 taken into account.  For function not declared inline, recursive inlining
6379 happens only when @option{-finline-functions} (included in @option{-O3}) is
6380 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6381 default value is 450.
6382
6383 @item min-inline-recursive-probability
6384 Recursive inlining is profitable only for function having deep recursion
6385 in average and can hurt for function having little recursion depth by
6386 increasing the prologue size or complexity of function body to other
6387 optimizers.
6388
6389 When profile feedback is available (see @option{-fprofile-generate}) the actual
6390 recursion depth can be guessed from probability that function will recurse via
6391 given call expression.  This parameter limits inlining only to call expression
6392 whose probability exceeds given threshold (in percents).  The default value is
6393 10.
6394
6395 @item inline-call-cost
6396 Specify cost of call instruction relative to simple arithmetics operations
6397 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6398 functions and at the same time increases size of leaf function that is believed to
6399 reduce function size by being inlined.  In effect it increases amount of
6400 inlining for code having large abstraction penalty (many functions that just
6401 pass the arguments to other functions) and decrease inlining for code with low
6402 abstraction penalty.  The default value is 16.
6403
6404 @item min-vect-loop-bound
6405 The minimum number of iterations under which a loop will not get vectorized 
6406 when @option{-ftree-vectorize} is used.  The number of iterations after 
6407 vectorization needs to be greater than the value specified by this option
6408 to allow vectorization.  The default value is 0.
6409
6410 @item max-unrolled-insns
6411 The maximum number of instructions that a loop should have if that loop
6412 is unrolled, and if the loop is unrolled, it determines how many times
6413 the loop code is unrolled.
6414
6415 @item max-average-unrolled-insns
6416 The maximum number of instructions biased by probabilities of their execution
6417 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6418 it determines how many times the loop code is unrolled.
6419
6420 @item max-unroll-times
6421 The maximum number of unrollings of a single loop.
6422
6423 @item max-peeled-insns
6424 The maximum number of instructions that a loop should have if that loop
6425 is peeled, and if the loop is peeled, it determines how many times
6426 the loop code is peeled.
6427
6428 @item max-peel-times
6429 The maximum number of peelings of a single loop.
6430
6431 @item max-completely-peeled-insns
6432 The maximum number of insns of a completely peeled loop.
6433
6434 @item max-completely-peel-times
6435 The maximum number of iterations of a loop to be suitable for complete peeling.
6436
6437 @item max-unswitch-insns
6438 The maximum number of insns of an unswitched loop.
6439
6440 @item max-unswitch-level
6441 The maximum number of branches unswitched in a single loop.
6442
6443 @item lim-expensive
6444 The minimum cost of an expensive expression in the loop invariant motion.
6445
6446 @item iv-consider-all-candidates-bound
6447 Bound on number of candidates for induction variables below that
6448 all candidates are considered for each use in induction variable
6449 optimizations.  Only the most relevant candidates are considered
6450 if there are more candidates, to avoid quadratic time complexity.
6451
6452 @item iv-max-considered-uses
6453 The induction variable optimizations give up on loops that contain more
6454 induction variable uses.
6455
6456 @item iv-always-prune-cand-set-bound
6457 If number of candidates in the set is smaller than this value,
6458 we always try to remove unnecessary ivs from the set during its
6459 optimization when a new iv is added to the set.
6460
6461 @item scev-max-expr-size
6462 Bound on size of expressions used in the scalar evolutions analyzer.
6463 Large expressions slow the analyzer.
6464
6465 @item omega-max-vars
6466 The maximum number of variables in an Omega constraint system.
6467 The default value is 128.
6468
6469 @item omega-max-geqs
6470 The maximum number of inequalities in an Omega constraint system.
6471 The default value is 256.
6472
6473 @item omega-max-eqs
6474 The maximum number of equalities in an Omega constraint system.
6475 The default value is 128.
6476
6477 @item omega-max-wild-cards
6478 The maximum number of wildcard variables that the Omega solver will
6479 be able to insert.  The default value is 18.
6480
6481 @item omega-hash-table-size
6482 The size of the hash table in the Omega solver.  The default value is
6483 550.
6484
6485 @item omega-max-keys
6486 The maximal number of keys used by the Omega solver.  The default
6487 value is 500.
6488
6489 @item omega-eliminate-redundant-constraints
6490 When set to 1, use expensive methods to eliminate all redundant
6491 constraints.  The default value is 0.
6492
6493 @item vect-max-version-checks
6494 The maximum number of runtime checks that can be performed when doing
6495 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6496 for more information.
6497
6498 @item max-iterations-to-track
6499
6500 The maximum number of iterations of a loop the brute force algorithm
6501 for analysis of # of iterations of the loop tries to evaluate.
6502
6503 @item hot-bb-count-fraction
6504 Select fraction of the maximal count of repetitions of basic block in program
6505 given basic block needs to have to be considered hot.
6506
6507 @item hot-bb-frequency-fraction
6508 Select fraction of the maximal frequency of executions of basic block in
6509 function given basic block needs to have to be considered hot
6510
6511 @item max-predicted-iterations
6512 The maximum number of loop iterations we predict statically.  This is useful
6513 in cases where function contain single loop with known bound and other loop
6514 with unknown.  We predict the known number of iterations correctly, while
6515 the unknown number of iterations average to roughly 10.  This means that the
6516 loop without bounds would appear artificially cold relative to the other one.
6517
6518 @item tracer-dynamic-coverage
6519 @itemx tracer-dynamic-coverage-feedback
6520
6521 This value is used to limit superblock formation once the given percentage of
6522 executed instructions is covered.  This limits unnecessary code size
6523 expansion.
6524
6525 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6526 feedback is available.  The real profiles (as opposed to statically estimated
6527 ones) are much less balanced allowing the threshold to be larger value.
6528
6529 @item tracer-max-code-growth
6530 Stop tail duplication once code growth has reached given percentage.  This is
6531 rather hokey argument, as most of the duplicates will be eliminated later in
6532 cross jumping, so it may be set to much higher values than is the desired code
6533 growth.
6534
6535 @item tracer-min-branch-ratio
6536
6537 Stop reverse growth when the reverse probability of best edge is less than this
6538 threshold (in percent).
6539
6540 @item tracer-min-branch-ratio
6541 @itemx tracer-min-branch-ratio-feedback
6542
6543 Stop forward growth if the best edge do have probability lower than this
6544 threshold.
6545
6546 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6547 compilation for profile feedback and one for compilation without.  The value
6548 for compilation with profile feedback needs to be more conservative (higher) in
6549 order to make tracer effective.
6550
6551 @item max-cse-path-length
6552
6553 Maximum number of basic blocks on path that cse considers.  The default is 10.
6554
6555 @item max-cse-insns
6556 The maximum instructions CSE process before flushing. The default is 1000.
6557
6558 @item max-aliased-vops
6559
6560 Maximum number of virtual operands per statement allowed to represent
6561 aliases before triggering the alias grouping heuristic.  Alias
6562 grouping reduces compile times and memory consumption needed for
6563 aliasing at the expense of precision loss in alias information.
6564
6565 @item ggc-min-expand
6566
6567 GCC uses a garbage collector to manage its own memory allocation.  This
6568 parameter specifies the minimum percentage by which the garbage
6569 collector's heap should be allowed to expand between collections.
6570 Tuning this may improve compilation speed; it has no effect on code
6571 generation.
6572
6573 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6574 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6575 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6576 GCC is not able to calculate RAM on a particular platform, the lower
6577 bound of 30% is used.  Setting this parameter and
6578 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6579 every opportunity.  This is extremely slow, but can be useful for
6580 debugging.
6581
6582 @item ggc-min-heapsize
6583
6584 Minimum size of the garbage collector's heap before it begins bothering
6585 to collect garbage.  The first collection occurs after the heap expands
6586 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6587 tuning this may improve compilation speed, and has no effect on code
6588 generation.
6589
6590 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6591 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6592 with a lower bound of 4096 (four megabytes) and an upper bound of
6593 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6594 particular platform, the lower bound is used.  Setting this parameter
6595 very large effectively disables garbage collection.  Setting this
6596 parameter and @option{ggc-min-expand} to zero causes a full collection
6597 to occur at every opportunity.
6598
6599 @item max-reload-search-insns
6600 The maximum number of instruction reload should look backward for equivalent
6601 register.  Increasing values mean more aggressive optimization, making the
6602 compile time increase with probably slightly better performance.  The default
6603 value is 100.
6604
6605 @item max-cselib-memory-locations
6606 The maximum number of memory locations cselib should take into account.
6607 Increasing values mean more aggressive optimization, making the compile time
6608 increase with probably slightly better performance.  The default value is 500.
6609
6610 @item max-flow-memory-locations
6611 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6612 The default value is 100.
6613
6614 @item reorder-blocks-duplicate
6615 @itemx reorder-blocks-duplicate-feedback
6616
6617 Used by basic block reordering pass to decide whether to use unconditional
6618 branch or duplicate the code on its destination.  Code is duplicated when its
6619 estimated size is smaller than this value multiplied by the estimated size of
6620 unconditional jump in the hot spots of the program.
6621
6622 The @option{reorder-block-duplicate-feedback} is used only when profile
6623 feedback is available and may be set to higher values than
6624 @option{reorder-block-duplicate} since information about the hot spots is more
6625 accurate.
6626
6627 @item max-sched-ready-insns
6628 The maximum number of instructions ready to be issued the scheduler should
6629 consider at any given time during the first scheduling pass.  Increasing
6630 values mean more thorough searches, making the compilation time increase
6631 with probably little benefit.  The default value is 100.
6632
6633 @item max-sched-region-blocks
6634 The maximum number of blocks in a region to be considered for
6635 interblock scheduling.  The default value is 10.
6636
6637 @item max-sched-region-insns
6638 The maximum number of insns in a region to be considered for
6639 interblock scheduling.  The default value is 100.
6640
6641 @item min-spec-prob
6642 The minimum probability (in percents) of reaching a source block
6643 for interblock speculative scheduling.  The default value is 40.
6644
6645 @item max-sched-extend-regions-iters
6646 The maximum number of iterations through CFG to extend regions.
6647 0 - disable region extension,
6648 N - do at most N iterations.
6649 The default value is 0.
6650
6651 @item max-sched-insn-conflict-delay
6652 The maximum conflict delay for an insn to be considered for speculative motion.
6653 The default value is 3.
6654
6655 @item sched-spec-prob-cutoff
6656 The minimal probability of speculation success (in percents), so that
6657 speculative insn will be scheduled.
6658 The default value is 40.
6659
6660 @item max-last-value-rtl
6661
6662 The maximum size measured as number of RTLs that can be recorded in an expression
6663 in combiner for a pseudo register as last known value of that register.  The default
6664 is 10000.
6665
6666 @item integer-share-limit
6667 Small integer constants can use a shared data structure, reducing the
6668 compiler's memory usage and increasing its speed.  This sets the maximum
6669 value of a shared integer constant's.  The default value is 256.
6670
6671 @item min-virtual-mappings
6672 Specifies the minimum number of virtual mappings in the incremental
6673 SSA updater that should be registered to trigger the virtual mappings
6674 heuristic defined by virtual-mappings-ratio.  The default value is
6675 100.
6676
6677 @item virtual-mappings-ratio
6678 If the number of virtual mappings is virtual-mappings-ratio bigger
6679 than the number of virtual symbols to be updated, then the incremental
6680 SSA updater switches to a full update for those symbols.  The default
6681 ratio is 3.
6682
6683 @item ssp-buffer-size
6684 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6685 protection when @option{-fstack-protection} is used.
6686
6687 @item max-jump-thread-duplication-stmts
6688 Maximum number of statements allowed in a block that needs to be
6689 duplicated when threading jumps.
6690
6691 @item max-fields-for-field-sensitive
6692 Maximum number of fields in a structure we will treat in
6693 a field sensitive manner during pointer analysis.
6694
6695 @item prefetch-latency
6696 Estimate on average number of instructions that are executed before
6697 prefetch finishes.  The distance we prefetch ahead is proportional
6698 to this constant.  Increasing this number may also lead to less
6699 streams being prefetched (see @option{simultaneous-prefetches}).
6700
6701 @item simultaneous-prefetches
6702 Maximum number of prefetches that can run at the same time.
6703
6704 @item l1-cache-line-size
6705 The size of cache line in L1 cache, in bytes.
6706
6707 @item l1-cache-size
6708 The number of cache lines in L1 cache.
6709
6710 @item verify-canonical-types
6711 Whether the compiler should verify the ``canonical'' types used for
6712 type equality comparisons within the C++ and Objective-C++ front
6713 ends. Set to 1 (the default when GCC is configured with
6714 --enable-checking) to enable verification, 0 to disable verification
6715 (the default when GCC is configured with --disable-checking).
6716
6717 @end table
6718 @end table
6719
6720 @node Preprocessor Options
6721 @section Options Controlling the Preprocessor
6722 @cindex preprocessor options
6723 @cindex options, preprocessor
6724
6725 These options control the C preprocessor, which is run on each C source
6726 file before actual compilation.
6727
6728 If you use the @option{-E} option, nothing is done except preprocessing.
6729 Some of these options make sense only together with @option{-E} because
6730 they cause the preprocessor output to be unsuitable for actual
6731 compilation.
6732
6733 @table @gcctabopt
6734 @opindex Wp
6735 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6736 and pass @var{option} directly through to the preprocessor.  If
6737 @var{option} contains commas, it is split into multiple options at the
6738 commas.  However, many options are modified, translated or interpreted
6739 by the compiler driver before being passed to the preprocessor, and
6740 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6741 interface is undocumented and subject to change, so whenever possible
6742 you should avoid using @option{-Wp} and let the driver handle the
6743 options instead.
6744
6745 @item -Xpreprocessor @var{option}
6746 @opindex preprocessor
6747 Pass @var{option} as an option to the preprocessor.  You can use this to
6748 supply system-specific preprocessor options which GCC does not know how to
6749 recognize.
6750
6751 If you want to pass an option that takes an argument, you must use
6752 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6753 @end table
6754
6755 @include cppopts.texi
6756
6757 @node Assembler Options
6758 @section Passing Options to the Assembler
6759
6760 @c prevent bad page break with this line
6761 You can pass options to the assembler.
6762
6763 @table @gcctabopt
6764 @item -Wa,@var{option}
6765 @opindex Wa
6766 Pass @var{option} as an option to the assembler.  If @var{option}
6767 contains commas, it is split into multiple options at the commas.
6768
6769 @item -Xassembler @var{option}
6770 @opindex Xassembler
6771 Pass @var{option} as an option to the assembler.  You can use this to
6772 supply system-specific assembler options which GCC does not know how to
6773 recognize.
6774
6775 If you want to pass an option that takes an argument, you must use
6776 @option{-Xassembler} twice, once for the option and once for the argument.
6777
6778 @end table
6779
6780 @node Link Options
6781 @section Options for Linking
6782 @cindex link options
6783 @cindex options, linking
6784
6785 These options come into play when the compiler links object files into
6786 an executable output file.  They are meaningless if the compiler is
6787 not doing a link step.
6788
6789 @table @gcctabopt
6790 @cindex file names
6791 @item @var{object-file-name}
6792 A file name that does not end in a special recognized suffix is
6793 considered to name an object file or library.  (Object files are
6794 distinguished from libraries by the linker according to the file
6795 contents.)  If linking is done, these object files are used as input
6796 to the linker.
6797
6798 @item -c
6799 @itemx -S
6800 @itemx -E
6801 @opindex c
6802 @opindex S
6803 @opindex E
6804 If any of these options is used, then the linker is not run, and
6805 object file names should not be used as arguments.  @xref{Overall
6806 Options}.
6807
6808 @cindex Libraries
6809 @item -l@var{library}
6810 @itemx -l @var{library}
6811 @opindex l
6812 Search the library named @var{library} when linking.  (The second
6813 alternative with the library as a separate argument is only for
6814 POSIX compliance and is not recommended.)
6815
6816 It makes a difference where in the command you write this option; the
6817 linker searches and processes libraries and object files in the order they
6818 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6819 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6820 to functions in @samp{z}, those functions may not be loaded.
6821
6822 The linker searches a standard list of directories for the library,
6823 which is actually a file named @file{lib@var{library}.a}.  The linker
6824 then uses this file as if it had been specified precisely by name.
6825
6826 The directories searched include several standard system directories
6827 plus any that you specify with @option{-L}.
6828
6829 Normally the files found this way are library files---archive files
6830 whose members are object files.  The linker handles an archive file by
6831 scanning through it for members which define symbols that have so far
6832 been referenced but not defined.  But if the file that is found is an
6833 ordinary object file, it is linked in the usual fashion.  The only
6834 difference between using an @option{-l} option and specifying a file name
6835 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6836 and searches several directories.
6837
6838 @item -lobjc
6839 @opindex lobjc
6840 You need this special case of the @option{-l} option in order to
6841 link an Objective-C or Objective-C++ program.
6842
6843 @item -nostartfiles
6844 @opindex nostartfiles
6845 Do not use the standard system startup files when linking.
6846 The standard system libraries are used normally, unless @option{-nostdlib}
6847 or @option{-nodefaultlibs} is used.
6848
6849 @item -nodefaultlibs
6850 @opindex nodefaultlibs
6851 Do not use the standard system libraries when linking.
6852 Only the libraries you specify will be passed to the linker.
6853 The standard startup files are used normally, unless @option{-nostartfiles}
6854 is used.  The compiler may generate calls to @code{memcmp},
6855 @code{memset}, @code{memcpy} and @code{memmove}.
6856 These entries are usually resolved by entries in
6857 libc.  These entry points should be supplied through some other
6858 mechanism when this option is specified.
6859
6860 @item -nostdlib
6861 @opindex nostdlib
6862 Do not use the standard system startup files or libraries when linking.
6863 No startup files and only the libraries you specify will be passed to
6864 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6865 @code{memcpy} and @code{memmove}.
6866 These entries are usually resolved by entries in
6867 libc.  These entry points should be supplied through some other
6868 mechanism when this option is specified.
6869
6870 @cindex @option{-lgcc}, use with @option{-nostdlib}
6871 @cindex @option{-nostdlib} and unresolved references
6872 @cindex unresolved references and @option{-nostdlib}
6873 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6874 @cindex @option{-nodefaultlibs} and unresolved references
6875 @cindex unresolved references and @option{-nodefaultlibs}
6876 One of the standard libraries bypassed by @option{-nostdlib} and
6877 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6878 that GCC uses to overcome shortcomings of particular machines, or special
6879 needs for some languages.
6880 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6881 Collection (GCC) Internals},
6882 for more discussion of @file{libgcc.a}.)
6883 In most cases, you need @file{libgcc.a} even when you want to avoid
6884 other standard libraries.  In other words, when you specify @option{-nostdlib}
6885 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6886 This ensures that you have no unresolved references to internal GCC
6887 library subroutines.  (For example, @samp{__main}, used to ensure C++
6888 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6889 GNU Compiler Collection (GCC) Internals}.)
6890
6891 @item -pie
6892 @opindex pie
6893 Produce a position independent executable on targets which support it.
6894 For predictable results, you must also specify the same set of options
6895 that were used to generate code (@option{-fpie}, @option{-fPIE},
6896 or model suboptions) when you specify this option.
6897
6898 @item -rdynamic
6899 @opindex rdynamic
6900 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6901 that support it. This instructs the linker to add all symbols, not
6902 only used ones, to the dynamic symbol table. This option is needed
6903 for some uses of @code{dlopen} or to allow obtaining backtraces
6904 from within a program.
6905
6906 @item -s
6907 @opindex s
6908 Remove all symbol table and relocation information from the executable.
6909
6910 @item -static
6911 @opindex static
6912 On systems that support dynamic linking, this prevents linking with the shared
6913 libraries.  On other systems, this option has no effect.
6914
6915 @item -shared
6916 @opindex shared
6917 Produce a shared object which can then be linked with other objects to
6918 form an executable.  Not all systems support this option.  For predictable
6919 results, you must also specify the same set of options that were used to
6920 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6921 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6922 needs to build supplementary stub code for constructors to work.  On
6923 multi-libbed systems, @samp{gcc -shared} must select the correct support
6924 libraries to link against.  Failing to supply the correct flags may lead
6925 to subtle defects.  Supplying them in cases where they are not necessary
6926 is innocuous.}
6927
6928 @item -shared-libgcc
6929 @itemx -static-libgcc
6930 @opindex shared-libgcc
6931 @opindex static-libgcc
6932 On systems that provide @file{libgcc} as a shared library, these options
6933 force the use of either the shared or static version respectively.
6934 If no shared version of @file{libgcc} was built when the compiler was
6935 configured, these options have no effect.
6936
6937 There are several situations in which an application should use the
6938 shared @file{libgcc} instead of the static version.  The most common
6939 of these is when the application wishes to throw and catch exceptions
6940 across different shared libraries.  In that case, each of the libraries
6941 as well as the application itself should use the shared @file{libgcc}.
6942
6943 Therefore, the G++ and GCJ drivers automatically add
6944 @option{-shared-libgcc} whenever you build a shared library or a main
6945 executable, because C++ and Java programs typically use exceptions, so
6946 this is the right thing to do.
6947
6948 If, instead, you use the GCC driver to create shared libraries, you may
6949 find that they will not always be linked with the shared @file{libgcc}.
6950 If GCC finds, at its configuration time, that you have a non-GNU linker
6951 or a GNU linker that does not support option @option{--eh-frame-hdr},
6952 it will link the shared version of @file{libgcc} into shared libraries
6953 by default.  Otherwise, it will take advantage of the linker and optimize
6954 away the linking with the shared version of @file{libgcc}, linking with
6955 the static version of libgcc by default.  This allows exceptions to
6956 propagate through such shared libraries, without incurring relocation
6957 costs at library load time.
6958
6959 However, if a library or main executable is supposed to throw or catch
6960 exceptions, you must link it using the G++ or GCJ driver, as appropriate
6961 for the languages used in the program, or using the option
6962 @option{-shared-libgcc}, such that it is linked with the shared
6963 @file{libgcc}.
6964
6965 @item -symbolic
6966 @opindex symbolic
6967 Bind references to global symbols when building a shared object.  Warn
6968 about any unresolved references (unless overridden by the link editor
6969 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
6970 this option.
6971
6972 @item -Xlinker @var{option}
6973 @opindex Xlinker
6974 Pass @var{option} as an option to the linker.  You can use this to
6975 supply system-specific linker options which GCC does not know how to
6976 recognize.
6977
6978 If you want to pass an option that takes an argument, you must use
6979 @option{-Xlinker} twice, once for the option and once for the argument.
6980 For example, to pass @option{-assert definitions}, you must write
6981 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
6982 @option{-Xlinker "-assert definitions"}, because this passes the entire
6983 string as a single argument, which is not what the linker expects.
6984
6985 @item -Wl,@var{option}
6986 @opindex Wl
6987 Pass @var{option} as an option to the linker.  If @var{option} contains
6988 commas, it is split into multiple options at the commas.
6989
6990 @item -u @var{symbol}
6991 @opindex u
6992 Pretend the symbol @var{symbol} is undefined, to force linking of
6993 library modules to define it.  You can use @option{-u} multiple times with
6994 different symbols to force loading of additional library modules.
6995 @end table
6996
6997 @node Directory Options
6998 @section Options for Directory Search
6999 @cindex directory options
7000 @cindex options, directory search
7001 @cindex search path
7002
7003 These options specify directories to search for header files, for
7004 libraries and for parts of the compiler:
7005
7006 @table @gcctabopt
7007 @item -I@var{dir}
7008 @opindex I
7009 Add the directory @var{dir} to the head of the list of directories to be
7010 searched for header files.  This can be used to override a system header
7011 file, substituting your own version, since these directories are
7012 searched before the system header file directories.  However, you should
7013 not use this option to add directories that contain vendor-supplied
7014 system header files (use @option{-isystem} for that).  If you use more than
7015 one @option{-I} option, the directories are scanned in left-to-right
7016 order; the standard system directories come after.
7017
7018 If a standard system include directory, or a directory specified with
7019 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7020 option will be ignored.  The directory will still be searched but as a
7021 system directory at its normal position in the system include chain.
7022 This is to ensure that GCC's procedure to fix buggy system headers and
7023 the ordering for the include_next directive are not inadvertently changed.
7024 If you really need to change the search order for system directories,
7025 use the @option{-nostdinc} and/or @option{-isystem} options.
7026
7027 @item -iquote@var{dir}
7028 @opindex iquote
7029 Add the directory @var{dir} to the head of the list of directories to
7030 be searched for header files only for the case of @samp{#include
7031 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7032 otherwise just like @option{-I}.
7033
7034 @item -L@var{dir}
7035 @opindex L
7036 Add directory @var{dir} to the list of directories to be searched
7037 for @option{-l}.
7038
7039 @item -B@var{prefix}
7040 @opindex B
7041 This option specifies where to find the executables, libraries,
7042 include files, and data files of the compiler itself.
7043
7044 The compiler driver program runs one or more of the subprograms
7045 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7046 @var{prefix} as a prefix for each program it tries to run, both with and
7047 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7048
7049 For each subprogram to be run, the compiler driver first tries the
7050 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7051 was not specified, the driver tries two standard prefixes, which are
7052 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7053 those results in a file name that is found, the unmodified program
7054 name is searched for using the directories specified in your
7055 @env{PATH} environment variable.
7056
7057 The compiler will check to see if the path provided by the @option{-B}
7058 refers to a directory, and if necessary it will add a directory
7059 separator character at the end of the path.
7060
7061 @option{-B} prefixes that effectively specify directory names also apply
7062 to libraries in the linker, because the compiler translates these
7063 options into @option{-L} options for the linker.  They also apply to
7064 includes files in the preprocessor, because the compiler translates these
7065 options into @option{-isystem} options for the preprocessor.  In this case,
7066 the compiler appends @samp{include} to the prefix.
7067
7068 The run-time support file @file{libgcc.a} can also be searched for using
7069 the @option{-B} prefix, if needed.  If it is not found there, the two
7070 standard prefixes above are tried, and that is all.  The file is left
7071 out of the link if it is not found by those means.
7072
7073 Another way to specify a prefix much like the @option{-B} prefix is to use
7074 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7075 Variables}.
7076
7077 As a special kludge, if the path provided by @option{-B} is
7078 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7079 9, then it will be replaced by @file{[dir/]include}.  This is to help
7080 with boot-strapping the compiler.
7081
7082 @item -specs=@var{file}
7083 @opindex specs
7084 Process @var{file} after the compiler reads in the standard @file{specs}
7085 file, in order to override the defaults that the @file{gcc} driver
7086 program uses when determining what switches to pass to @file{cc1},
7087 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7088 @option{-specs=@var{file}} can be specified on the command line, and they
7089 are processed in order, from left to right.
7090
7091 @item --sysroot=@var{dir}
7092 @opindex sysroot
7093 Use @var{dir} as the logical root directory for headers and libraries.
7094 For example, if the compiler would normally search for headers in
7095 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7096 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.  
7097
7098 If you use both this option and the @option{-isysroot} option, then
7099 the @option{--sysroot} option will apply to libraries, but the
7100 @option{-isysroot} option will apply to header files.
7101
7102 The GNU linker (beginning with version 2.16) has the necessary support
7103 for this option.  If your linker does not support this option, the
7104 header file aspect of @option{--sysroot} will still work, but the
7105 library aspect will not.
7106
7107 @item -I-
7108 @opindex I-
7109 This option has been deprecated.  Please use @option{-iquote} instead for
7110 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7111 Any directories you specify with @option{-I} options before the @option{-I-}
7112 option are searched only for the case of @samp{#include "@var{file}"};
7113 they are not searched for @samp{#include <@var{file}>}.
7114
7115 If additional directories are specified with @option{-I} options after
7116 the @option{-I-}, these directories are searched for all @samp{#include}
7117 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7118 this way.)
7119
7120 In addition, the @option{-I-} option inhibits the use of the current
7121 directory (where the current input file came from) as the first search
7122 directory for @samp{#include "@var{file}"}.  There is no way to
7123 override this effect of @option{-I-}.  With @option{-I.} you can specify
7124 searching the directory which was current when the compiler was
7125 invoked.  That is not exactly the same as what the preprocessor does
7126 by default, but it is often satisfactory.
7127
7128 @option{-I-} does not inhibit the use of the standard system directories
7129 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7130 independent.
7131 @end table
7132
7133 @c man end
7134
7135 @node Spec Files
7136 @section Specifying subprocesses and the switches to pass to them
7137 @cindex Spec Files
7138
7139 @command{gcc} is a driver program.  It performs its job by invoking a
7140 sequence of other programs to do the work of compiling, assembling and
7141 linking.  GCC interprets its command-line parameters and uses these to
7142 deduce which programs it should invoke, and which command-line options
7143 it ought to place on their command lines.  This behavior is controlled
7144 by @dfn{spec strings}.  In most cases there is one spec string for each
7145 program that GCC can invoke, but a few programs have multiple spec
7146 strings to control their behavior.  The spec strings built into GCC can
7147 be overridden by using the @option{-specs=} command-line switch to specify
7148 a spec file.
7149
7150 @dfn{Spec files} are plaintext files that are used to construct spec
7151 strings.  They consist of a sequence of directives separated by blank
7152 lines.  The type of directive is determined by the first non-whitespace
7153 character on the line and it can be one of the following:
7154
7155 @table @code
7156 @item %@var{command}
7157 Issues a @var{command} to the spec file processor.  The commands that can
7158 appear here are:
7159
7160 @table @code
7161 @item %include <@var{file}>
7162 @cindex %include
7163 Search for @var{file} and insert its text at the current point in the
7164 specs file.
7165
7166 @item %include_noerr <@var{file}>
7167 @cindex %include_noerr
7168 Just like @samp{%include}, but do not generate an error message if the include
7169 file cannot be found.
7170
7171 @item %rename @var{old_name} @var{new_name}
7172 @cindex %rename
7173 Rename the spec string @var{old_name} to @var{new_name}.
7174
7175 @end table
7176
7177 @item *[@var{spec_name}]:
7178 This tells the compiler to create, override or delete the named spec
7179 string.  All lines after this directive up to the next directive or
7180 blank line are considered to be the text for the spec string.  If this
7181 results in an empty string then the spec will be deleted.  (Or, if the
7182 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7183 does not currently exist a new spec will be created.  If the spec does
7184 exist then its contents will be overridden by the text of this
7185 directive, unless the first character of that text is the @samp{+}
7186 character, in which case the text will be appended to the spec.
7187
7188 @item [@var{suffix}]:
7189 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7190 and up to the next directive or blank line are considered to make up the
7191 spec string for the indicated suffix.  When the compiler encounters an
7192 input file with the named suffix, it will processes the spec string in
7193 order to work out how to compile that file.  For example:
7194
7195 @smallexample
7196 .ZZ:
7197 z-compile -input %i
7198 @end smallexample
7199
7200 This says that any input file whose name ends in @samp{.ZZ} should be
7201 passed to the program @samp{z-compile}, which should be invoked with the
7202 command-line switch @option{-input} and with the result of performing the
7203 @samp{%i} substitution.  (See below.)
7204
7205 As an alternative to providing a spec string, the text that follows a
7206 suffix directive can be one of the following:
7207
7208 @table @code
7209 @item @@@var{language}
7210 This says that the suffix is an alias for a known @var{language}.  This is
7211 similar to using the @option{-x} command-line switch to GCC to specify a
7212 language explicitly.  For example:
7213
7214 @smallexample
7215 .ZZ:
7216 @@c++
7217 @end smallexample
7218
7219 Says that .ZZ files are, in fact, C++ source files.
7220
7221 @item #@var{name}
7222 This causes an error messages saying:
7223
7224 @smallexample
7225 @var{name} compiler not installed on this system.
7226 @end smallexample
7227 @end table
7228
7229 GCC already has an extensive list of suffixes built into it.
7230 This directive will add an entry to the end of the list of suffixes, but
7231 since the list is searched from the end backwards, it is effectively
7232 possible to override earlier entries using this technique.
7233
7234 @end table
7235
7236 GCC has the following spec strings built into it.  Spec files can
7237 override these strings or create their own.  Note that individual
7238 targets can also add their own spec strings to this list.
7239
7240 @smallexample
7241 asm          Options to pass to the assembler
7242 asm_final    Options to pass to the assembler post-processor
7243 cpp          Options to pass to the C preprocessor
7244 cc1          Options to pass to the C compiler
7245 cc1plus      Options to pass to the C++ compiler
7246 endfile      Object files to include at the end of the link
7247 link         Options to pass to the linker
7248 lib          Libraries to include on the command line to the linker
7249 libgcc       Decides which GCC support library to pass to the linker
7250 linker       Sets the name of the linker
7251 predefines   Defines to be passed to the C preprocessor
7252 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7253              by default
7254 startfile    Object files to include at the start of the link
7255 @end smallexample
7256
7257 Here is a small example of a spec file:
7258
7259 @smallexample
7260 %rename lib                 old_lib
7261
7262 *lib:
7263 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7264 @end smallexample
7265
7266 This example renames the spec called @samp{lib} to @samp{old_lib} and
7267 then overrides the previous definition of @samp{lib} with a new one.
7268 The new definition adds in some extra command-line options before
7269 including the text of the old definition.
7270
7271 @dfn{Spec strings} are a list of command-line options to be passed to their
7272 corresponding program.  In addition, the spec strings can contain
7273 @samp{%}-prefixed sequences to substitute variable text or to
7274 conditionally insert text into the command line.  Using these constructs
7275 it is possible to generate quite complex command lines.
7276
7277 Here is a table of all defined @samp{%}-sequences for spec
7278 strings.  Note that spaces are not generated automatically around the
7279 results of expanding these sequences.  Therefore you can concatenate them
7280 together or combine them with constant text in a single argument.
7281
7282 @table @code
7283 @item %%
7284 Substitute one @samp{%} into the program name or argument.
7285
7286 @item %i
7287 Substitute the name of the input file being processed.
7288
7289 @item %b
7290 Substitute the basename of the input file being processed.
7291 This is the substring up to (and not including) the last period
7292 and not including the directory.
7293
7294 @item %B
7295 This is the same as @samp{%b}, but include the file suffix (text after
7296 the last period).
7297
7298 @item %d
7299 Marks the argument containing or following the @samp{%d} as a
7300 temporary file name, so that that file will be deleted if GCC exits
7301 successfully.  Unlike @samp{%g}, this contributes no text to the
7302 argument.
7303
7304 @item %g@var{suffix}
7305 Substitute a file name that has suffix @var{suffix} and is chosen
7306 once per compilation, and mark the argument in the same way as
7307 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7308 name is now chosen in a way that is hard to predict even when previously
7309 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7310 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7311 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7312 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7313 was simply substituted with a file name chosen once per compilation,
7314 without regard to any appended suffix (which was therefore treated
7315 just like ordinary text), making such attacks more likely to succeed.
7316
7317 @item %u@var{suffix}
7318 Like @samp{%g}, but generates a new temporary file name even if
7319 @samp{%u@var{suffix}} was already seen.
7320
7321 @item %U@var{suffix}
7322 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7323 new one if there is no such last file name.  In the absence of any
7324 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7325 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7326 would involve the generation of two distinct file names, one
7327 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7328 simply substituted with a file name chosen for the previous @samp{%u},
7329 without regard to any appended suffix.
7330
7331 @item %j@var{suffix}
7332 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7333 writable, and if save-temps is off; otherwise, substitute the name
7334 of a temporary file, just like @samp{%u}.  This temporary file is not
7335 meant for communication between processes, but rather as a junk
7336 disposal mechanism.
7337
7338 @item %|@var{suffix}
7339 @itemx %m@var{suffix}
7340 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7341 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7342 all.  These are the two most common ways to instruct a program that it
7343 should read from standard input or write to standard output.  If you
7344 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7345 construct: see for example @file{f/lang-specs.h}.
7346
7347 @item %.@var{SUFFIX}
7348 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7349 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7350 terminated by the next space or %.
7351
7352 @item %w
7353 Marks the argument containing or following the @samp{%w} as the
7354 designated output file of this compilation.  This puts the argument
7355 into the sequence of arguments that @samp{%o} will substitute later.
7356
7357 @item %o
7358 Substitutes the names of all the output files, with spaces
7359 automatically placed around them.  You should write spaces
7360 around the @samp{%o} as well or the results are undefined.
7361 @samp{%o} is for use in the specs for running the linker.
7362 Input files whose names have no recognized suffix are not compiled
7363 at all, but they are included among the output files, so they will
7364 be linked.
7365
7366 @item %O
7367 Substitutes the suffix for object files.  Note that this is
7368 handled specially when it immediately follows @samp{%g, %u, or %U},
7369 because of the need for those to form complete file names.  The
7370 handling is such that @samp{%O} is treated exactly as if it had already
7371 been substituted, except that @samp{%g, %u, and %U} do not currently
7372 support additional @var{suffix} characters following @samp{%O} as they would
7373 following, for example, @samp{.o}.
7374
7375 @item %p
7376 Substitutes the standard macro predefinitions for the
7377 current target machine.  Use this when running @code{cpp}.
7378
7379 @item %P
7380 Like @samp{%p}, but puts @samp{__} before and after the name of each
7381 predefined macro, except for macros that start with @samp{__} or with
7382 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7383 C@.
7384
7385 @item %I
7386 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7387 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7388 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7389 and @option{-imultilib} as necessary.
7390
7391 @item %s
7392 Current argument is the name of a library or startup file of some sort.
7393 Search for that file in a standard list of directories and substitute
7394 the full name found.
7395
7396 @item %e@var{str}
7397 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7398 Use this when inconsistent options are detected.
7399
7400 @item %(@var{name})
7401 Substitute the contents of spec string @var{name} at this point.
7402
7403 @item %[@var{name}]
7404 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7405
7406 @item %x@{@var{option}@}
7407 Accumulate an option for @samp{%X}.
7408
7409 @item %X
7410 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7411 spec string.
7412
7413 @item %Y
7414 Output the accumulated assembler options specified by @option{-Wa}.
7415
7416 @item %Z
7417 Output the accumulated preprocessor options specified by @option{-Wp}.
7418
7419 @item %a
7420 Process the @code{asm} spec.  This is used to compute the
7421 switches to be passed to the assembler.
7422
7423 @item %A
7424 Process the @code{asm_final} spec.  This is a spec string for
7425 passing switches to an assembler post-processor, if such a program is
7426 needed.
7427
7428 @item %l
7429 Process the @code{link} spec.  This is the spec for computing the
7430 command line passed to the linker.  Typically it will make use of the
7431 @samp{%L %G %S %D and %E} sequences.
7432
7433 @item %D
7434 Dump out a @option{-L} option for each directory that GCC believes might
7435 contain startup files.  If the target supports multilibs then the
7436 current multilib directory will be prepended to each of these paths.
7437
7438 @item %L
7439 Process the @code{lib} spec.  This is a spec string for deciding which
7440 libraries should be included on the command line to the linker.
7441
7442 @item %G
7443 Process the @code{libgcc} spec.  This is a spec string for deciding
7444 which GCC support library should be included on the command line to the linker.
7445
7446 @item %S
7447 Process the @code{startfile} spec.  This is a spec for deciding which
7448 object files should be the first ones passed to the linker.  Typically
7449 this might be a file named @file{crt0.o}.
7450
7451 @item %E
7452 Process the @code{endfile} spec.  This is a spec string that specifies
7453 the last object files that will be passed to the linker.
7454
7455 @item %C
7456 Process the @code{cpp} spec.  This is used to construct the arguments
7457 to be passed to the C preprocessor.
7458
7459 @item %1
7460 Process the @code{cc1} spec.  This is used to construct the options to be
7461 passed to the actual C compiler (@samp{cc1}).
7462
7463 @item %2
7464 Process the @code{cc1plus} spec.  This is used to construct the options to be
7465 passed to the actual C++ compiler (@samp{cc1plus}).
7466
7467 @item %*
7468 Substitute the variable part of a matched option.  See below.
7469 Note that each comma in the substituted string is replaced by
7470 a single space.
7471
7472 @item %<@code{S}
7473 Remove all occurrences of @code{-S} from the command line.  Note---this
7474 command is position dependent.  @samp{%} commands in the spec string
7475 before this one will see @code{-S}, @samp{%} commands in the spec string
7476 after this one will not.
7477
7478 @item %:@var{function}(@var{args})
7479 Call the named function @var{function}, passing it @var{args}.
7480 @var{args} is first processed as a nested spec string, then split
7481 into an argument vector in the usual fashion.  The function returns
7482 a string which is processed as if it had appeared literally as part
7483 of the current spec.
7484
7485 The following built-in spec functions are provided:
7486
7487 @table @code
7488 @item @code{getenv}
7489 The @code{getenv} spec function takes two arguments: an environment
7490 variable name and a string.  If the environment variable is not
7491 defined, a fatal error is issued.  Otherwise, the return value is the
7492 value of the environment variable concatenated with the string.  For
7493 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
7494
7495 @smallexample
7496 %:getenv(TOPDIR /include)
7497 @end smallexample
7498
7499 expands to @file{/path/to/top/include}.
7500
7501 @item @code{if-exists}
7502 The @code{if-exists} spec function takes one argument, an absolute
7503 pathname to a file.  If the file exists, @code{if-exists} returns the
7504 pathname.  Here is a small example of its usage:
7505
7506 @smallexample
7507 *startfile:
7508 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7509 @end smallexample
7510
7511 @item @code{if-exists-else}
7512 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7513 spec function, except that it takes two arguments.  The first argument is
7514 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7515 returns the pathname.  If it does not exist, it returns the second argument.
7516 This way, @code{if-exists-else} can be used to select one file or another,
7517 based on the existence of the first.  Here is a small example of its usage:
7518
7519 @smallexample
7520 *startfile:
7521 crt0%O%s %:if-exists(crti%O%s) \
7522 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7523 @end smallexample
7524
7525 @item @code{replace-outfile}
7526 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7527 first argument in the outfiles array and replaces it with the second argument.  Here
7528 is a small example of its usage:
7529
7530 @smallexample
7531 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7532 @end smallexample
7533
7534 @end table
7535
7536 @item %@{@code{S}@}
7537 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7538 If that switch was not specified, this substitutes nothing.  Note that
7539 the leading dash is omitted when specifying this option, and it is
7540 automatically inserted if the substitution is performed.  Thus the spec
7541 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7542 and would output the command line option @option{-foo}.
7543
7544 @item %W@{@code{S}@}
7545 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7546 deleted on failure.
7547
7548 @item %@{@code{S}*@}
7549 Substitutes all the switches specified to GCC whose names start
7550 with @code{-S}, but which also take an argument.  This is used for
7551 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7552 GCC considers @option{-o foo} as being
7553 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7554 text, including the space.  Thus two arguments would be generated.
7555
7556 @item %@{@code{S}*&@code{T}*@}
7557 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7558 (the order of @code{S} and @code{T} in the spec is not significant).
7559 There can be any number of ampersand-separated variables; for each the
7560 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7561
7562 @item %@{@code{S}:@code{X}@}
7563 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7564
7565 @item %@{!@code{S}:@code{X}@}
7566 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7567
7568 @item %@{@code{S}*:@code{X}@}
7569 Substitutes @code{X} if one or more switches whose names start with
7570 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7571 once, no matter how many such switches appeared.  However, if @code{%*}
7572 appears somewhere in @code{X}, then @code{X} will be substituted once
7573 for each matching switch, with the @code{%*} replaced by the part of
7574 that switch that matched the @code{*}.
7575
7576 @item %@{.@code{S}:@code{X}@}
7577 Substitutes @code{X}, if processing a file with suffix @code{S}.
7578
7579 @item %@{!.@code{S}:@code{X}@}
7580 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7581
7582 @item %@{@code{S}|@code{P}:@code{X}@}
7583 Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@.
7584 This may be combined with @samp{!}, @samp{.}, and @code{*} sequences as well,
7585 although they have a stronger binding than the @samp{|}.  If @code{%*}
7586 appears in @code{X}, all of the alternatives must be starred, and only
7587 the first matching alternative is substituted.
7588
7589 For example, a spec string like this:
7590
7591 @smallexample
7592 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7593 @end smallexample
7594
7595 will output the following command-line options from the following input
7596 command-line options:
7597
7598 @smallexample
7599 fred.c        -foo -baz
7600 jim.d         -bar -boggle
7601 -d fred.c     -foo -baz -boggle
7602 -d jim.d      -bar -baz -boggle
7603 @end smallexample
7604
7605 @item %@{S:X; T:Y; :D@}
7606
7607 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7608 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7609 be as many clauses as you need.  This may be combined with @code{.},
7610 @code{!}, @code{|}, and @code{*} as needed.
7611
7612
7613 @end table
7614
7615 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7616 construct may contain other nested @samp{%} constructs or spaces, or
7617 even newlines.  They are processed as usual, as described above.
7618 Trailing white space in @code{X} is ignored.  White space may also
7619 appear anywhere on the left side of the colon in these constructs,
7620 except between @code{.} or @code{*} and the corresponding word.
7621
7622 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7623 handled specifically in these constructs.  If another value of
7624 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7625 @option{-W} switch is found later in the command line, the earlier
7626 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7627 just one letter, which passes all matching options.
7628
7629 The character @samp{|} at the beginning of the predicate text is used to
7630 indicate that a command should be piped to the following command, but
7631 only if @option{-pipe} is specified.
7632
7633 It is built into GCC which switches take arguments and which do not.
7634 (You might think it would be useful to generalize this to allow each
7635 compiler's spec to say which switches take arguments.  But this cannot
7636 be done in a consistent fashion.  GCC cannot even decide which input
7637 files have been specified without knowing which switches take arguments,
7638 and it must know which input files to compile in order to tell which
7639 compilers to run).
7640
7641 GCC also knows implicitly that arguments starting in @option{-l} are to be
7642 treated as compiler output files, and passed to the linker in their
7643 proper position among the other output files.
7644
7645 @c man begin OPTIONS
7646
7647 @node Target Options
7648 @section Specifying Target Machine and Compiler Version
7649 @cindex target options
7650 @cindex cross compiling
7651 @cindex specifying machine version
7652 @cindex specifying compiler version and target machine
7653 @cindex compiler version, specifying
7654 @cindex target machine, specifying
7655
7656 The usual way to run GCC is to run the executable called @file{gcc}, or
7657 @file{<machine>-gcc} when cross-compiling, or
7658 @file{<machine>-gcc-<version>} to run a version other than the one that
7659 was installed last.  Sometimes this is inconvenient, so GCC provides
7660 options that will switch to another cross-compiler or version.
7661
7662 @table @gcctabopt
7663 @item -b @var{machine}
7664 @opindex b
7665 The argument @var{machine} specifies the target machine for compilation.
7666
7667 The value to use for @var{machine} is the same as was specified as the
7668 machine type when configuring GCC as a cross-compiler.  For
7669 example, if a cross-compiler was configured with @samp{configure
7670 arm-elf}, meaning to compile for an arm processor with elf binaries,
7671 then you would specify @option{-b arm-elf} to run that cross compiler.
7672 Because there are other options beginning with @option{-b}, the
7673 configuration must contain a hyphen. 
7674
7675 @item -V @var{version}
7676 @opindex V
7677 The argument @var{version} specifies which version of GCC to run.
7678 This is useful when multiple versions are installed.  For example,
7679 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7680 @end table
7681
7682 The @option{-V} and @option{-b} options work by running the
7683 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7684 use them if you can just run that directly.
7685
7686 @node Submodel Options
7687 @section Hardware Models and Configurations
7688 @cindex submodel options
7689 @cindex specifying hardware config
7690 @cindex hardware models and configurations, specifying
7691 @cindex machine dependent options
7692
7693 Earlier we discussed the standard option @option{-b} which chooses among
7694 different installed compilers for completely different target
7695 machines, such as VAX vs.@: 68000 vs.@: 80386.
7696
7697 In addition, each of these target machine types can have its own
7698 special options, starting with @samp{-m}, to choose among various
7699 hardware models or configurations---for example, 68010 vs 68020,
7700 floating coprocessor or none.  A single installed version of the
7701 compiler can compile for any model or configuration, according to the
7702 options specified.
7703
7704 Some configurations of the compiler also support additional special
7705 options, usually for compatibility with other compilers on the same
7706 platform.
7707
7708 @c This list is ordered alphanumerically by subsection name.
7709 @c It should be the same order and spelling as these options are listed
7710 @c in Machine Dependent Options
7711
7712 @menu
7713 * ARC Options::
7714 * ARM Options::
7715 * AVR Options::
7716 * Blackfin Options::
7717 * CRIS Options::
7718 * CRX Options::
7719 * Darwin Options::
7720 * DEC Alpha Options::
7721 * DEC Alpha/VMS Options::
7722 * FRV Options::
7723 * GNU/Linux Options::
7724 * H8/300 Options::
7725 * HPPA Options::
7726 * i386 and x86-64 Options::
7727 * IA-64 Options::
7728 * M32C Options::
7729 * M32R/D Options::
7730 * M680x0 Options::
7731 * M68hc1x Options::
7732 * MCore Options::
7733 * MIPS Options::
7734 * MMIX Options::
7735 * MN10300 Options::
7736 * MT Options::
7737 * PDP-11 Options::
7738 * PowerPC Options::
7739 * RS/6000 and PowerPC Options::
7740 * S/390 and zSeries Options::
7741 * Score Options::
7742 * SH Options::
7743 * SPARC Options::
7744 * SPU Options::
7745 * System V Options::
7746 * TMS320C3x/C4x Options::
7747 * V850 Options::
7748 * VAX Options::
7749 * x86-64 Options::
7750 * Xstormy16 Options::
7751 * Xtensa Options::
7752 * zSeries Options::
7753 @end menu
7754
7755 @node ARC Options
7756 @subsection ARC Options
7757 @cindex ARC Options
7758
7759 These options are defined for ARC implementations:
7760
7761 @table @gcctabopt
7762 @item -EL
7763 @opindex EL
7764 Compile code for little endian mode.  This is the default.
7765
7766 @item -EB
7767 @opindex EB
7768 Compile code for big endian mode.
7769
7770 @item -mmangle-cpu
7771 @opindex mmangle-cpu
7772 Prepend the name of the cpu to all public symbol names.
7773 In multiple-processor systems, there are many ARC variants with different
7774 instruction and register set characteristics.  This flag prevents code
7775 compiled for one cpu to be linked with code compiled for another.
7776 No facility exists for handling variants that are ``almost identical''.
7777 This is an all or nothing option.
7778
7779 @item -mcpu=@var{cpu}
7780 @opindex mcpu
7781 Compile code for ARC variant @var{cpu}.
7782 Which variants are supported depend on the configuration.
7783 All variants support @option{-mcpu=base}, this is the default.
7784
7785 @item -mtext=@var{text-section}
7786 @itemx -mdata=@var{data-section}
7787 @itemx -mrodata=@var{readonly-data-section}
7788 @opindex mtext
7789 @opindex mdata
7790 @opindex mrodata
7791 Put functions, data, and readonly data in @var{text-section},
7792 @var{data-section}, and @var{readonly-data-section} respectively
7793 by default.  This can be overridden with the @code{section} attribute.
7794 @xref{Variable Attributes}.
7795
7796 @end table
7797
7798 @node ARM Options
7799 @subsection ARM Options
7800 @cindex ARM options
7801
7802 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7803 architectures:
7804
7805 @table @gcctabopt
7806 @item -mabi=@var{name}
7807 @opindex mabi
7808 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7809 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
7810
7811 @item -mapcs-frame
7812 @opindex mapcs-frame
7813 Generate a stack frame that is compliant with the ARM Procedure Call
7814 Standard for all functions, even if this is not strictly necessary for
7815 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7816 with this option will cause the stack frames not to be generated for
7817 leaf functions.  The default is @option{-mno-apcs-frame}.
7818
7819 @item -mapcs
7820 @opindex mapcs
7821 This is a synonym for @option{-mapcs-frame}.
7822
7823 @ignore
7824 @c not currently implemented
7825 @item -mapcs-stack-check
7826 @opindex mapcs-stack-check
7827 Generate code to check the amount of stack space available upon entry to
7828 every function (that actually uses some stack space).  If there is
7829 insufficient space available then either the function
7830 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7831 called, depending upon the amount of stack space required.  The run time
7832 system is required to provide these functions.  The default is
7833 @option{-mno-apcs-stack-check}, since this produces smaller code.
7834
7835 @c not currently implemented
7836 @item -mapcs-float
7837 @opindex mapcs-float
7838 Pass floating point arguments using the float point registers.  This is
7839 one of the variants of the APCS@.  This option is recommended if the
7840 target hardware has a floating point unit or if a lot of floating point
7841 arithmetic is going to be performed by the code.  The default is
7842 @option{-mno-apcs-float}, since integer only code is slightly increased in
7843 size if @option{-mapcs-float} is used.
7844
7845 @c not currently implemented
7846 @item -mapcs-reentrant
7847 @opindex mapcs-reentrant
7848 Generate reentrant, position independent code.  The default is
7849 @option{-mno-apcs-reentrant}.
7850 @end ignore
7851
7852 @item -mthumb-interwork
7853 @opindex mthumb-interwork
7854 Generate code which supports calling between the ARM and Thumb
7855 instruction sets.  Without this option the two instruction sets cannot
7856 be reliably used inside one program.  The default is
7857 @option{-mno-thumb-interwork}, since slightly larger code is generated
7858 when @option{-mthumb-interwork} is specified.
7859
7860 @item -mno-sched-prolog
7861 @opindex mno-sched-prolog
7862 Prevent the reordering of instructions in the function prolog, or the
7863 merging of those instruction with the instructions in the function's
7864 body.  This means that all functions will start with a recognizable set
7865 of instructions (or in fact one of a choice from a small set of
7866 different function prologues), and this information can be used to
7867 locate the start if functions inside an executable piece of code.  The
7868 default is @option{-msched-prolog}.
7869
7870 @item -mhard-float
7871 @opindex mhard-float
7872 Generate output containing floating point instructions.  This is the
7873 default.
7874
7875 @item -msoft-float
7876 @opindex msoft-float
7877 Generate output containing library calls for floating point.
7878 @strong{Warning:} the requisite libraries are not available for all ARM
7879 targets.  Normally the facilities of the machine's usual C compiler are
7880 used, but this cannot be done directly in cross-compilation.  You must make
7881 your own arrangements to provide suitable library functions for
7882 cross-compilation.
7883
7884 @option{-msoft-float} changes the calling convention in the output file;
7885 therefore, it is only useful if you compile @emph{all} of a program with
7886 this option.  In particular, you need to compile @file{libgcc.a}, the
7887 library that comes with GCC, with @option{-msoft-float} in order for
7888 this to work.
7889
7890 @item -mfloat-abi=@var{name}
7891 @opindex mfloat-abi
7892 Specifies which ABI to use for floating point values.  Permissible values
7893 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7894
7895 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7896 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7897 of floating point instructions, but still uses the soft-float calling
7898 conventions.
7899
7900 @item -mlittle-endian
7901 @opindex mlittle-endian
7902 Generate code for a processor running in little-endian mode.  This is
7903 the default for all standard configurations.
7904
7905 @item -mbig-endian
7906 @opindex mbig-endian
7907 Generate code for a processor running in big-endian mode; the default is
7908 to compile code for a little-endian processor.
7909
7910 @item -mwords-little-endian
7911 @opindex mwords-little-endian
7912 This option only applies when generating code for big-endian processors.
7913 Generate code for a little-endian word order but a big-endian byte
7914 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7915 option should only be used if you require compatibility with code for
7916 big-endian ARM processors generated by versions of the compiler prior to
7917 2.8.
7918
7919 @item -mcpu=@var{name}
7920 @opindex mcpu
7921 This specifies the name of the target ARM processor.  GCC uses this name
7922 to determine what kind of instructions it can emit when generating
7923 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7924 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7925 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7926 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7927 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7928 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7929 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7930 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7931 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7932 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7933 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7934 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7935 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7936 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
7937 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
7938 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
7939
7940 @itemx -mtune=@var{name}
7941 @opindex mtune
7942 This option is very similar to the @option{-mcpu=} option, except that
7943 instead of specifying the actual target processor type, and hence
7944 restricting which instructions can be used, it specifies that GCC should
7945 tune the performance of the code as if the target were of the type
7946 specified in this option, but still choosing the instructions that it
7947 will generate based on the cpu specified by a @option{-mcpu=} option.
7948 For some ARM implementations better performance can be obtained by using
7949 this option.
7950
7951 @item -march=@var{name}
7952 @opindex march
7953 This specifies the name of the target ARM architecture.  GCC uses this
7954 name to determine what kind of instructions it can emit when generating
7955 assembly code.  This option can be used in conjunction with or instead
7956 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
7957 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
7958 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
7959 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a},
7960 @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{ep9312}.
7961
7962 @item -mfpu=@var{name}
7963 @itemx -mfpe=@var{number}
7964 @itemx -mfp=@var{number}
7965 @opindex mfpu
7966 @opindex mfpe
7967 @opindex mfp
7968 This specifies what floating point hardware (or hardware emulation) is
7969 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
7970 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
7971 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
7972 with older versions of GCC@.
7973
7974 If @option{-msoft-float} is specified this specifies the format of
7975 floating point values.
7976
7977 @item -mstructure-size-boundary=@var{n}
7978 @opindex mstructure-size-boundary
7979 The size of all structures and unions will be rounded up to a multiple
7980 of the number of bits set by this option.  Permissible values are 8, 32
7981 and 64.  The default value varies for different toolchains.  For the COFF
7982 targeted toolchain the default value is 8.  A value of 64 is only allowed
7983 if the underlying ABI supports it.
7984
7985 Specifying the larger number can produce faster, more efficient code, but
7986 can also increase the size of the program.  Different values are potentially
7987 incompatible.  Code compiled with one value cannot necessarily expect to
7988 work with code or libraries compiled with another value, if they exchange
7989 information using structures or unions.
7990
7991 @item -mabort-on-noreturn
7992 @opindex mabort-on-noreturn
7993 Generate a call to the function @code{abort} at the end of a
7994 @code{noreturn} function.  It will be executed if the function tries to
7995 return.
7996
7997 @item -mlong-calls
7998 @itemx -mno-long-calls
7999 @opindex mlong-calls
8000 @opindex mno-long-calls
8001 Tells the compiler to perform function calls by first loading the
8002 address of the function into a register and then performing a subroutine
8003 call on this register.  This switch is needed if the target function
8004 will lie outside of the 64 megabyte addressing range of the offset based
8005 version of subroutine call instruction.
8006
8007 Even if this switch is enabled, not all function calls will be turned
8008 into long calls.  The heuristic is that static functions, functions
8009 which have the @samp{short-call} attribute, functions that are inside
8010 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8011 definitions have already been compiled within the current compilation
8012 unit, will not be turned into long calls.  The exception to this rule is
8013 that weak function definitions, functions with the @samp{long-call}
8014 attribute or the @samp{section} attribute, and functions that are within
8015 the scope of a @samp{#pragma long_calls} directive, will always be
8016 turned into long calls.
8017
8018 This feature is not enabled by default.  Specifying
8019 @option{-mno-long-calls} will restore the default behavior, as will
8020 placing the function calls within the scope of a @samp{#pragma
8021 long_calls_off} directive.  Note these switches have no effect on how
8022 the compiler generates code to handle function calls via function
8023 pointers.
8024
8025 @item -mnop-fun-dllimport
8026 @opindex mnop-fun-dllimport
8027 Disable support for the @code{dllimport} attribute.
8028
8029 @item -msingle-pic-base
8030 @opindex msingle-pic-base
8031 Treat the register used for PIC addressing as read-only, rather than
8032 loading it in the prologue for each function.  The run-time system is
8033 responsible for initializing this register with an appropriate value
8034 before execution begins.
8035
8036 @item -mpic-register=@var{reg}
8037 @opindex mpic-register
8038 Specify the register to be used for PIC addressing.  The default is R10
8039 unless stack-checking is enabled, when R9 is used.
8040
8041 @item -mcirrus-fix-invalid-insns
8042 @opindex mcirrus-fix-invalid-insns
8043 @opindex mno-cirrus-fix-invalid-insns
8044 Insert NOPs into the instruction stream to in order to work around
8045 problems with invalid Maverick instruction combinations.  This option
8046 is only valid if the @option{-mcpu=ep9312} option has been used to
8047 enable generation of instructions for the Cirrus Maverick floating
8048 point co-processor.  This option is not enabled by default, since the
8049 problem is only present in older Maverick implementations.  The default
8050 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8051 switch.
8052
8053 @item -mpoke-function-name
8054 @opindex mpoke-function-name
8055 Write the name of each function into the text section, directly
8056 preceding the function prologue.  The generated code is similar to this:
8057
8058 @smallexample
8059      t0
8060          .ascii "arm_poke_function_name", 0
8061          .align
8062      t1
8063          .word 0xff000000 + (t1 - t0)
8064      arm_poke_function_name
8065          mov     ip, sp
8066          stmfd   sp!, @{fp, ip, lr, pc@}
8067          sub     fp, ip, #4
8068 @end smallexample
8069
8070 When performing a stack backtrace, code can inspect the value of
8071 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8072 location @code{pc - 12} and the top 8 bits are set, then we know that
8073 there is a function name embedded immediately preceding this location
8074 and has length @code{((pc[-3]) & 0xff000000)}.
8075
8076 @item -mthumb
8077 @opindex mthumb
8078 Generate code for the Thumb instruction set.  The default is to
8079 use the 32-bit ARM instruction set.
8080 This option automatically enables either 16-bit Thumb-1 or
8081 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8082 and @option{-march=@var{name}} options.
8083
8084 @item -mtpcs-frame
8085 @opindex mtpcs-frame
8086 Generate a stack frame that is compliant with the Thumb Procedure Call
8087 Standard for all non-leaf functions.  (A leaf function is one that does
8088 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8089
8090 @item -mtpcs-leaf-frame
8091 @opindex mtpcs-leaf-frame
8092 Generate a stack frame that is compliant with the Thumb Procedure Call
8093 Standard for all leaf functions.  (A leaf function is one that does
8094 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8095
8096 @item -mcallee-super-interworking
8097 @opindex mcallee-super-interworking
8098 Gives all externally visible functions in the file being compiled an ARM
8099 instruction set header which switches to Thumb mode before executing the
8100 rest of the function.  This allows these functions to be called from
8101 non-interworking code.
8102
8103 @item -mcaller-super-interworking
8104 @opindex mcaller-super-interworking
8105 Allows calls via function pointers (including virtual functions) to
8106 execute correctly regardless of whether the target code has been
8107 compiled for interworking or not.  There is a small overhead in the cost
8108 of executing a function pointer if this option is enabled.
8109
8110 @item -mtp=@var{name}
8111 @opindex mtp
8112 Specify the access model for the thread local storage pointer.  The valid
8113 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8114 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8115 (supported in the arm6k architecture), and @option{auto}, which uses the
8116 best available method for the selected processor.  The default setting is
8117 @option{auto}.
8118
8119 @end table
8120
8121 @node AVR Options
8122 @subsection AVR Options
8123 @cindex AVR Options
8124
8125 These options are defined for AVR implementations:
8126
8127 @table @gcctabopt
8128 @item -mmcu=@var{mcu}
8129 @opindex mmcu
8130 Specify ATMEL AVR instruction set or MCU type.
8131
8132 Instruction set avr1 is for the minimal AVR core, not supported by the C
8133 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8134 attiny11, attiny12, attiny15, attiny28).
8135
8136 Instruction set avr2 (default) is for the classic AVR core with up to
8137 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8138 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8139 at90c8534, at90s8535).
8140
8141 Instruction set avr3 is for the classic AVR core with up to 128K program
8142 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8143
8144 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8145 memory space (MCU types: atmega8, atmega83, atmega85).
8146
8147 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8148 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8149 atmega64, atmega128, at43usb355, at94k).
8150
8151 @item -msize
8152 @opindex msize
8153 Output instruction sizes to the asm file.
8154
8155 @item -minit-stack=@var{N}
8156 @opindex minit-stack
8157 Specify the initial stack address, which may be a symbol or numeric value,
8158 @samp{__stack} is the default.
8159
8160 @item -mno-interrupts
8161 @opindex mno-interrupts
8162 Generated code is not compatible with hardware interrupts.
8163 Code size will be smaller.
8164
8165 @item -mcall-prologues
8166 @opindex mcall-prologues
8167 Functions prologues/epilogues expanded as call to appropriate
8168 subroutines.  Code size will be smaller.
8169
8170 @item -mno-tablejump
8171 @opindex mno-tablejump
8172 Do not generate tablejump insns which sometimes increase code size.
8173
8174 @item -mtiny-stack
8175 @opindex mtiny-stack
8176 Change only the low 8 bits of the stack pointer.
8177
8178 @item -mint8
8179 @opindex mint8
8180 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8181 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8182 and long long will be 4 bytes.  Please note that this option does not
8183 comply to the C standards, but it will provide you with smaller code
8184 size.
8185 @end table
8186
8187 @node Blackfin Options
8188 @subsection Blackfin Options
8189 @cindex Blackfin Options
8190
8191 @table @gcctabopt
8192 @item -momit-leaf-frame-pointer
8193 @opindex momit-leaf-frame-pointer
8194 Don't keep the frame pointer in a register for leaf functions.  This
8195 avoids the instructions to save, set up and restore frame pointers and
8196 makes an extra register available in leaf functions.  The option
8197 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8198 which might make debugging harder.
8199
8200 @item -mspecld-anomaly
8201 @opindex mspecld-anomaly
8202 When enabled, the compiler will ensure that the generated code does not
8203 contain speculative loads after jump instructions.  This option is enabled
8204 by default.
8205
8206 @item -mno-specld-anomaly
8207 @opindex mno-specld-anomaly
8208 Don't generate extra code to prevent speculative loads from occurring.
8209
8210 @item -mcsync-anomaly
8211 @opindex mcsync-anomaly
8212 When enabled, the compiler will ensure that the generated code does not
8213 contain CSYNC or SSYNC instructions too soon after conditional branches.
8214 This option is enabled by default.
8215
8216 @item -mno-csync-anomaly
8217 @opindex mno-csync-anomaly
8218 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8219 occurring too soon after a conditional branch.
8220
8221 @item -mlow-64k
8222 @opindex mlow-64k
8223 When enabled, the compiler is free to take advantage of the knowledge that
8224 the entire program fits into the low 64k of memory.
8225
8226 @item -mno-low-64k
8227 @opindex mno-low-64k
8228 Assume that the program is arbitrarily large.  This is the default.
8229
8230 @item -mstack-check-l1
8231 @opindex mstack-check-l1
8232 Do stack checking using information placed into L1 scratchpad memory by the
8233 uClinux kernel.
8234
8235 @item -mid-shared-library
8236 @opindex mid-shared-library
8237 Generate code that supports shared libraries via the library ID method.
8238 This allows for execute in place and shared libraries in an environment
8239 without virtual memory management.  This option implies @option{-fPIC}.
8240
8241 @item -mno-id-shared-library
8242 @opindex mno-id-shared-library
8243 Generate code that doesn't assume ID based shared libraries are being used.
8244 This is the default.
8245
8246 @item -mleaf-id-shared-library
8247 @opindex mleaf-id-shared-library
8248 Generate code that supports shared libraries via the library ID method,
8249 but assumes that this library or executable won't link against any other
8250 ID shared libraries.  That allows the compiler to use faster code for jumps
8251 and calls.
8252
8253 @item -mno-leaf-id-shared-library
8254 @opindex mno-leaf-id-shared-library
8255 Do not assume that the code being compiled won't link against any ID shared
8256 libraries.  Slower code will be generated for jump and call insns.
8257
8258 @item -mshared-library-id=n
8259 @opindex mshared-library-id
8260 Specified the identification number of the ID based shared library being
8261 compiled.  Specifying a value of 0 will generate more compact code, specifying
8262 other values will force the allocation of that number to the current
8263 library but is no more space or time efficient than omitting this option.
8264
8265 @item -msep-data
8266 @opindex msep-data
8267 Generate code that allows the data segment to be located in a different
8268 area of memory from the text segment.  This allows for execute in place in
8269 an environment without virtual memory management by eliminating relocations
8270 against the text section.
8271
8272 @item -mno-sep-data
8273 @opindex mno-sep-data
8274 Generate code that assumes that the data segment follows the text segment.
8275 This is the default.
8276
8277 @item -mlong-calls
8278 @itemx -mno-long-calls
8279 @opindex mlong-calls
8280 @opindex mno-long-calls
8281 Tells the compiler to perform function calls by first loading the
8282 address of the function into a register and then performing a subroutine
8283 call on this register.  This switch is needed if the target function
8284 will lie outside of the 24 bit addressing range of the offset based
8285 version of subroutine call instruction.
8286
8287 This feature is not enabled by default.  Specifying
8288 @option{-mno-long-calls} will restore the default behavior.  Note these
8289 switches have no effect on how the compiler generates code to handle
8290 function calls via function pointers.
8291 @end table
8292
8293 @node CRIS Options
8294 @subsection CRIS Options
8295 @cindex CRIS Options
8296
8297 These options are defined specifically for the CRIS ports.
8298
8299 @table @gcctabopt
8300 @item -march=@var{architecture-type}
8301 @itemx -mcpu=@var{architecture-type}
8302 @opindex march
8303 @opindex mcpu
8304 Generate code for the specified architecture.  The choices for
8305 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8306 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8307 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8308 @samp{v10}.
8309
8310 @item -mtune=@var{architecture-type}
8311 @opindex mtune
8312 Tune to @var{architecture-type} everything applicable about the generated
8313 code, except for the ABI and the set of available instructions.  The
8314 choices for @var{architecture-type} are the same as for
8315 @option{-march=@var{architecture-type}}.
8316
8317 @item -mmax-stack-frame=@var{n}
8318 @opindex mmax-stack-frame
8319 Warn when the stack frame of a function exceeds @var{n} bytes.
8320
8321 @item -melinux-stacksize=@var{n}
8322 @opindex melinux-stacksize
8323 Only available with the @samp{cris-axis-aout} target.  Arranges for
8324 indications in the program to the kernel loader that the stack of the
8325 program should be set to @var{n} bytes.
8326
8327 @item -metrax4
8328 @itemx -metrax100
8329 @opindex metrax4
8330 @opindex metrax100
8331 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8332 @option{-march=v3} and @option{-march=v8} respectively.
8333
8334 @item -mmul-bug-workaround
8335 @itemx -mno-mul-bug-workaround
8336 @opindex mmul-bug-workaround
8337 @opindex mno-mul-bug-workaround
8338 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8339 models where it applies.  This option is active by default.
8340
8341 @item -mpdebug
8342 @opindex mpdebug
8343 Enable CRIS-specific verbose debug-related information in the assembly
8344 code.  This option also has the effect to turn off the @samp{#NO_APP}
8345 formatted-code indicator to the assembler at the beginning of the
8346 assembly file.
8347
8348 @item -mcc-init
8349 @opindex mcc-init
8350 Do not use condition-code results from previous instruction; always emit
8351 compare and test instructions before use of condition codes.
8352
8353 @item -mno-side-effects
8354 @opindex mno-side-effects
8355 Do not emit instructions with side-effects in addressing modes other than
8356 post-increment.
8357
8358 @item -mstack-align
8359 @itemx -mno-stack-align
8360 @itemx -mdata-align
8361 @itemx -mno-data-align
8362 @itemx -mconst-align
8363 @itemx -mno-const-align
8364 @opindex mstack-align
8365 @opindex mno-stack-align
8366 @opindex mdata-align
8367 @opindex mno-data-align
8368 @opindex mconst-align
8369 @opindex mno-const-align
8370 These options (no-options) arranges (eliminate arrangements) for the
8371 stack-frame, individual data and constants to be aligned for the maximum
8372 single data access size for the chosen CPU model.  The default is to
8373 arrange for 32-bit alignment.  ABI details such as structure layout are
8374 not affected by these options.
8375
8376 @item -m32-bit
8377 @itemx -m16-bit
8378 @itemx -m8-bit
8379 @opindex m32-bit
8380 @opindex m16-bit
8381 @opindex m8-bit
8382 Similar to the stack- data- and const-align options above, these options
8383 arrange for stack-frame, writable data and constants to all be 32-bit,
8384 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8385
8386 @item -mno-prologue-epilogue
8387 @itemx -mprologue-epilogue
8388 @opindex mno-prologue-epilogue
8389 @opindex mprologue-epilogue
8390 With @option{-mno-prologue-epilogue}, the normal function prologue and
8391 epilogue that sets up the stack-frame are omitted and no return
8392 instructions or return sequences are generated in the code.  Use this
8393 option only together with visual inspection of the compiled code: no
8394 warnings or errors are generated when call-saved registers must be saved,
8395 or storage for local variable needs to be allocated.
8396
8397 @item -mno-gotplt
8398 @itemx -mgotplt
8399 @opindex mno-gotplt
8400 @opindex mgotplt
8401 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8402 instruction sequences that load addresses for functions from the PLT part
8403 of the GOT rather than (traditional on other architectures) calls to the
8404 PLT@.  The default is @option{-mgotplt}.
8405
8406 @item -maout
8407 @opindex maout
8408 Legacy no-op option only recognized with the cris-axis-aout target.
8409
8410 @item -melf
8411 @opindex melf
8412 Legacy no-op option only recognized with the cris-axis-elf and
8413 cris-axis-linux-gnu targets.
8414
8415 @item -melinux
8416 @opindex melinux
8417 Only recognized with the cris-axis-aout target, where it selects a
8418 GNU/linux-like multilib, include files and instruction set for
8419 @option{-march=v8}.
8420
8421 @item -mlinux
8422 @opindex mlinux
8423 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8424
8425 @item -sim
8426 @opindex sim
8427 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8428 to link with input-output functions from a simulator library.  Code,
8429 initialized data and zero-initialized data are allocated consecutively.
8430
8431 @item -sim2
8432 @opindex sim2
8433 Like @option{-sim}, but pass linker options to locate initialized data at
8434 0x40000000 and zero-initialized data at 0x80000000.
8435 @end table
8436
8437 @node CRX Options
8438 @subsection CRX Options
8439 @cindex CRX Options
8440
8441 These options are defined specifically for the CRX ports.
8442
8443 @table @gcctabopt
8444
8445 @item -mmac
8446 @opindex mmac
8447 Enable the use of multiply-accumulate instructions. Disabled by default.
8448
8449 @item -mpush-args
8450 @opindex mpush-args
8451 Push instructions will be used to pass outgoing arguments when functions
8452 are called. Enabled by default.
8453 @end table
8454
8455 @node Darwin Options
8456 @subsection Darwin Options
8457 @cindex Darwin options
8458
8459 These options are defined for all architectures running the Darwin operating
8460 system.
8461
8462 FSF GCC on Darwin does not create ``fat'' object files; it will create
8463 an object file for the single architecture that it was built to
8464 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8465 @option{-arch} options are used; it does so by running the compiler or
8466 linker multiple times and joining the results together with
8467 @file{lipo}.
8468
8469 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8470 @samp{i686}) is determined by the flags that specify the ISA
8471 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8472 @option{-force_cpusubtype_ALL} option can be used to override this.
8473
8474 The Darwin tools vary in their behavior when presented with an ISA
8475 mismatch.  The assembler, @file{as}, will only permit instructions to
8476 be used that are valid for the subtype of the file it is generating,
8477 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8478 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8479 and print an error if asked to create a shared library with a less
8480 restrictive subtype than its input files (for instance, trying to put
8481 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8482 for executables, @file{ld}, will quietly give the executable the most
8483 restrictive subtype of any of its input files.
8484
8485 @table @gcctabopt
8486 @item -F@var{dir}
8487 @opindex F
8488 Add the framework directory @var{dir} to the head of the list of
8489 directories to be searched for header files.  These directories are
8490 interleaved with those specified by @option{-I} options and are
8491 scanned in a left-to-right order.
8492
8493 A framework directory is a directory with frameworks in it.  A
8494 framework is a directory with a @samp{"Headers"} and/or
8495 @samp{"PrivateHeaders"} directory contained directly in it that ends
8496 in @samp{".framework"}.  The name of a framework is the name of this
8497 directory excluding the @samp{".framework"}.  Headers associated with
8498 the framework are found in one of those two directories, with
8499 @samp{"Headers"} being searched first.  A subframework is a framework
8500 directory that is in a framework's @samp{"Frameworks"} directory.
8501 Includes of subframework headers can only appear in a header of a
8502 framework that contains the subframework, or in a sibling subframework
8503 header.  Two subframeworks are siblings if they occur in the same
8504 framework.  A subframework should not have the same name as a
8505 framework, a warning will be issued if this is violated.  Currently a
8506 subframework cannot have subframeworks, in the future, the mechanism
8507 may be extended to support this.  The standard frameworks can be found
8508 in @samp{"/System/Library/Frameworks"} and
8509 @samp{"/Library/Frameworks"}.  An example include looks like
8510 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8511 the name of the framework and header.h is found in the
8512 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8513
8514 @item -iframework@var{dir}
8515 @opindex iframework
8516 Like @option{-F} except the directory is a treated as a system
8517 directory.  The main difference between this @option{-iframework} and
8518 @option{-F} is that with @option{-iframework} the compiler does not
8519 warn about constructs contained within header files found via
8520 @var{dir}.  This option is valid only for the C family of languages.
8521
8522 @item -gused
8523 @opindex -gused
8524 Emit debugging information for symbols that are used.  For STABS
8525 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8526 This is by default ON@.
8527
8528 @item -gfull
8529 @opindex -gfull
8530 Emit debugging information for all symbols and types.
8531
8532 @item -mmacosx-version-min=@var{version}
8533 The earliest version of MacOS X that this executable will run on
8534 is @var{version}.  Typical values of @var{version} include @code{10.1},
8535 @code{10.2}, and @code{10.3.9}.
8536
8537 The default for this option is to make choices that seem to be most
8538 useful.  
8539
8540 @item -mkernel
8541 @opindex mkernel
8542 Enable kernel development mode.  The @option{-mkernel} option sets
8543 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8544 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8545 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8546 applicable.  This mode also sets @option{-mno-altivec},
8547 @option{-msoft-float}, @option{-fno-builtin} and
8548 @option{-mlong-branch} for PowerPC targets.
8549
8550 @item -mone-byte-bool
8551 @opindex -mone-byte-bool
8552 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8553 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8554 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8555 option has no effect on x86.
8556
8557 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8558 to generate code that is not binary compatible with code generated
8559 without that switch.  Using this switch may require recompiling all
8560 other modules in a program, including system libraries.  Use this
8561 switch to conform to a non-default data model.
8562
8563 @item -mfix-and-continue
8564 @itemx -ffix-and-continue
8565 @itemx -findirect-data
8566 @opindex mfix-and-continue
8567 @opindex ffix-and-continue
8568 @opindex findirect-data
8569 Generate code suitable for fast turn around development.  Needed to
8570 enable gdb to dynamically load @code{.o} files into already running
8571 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8572 are provided for backwards compatibility.
8573
8574 @item -all_load
8575 @opindex all_load
8576 Loads all members of static archive libraries.
8577 See man ld(1) for more information.
8578
8579 @item -arch_errors_fatal
8580 @opindex arch_errors_fatal
8581 Cause the errors having to do with files that have the wrong architecture
8582 to be fatal.
8583
8584 @item -bind_at_load
8585 @opindex bind_at_load
8586 Causes the output file to be marked such that the dynamic linker will
8587 bind all undefined references when the file is loaded or launched.
8588
8589 @item -bundle
8590 @opindex bundle
8591 Produce a Mach-o bundle format file.
8592 See man ld(1) for more information.
8593
8594 @item -bundle_loader @var{executable}
8595 @opindex bundle_loader
8596 This option specifies the @var{executable} that will be loading the build
8597 output file being linked.  See man ld(1) for more information.
8598
8599 @item -dynamiclib
8600 @opindex -dynamiclib
8601 When passed this option, GCC will produce a dynamic library instead of
8602 an executable when linking, using the Darwin @file{libtool} command.
8603
8604 @item -force_cpusubtype_ALL
8605 @opindex -force_cpusubtype_ALL
8606 This causes GCC's output file to have the @var{ALL} subtype, instead of
8607 one controlled by the @option{-mcpu} or @option{-march} option.
8608
8609 @item -allowable_client  @var{client_name}
8610 @itemx -client_name
8611 @itemx -compatibility_version
8612 @itemx -current_version
8613 @itemx -dead_strip
8614 @itemx -dependency-file
8615 @itemx -dylib_file
8616 @itemx -dylinker_install_name
8617 @itemx -dynamic
8618 @itemx -exported_symbols_list
8619 @itemx -filelist
8620 @itemx -flat_namespace
8621 @itemx -force_flat_namespace
8622 @itemx -headerpad_max_install_names
8623 @itemx -image_base
8624 @itemx -init
8625 @itemx -install_name
8626 @itemx -keep_private_externs
8627 @itemx -multi_module
8628 @itemx -multiply_defined
8629 @itemx -multiply_defined_unused
8630 @itemx -noall_load
8631 @itemx -no_dead_strip_inits_and_terms
8632 @itemx -nofixprebinding
8633 @itemx -nomultidefs
8634 @itemx -noprebind
8635 @itemx -noseglinkedit
8636 @itemx -pagezero_size
8637 @itemx -prebind
8638 @itemx -prebind_all_twolevel_modules
8639 @itemx -private_bundle
8640 @itemx -read_only_relocs
8641 @itemx -sectalign
8642 @itemx -sectobjectsymbols
8643 @itemx -whyload
8644 @itemx -seg1addr
8645 @itemx -sectcreate
8646 @itemx -sectobjectsymbols
8647 @itemx -sectorder
8648 @itemx -segaddr
8649 @itemx -segs_read_only_addr
8650 @itemx -segs_read_write_addr
8651 @itemx -seg_addr_table
8652 @itemx -seg_addr_table_filename
8653 @itemx -seglinkedit
8654 @itemx -segprot
8655 @itemx -segs_read_only_addr
8656 @itemx -segs_read_write_addr
8657 @itemx -single_module
8658 @itemx -static
8659 @itemx -sub_library
8660 @itemx -sub_umbrella
8661 @itemx -twolevel_namespace
8662 @itemx -umbrella
8663 @itemx -undefined
8664 @itemx -unexported_symbols_list
8665 @itemx -weak_reference_mismatches
8666 @itemx -whatsloaded
8667
8668 @opindex allowable_client
8669 @opindex client_name
8670 @opindex compatibility_version
8671 @opindex current_version
8672 @opindex dead_strip
8673 @opindex dependency-file
8674 @opindex dylib_file
8675 @opindex dylinker_install_name
8676 @opindex dynamic
8677 @opindex exported_symbols_list
8678 @opindex filelist
8679 @opindex flat_namespace
8680 @opindex force_flat_namespace
8681 @opindex headerpad_max_install_names
8682 @opindex image_base
8683 @opindex init
8684 @opindex install_name
8685 @opindex keep_private_externs
8686 @opindex multi_module
8687 @opindex multiply_defined
8688 @opindex multiply_defined_unused
8689 @opindex noall_load
8690 @opindex no_dead_strip_inits_and_terms
8691 @opindex nofixprebinding
8692 @opindex nomultidefs
8693 @opindex noprebind
8694 @opindex noseglinkedit
8695 @opindex pagezero_size
8696 @opindex prebind
8697 @opindex prebind_all_twolevel_modules
8698 @opindex private_bundle
8699 @opindex read_only_relocs
8700 @opindex sectalign
8701 @opindex sectobjectsymbols
8702 @opindex whyload
8703 @opindex seg1addr
8704 @opindex sectcreate
8705 @opindex sectobjectsymbols
8706 @opindex sectorder
8707 @opindex segaddr
8708 @opindex segs_read_only_addr
8709 @opindex segs_read_write_addr
8710 @opindex seg_addr_table
8711 @opindex seg_addr_table_filename
8712 @opindex seglinkedit
8713 @opindex segprot
8714 @opindex segs_read_only_addr
8715 @opindex segs_read_write_addr
8716 @opindex single_module
8717 @opindex static
8718 @opindex sub_library
8719 @opindex sub_umbrella
8720 @opindex twolevel_namespace
8721 @opindex umbrella
8722 @opindex undefined
8723 @opindex unexported_symbols_list
8724 @opindex weak_reference_mismatches
8725 @opindex whatsloaded
8726
8727 These options are passed to the Darwin linker.  The Darwin linker man page
8728 describes them in detail.
8729 @end table
8730
8731 @node DEC Alpha Options
8732 @subsection DEC Alpha Options
8733
8734 These @samp{-m} options are defined for the DEC Alpha implementations:
8735
8736 @table @gcctabopt
8737 @item -mno-soft-float
8738 @itemx -msoft-float
8739 @opindex mno-soft-float
8740 @opindex msoft-float
8741 Use (do not use) the hardware floating-point instructions for
8742 floating-point operations.  When @option{-msoft-float} is specified,
8743 functions in @file{libgcc.a} will be used to perform floating-point
8744 operations.  Unless they are replaced by routines that emulate the
8745 floating-point operations, or compiled in such a way as to call such
8746 emulations routines, these routines will issue floating-point
8747 operations.   If you are compiling for an Alpha without floating-point
8748 operations, you must ensure that the library is built so as not to call
8749 them.
8750
8751 Note that Alpha implementations without floating-point operations are
8752 required to have floating-point registers.
8753
8754 @item -mfp-reg
8755 @itemx -mno-fp-regs
8756 @opindex mfp-reg
8757 @opindex mno-fp-regs
8758 Generate code that uses (does not use) the floating-point register set.
8759 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8760 register set is not used, floating point operands are passed in integer
8761 registers as if they were integers and floating-point results are passed
8762 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8763 so any function with a floating-point argument or return value called by code
8764 compiled with @option{-mno-fp-regs} must also be compiled with that
8765 option.
8766
8767 A typical use of this option is building a kernel that does not use,
8768 and hence need not save and restore, any floating-point registers.
8769
8770 @item -mieee
8771 @opindex mieee
8772 The Alpha architecture implements floating-point hardware optimized for
8773 maximum performance.  It is mostly compliant with the IEEE floating
8774 point standard.  However, for full compliance, software assistance is
8775 required.  This option generates code fully IEEE compliant code
8776 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8777 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8778 defined during compilation.  The resulting code is less efficient but is
8779 able to correctly support denormalized numbers and exceptional IEEE
8780 values such as not-a-number and plus/minus infinity.  Other Alpha
8781 compilers call this option @option{-ieee_with_no_inexact}.
8782
8783 @item -mieee-with-inexact
8784 @opindex mieee-with-inexact
8785 This is like @option{-mieee} except the generated code also maintains
8786 the IEEE @var{inexact-flag}.  Turning on this option causes the
8787 generated code to implement fully-compliant IEEE math.  In addition to
8788 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8789 macro.  On some Alpha implementations the resulting code may execute
8790 significantly slower than the code generated by default.  Since there is
8791 very little code that depends on the @var{inexact-flag}, you should
8792 normally not specify this option.  Other Alpha compilers call this
8793 option @option{-ieee_with_inexact}.
8794
8795 @item -mfp-trap-mode=@var{trap-mode}
8796 @opindex mfp-trap-mode
8797 This option controls what floating-point related traps are enabled.
8798 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8799 The trap mode can be set to one of four values:
8800
8801 @table @samp
8802 @item n
8803 This is the default (normal) setting.  The only traps that are enabled
8804 are the ones that cannot be disabled in software (e.g., division by zero
8805 trap).
8806
8807 @item u
8808 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8809 as well.
8810
8811 @item su
8812 Like @samp{u}, but the instructions are marked to be safe for software
8813 completion (see Alpha architecture manual for details).
8814
8815 @item sui
8816 Like @samp{su}, but inexact traps are enabled as well.
8817 @end table
8818
8819 @item -mfp-rounding-mode=@var{rounding-mode}
8820 @opindex mfp-rounding-mode
8821 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8822 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8823 of:
8824
8825 @table @samp
8826 @item n
8827 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8828 the nearest machine number or towards the even machine number in case
8829 of a tie.
8830
8831 @item m
8832 Round towards minus infinity.
8833
8834 @item c
8835 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8836
8837 @item d
8838 Dynamic rounding mode.  A field in the floating point control register
8839 (@var{fpcr}, see Alpha architecture reference manual) controls the
8840 rounding mode in effect.  The C library initializes this register for
8841 rounding towards plus infinity.  Thus, unless your program modifies the
8842 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8843 @end table
8844
8845 @item -mtrap-precision=@var{trap-precision}
8846 @opindex mtrap-precision
8847 In the Alpha architecture, floating point traps are imprecise.  This
8848 means without software assistance it is impossible to recover from a
8849 floating trap and program execution normally needs to be terminated.
8850 GCC can generate code that can assist operating system trap handlers
8851 in determining the exact location that caused a floating point trap.
8852 Depending on the requirements of an application, different levels of
8853 precisions can be selected:
8854
8855 @table @samp
8856 @item p
8857 Program precision.  This option is the default and means a trap handler
8858 can only identify which program caused a floating point exception.
8859
8860 @item f
8861 Function precision.  The trap handler can determine the function that
8862 caused a floating point exception.
8863
8864 @item i
8865 Instruction precision.  The trap handler can determine the exact
8866 instruction that caused a floating point exception.
8867 @end table
8868
8869 Other Alpha compilers provide the equivalent options called
8870 @option{-scope_safe} and @option{-resumption_safe}.
8871
8872 @item -mieee-conformant
8873 @opindex mieee-conformant
8874 This option marks the generated code as IEEE conformant.  You must not
8875 use this option unless you also specify @option{-mtrap-precision=i} and either
8876 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8877 is to emit the line @samp{.eflag 48} in the function prologue of the
8878 generated assembly file.  Under DEC Unix, this has the effect that
8879 IEEE-conformant math library routines will be linked in.
8880
8881 @item -mbuild-constants
8882 @opindex mbuild-constants
8883 Normally GCC examines a 32- or 64-bit integer constant to
8884 see if it can construct it from smaller constants in two or three
8885 instructions.  If it cannot, it will output the constant as a literal and
8886 generate code to load it from the data segment at runtime.
8887
8888 Use this option to require GCC to construct @emph{all} integer constants
8889 using code, even if it takes more instructions (the maximum is six).
8890
8891 You would typically use this option to build a shared library dynamic
8892 loader.  Itself a shared library, it must relocate itself in memory
8893 before it can find the variables and constants in its own data segment.
8894
8895 @item -malpha-as
8896 @itemx -mgas
8897 @opindex malpha-as
8898 @opindex mgas
8899 Select whether to generate code to be assembled by the vendor-supplied
8900 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8901
8902 @item -mbwx
8903 @itemx -mno-bwx
8904 @itemx -mcix
8905 @itemx -mno-cix
8906 @itemx -mfix
8907 @itemx -mno-fix
8908 @itemx -mmax
8909 @itemx -mno-max
8910 @opindex mbwx
8911 @opindex mno-bwx
8912 @opindex mcix
8913 @opindex mno-cix
8914 @opindex mfix
8915 @opindex mno-fix
8916 @opindex mmax
8917 @opindex mno-max
8918 Indicate whether GCC should generate code to use the optional BWX,
8919 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8920 sets supported by the CPU type specified via @option{-mcpu=} option or that
8921 of the CPU on which GCC was built if none was specified.
8922
8923 @item -mfloat-vax
8924 @itemx -mfloat-ieee
8925 @opindex mfloat-vax
8926 @opindex mfloat-ieee
8927 Generate code that uses (does not use) VAX F and G floating point
8928 arithmetic instead of IEEE single and double precision.
8929
8930 @item -mexplicit-relocs
8931 @itemx -mno-explicit-relocs
8932 @opindex mexplicit-relocs
8933 @opindex mno-explicit-relocs
8934 Older Alpha assemblers provided no way to generate symbol relocations
8935 except via assembler macros.  Use of these macros does not allow
8936 optimal instruction scheduling.  GNU binutils as of version 2.12
8937 supports a new syntax that allows the compiler to explicitly mark
8938 which relocations should apply to which instructions.  This option
8939 is mostly useful for debugging, as GCC detects the capabilities of
8940 the assembler when it is built and sets the default accordingly.
8941
8942 @item -msmall-data
8943 @itemx -mlarge-data
8944 @opindex msmall-data
8945 @opindex mlarge-data
8946 When @option{-mexplicit-relocs} is in effect, static data is
8947 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
8948 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
8949 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
8950 16-bit relocations off of the @code{$gp} register.  This limits the
8951 size of the small data area to 64KB, but allows the variables to be
8952 directly accessed via a single instruction.
8953
8954 The default is @option{-mlarge-data}.  With this option the data area
8955 is limited to just below 2GB@.  Programs that require more than 2GB of
8956 data must use @code{malloc} or @code{mmap} to allocate the data in the
8957 heap instead of in the program's data segment.
8958
8959 When generating code for shared libraries, @option{-fpic} implies
8960 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
8961
8962 @item -msmall-text
8963 @itemx -mlarge-text
8964 @opindex msmall-text
8965 @opindex mlarge-text
8966 When @option{-msmall-text} is used, the compiler assumes that the
8967 code of the entire program (or shared library) fits in 4MB, and is
8968 thus reachable with a branch instruction.  When @option{-msmall-data}
8969 is used, the compiler can assume that all local symbols share the
8970 same @code{$gp} value, and thus reduce the number of instructions
8971 required for a function call from 4 to 1.
8972
8973 The default is @option{-mlarge-text}.
8974
8975 @item -mcpu=@var{cpu_type}
8976 @opindex mcpu
8977 Set the instruction set and instruction scheduling parameters for
8978 machine type @var{cpu_type}.  You can specify either the @samp{EV}
8979 style name or the corresponding chip number.  GCC supports scheduling
8980 parameters for the EV4, EV5 and EV6 family of processors and will
8981 choose the default values for the instruction set from the processor
8982 you specify.  If you do not specify a processor type, GCC will default
8983 to the processor on which the compiler was built.
8984
8985 Supported values for @var{cpu_type} are
8986
8987 @table @samp
8988 @item ev4
8989 @itemx ev45
8990 @itemx 21064
8991 Schedules as an EV4 and has no instruction set extensions.
8992
8993 @item ev5
8994 @itemx 21164
8995 Schedules as an EV5 and has no instruction set extensions.
8996
8997 @item ev56
8998 @itemx 21164a
8999 Schedules as an EV5 and supports the BWX extension.
9000
9001 @item pca56
9002 @itemx 21164pc
9003 @itemx 21164PC
9004 Schedules as an EV5 and supports the BWX and MAX extensions.
9005
9006 @item ev6
9007 @itemx 21264
9008 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9009
9010 @item ev67
9011 @itemx 21264a
9012 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9013 @end table
9014
9015 @item -mtune=@var{cpu_type}
9016 @opindex mtune
9017 Set only the instruction scheduling parameters for machine type
9018 @var{cpu_type}.  The instruction set is not changed.
9019
9020 @item -mmemory-latency=@var{time}
9021 @opindex mmemory-latency
9022 Sets the latency the scheduler should assume for typical memory
9023 references as seen by the application.  This number is highly
9024 dependent on the memory access patterns used by the application
9025 and the size of the external cache on the machine.
9026
9027 Valid options for @var{time} are
9028
9029 @table @samp
9030 @item @var{number}
9031 A decimal number representing clock cycles.
9032
9033 @item L1
9034 @itemx L2
9035 @itemx L3
9036 @itemx main
9037 The compiler contains estimates of the number of clock cycles for
9038 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9039 (also called Dcache, Scache, and Bcache), as well as to main memory.
9040 Note that L3 is only valid for EV5.
9041
9042 @end table
9043 @end table
9044
9045 @node DEC Alpha/VMS Options
9046 @subsection DEC Alpha/VMS Options
9047
9048 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9049
9050 @table @gcctabopt
9051 @item -mvms-return-codes
9052 @opindex mvms-return-codes
9053 Return VMS condition codes from main.  The default is to return POSIX
9054 style condition (e.g.@ error) codes.
9055 @end table
9056
9057 @node FRV Options
9058 @subsection FRV Options
9059 @cindex FRV Options
9060
9061 @table @gcctabopt
9062 @item -mgpr-32
9063 @opindex mgpr-32
9064
9065 Only use the first 32 general purpose registers.
9066
9067 @item -mgpr-64
9068 @opindex mgpr-64
9069
9070 Use all 64 general purpose registers.
9071
9072 @item -mfpr-32
9073 @opindex mfpr-32
9074
9075 Use only the first 32 floating point registers.
9076
9077 @item -mfpr-64
9078 @opindex mfpr-64
9079
9080 Use all 64 floating point registers
9081
9082 @item -mhard-float
9083 @opindex mhard-float
9084
9085 Use hardware instructions for floating point operations.
9086
9087 @item -msoft-float
9088 @opindex msoft-float
9089
9090 Use library routines for floating point operations.
9091
9092 @item -malloc-cc
9093 @opindex malloc-cc
9094
9095 Dynamically allocate condition code registers.
9096
9097 @item -mfixed-cc
9098 @opindex mfixed-cc
9099
9100 Do not try to dynamically allocate condition code registers, only
9101 use @code{icc0} and @code{fcc0}.
9102
9103 @item -mdword
9104 @opindex mdword
9105
9106 Change ABI to use double word insns.
9107
9108 @item -mno-dword
9109 @opindex mno-dword
9110
9111 Do not use double word instructions.
9112
9113 @item -mdouble
9114 @opindex mdouble
9115
9116 Use floating point double instructions.
9117
9118 @item -mno-double
9119 @opindex mno-double
9120
9121 Do not use floating point double instructions.
9122
9123 @item -mmedia
9124 @opindex mmedia
9125
9126 Use media instructions.
9127
9128 @item -mno-media
9129 @opindex mno-media
9130
9131 Do not use media instructions.
9132
9133 @item -mmuladd
9134 @opindex mmuladd
9135
9136 Use multiply and add/subtract instructions.
9137
9138 @item -mno-muladd
9139 @opindex mno-muladd
9140
9141 Do not use multiply and add/subtract instructions.
9142
9143 @item -mfdpic
9144 @opindex mfdpic
9145
9146 Select the FDPIC ABI, that uses function descriptors to represent
9147 pointers to functions.  Without any PIC/PIE-related options, it
9148 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
9149 assumes GOT entries and small data are within a 12-bit range from the
9150 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
9151 are computed with 32 bits.
9152
9153 @item -minline-plt
9154 @opindex minline-plt
9155
9156 Enable inlining of PLT entries in function calls to functions that are
9157 not known to bind locally.  It has no effect without @option{-mfdpic}.
9158 It's enabled by default if optimizing for speed and compiling for
9159 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
9160 optimization option such as @option{-O3} or above is present in the
9161 command line.
9162
9163 @item -mTLS
9164 @opindex TLS
9165
9166 Assume a large TLS segment when generating thread-local code.
9167
9168 @item -mtls
9169 @opindex tls
9170
9171 Do not assume a large TLS segment when generating thread-local code.
9172
9173 @item -mgprel-ro
9174 @opindex mgprel-ro
9175
9176 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
9177 that is known to be in read-only sections.  It's enabled by default,
9178 except for @option{-fpic} or @option{-fpie}: even though it may help
9179 make the global offset table smaller, it trades 1 instruction for 4.
9180 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9181 one of which may be shared by multiple symbols, and it avoids the need
9182 for a GOT entry for the referenced symbol, so it's more likely to be a
9183 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9184
9185 @item -multilib-library-pic
9186 @opindex multilib-library-pic
9187
9188 Link with the (library, not FD) pic libraries.  It's implied by
9189 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9190 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9191 it explicitly.
9192
9193 @item -mlinked-fp
9194 @opindex mlinked-fp
9195
9196 Follow the EABI requirement of always creating a frame pointer whenever
9197 a stack frame is allocated.  This option is enabled by default and can
9198 be disabled with @option{-mno-linked-fp}.
9199
9200 @item -mlong-calls
9201 @opindex mlong-calls
9202
9203 Use indirect addressing to call functions outside the current
9204 compilation unit.  This allows the functions to be placed anywhere
9205 within the 32-bit address space.
9206
9207 @item -malign-labels
9208 @opindex malign-labels
9209
9210 Try to align labels to an 8-byte boundary by inserting nops into the
9211 previous packet.  This option only has an effect when VLIW packing
9212 is enabled.  It doesn't create new packets; it merely adds nops to
9213 existing ones.
9214
9215 @item -mlibrary-pic
9216 @opindex mlibrary-pic
9217
9218 Generate position-independent EABI code.
9219
9220 @item -macc-4
9221 @opindex macc-4
9222
9223 Use only the first four media accumulator registers.
9224
9225 @item -macc-8
9226 @opindex macc-8
9227
9228 Use all eight media accumulator registers.
9229
9230 @item -mpack
9231 @opindex mpack
9232
9233 Pack VLIW instructions.
9234
9235 @item -mno-pack
9236 @opindex mno-pack
9237
9238 Do not pack VLIW instructions.
9239
9240 @item -mno-eflags
9241 @opindex mno-eflags
9242
9243 Do not mark ABI switches in e_flags.
9244
9245 @item -mcond-move
9246 @opindex mcond-move
9247
9248 Enable the use of conditional-move instructions (default).
9249
9250 This switch is mainly for debugging the compiler and will likely be removed
9251 in a future version.
9252
9253 @item -mno-cond-move
9254 @opindex mno-cond-move
9255
9256 Disable the use of conditional-move instructions.
9257
9258 This switch is mainly for debugging the compiler and will likely be removed
9259 in a future version.
9260
9261 @item -mscc
9262 @opindex mscc
9263
9264 Enable the use of conditional set instructions (default).
9265
9266 This switch is mainly for debugging the compiler and will likely be removed
9267 in a future version.
9268
9269 @item -mno-scc
9270 @opindex mno-scc
9271
9272 Disable the use of conditional set instructions.
9273
9274 This switch is mainly for debugging the compiler and will likely be removed
9275 in a future version.
9276
9277 @item -mcond-exec
9278 @opindex mcond-exec
9279
9280 Enable the use of conditional execution (default).
9281
9282 This switch is mainly for debugging the compiler and will likely be removed
9283 in a future version.
9284
9285 @item -mno-cond-exec
9286 @opindex mno-cond-exec
9287
9288 Disable the use of conditional execution.
9289
9290 This switch is mainly for debugging the compiler and will likely be removed
9291 in a future version.
9292
9293 @item -mvliw-branch
9294 @opindex mvliw-branch
9295
9296 Run a pass to pack branches into VLIW instructions (default).
9297
9298 This switch is mainly for debugging the compiler and will likely be removed
9299 in a future version.
9300
9301 @item -mno-vliw-branch
9302 @opindex mno-vliw-branch
9303
9304 Do not run a pass to pack branches into VLIW instructions.
9305
9306 This switch is mainly for debugging the compiler and will likely be removed
9307 in a future version.
9308
9309 @item -mmulti-cond-exec
9310 @opindex mmulti-cond-exec
9311
9312 Enable optimization of @code{&&} and @code{||} in conditional execution
9313 (default).
9314
9315 This switch is mainly for debugging the compiler and will likely be removed
9316 in a future version.
9317
9318 @item -mno-multi-cond-exec
9319 @opindex mno-multi-cond-exec
9320
9321 Disable optimization of @code{&&} and @code{||} in conditional execution.
9322
9323 This switch is mainly for debugging the compiler and will likely be removed
9324 in a future version.
9325
9326 @item -mnested-cond-exec
9327 @opindex mnested-cond-exec
9328
9329 Enable nested conditional execution optimizations (default).
9330
9331 This switch is mainly for debugging the compiler and will likely be removed
9332 in a future version.
9333
9334 @item -mno-nested-cond-exec
9335 @opindex mno-nested-cond-exec
9336
9337 Disable nested conditional execution optimizations.
9338
9339 This switch is mainly for debugging the compiler and will likely be removed
9340 in a future version.
9341
9342 @item -moptimize-membar
9343 @opindex moptimize-membar
9344
9345 This switch removes redundant @code{membar} instructions from the
9346 compiler generated code.  It is enabled by default.
9347
9348 @item -mno-optimize-membar
9349 @opindex mno-optimize-membar
9350
9351 This switch disables the automatic removal of redundant @code{membar}
9352 instructions from the generated code.
9353
9354 @item -mtomcat-stats
9355 @opindex mtomcat-stats
9356
9357 Cause gas to print out tomcat statistics.
9358
9359 @item -mcpu=@var{cpu}
9360 @opindex mcpu
9361
9362 Select the processor type for which to generate code.  Possible values are
9363 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9364 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9365
9366 @end table
9367
9368 @node GNU/Linux Options
9369 @subsection GNU/Linux Options
9370
9371 These @samp{-m} options are defined for GNU/Linux targets:
9372
9373 @table @gcctabopt
9374 @item -mglibc
9375 @opindex mglibc
9376 Use the GNU C library instead of uClibc.  This is the default except
9377 on @samp{*-*-linux-*uclibc*} targets.
9378
9379 @item -muclibc
9380 @opindex muclibc
9381 Use uClibc instead of the GNU C library.  This is the default on
9382 @samp{*-*-linux-*uclibc*} targets.
9383 @end table
9384
9385 @node H8/300 Options
9386 @subsection H8/300 Options
9387
9388 These @samp{-m} options are defined for the H8/300 implementations:
9389
9390 @table @gcctabopt
9391 @item -mrelax
9392 @opindex mrelax
9393 Shorten some address references at link time, when possible; uses the
9394 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9395 ld, Using ld}, for a fuller description.
9396
9397 @item -mh
9398 @opindex mh
9399 Generate code for the H8/300H@.
9400
9401 @item -ms
9402 @opindex ms
9403 Generate code for the H8S@.
9404
9405 @item -mn
9406 @opindex mn
9407 Generate code for the H8S and H8/300H in the normal mode.  This switch
9408 must be used either with @option{-mh} or @option{-ms}.
9409
9410 @item -ms2600
9411 @opindex ms2600
9412 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9413
9414 @item -mint32
9415 @opindex mint32
9416 Make @code{int} data 32 bits by default.
9417
9418 @item -malign-300
9419 @opindex malign-300
9420 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9421 The default for the H8/300H and H8S is to align longs and floats on 4
9422 byte boundaries.
9423 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9424 This option has no effect on the H8/300.
9425 @end table
9426
9427 @node HPPA Options
9428 @subsection HPPA Options
9429 @cindex HPPA Options
9430
9431 These @samp{-m} options are defined for the HPPA family of computers:
9432
9433 @table @gcctabopt
9434 @item -march=@var{architecture-type}
9435 @opindex march
9436 Generate code for the specified architecture.  The choices for
9437 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9438 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9439 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9440 architecture option for your machine.  Code compiled for lower numbered
9441 architectures will run on higher numbered architectures, but not the
9442 other way around.
9443
9444 @item -mpa-risc-1-0
9445 @itemx -mpa-risc-1-1
9446 @itemx -mpa-risc-2-0
9447 @opindex mpa-risc-1-0
9448 @opindex mpa-risc-1-1
9449 @opindex mpa-risc-2-0
9450 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9451
9452 @item -mbig-switch
9453 @opindex mbig-switch
9454 Generate code suitable for big switch tables.  Use this option only if
9455 the assembler/linker complain about out of range branches within a switch
9456 table.
9457
9458 @item -mjump-in-delay
9459 @opindex mjump-in-delay
9460 Fill delay slots of function calls with unconditional jump instructions
9461 by modifying the return pointer for the function call to be the target
9462 of the conditional jump.
9463
9464 @item -mdisable-fpregs
9465 @opindex mdisable-fpregs
9466 Prevent floating point registers from being used in any manner.  This is
9467 necessary for compiling kernels which perform lazy context switching of
9468 floating point registers.  If you use this option and attempt to perform
9469 floating point operations, the compiler will abort.
9470
9471 @item -mdisable-indexing
9472 @opindex mdisable-indexing
9473 Prevent the compiler from using indexing address modes.  This avoids some
9474 rather obscure problems when compiling MIG generated code under MACH@.
9475
9476 @item -mno-space-regs
9477 @opindex mno-space-regs
9478 Generate code that assumes the target has no space registers.  This allows
9479 GCC to generate faster indirect calls and use unscaled index address modes.
9480
9481 Such code is suitable for level 0 PA systems and kernels.
9482
9483 @item -mfast-indirect-calls
9484 @opindex mfast-indirect-calls
9485 Generate code that assumes calls never cross space boundaries.  This
9486 allows GCC to emit code which performs faster indirect calls.
9487
9488 This option will not work in the presence of shared libraries or nested
9489 functions.
9490
9491 @item -mfixed-range=@var{register-range}
9492 @opindex mfixed-range
9493 Generate code treating the given register range as fixed registers.
9494 A fixed register is one that the register allocator can not use.  This is
9495 useful when compiling kernel code.  A register range is specified as
9496 two registers separated by a dash.  Multiple register ranges can be
9497 specified separated by a comma.
9498
9499 @item -mlong-load-store
9500 @opindex mlong-load-store
9501 Generate 3-instruction load and store sequences as sometimes required by
9502 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9503 the HP compilers.
9504
9505 @item -mportable-runtime
9506 @opindex mportable-runtime
9507 Use the portable calling conventions proposed by HP for ELF systems.
9508
9509 @item -mgas
9510 @opindex mgas
9511 Enable the use of assembler directives only GAS understands.
9512
9513 @item -mschedule=@var{cpu-type}
9514 @opindex mschedule
9515 Schedule code according to the constraints for the machine type
9516 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9517 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9518 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9519 proper scheduling option for your machine.  The default scheduling is
9520 @samp{8000}.
9521
9522 @item -mlinker-opt
9523 @opindex mlinker-opt
9524 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9525 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9526 linkers in which they give bogus error messages when linking some programs.
9527
9528 @item -msoft-float
9529 @opindex msoft-float
9530 Generate output containing library calls for floating point.
9531 @strong{Warning:} the requisite libraries are not available for all HPPA
9532 targets.  Normally the facilities of the machine's usual C compiler are
9533 used, but this cannot be done directly in cross-compilation.  You must make
9534 your own arrangements to provide suitable library functions for
9535 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9536 does provide software floating point support.
9537
9538 @option{-msoft-float} changes the calling convention in the output file;
9539 therefore, it is only useful if you compile @emph{all} of a program with
9540 this option.  In particular, you need to compile @file{libgcc.a}, the
9541 library that comes with GCC, with @option{-msoft-float} in order for
9542 this to work.
9543
9544 @item -msio
9545 @opindex msio
9546 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9547 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9548 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9549 options are available under HP-UX and HI-UX@.
9550
9551 @item -mgnu-ld
9552 @opindex gnu-ld
9553 Use GNU ld specific options.  This passes @option{-shared} to ld when
9554 building a shared library.  It is the default when GCC is configured,
9555 explicitly or implicitly, with the GNU linker.  This option does not
9556 have any affect on which ld is called, it only changes what parameters
9557 are passed to that ld.  The ld that is called is determined by the
9558 @option{--with-ld} configure option, GCC's program search path, and
9559 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9560 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9561 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9562
9563 @item -mhp-ld
9564 @opindex hp-ld
9565 Use HP ld specific options.  This passes @option{-b} to ld when building
9566 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9567 links.  It is the default when GCC is configured, explicitly or
9568 implicitly, with the HP linker.  This option does not have any affect on
9569 which ld is called, it only changes what parameters are passed to that
9570 ld.  The ld that is called is determined by the @option{--with-ld}
9571 configure option, GCC's program search path, and finally by the user's
9572 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9573 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9574 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9575
9576 @item -mlong-calls
9577 @opindex mno-long-calls
9578 Generate code that uses long call sequences.  This ensures that a call
9579 is always able to reach linker generated stubs.  The default is to generate
9580 long calls only when the distance from the call site to the beginning
9581 of the function or translation unit, as the case may be, exceeds a
9582 predefined limit set by the branch type being used.  The limits for
9583 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9584 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9585 240,000 bytes.
9586
9587 Distances are measured from the beginning of functions when using the
9588 @option{-ffunction-sections} option, or when using the @option{-mgas}
9589 and @option{-mno-portable-runtime} options together under HP-UX with
9590 the SOM linker.
9591
9592 It is normally not desirable to use this option as it will degrade
9593 performance.  However, it may be useful in large applications,
9594 particularly when partial linking is used to build the application.
9595
9596 The types of long calls used depends on the capabilities of the
9597 assembler and linker, and the type of code being generated.  The
9598 impact on systems that support long absolute calls, and long pic
9599 symbol-difference or pc-relative calls should be relatively small.
9600 However, an indirect call is used on 32-bit ELF systems in pic code
9601 and it is quite long.
9602
9603 @item -munix=@var{unix-std}
9604 @opindex march
9605 Generate compiler predefines and select a startfile for the specified
9606 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9607 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9608 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9609 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9610 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9611 and later.
9612
9613 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9614 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9615 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9616 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9617 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9618 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9619
9620 It is @emph{important} to note that this option changes the interfaces
9621 for various library routines.  It also affects the operational behavior
9622 of the C library.  Thus, @emph{extreme} care is needed in using this
9623 option.
9624
9625 Library code that is intended to operate with more than one UNIX
9626 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9627 as appropriate.  Most GNU software doesn't provide this capability.
9628
9629 @item -nolibdld
9630 @opindex nolibdld
9631 Suppress the generation of link options to search libdld.sl when the
9632 @option{-static} option is specified on HP-UX 10 and later.
9633
9634 @item -static
9635 @opindex static
9636 The HP-UX implementation of setlocale in libc has a dependency on
9637 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9638 when the @option{-static} option is specified, special link options
9639 are needed to resolve this dependency.
9640
9641 On HP-UX 10 and later, the GCC driver adds the necessary options to
9642 link with libdld.sl when the @option{-static} option is specified.
9643 This causes the resulting binary to be dynamic.  On the 64-bit port,
9644 the linkers generate dynamic binaries by default in any case.  The
9645 @option{-nolibdld} option can be used to prevent the GCC driver from
9646 adding these link options.
9647
9648 @item -threads
9649 @opindex threads
9650 Add support for multithreading with the @dfn{dce thread} library
9651 under HP-UX@.  This option sets flags for both the preprocessor and
9652 linker.
9653 @end table
9654
9655 @node i386 and x86-64 Options
9656 @subsection Intel 386 and AMD x86-64 Options
9657 @cindex i386 Options
9658 @cindex x86-64 Options
9659 @cindex Intel 386 Options
9660 @cindex AMD x86-64 Options
9661
9662 These @samp{-m} options are defined for the i386 and x86-64 family of
9663 computers:
9664
9665 @table @gcctabopt
9666 @item -mtune=@var{cpu-type}
9667 @opindex mtune
9668 Tune to @var{cpu-type} everything applicable about the generated code, except
9669 for the ABI and the set of available instructions.  The choices for
9670 @var{cpu-type} are:
9671 @table @emph
9672 @item generic
9673 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9674 If you know the CPU on which your code will run, then you should use
9675 the corresponding @option{-mtune} option instead of
9676 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9677 of your application will have, then you should use this option.
9678
9679 As new processors are deployed in the marketplace, the behavior of this
9680 option will change.  Therefore, if you upgrade to a newer version of
9681 GCC, the code generated option will change to reflect the processors
9682 that were most common when that version of GCC was released.
9683
9684 There is no @option{-march=generic} option because @option{-march}
9685 indicates the instruction set the compiler can use, and there is no
9686 generic instruction set applicable to all processors.  In contrast,
9687 @option{-mtune} indicates the processor (or, in this case, collection of
9688 processors) for which the code is optimized.
9689 @item native
9690 This selects the CPU to tune for at compilation time by determining
9691 the processor type of the compiling machine.  Using @option{-mtune=native}
9692 will produce code optimized for the local machine under the constraints
9693 of the selected instruction set.  Using @option{-march=native} will
9694 enable all instruction subsets supported by the local machine (hence
9695 the result might not run on different machines).
9696 @item i386
9697 Original Intel's i386 CPU@.
9698 @item i486
9699 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9700 @item i586, pentium
9701 Intel Pentium CPU with no MMX support.
9702 @item pentium-mmx
9703 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9704 @item pentiumpro
9705 Intel PentiumPro CPU@.
9706 @item i686
9707 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9708 instruction set will be used, so the code will run on all i686 family chips.
9709 @item pentium2
9710 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9711 @item pentium3, pentium3m
9712 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9713 support.
9714 @item pentium-m
9715 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9716 support.  Used by Centrino notebooks.
9717 @item pentium4, pentium4m
9718 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9719 @item prescott
9720 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9721 set support.
9722 @item nocona
9723 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9724 SSE2 and SSE3 instruction set support.
9725 @item core2
9726 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9727 instruction set support.
9728 @item k6
9729 AMD K6 CPU with MMX instruction set support.
9730 @item k6-2, k6-3
9731 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9732 @item athlon, athlon-tbird
9733 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9734 support.
9735 @item athlon-4, athlon-xp, athlon-mp
9736 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9737 instruction set support.
9738 @item k8, opteron, athlon64, athlon-fx
9739 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9740 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9741 @item amdfam10
9742 AMD Family 10 core based CPUs with x86-64 instruction set support.  (This
9743 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
9744 instruction set extensions.)
9745 @item winchip-c6
9746 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9747 set support.
9748 @item winchip2
9749 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9750 instruction set support.
9751 @item c3
9752 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9753 implemented for this chip.)
9754 @item c3-2
9755 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9756 implemented for this chip.)
9757 @item geode
9758 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9759 @end table
9760
9761 While picking a specific @var{cpu-type} will schedule things appropriately
9762 for that particular chip, the compiler will not generate any code that
9763 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9764 being used.
9765
9766 @item -march=@var{cpu-type}
9767 @opindex march
9768 Generate instructions for the machine type @var{cpu-type}.  The choices
9769 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9770 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9771
9772 @item -mcpu=@var{cpu-type}
9773 @opindex mcpu
9774 A deprecated synonym for @option{-mtune}.
9775
9776 @item -m386
9777 @itemx -m486
9778 @itemx -mpentium
9779 @itemx -mpentiumpro
9780 @opindex m386
9781 @opindex m486
9782 @opindex mpentium
9783 @opindex mpentiumpro
9784 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9785 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9786 These synonyms are deprecated.
9787
9788 @item -mfpmath=@var{unit}
9789 @opindex march
9790 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9791 for @var{unit} are:
9792
9793 @table @samp
9794 @item 387
9795 Use the standard 387 floating point coprocessor present majority of chips and
9796 emulated otherwise.  Code compiled with this option will run almost everywhere.
9797 The temporary results are computed in 80bit precision instead of precision
9798 specified by the type resulting in slightly different results compared to most
9799 of other chips.  See @option{-ffloat-store} for more detailed description.
9800
9801 This is the default choice for i386 compiler.
9802
9803 @item sse
9804 Use scalar floating point instructions present in the SSE instruction set.
9805 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9806 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9807 instruction set supports only single precision arithmetics, thus the double and
9808 extended precision arithmetics is still done using 387.  Later version, present
9809 only in Pentium4 and the future AMD x86-64 chips supports double precision
9810 arithmetics too.
9811
9812 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9813 or @option{-msse2} switches to enable SSE extensions and make this option
9814 effective.  For the x86-64 compiler, these extensions are enabled by default.
9815
9816 The resulting code should be considerably faster in the majority of cases and avoid
9817 the numerical instability problems of 387 code, but may break some existing
9818 code that expects temporaries to be 80bit.
9819
9820 This is the default choice for the x86-64 compiler.
9821
9822 @item sse,387
9823 Attempt to utilize both instruction sets at once.  This effectively double the
9824 amount of available registers and on chips with separate execution units for
9825 387 and SSE the execution resources too.  Use this option with care, as it is
9826 still experimental, because the GCC register allocator does not model separate
9827 functional units well resulting in instable performance.
9828 @end table
9829
9830 @item -masm=@var{dialect}
9831 @opindex masm=@var{dialect}
9832 Output asm instructions using selected @var{dialect}.  Supported
9833 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9834 not support @samp{intel}.
9835
9836 @item -mieee-fp
9837 @itemx -mno-ieee-fp
9838 @opindex mieee-fp
9839 @opindex mno-ieee-fp
9840 Control whether or not the compiler uses IEEE floating point
9841 comparisons.  These handle correctly the case where the result of a
9842 comparison is unordered.
9843
9844 @item -msoft-float
9845 @opindex msoft-float
9846 Generate output containing library calls for floating point.
9847 @strong{Warning:} the requisite libraries are not part of GCC@.
9848 Normally the facilities of the machine's usual C compiler are used, but
9849 this can't be done directly in cross-compilation.  You must make your
9850 own arrangements to provide suitable library functions for
9851 cross-compilation.
9852
9853 On machines where a function returns floating point results in the 80387
9854 register stack, some floating point opcodes may be emitted even if
9855 @option{-msoft-float} is used.
9856
9857 @item -mno-fp-ret-in-387
9858 @opindex mno-fp-ret-in-387
9859 Do not use the FPU registers for return values of functions.
9860
9861 The usual calling convention has functions return values of types
9862 @code{float} and @code{double} in an FPU register, even if there
9863 is no FPU@.  The idea is that the operating system should emulate
9864 an FPU@.
9865
9866 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9867 in ordinary CPU registers instead.
9868
9869 @item -mno-fancy-math-387
9870 @opindex mno-fancy-math-387
9871 Some 387 emulators do not support the @code{sin}, @code{cos} and
9872 @code{sqrt} instructions for the 387.  Specify this option to avoid
9873 generating those instructions.  This option is the default on FreeBSD,
9874 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9875 indicates that the target cpu will always have an FPU and so the
9876 instruction will not need emulation.  As of revision 2.6.1, these
9877 instructions are not generated unless you also use the
9878 @option{-funsafe-math-optimizations} switch.
9879
9880 @item -malign-double
9881 @itemx -mno-align-double
9882 @opindex malign-double
9883 @opindex mno-align-double
9884 Control whether GCC aligns @code{double}, @code{long double}, and
9885 @code{long long} variables on a two word boundary or a one word
9886 boundary.  Aligning @code{double} variables on a two word boundary will
9887 produce code that runs somewhat faster on a @samp{Pentium} at the
9888 expense of more memory.
9889
9890 On x86-64, @option{-malign-double} is enabled by default.
9891
9892 @strong{Warning:} if you use the @option{-malign-double} switch,
9893 structures containing the above types will be aligned differently than
9894 the published application binary interface specifications for the 386
9895 and will not be binary compatible with structures in code compiled
9896 without that switch.
9897
9898 @item -m96bit-long-double
9899 @itemx -m128bit-long-double
9900 @opindex m96bit-long-double
9901 @opindex m128bit-long-double
9902 These switches control the size of @code{long double} type.  The i386
9903 application binary interface specifies the size to be 96 bits,
9904 so @option{-m96bit-long-double} is the default in 32 bit mode.
9905
9906 Modern architectures (Pentium and newer) would prefer @code{long double}
9907 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9908 conforming to the ABI, this would not be possible.  So specifying a
9909 @option{-m128bit-long-double} will align @code{long double}
9910 to a 16 byte boundary by padding the @code{long double} with an additional
9911 32 bit zero.
9912
9913 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9914 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9915
9916 Notice that neither of these options enable any extra precision over the x87
9917 standard of 80 bits for a @code{long double}.
9918
9919 @strong{Warning:} if you override the default value for your target ABI, the
9920 structures and arrays containing @code{long double} variables will change
9921 their size as well as function calling convention for function taking
9922 @code{long double} will be modified.  Hence they will not be binary
9923 compatible with arrays or structures in code compiled without that switch.
9924
9925 @item -mmlarge-data-threshold=@var{number}
9926 @opindex mlarge-data-threshold=@var{number}
9927 When @option{-mcmodel=medium} is specified, the data greater than
9928 @var{threshold} are placed in large data section.  This value must be the
9929 same across all object linked into the binary and defaults to 65535.
9930
9931 @item -msvr3-shlib
9932 @itemx -mno-svr3-shlib
9933 @opindex msvr3-shlib
9934 @opindex mno-svr3-shlib
9935 Control whether GCC places uninitialized local variables into the
9936 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9937 into @code{bss}.  These options are meaningful only on System V Release 3.
9938
9939 @item -mrtd
9940 @opindex mrtd
9941 Use a different function-calling convention, in which functions that
9942 take a fixed number of arguments return with the @code{ret} @var{num}
9943 instruction, which pops their arguments while returning.  This saves one
9944 instruction in the caller since there is no need to pop the arguments
9945 there.
9946
9947 You can specify that an individual function is called with this calling
9948 sequence with the function attribute @samp{stdcall}.  You can also
9949 override the @option{-mrtd} option by using the function attribute
9950 @samp{cdecl}.  @xref{Function Attributes}.
9951
9952 @strong{Warning:} this calling convention is incompatible with the one
9953 normally used on Unix, so you cannot use it if you need to call
9954 libraries compiled with the Unix compiler.
9955
9956 Also, you must provide function prototypes for all functions that
9957 take variable numbers of arguments (including @code{printf});
9958 otherwise incorrect code will be generated for calls to those
9959 functions.
9960
9961 In addition, seriously incorrect code will result if you call a
9962 function with too many arguments.  (Normally, extra arguments are
9963 harmlessly ignored.)
9964
9965 @item -mregparm=@var{num}
9966 @opindex mregparm
9967 Control how many registers are used to pass integer arguments.  By
9968 default, no registers are used to pass arguments, and at most 3
9969 registers can be used.  You can control this behavior for a specific
9970 function by using the function attribute @samp{regparm}.
9971 @xref{Function Attributes}.
9972
9973 @strong{Warning:} if you use this switch, and
9974 @var{num} is nonzero, then you must build all modules with the same
9975 value, including any libraries.  This includes the system libraries and
9976 startup modules.
9977
9978 @item -msseregparm
9979 @opindex msseregparm
9980 Use SSE register passing conventions for float and double arguments
9981 and return values.  You can control this behavior for a specific
9982 function by using the function attribute @samp{sseregparm}.
9983 @xref{Function Attributes}.
9984
9985 @strong{Warning:} if you use this switch then you must build all
9986 modules with the same value, including any libraries.  This includes
9987 the system libraries and startup modules.
9988
9989 @item -mstackrealign
9990 @opindex mstackrealign
9991 Realign the stack at entry.  On the Intel x86, the
9992 @option{-mstackrealign} option will generate an alternate prologue and
9993 epilogue that realigns the runtime stack.  This supports mixing legacy
9994 codes that keep a 4-byte aligned stack with modern codes that keep a
9995 16-byte stack for SSE compatibility.  The alternate prologue and
9996 epilogue are slower and bigger than the regular ones, and the
9997 alternate prologue requires an extra scratch register; this lowers the
9998 number of registers available if used in conjunction with the
9999 @code{regparm} attribute.  The @option{-mstackrealign} option is
10000 incompatible with the nested function prologue; this is considered a
10001 hard error.  See also the attribute @code{force_align_arg_pointer},
10002 applicable to individual functions.
10003
10004 @item -mpreferred-stack-boundary=@var{num}
10005 @opindex mpreferred-stack-boundary
10006 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10007 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10008 the default is 4 (16 bytes or 128 bits).
10009
10010 On Pentium and PentiumPro, @code{double} and @code{long double} values
10011 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10012 suffer significant run time performance penalties.  On Pentium III, the
10013 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10014 properly if it is not 16 byte aligned.
10015
10016 To ensure proper alignment of this values on the stack, the stack boundary
10017 must be as aligned as that required by any value stored on the stack.
10018 Further, every function must be generated such that it keeps the stack
10019 aligned.  Thus calling a function compiled with a higher preferred
10020 stack boundary from a function compiled with a lower preferred stack
10021 boundary will most likely misalign the stack.  It is recommended that
10022 libraries that use callbacks always use the default setting.
10023
10024 This extra alignment does consume extra stack space, and generally
10025 increases code size.  Code that is sensitive to stack space usage, such
10026 as embedded systems and operating system kernels, may want to reduce the
10027 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10028
10029 @item -mmmx
10030 @itemx -mno-mmx
10031 @item -msse
10032 @itemx -mno-sse
10033 @item -msse2
10034 @itemx -mno-sse2
10035 @item -msse3
10036 @itemx -mno-sse3
10037 @item -mssse3
10038 @itemx -mno-ssse3
10039 @item -msse4a
10040 @item -mno-sse4a
10041 @item -m3dnow
10042 @itemx -mno-3dnow
10043 @item -mpopcnt
10044 @itemx -mno-popcnt
10045 @item -mabm
10046 @itemx -mno-abm
10047 @opindex mmmx
10048 @opindex mno-mmx
10049 @opindex msse
10050 @opindex mno-sse
10051 @opindex m3dnow
10052 @opindex mno-3dnow
10053 These switches enable or disable the use of instructions in the MMX,
10054 SSE, SSE2, SSE3, SSSE3, SSE4A, ABM or 3DNow! extended instruction sets.
10055 These extensions are also available as built-in functions: see
10056 @ref{X86 Built-in Functions}, for details of the functions enabled and
10057 disabled by these switches.
10058
10059 To have SSE/SSE2 instructions generated automatically from floating-point
10060 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10061
10062 These options will enable GCC to use these extended instructions in
10063 generated code, even without @option{-mfpmath=sse}.  Applications which
10064 perform runtime CPU detection must compile separate files for each
10065 supported architecture, using the appropriate flags.  In particular,
10066 the file containing the CPU detection code should be compiled without
10067 these options.
10068
10069 @item -mpush-args
10070 @itemx -mno-push-args
10071 @opindex mpush-args
10072 @opindex mno-push-args
10073 Use PUSH operations to store outgoing parameters.  This method is shorter
10074 and usually equally fast as method using SUB/MOV operations and is enabled
10075 by default.  In some cases disabling it may improve performance because of
10076 improved scheduling and reduced dependencies.
10077
10078 @item -maccumulate-outgoing-args
10079 @opindex maccumulate-outgoing-args
10080 If enabled, the maximum amount of space required for outgoing arguments will be
10081 computed in the function prologue.  This is faster on most modern CPUs
10082 because of reduced dependencies, improved scheduling and reduced stack usage
10083 when preferred stack boundary is not equal to 2.  The drawback is a notable
10084 increase in code size.  This switch implies @option{-mno-push-args}.
10085
10086 @item -mthreads
10087 @opindex mthreads
10088 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
10089 on thread-safe exception handling must compile and link all code with the
10090 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
10091 @option{-D_MT}; when linking, it links in a special thread helper library
10092 @option{-lmingwthrd} which cleans up per thread exception handling data.
10093
10094 @item -mno-align-stringops
10095 @opindex mno-align-stringops
10096 Do not align destination of inlined string operations.  This switch reduces
10097 code size and improves performance in case the destination is already aligned,
10098 but GCC doesn't know about it.
10099
10100 @item -minline-all-stringops
10101 @opindex minline-all-stringops
10102 By default GCC inlines string operations only when destination is known to be
10103 aligned at least to 4 byte boundary.  This enables more inlining, increase code
10104 size, but may improve performance of code that depends on fast memcpy, strlen
10105 and memset for short lengths.
10106
10107 @item -minline-stringops-dynamically
10108 @opindex minline-stringops-dynamically
10109 For string operation of unknown size, inline runtime checks so for small
10110 blocks inline code is used, while for large blocks library call is used.
10111
10112 @item -mstringop-strategy=@var{alg}
10113 @opindex mstringop-strategy=@var{alg}
10114 Overwrite internal decision heuristic about particular algorithm to inline
10115 string operation with.  The allowed values are @code{rep_byte},
10116 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
10117 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
10118 expanding inline loop, @code{libcall} for always expanding library call.
10119
10120 @item -momit-leaf-frame-pointer
10121 @opindex momit-leaf-frame-pointer
10122 Don't keep the frame pointer in a register for leaf functions.  This
10123 avoids the instructions to save, set up and restore frame pointers and
10124 makes an extra register available in leaf functions.  The option
10125 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10126 which might make debugging harder.
10127
10128 @item -mtls-direct-seg-refs
10129 @itemx -mno-tls-direct-seg-refs
10130 @opindex mtls-direct-seg-refs
10131 Controls whether TLS variables may be accessed with offsets from the
10132 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
10133 or whether the thread base pointer must be added.  Whether or not this
10134 is legal depends on the operating system, and whether it maps the
10135 segment to cover the entire TLS area.
10136
10137 For systems that use GNU libc, the default is on.
10138 @end table
10139
10140 These @samp{-m} switches are supported in addition to the above
10141 on AMD x86-64 processors in 64-bit environments.
10142
10143 @table @gcctabopt
10144 @item -m32
10145 @itemx -m64
10146 @opindex m32
10147 @opindex m64
10148 Generate code for a 32-bit or 64-bit environment.
10149 The 32-bit environment sets int, long and pointer to 32 bits and
10150 generates code that runs on any i386 system.
10151 The 64-bit environment sets int to 32 bits and long and pointer
10152 to 64 bits and generates code for AMD's x86-64 architecture.
10153
10154 @item -mno-red-zone
10155 @opindex no-red-zone
10156 Do not use a so called red zone for x86-64 code.  The red zone is mandated
10157 by the x86-64 ABI, it is a 128-byte area beyond the location of the
10158 stack pointer that will not be modified by signal or interrupt handlers
10159 and therefore can be used for temporary data without adjusting the stack
10160 pointer.  The flag @option{-mno-red-zone} disables this red zone.
10161
10162 @item -mcmodel=small
10163 @opindex mcmodel=small
10164 Generate code for the small code model: the program and its symbols must
10165 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
10166 Programs can be statically or dynamically linked.  This is the default
10167 code model.
10168
10169 @item -mcmodel=kernel
10170 @opindex mcmodel=kernel
10171 Generate code for the kernel code model.  The kernel runs in the
10172 negative 2 GB of the address space.
10173 This model has to be used for Linux kernel code.
10174
10175 @item -mcmodel=medium
10176 @opindex mcmodel=medium
10177 Generate code for the medium model: The program is linked in the lower 2
10178 GB of the address space but symbols can be located anywhere in the
10179 address space.  Programs can be statically or dynamically linked, but
10180 building of shared libraries are not supported with the medium model.
10181
10182 @item -mcmodel=large
10183 @opindex mcmodel=large
10184 Generate code for the large model: This model makes no assumptions
10185 about addresses and sizes of sections.  
10186 @end table
10187
10188 @node IA-64 Options
10189 @subsection IA-64 Options
10190 @cindex IA-64 Options
10191
10192 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10193
10194 @table @gcctabopt
10195 @item -mbig-endian
10196 @opindex mbig-endian
10197 Generate code for a big endian target.  This is the default for HP-UX@.
10198
10199 @item -mlittle-endian
10200 @opindex mlittle-endian
10201 Generate code for a little endian target.  This is the default for AIX5
10202 and GNU/Linux.
10203
10204 @item -mgnu-as
10205 @itemx -mno-gnu-as
10206 @opindex mgnu-as
10207 @opindex mno-gnu-as
10208 Generate (or don't) code for the GNU assembler.  This is the default.
10209 @c Also, this is the default if the configure option @option{--with-gnu-as}
10210 @c is used.
10211
10212 @item -mgnu-ld
10213 @itemx -mno-gnu-ld
10214 @opindex mgnu-ld
10215 @opindex mno-gnu-ld
10216 Generate (or don't) code for the GNU linker.  This is the default.
10217 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10218 @c is used.
10219
10220 @item -mno-pic
10221 @opindex mno-pic
10222 Generate code that does not use a global pointer register.  The result
10223 is not position independent code, and violates the IA-64 ABI@.
10224
10225 @item -mvolatile-asm-stop
10226 @itemx -mno-volatile-asm-stop
10227 @opindex mvolatile-asm-stop
10228 @opindex mno-volatile-asm-stop
10229 Generate (or don't) a stop bit immediately before and after volatile asm
10230 statements.
10231
10232 @item -mregister-names
10233 @itemx -mno-register-names
10234 @opindex mregister-names
10235 @opindex mno-register-names
10236 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10237 the stacked registers.  This may make assembler output more readable.
10238
10239 @item -mno-sdata
10240 @itemx -msdata
10241 @opindex mno-sdata
10242 @opindex msdata
10243 Disable (or enable) optimizations that use the small data section.  This may
10244 be useful for working around optimizer bugs.
10245
10246 @item -mconstant-gp
10247 @opindex mconstant-gp
10248 Generate code that uses a single constant global pointer value.  This is
10249 useful when compiling kernel code.
10250
10251 @item -mauto-pic
10252 @opindex mauto-pic
10253 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10254 This is useful when compiling firmware code.
10255
10256 @item -minline-float-divide-min-latency
10257 @opindex minline-float-divide-min-latency
10258 Generate code for inline divides of floating point values
10259 using the minimum latency algorithm.
10260
10261 @item -minline-float-divide-max-throughput
10262 @opindex minline-float-divide-max-throughput
10263 Generate code for inline divides of floating point values
10264 using the maximum throughput algorithm.
10265
10266 @item -minline-int-divide-min-latency
10267 @opindex minline-int-divide-min-latency
10268 Generate code for inline divides of integer values
10269 using the minimum latency algorithm.
10270
10271 @item -minline-int-divide-max-throughput
10272 @opindex minline-int-divide-max-throughput
10273 Generate code for inline divides of integer values
10274 using the maximum throughput algorithm.
10275
10276 @item -minline-sqrt-min-latency
10277 @opindex minline-sqrt-min-latency
10278 Generate code for inline square roots
10279 using the minimum latency algorithm.
10280
10281 @item -minline-sqrt-max-throughput
10282 @opindex minline-sqrt-max-throughput
10283 Generate code for inline square roots
10284 using the maximum throughput algorithm.
10285
10286 @item -mno-dwarf2-asm
10287 @itemx -mdwarf2-asm
10288 @opindex mno-dwarf2-asm
10289 @opindex mdwarf2-asm
10290 Don't (or do) generate assembler code for the DWARF2 line number debugging
10291 info.  This may be useful when not using the GNU assembler.
10292
10293 @item -mearly-stop-bits
10294 @itemx -mno-early-stop-bits
10295 @opindex mearly-stop-bits
10296 @opindex mno-early-stop-bits
10297 Allow stop bits to be placed earlier than immediately preceding the
10298 instruction that triggered the stop bit.  This can improve instruction
10299 scheduling, but does not always do so.
10300
10301 @item -mfixed-range=@var{register-range}
10302 @opindex mfixed-range
10303 Generate code treating the given register range as fixed registers.
10304 A fixed register is one that the register allocator can not use.  This is
10305 useful when compiling kernel code.  A register range is specified as
10306 two registers separated by a dash.  Multiple register ranges can be
10307 specified separated by a comma.
10308
10309 @item -mtls-size=@var{tls-size}
10310 @opindex mtls-size
10311 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10312 64.
10313
10314 @item -mtune=@var{cpu-type}
10315 @opindex mtune
10316 Tune the instruction scheduling for a particular CPU, Valid values are
10317 itanium, itanium1, merced, itanium2, and mckinley.
10318
10319 @item -mt
10320 @itemx -pthread
10321 @opindex mt
10322 @opindex pthread
10323 Add support for multithreading using the POSIX threads library.  This
10324 option sets flags for both the preprocessor and linker.  It does
10325 not affect the thread safety of object code produced by the compiler or
10326 that of libraries supplied with it.  These are HP-UX specific flags.
10327
10328 @item -milp32
10329 @itemx -mlp64
10330 @opindex milp32
10331 @opindex mlp64
10332 Generate code for a 32-bit or 64-bit environment.
10333 The 32-bit environment sets int, long and pointer to 32 bits.
10334 The 64-bit environment sets int to 32 bits and long and pointer
10335 to 64 bits.  These are HP-UX specific flags.
10336
10337 @item -mno-sched-br-data-spec
10338 @itemx -msched-br-data-spec
10339 @opindex -mno-sched-br-data-spec
10340 @opindex -msched-br-data-spec
10341 (Dis/En)able data speculative scheduling before reload.
10342 This will result in generation of the ld.a instructions and
10343 the corresponding check instructions (ld.c / chk.a).
10344 The default is 'disable'.
10345
10346 @item -msched-ar-data-spec
10347 @itemx -mno-sched-ar-data-spec
10348 @opindex -msched-ar-data-spec
10349 @opindex -mno-sched-ar-data-spec
10350 (En/Dis)able data speculative scheduling after reload.
10351 This will result in generation of the ld.a instructions and
10352 the corresponding check instructions (ld.c / chk.a).
10353 The default is 'enable'.
10354
10355 @item -mno-sched-control-spec
10356 @itemx -msched-control-spec
10357 @opindex -mno-sched-control-spec
10358 @opindex -msched-control-spec
10359 (Dis/En)able control speculative scheduling.  This feature is
10360 available only during region scheduling (i.e. before reload).
10361 This will result in generation of the ld.s instructions and
10362 the corresponding check instructions chk.s .
10363 The default is 'disable'.
10364
10365 @item -msched-br-in-data-spec
10366 @itemx -mno-sched-br-in-data-spec
10367 @opindex -msched-br-in-data-spec
10368 @opindex -mno-sched-br-in-data-spec
10369 (En/Dis)able speculative scheduling of the instructions that
10370 are dependent on the data speculative loads before reload.
10371 This is effective only with @option{-msched-br-data-spec} enabled.
10372 The default is 'enable'.
10373
10374 @item -msched-ar-in-data-spec
10375 @itemx -mno-sched-ar-in-data-spec
10376 @opindex -msched-ar-in-data-spec
10377 @opindex -mno-sched-ar-in-data-spec
10378 (En/Dis)able speculative scheduling of the instructions that
10379 are dependent on the data speculative loads after reload.
10380 This is effective only with @option{-msched-ar-data-spec} enabled.
10381 The default is 'enable'.
10382
10383 @item -msched-in-control-spec
10384 @itemx -mno-sched-in-control-spec
10385 @opindex -msched-in-control-spec
10386 @opindex -mno-sched-in-control-spec
10387 (En/Dis)able speculative scheduling of the instructions that
10388 are dependent on the control speculative loads.
10389 This is effective only with @option{-msched-control-spec} enabled.
10390 The default is 'enable'.
10391
10392 @item -msched-ldc
10393 @itemx -mno-sched-ldc
10394 @opindex -msched-ldc
10395 @opindex -mno-sched-ldc
10396 (En/Dis)able use of simple data speculation checks ld.c .
10397 If disabled, only chk.a instructions will be emitted to check
10398 data speculative loads.
10399 The default is 'enable'.
10400
10401 @item -mno-sched-control-ldc
10402 @itemx -msched-control-ldc
10403 @opindex -mno-sched-control-ldc
10404 @opindex -msched-control-ldc 
10405 (Dis/En)able use of ld.c instructions to check control speculative loads.
10406 If enabled, in case of control speculative load with no speculatively
10407 scheduled dependent instructions this load will be emitted as ld.sa and
10408 ld.c will be used to check it.
10409 The default is 'disable'.
10410
10411 @item -mno-sched-spec-verbose
10412 @itemx -msched-spec-verbose
10413 @opindex -mno-sched-spec-verbose
10414 @opindex -msched-spec-verbose
10415 (Dis/En)able printing of the information about speculative motions.
10416
10417 @item -mno-sched-prefer-non-data-spec-insns
10418 @itemx -msched-prefer-non-data-spec-insns
10419 @opindex -mno-sched-prefer-non-data-spec-insns
10420 @opindex -msched-prefer-non-data-spec-insns
10421 If enabled, data speculative instructions will be chosen for schedule
10422 only if there are no other choices at the moment.  This will make
10423 the use of the data speculation much more conservative.
10424 The default is 'disable'.
10425
10426 @item -mno-sched-prefer-non-control-spec-insns
10427 @itemx -msched-prefer-non-control-spec-insns
10428 @opindex -mno-sched-prefer-non-control-spec-insns
10429 @opindex -msched-prefer-non-control-spec-insns
10430 If enabled, control speculative instructions will be chosen for schedule
10431 only if there are no other choices at the moment.  This will make
10432 the use of the control speculation much more conservative.
10433 The default is 'disable'.
10434
10435 @item -mno-sched-count-spec-in-critical-path
10436 @itemx -msched-count-spec-in-critical-path
10437 @opindex -mno-sched-count-spec-in-critical-path
10438 @opindex -msched-count-spec-in-critical-path
10439 If enabled, speculative dependencies will be considered during
10440 computation of the instructions priorities.  This will make the use of the
10441 speculation a bit more conservative.
10442 The default is 'disable'.
10443
10444 @end table
10445
10446 @node M32C Options
10447 @subsection M32C Options
10448 @cindex M32C options
10449
10450 @table @gcctabopt
10451 @item -mcpu=@var{name}
10452 @opindex mcpu=
10453 Select the CPU for which code is generated.  @var{name} may be one of
10454 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10455 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10456 the M32C/80 series.
10457
10458 @item -msim
10459 @opindex msim
10460 Specifies that the program will be run on the simulator.  This causes
10461 an alternate runtime library to be linked in which supports, for
10462 example, file I/O.  You must not use this option when generating
10463 programs that will run on real hardware; you must provide your own
10464 runtime library for whatever I/O functions are needed.
10465
10466 @item -memregs=@var{number}
10467 @opindex memregs=
10468 Specifies the number of memory-based pseudo-registers GCC will use
10469 during code generation.  These pseudo-registers will be used like real
10470 registers, so there is a tradeoff between GCC's ability to fit the
10471 code into available registers, and the performance penalty of using
10472 memory instead of registers.  Note that all modules in a program must
10473 be compiled with the same value for this option.  Because of that, you
10474 must not use this option with the default runtime libraries gcc
10475 builds.
10476
10477 @end table
10478
10479 @node M32R/D Options
10480 @subsection M32R/D Options
10481 @cindex M32R/D options
10482
10483 These @option{-m} options are defined for Renesas M32R/D architectures:
10484
10485 @table @gcctabopt
10486 @item -m32r2
10487 @opindex m32r2
10488 Generate code for the M32R/2@.
10489
10490 @item -m32rx
10491 @opindex m32rx
10492 Generate code for the M32R/X@.
10493
10494 @item -m32r
10495 @opindex m32r
10496 Generate code for the M32R@.  This is the default.
10497
10498 @item -mmodel=small
10499 @opindex mmodel=small
10500 Assume all objects live in the lower 16MB of memory (so that their addresses
10501 can be loaded with the @code{ld24} instruction), and assume all subroutines
10502 are reachable with the @code{bl} instruction.
10503 This is the default.
10504
10505 The addressability of a particular object can be set with the
10506 @code{model} attribute.
10507
10508 @item -mmodel=medium
10509 @opindex mmodel=medium
10510 Assume objects may be anywhere in the 32-bit address space (the compiler
10511 will generate @code{seth/add3} instructions to load their addresses), and
10512 assume all subroutines are reachable with the @code{bl} instruction.
10513
10514 @item -mmodel=large
10515 @opindex mmodel=large
10516 Assume objects may be anywhere in the 32-bit address space (the compiler
10517 will generate @code{seth/add3} instructions to load their addresses), and
10518 assume subroutines may not be reachable with the @code{bl} instruction
10519 (the compiler will generate the much slower @code{seth/add3/jl}
10520 instruction sequence).
10521
10522 @item -msdata=none
10523 @opindex msdata=none
10524 Disable use of the small data area.  Variables will be put into
10525 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10526 @code{section} attribute has been specified).
10527 This is the default.
10528
10529 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10530 Objects may be explicitly put in the small data area with the
10531 @code{section} attribute using one of these sections.
10532
10533 @item -msdata=sdata
10534 @opindex msdata=sdata
10535 Put small global and static data in the small data area, but do not
10536 generate special code to reference them.
10537
10538 @item -msdata=use
10539 @opindex msdata=use
10540 Put small global and static data in the small data area, and generate
10541 special instructions to reference them.
10542
10543 @item -G @var{num}
10544 @opindex G
10545 @cindex smaller data references
10546 Put global and static objects less than or equal to @var{num} bytes
10547 into the small data or bss sections instead of the normal data or bss
10548 sections.  The default value of @var{num} is 8.
10549 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10550 for this option to have any effect.
10551
10552 All modules should be compiled with the same @option{-G @var{num}} value.
10553 Compiling with different values of @var{num} may or may not work; if it
10554 doesn't the linker will give an error message---incorrect code will not be
10555 generated.
10556
10557 @item -mdebug
10558 @opindex mdebug
10559 Makes the M32R specific code in the compiler display some statistics
10560 that might help in debugging programs.
10561
10562 @item -malign-loops
10563 @opindex malign-loops
10564 Align all loops to a 32-byte boundary.
10565
10566 @item -mno-align-loops
10567 @opindex mno-align-loops
10568 Do not enforce a 32-byte alignment for loops.  This is the default.
10569
10570 @item -missue-rate=@var{number}
10571 @opindex missue-rate=@var{number}
10572 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10573 or 2.
10574
10575 @item -mbranch-cost=@var{number}
10576 @opindex mbranch-cost=@var{number}
10577 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10578 preferred over conditional code, if it is 2, then the opposite will
10579 apply.
10580
10581 @item -mflush-trap=@var{number}
10582 @opindex mflush-trap=@var{number}
10583 Specifies the trap number to use to flush the cache.  The default is
10584 12.  Valid numbers are between 0 and 15 inclusive.
10585
10586 @item -mno-flush-trap
10587 @opindex mno-flush-trap
10588 Specifies that the cache cannot be flushed by using a trap.
10589
10590 @item -mflush-func=@var{name}
10591 @opindex mflush-func=@var{name}
10592 Specifies the name of the operating system function to call to flush
10593 the cache.  The default is @emph{_flush_cache}, but a function call
10594 will only be used if a trap is not available.
10595
10596 @item -mno-flush-func
10597 @opindex mno-flush-func
10598 Indicates that there is no OS function for flushing the cache.
10599
10600 @end table
10601
10602 @node M680x0 Options
10603 @subsection M680x0 Options
10604 @cindex M680x0 options
10605
10606 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
10607 The default settings depend on which architecture was selected when
10608 the compiler was configured; the defaults for the most common choices
10609 are given below.
10610
10611 @table @gcctabopt
10612 @item -march=@var{arch}
10613 @opindex march
10614 Generate code for a specific M680x0 or ColdFire instruction set
10615 architecture.  Permissible values of @var{arch} for M680x0
10616 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
10617 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
10618 architectures are selected according to Freescale's ISA classification
10619 and the permissible values are: @samp{isaa}, @samp{isaaplus},
10620 @samp{isab} and @samp{isac}.
10621
10622 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
10623 code for a ColdFire target.  The @var{arch} in this macro is one of the
10624 @option{-march} arguments given above.
10625
10626 When used together, @option{-march} and @option{-mtune} select code
10627 that runs on a family of similar processors but that is optimized
10628 for a particular microarchitecture.
10629
10630 @item -mcpu=@var{cpu}
10631 @opindex mcpu
10632 Generate code for a specific M680x0 or ColdFire processor.
10633 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
10634 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
10635 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
10636 below, which also classifies the CPUs into families:
10637
10638 @multitable @columnfractions 0.20 0.80
10639 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
10640 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
10641 @item @samp{5206e} @tab @samp{5206e}
10642 @item @samp{5208} @tab @samp{5207} @samp{5208}
10643 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
10644 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
10645 @item @samp{5216} @tab @samp{5214} @samp{5216}
10646 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
10647 @item @samp{5225} @tab @samp{5224} @samp{5225}
10648 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
10649 @item @samp{5249} @tab @samp{5249}
10650 @item @samp{5250} @tab @samp{5250}
10651 @item @samp{5271} @tab @samp{5270} @samp{5271}
10652 @item @samp{5272} @tab @samp{5272}
10653 @item @samp{5275} @tab @samp{5274} @samp{5275}
10654 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
10655 @item @samp{5307} @tab @samp{5307}
10656 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
10657 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
10658 @item @samp{5407} @tab @samp{5407}
10659 @item @samp{5475} @tab @samp{5470} @samp{5471} @samp{5472} @samp{5473} @samp{5474} @samp{5475} @samp{547x} @samp{5480} @samp{5481} @samp{5482} @samp{5483} @samp{5484} @samp{5485}
10660 @end multitable
10661
10662 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
10663 @var{arch} is compatible with @var{cpu}.  Other combinations of
10664 @option{-mcpu} and @option{-march} are rejected.
10665
10666 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
10667 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
10668 where the value of @var{family} is given by the table above.
10669
10670 @item -mtune=@var{tune}
10671 @opindex mtune
10672 Tune the code for a particular microarchitecture, within the
10673 constraints set by @option{-march} and @option{-mcpu}.
10674 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
10675 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
10676 and @samp{cpu32}.  The ColdFire microarchitectures
10677 are: @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
10678
10679 You can also use @option{-mtune=68020-40} for code that needs
10680 to run relatively well on 68020, 68030 and 68040 targets.
10681 @option{-mtune=68020-60} is similar but includes 68060 targets
10682 as well.  These two options select the same tuning decisions as
10683 @option{-m68020-40} and @option{-m68020-60} respectively.
10684
10685 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
10686 when tuning for 680x0 architecture @var{arch}.  It also defines
10687 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
10688 option is used.  If gcc is tuning for a range of architectures,
10689 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
10690 it defines the macros for every architecture in the range.
10691
10692 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
10693 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
10694 of the arguments given above.
10695
10696 @item -m68000
10697 @itemx -mc68000
10698 @opindex m68000
10699 @opindex mc68000
10700 Generate output for a 68000.  This is the default
10701 when the compiler is configured for 68000-based systems.
10702 It is equivalent to @option{-march=68000}.
10703
10704 Use this option for microcontrollers with a 68000 or EC000 core,
10705 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10706
10707 @item -m68010
10708 @opindex m68010
10709 Generate output for a 68010.  This is the default
10710 when the compiler is configured for 68010-based systems.
10711 It is equivalent to @option{-march=68010}.
10712
10713 @item -m68020
10714 @itemx -mc68020
10715 @opindex m68020
10716 @opindex mc68020
10717 Generate output for a 68020.  This is the default
10718 when the compiler is configured for 68020-based systems.
10719 It is equivalent to @option{-march=68020}.
10720
10721 @item -m68030
10722 @opindex m68030
10723 Generate output for a 68030.  This is the default when the compiler is
10724 configured for 68030-based systems.  It is equivalent to
10725 @option{-march=68030}.
10726
10727 @item -m68040
10728 @opindex m68040
10729 Generate output for a 68040.  This is the default when the compiler is
10730 configured for 68040-based systems.  It is equivalent to
10731 @option{-march=68040}.
10732
10733 This option inhibits the use of 68881/68882 instructions that have to be
10734 emulated by software on the 68040.  Use this option if your 68040 does not
10735 have code to emulate those instructions.
10736
10737 @item -m68060
10738 @opindex m68060
10739 Generate output for a 68060.  This is the default when the compiler is
10740 configured for 68060-based systems.  It is equivalent to
10741 @option{-march=68060}.
10742
10743 This option inhibits the use of 68020 and 68881/68882 instructions that
10744 have to be emulated by software on the 68060.  Use this option if your 68060
10745 does not have code to emulate those instructions.
10746
10747 @item -mcpu32
10748 @opindex mcpu32
10749 Generate output for a CPU32.  This is the default
10750 when the compiler is configured for CPU32-based systems.
10751 It is equivalent to @option{-march=cpu32}.
10752
10753 Use this option for microcontrollers with a
10754 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
10755 68336, 68340, 68341, 68349 and 68360.
10756
10757 @item -m5200
10758 @opindex m5200
10759 Generate output for a 520X ColdFire CPU.  This is the default
10760 when the compiler is configured for 520X-based systems.
10761 It is equivalent to @option{-mcpu=5206}, and is now deprecated
10762 in favor of that option.
10763
10764 Use this option for microcontroller with a 5200 core, including
10765 the MCF5202, MCF5203, MCF5204 and MCF5206.
10766
10767 @item -m5206e
10768 @opindex m5206e
10769 Generate output for a 5206e ColdFire CPU.  The option is now
10770 deprecated in favor of the equivalent @option{-mcpu=5206e}.
10771
10772 @item -m528x
10773 @opindex m528x
10774 Generate output for a member of the ColdFire 528X family.
10775 The option is now deprecated in favor of the equivalent
10776 @option{-mcpu=528x}.
10777
10778 @item -m5307
10779 @opindex m5307
10780 Generate output for a ColdFire 5307 CPU.  The option is now deprecated
10781 in favor of the equivalent @option{-mcpu=5307}.
10782
10783 @item -m5407
10784 @opindex m5407
10785 Generate output for a ColdFire 5407 CPU.  The option is now deprecated
10786 in favor of the equivalent @option{-mcpu=5407}.
10787
10788 @item -mcfv4e
10789 @opindex mcfv4e
10790 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
10791 This includes use of hardware floating point instructions.
10792 The option is equivalent to @option{-mcpu=547x}, and is now
10793 deprecated in favor of that option.
10794
10795 @item -m68020-40
10796 @opindex m68020-40
10797 Generate output for a 68040, without using any of the new instructions.
10798 This results in code which can run relatively efficiently on either a
10799 68020/68881 or a 68030 or a 68040.  The generated code does use the
10800 68881 instructions that are emulated on the 68040.
10801
10802 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
10803
10804 @item -m68020-60
10805 @opindex m68020-60
10806 Generate output for a 68060, without using any of the new instructions.
10807 This results in code which can run relatively efficiently on either a
10808 68020/68881 or a 68030 or a 68040.  The generated code does use the
10809 68881 instructions that are emulated on the 68060.
10810
10811 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
10812
10813 @item -mhard-float
10814 @itemx -m68881
10815 @opindex mhard-float
10816 @opindex m68881
10817 Generate floating-point instructions.  This is the default for 68020
10818 and above, and for ColdFire devices that have an FPU.  It defines the
10819 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
10820 on ColdFire targets.
10821
10822 @item -msoft-float
10823 @opindex msoft-float
10824 Do not generate floating-point instructions; use library calls instead.
10825 This is the default for 68000, 68010, and 68832 targets.  It is also
10826 the default for ColdFire devices that have no FPU.
10827
10828 @item -mdiv
10829 @itemx -mno-div
10830 @opindex mdiv
10831 @opindex mno-div
10832 Generate (do not generate) ColdFire hardware divide and remainder
10833 instructions.  If @option{-march} is used without @option{-mcpu},
10834 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
10835 architectures.  Otherwise, the default is taken from the target CPU
10836 (either the default CPU, or the one specified by @option{-mcpu}).  For
10837 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
10838 @option{-mcpu=5206e}.
10839
10840 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
10841
10842 @item -mshort
10843 @opindex mshort
10844 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10845 Additionally, parameters passed on the stack are also aligned to a
10846 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10847
10848 @item -mno-short
10849 @opindex -mno-short
10850 Do not consider type @code{int} to be 16 bits wide.  This is the default.
10851
10852 @item -mnobitfield
10853 @itemx -mno-bitfield
10854 @opindex mnobitfield
10855 @opindex mno-bitfield
10856 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10857 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10858
10859 @item -mbitfield
10860 @opindex mbitfield
10861 Do use the bit-field instructions.  The @option{-m68020} option implies
10862 @option{-mbitfield}.  This is the default if you use a configuration
10863 designed for a 68020.
10864
10865 @item -mrtd
10866 @opindex mrtd
10867 Use a different function-calling convention, in which functions
10868 that take a fixed number of arguments return with the @code{rtd}
10869 instruction, which pops their arguments while returning.  This
10870 saves one instruction in the caller since there is no need to pop
10871 the arguments there.
10872
10873 This calling convention is incompatible with the one normally
10874 used on Unix, so you cannot use it if you need to call libraries
10875 compiled with the Unix compiler.
10876
10877 Also, you must provide function prototypes for all functions that
10878 take variable numbers of arguments (including @code{printf});
10879 otherwise incorrect code will be generated for calls to those
10880 functions.
10881
10882 In addition, seriously incorrect code will result if you call a
10883 function with too many arguments.  (Normally, extra arguments are
10884 harmlessly ignored.)
10885
10886 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10887 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10888
10889 @item -mno-rtd
10890 @opindex mno-rtd
10891 Do not use the calling conventions selected by @option{-mrtd}.
10892 This is the default.
10893
10894 @item -malign-int
10895 @itemx -mno-align-int
10896 @opindex malign-int
10897 @opindex mno-align-int
10898 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10899 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10900 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10901 Aligning variables on 32-bit boundaries produces code that runs somewhat
10902 faster on processors with 32-bit busses at the expense of more memory.
10903
10904 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
10905 align structures containing the above types  differently than
10906 most published application binary interface specifications for the m68k.
10907
10908 @item -mpcrel
10909 @opindex mpcrel
10910 Use the pc-relative addressing mode of the 68000 directly, instead of
10911 using a global offset table.  At present, this option implies @option{-fpic},
10912 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
10913 not presently supported with @option{-mpcrel}, though this could be supported for
10914 68020 and higher processors.
10915
10916 @item -mno-strict-align
10917 @itemx -mstrict-align
10918 @opindex mno-strict-align
10919 @opindex mstrict-align
10920 Do not (do) assume that unaligned memory references will be handled by
10921 the system.
10922
10923 @item -msep-data
10924 Generate code that allows the data segment to be located in a different
10925 area of memory from the text segment.  This allows for execute in place in
10926 an environment without virtual memory management.  This option implies
10927 @option{-fPIC}.
10928
10929 @item -mno-sep-data
10930 Generate code that assumes that the data segment follows the text segment.
10931 This is the default.
10932
10933 @item -mid-shared-library
10934 Generate code that supports shared libraries via the library ID method.
10935 This allows for execute in place and shared libraries in an environment
10936 without virtual memory management.  This option implies @option{-fPIC}.
10937
10938 @item -mno-id-shared-library
10939 Generate code that doesn't assume ID based shared libraries are being used.
10940 This is the default.
10941
10942 @item -mshared-library-id=n
10943 Specified the identification number of the ID based shared library being
10944 compiled.  Specifying a value of 0 will generate more compact code, specifying
10945 other values will force the allocation of that number to the current
10946 library but is no more space or time efficient than omitting this option.
10947
10948 @end table
10949
10950 @node M68hc1x Options
10951 @subsection M68hc1x Options
10952 @cindex M68hc1x options
10953
10954 These are the @samp{-m} options defined for the 68hc11 and 68hc12
10955 microcontrollers.  The default values for these options depends on
10956 which style of microcontroller was selected when the compiler was configured;
10957 the defaults for the most common choices are given below.
10958
10959 @table @gcctabopt
10960 @item -m6811
10961 @itemx -m68hc11
10962 @opindex m6811
10963 @opindex m68hc11
10964 Generate output for a 68HC11.  This is the default
10965 when the compiler is configured for 68HC11-based systems.
10966
10967 @item -m6812
10968 @itemx -m68hc12
10969 @opindex m6812
10970 @opindex m68hc12
10971 Generate output for a 68HC12.  This is the default
10972 when the compiler is configured for 68HC12-based systems.
10973
10974 @item -m68S12
10975 @itemx -m68hcs12
10976 @opindex m68S12
10977 @opindex m68hcs12
10978 Generate output for a 68HCS12.
10979
10980 @item -mauto-incdec
10981 @opindex mauto-incdec
10982 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
10983 addressing modes.
10984
10985 @item -minmax
10986 @itemx -nominmax
10987 @opindex minmax
10988 @opindex mnominmax
10989 Enable the use of 68HC12 min and max instructions.
10990
10991 @item -mlong-calls
10992 @itemx -mno-long-calls
10993 @opindex mlong-calls
10994 @opindex mno-long-calls
10995 Treat all calls as being far away (near).  If calls are assumed to be
10996 far away, the compiler will use the @code{call} instruction to
10997 call a function and the @code{rtc} instruction for returning.
10998
10999 @item -mshort
11000 @opindex mshort
11001 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11002
11003 @item -msoft-reg-count=@var{count}
11004 @opindex msoft-reg-count
11005 Specify the number of pseudo-soft registers which are used for the
11006 code generation.  The maximum number is 32.  Using more pseudo-soft
11007 register may or may not result in better code depending on the program.
11008 The default is 4 for 68HC11 and 2 for 68HC12.
11009
11010 @end table
11011
11012 @node MCore Options
11013 @subsection MCore Options
11014 @cindex MCore options
11015
11016 These are the @samp{-m} options defined for the Motorola M*Core
11017 processors.
11018
11019 @table @gcctabopt
11020
11021 @item -mhardlit
11022 @itemx -mno-hardlit
11023 @opindex mhardlit
11024 @opindex mno-hardlit
11025 Inline constants into the code stream if it can be done in two
11026 instructions or less.
11027
11028 @item -mdiv
11029 @itemx -mno-div
11030 @opindex mdiv
11031 @opindex mno-div
11032 Use the divide instruction.  (Enabled by default).
11033
11034 @item -mrelax-immediate
11035 @itemx -mno-relax-immediate
11036 @opindex mrelax-immediate
11037 @opindex mno-relax-immediate
11038 Allow arbitrary sized immediates in bit operations.
11039
11040 @item -mwide-bitfields
11041 @itemx -mno-wide-bitfields
11042 @opindex mwide-bitfields
11043 @opindex mno-wide-bitfields
11044 Always treat bit-fields as int-sized.
11045
11046 @item -m4byte-functions
11047 @itemx -mno-4byte-functions
11048 @opindex m4byte-functions
11049 @opindex mno-4byte-functions
11050 Force all functions to be aligned to a four byte boundary.
11051
11052 @item -mcallgraph-data
11053 @itemx -mno-callgraph-data
11054 @opindex mcallgraph-data
11055 @opindex mno-callgraph-data
11056 Emit callgraph information.
11057
11058 @item -mslow-bytes
11059 @itemx -mno-slow-bytes
11060 @opindex mslow-bytes
11061 @opindex mno-slow-bytes
11062 Prefer word access when reading byte quantities.
11063
11064 @item -mlittle-endian
11065 @itemx -mbig-endian
11066 @opindex mlittle-endian
11067 @opindex mbig-endian
11068 Generate code for a little endian target.
11069
11070 @item -m210
11071 @itemx -m340
11072 @opindex m210
11073 @opindex m340
11074 Generate code for the 210 processor.
11075 @end table
11076
11077 @node MIPS Options
11078 @subsection MIPS Options
11079 @cindex MIPS options
11080
11081 @table @gcctabopt
11082
11083 @item -EB
11084 @opindex EB
11085 Generate big-endian code.
11086
11087 @item -EL
11088 @opindex EL
11089 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
11090 configurations.
11091
11092 @item -march=@var{arch}
11093 @opindex march
11094 Generate code that will run on @var{arch}, which can be the name of a
11095 generic MIPS ISA, or the name of a particular processor.
11096 The ISA names are:
11097 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
11098 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
11099 The processor names are:
11100 @samp{4kc}, @samp{4km}, @samp{4kp},
11101 @samp{4kec}, @samp{4kem}, @samp{4kep},
11102 @samp{5kc}, @samp{5kf},
11103 @samp{20kc},
11104 @samp{24kc}, @samp{24kf}, @samp{24kx},
11105 @samp{24kec}, @samp{24kef}, @samp{24kex},
11106 @samp{34kc}, @samp{34kf}, @samp{34kx},
11107 @samp{m4k},
11108 @samp{orion},
11109 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
11110 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
11111 @samp{rm7000}, @samp{rm9000},
11112 @samp{sb1},
11113 @samp{sr71000},
11114 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
11115 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
11116 The special value @samp{from-abi} selects the
11117 most compatible architecture for the selected ABI (that is,
11118 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
11119
11120 In processor names, a final @samp{000} can be abbreviated as @samp{k}
11121 (for example, @samp{-march=r2k}).  Prefixes are optional, and
11122 @samp{vr} may be written @samp{r}.
11123
11124 GCC defines two macros based on the value of this option.  The first
11125 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
11126 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
11127 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
11128 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
11129 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
11130
11131 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
11132 above.  In other words, it will have the full prefix and will not
11133 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
11134 the macro names the resolved architecture (either @samp{"mips1"} or
11135 @samp{"mips3"}).  It names the default architecture when no
11136 @option{-march} option is given.
11137
11138 @item -mtune=@var{arch}
11139 @opindex mtune
11140 Optimize for @var{arch}.  Among other things, this option controls
11141 the way instructions are scheduled, and the perceived cost of arithmetic
11142 operations.  The list of @var{arch} values is the same as for
11143 @option{-march}.
11144
11145 When this option is not used, GCC will optimize for the processor
11146 specified by @option{-march}.  By using @option{-march} and
11147 @option{-mtune} together, it is possible to generate code that will
11148 run on a family of processors, but optimize the code for one
11149 particular member of that family.
11150
11151 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
11152 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
11153 @samp{-march} ones described above.
11154
11155 @item -mips1
11156 @opindex mips1
11157 Equivalent to @samp{-march=mips1}.
11158
11159 @item -mips2
11160 @opindex mips2
11161 Equivalent to @samp{-march=mips2}.
11162
11163 @item -mips3
11164 @opindex mips3
11165 Equivalent to @samp{-march=mips3}.
11166
11167 @item -mips4
11168 @opindex mips4
11169 Equivalent to @samp{-march=mips4}.
11170
11171 @item -mips32
11172 @opindex mips32
11173 Equivalent to @samp{-march=mips32}.
11174
11175 @item -mips32r2
11176 @opindex mips32r2
11177 Equivalent to @samp{-march=mips32r2}.
11178
11179 @item -mips64
11180 @opindex mips64
11181 Equivalent to @samp{-march=mips64}.
11182
11183 @item -mips16
11184 @itemx -mno-mips16
11185 @opindex mips16
11186 @opindex mno-mips16
11187 Generate (do not generate) MIPS16 code.  If GCC is targetting a
11188 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
11189
11190 @item -mabi=32
11191 @itemx -mabi=o64
11192 @itemx -mabi=n32
11193 @itemx -mabi=64
11194 @itemx -mabi=eabi
11195 @opindex mabi=32
11196 @opindex mabi=o64
11197 @opindex mabi=n32
11198 @opindex mabi=64
11199 @opindex mabi=eabi
11200 Generate code for the given ABI@.
11201
11202 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
11203 generates 64-bit code when you select a 64-bit architecture, but you
11204 can use @option{-mgp32} to get 32-bit code instead.
11205
11206 For information about the O64 ABI, see
11207 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
11208
11209 GCC supports a variant of the o32 ABI in which floating-point registers
11210 are 64 rather than 32 bits wide.  You can select this combination with
11211 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
11212 and @samp{mfhc1} instructions and is therefore only supported for
11213 MIPS32R2 processors.
11214
11215 The register assignments for arguments and return values remain the
11216 same, but each scalar value is passed in a single 64-bit register
11217 rather than a pair of 32-bit registers.  For example, scalar
11218 floating-point values are returned in @samp{$f0} only, not a
11219 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
11220 remains the same, but all 64 bits are saved.
11221
11222 @item -mabicalls
11223 @itemx -mno-abicalls
11224 @opindex mabicalls
11225 @opindex mno-abicalls
11226 Generate (do not generate) code that is suitable for SVR4-style
11227 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
11228 systems.
11229
11230 @item -mshared
11231 @itemx -mno-shared
11232 Generate (do not generate) code that is fully position-independent,
11233 and that can therefore be linked into shared libraries.  This option
11234 only affects @option{-mabicalls}.
11235
11236 All @option{-mabicalls} code has traditionally been position-independent,
11237 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
11238 as an extension, the GNU toolchain allows executables to use absolute
11239 accesses for locally-binding symbols.  It can also use shorter GP
11240 initialization sequences and generate direct calls to locally-defined
11241 functions.  This mode is selected by @option{-mno-shared}.
11242
11243 @option{-mno-shared} depends on binutils 2.16 or higher and generates
11244 objects that can only be linked by the GNU linker.  However, the option
11245 does not affect the ABI of the final executable; it only affects the ABI
11246 of relocatable objects.  Using @option{-mno-shared} will generally make
11247 executables both smaller and quicker.
11248
11249 @option{-mshared} is the default.
11250
11251 @item -mxgot
11252 @itemx -mno-xgot
11253 @opindex mxgot
11254 @opindex mno-xgot
11255 Lift (do not lift) the usual restrictions on the size of the global
11256 offset table.
11257
11258 GCC normally uses a single instruction to load values from the GOT@.
11259 While this is relatively efficient, it will only work if the GOT
11260 is smaller than about 64k.  Anything larger will cause the linker
11261 to report an error such as:
11262
11263 @cindex relocation truncated to fit (MIPS)
11264 @smallexample
11265 relocation truncated to fit: R_MIPS_GOT16 foobar
11266 @end smallexample
11267
11268 If this happens, you should recompile your code with @option{-mxgot}.
11269 It should then work with very large GOTs, although it will also be
11270 less efficient, since it will take three instructions to fetch the
11271 value of a global symbol.
11272
11273 Note that some linkers can create multiple GOTs.  If you have such a
11274 linker, you should only need to use @option{-mxgot} when a single object
11275 file accesses more than 64k's worth of GOT entries.  Very few do.
11276
11277 These options have no effect unless GCC is generating position
11278 independent code.
11279
11280 @item -mgp32
11281 @opindex mgp32
11282 Assume that general-purpose registers are 32 bits wide.
11283
11284 @item -mgp64
11285 @opindex mgp64
11286 Assume that general-purpose registers are 64 bits wide.
11287
11288 @item -mfp32
11289 @opindex mfp32
11290 Assume that floating-point registers are 32 bits wide.
11291
11292 @item -mfp64
11293 @opindex mfp64
11294 Assume that floating-point registers are 64 bits wide.
11295
11296 @item -mhard-float
11297 @opindex mhard-float
11298 Use floating-point coprocessor instructions.
11299
11300 @item -msoft-float
11301 @opindex msoft-float
11302 Do not use floating-point coprocessor instructions.  Implement
11303 floating-point calculations using library calls instead.
11304
11305 @item -msingle-float
11306 @opindex msingle-float
11307 Assume that the floating-point coprocessor only supports single-precision
11308 operations.
11309
11310 @itemx -mdouble-float
11311 @opindex mdouble-float
11312 Assume that the floating-point coprocessor supports double-precision
11313 operations.  This is the default.
11314
11315 @itemx -mdsp
11316 @itemx -mno-dsp
11317 @opindex mdsp
11318 @opindex mno-dsp
11319 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
11320
11321 @itemx -mdspr2
11322 @itemx -mno-dspr2
11323 @opindex mdspr2
11324 @opindex mno-dspr2
11325 Use (do not use) the MIPS DSP ASE REV 2.  @xref{MIPS DSP Built-in Functions}.
11326 The option @option{-mdspr2} implies @option{-mdsp}.
11327
11328 @itemx -mpaired-single
11329 @itemx -mno-paired-single
11330 @opindex mpaired-single
11331 @opindex mno-paired-single
11332 Use (do not use) paired-single floating-point instructions.
11333 @xref{MIPS Paired-Single Support}.  This option can only be used
11334 when generating 64-bit code and requires hardware floating-point
11335 support to be enabled.
11336
11337 @itemx -mips3d
11338 @itemx -mno-mips3d
11339 @opindex mips3d
11340 @opindex mno-mips3d
11341 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
11342 The option @option{-mips3d} implies @option{-mpaired-single}.
11343
11344 @item -mlong64
11345 @opindex mlong64
11346 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
11347 an explanation of the default and the way that the pointer size is
11348 determined.
11349
11350 @item -mlong32
11351 @opindex mlong32
11352 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
11353
11354 The default size of @code{int}s, @code{long}s and pointers depends on
11355 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
11356 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
11357 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
11358 or the same size as integer registers, whichever is smaller.
11359
11360 @item -msym32
11361 @itemx -mno-sym32
11362 @opindex msym32
11363 @opindex mno-sym32
11364 Assume (do not assume) that all symbols have 32-bit values, regardless
11365 of the selected ABI@.  This option is useful in combination with
11366 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11367 to generate shorter and faster references to symbolic addresses.
11368
11369 @item -G @var{num}
11370 @opindex G
11371 @cindex smaller data references (MIPS)
11372 @cindex gp-relative references (MIPS)
11373 Put global and static items less than or equal to @var{num} bytes into
11374 the small data or bss section instead of the normal data or bss section.
11375 This allows the data to be accessed using a single instruction.
11376
11377 All modules should be compiled with the same @option{-G @var{num}}
11378 value.
11379
11380 @item -membedded-data
11381 @itemx -mno-embedded-data
11382 @opindex membedded-data
11383 @opindex mno-embedded-data
11384 Allocate variables to the read-only data section first if possible, then
11385 next in the small data section if possible, otherwise in data.  This gives
11386 slightly slower code than the default, but reduces the amount of RAM required
11387 when executing, and thus may be preferred for some embedded systems.
11388
11389 @item -muninit-const-in-rodata
11390 @itemx -mno-uninit-const-in-rodata
11391 @opindex muninit-const-in-rodata
11392 @opindex mno-uninit-const-in-rodata
11393 Put uninitialized @code{const} variables in the read-only data section.
11394 This option is only meaningful in conjunction with @option{-membedded-data}.
11395
11396 @item -msplit-addresses
11397 @itemx -mno-split-addresses
11398 @opindex msplit-addresses
11399 @opindex mno-split-addresses
11400 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
11401 relocation operators.  This option has been superseded by
11402 @option{-mexplicit-relocs} but is retained for backwards compatibility.
11403
11404 @item -mexplicit-relocs
11405 @itemx -mno-explicit-relocs
11406 @opindex mexplicit-relocs
11407 @opindex mno-explicit-relocs
11408 Use (do not use) assembler relocation operators when dealing with symbolic
11409 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
11410 is to use assembler macros instead.
11411
11412 @option{-mexplicit-relocs} is the default if GCC was configured
11413 to use an assembler that supports relocation operators.
11414
11415 @item -mcheck-zero-division
11416 @itemx -mno-check-zero-division
11417 @opindex mcheck-zero-division
11418 @opindex mno-check-zero-division
11419 Trap (do not trap) on integer division by zero.
11420
11421 The default is @option{-mcheck-zero-division}.
11422
11423 @item -mdivide-traps
11424 @itemx -mdivide-breaks
11425 @opindex mdivide-traps
11426 @opindex mdivide-breaks
11427 MIPS systems check for division by zero by generating either a
11428 conditional trap or a break instruction.  Using traps results in
11429 smaller code, but is only supported on MIPS II and later.  Also, some
11430 versions of the Linux kernel have a bug that prevents trap from
11431 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
11432 allow conditional traps on architectures that support them and
11433 @option{-mdivide-breaks} to force the use of breaks.
11434
11435 The default is usually @option{-mdivide-traps}, but this can be
11436 overridden at configure time using @option{--with-divide=breaks}.
11437 Divide-by-zero checks can be completely disabled using
11438 @option{-mno-check-zero-division}.
11439
11440 @item -mmemcpy
11441 @itemx -mno-memcpy
11442 @opindex mmemcpy
11443 @opindex mno-memcpy
11444 Force (do not force) the use of @code{memcpy()} for non-trivial block
11445 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
11446 most constant-sized copies.
11447
11448 @item -mlong-calls
11449 @itemx -mno-long-calls
11450 @opindex mlong-calls
11451 @opindex mno-long-calls
11452 Disable (do not disable) use of the @code{jal} instruction.  Calling
11453 functions using @code{jal} is more efficient but requires the caller
11454 and callee to be in the same 256 megabyte segment.
11455
11456 This option has no effect on abicalls code.  The default is
11457 @option{-mno-long-calls}.
11458
11459 @item -mmad
11460 @itemx -mno-mad
11461 @opindex mmad
11462 @opindex mno-mad
11463 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
11464 instructions, as provided by the R4650 ISA@.
11465
11466 @item -mfused-madd
11467 @itemx -mno-fused-madd
11468 @opindex mfused-madd
11469 @opindex mno-fused-madd
11470 Enable (disable) use of the floating point multiply-accumulate
11471 instructions, when they are available.  The default is
11472 @option{-mfused-madd}.
11473
11474 When multiply-accumulate instructions are used, the intermediate
11475 product is calculated to infinite precision and is not subject to
11476 the FCSR Flush to Zero bit.  This may be undesirable in some
11477 circumstances.
11478
11479 @item -nocpp
11480 @opindex nocpp
11481 Tell the MIPS assembler to not run its preprocessor over user
11482 assembler files (with a @samp{.s} suffix) when assembling them.
11483
11484 @item -mfix-r4000
11485 @itemx -mno-fix-r4000
11486 @opindex mfix-r4000
11487 @opindex mno-fix-r4000
11488 Work around certain R4000 CPU errata:
11489 @itemize @minus
11490 @item
11491 A double-word or a variable shift may give an incorrect result if executed
11492 immediately after starting an integer division.
11493 @item
11494 A double-word or a variable shift may give an incorrect result if executed
11495 while an integer multiplication is in progress.
11496 @item
11497 An integer division may give an incorrect result if started in a delay slot
11498 of a taken branch or a jump.
11499 @end itemize
11500
11501 @item -mfix-r4400
11502 @itemx -mno-fix-r4400
11503 @opindex mfix-r4400
11504 @opindex mno-fix-r4400
11505 Work around certain R4400 CPU errata:
11506 @itemize @minus
11507 @item
11508 A double-word or a variable shift may give an incorrect result if executed
11509 immediately after starting an integer division.
11510 @end itemize
11511
11512 @item -mfix-vr4120
11513 @itemx -mno-fix-vr4120
11514 @opindex mfix-vr4120
11515 Work around certain VR4120 errata:
11516 @itemize @minus
11517 @item
11518 @code{dmultu} does not always produce the correct result.
11519 @item
11520 @code{div} and @code{ddiv} do not always produce the correct result if one
11521 of the operands is negative.
11522 @end itemize
11523 The workarounds for the division errata rely on special functions in
11524 @file{libgcc.a}.  At present, these functions are only provided by
11525 the @code{mips64vr*-elf} configurations.
11526
11527 Other VR4120 errata require a nop to be inserted between certain pairs of
11528 instructions.  These errata are handled by the assembler, not by GCC itself.
11529
11530 @item -mfix-vr4130
11531 @opindex mfix-vr4130
11532 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11533 workarounds are implemented by the assembler rather than by GCC,
11534 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11535 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11536 instructions are available instead.
11537
11538 @item -mfix-sb1
11539 @itemx -mno-fix-sb1
11540 @opindex mfix-sb1
11541 Work around certain SB-1 CPU core errata.
11542 (This flag currently works around the SB-1 revision 2
11543 ``F1'' and ``F2'' floating point errata.)
11544
11545 @item -mflush-func=@var{func}
11546 @itemx -mno-flush-func
11547 @opindex mflush-func
11548 Specifies the function to call to flush the I and D caches, or to not
11549 call any such function.  If called, the function must take the same
11550 arguments as the common @code{_flush_func()}, that is, the address of the
11551 memory range for which the cache is being flushed, the size of the
11552 memory range, and the number 3 (to flush both caches).  The default
11553 depends on the target GCC was configured for, but commonly is either
11554 @samp{_flush_func} or @samp{__cpu_flush}.
11555
11556 @item -mbranch-likely
11557 @itemx -mno-branch-likely
11558 @opindex mbranch-likely
11559 @opindex mno-branch-likely
11560 Enable or disable use of Branch Likely instructions, regardless of the
11561 default for the selected architecture.  By default, Branch Likely
11562 instructions may be generated if they are supported by the selected
11563 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11564 and processors which implement those architectures; for those, Branch
11565 Likely instructions will not be generated by default because the MIPS32
11566 and MIPS64 architectures specifically deprecate their use.
11567
11568 @item -mfp-exceptions
11569 @itemx -mno-fp-exceptions
11570 @opindex mfp-exceptions
11571 Specifies whether FP exceptions are enabled.  This affects how we schedule
11572 FP instructions for some processors.  The default is that FP exceptions are
11573 enabled.
11574
11575 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11576 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11577 FP pipe.
11578
11579 @item -mvr4130-align
11580 @itemx -mno-vr4130-align
11581 @opindex mvr4130-align
11582 The VR4130 pipeline is two-way superscalar, but can only issue two
11583 instructions together if the first one is 8-byte aligned.  When this
11584 option is enabled, GCC will align pairs of instructions that it
11585 thinks should execute in parallel.
11586
11587 This option only has an effect when optimizing for the VR4130.
11588 It normally makes code faster, but at the expense of making it bigger.
11589 It is enabled by default at optimization level @option{-O3}.
11590 @end table
11591
11592 @node MMIX Options
11593 @subsection MMIX Options
11594 @cindex MMIX Options
11595
11596 These options are defined for the MMIX:
11597
11598 @table @gcctabopt
11599 @item -mlibfuncs
11600 @itemx -mno-libfuncs
11601 @opindex mlibfuncs
11602 @opindex mno-libfuncs
11603 Specify that intrinsic library functions are being compiled, passing all
11604 values in registers, no matter the size.
11605
11606 @item -mepsilon
11607 @itemx -mno-epsilon
11608 @opindex mepsilon
11609 @opindex mno-epsilon
11610 Generate floating-point comparison instructions that compare with respect
11611 to the @code{rE} epsilon register.
11612
11613 @item -mabi=mmixware
11614 @itemx -mabi=gnu
11615 @opindex mabi-mmixware
11616 @opindex mabi=gnu
11617 Generate code that passes function parameters and return values that (in
11618 the called function) are seen as registers @code{$0} and up, as opposed to
11619 the GNU ABI which uses global registers @code{$231} and up.
11620
11621 @item -mzero-extend
11622 @itemx -mno-zero-extend
11623 @opindex mzero-extend
11624 @opindex mno-zero-extend
11625 When reading data from memory in sizes shorter than 64 bits, use (do not
11626 use) zero-extending load instructions by default, rather than
11627 sign-extending ones.
11628
11629 @item -mknuthdiv
11630 @itemx -mno-knuthdiv
11631 @opindex mknuthdiv
11632 @opindex mno-knuthdiv
11633 Make the result of a division yielding a remainder have the same sign as
11634 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11635 remainder follows the sign of the dividend.  Both methods are
11636 arithmetically valid, the latter being almost exclusively used.
11637
11638 @item -mtoplevel-symbols
11639 @itemx -mno-toplevel-symbols
11640 @opindex mtoplevel-symbols
11641 @opindex mno-toplevel-symbols
11642 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11643 code can be used with the @code{PREFIX} assembly directive.
11644
11645 @item -melf
11646 @opindex melf
11647 Generate an executable in the ELF format, rather than the default
11648 @samp{mmo} format used by the @command{mmix} simulator.
11649
11650 @item -mbranch-predict
11651 @itemx -mno-branch-predict
11652 @opindex mbranch-predict
11653 @opindex mno-branch-predict
11654 Use (do not use) the probable-branch instructions, when static branch
11655 prediction indicates a probable branch.
11656
11657 @item -mbase-addresses
11658 @itemx -mno-base-addresses
11659 @opindex mbase-addresses
11660 @opindex mno-base-addresses
11661 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11662 base address automatically generates a request (handled by the assembler
11663 and the linker) for a constant to be set up in a global register.  The
11664 register is used for one or more base address requests within the range 0
11665 to 255 from the value held in the register.  The generally leads to short
11666 and fast code, but the number of different data items that can be
11667 addressed is limited.  This means that a program that uses lots of static
11668 data may require @option{-mno-base-addresses}.
11669
11670 @item -msingle-exit
11671 @itemx -mno-single-exit
11672 @opindex msingle-exit
11673 @opindex mno-single-exit
11674 Force (do not force) generated code to have a single exit point in each
11675 function.
11676 @end table
11677
11678 @node MN10300 Options
11679 @subsection MN10300 Options
11680 @cindex MN10300 options
11681
11682 These @option{-m} options are defined for Matsushita MN10300 architectures:
11683
11684 @table @gcctabopt
11685 @item -mmult-bug
11686 @opindex mmult-bug
11687 Generate code to avoid bugs in the multiply instructions for the MN10300
11688 processors.  This is the default.
11689
11690 @item -mno-mult-bug
11691 @opindex mno-mult-bug
11692 Do not generate code to avoid bugs in the multiply instructions for the
11693 MN10300 processors.
11694
11695 @item -mam33
11696 @opindex mam33
11697 Generate code which uses features specific to the AM33 processor.
11698
11699 @item -mno-am33
11700 @opindex mno-am33
11701 Do not generate code which uses features specific to the AM33 processor.  This
11702 is the default.
11703
11704 @item -mreturn-pointer-on-d0
11705 @opindex mreturn-pointer-on-d0
11706 When generating a function which returns a pointer, return the pointer
11707 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11708 only in a0, and attempts to call such functions without a prototype
11709 would result in errors.  Note that this option is on by default; use
11710 @option{-mno-return-pointer-on-d0} to disable it.
11711
11712 @item -mno-crt0
11713 @opindex mno-crt0
11714 Do not link in the C run-time initialization object file.
11715
11716 @item -mrelax
11717 @opindex mrelax
11718 Indicate to the linker that it should perform a relaxation optimization pass
11719 to shorten branches, calls and absolute memory addresses.  This option only
11720 has an effect when used on the command line for the final link step.
11721
11722 This option makes symbolic debugging impossible.
11723 @end table
11724
11725 @node MT Options
11726 @subsection MT Options
11727 @cindex MT options
11728
11729 These @option{-m} options are defined for Morpho MT architectures:
11730
11731 @table @gcctabopt
11732
11733 @item -march=@var{cpu-type}
11734 @opindex march
11735 Generate code that will run on @var{cpu-type}, which is the name of a system
11736 representing a certain processor type.  Possible values for
11737 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
11738 @samp{ms1-16-003} and @samp{ms2}.
11739
11740 When this option is not used, the default is @option{-march=ms1-16-002}.
11741
11742 @item -mbacc
11743 @opindex mbacc
11744 Use byte loads and stores when generating code.
11745
11746 @item -mno-bacc
11747 @opindex mno-bacc
11748 Do not use byte loads and stores when generating code.
11749
11750 @item -msim
11751 @opindex msim
11752 Use simulator runtime
11753
11754 @item -mno-crt0
11755 @opindex mno-crt0
11756 Do not link in the C run-time initialization object file
11757 @file{crti.o}.  Other run-time initialization and termination files
11758 such as @file{startup.o} and @file{exit.o} are still included on the
11759 linker command line.
11760
11761 @end table
11762
11763 @node PDP-11 Options
11764 @subsection PDP-11 Options
11765 @cindex PDP-11 Options
11766
11767 These options are defined for the PDP-11:
11768
11769 @table @gcctabopt
11770 @item -mfpu
11771 @opindex mfpu
11772 Use hardware FPP floating point.  This is the default.  (FIS floating
11773 point on the PDP-11/40 is not supported.)
11774
11775 @item -msoft-float
11776 @opindex msoft-float
11777 Do not use hardware floating point.
11778
11779 @item -mac0
11780 @opindex mac0
11781 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
11782
11783 @item -mno-ac0
11784 @opindex mno-ac0
11785 Return floating-point results in memory.  This is the default.
11786
11787 @item -m40
11788 @opindex m40
11789 Generate code for a PDP-11/40.
11790
11791 @item -m45
11792 @opindex m45
11793 Generate code for a PDP-11/45.  This is the default.
11794
11795 @item -m10
11796 @opindex m10
11797 Generate code for a PDP-11/10.
11798
11799 @item -mbcopy-builtin
11800 @opindex bcopy-builtin
11801 Use inline @code{movmemhi} patterns for copying memory.  This is the
11802 default.
11803
11804 @item -mbcopy
11805 @opindex mbcopy
11806 Do not use inline @code{movmemhi} patterns for copying memory.
11807
11808 @item -mint16
11809 @itemx -mno-int32
11810 @opindex mint16
11811 @opindex mno-int32
11812 Use 16-bit @code{int}.  This is the default.
11813
11814 @item -mint32
11815 @itemx -mno-int16
11816 @opindex mint32
11817 @opindex mno-int16
11818 Use 32-bit @code{int}.
11819
11820 @item -mfloat64
11821 @itemx -mno-float32
11822 @opindex mfloat64
11823 @opindex mno-float32
11824 Use 64-bit @code{float}.  This is the default.
11825
11826 @item -mfloat32
11827 @itemx -mno-float64
11828 @opindex mfloat32
11829 @opindex mno-float64
11830 Use 32-bit @code{float}.
11831
11832 @item -mabshi
11833 @opindex mabshi
11834 Use @code{abshi2} pattern.  This is the default.
11835
11836 @item -mno-abshi
11837 @opindex mno-abshi
11838 Do not use @code{abshi2} pattern.
11839
11840 @item -mbranch-expensive
11841 @opindex mbranch-expensive
11842 Pretend that branches are expensive.  This is for experimenting with
11843 code generation only.
11844
11845 @item -mbranch-cheap
11846 @opindex mbranch-cheap
11847 Do not pretend that branches are expensive.  This is the default.
11848
11849 @item -msplit
11850 @opindex msplit
11851 Generate code for a system with split I&D@.
11852
11853 @item -mno-split
11854 @opindex mno-split
11855 Generate code for a system without split I&D@.  This is the default.
11856
11857 @item -munix-asm
11858 @opindex munix-asm
11859 Use Unix assembler syntax.  This is the default when configured for
11860 @samp{pdp11-*-bsd}.
11861
11862 @item -mdec-asm
11863 @opindex mdec-asm
11864 Use DEC assembler syntax.  This is the default when configured for any
11865 PDP-11 target other than @samp{pdp11-*-bsd}.
11866 @end table
11867
11868 @node PowerPC Options
11869 @subsection PowerPC Options
11870 @cindex PowerPC options
11871
11872 These are listed under @xref{RS/6000 and PowerPC Options}.
11873
11874 @node RS/6000 and PowerPC Options
11875 @subsection IBM RS/6000 and PowerPC Options
11876 @cindex RS/6000 and PowerPC Options
11877 @cindex IBM RS/6000 and PowerPC Options
11878
11879 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11880 @table @gcctabopt
11881 @item -mpower
11882 @itemx -mno-power
11883 @itemx -mpower2
11884 @itemx -mno-power2
11885 @itemx -mpowerpc
11886 @itemx -mno-powerpc
11887 @itemx -mpowerpc-gpopt
11888 @itemx -mno-powerpc-gpopt
11889 @itemx -mpowerpc-gfxopt
11890 @itemx -mno-powerpc-gfxopt
11891 @itemx -mpowerpc64
11892 @itemx -mno-powerpc64
11893 @itemx -mmfcrf
11894 @itemx -mno-mfcrf
11895 @itemx -mpopcntb
11896 @itemx -mno-popcntb
11897 @itemx -mfprnd
11898 @itemx -mno-fprnd
11899 @itemx -mcmpb
11900 @itemx -mno-cmpb
11901 @itemx -mmfpgpr
11902 @itemx -mno-mfpgpr
11903 @itemx -mdfp
11904 @itemx -mno-dfp
11905 @opindex mpower
11906 @opindex mno-power
11907 @opindex mpower2
11908 @opindex mno-power2
11909 @opindex mpowerpc
11910 @opindex mno-powerpc
11911 @opindex mpowerpc-gpopt
11912 @opindex mno-powerpc-gpopt
11913 @opindex mpowerpc-gfxopt
11914 @opindex mno-powerpc-gfxopt
11915 @opindex mpowerpc64
11916 @opindex mno-powerpc64
11917 @opindex mmfcrf
11918 @opindex mno-mfcrf
11919 @opindex mpopcntb
11920 @opindex mno-popcntb
11921 @opindex mfprnd
11922 @opindex mno-fprnd
11923 @opindex mcmpb
11924 @opindex mno-cmpb
11925 @opindex mmfpgpr
11926 @opindex mno-mfpgpr
11927 @opindex mdfp
11928 @opindex mno-dfp
11929 GCC supports two related instruction set architectures for the
11930 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
11931 instructions supported by the @samp{rios} chip set used in the original
11932 RS/6000 systems and the @dfn{PowerPC} instruction set is the
11933 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
11934 the IBM 4xx, 6xx, and follow-on microprocessors.
11935
11936 Neither architecture is a subset of the other.  However there is a
11937 large common subset of instructions supported by both.  An MQ
11938 register is included in processors supporting the POWER architecture.
11939
11940 You use these options to specify which instructions are available on the
11941 processor you are using.  The default value of these options is
11942 determined when configuring GCC@.  Specifying the
11943 @option{-mcpu=@var{cpu_type}} overrides the specification of these
11944 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
11945 rather than the options listed above.
11946
11947 The @option{-mpower} option allows GCC to generate instructions that
11948 are found only in the POWER architecture and to use the MQ register.
11949 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
11950 to generate instructions that are present in the POWER2 architecture but
11951 not the original POWER architecture.
11952
11953 The @option{-mpowerpc} option allows GCC to generate instructions that
11954 are found only in the 32-bit subset of the PowerPC architecture.
11955 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
11956 GCC to use the optional PowerPC architecture instructions in the
11957 General Purpose group, including floating-point square root.  Specifying
11958 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
11959 use the optional PowerPC architecture instructions in the Graphics
11960 group, including floating-point select.
11961
11962 The @option{-mmfcrf} option allows GCC to generate the move from
11963 condition register field instruction implemented on the POWER4
11964 processor and other processors that support the PowerPC V2.01
11965 architecture.
11966 The @option{-mpopcntb} option allows GCC to generate the popcount and
11967 double precision FP reciprocal estimate instruction implemented on the
11968 POWER5 processor and other processors that support the PowerPC V2.02
11969 architecture.
11970 The @option{-mfprnd} option allows GCC to generate the FP round to
11971 integer instructions implemented on the POWER5+ processor and other
11972 processors that support the PowerPC V2.03 architecture.
11973 The @option{-mcmpb} option allows GCC to generate the compare bytes
11974 instruction implemented on the POWER6 processor and other processors
11975 that support the PowerPC V2.05 architecture.
11976 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
11977 general purpose register instructions implemented on the POWER6X
11978 processor and other processors that support the extended PowerPC V2.05
11979 architecture.
11980 The @option{-mdfp} option allows GCC to generate the decimal floating
11981 point instructions implemented on some POWER processors.
11982
11983 The @option{-mpowerpc64} option allows GCC to generate the additional
11984 64-bit instructions that are found in the full PowerPC64 architecture
11985 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
11986 @option{-mno-powerpc64}.
11987
11988 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
11989 will use only the instructions in the common subset of both
11990 architectures plus some special AIX common-mode calls, and will not use
11991 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
11992 permits GCC to use any instruction from either architecture and to
11993 allow use of the MQ register; specify this for the Motorola MPC601.
11994
11995 @item -mnew-mnemonics
11996 @itemx -mold-mnemonics
11997 @opindex mnew-mnemonics
11998 @opindex mold-mnemonics
11999 Select which mnemonics to use in the generated assembler code.  With
12000 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
12001 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
12002 assembler mnemonics defined for the POWER architecture.  Instructions
12003 defined in only one architecture have only one mnemonic; GCC uses that
12004 mnemonic irrespective of which of these options is specified.
12005
12006 GCC defaults to the mnemonics appropriate for the architecture in
12007 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
12008 value of these option.  Unless you are building a cross-compiler, you
12009 should normally not specify either @option{-mnew-mnemonics} or
12010 @option{-mold-mnemonics}, but should instead accept the default.
12011
12012 @item -mcpu=@var{cpu_type}
12013 @opindex mcpu
12014 Set architecture type, register usage, choice of mnemonics, and
12015 instruction scheduling parameters for machine type @var{cpu_type}.
12016 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
12017 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
12018 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
12019 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
12020 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
12021 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
12022 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
12023 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
12024 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
12025 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
12026
12027 @option{-mcpu=common} selects a completely generic processor.  Code
12028 generated under this option will run on any POWER or PowerPC processor.
12029 GCC will use only the instructions in the common subset of both
12030 architectures, and will not use the MQ register.  GCC assumes a generic
12031 processor model for scheduling purposes.
12032
12033 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
12034 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
12035 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
12036 types, with an appropriate, generic processor model assumed for
12037 scheduling purposes.
12038
12039 The other options specify a specific processor.  Code generated under
12040 those options will run best on that processor, and may not run at all on
12041 others.
12042
12043 The @option{-mcpu} options automatically enable or disable the
12044 following options:
12045
12046 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
12047 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
12048 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
12049
12050 The particular options set for any particular CPU will vary between
12051 compiler versions, depending on what setting seems to produce optimal
12052 code for that CPU; it doesn't necessarily reflect the actual hardware's
12053 capabilities.  If you wish to set an individual option to a particular
12054 value, you may specify it after the @option{-mcpu} option, like
12055 @samp{-mcpu=970 -mno-altivec}.
12056
12057 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
12058 not enabled or disabled by the @option{-mcpu} option at present because
12059 AIX does not have full support for these options.  You may still
12060 enable or disable them individually if you're sure it'll work in your
12061 environment.
12062
12063 @item -mtune=@var{cpu_type}
12064 @opindex mtune
12065 Set the instruction scheduling parameters for machine type
12066 @var{cpu_type}, but do not set the architecture type, register usage, or
12067 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
12068 values for @var{cpu_type} are used for @option{-mtune} as for
12069 @option{-mcpu}.  If both are specified, the code generated will use the
12070 architecture, registers, and mnemonics set by @option{-mcpu}, but the
12071 scheduling parameters set by @option{-mtune}.
12072
12073 @item -mswdiv
12074 @itemx -mno-swdiv
12075 @opindex mswdiv
12076 @opindex mno-swdiv
12077 Generate code to compute division as reciprocal estimate and iterative
12078 refinement, creating opportunities for increased throughput.  This
12079 feature requires: optional PowerPC Graphics instruction set for single
12080 precision and FRE instruction for double precision, assuming divides
12081 cannot generate user-visible traps, and the domain values not include
12082 Infinities, denormals or zero denominator.
12083
12084 @item -maltivec
12085 @itemx -mno-altivec
12086 @opindex maltivec
12087 @opindex mno-altivec
12088 Generate code that uses (does not use) AltiVec instructions, and also
12089 enable the use of built-in functions that allow more direct access to
12090 the AltiVec instruction set.  You may also need to set
12091 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
12092 enhancements.
12093
12094 @item -mvrsave
12095 @item -mno-vrsave
12096 @opindex mvrsave
12097 @opindex mno-vrsave
12098 Generate VRSAVE instructions when generating AltiVec code.
12099
12100 @item -msecure-plt
12101 @opindex msecure-plt
12102 Generate code that allows ld and ld.so to build executables and shared
12103 libraries with non-exec .plt and .got sections.  This is a PowerPC
12104 32-bit SYSV ABI option.
12105
12106 @item -mbss-plt
12107 @opindex mbss-plt
12108 Generate code that uses a BSS .plt section that ld.so fills in, and
12109 requires .plt and .got sections that are both writable and executable.
12110 This is a PowerPC 32-bit SYSV ABI option.
12111
12112 @item -misel
12113 @itemx -mno-isel
12114 @opindex misel
12115 @opindex mno-isel
12116 This switch enables or disables the generation of ISEL instructions.
12117
12118 @item -misel=@var{yes/no}
12119 This switch has been deprecated.  Use @option{-misel} and
12120 @option{-mno-isel} instead.
12121
12122 @item -mspe
12123 @itemx -mno-spe
12124 @opindex mspe
12125 @opindex mno-spe
12126 This switch enables or disables the generation of SPE simd
12127 instructions.
12128
12129 @item -mspe=@var{yes/no}
12130 This option has been deprecated.  Use @option{-mspe} and
12131 @option{-mno-spe} instead.
12132
12133 @item -mfloat-gprs=@var{yes/single/double/no}
12134 @itemx -mfloat-gprs
12135 @opindex mfloat-gprs
12136 This switch enables or disables the generation of floating point
12137 operations on the general purpose registers for architectures that
12138 support it.
12139
12140 The argument @var{yes} or @var{single} enables the use of
12141 single-precision floating point operations.
12142
12143 The argument @var{double} enables the use of single and
12144 double-precision floating point operations.
12145
12146 The argument @var{no} disables floating point operations on the
12147 general purpose registers.
12148
12149 This option is currently only available on the MPC854x.
12150
12151 @item -m32
12152 @itemx -m64
12153 @opindex m32
12154 @opindex m64
12155 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12156 targets (including GNU/Linux).  The 32-bit environment sets int, long
12157 and pointer to 32 bits and generates code that runs on any PowerPC
12158 variant.  The 64-bit environment sets int to 32 bits and long and
12159 pointer to 64 bits, and generates code for PowerPC64, as for
12160 @option{-mpowerpc64}.
12161
12162 @item -mfull-toc
12163 @itemx -mno-fp-in-toc
12164 @itemx -mno-sum-in-toc
12165 @itemx -mminimal-toc
12166 @opindex mfull-toc
12167 @opindex mno-fp-in-toc
12168 @opindex mno-sum-in-toc
12169 @opindex mminimal-toc
12170 Modify generation of the TOC (Table Of Contents), which is created for
12171 every executable file.  The @option{-mfull-toc} option is selected by
12172 default.  In that case, GCC will allocate at least one TOC entry for
12173 each unique non-automatic variable reference in your program.  GCC
12174 will also place floating-point constants in the TOC@.  However, only
12175 16,384 entries are available in the TOC@.
12176
12177 If you receive a linker error message that saying you have overflowed
12178 the available TOC space, you can reduce the amount of TOC space used
12179 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
12180 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
12181 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
12182 generate code to calculate the sum of an address and a constant at
12183 run-time instead of putting that sum into the TOC@.  You may specify one
12184 or both of these options.  Each causes GCC to produce very slightly
12185 slower and larger code at the expense of conserving TOC space.
12186
12187 If you still run out of space in the TOC even when you specify both of
12188 these options, specify @option{-mminimal-toc} instead.  This option causes
12189 GCC to make only one TOC entry for every file.  When you specify this
12190 option, GCC will produce code that is slower and larger but which
12191 uses extremely little TOC space.  You may wish to use this option
12192 only on files that contain less frequently executed code.
12193
12194 @item -maix64
12195 @itemx -maix32
12196 @opindex maix64
12197 @opindex maix32
12198 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
12199 @code{long} type, and the infrastructure needed to support them.
12200 Specifying @option{-maix64} implies @option{-mpowerpc64} and
12201 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
12202 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
12203
12204 @item -mxl-compat
12205 @itemx -mno-xl-compat
12206 @opindex mxl-compat
12207 @opindex mno-xl-compat
12208 Produce code that conforms more closely to IBM XL compiler semantics
12209 when using AIX-compatible ABI.  Pass floating-point arguments to
12210 prototyped functions beyond the register save area (RSA) on the stack
12211 in addition to argument FPRs.  Do not assume that most significant
12212 double in 128-bit long double value is properly rounded when comparing
12213 values and converting to double.  Use XL symbol names for long double
12214 support routines.
12215
12216 The AIX calling convention was extended but not initially documented to
12217 handle an obscure K&R C case of calling a function that takes the
12218 address of its arguments with fewer arguments than declared.  IBM XL
12219 compilers access floating point arguments which do not fit in the
12220 RSA from the stack when a subroutine is compiled without
12221 optimization.  Because always storing floating-point arguments on the
12222 stack is inefficient and rarely needed, this option is not enabled by
12223 default and only is necessary when calling subroutines compiled by IBM
12224 XL compilers without optimization.
12225
12226 @item -mpe
12227 @opindex mpe
12228 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
12229 application written to use message passing with special startup code to
12230 enable the application to run.  The system must have PE installed in the
12231 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
12232 must be overridden with the @option{-specs=} option to specify the
12233 appropriate directory location.  The Parallel Environment does not
12234 support threads, so the @option{-mpe} option and the @option{-pthread}
12235 option are incompatible.
12236
12237 @item -malign-natural
12238 @itemx -malign-power
12239 @opindex malign-natural
12240 @opindex malign-power
12241 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12242 @option{-malign-natural} overrides the ABI-defined alignment of larger
12243 types, such as floating-point doubles, on their natural size-based boundary.
12244 The option @option{-malign-power} instructs GCC to follow the ABI-specified
12245 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
12246
12247 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
12248 is not supported.
12249
12250 @item -msoft-float
12251 @itemx -mhard-float
12252 @opindex msoft-float
12253 @opindex mhard-float
12254 Generate code that does not use (uses) the floating-point register set.
12255 Software floating point emulation is provided if you use the
12256 @option{-msoft-float} option, and pass the option to GCC when linking.
12257
12258 @item -mmultiple
12259 @itemx -mno-multiple
12260 @opindex mmultiple
12261 @opindex mno-multiple
12262 Generate code that uses (does not use) the load multiple word
12263 instructions and the store multiple word instructions.  These
12264 instructions are generated by default on POWER systems, and not
12265 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
12266 endian PowerPC systems, since those instructions do not work when the
12267 processor is in little endian mode.  The exceptions are PPC740 and
12268 PPC750 which permit the instructions usage in little endian mode.
12269
12270 @item -mstring
12271 @itemx -mno-string
12272 @opindex mstring
12273 @opindex mno-string
12274 Generate code that uses (does not use) the load string instructions
12275 and the store string word instructions to save multiple registers and
12276 do small block moves.  These instructions are generated by default on
12277 POWER systems, and not generated on PowerPC systems.  Do not use
12278 @option{-mstring} on little endian PowerPC systems, since those
12279 instructions do not work when the processor is in little endian mode.
12280 The exceptions are PPC740 and PPC750 which permit the instructions
12281 usage in little endian mode.
12282
12283 @item -mupdate
12284 @itemx -mno-update
12285 @opindex mupdate
12286 @opindex mno-update
12287 Generate code that uses (does not use) the load or store instructions
12288 that update the base register to the address of the calculated memory
12289 location.  These instructions are generated by default.  If you use
12290 @option{-mno-update}, there is a small window between the time that the
12291 stack pointer is updated and the address of the previous frame is
12292 stored, which means code that walks the stack frame across interrupts or
12293 signals may get corrupted data.
12294
12295 @item -mfused-madd
12296 @itemx -mno-fused-madd
12297 @opindex mfused-madd
12298 @opindex mno-fused-madd
12299 Generate code that uses (does not use) the floating point multiply and
12300 accumulate instructions.  These instructions are generated by default if
12301 hardware floating is used.
12302
12303 @item -mmulhw
12304 @itemx -mno-mulhw
12305 @opindex mmulhw
12306 @opindex mno-mulhw
12307 Generate code that uses (does not use) the half-word multiply and
12308 multiply-accumulate instructions on the IBM 405 and 440 processors.
12309 These instructions are generated by default when targetting those
12310 processors.
12311
12312 @item -mdlmzb
12313 @itemx -mno-dlmzb
12314 @opindex mdlmzb
12315 @opindex mno-dlmzb
12316 Generate code that uses (does not use) the string-search @samp{dlmzb}
12317 instruction on the IBM 405 and 440 processors.  This instruction is
12318 generated by default when targetting those processors.
12319
12320 @item -mno-bit-align
12321 @itemx -mbit-align
12322 @opindex mno-bit-align
12323 @opindex mbit-align
12324 On System V.4 and embedded PowerPC systems do not (do) force structures
12325 and unions that contain bit-fields to be aligned to the base type of the
12326 bit-field.
12327
12328 For example, by default a structure containing nothing but 8
12329 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
12330 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
12331 the structure would be aligned to a 1 byte boundary and be one byte in
12332 size.
12333
12334 @item -mno-strict-align
12335 @itemx -mstrict-align
12336 @opindex mno-strict-align
12337 @opindex mstrict-align
12338 On System V.4 and embedded PowerPC systems do not (do) assume that
12339 unaligned memory references will be handled by the system.
12340
12341 @item -mrelocatable
12342 @itemx -mno-relocatable
12343 @opindex mrelocatable
12344 @opindex mno-relocatable
12345 On embedded PowerPC systems generate code that allows (does not allow)
12346 the program to be relocated to a different address at runtime.  If you
12347 use @option{-mrelocatable} on any module, all objects linked together must
12348 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
12349
12350 @item -mrelocatable-lib
12351 @itemx -mno-relocatable-lib
12352 @opindex mrelocatable-lib
12353 @opindex mno-relocatable-lib
12354 On embedded PowerPC systems generate code that allows (does not allow)
12355 the program to be relocated to a different address at runtime.  Modules
12356 compiled with @option{-mrelocatable-lib} can be linked with either modules
12357 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
12358 with modules compiled with the @option{-mrelocatable} options.
12359
12360 @item -mno-toc
12361 @itemx -mtoc
12362 @opindex mno-toc
12363 @opindex mtoc
12364 On System V.4 and embedded PowerPC systems do not (do) assume that
12365 register 2 contains a pointer to a global area pointing to the addresses
12366 used in the program.
12367
12368 @item -mlittle
12369 @itemx -mlittle-endian
12370 @opindex mlittle
12371 @opindex mlittle-endian
12372 On System V.4 and embedded PowerPC systems compile code for the
12373 processor in little endian mode.  The @option{-mlittle-endian} option is
12374 the same as @option{-mlittle}.
12375
12376 @item -mbig
12377 @itemx -mbig-endian
12378 @opindex mbig
12379 @opindex mbig-endian
12380 On System V.4 and embedded PowerPC systems compile code for the
12381 processor in big endian mode.  The @option{-mbig-endian} option is
12382 the same as @option{-mbig}.
12383
12384 @item -mdynamic-no-pic
12385 @opindex mdynamic-no-pic
12386 On Darwin and Mac OS X systems, compile code so that it is not
12387 relocatable, but that its external references are relocatable.  The
12388 resulting code is suitable for applications, but not shared
12389 libraries.
12390
12391 @item -mprioritize-restricted-insns=@var{priority}
12392 @opindex mprioritize-restricted-insns
12393 This option controls the priority that is assigned to
12394 dispatch-slot restricted instructions during the second scheduling
12395 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
12396 @var{no/highest/second-highest} priority to dispatch slot restricted
12397 instructions.
12398
12399 @item -msched-costly-dep=@var{dependence_type}
12400 @opindex msched-costly-dep
12401 This option controls which dependences are considered costly
12402 by the target during instruction scheduling.  The argument
12403 @var{dependence_type} takes one of the following values:
12404 @var{no}: no dependence is costly,
12405 @var{all}: all dependences are costly,
12406 @var{true_store_to_load}: a true dependence from store to load is costly,
12407 @var{store_to_load}: any dependence from store to load is costly,
12408 @var{number}: any dependence which latency >= @var{number} is costly.
12409
12410 @item -minsert-sched-nops=@var{scheme}
12411 @opindex minsert-sched-nops
12412 This option controls which nop insertion scheme will be used during
12413 the second scheduling pass.  The argument @var{scheme} takes one of the
12414 following values:
12415 @var{no}: Don't insert nops.
12416 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
12417 according to the scheduler's grouping.
12418 @var{regroup_exact}: Insert nops to force costly dependent insns into
12419 separate groups.  Insert exactly as many nops as needed to force an insn
12420 to a new group, according to the estimated processor grouping.
12421 @var{number}: Insert nops to force costly dependent insns into
12422 separate groups.  Insert @var{number} nops to force an insn to a new group.
12423
12424 @item -mcall-sysv
12425 @opindex mcall-sysv
12426 On System V.4 and embedded PowerPC systems compile code using calling
12427 conventions that adheres to the March 1995 draft of the System V
12428 Application Binary Interface, PowerPC processor supplement.  This is the
12429 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
12430
12431 @item -mcall-sysv-eabi
12432 @opindex mcall-sysv-eabi
12433 Specify both @option{-mcall-sysv} and @option{-meabi} options.
12434
12435 @item -mcall-sysv-noeabi
12436 @opindex mcall-sysv-noeabi
12437 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
12438
12439 @item -mcall-solaris
12440 @opindex mcall-solaris
12441 On System V.4 and embedded PowerPC systems compile code for the Solaris
12442 operating system.
12443
12444 @item -mcall-linux
12445 @opindex mcall-linux
12446 On System V.4 and embedded PowerPC systems compile code for the
12447 Linux-based GNU system.
12448
12449 @item -mcall-gnu
12450 @opindex mcall-gnu
12451 On System V.4 and embedded PowerPC systems compile code for the
12452 Hurd-based GNU system.
12453
12454 @item -mcall-netbsd
12455 @opindex mcall-netbsd
12456 On System V.4 and embedded PowerPC systems compile code for the
12457 NetBSD operating system.
12458
12459 @item -maix-struct-return
12460 @opindex maix-struct-return
12461 Return all structures in memory (as specified by the AIX ABI)@.
12462
12463 @item -msvr4-struct-return
12464 @opindex msvr4-struct-return
12465 Return structures smaller than 8 bytes in registers (as specified by the
12466 SVR4 ABI)@.
12467
12468 @item -mabi=@var{abi-type}
12469 @opindex mabi
12470 Extend the current ABI with a particular extension, or remove such extension.
12471 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
12472 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
12473
12474 @item -mabi=spe
12475 @opindex mabi=spe
12476 Extend the current ABI with SPE ABI extensions.  This does not change
12477 the default ABI, instead it adds the SPE ABI extensions to the current
12478 ABI@.
12479
12480 @item -mabi=no-spe
12481 @opindex mabi=no-spe
12482 Disable Booke SPE ABI extensions for the current ABI@.
12483
12484 @item -mabi=ibmlongdouble
12485 @opindex mabi=ibmlongdouble
12486 Change the current ABI to use IBM extended precision long double.
12487 This is a PowerPC 32-bit SYSV ABI option.
12488
12489 @item -mabi=ieeelongdouble
12490 @opindex mabi=ieeelongdouble
12491 Change the current ABI to use IEEE extended precision long double.
12492 This is a PowerPC 32-bit Linux ABI option.
12493
12494 @item -mprototype
12495 @itemx -mno-prototype
12496 @opindex mprototype
12497 @opindex mno-prototype
12498 On System V.4 and embedded PowerPC systems assume that all calls to
12499 variable argument functions are properly prototyped.  Otherwise, the
12500 compiler must insert an instruction before every non prototyped call to
12501 set or clear bit 6 of the condition code register (@var{CR}) to
12502 indicate whether floating point values were passed in the floating point
12503 registers in case the function takes a variable arguments.  With
12504 @option{-mprototype}, only calls to prototyped variable argument functions
12505 will set or clear the bit.
12506
12507 @item -msim
12508 @opindex msim
12509 On embedded PowerPC systems, assume that the startup module is called
12510 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12511 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12512 configurations.
12513
12514 @item -mmvme
12515 @opindex mmvme
12516 On embedded PowerPC systems, assume that the startup module is called
12517 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12518 @file{libc.a}.
12519
12520 @item -mads
12521 @opindex mads
12522 On embedded PowerPC systems, assume that the startup module is called
12523 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12524 @file{libc.a}.
12525
12526 @item -myellowknife
12527 @opindex myellowknife
12528 On embedded PowerPC systems, assume that the startup module is called
12529 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12530 @file{libc.a}.
12531
12532 @item -mvxworks
12533 @opindex mvxworks
12534 On System V.4 and embedded PowerPC systems, specify that you are
12535 compiling for a VxWorks system.
12536
12537 @item -mwindiss
12538 @opindex mwindiss
12539 Specify that you are compiling for the WindISS simulation environment.
12540
12541 @item -memb
12542 @opindex memb
12543 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12544 header to indicate that @samp{eabi} extended relocations are used.
12545
12546 @item -meabi
12547 @itemx -mno-eabi
12548 @opindex meabi
12549 @opindex mno-eabi
12550 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12551 Embedded Applications Binary Interface (eabi) which is a set of
12552 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12553 means that the stack is aligned to an 8 byte boundary, a function
12554 @code{__eabi} is called to from @code{main} to set up the eabi
12555 environment, and the @option{-msdata} option can use both @code{r2} and
12556 @code{r13} to point to two separate small data areas.  Selecting
12557 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12558 do not call an initialization function from @code{main}, and the
12559 @option{-msdata} option will only use @code{r13} to point to a single
12560 small data area.  The @option{-meabi} option is on by default if you
12561 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12562
12563 @item -msdata=eabi
12564 @opindex msdata=eabi
12565 On System V.4 and embedded PowerPC systems, put small initialized
12566 @code{const} global and static data in the @samp{.sdata2} section, which
12567 is pointed to by register @code{r2}.  Put small initialized
12568 non-@code{const} global and static data in the @samp{.sdata} section,
12569 which is pointed to by register @code{r13}.  Put small uninitialized
12570 global and static data in the @samp{.sbss} section, which is adjacent to
12571 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12572 incompatible with the @option{-mrelocatable} option.  The
12573 @option{-msdata=eabi} option also sets the @option{-memb} option.
12574
12575 @item -msdata=sysv
12576 @opindex msdata=sysv
12577 On System V.4 and embedded PowerPC systems, put small global and static
12578 data in the @samp{.sdata} section, which is pointed to by register
12579 @code{r13}.  Put small uninitialized global and static data in the
12580 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12581 The @option{-msdata=sysv} option is incompatible with the
12582 @option{-mrelocatable} option.
12583
12584 @item -msdata=default
12585 @itemx -msdata
12586 @opindex msdata=default
12587 @opindex msdata
12588 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12589 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12590 same as @option{-msdata=sysv}.
12591
12592 @item -msdata-data
12593 @opindex msdata-data
12594 On System V.4 and embedded PowerPC systems, put small global
12595 data in the @samp{.sdata} section.  Put small uninitialized global
12596 data in the @samp{.sbss} section.  Do not use register @code{r13}
12597 to address small data however.  This is the default behavior unless
12598 other @option{-msdata} options are used.
12599
12600 @item -msdata=none
12601 @itemx -mno-sdata
12602 @opindex msdata=none
12603 @opindex mno-sdata
12604 On embedded PowerPC systems, put all initialized global and static data
12605 in the @samp{.data} section, and all uninitialized data in the
12606 @samp{.bss} section.
12607
12608 @item -G @var{num}
12609 @opindex G
12610 @cindex smaller data references (PowerPC)
12611 @cindex .sdata/.sdata2 references (PowerPC)
12612 On embedded PowerPC systems, put global and static items less than or
12613 equal to @var{num} bytes into the small data or bss sections instead of
12614 the normal data or bss section.  By default, @var{num} is 8.  The
12615 @option{-G @var{num}} switch is also passed to the linker.
12616 All modules should be compiled with the same @option{-G @var{num}} value.
12617
12618 @item -mregnames
12619 @itemx -mno-regnames
12620 @opindex mregnames
12621 @opindex mno-regnames
12622 On System V.4 and embedded PowerPC systems do (do not) emit register
12623 names in the assembly language output using symbolic forms.
12624
12625 @item -mlongcall
12626 @itemx -mno-longcall
12627 @opindex mlongcall
12628 @opindex mno-longcall
12629 By default assume that all calls are far away so that a longer more
12630 expensive calling sequence is required.  This is required for calls
12631 further than 32 megabytes (33,554,432 bytes) from the current location.
12632 A short call will be generated if the compiler knows
12633 the call cannot be that far away.  This setting can be overridden by
12634 the @code{shortcall} function attribute, or by @code{#pragma
12635 longcall(0)}.
12636
12637 Some linkers are capable of detecting out-of-range calls and generating
12638 glue code on the fly.  On these systems, long calls are unnecessary and
12639 generate slower code.  As of this writing, the AIX linker can do this,
12640 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12641 to the GNU linker for 32-bit PowerPC systems as well.
12642
12643 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12644 callee, L42'', plus a ``branch island'' (glue code).  The two target
12645 addresses represent the callee and the ``branch island''.  The
12646 Darwin/PPC linker will prefer the first address and generate a ``bl
12647 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12648 otherwise, the linker will generate ``bl L42'' to call the ``branch
12649 island''.  The ``branch island'' is appended to the body of the
12650 calling function; it computes the full 32-bit address of the callee
12651 and jumps to it.
12652
12653 On Mach-O (Darwin) systems, this option directs the compiler emit to
12654 the glue for every direct call, and the Darwin linker decides whether
12655 to use or discard it.
12656
12657 In the future, we may cause GCC to ignore all longcall specifications
12658 when the linker is known to generate glue.
12659
12660 @item -pthread
12661 @opindex pthread
12662 Adds support for multithreading with the @dfn{pthreads} library.
12663 This option sets flags for both the preprocessor and linker.
12664
12665 @end table
12666
12667 @node S/390 and zSeries Options
12668 @subsection S/390 and zSeries Options
12669 @cindex S/390 and zSeries Options
12670
12671 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12672
12673 @table @gcctabopt
12674 @item -mhard-float
12675 @itemx -msoft-float
12676 @opindex mhard-float
12677 @opindex msoft-float
12678 Use (do not use) the hardware floating-point instructions and registers
12679 for floating-point operations.  When @option{-msoft-float} is specified,
12680 functions in @file{libgcc.a} will be used to perform floating-point
12681 operations.  When @option{-mhard-float} is specified, the compiler
12682 generates IEEE floating-point instructions.  This is the default.
12683
12684 @item -mlong-double-64
12685 @itemx -mlong-double-128
12686 @opindex mlong-double-64
12687 @opindex mlong-double-128
12688 These switches control the size of @code{long double} type. A size
12689 of 64bit makes the @code{long double} type equivalent to the @code{double}
12690 type. This is the default.
12691
12692 @item -mbackchain
12693 @itemx -mno-backchain
12694 @opindex mbackchain
12695 @opindex mno-backchain
12696 Store (do not store) the address of the caller's frame as backchain pointer
12697 into the callee's stack frame.
12698 A backchain may be needed to allow debugging using tools that do not understand
12699 DWARF-2 call frame information.
12700 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12701 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12702 the backchain is placed into the topmost word of the 96/160 byte register
12703 save area.
12704
12705 In general, code compiled with @option{-mbackchain} is call-compatible with
12706 code compiled with @option{-mmo-backchain}; however, use of the backchain
12707 for debugging purposes usually requires that the whole binary is built with
12708 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12709 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12710 to build a linux kernel use @option{-msoft-float}.
12711
12712 The default is to not maintain the backchain.
12713
12714 @item -mpacked-stack
12715 @item -mno-packed-stack
12716 @opindex mpacked-stack
12717 @opindex mno-packed-stack
12718 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12719 specified, the compiler uses the all fields of the 96/160 byte register save
12720 area only for their default purpose; unused fields still take up stack space.
12721 When @option{-mpacked-stack} is specified, register save slots are densely
12722 packed at the top of the register save area; unused space is reused for other
12723 purposes, allowing for more efficient use of the available stack space.
12724 However, when @option{-mbackchain} is also in effect, the topmost word of
12725 the save area is always used to store the backchain, and the return address
12726 register is always saved two words below the backchain.
12727
12728 As long as the stack frame backchain is not used, code generated with
12729 @option{-mpacked-stack} is call-compatible with code generated with
12730 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
12731 S/390 or zSeries generated code that uses the stack frame backchain at run
12732 time, not just for debugging purposes.  Such code is not call-compatible
12733 with code compiled with @option{-mpacked-stack}.  Also, note that the
12734 combination of @option{-mbackchain},
12735 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12736 to build a linux kernel use @option{-msoft-float}.
12737
12738 The default is to not use the packed stack layout.
12739
12740 @item -msmall-exec
12741 @itemx -mno-small-exec
12742 @opindex msmall-exec
12743 @opindex mno-small-exec
12744 Generate (or do not generate) code using the @code{bras} instruction
12745 to do subroutine calls.
12746 This only works reliably if the total executable size does not
12747 exceed 64k.  The default is to use the @code{basr} instruction instead,
12748 which does not have this limitation.
12749
12750 @item -m64
12751 @itemx -m31
12752 @opindex m64
12753 @opindex m31
12754 When @option{-m31} is specified, generate code compliant to the
12755 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
12756 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
12757 particular to generate 64-bit instructions.  For the @samp{s390}
12758 targets, the default is @option{-m31}, while the @samp{s390x}
12759 targets default to @option{-m64}.
12760
12761 @item -mzarch
12762 @itemx -mesa
12763 @opindex mzarch
12764 @opindex mesa
12765 When @option{-mzarch} is specified, generate code using the
12766 instructions available on z/Architecture.
12767 When @option{-mesa} is specified, generate code using the
12768 instructions available on ESA/390.  Note that @option{-mesa} is
12769 not possible with @option{-m64}.
12770 When generating code compliant to the GNU/Linux for S/390 ABI,
12771 the default is @option{-mesa}.  When generating code compliant
12772 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
12773
12774 @item -mmvcle
12775 @itemx -mno-mvcle
12776 @opindex mmvcle
12777 @opindex mno-mvcle
12778 Generate (or do not generate) code using the @code{mvcle} instruction
12779 to perform block moves.  When @option{-mno-mvcle} is specified,
12780 use a @code{mvc} loop instead.  This is the default unless optimizing for
12781 size.
12782
12783 @item -mdebug
12784 @itemx -mno-debug
12785 @opindex mdebug
12786 @opindex mno-debug
12787 Print (or do not print) additional debug information when compiling.
12788 The default is to not print debug information.
12789
12790 @item -march=@var{cpu-type}
12791 @opindex march
12792 Generate code that will run on @var{cpu-type}, which is the name of a system
12793 representing a certain processor type.  Possible values for
12794 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
12795 When generating code using the instructions available on z/Architecture,
12796 the default is @option{-march=z900}.  Otherwise, the default is
12797 @option{-march=g5}.
12798
12799 @item -mtune=@var{cpu-type}
12800 @opindex mtune
12801 Tune to @var{cpu-type} everything applicable about the generated code,
12802 except for the ABI and the set of available instructions.
12803 The list of @var{cpu-type} values is the same as for @option{-march}.
12804 The default is the value used for @option{-march}.
12805
12806 @item -mtpf-trace
12807 @itemx -mno-tpf-trace
12808 @opindex mtpf-trace
12809 @opindex mno-tpf-trace
12810 Generate code that adds (does not add) in TPF OS specific branches to trace
12811 routines in the operating system.  This option is off by default, even
12812 when compiling for the TPF OS@.
12813
12814 @item -mfused-madd
12815 @itemx -mno-fused-madd
12816 @opindex mfused-madd
12817 @opindex mno-fused-madd
12818 Generate code that uses (does not use) the floating point multiply and
12819 accumulate instructions.  These instructions are generated by default if
12820 hardware floating point is used.
12821
12822 @item -mwarn-framesize=@var{framesize}
12823 @opindex mwarn-framesize
12824 Emit a warning if the current function exceeds the given frame size.  Because
12825 this is a compile time check it doesn't need to be a real problem when the program
12826 runs.  It is intended to identify functions which most probably cause
12827 a stack overflow.  It is useful to be used in an environment with limited stack
12828 size e.g.@: the linux kernel.
12829
12830 @item -mwarn-dynamicstack
12831 @opindex mwarn-dynamicstack
12832 Emit a warning if the function calls alloca or uses dynamically
12833 sized arrays.  This is generally a bad idea with a limited stack size.
12834
12835 @item -mstack-guard=@var{stack-guard}
12836 @item -mstack-size=@var{stack-size}
12837 @opindex mstack-guard
12838 @opindex mstack-size
12839 If these options are provided the s390 back end emits additional instructions in
12840 the function prologue which trigger a trap if the stack size is @var{stack-guard}
12841 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
12842 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
12843 the frame size of the compiled function is chosen.
12844 These options are intended to be used to help debugging stack overflow problems.
12845 The additionally emitted code causes only little overhead and hence can also be
12846 used in production like systems without greater performance degradation.  The given
12847 values have to be exact powers of 2 and @var{stack-size} has to be greater than
12848 @var{stack-guard} without exceeding 64k.
12849 In order to be efficient the extra code makes the assumption that the stack starts
12850 at an address aligned to the value given by @var{stack-size}.
12851 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
12852 @end table
12853
12854 @node Score Options
12855 @subsection Score Options
12856 @cindex Score Options
12857
12858 These options are defined for Score implementations:
12859
12860 @table @gcctabopt
12861 @item -mel
12862 @opindex -mel
12863 Compile code for little endian mode. 
12864
12865 @item -meb
12866 @opindex meb
12867 Compile code for big endian mode.  This is the default.
12868
12869 @item -mmac
12870 @opindex mmac
12871 Enable the use of multiply-accumulate instructions. Disabled by default. 
12872
12873 @item -mscore5u
12874 @opindex mscore5u
12875 Specify the SCORE5U of the target architecture.
12876
12877 @item -mscore7
12878 @opindex mscore7
12879 Specify the SCORE7 of the target architecture. This is the default.
12880 @end table
12881
12882 @node SH Options
12883 @subsection SH Options
12884
12885 These @samp{-m} options are defined for the SH implementations:
12886
12887 @table @gcctabopt
12888 @item -m1
12889 @opindex m1
12890 Generate code for the SH1.
12891
12892 @item -m2
12893 @opindex m2
12894 Generate code for the SH2.
12895
12896 @item -m2e
12897 Generate code for the SH2e.
12898
12899 @item -m3
12900 @opindex m3
12901 Generate code for the SH3.
12902
12903 @item -m3e
12904 @opindex m3e
12905 Generate code for the SH3e.
12906
12907 @item -m4-nofpu
12908 @opindex m4-nofpu
12909 Generate code for the SH4 without a floating-point unit.
12910
12911 @item -m4-single-only
12912 @opindex m4-single-only
12913 Generate code for the SH4 with a floating-point unit that only
12914 supports single-precision arithmetic.
12915
12916 @item -m4-single
12917 @opindex m4-single
12918 Generate code for the SH4 assuming the floating-point unit is in
12919 single-precision mode by default.
12920
12921 @item -m4
12922 @opindex m4
12923 Generate code for the SH4.
12924
12925 @item -m4a-nofpu
12926 @opindex m4a-nofpu
12927 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
12928 floating-point unit is not used.
12929
12930 @item -m4a-single-only
12931 @opindex m4a-single-only
12932 Generate code for the SH4a, in such a way that no double-precision
12933 floating point operations are used.
12934
12935 @item -m4a-single
12936 @opindex m4a-single
12937 Generate code for the SH4a assuming the floating-point unit is in
12938 single-precision mode by default.
12939
12940 @item -m4a
12941 @opindex m4a
12942 Generate code for the SH4a.
12943
12944 @item -m4al
12945 @opindex m4al
12946 Same as @option{-m4a-nofpu}, except that it implicitly passes
12947 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
12948 instructions at the moment.
12949
12950 @item -mb
12951 @opindex mb
12952 Compile code for the processor in big endian mode.
12953
12954 @item -ml
12955 @opindex ml
12956 Compile code for the processor in little endian mode.
12957
12958 @item -mdalign
12959 @opindex mdalign
12960 Align doubles at 64-bit boundaries.  Note that this changes the calling
12961 conventions, and thus some functions from the standard C library will
12962 not work unless you recompile it first with @option{-mdalign}.
12963
12964 @item -mrelax
12965 @opindex mrelax
12966 Shorten some address references at link time, when possible; uses the
12967 linker option @option{-relax}.
12968
12969 @item -mbigtable
12970 @opindex mbigtable
12971 Use 32-bit offsets in @code{switch} tables.  The default is to use
12972 16-bit offsets.
12973
12974 @item -mfmovd
12975 @opindex mfmovd
12976 Enable the use of the instruction @code{fmovd}.
12977
12978 @item -mhitachi
12979 @opindex mhitachi
12980 Comply with the calling conventions defined by Renesas.
12981
12982 @item -mrenesas
12983 @opindex mhitachi
12984 Comply with the calling conventions defined by Renesas.
12985
12986 @item -mno-renesas
12987 @opindex mhitachi
12988 Comply with the calling conventions defined for GCC before the Renesas
12989 conventions were available.  This option is the default for all
12990 targets of the SH toolchain except for @samp{sh-symbianelf}.
12991
12992 @item -mnomacsave
12993 @opindex mnomacsave
12994 Mark the @code{MAC} register as call-clobbered, even if
12995 @option{-mhitachi} is given.
12996
12997 @item -mieee
12998 @opindex mieee
12999 Increase IEEE-compliance of floating-point code.
13000 At the moment, this is equivalent to @option{-fno-finite-math-only}.
13001 When generating 16 bit SH opcodes, getting IEEE-conforming results for
13002 comparisons of NANs / infinities incurs extra overhead in every
13003 floating point comparison, therefore the default is set to
13004 @option{-ffinite-math-only}.
13005
13006 @item -minline-ic_invalidate
13007 @opindex minline-ic_invalidate
13008 Inline code to invalidate instruction cache entries after setting up
13009 nested function trampolines.
13010 This option has no effect if -musermode is in effect and the selected
13011 code generation option (e.g. -m4) does not allow the use of the icbi
13012 instruction.
13013 If the selected code generation option does not allow the use of the icbi
13014 instruction, and -musermode is not in effect, the inlined code will
13015 manipulate the instruction cache address array directly with an associative
13016 write.  This not only requires privileged mode, but it will also
13017 fail if the cache line had been mapped via the TLB and has become unmapped.
13018
13019 @item -misize
13020 @opindex misize
13021 Dump instruction size and location in the assembly code.
13022
13023 @item -mpadstruct
13024 @opindex mpadstruct
13025 This option is deprecated.  It pads structures to multiple of 4 bytes,
13026 which is incompatible with the SH ABI@.
13027
13028 @item -mspace
13029 @opindex mspace
13030 Optimize for space instead of speed.  Implied by @option{-Os}.
13031
13032 @item -mprefergot
13033 @opindex mprefergot
13034 When generating position-independent code, emit function calls using
13035 the Global Offset Table instead of the Procedure Linkage Table.
13036
13037 @item -musermode
13038 @opindex musermode
13039 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
13040 if the inlined code would not work in user mode.
13041 This is the default when the target is @code{sh-*-linux*}.
13042
13043 @item -multcost=@var{number}
13044 @opindex multcost=@var{number}
13045 Set the cost to assume for a multiply insn.
13046
13047 @item -mdiv=@var{strategy}
13048 @opindex mdiv=@var{strategy}
13049 Set the division strategy to use for SHmedia code.  @var{strategy} must be
13050 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
13051 inv:call2, inv:fp .
13052 "fp" performs the operation in floating point.  This has a very high latency,
13053 but needs only a few instructions, so it might be a good choice if
13054 your code has enough easily exploitable ILP to allow the compiler to
13055 schedule the floating point instructions together with other instructions.
13056 Division by zero causes a floating point exception.
13057 "inv" uses integer operations to calculate the inverse of the divisor,
13058 and then multiplies the dividend with the inverse.  This strategy allows
13059 cse and hoisting of the inverse calculation.  Division by zero calculates
13060 an unspecified result, but does not trap.
13061 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
13062 have been found, or if the entire operation has been hoisted to the same
13063 place, the last stages of the inverse calculation are intertwined with the
13064 final multiply to reduce the overall latency, at the expense of using a few
13065 more instructions, and thus offering fewer scheduling opportunities with
13066 other code.
13067 "call" calls a library function that usually implements the inv:minlat
13068 strategy.
13069 This gives high code density for m5-*media-nofpu compilations.
13070 "call2" uses a different entry point of the same library function, where it
13071 assumes that a pointer to a lookup table has already been set up, which
13072 exposes the pointer load to cse / code hoisting optimizations.
13073 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
13074 code generation, but if the code stays unoptimized, revert to the "call",
13075 "call2", or "fp" strategies, respectively.  Note that the
13076 potentially-trapping side effect of division by zero is carried by a
13077 separate instruction, so it is possible that all the integer instructions
13078 are hoisted out, but the marker for the side effect stays where it is.
13079 A recombination to fp operations or a call is not possible in that case.
13080 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
13081 that the inverse calculation was nor separated from the multiply, they speed
13082 up division where the dividend fits into 20 bits (plus sign where applicable),
13083 by inserting a test to skip a number of operations in this case; this test
13084 slows down the case of larger dividends.  inv20u assumes the case of a such
13085 a small dividend to be unlikely, and inv20l assumes it to be likely.
13086
13087 @item -mdivsi3_libfunc=@var{name}
13088 @opindex mdivsi3_libfunc=@var{name}
13089 Set the name of the library function used for 32 bit signed division to
13090 @var{name}.  This only affect the name used in the call and inv:call
13091 division strategies, and the compiler will still expect the same
13092 sets of input/output/clobbered registers as if this option was not present.
13093
13094 @item -madjust-unroll
13095 @opindex madjust-unroll
13096 Throttle unrolling to avoid thrashing target registers.
13097 This option only has an effect if the gcc code base supports the
13098 TARGET_ADJUST_UNROLL_MAX target hook.
13099
13100 @item -mindexed-addressing
13101 @opindex mindexed-addressing
13102 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
13103 This is only safe if the hardware and/or OS implement 32 bit wrap-around
13104 semantics for the indexed addressing mode.  The architecture allows the
13105 implementation of processors with 64 bit MMU, which the OS could use to
13106 get 32 bit addressing, but since no current hardware implementation supports
13107 this or any other way to make the indexed addressing mode safe to use in
13108 the 32 bit ABI, the default is -mno-indexed-addressing.
13109
13110 @item -mgettrcost=@var{number}
13111 @opindex mgettrcost=@var{number}
13112 Set the cost assumed for the gettr instruction to @var{number}.
13113 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
13114
13115 @item -mpt-fixed
13116 @opindex mpt-fixed
13117 Assume pt* instructions won't trap.  This will generally generate better
13118 scheduled code, but is unsafe on current hardware.  The current architecture
13119 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
13120 This has the unintentional effect of making it unsafe to schedule ptabs /
13121 ptrel before a branch, or hoist it out of a loop.  For example,
13122 __do_global_ctors, a part of libgcc that runs constructors at program
13123 startup, calls functions in a list which is delimited by @minus{}1.  With the
13124 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
13125 That means that all the constructors will be run a bit quicker, but when
13126 the loop comes to the end of the list, the program crashes because ptabs
13127 loads @minus{}1 into a target register.  Since this option is unsafe for any
13128 hardware implementing the current architecture specification, the default
13129 is -mno-pt-fixed.  Unless the user specifies a specific cost with
13130 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
13131 this deters register allocation using target registers for storing
13132 ordinary integers.
13133
13134 @item -minvalid-symbols
13135 @opindex minvalid-symbols
13136 Assume symbols might be invalid.  Ordinary function symbols generated by
13137 the compiler will always be valid to load with movi/shori/ptabs or
13138 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
13139 to generate symbols that will cause ptabs / ptrel to trap.
13140 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
13141 It will then prevent cross-basic-block cse, hoisting and most scheduling
13142 of symbol loads.  The default is @option{-mno-invalid-symbols}.
13143 @end table
13144
13145 @node SPARC Options
13146 @subsection SPARC Options
13147 @cindex SPARC options
13148
13149 These @samp{-m} options are supported on the SPARC:
13150
13151 @table @gcctabopt
13152 @item -mno-app-regs
13153 @itemx -mapp-regs
13154 @opindex mno-app-regs
13155 @opindex mapp-regs
13156 Specify @option{-mapp-regs} to generate output using the global registers
13157 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
13158 is the default.
13159
13160 To be fully SVR4 ABI compliant at the cost of some performance loss,
13161 specify @option{-mno-app-regs}.  You should compile libraries and system
13162 software with this option.
13163
13164 @item -mfpu
13165 @itemx -mhard-float
13166 @opindex mfpu
13167 @opindex mhard-float
13168 Generate output containing floating point instructions.  This is the
13169 default.
13170
13171 @item -mno-fpu
13172 @itemx -msoft-float
13173 @opindex mno-fpu
13174 @opindex msoft-float
13175 Generate output containing library calls for floating point.
13176 @strong{Warning:} the requisite libraries are not available for all SPARC
13177 targets.  Normally the facilities of the machine's usual C compiler are
13178 used, but this cannot be done directly in cross-compilation.  You must make
13179 your own arrangements to provide suitable library functions for
13180 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
13181 @samp{sparclite-*-*} do provide software floating point support.
13182
13183 @option{-msoft-float} changes the calling convention in the output file;
13184 therefore, it is only useful if you compile @emph{all} of a program with
13185 this option.  In particular, you need to compile @file{libgcc.a}, the
13186 library that comes with GCC, with @option{-msoft-float} in order for
13187 this to work.
13188
13189 @item -mhard-quad-float
13190 @opindex mhard-quad-float
13191 Generate output containing quad-word (long double) floating point
13192 instructions.
13193
13194 @item -msoft-quad-float
13195 @opindex msoft-quad-float
13196 Generate output containing library calls for quad-word (long double)
13197 floating point instructions.  The functions called are those specified
13198 in the SPARC ABI@.  This is the default.
13199
13200 As of this writing, there are no SPARC implementations that have hardware
13201 support for the quad-word floating point instructions.  They all invoke
13202 a trap handler for one of these instructions, and then the trap handler
13203 emulates the effect of the instruction.  Because of the trap handler overhead,
13204 this is much slower than calling the ABI library routines.  Thus the
13205 @option{-msoft-quad-float} option is the default.
13206
13207 @item -mno-unaligned-doubles
13208 @itemx -munaligned-doubles
13209 @opindex mno-unaligned-doubles
13210 @opindex munaligned-doubles
13211 Assume that doubles have 8 byte alignment.  This is the default.
13212
13213 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
13214 alignment only if they are contained in another type, or if they have an
13215 absolute address.  Otherwise, it assumes they have 4 byte alignment.
13216 Specifying this option avoids some rare compatibility problems with code
13217 generated by other compilers.  It is not the default because it results
13218 in a performance loss, especially for floating point code.
13219
13220 @item -mno-faster-structs
13221 @itemx -mfaster-structs
13222 @opindex mno-faster-structs
13223 @opindex mfaster-structs
13224 With @option{-mfaster-structs}, the compiler assumes that structures
13225 should have 8 byte alignment.  This enables the use of pairs of
13226 @code{ldd} and @code{std} instructions for copies in structure
13227 assignment, in place of twice as many @code{ld} and @code{st} pairs.
13228 However, the use of this changed alignment directly violates the SPARC
13229 ABI@.  Thus, it's intended only for use on targets where the developer
13230 acknowledges that their resulting code will not be directly in line with
13231 the rules of the ABI@.
13232
13233 @item -mimpure-text
13234 @opindex mimpure-text
13235 @option{-mimpure-text}, used in addition to @option{-shared}, tells
13236 the compiler to not pass @option{-z text} to the linker when linking a
13237 shared object.  Using this option, you can link position-dependent
13238 code into a shared object.
13239
13240 @option{-mimpure-text} suppresses the ``relocations remain against
13241 allocatable but non-writable sections'' linker error message.
13242 However, the necessary relocations will trigger copy-on-write, and the
13243 shared object is not actually shared across processes.  Instead of
13244 using @option{-mimpure-text}, you should compile all source code with
13245 @option{-fpic} or @option{-fPIC}.
13246
13247 This option is only available on SunOS and Solaris.
13248
13249 @item -mcpu=@var{cpu_type}
13250 @opindex mcpu
13251 Set the instruction set, register set, and instruction scheduling parameters
13252 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
13253 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
13254 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
13255 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
13256 @samp{ultrasparc3}, and @samp{niagara}.
13257
13258 Default instruction scheduling parameters are used for values that select
13259 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
13260 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
13261
13262 Here is a list of each supported architecture and their supported
13263 implementations.
13264
13265 @smallexample
13266     v7:             cypress
13267     v8:             supersparc, hypersparc
13268     sparclite:      f930, f934, sparclite86x
13269     sparclet:       tsc701
13270     v9:             ultrasparc, ultrasparc3, niagara
13271 @end smallexample
13272
13273 By default (unless configured otherwise), GCC generates code for the V7
13274 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
13275 additionally optimizes it for the Cypress CY7C602 chip, as used in the
13276 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
13277 SPARCStation 1, 2, IPX etc.
13278
13279 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
13280 architecture.  The only difference from V7 code is that the compiler emits
13281 the integer multiply and integer divide instructions which exist in SPARC-V8
13282 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
13283 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
13284 2000 series.
13285
13286 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
13287 the SPARC architecture.  This adds the integer multiply, integer divide step
13288 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
13289 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
13290 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
13291 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
13292 MB86934 chip, which is the more recent SPARClite with FPU@.
13293
13294 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
13295 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
13296 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
13297 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
13298 optimizes it for the TEMIC SPARClet chip.
13299
13300 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
13301 architecture.  This adds 64-bit integer and floating-point move instructions,
13302 3 additional floating-point condition code registers and conditional move
13303 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
13304 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
13305 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
13306 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
13307 @option{-mcpu=niagara}, the compiler additionally optimizes it for
13308 Sun UltraSPARC T1 chips.
13309
13310 @item -mtune=@var{cpu_type}
13311 @opindex mtune
13312 Set the instruction scheduling parameters for machine type
13313 @var{cpu_type}, but do not set the instruction set or register set that the
13314 option @option{-mcpu=@var{cpu_type}} would.
13315
13316 The same values for @option{-mcpu=@var{cpu_type}} can be used for
13317 @option{-mtune=@var{cpu_type}}, but the only useful values are those
13318 that select a particular cpu implementation.  Those are @samp{cypress},
13319 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
13320 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
13321 @samp{ultrasparc3}, and @samp{niagara}.
13322
13323 @item -mv8plus
13324 @itemx -mno-v8plus
13325 @opindex mv8plus
13326 @opindex mno-v8plus
13327 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
13328 difference from the V8 ABI is that the global and out registers are
13329 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
13330 mode for all SPARC-V9 processors.
13331
13332 @item -mvis
13333 @itemx -mno-vis
13334 @opindex mvis
13335 @opindex mno-vis
13336 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
13337 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
13338 @end table
13339
13340 These @samp{-m} options are supported in addition to the above
13341 on SPARC-V9 processors in 64-bit environments:
13342
13343 @table @gcctabopt
13344 @item -mlittle-endian
13345 @opindex mlittle-endian
13346 Generate code for a processor running in little-endian mode.  It is only
13347 available for a few configurations and most notably not on Solaris and Linux.
13348
13349 @item -m32
13350 @itemx -m64
13351 @opindex m32
13352 @opindex m64
13353 Generate code for a 32-bit or 64-bit environment.
13354 The 32-bit environment sets int, long and pointer to 32 bits.
13355 The 64-bit environment sets int to 32 bits and long and pointer
13356 to 64 bits.
13357
13358 @item -mcmodel=medlow
13359 @opindex mcmodel=medlow
13360 Generate code for the Medium/Low code model: 64-bit addresses, programs
13361 must be linked in the low 32 bits of memory.  Programs can be statically
13362 or dynamically linked.
13363
13364 @item -mcmodel=medmid
13365 @opindex mcmodel=medmid
13366 Generate code for the Medium/Middle code model: 64-bit addresses, programs
13367 must be linked in the low 44 bits of memory, the text and data segments must
13368 be less than 2GB in size and the data segment must be located within 2GB of
13369 the text segment.
13370
13371 @item -mcmodel=medany
13372 @opindex mcmodel=medany
13373 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
13374 may be linked anywhere in memory, the text and data segments must be less
13375 than 2GB in size and the data segment must be located within 2GB of the
13376 text segment.
13377
13378 @item -mcmodel=embmedany
13379 @opindex mcmodel=embmedany
13380 Generate code for the Medium/Anywhere code model for embedded systems:
13381 64-bit addresses, the text and data segments must be less than 2GB in
13382 size, both starting anywhere in memory (determined at link time).  The
13383 global register %g4 points to the base of the data segment.  Programs
13384 are statically linked and PIC is not supported.
13385
13386 @item -mstack-bias
13387 @itemx -mno-stack-bias
13388 @opindex mstack-bias
13389 @opindex mno-stack-bias
13390 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
13391 frame pointer if present, are offset by @minus{}2047 which must be added back
13392 when making stack frame references.  This is the default in 64-bit mode.
13393 Otherwise, assume no such offset is present.
13394 @end table
13395
13396 These switches are supported in addition to the above on Solaris:
13397
13398 @table @gcctabopt
13399 @item -threads
13400 @opindex threads
13401 Add support for multithreading using the Solaris threads library.  This
13402 option sets flags for both the preprocessor and linker.  This option does
13403 not affect the thread safety of object code produced by the compiler or
13404 that of libraries supplied with it.
13405
13406 @item -pthreads
13407 @opindex pthreads
13408 Add support for multithreading using the POSIX threads library.  This
13409 option sets flags for both the preprocessor and linker.  This option does
13410 not affect the thread safety of object code produced  by the compiler or
13411 that of libraries supplied with it.
13412
13413 @item -pthread
13414 @opindex pthread
13415 This is a synonym for @option{-pthreads}.
13416 @end table
13417
13418 @node SPU Options
13419 @subsection SPU Options
13420 @cindex SPU options
13421
13422 These @samp{-m} options are supported on the SPU:
13423
13424 @table @gcctabopt
13425 @item -mwarn-reloc
13426 @itemx -merror-reloc
13427 @opindex mwarn-reloc
13428 @opindex merror-reloc
13429
13430 The loader for SPU does not handle dynamic relocations.  By default, GCC
13431 will give an error when it generates code that requires a dynamic
13432 relocation.  @option{-mno-error-reloc} disables the error,
13433 @option{-mwarn-reloc} will generate a warning instead.
13434
13435 @item -msafe-dma
13436 @itemx -munsafe-dma
13437 @opindex msafe-dma
13438 @opindex munsafe-dma
13439
13440 Instructions which initiate or test completion of DMA must not be
13441 reordered with respect to loads and stores of the memory which is being
13442 accessed.  Users typically address this problem using the volatile
13443 keyword, but that can lead to inefficient code in places where the
13444 memory is known to not change.  Rather than mark the memory as volatile
13445 we treat the DMA instructions as potentially effecting all memory.  With
13446 @option{-munsafe-dma} users must use the volatile keyword to protect
13447 memory accesses.
13448
13449 @item -mbranch-hints
13450 @opindex mbranch-hints
13451
13452 By default, GCC will generate a branch hint instruction to avoid
13453 pipeline stalls for always taken or probably taken branches.  A hint
13454 will not be generated closer than 8 instructions away from its branch.
13455 There is little reason to disable them, except for debugging purposes,
13456 or to make an object a little bit smaller.
13457
13458 @item -msmall-mem
13459 @itemx -mlarge-mem
13460 @opindex msmall-mem
13461 @opindex mlarge-mem
13462
13463 By default, GCC generates code assuming that addresses are never larger
13464 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
13465 a full 32 bit address.
13466
13467 @item -mstdmain
13468 @opindex mstdmain
13469
13470 By default, GCC links against startup code that assumes the SPU-style
13471 main function interface (which has an unconventional parameter list).
13472 With @option{-mstdmain}, GCC will link your program against startup
13473 code that assumes a C99-style interface to @code{main}, including a
13474 local copy of @code{argv} strings.
13475
13476 @item -mfixed-range=@var{register-range}
13477 @opindex mfixed-range
13478 Generate code treating the given register range as fixed registers.
13479 A fixed register is one that the register allocator can not use.  This is
13480 useful when compiling kernel code.  A register range is specified as
13481 two registers separated by a dash.  Multiple register ranges can be
13482 specified separated by a comma.
13483
13484 @end table
13485
13486 @node System V Options
13487 @subsection Options for System V
13488
13489 These additional options are available on System V Release 4 for
13490 compatibility with other compilers on those systems:
13491
13492 @table @gcctabopt
13493 @item -G
13494 @opindex G
13495 Create a shared object.
13496 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13497
13498 @item -Qy
13499 @opindex Qy
13500 Identify the versions of each tool used by the compiler, in a
13501 @code{.ident} assembler directive in the output.
13502
13503 @item -Qn
13504 @opindex Qn
13505 Refrain from adding @code{.ident} directives to the output file (this is
13506 the default).
13507
13508 @item -YP,@var{dirs}
13509 @opindex YP
13510 Search the directories @var{dirs}, and no others, for libraries
13511 specified with @option{-l}.
13512
13513 @item -Ym,@var{dir}
13514 @opindex Ym
13515 Look in the directory @var{dir} to find the M4 preprocessor.
13516 The assembler uses this option.
13517 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13518 @c the generic assembler that comes with Solaris takes just -Ym.
13519 @end table
13520
13521 @node TMS320C3x/C4x Options
13522 @subsection TMS320C3x/C4x Options
13523 @cindex TMS320C3x/C4x Options
13524
13525 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
13526
13527 @table @gcctabopt
13528
13529 @item -mcpu=@var{cpu_type}
13530 @opindex mcpu
13531 Set the instruction set, register set, and instruction scheduling
13532 parameters for machine type @var{cpu_type}.  Supported values for
13533 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
13534 @samp{c44}.  The default is @samp{c40} to generate code for the
13535 TMS320C40.
13536
13537 @item -mbig-memory
13538 @itemx -mbig
13539 @itemx -msmall-memory
13540 @itemx -msmall
13541 @opindex mbig-memory
13542 @opindex mbig
13543 @opindex msmall-memory
13544 @opindex msmall
13545 Generates code for the big or small memory model.  The small memory
13546 model assumed that all data fits into one 64K word page.  At run-time
13547 the data page (DP) register must be set to point to the 64K page
13548 containing the .bss and .data program sections.  The big memory model is
13549 the default and requires reloading of the DP register for every direct
13550 memory access.
13551
13552 @item -mbk
13553 @itemx -mno-bk
13554 @opindex mbk
13555 @opindex mno-bk
13556 Allow (disallow) allocation of general integer operands into the block
13557 count register BK@.
13558
13559 @item -mdb
13560 @itemx -mno-db
13561 @opindex mdb
13562 @opindex mno-db
13563 Enable (disable) generation of code using decrement and branch,
13564 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13565 on the safe side, this is disabled for the C3x, since the maximum
13566 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13567 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13568 that it can utilize the decrement and branch instruction, but will give
13569 up if there is more than one memory reference in the loop.  Thus a loop
13570 where the loop counter is decremented can generate slightly more
13571 efficient code, in cases where the RPTB instruction cannot be utilized.
13572
13573 @item -mdp-isr-reload
13574 @itemx -mparanoid
13575 @opindex mdp-isr-reload
13576 @opindex mparanoid
13577 Force the DP register to be saved on entry to an interrupt service
13578 routine (ISR), reloaded to point to the data section, and restored on
13579 exit from the ISR@.  This should not be required unless someone has
13580 violated the small memory model by modifying the DP register, say within
13581 an object library.
13582
13583 @item -mmpyi
13584 @itemx -mno-mpyi
13585 @opindex mmpyi
13586 @opindex mno-mpyi
13587 For the C3x use the 24-bit MPYI instruction for integer multiplies
13588 instead of a library call to guarantee 32-bit results.  Note that if one
13589 of the operands is a constant, then the multiplication will be performed
13590 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13591 then squaring operations are performed inline instead of a library call.
13592
13593 @item -mfast-fix
13594 @itemx -mno-fast-fix
13595 @opindex mfast-fix
13596 @opindex mno-fast-fix
13597 The C3x/C4x FIX instruction to convert a floating point value to an
13598 integer value chooses the nearest integer less than or equal to the
13599 floating point value rather than to the nearest integer.  Thus if the
13600 floating point number is negative, the result will be incorrectly
13601 truncated an additional code is necessary to detect and correct this
13602 case.  This option can be used to disable generation of the additional
13603 code required to correct the result.
13604
13605 @item -mrptb
13606 @itemx -mno-rptb
13607 @opindex mrptb
13608 @opindex mno-rptb
13609 Enable (disable) generation of repeat block sequences using the RPTB
13610 instruction for zero overhead looping.  The RPTB construct is only used
13611 for innermost loops that do not call functions or jump across the loop
13612 boundaries.  There is no advantage having nested RPTB loops due to the
13613 overhead required to save and restore the RC, RS, and RE registers.
13614 This is enabled by default with @option{-O2}.
13615
13616 @item -mrpts=@var{count}
13617 @itemx -mno-rpts
13618 @opindex mrpts
13619 @opindex mno-rpts
13620 Enable (disable) the use of the single instruction repeat instruction
13621 RPTS@.  If a repeat block contains a single instruction, and the loop
13622 count can be guaranteed to be less than the value @var{count}, GCC will
13623 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13624 then a RPTS will be emitted even if the loop count cannot be determined
13625 at compile time.  Note that the repeated instruction following RPTS does
13626 not have to be reloaded from memory each iteration, thus freeing up the
13627 CPU buses for operands.  However, since interrupts are blocked by this
13628 instruction, it is disabled by default.
13629
13630 @item -mloop-unsigned
13631 @itemx -mno-loop-unsigned
13632 @opindex mloop-unsigned
13633 @opindex mno-loop-unsigned
13634 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13635 is @math{2^{31} + 1} since these instructions test if the iteration count is
13636 negative to terminate the loop.  If the iteration count is unsigned
13637 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13638 exceeded.  This switch allows an unsigned iteration count.
13639
13640 @item -mti
13641 @opindex mti
13642 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13643 with.  This also enforces compatibility with the API employed by the TI
13644 C3x C compiler.  For example, long doubles are passed as structures
13645 rather than in floating point registers.
13646
13647 @item -mregparm
13648 @itemx -mmemparm
13649 @opindex mregparm
13650 @opindex mmemparm
13651 Generate code that uses registers (stack) for passing arguments to functions.
13652 By default, arguments are passed in registers where possible rather
13653 than by pushing arguments on to the stack.
13654
13655 @item -mparallel-insns
13656 @itemx -mno-parallel-insns
13657 @opindex mparallel-insns
13658 @opindex mno-parallel-insns
13659 Allow the generation of parallel instructions.  This is enabled by
13660 default with @option{-O2}.
13661
13662 @item -mparallel-mpy
13663 @itemx -mno-parallel-mpy
13664 @opindex mparallel-mpy
13665 @opindex mno-parallel-mpy
13666 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13667 provided @option{-mparallel-insns} is also specified.  These instructions have
13668 tight register constraints which can pessimize the code generation
13669 of large functions.
13670
13671 @end table
13672
13673 @node V850 Options
13674 @subsection V850 Options
13675 @cindex V850 Options
13676
13677 These @samp{-m} options are defined for V850 implementations:
13678
13679 @table @gcctabopt
13680 @item -mlong-calls
13681 @itemx -mno-long-calls
13682 @opindex mlong-calls
13683 @opindex mno-long-calls
13684 Treat all calls as being far away (near).  If calls are assumed to be
13685 far away, the compiler will always load the functions address up into a
13686 register, and call indirect through the pointer.
13687
13688 @item -mno-ep
13689 @itemx -mep
13690 @opindex mno-ep
13691 @opindex mep
13692 Do not optimize (do optimize) basic blocks that use the same index
13693 pointer 4 or more times to copy pointer into the @code{ep} register, and
13694 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13695 option is on by default if you optimize.
13696
13697 @item -mno-prolog-function
13698 @itemx -mprolog-function
13699 @opindex mno-prolog-function
13700 @opindex mprolog-function
13701 Do not use (do use) external functions to save and restore registers
13702 at the prologue and epilogue of a function.  The external functions
13703 are slower, but use less code space if more than one function saves
13704 the same number of registers.  The @option{-mprolog-function} option
13705 is on by default if you optimize.
13706
13707 @item -mspace
13708 @opindex mspace
13709 Try to make the code as small as possible.  At present, this just turns
13710 on the @option{-mep} and @option{-mprolog-function} options.
13711
13712 @item -mtda=@var{n}
13713 @opindex mtda
13714 Put static or global variables whose size is @var{n} bytes or less into
13715 the tiny data area that register @code{ep} points to.  The tiny data
13716 area can hold up to 256 bytes in total (128 bytes for byte references).
13717
13718 @item -msda=@var{n}
13719 @opindex msda
13720 Put static or global variables whose size is @var{n} bytes or less into
13721 the small data area that register @code{gp} points to.  The small data
13722 area can hold up to 64 kilobytes.
13723
13724 @item -mzda=@var{n}
13725 @opindex mzda
13726 Put static or global variables whose size is @var{n} bytes or less into
13727 the first 32 kilobytes of memory.
13728
13729 @item -mv850
13730 @opindex mv850
13731 Specify that the target processor is the V850.
13732
13733 @item -mbig-switch
13734 @opindex mbig-switch
13735 Generate code suitable for big switch tables.  Use this option only if
13736 the assembler/linker complain about out of range branches within a switch
13737 table.
13738
13739 @item -mapp-regs
13740 @opindex mapp-regs
13741 This option will cause r2 and r5 to be used in the code generated by
13742 the compiler.  This setting is the default.
13743
13744 @item -mno-app-regs
13745 @opindex mno-app-regs
13746 This option will cause r2 and r5 to be treated as fixed registers.
13747
13748 @item -mv850e1
13749 @opindex mv850e1
13750 Specify that the target processor is the V850E1.  The preprocessor
13751 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
13752 this option is used.
13753
13754 @item -mv850e
13755 @opindex mv850e
13756 Specify that the target processor is the V850E@.  The preprocessor
13757 constant @samp{__v850e__} will be defined if this option is used.
13758
13759 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
13760 are defined then a default target processor will be chosen and the
13761 relevant @samp{__v850*__} preprocessor constant will be defined.
13762
13763 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
13764 defined, regardless of which processor variant is the target.
13765
13766 @item -mdisable-callt
13767 @opindex mdisable-callt
13768 This option will suppress generation of the CALLT instruction for the
13769 v850e and v850e1 flavors of the v850 architecture.  The default is
13770 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
13771
13772 @end table
13773
13774 @node VAX Options
13775 @subsection VAX Options
13776 @cindex VAX options
13777
13778 These @samp{-m} options are defined for the VAX:
13779
13780 @table @gcctabopt
13781 @item -munix
13782 @opindex munix
13783 Do not output certain jump instructions (@code{aobleq} and so on)
13784 that the Unix assembler for the VAX cannot handle across long
13785 ranges.
13786
13787 @item -mgnu
13788 @opindex mgnu
13789 Do output those jump instructions, on the assumption that you
13790 will assemble with the GNU assembler.
13791
13792 @item -mg
13793 @opindex mg
13794 Output code for g-format floating point numbers instead of d-format.
13795 @end table
13796
13797 @node x86-64 Options
13798 @subsection x86-64 Options
13799 @cindex x86-64 options
13800
13801 These are listed under @xref{i386 and x86-64 Options}.
13802
13803 @node Xstormy16 Options
13804 @subsection Xstormy16 Options
13805 @cindex Xstormy16 Options
13806
13807 These options are defined for Xstormy16:
13808
13809 @table @gcctabopt
13810 @item -msim
13811 @opindex msim
13812 Choose startup files and linker script suitable for the simulator.
13813 @end table
13814
13815 @node Xtensa Options
13816 @subsection Xtensa Options
13817 @cindex Xtensa Options
13818
13819 These options are supported for Xtensa targets:
13820
13821 @table @gcctabopt
13822 @item -mconst16
13823 @itemx -mno-const16
13824 @opindex mconst16
13825 @opindex mno-const16
13826 Enable or disable use of @code{CONST16} instructions for loading
13827 constant values.  The @code{CONST16} instruction is currently not a
13828 standard option from Tensilica.  When enabled, @code{CONST16}
13829 instructions are always used in place of the standard @code{L32R}
13830 instructions.  The use of @code{CONST16} is enabled by default only if
13831 the @code{L32R} instruction is not available.
13832
13833 @item -mfused-madd
13834 @itemx -mno-fused-madd
13835 @opindex mfused-madd
13836 @opindex mno-fused-madd
13837 Enable or disable use of fused multiply/add and multiply/subtract
13838 instructions in the floating-point option.  This has no effect if the
13839 floating-point option is not also enabled.  Disabling fused multiply/add
13840 and multiply/subtract instructions forces the compiler to use separate
13841 instructions for the multiply and add/subtract operations.  This may be
13842 desirable in some cases where strict IEEE 754-compliant results are
13843 required: the fused multiply add/subtract instructions do not round the
13844 intermediate result, thereby producing results with @emph{more} bits of
13845 precision than specified by the IEEE standard.  Disabling fused multiply
13846 add/subtract instructions also ensures that the program output is not
13847 sensitive to the compiler's ability to combine multiply and add/subtract
13848 operations.
13849
13850 @item -mtext-section-literals
13851 @itemx -mno-text-section-literals
13852 @opindex mtext-section-literals
13853 @opindex mno-text-section-literals
13854 Control the treatment of literal pools.  The default is
13855 @option{-mno-text-section-literals}, which places literals in a separate
13856 section in the output file.  This allows the literal pool to be placed
13857 in a data RAM/ROM, and it also allows the linker to combine literal
13858 pools from separate object files to remove redundant literals and
13859 improve code size.  With @option{-mtext-section-literals}, the literals
13860 are interspersed in the text section in order to keep them as close as
13861 possible to their references.  This may be necessary for large assembly
13862 files.
13863
13864 @item -mtarget-align
13865 @itemx -mno-target-align
13866 @opindex mtarget-align
13867 @opindex mno-target-align
13868 When this option is enabled, GCC instructs the assembler to
13869 automatically align instructions to reduce branch penalties at the
13870 expense of some code density.  The assembler attempts to widen density
13871 instructions to align branch targets and the instructions following call
13872 instructions.  If there are not enough preceding safe density
13873 instructions to align a target, no widening will be performed.  The
13874 default is @option{-mtarget-align}.  These options do not affect the
13875 treatment of auto-aligned instructions like @code{LOOP}, which the
13876 assembler will always align, either by widening density instructions or
13877 by inserting no-op instructions.
13878
13879 @item -mlongcalls
13880 @itemx -mno-longcalls
13881 @opindex mlongcalls
13882 @opindex mno-longcalls
13883 When this option is enabled, GCC instructs the assembler to translate
13884 direct calls to indirect calls unless it can determine that the target
13885 of a direct call is in the range allowed by the call instruction.  This
13886 translation typically occurs for calls to functions in other source
13887 files.  Specifically, the assembler translates a direct @code{CALL}
13888 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
13889 The default is @option{-mno-longcalls}.  This option should be used in
13890 programs where the call target can potentially be out of range.  This
13891 option is implemented in the assembler, not the compiler, so the
13892 assembly code generated by GCC will still show direct call
13893 instructions---look at the disassembled object code to see the actual
13894 instructions.  Note that the assembler will use an indirect call for
13895 every cross-file call, not just those that really will be out of range.
13896 @end table
13897
13898 @node zSeries Options
13899 @subsection zSeries Options
13900 @cindex zSeries options
13901
13902 These are listed under @xref{S/390 and zSeries Options}.
13903
13904 @node Code Gen Options
13905 @section Options for Code Generation Conventions
13906 @cindex code generation conventions
13907 @cindex options, code generation
13908 @cindex run-time options
13909
13910 These machine-independent options control the interface conventions
13911 used in code generation.
13912
13913 Most of them have both positive and negative forms; the negative form
13914 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
13915 one of the forms is listed---the one which is not the default.  You
13916 can figure out the other form by either removing @samp{no-} or adding
13917 it.
13918
13919 @table @gcctabopt
13920 @item -fbounds-check
13921 @opindex fbounds-check
13922 For front-ends that support it, generate additional code to check that
13923 indices used to access arrays are within the declared range.  This is
13924 currently only supported by the Java and Fortran front-ends, where
13925 this option defaults to true and false respectively.
13926
13927 @item -ftrapv
13928 @opindex ftrapv
13929 This option generates traps for signed overflow on addition, subtraction,
13930 multiplication operations.
13931
13932 @item -fwrapv
13933 @opindex fwrapv
13934 This option instructs the compiler to assume that signed arithmetic
13935 overflow of addition, subtraction and multiplication wraps around
13936 using twos-complement representation.  This flag enables some optimizations
13937 and disables others.  This option is enabled by default for the Java
13938 front-end, as required by the Java language specification.
13939
13940 @item -fexceptions
13941 @opindex fexceptions
13942 Enable exception handling.  Generates extra code needed to propagate
13943 exceptions.  For some targets, this implies GCC will generate frame
13944 unwind information for all functions, which can produce significant data
13945 size overhead, although it does not affect execution.  If you do not
13946 specify this option, GCC will enable it by default for languages like
13947 C++ which normally require exception handling, and disable it for
13948 languages like C that do not normally require it.  However, you may need
13949 to enable this option when compiling C code that needs to interoperate
13950 properly with exception handlers written in C++.  You may also wish to
13951 disable this option if you are compiling older C++ programs that don't
13952 use exception handling.
13953
13954 @item -fnon-call-exceptions
13955 @opindex fnon-call-exceptions
13956 Generate code that allows trapping instructions to throw exceptions.
13957 Note that this requires platform-specific runtime support that does
13958 not exist everywhere.  Moreover, it only allows @emph{trapping}
13959 instructions to throw exceptions, i.e.@: memory references or floating
13960 point instructions.  It does not allow exceptions to be thrown from
13961 arbitrary signal handlers such as @code{SIGALRM}.
13962
13963 @item -funwind-tables
13964 @opindex funwind-tables
13965 Similar to @option{-fexceptions}, except that it will just generate any needed
13966 static data, but will not affect the generated code in any other way.
13967 You will normally not enable this option; instead, a language processor
13968 that needs this handling would enable it on your behalf.
13969
13970 @item -fasynchronous-unwind-tables
13971 @opindex fasynchronous-unwind-tables
13972 Generate unwind table in dwarf2 format, if supported by target machine.  The
13973 table is exact at each instruction boundary, so it can be used for stack
13974 unwinding from asynchronous events (such as debugger or garbage collector).
13975
13976 @item -fpcc-struct-return
13977 @opindex fpcc-struct-return
13978 Return ``short'' @code{struct} and @code{union} values in memory like
13979 longer ones, rather than in registers.  This convention is less
13980 efficient, but it has the advantage of allowing intercallability between
13981 GCC-compiled files and files compiled with other compilers, particularly
13982 the Portable C Compiler (pcc).
13983
13984 The precise convention for returning structures in memory depends
13985 on the target configuration macros.
13986
13987 Short structures and unions are those whose size and alignment match
13988 that of some integer type.
13989
13990 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13991 switch is not binary compatible with code compiled with the
13992 @option{-freg-struct-return} switch.
13993 Use it to conform to a non-default application binary interface.
13994
13995 @item -freg-struct-return
13996 @opindex freg-struct-return
13997 Return @code{struct} and @code{union} values in registers when possible.
13998 This is more efficient for small structures than
13999 @option{-fpcc-struct-return}.
14000
14001 If you specify neither @option{-fpcc-struct-return} nor
14002 @option{-freg-struct-return}, GCC defaults to whichever convention is
14003 standard for the target.  If there is no standard convention, GCC
14004 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14005 the principal compiler.  In those cases, we can choose the standard, and
14006 we chose the more efficient register return alternative.
14007
14008 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14009 switch is not binary compatible with code compiled with the
14010 @option{-fpcc-struct-return} switch.
14011 Use it to conform to a non-default application binary interface.
14012
14013 @item -fshort-enums
14014 @opindex fshort-enums
14015 Allocate to an @code{enum} type only as many bytes as it needs for the
14016 declared range of possible values.  Specifically, the @code{enum} type
14017 will be equivalent to the smallest integer type which has enough room.
14018
14019 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14020 code that is not binary compatible with code generated without that switch.
14021 Use it to conform to a non-default application binary interface.
14022
14023 @item -fshort-double
14024 @opindex fshort-double
14025 Use the same size for @code{double} as for @code{float}.
14026
14027 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
14028 code that is not binary compatible with code generated without that switch.
14029 Use it to conform to a non-default application binary interface.
14030
14031 @item -fshort-wchar
14032 @opindex fshort-wchar
14033 Override the underlying type for @samp{wchar_t} to be @samp{short
14034 unsigned int} instead of the default for the target.  This option is
14035 useful for building programs to run under WINE@.
14036
14037 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14038 code that is not binary compatible with code generated without that switch.
14039 Use it to conform to a non-default application binary interface.
14040
14041 @item -fno-common
14042 @opindex fno-common
14043 In C, allocate even uninitialized global variables in the data section of the
14044 object file, rather than generating them as common blocks.  This has the
14045 effect that if the same variable is declared (without @code{extern}) in
14046 two different compilations, you will get an error when you link them.
14047 The only reason this might be useful is if you wish to verify that the
14048 program will work on other systems which always work this way.
14049
14050 @item -fno-ident
14051 @opindex fno-ident
14052 Ignore the @samp{#ident} directive.
14053
14054 @item -finhibit-size-directive
14055 @opindex finhibit-size-directive
14056 Don't output a @code{.size} assembler directive, or anything else that
14057 would cause trouble if the function is split in the middle, and the
14058 two halves are placed at locations far apart in memory.  This option is
14059 used when compiling @file{crtstuff.c}; you should not need to use it
14060 for anything else.
14061
14062 @item -fverbose-asm
14063 @opindex fverbose-asm
14064 Put extra commentary information in the generated assembly code to
14065 make it more readable.  This option is generally only of use to those
14066 who actually need to read the generated assembly code (perhaps while
14067 debugging the compiler itself).
14068
14069 @option{-fno-verbose-asm}, the default, causes the
14070 extra information to be omitted and is useful when comparing two assembler
14071 files.
14072
14073 @item -frecord-gcc-switches
14074 @opindex frecord-gcc-switches
14075 This switch causes the command line that was used to invoke the
14076 compiler to be recorded into the object file that is being created.
14077 This switch is only implemented on some targets and the exact format
14078 of the recording is target and binary file format dependent, but it
14079 usually takes the form of a section containing ASCII text.  This
14080 switch is related to the @option{-fverbose-asm} switch, but that
14081 switch only records information in the assembler output file as
14082 comments, so it never reaches the object file.
14083
14084 @item -fpic
14085 @opindex fpic
14086 @cindex global offset table
14087 @cindex PIC
14088 Generate position-independent code (PIC) suitable for use in a shared
14089 library, if supported for the target machine.  Such code accesses all
14090 constant addresses through a global offset table (GOT)@.  The dynamic
14091 loader resolves the GOT entries when the program starts (the dynamic
14092 loader is not part of GCC; it is part of the operating system).  If
14093 the GOT size for the linked executable exceeds a machine-specific
14094 maximum size, you get an error message from the linker indicating that
14095 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14096 instead.  (These maximums are 8k on the SPARC and 32k
14097 on the m68k and RS/6000.  The 386 has no such limit.)
14098
14099 Position-independent code requires special support, and therefore works
14100 only on certain machines.  For the 386, GCC supports PIC for System V
14101 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14102 position-independent.
14103
14104 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14105 are defined to 1.
14106
14107 @item -fPIC
14108 @opindex fPIC
14109 If supported for the target machine, emit position-independent code,
14110 suitable for dynamic linking and avoiding any limit on the size of the
14111 global offset table.  This option makes a difference on the m68k,
14112 PowerPC and SPARC@.
14113
14114 Position-independent code requires special support, and therefore works
14115 only on certain machines.
14116
14117 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14118 are defined to 2.
14119
14120 @item -fpie
14121 @itemx -fPIE
14122 @opindex fpie
14123 @opindex fPIE
14124 These options are similar to @option{-fpic} and @option{-fPIC}, but
14125 generated position independent code can be only linked into executables.
14126 Usually these options are used when @option{-pie} GCC option will be
14127 used during linking.
14128
14129 @item -fno-jump-tables
14130 @opindex fno-jump-tables
14131 Do not use jump tables for switch statements even where it would be
14132 more efficient than other code generation strategies.  This option is
14133 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14134 building code which forms part of a dynamic linker and cannot
14135 reference the address of a jump table.  On some targets, jump tables
14136 do not require a GOT and this option is not needed.
14137
14138 @item -ffixed-@var{reg}
14139 @opindex ffixed
14140 Treat the register named @var{reg} as a fixed register; generated code
14141 should never refer to it (except perhaps as a stack pointer, frame
14142 pointer or in some other fixed role).
14143
14144 @var{reg} must be the name of a register.  The register names accepted
14145 are machine-specific and are defined in the @code{REGISTER_NAMES}
14146 macro in the machine description macro file.
14147
14148 This flag does not have a negative form, because it specifies a
14149 three-way choice.
14150
14151 @item -fcall-used-@var{reg}
14152 @opindex fcall-used
14153 Treat the register named @var{reg} as an allocable register that is
14154 clobbered by function calls.  It may be allocated for temporaries or
14155 variables that do not live across a call.  Functions compiled this way
14156 will not save and restore the register @var{reg}.
14157
14158 It is an error to used this flag with the frame pointer or stack pointer.
14159 Use of this flag for other registers that have fixed pervasive roles in
14160 the machine's execution model will produce disastrous results.
14161
14162 This flag does not have a negative form, because it specifies a
14163 three-way choice.
14164
14165 @item -fcall-saved-@var{reg}
14166 @opindex fcall-saved
14167 Treat the register named @var{reg} as an allocable register saved by
14168 functions.  It may be allocated even for temporaries or variables that
14169 live across a call.  Functions compiled this way will save and restore
14170 the register @var{reg} if they use it.
14171
14172 It is an error to used this flag with the frame pointer or stack pointer.
14173 Use of this flag for other registers that have fixed pervasive roles in
14174 the machine's execution model will produce disastrous results.
14175
14176 A different sort of disaster will result from the use of this flag for
14177 a register in which function values may be returned.
14178
14179 This flag does not have a negative form, because it specifies a
14180 three-way choice.
14181
14182 @item -fpack-struct[=@var{n}]
14183 @opindex fpack-struct
14184 Without a value specified, pack all structure members together without
14185 holes.  When a value is specified (which must be a small power of two), pack
14186 structure members according to this value, representing the maximum
14187 alignment (that is, objects with default alignment requirements larger than
14188 this will be output potentially unaligned at the next fitting location.
14189
14190 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14191 code that is not binary compatible with code generated without that switch.
14192 Additionally, it makes the code suboptimal.
14193 Use it to conform to a non-default application binary interface.
14194
14195 @item -finstrument-functions
14196 @opindex finstrument-functions
14197 Generate instrumentation calls for entry and exit to functions.  Just
14198 after function entry and just before function exit, the following
14199 profiling functions will be called with the address of the current
14200 function and its call site.  (On some platforms,
14201 @code{__builtin_return_address} does not work beyond the current
14202 function, so the call site information may not be available to the
14203 profiling functions otherwise.)
14204
14205 @smallexample
14206 void __cyg_profile_func_enter (void *this_fn,
14207                                void *call_site);
14208 void __cyg_profile_func_exit  (void *this_fn,
14209                                void *call_site);
14210 @end smallexample
14211
14212 The first argument is the address of the start of the current function,
14213 which may be looked up exactly in the symbol table.
14214
14215 This instrumentation is also done for functions expanded inline in other
14216 functions.  The profiling calls will indicate where, conceptually, the
14217 inline function is entered and exited.  This means that addressable
14218 versions of such functions must be available.  If all your uses of a
14219 function are expanded inline, this may mean an additional expansion of
14220 code size.  If you use @samp{extern inline} in your C code, an
14221 addressable version of such functions must be provided.  (This is
14222 normally the case anyways, but if you get lucky and the optimizer always
14223 expands the functions inline, you might have gotten away without
14224 providing static copies.)
14225
14226 A function may be given the attribute @code{no_instrument_function}, in
14227 which case this instrumentation will not be done.  This can be used, for
14228 example, for the profiling functions listed above, high-priority
14229 interrupt routines, and any functions from which the profiling functions
14230 cannot safely be called (perhaps signal handlers, if the profiling
14231 routines generate output or allocate memory).
14232
14233 @item -fstack-check
14234 @opindex fstack-check
14235 Generate code to verify that you do not go beyond the boundary of the
14236 stack.  You should specify this flag if you are running in an
14237 environment with multiple threads, but only rarely need to specify it in
14238 a single-threaded environment since stack overflow is automatically
14239 detected on nearly all systems if there is only one stack.
14240
14241 Note that this switch does not actually cause checking to be done; the
14242 operating system must do that.  The switch causes generation of code
14243 to ensure that the operating system sees the stack being extended.
14244
14245 @item -fstack-limit-register=@var{reg}
14246 @itemx -fstack-limit-symbol=@var{sym}
14247 @itemx -fno-stack-limit
14248 @opindex fstack-limit-register
14249 @opindex fstack-limit-symbol
14250 @opindex fno-stack-limit
14251 Generate code to ensure that the stack does not grow beyond a certain value,
14252 either the value of a register or the address of a symbol.  If the stack
14253 would grow beyond the value, a signal is raised.  For most targets,
14254 the signal is raised before the stack overruns the boundary, so
14255 it is possible to catch the signal without taking special precautions.
14256
14257 For instance, if the stack starts at absolute address @samp{0x80000000}
14258 and grows downwards, you can use the flags
14259 @option{-fstack-limit-symbol=__stack_limit} and
14260 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
14261 of 128KB@.  Note that this may only work with the GNU linker.
14262
14263 @cindex aliasing of parameters
14264 @cindex parameters, aliased
14265 @item -fargument-alias
14266 @itemx -fargument-noalias
14267 @itemx -fargument-noalias-global
14268 @itemx -fargument-noalias-anything
14269 @opindex fargument-alias
14270 @opindex fargument-noalias
14271 @opindex fargument-noalias-global
14272 @opindex fargument-noalias-anything
14273 Specify the possible relationships among parameters and between
14274 parameters and global data.
14275
14276 @option{-fargument-alias} specifies that arguments (parameters) may
14277 alias each other and may alias global storage.@*
14278 @option{-fargument-noalias} specifies that arguments do not alias
14279 each other, but may alias global storage.@*
14280 @option{-fargument-noalias-global} specifies that arguments do not
14281 alias each other and do not alias global storage.
14282 @option{-fargument-noalias-anything} specifies that arguments do not
14283 alias any other storage.
14284
14285 Each language will automatically use whatever option is required by
14286 the language standard.  You should not need to use these options yourself.
14287
14288 @item -fleading-underscore
14289 @opindex fleading-underscore
14290 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
14291 change the way C symbols are represented in the object file.  One use
14292 is to help link with legacy assembly code.
14293
14294 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
14295 generate code that is not binary compatible with code generated without that
14296 switch.  Use it to conform to a non-default application binary interface.
14297 Not all targets provide complete support for this switch.
14298
14299 @item -ftls-model=@var{model}
14300 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
14301 The @var{model} argument should be one of @code{global-dynamic},
14302 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
14303
14304 The default without @option{-fpic} is @code{initial-exec}; with
14305 @option{-fpic} the default is @code{global-dynamic}.
14306
14307 @item -fvisibility=@var{default|internal|hidden|protected}
14308 @opindex fvisibility
14309 Set the default ELF image symbol visibility to the specified option---all
14310 symbols will be marked with this unless overridden within the code.
14311 Using this feature can very substantially improve linking and
14312 load times of shared object libraries, produce more optimized
14313 code, provide near-perfect API export and prevent symbol clashes.
14314 It is @strong{strongly} recommended that you use this in any shared objects
14315 you distribute.
14316
14317 Despite the nomenclature, @code{default} always means public ie;
14318 available to be linked against from outside the shared object.
14319 @code{protected} and @code{internal} are pretty useless in real-world
14320 usage so the only other commonly used option will be @code{hidden}.
14321 The default if @option{-fvisibility} isn't specified is
14322 @code{default}, i.e., make every
14323 symbol public---this causes the same behavior as previous versions of
14324 GCC@.
14325
14326 A good explanation of the benefits offered by ensuring ELF
14327 symbols have the correct visibility is given by ``How To Write
14328 Shared Libraries'' by Ulrich Drepper (which can be found at
14329 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
14330 solution made possible by this option to marking things hidden when
14331 the default is public is to make the default hidden and mark things
14332 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
14333 and @code{__attribute__ ((visibility("default")))} instead of
14334 @code{__declspec(dllexport)} you get almost identical semantics with
14335 identical syntax.  This is a great boon to those working with
14336 cross-platform projects.
14337
14338 For those adding visibility support to existing code, you may find
14339 @samp{#pragma GCC visibility} of use.  This works by you enclosing
14340 the declarations you wish to set visibility for with (for example)
14341 @samp{#pragma GCC visibility push(hidden)} and
14342 @samp{#pragma GCC visibility pop}.
14343 Bear in mind that symbol visibility should be viewed @strong{as
14344 part of the API interface contract} and thus all new code should
14345 always specify visibility when it is not the default ie; declarations
14346 only for use within the local DSO should @strong{always} be marked explicitly
14347 as hidden as so to avoid PLT indirection overheads---making this
14348 abundantly clear also aids readability and self-documentation of the code.
14349 Note that due to ISO C++ specification requirements, operator new and
14350 operator delete must always be of default visibility.
14351
14352 Be aware that headers from outside your project, in particular system
14353 headers and headers from any other library you use, may not be
14354 expecting to be compiled with visibility other than the default.  You
14355 may need to explicitly say @samp{#pragma GCC visibility push(default)}
14356 before including any such headers.
14357
14358 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
14359 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
14360 no modifications.  However, this means that calls to @samp{extern}
14361 functions with no explicit visibility will use the PLT, so it is more
14362 effective to use @samp{__attribute ((visibility))} and/or
14363 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
14364 declarations should be treated as hidden.
14365
14366 Note that @samp{-fvisibility} does affect C++ vague linkage
14367 entities. This means that, for instance, an exception class that will
14368 be thrown between DSOs must be explicitly marked with default
14369 visibility so that the @samp{type_info} nodes will be unified between
14370 the DSOs.
14371
14372 An overview of these techniques, their benefits and how to use them
14373 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
14374
14375 @end table
14376
14377 @c man end
14378
14379 @node Environment Variables
14380 @section Environment Variables Affecting GCC
14381 @cindex environment variables
14382
14383 @c man begin ENVIRONMENT
14384 This section describes several environment variables that affect how GCC
14385 operates.  Some of them work by specifying directories or prefixes to use
14386 when searching for various kinds of files.  Some are used to specify other
14387 aspects of the compilation environment.
14388
14389 Note that you can also specify places to search using options such as
14390 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
14391 take precedence over places specified using environment variables, which
14392 in turn take precedence over those specified by the configuration of GCC@.
14393 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
14394 GNU Compiler Collection (GCC) Internals}.
14395
14396 @table @env
14397 @item LANG
14398 @itemx LC_CTYPE
14399 @c @itemx LC_COLLATE
14400 @itemx LC_MESSAGES
14401 @c @itemx LC_MONETARY
14402 @c @itemx LC_NUMERIC
14403 @c @itemx LC_TIME
14404 @itemx LC_ALL
14405 @findex LANG
14406 @findex LC_CTYPE
14407 @c @findex LC_COLLATE
14408 @findex LC_MESSAGES
14409 @c @findex LC_MONETARY
14410 @c @findex LC_NUMERIC
14411 @c @findex LC_TIME
14412 @findex LC_ALL
14413 @cindex locale
14414 These environment variables control the way that GCC uses
14415 localization information that allow GCC to work with different
14416 national conventions.  GCC inspects the locale categories
14417 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
14418 so.  These locale categories can be set to any value supported by your
14419 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
14420 Kingdom encoded in UTF-8.
14421
14422 The @env{LC_CTYPE} environment variable specifies character
14423 classification.  GCC uses it to determine the character boundaries in
14424 a string; this is needed for some multibyte encodings that contain quote
14425 and escape characters that would otherwise be interpreted as a string
14426 end or escape.
14427
14428 The @env{LC_MESSAGES} environment variable specifies the language to
14429 use in diagnostic messages.
14430
14431 If the @env{LC_ALL} environment variable is set, it overrides the value
14432 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
14433 and @env{LC_MESSAGES} default to the value of the @env{LANG}
14434 environment variable.  If none of these variables are set, GCC
14435 defaults to traditional C English behavior.
14436
14437 @item TMPDIR
14438 @findex TMPDIR
14439 If @env{TMPDIR} is set, it specifies the directory to use for temporary
14440 files.  GCC uses temporary files to hold the output of one stage of
14441 compilation which is to be used as input to the next stage: for example,
14442 the output of the preprocessor, which is the input to the compiler
14443 proper.
14444
14445 @item GCC_EXEC_PREFIX
14446 @findex GCC_EXEC_PREFIX
14447 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
14448 names of the subprograms executed by the compiler.  No slash is added
14449 when this prefix is combined with the name of a subprogram, but you can
14450 specify a prefix that ends with a slash if you wish.
14451
14452 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
14453 an appropriate prefix to use based on the pathname it was invoked with.
14454
14455 If GCC cannot find the subprogram using the specified prefix, it
14456 tries looking in the usual places for the subprogram.
14457
14458 The default value of @env{GCC_EXEC_PREFIX} is
14459 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
14460 the installed compiler. In many cases @var{prefix} is the value
14461 of @code{prefix} when you ran the @file{configure} script.
14462
14463 Other prefixes specified with @option{-B} take precedence over this prefix.
14464
14465 This prefix is also used for finding files such as @file{crt0.o} that are
14466 used for linking.
14467
14468 In addition, the prefix is used in an unusual way in finding the
14469 directories to search for header files.  For each of the standard
14470 directories whose name normally begins with @samp{/usr/local/lib/gcc}
14471 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
14472 replacing that beginning with the specified prefix to produce an
14473 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
14474 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
14475 These alternate directories are searched first; the standard directories
14476 come next. If a standard directory begins with the configured 
14477 @var{prefix} then the value of @var{prefix} is replaced by 
14478 @env{GCC_EXEC_PREFIX} when looking for header files.
14479
14480 @item COMPILER_PATH
14481 @findex COMPILER_PATH
14482 The value of @env{COMPILER_PATH} is a colon-separated list of
14483 directories, much like @env{PATH}.  GCC tries the directories thus
14484 specified when searching for subprograms, if it can't find the
14485 subprograms using @env{GCC_EXEC_PREFIX}.
14486
14487 @item LIBRARY_PATH
14488 @findex LIBRARY_PATH
14489 The value of @env{LIBRARY_PATH} is a colon-separated list of
14490 directories, much like @env{PATH}.  When configured as a native compiler,
14491 GCC tries the directories thus specified when searching for special
14492 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
14493 using GCC also uses these directories when searching for ordinary
14494 libraries for the @option{-l} option (but directories specified with
14495 @option{-L} come first).
14496
14497 @item LANG
14498 @findex LANG
14499 @cindex locale definition
14500 This variable is used to pass locale information to the compiler.  One way in
14501 which this information is used is to determine the character set to be used
14502 when character literals, string literals and comments are parsed in C and C++.
14503 When the compiler is configured to allow multibyte characters,
14504 the following values for @env{LANG} are recognized:
14505
14506 @table @samp
14507 @item C-JIS
14508 Recognize JIS characters.
14509 @item C-SJIS
14510 Recognize SJIS characters.
14511 @item C-EUCJP
14512 Recognize EUCJP characters.
14513 @end table
14514
14515 If @env{LANG} is not defined, or if it has some other value, then the
14516 compiler will use mblen and mbtowc as defined by the default locale to
14517 recognize and translate multibyte characters.
14518 @end table
14519
14520 @noindent
14521 Some additional environments variables affect the behavior of the
14522 preprocessor.
14523
14524 @include cppenv.texi
14525
14526 @c man end
14527
14528 @node Precompiled Headers
14529 @section Using Precompiled Headers
14530 @cindex precompiled headers
14531 @cindex speed of compilation
14532
14533 Often large projects have many header files that are included in every
14534 source file.  The time the compiler takes to process these header files
14535 over and over again can account for nearly all of the time required to
14536 build the project.  To make builds faster, GCC allows users to
14537 `precompile' a header file; then, if builds can use the precompiled
14538 header file they will be much faster.
14539
14540 To create a precompiled header file, simply compile it as you would any
14541 other file, if necessary using the @option{-x} option to make the driver
14542 treat it as a C or C++ header file.  You will probably want to use a
14543 tool like @command{make} to keep the precompiled header up-to-date when
14544 the headers it contains change.
14545
14546 A precompiled header file will be searched for when @code{#include} is
14547 seen in the compilation.  As it searches for the included file
14548 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
14549 compiler looks for a precompiled header in each directory just before it
14550 looks for the include file in that directory.  The name searched for is
14551 the name specified in the @code{#include} with @samp{.gch} appended.  If
14552 the precompiled header file can't be used, it is ignored.
14553
14554 For instance, if you have @code{#include "all.h"}, and you have
14555 @file{all.h.gch} in the same directory as @file{all.h}, then the
14556 precompiled header file will be used if possible, and the original
14557 header will be used otherwise.
14558
14559 Alternatively, you might decide to put the precompiled header file in a
14560 directory and use @option{-I} to ensure that directory is searched
14561 before (or instead of) the directory containing the original header.
14562 Then, if you want to check that the precompiled header file is always
14563 used, you can put a file of the same name as the original header in this
14564 directory containing an @code{#error} command.
14565
14566 This also works with @option{-include}.  So yet another way to use
14567 precompiled headers, good for projects not designed with precompiled
14568 header files in mind, is to simply take most of the header files used by
14569 a project, include them from another header file, precompile that header
14570 file, and @option{-include} the precompiled header.  If the header files
14571 have guards against multiple inclusion, they will be skipped because
14572 they've already been included (in the precompiled header).
14573
14574 If you need to precompile the same header file for different
14575 languages, targets, or compiler options, you can instead make a
14576 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14577 header in the directory, perhaps using @option{-o}.  It doesn't matter
14578 what you call the files in the directory, every precompiled header in
14579 the directory will be considered.  The first precompiled header
14580 encountered in the directory that is valid for this compilation will
14581 be used; they're searched in no particular order.
14582
14583 There are many other possibilities, limited only by your imagination,
14584 good sense, and the constraints of your build system.
14585
14586 A precompiled header file can be used only when these conditions apply:
14587
14588 @itemize
14589 @item
14590 Only one precompiled header can be used in a particular compilation.
14591
14592 @item
14593 A precompiled header can't be used once the first C token is seen.  You
14594 can have preprocessor directives before a precompiled header; you can
14595 even include a precompiled header from inside another header, so long as
14596 there are no C tokens before the @code{#include}.
14597
14598 @item
14599 The precompiled header file must be produced for the same language as
14600 the current compilation.  You can't use a C precompiled header for a C++
14601 compilation.
14602
14603 @item
14604 The precompiled header file must have been produced by the same compiler
14605 binary as the current compilation is using.
14606
14607 @item
14608 Any macros defined before the precompiled header is included must
14609 either be defined in the same way as when the precompiled header was
14610 generated, or must not affect the precompiled header, which usually
14611 means that they don't appear in the precompiled header at all.
14612
14613 The @option{-D} option is one way to define a macro before a
14614 precompiled header is included; using a @code{#define} can also do it.
14615 There are also some options that define macros implicitly, like
14616 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14617 defined this way.
14618
14619 @item If debugging information is output when using the precompiled
14620 header, using @option{-g} or similar, the same kind of debugging information
14621 must have been output when building the precompiled header.  However,
14622 a precompiled header built using @option{-g} can be used in a compilation
14623 when no debugging information is being output.
14624
14625 @item The same @option{-m} options must generally be used when building
14626 and using the precompiled header.  @xref{Submodel Options},
14627 for any cases where this rule is relaxed.
14628
14629 @item Each of the following options must be the same when building and using
14630 the precompiled header:
14631
14632 @gccoptlist{-fexceptions -funit-at-a-time}
14633
14634 @item
14635 Some other command-line options starting with @option{-f},
14636 @option{-p}, or @option{-O} must be defined in the same way as when
14637 the precompiled header was generated.  At present, it's not clear
14638 which options are safe to change and which are not; the safest choice
14639 is to use exactly the same options when generating and using the
14640 precompiled header.  The following are known to be safe:
14641
14642 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
14643 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
14644 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
14645 -pedantic-errors}
14646
14647 @end itemize
14648
14649 For all of these except the last, the compiler will automatically
14650 ignore the precompiled header if the conditions aren't met.  If you
14651 find an option combination that doesn't work and doesn't cause the
14652 precompiled header to be ignored, please consider filing a bug report,
14653 see @ref{Bugs}.
14654
14655 If you do use differing options when generating and using the
14656 precompiled header, the actual behavior will be a mixture of the
14657 behavior for the options.  For instance, if you use @option{-g} to
14658 generate the precompiled header but not when using it, you may or may
14659 not get debugging information for routines in the precompiled header.
14660
14661 @node Running Protoize
14662 @section Running Protoize
14663
14664 The program @code{protoize} is an optional part of GCC@.  You can use
14665 it to add prototypes to a program, thus converting the program to ISO
14666 C in one respect.  The companion program @code{unprotoize} does the
14667 reverse: it removes argument types from any prototypes that are found.
14668
14669 When you run these programs, you must specify a set of source files as
14670 command line arguments.  The conversion programs start out by compiling
14671 these files to see what functions they define.  The information gathered
14672 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
14673
14674 After scanning comes actual conversion.  The specified files are all
14675 eligible to be converted; any files they include (whether sources or
14676 just headers) are eligible as well.
14677
14678 But not all the eligible files are converted.  By default,
14679 @code{protoize} and @code{unprotoize} convert only source and header
14680 files in the current directory.  You can specify additional directories
14681 whose files should be converted with the @option{-d @var{directory}}
14682 option.  You can also specify particular files to exclude with the
14683 @option{-x @var{file}} option.  A file is converted if it is eligible, its
14684 directory name matches one of the specified directory names, and its
14685 name within the directory has not been excluded.
14686
14687 Basic conversion with @code{protoize} consists of rewriting most
14688 function definitions and function declarations to specify the types of
14689 the arguments.  The only ones not rewritten are those for varargs
14690 functions.
14691
14692 @code{protoize} optionally inserts prototype declarations at the
14693 beginning of the source file, to make them available for any calls that
14694 precede the function's definition.  Or it can insert prototype
14695 declarations with block scope in the blocks where undeclared functions
14696 are called.
14697
14698 Basic conversion with @code{unprotoize} consists of rewriting most
14699 function declarations to remove any argument types, and rewriting
14700 function definitions to the old-style pre-ISO form.
14701
14702 Both conversion programs print a warning for any function declaration or
14703 definition that they can't convert.  You can suppress these warnings
14704 with @option{-q}.
14705
14706 The output from @code{protoize} or @code{unprotoize} replaces the
14707 original source file.  The original file is renamed to a name ending
14708 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
14709 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
14710 for DOS) file already exists, then the source file is simply discarded.
14711
14712 @code{protoize} and @code{unprotoize} both depend on GCC itself to
14713 scan the program and collect information about the functions it uses.
14714 So neither of these programs will work until GCC is installed.
14715
14716 Here is a table of the options you can use with @code{protoize} and
14717 @code{unprotoize}.  Each option works with both programs unless
14718 otherwise stated.
14719
14720 @table @code
14721 @item -B @var{directory}
14722 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
14723 usual directory (normally @file{/usr/local/lib}).  This file contains
14724 prototype information about standard system functions.  This option
14725 applies only to @code{protoize}.
14726
14727 @item -c @var{compilation-options}
14728 Use @var{compilation-options} as the options when running @command{gcc} to
14729 produce the @samp{.X} files.  The special option @option{-aux-info} is
14730 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
14731
14732 Note that the compilation options must be given as a single argument to
14733 @code{protoize} or @code{unprotoize}.  If you want to specify several
14734 @command{gcc} options, you must quote the entire set of compilation options
14735 to make them a single word in the shell.
14736
14737 There are certain @command{gcc} arguments that you cannot use, because they
14738 would produce the wrong kind of output.  These include @option{-g},
14739 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
14740 the @var{compilation-options}, they are ignored.
14741
14742 @item -C
14743 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
14744 systems) instead of @samp{.c}.  This is convenient if you are converting
14745 a C program to C++.  This option applies only to @code{protoize}.
14746
14747 @item -g
14748 Add explicit global declarations.  This means inserting explicit
14749 declarations at the beginning of each source file for each function
14750 that is called in the file and was not declared.  These declarations
14751 precede the first function definition that contains a call to an
14752 undeclared function.  This option applies only to @code{protoize}.
14753
14754 @item -i @var{string}
14755 Indent old-style parameter declarations with the string @var{string}.
14756 This option applies only to @code{protoize}.
14757
14758 @code{unprotoize} converts prototyped function definitions to old-style
14759 function definitions, where the arguments are declared between the
14760 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
14761 uses five spaces as the indentation.  If you want to indent with just
14762 one space instead, use @option{-i " "}.
14763
14764 @item -k
14765 Keep the @samp{.X} files.  Normally, they are deleted after conversion
14766 is finished.
14767
14768 @item -l
14769 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
14770 a prototype declaration for each function in each block which calls the
14771 function without any declaration.  This option applies only to
14772 @code{protoize}.
14773
14774 @item -n
14775 Make no real changes.  This mode just prints information about the conversions
14776 that would have been done without @option{-n}.
14777
14778 @item -N
14779 Make no @samp{.save} files.  The original files are simply deleted.
14780 Use this option with caution.
14781
14782 @item -p @var{program}
14783 Use the program @var{program} as the compiler.  Normally, the name
14784 @file{gcc} is used.
14785
14786 @item -q
14787 Work quietly.  Most warnings are suppressed.
14788
14789 @item -v
14790 Print the version number, just like @option{-v} for @command{gcc}.
14791 @end table
14792
14793 If you need special compiler options to compile one of your program's
14794 source files, then you should generate that file's @samp{.X} file
14795 specially, by running @command{gcc} on that source file with the
14796 appropriate options and the option @option{-aux-info}.  Then run
14797 @code{protoize} on the entire set of files.  @code{protoize} will use
14798 the existing @samp{.X} file because it is newer than the source file.
14799 For example:
14800
14801 @smallexample
14802 gcc -Dfoo=bar file1.c -aux-info file1.X
14803 protoize *.c
14804 @end smallexample
14805
14806 @noindent
14807 You need to include the special files along with the rest in the
14808 @code{protoize} command, even though their @samp{.X} files already
14809 exist, because otherwise they won't get converted.
14810
14811 @xref{Protoize Caveats}, for more information on how to use
14812 @code{protoize} successfully.