OSDN Git Service

2007-03-14 Dirk Mueller <dmueller@suse.de>
[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 @gol
258 -Wvariadic-macros -Wvla @gol
259 -Wvolatile-register-var  -Wwrite-strings}
260
261 @item C-only Warning Options
262 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
263 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
264 -Wold-style-declaration  -Wold-style-definition @gol
265 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
266 -Wdeclaration-after-statement -Wpointer-sign}
267
268 @item Debugging Options
269 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
270 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
271 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
272 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
273 -fdump-ipa-all -fdump-ipa-cgraph @gol
274 -fdump-tree-all @gol
275 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
276 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
277 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
278 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
279 -fdump-tree-ch @gol
280 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
281 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
282 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
283 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
284 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
285 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
288 -fdump-tree-nrv -fdump-tree-vect @gol
289 -fdump-tree-sink @gol
290 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-salias @gol
292 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
294 -ftree-vectorizer-verbose=@var{n} @gol
295 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
296 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
297 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
298 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
299 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
300 -ftest-coverage  -ftime-report -fvar-tracking @gol
301 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
302 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
303 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
304 -print-multi-directory  -print-multi-lib @gol
305 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
306 -print-sysroot-headers-suffix @gol
307 -save-temps  -time}
308
309 @item Optimization Options
310 @xref{Optimize Options,,Options that Control Optimization}.
311 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
312 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
313 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
314 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
315 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
316 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
317 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
318 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
319 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
320 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
321 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
322 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
323 -finline-functions  -finline-functions-called-once @gol
324 -finline-limit=@var{n}  -fkeep-inline-functions @gol
325 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
326 -fmodulo-sched -fno-branch-count-reg @gol
327 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
328 -fno-function-cse  -fno-guess-branch-probability @gol
329 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
330 -funsafe-math-optimizations  -funsafe-loop-optimizations @gol
331 -ffinite-math-only  -fno-signed-zeros @gol
332 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
333 -fomit-frame-pointer  -foptimize-register-move @gol
334 -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
335 -fprofile-generate -fprofile-use @gol
336 -fregmove  -frename-registers @gol
337 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
338 -frerun-cse-after-loop @gol
339 -frounding-math -frtl-abstract-sequences @gol
340 -fschedule-insns  -fschedule-insns2 @gol
341 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
342 -fsched-spec-load-dangerous  @gol
343 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
344 -fsched2-use-superblocks @gol
345 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
346 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
347 -fno-split-wide-types -fstack-protector  -fstack-protector-all @gol
348 -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps @gol
349 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
350 -fsplit-ivs-in-unroller -funswitch-loops @gol
351 -fvariable-expansion-in-unroller @gol
352 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
353 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
354 -fcheck-data-deps @gol
355 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
356 -ftree-ch -ftree-sra -ftree-ter -ftree-fre -ftree-vectorize @gol
357 -ftree-vect-loop-version -ftree-salias -fipa-pta -fweb @gol
358 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
359 --param @var{name}=@var{value}
360 -O  -O0  -O1  -O2  -O3  -Os}
361
362 @item Preprocessor Options
363 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
364 @gccoptlist{-A@var{question}=@var{answer} @gol
365 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
366 -C  -dD  -dI  -dM  -dN @gol
367 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
368 -idirafter @var{dir} @gol
369 -include @var{file}  -imacros @var{file} @gol
370 -iprefix @var{file}  -iwithprefix @var{dir} @gol
371 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
372 -imultilib @var{dir} -isysroot @var{dir} @gol
373 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
374 -P  -fworking-directory  -remap @gol
375 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
376 -Xpreprocessor @var{option}}
377
378 @item Assembler Option
379 @xref{Assembler Options,,Passing Options to the Assembler}.
380 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
381
382 @item Linker Options
383 @xref{Link Options,,Options for Linking}.
384 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
385 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
386 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
387 -Wl,@var{option}  -Xlinker @var{option} @gol
388 -u @var{symbol}}
389
390 @item Directory Options
391 @xref{Directory Options,,Options for Directory Search}.
392 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
393 -specs=@var{file}  -I- --sysroot=@var{dir}}
394
395 @item Target Options
396 @c I wrote this xref this way to avoid overfull hbox. -- rms
397 @xref{Target Options}.
398 @gccoptlist{-V @var{version}  -b @var{machine}}
399
400 @item Machine Dependent Options
401 @xref{Submodel Options,,Hardware Models and Configurations}.
402 @c This list is ordered alphanumerically by subsection name.
403 @c Try and put the significant identifier (CPU or system) first,
404 @c so users have a clue at guessing where the ones they want will be.
405
406 @emph{ARC Options}
407 @gccoptlist{-EB  -EL @gol
408 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
409 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
410
411 @emph{ARM Options}
412 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
413 -mabi=@var{name} @gol
414 -mapcs-stack-check  -mno-apcs-stack-check @gol
415 -mapcs-float  -mno-apcs-float @gol
416 -mapcs-reentrant  -mno-apcs-reentrant @gol
417 -msched-prolog  -mno-sched-prolog @gol
418 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
419 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
420 -mthumb-interwork  -mno-thumb-interwork @gol
421 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
422 -mstructure-size-boundary=@var{n} @gol
423 -mabort-on-noreturn @gol
424 -mlong-calls  -mno-long-calls @gol
425 -msingle-pic-base  -mno-single-pic-base @gol
426 -mpic-register=@var{reg} @gol
427 -mnop-fun-dllimport @gol
428 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
429 -mpoke-function-name @gol
430 -mthumb  -marm @gol
431 -mtpcs-frame  -mtpcs-leaf-frame @gol
432 -mcaller-super-interworking  -mcallee-super-interworking @gol
433 -mtp=@var{name}}
434
435 @emph{AVR Options}
436 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
437 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
438
439 @emph{Blackfin Options}
440 @gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol
441 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly @gol
442 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
443 -mno-id-shared-library -mshared-library-id=@var{n} @gol
444 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
445 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls}
446
447 @emph{CRIS Options}
448 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
449 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
450 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
451 -mstack-align  -mdata-align  -mconst-align @gol
452 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
453 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
454 -mmul-bug-workaround  -mno-mul-bug-workaround}
455
456 @emph{CRX Options}
457 @gccoptlist{-mmac -mpush-args}
458
459 @emph{Darwin Options}
460 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
461 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
462 -client_name  -compatibility_version  -current_version @gol
463 -dead_strip @gol
464 -dependency-file  -dylib_file  -dylinker_install_name @gol
465 -dynamic  -dynamiclib  -exported_symbols_list @gol
466 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
467 -force_flat_namespace  -headerpad_max_install_names @gol
468 -iframework @gol
469 -image_base  -init  -install_name  -keep_private_externs @gol
470 -multi_module  -multiply_defined  -multiply_defined_unused @gol
471 -noall_load   -no_dead_strip_inits_and_terms @gol
472 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
473 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
474 -private_bundle  -read_only_relocs  -sectalign @gol
475 -sectobjectsymbols  -whyload  -seg1addr @gol
476 -sectcreate  -sectobjectsymbols  -sectorder @gol
477 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
478 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
479 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
480 -single_module  -static  -sub_library  -sub_umbrella @gol
481 -twolevel_namespace  -umbrella  -undefined @gol
482 -unexported_symbols_list  -weak_reference_mismatches @gol
483 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
484 -mkernel -mone-byte-bool}
485
486 @emph{DEC Alpha Options}
487 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
488 -mieee  -mieee-with-inexact  -mieee-conformant @gol
489 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
490 -mtrap-precision=@var{mode}  -mbuild-constants @gol
491 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
492 -mbwx  -mmax  -mfix  -mcix @gol
493 -mfloat-vax  -mfloat-ieee @gol
494 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
495 -msmall-text  -mlarge-text @gol
496 -mmemory-latency=@var{time}}
497
498 @emph{DEC Alpha/VMS Options}
499 @gccoptlist{-mvms-return-codes}
500
501 @emph{FRV Options}
502 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
503 -mhard-float  -msoft-float @gol
504 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
505 -mdouble  -mno-double @gol
506 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
507 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
508 -mlinked-fp  -mlong-calls  -malign-labels @gol
509 -mlibrary-pic  -macc-4  -macc-8 @gol
510 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
511 -moptimize-membar -mno-optimize-membar @gol
512 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
513 -mvliw-branch  -mno-vliw-branch @gol
514 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
515 -mno-nested-cond-exec  -mtomcat-stats @gol
516 -mTLS -mtls @gol
517 -mcpu=@var{cpu}}
518
519 @emph{GNU/Linux Options}
520 @gccoptlist{-muclibc}
521
522 @emph{H8/300 Options}
523 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
524
525 @emph{HPPA Options}
526 @gccoptlist{-march=@var{architecture-type} @gol
527 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
528 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
529 -mfixed-range=@var{register-range} @gol
530 -mjump-in-delay -mlinker-opt -mlong-calls @gol
531 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
532 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
533 -mno-jump-in-delay  -mno-long-load-store @gol
534 -mno-portable-runtime  -mno-soft-float @gol
535 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
536 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
537 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
538 -munix=@var{unix-std}  -nolibdld  -static  -threads}
539
540 @emph{i386 and x86-64 Options}
541 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
542 -mfpmath=@var{unit} @gol
543 -masm=@var{dialect}  -mno-fancy-math-387 @gol
544 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
545 -mno-wide-multiply  -mrtd  -malign-double @gol
546 -mpreferred-stack-boundary=@var{num} -mcx16 -msahf @gol
547 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4a -m3dnow -mpopcnt -mabm @gol
548 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
549 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
550 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
551 -mstackrealign @gol
552 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
553 -mcmodel=@var{code-model} @gol
554 -m32  -m64 -mlarge-data-threshold=@var{num}}
555
556 @emph{IA-64 Options}
557 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
558 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
559 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
560 -minline-float-divide-max-throughput @gol
561 -minline-int-divide-min-latency @gol
562 -minline-int-divide-max-throughput  @gol
563 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
564 -mno-dwarf2-asm -mearly-stop-bits @gol
565 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
566 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
567 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
568 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
569 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
570 -mno-sched-prefer-non-data-spec-insns @gol
571 -mno-sched-prefer-non-control-spec-insns @gol
572 -mno-sched-count-spec-in-critical-path}
573
574 @emph{M32R/D Options}
575 @gccoptlist{-m32r2 -m32rx -m32r @gol
576 -mdebug @gol
577 -malign-loops -mno-align-loops @gol
578 -missue-rate=@var{number} @gol
579 -mbranch-cost=@var{number} @gol
580 -mmodel=@var{code-size-model-type} @gol
581 -msdata=@var{sdata-type} @gol
582 -mno-flush-func -mflush-func=@var{name} @gol
583 -mno-flush-trap -mflush-trap=@var{number} @gol
584 -G @var{num}}
585
586 @emph{M32C Options}
587 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
588
589 @emph{M680x0 Options}
590 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
591 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
592 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
593 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
594 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
595 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
596 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
597 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
598
599 @emph{M68hc1x Options}
600 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
601 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
602 -msoft-reg-count=@var{count}}
603
604 @emph{MCore Options}
605 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
606 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
607 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
608 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
609 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
610
611 @emph{MIPS Options}
612 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
613 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
614 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
615 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64  @gol
616 -mfp32  -mfp64  -mhard-float  -msoft-float  @gol
617 -msingle-float  -mdouble-float  -mdsp  -mdspr2  -mpaired-single  -mips3d @gol
618 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
619 -G@var{num}  -membedded-data  -mno-embedded-data @gol
620 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
621 -msplit-addresses  -mno-split-addresses  @gol
622 -mexplicit-relocs  -mno-explicit-relocs  @gol
623 -mcheck-zero-division  -mno-check-zero-division @gol
624 -mdivide-traps  -mdivide-breaks @gol
625 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
626 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
627 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
628 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130 @gol
629 -mfix-sb1  -mno-fix-sb1 @gol
630 -mflush-func=@var{func}  -mno-flush-func @gol
631 -mbranch-likely  -mno-branch-likely @gol
632 -mfp-exceptions -mno-fp-exceptions @gol
633 -mvr4130-align -mno-vr4130-align}
634
635 @emph{MMIX Options}
636 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
637 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
638 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
639 -mno-base-addresses  -msingle-exit  -mno-single-exit}
640
641 @emph{MN10300 Options}
642 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
643 -mam33  -mno-am33 @gol
644 -mam33-2  -mno-am33-2 @gol
645 -mreturn-pointer-on-d0 @gol
646 -mno-crt0  -mrelax}
647
648 @emph{MT Options}
649 @gccoptlist{-mno-crt0 -mbacc -msim @gol
650 -march=@var{cpu-type} }
651
652 @emph{PDP-11 Options}
653 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
654 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
655 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
656 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
657 -mbranch-expensive  -mbranch-cheap @gol
658 -msplit  -mno-split  -munix-asm  -mdec-asm}
659
660 @emph{PowerPC Options}
661 See RS/6000 and PowerPC Options.
662
663 @emph{RS/6000 and PowerPC Options}
664 @gccoptlist{-mcpu=@var{cpu-type} @gol
665 -mtune=@var{cpu-type} @gol
666 -mpower  -mno-power  -mpower2  -mno-power2 @gol
667 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
668 -maltivec  -mno-altivec @gol
669 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
670 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
671 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
672 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mdfp -mno-dfp @gol
673 -mnew-mnemonics  -mold-mnemonics @gol
674 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
675 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
676 -malign-power  -malign-natural @gol
677 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
678 -mstring  -mno-string  -mupdate  -mno-update @gol
679 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
680 -mstrict-align  -mno-strict-align  -mrelocatable @gol
681 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
682 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
683 -mdynamic-no-pic  -maltivec  -mswdiv @gol
684 -mprioritize-restricted-insns=@var{priority} @gol
685 -msched-costly-dep=@var{dependence_type} @gol
686 -minsert-sched-nops=@var{scheme} @gol
687 -mcall-sysv  -mcall-netbsd @gol
688 -maix-struct-return  -msvr4-struct-return @gol
689 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
690 -misel -mno-isel @gol
691 -misel=yes  -misel=no @gol
692 -mspe -mno-spe @gol
693 -mspe=yes  -mspe=no @gol
694 -mvrsave -mno-vrsave @gol
695 -mmulhw -mno-mulhw @gol
696 -mdlmzb -mno-dlmzb @gol
697 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
698 -mprototype  -mno-prototype @gol
699 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
700 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
701
702 @emph{S/390 and zSeries Options}
703 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
704 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
705 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
706 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
707 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
708 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
709 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
710
711 @emph{Score Options}
712 @gccoptlist{-mel -mel @gol
713 -mmac @gol
714 -mscore5u -mscore7}
715  
716 @emph{SH Options}
717 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
718 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
719 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
720 -m5-64media  -m5-64media-nofpu @gol
721 -m5-32media  -m5-32media-nofpu @gol
722 -m5-compact  -m5-compact-nofpu @gol
723 -mb  -ml  -mdalign  -mrelax @gol
724 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
725 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
726 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
727 -mdivsi3_libfunc=@var{name}  @gol
728 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
729  -minvalid-symbols}
730
731 @emph{SPARC Options}
732 @gccoptlist{-mcpu=@var{cpu-type} @gol
733 -mtune=@var{cpu-type} @gol
734 -mcmodel=@var{code-model} @gol
735 -m32  -m64  -mapp-regs  -mno-app-regs @gol
736 -mfaster-structs  -mno-faster-structs @gol
737 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
738 -mhard-quad-float  -msoft-quad-float @gol
739 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
740 -mstack-bias  -mno-stack-bias @gol
741 -munaligned-doubles  -mno-unaligned-doubles @gol
742 -mv8plus  -mno-v8plus  -mvis  -mno-vis
743 -threads -pthreads -pthread}
744
745 @emph{SPU Options}
746 @gccoptlist{-mwarn-reloc -merror-reloc @gol
747 -msafe-dma -munsafe-dma @gol
748 -mbranch-hints @gol
749 -msmall-mem -mlarge-mem -mstdmain @gol
750 -mfixed-range=@var{register-range}}
751
752 @emph{System V Options}
753 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
754
755 @emph{TMS320C3x/C4x Options}
756 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
757 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
758 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
759 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
760
761 @emph{V850 Options}
762 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
763 -mprolog-function  -mno-prolog-function  -mspace @gol
764 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
765 -mapp-regs  -mno-app-regs @gol
766 -mdisable-callt  -mno-disable-callt @gol
767 -mv850e1 @gol
768 -mv850e @gol
769 -mv850  -mbig-switch}
770
771 @emph{VAX Options}
772 @gccoptlist{-mg  -mgnu  -munix}
773
774 @emph{VxWorks Options}
775 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
776 -Xbind-lazy  -Xbind-now}
777
778 @emph{x86-64 Options}
779 See i386 and x86-64 Options.
780
781 @emph{Xstormy16 Options}
782 @gccoptlist{-msim}
783
784 @emph{Xtensa Options}
785 @gccoptlist{-mconst16 -mno-const16 @gol
786 -mfused-madd  -mno-fused-madd @gol
787 -mtext-section-literals  -mno-text-section-literals @gol
788 -mtarget-align  -mno-target-align @gol
789 -mlongcalls  -mno-longcalls}
790
791 @emph{zSeries Options}
792 See S/390 and zSeries Options.
793
794 @item Code Generation Options
795 @xref{Code Gen Options,,Options for Code Generation Conventions}.
796 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
797 -ffixed-@var{reg}  -fexceptions @gol
798 -fnon-call-exceptions  -funwind-tables @gol
799 -fasynchronous-unwind-tables @gol
800 -finhibit-size-directive  -finstrument-functions @gol
801 -fno-common  -fno-ident @gol
802 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
803 -fno-jump-tables @gol
804 -frecord-gcc-switches @gol
805 -freg-struct-return  -fshort-enums @gol
806 -fshort-double  -fshort-wchar @gol
807 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
808 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
809 -fargument-alias  -fargument-noalias @gol
810 -fargument-noalias-global  -fargument-noalias-anything
811 -fleading-underscore  -ftls-model=@var{model} @gol
812 -ftrapv  -fwrapv  -fbounds-check @gol
813 -fvisibility}
814 @end table
815
816 @menu
817 * Overall Options::     Controlling the kind of output:
818                         an executable, object files, assembler files,
819                         or preprocessed source.
820 * C Dialect Options::   Controlling the variant of C language compiled.
821 * C++ Dialect Options:: Variations on C++.
822 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
823                         and Objective-C++.
824 * Language Independent Options:: Controlling how diagnostics should be
825                         formatted.
826 * Warning Options::     How picky should the compiler be?
827 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
828 * Optimize Options::    How much optimization?
829 * Preprocessor Options:: Controlling header files and macro definitions.
830                          Also, getting dependency information for Make.
831 * Assembler Options::   Passing options to the assembler.
832 * Link Options::        Specifying libraries and so on.
833 * Directory Options::   Where to find header files and libraries.
834                         Where to find the compiler executable files.
835 * Spec Files::          How to pass switches to sub-processes.
836 * Target Options::      Running a cross-compiler, or an old version of GCC.
837 @end menu
838
839 @node Overall Options
840 @section Options Controlling the Kind of Output
841
842 Compilation can involve up to four stages: preprocessing, compilation
843 proper, assembly and linking, always in that order.  GCC is capable of
844 preprocessing and compiling several files either into several
845 assembler input files, or into one assembler input file; then each
846 assembler input file produces an object file, and linking combines all
847 the object files (those newly compiled, and those specified as input)
848 into an executable file.
849
850 @cindex file name suffix
851 For any given input file, the file name suffix determines what kind of
852 compilation is done:
853
854 @table @gcctabopt
855 @item @var{file}.c
856 C source code which must be preprocessed.
857
858 @item @var{file}.i
859 C source code which should not be preprocessed.
860
861 @item @var{file}.ii
862 C++ source code which should not be preprocessed.
863
864 @item @var{file}.m
865 Objective-C source code.  Note that you must link with the @file{libobjc}
866 library to make an Objective-C program work.
867
868 @item @var{file}.mi
869 Objective-C source code which should not be preprocessed.
870
871 @item @var{file}.mm
872 @itemx @var{file}.M
873 Objective-C++ source code.  Note that you must link with the @file{libobjc}
874 library to make an Objective-C++ program work.  Note that @samp{.M} refers
875 to a literal capital M@.
876
877 @item @var{file}.mii
878 Objective-C++ source code which should not be preprocessed.
879
880 @item @var{file}.h
881 C, C++, Objective-C or Objective-C++ header file to be turned into a
882 precompiled header.
883
884 @item @var{file}.cc
885 @itemx @var{file}.cp
886 @itemx @var{file}.cxx
887 @itemx @var{file}.cpp
888 @itemx @var{file}.CPP
889 @itemx @var{file}.c++
890 @itemx @var{file}.C
891 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
892 the last two letters must both be literally @samp{x}.  Likewise,
893 @samp{.C} refers to a literal capital C@.
894
895 @item @var{file}.mm
896 @itemx @var{file}.M
897 Objective-C++ source code which must be preprocessed.
898
899 @item @var{file}.mii
900 Objective-C++ source code which should not be preprocessed.
901
902 @item @var{file}.hh
903 @itemx @var{file}.H
904 C++ header file to be turned into a precompiled header.
905
906 @item @var{file}.f
907 @itemx @var{file}.for
908 @itemx @var{file}.FOR
909 Fixed form Fortran source code which should not be preprocessed.
910
911 @item @var{file}.F
912 @itemx @var{file}.fpp
913 @itemx @var{file}.FPP
914 Fixed form Fortran source code which must be preprocessed (with the traditional
915 preprocessor).
916
917 @item @var{file}.f90
918 @itemx @var{file}.f95
919 Free form Fortran source code which should not be preprocessed.
920
921 @item @var{file}.F90
922 @itemx @var{file}.F95
923 Free form Fortran source code which must be preprocessed (with the
924 traditional preprocessor).
925
926 @c FIXME: Descriptions of Java file types.
927 @c @var{file}.java
928 @c @var{file}.class
929 @c @var{file}.zip
930 @c @var{file}.jar
931
932 @item @var{file}.ads
933 Ada source code file which contains a library unit declaration (a
934 declaration of a package, subprogram, or generic, or a generic
935 instantiation), or a library unit renaming declaration (a package,
936 generic, or subprogram renaming declaration).  Such files are also
937 called @dfn{specs}.
938
939 @itemx @var{file}.adb
940 Ada source code file containing a library unit body (a subprogram or
941 package body).  Such files are also called @dfn{bodies}.
942
943 @c GCC also knows about some suffixes for languages not yet included:
944 @c Pascal:
945 @c @var{file}.p
946 @c @var{file}.pas
947 @c Ratfor:
948 @c @var{file}.r
949
950 @item @var{file}.s
951 Assembler code.
952
953 @item @var{file}.S
954 Assembler code which must be preprocessed.
955
956 @item @var{other}
957 An object file to be fed straight into linking.
958 Any file name with no recognized suffix is treated this way.
959 @end table
960
961 @opindex x
962 You can specify the input language explicitly with the @option{-x} option:
963
964 @table @gcctabopt
965 @item -x @var{language}
966 Specify explicitly the @var{language} for the following input files
967 (rather than letting the compiler choose a default based on the file
968 name suffix).  This option applies to all following input files until
969 the next @option{-x} option.  Possible values for @var{language} are:
970 @smallexample
971 c  c-header  c-cpp-output
972 c++  c++-header  c++-cpp-output
973 objective-c  objective-c-header  objective-c-cpp-output
974 objective-c++ objective-c++-header objective-c++-cpp-output
975 assembler  assembler-with-cpp
976 ada
977 f95  f95-cpp-input
978 java
979 treelang
980 @end smallexample
981
982 @item -x none
983 Turn off any specification of a language, so that subsequent files are
984 handled according to their file name suffixes (as they are if @option{-x}
985 has not been used at all).
986
987 @item -pass-exit-codes
988 @opindex pass-exit-codes
989 Normally the @command{gcc} program will exit with the code of 1 if any
990 phase of the compiler returns a non-success return code.  If you specify
991 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
992 numerically highest error produced by any phase that returned an error
993 indication.  The C, C++, and Fortran frontends return 4, if an internal
994 compiler error is encountered.
995 @end table
996
997 If you only want some of the stages of compilation, you can use
998 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
999 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1000 @command{gcc} is to stop.  Note that some combinations (for example,
1001 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1002
1003 @table @gcctabopt
1004 @item -c
1005 @opindex c
1006 Compile or assemble the source files, but do not link.  The linking
1007 stage simply is not done.  The ultimate output is in the form of an
1008 object file for each source file.
1009
1010 By default, the object file name for a source file is made by replacing
1011 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1012
1013 Unrecognized input files, not requiring compilation or assembly, are
1014 ignored.
1015
1016 @item -S
1017 @opindex S
1018 Stop after the stage of compilation proper; do not assemble.  The output
1019 is in the form of an assembler code file for each non-assembler input
1020 file specified.
1021
1022 By default, the assembler file name for a source file is made by
1023 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1024
1025 Input files that don't require compilation are ignored.
1026
1027 @item -E
1028 @opindex E
1029 Stop after the preprocessing stage; do not run the compiler proper.  The
1030 output is in the form of preprocessed source code, which is sent to the
1031 standard output.
1032
1033 Input files which don't require preprocessing are ignored.
1034
1035 @cindex output file option
1036 @item -o @var{file}
1037 @opindex o
1038 Place output in file @var{file}.  This applies regardless to whatever
1039 sort of output is being produced, whether it be an executable file,
1040 an object file, an assembler file or preprocessed C code.
1041
1042 If @option{-o} is not specified, the default is to put an executable
1043 file in @file{a.out}, the object file for
1044 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1045 assembler file in @file{@var{source}.s}, a precompiled header file in
1046 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1047 standard output.
1048
1049 @item -v
1050 @opindex v
1051 Print (on standard error output) the commands executed to run the stages
1052 of compilation.  Also print the version number of the compiler driver
1053 program and of the preprocessor and the compiler proper.
1054
1055 @item -###
1056 @opindex ###
1057 Like @option{-v} except the commands are not executed and all command
1058 arguments are quoted.  This is useful for shell scripts to capture the
1059 driver-generated command lines.
1060
1061 @item -pipe
1062 @opindex pipe
1063 Use pipes rather than temporary files for communication between the
1064 various stages of compilation.  This fails to work on some systems where
1065 the assembler is unable to read from a pipe; but the GNU assembler has
1066 no trouble.
1067
1068 @item -combine
1069 @opindex combine
1070 If you are compiling multiple source files, this option tells the driver
1071 to pass all the source files to the compiler at once (for those
1072 languages for which the compiler can handle this).  This will allow
1073 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1074 language for which this is supported is C@.  If you pass source files for
1075 multiple languages to the driver, using this option, the driver will invoke
1076 the compiler(s) that support IMA once each, passing each compiler all the
1077 source files appropriate for it.  For those languages that do not support
1078 IMA this option will be ignored, and the compiler will be invoked once for
1079 each source file in that language.  If you use this option in conjunction
1080 with @option{-save-temps}, the compiler will generate multiple
1081 pre-processed files
1082 (one for each source file), but only one (combined) @file{.o} or
1083 @file{.s} file.
1084
1085 @item --help
1086 @opindex help
1087 Print (on the standard output) a description of the command line options
1088 understood by @command{gcc}.  If the @option{-v} option is also specified
1089 then @option{--help} will also be passed on to the various processes
1090 invoked by @command{gcc}, so that they can display the command line options
1091 they accept.  If the @option{-Wextra} option has also been specified
1092 (prior to the @option{--help} option), then command line options which
1093 have no documentation associated with them will also be displayed.
1094
1095 @item --target-help
1096 @opindex target-help
1097 Print (on the standard output) a description of target-specific command
1098 line options for each tool.
1099
1100 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1101 Print (on the standard output) a description of the command line
1102 options understood by the compiler that fit into a specific class.
1103 The class can be one of @var{optimizers}, @var{warnings}, @var{target}
1104 or @var{params}:
1105
1106 @table @gcctabopt
1107 @item @var{optimizers}
1108 This will display all of the optimization options supported by the
1109 compiler.
1110
1111 @item @var{warnings}
1112 This will display all of the options controlling warning messages
1113 produced by the compiler.
1114
1115 @item @var{target}
1116 This will display target-specific options.  Unlike the
1117 @option{--target-help} option however, target-specific options of the
1118 linker and assembler will not be displayed.  This is because those
1119 tools do not currently support the extended @option{--help=} syntax.
1120
1121 @item @var{params}
1122 This will display the values recognized by the @option{--param}
1123 option.
1124 @end table
1125
1126 It is possible to further refine the output of the @option{--help=}
1127 option by adding a comma separated list of qualifiers after the
1128 class.  These can be any from the following list:
1129
1130 @table @gcctabopt
1131 @item undocumented
1132 Display only those options which are undocumented.
1133
1134 @item joined
1135 Display options which take an argument that appears after an equal
1136 sign in the same continuous piece of text, such as:
1137 @samp{--help=target}.
1138
1139 @item separate
1140 Display options which take an argument that appears as a separate word
1141 following the original option, such as: @samp{-o output-file}.
1142 @end table
1143
1144 Thus for example to display all the undocumented target-specific
1145 switches supported by the compiler the following can be used:
1146
1147 @smallexample
1148 --help=target,undocumented
1149 @end smallexample
1150
1151 The sense of a qualifier can be inverted by prefixing it with the
1152 @var{^} character, so for example to display all binary warning
1153 options (i.e. ones that are either on or off and that do not take an
1154 argument), which have a description the following can be used:
1155
1156 @smallexample
1157 --help=warnings,^joined,^undocumented
1158 @end smallexample
1159
1160 A class can also be used as a qualifier, although this usually
1161 restricts the output by so much that there is nothing to display.  One
1162 case where it does work however is when one of the classes is
1163 @var{target}.  So for example to display all the target-specific
1164 optimization options the following can be used:
1165
1166 @smallexample
1167 --help=target,optimizers
1168 @end smallexample
1169
1170 The @option{--help=} option can be repeated on the command line.  Each
1171 successive use will display its requested class of options, skipping
1172 those that have already been displayed.
1173
1174 If the @option{-Q} option appears on the command line before the
1175 @option{--help=} option, then the descriptive text displayed by
1176 @option{--help=} is changed.  Instead of describing the displayed
1177 options, an indication is given as to whether the option is enabled,
1178 disabled or set to a specific value (assuming that the compiler
1179 knows this at the point where the @option{--help=} option is used).
1180
1181 Here is a truncated example from the ARM port of @command{gcc}:
1182
1183 @smallexample
1184   % gcc -Q -mabi=2 --help=target -c
1185   The following options are target specific:
1186   -mabi=                                2
1187   -mabort-on-noreturn                   [disabled]
1188   -mapcs                                [disabled]
1189 @end smallexample
1190
1191 The output is sensitive to the effects of previous command line
1192 options, so for example it is possible to find out which optimizations
1193 are enabled at @option{-O2} by using:
1194
1195 @smallexample
1196 -O2 --help=optimizers
1197 @end smallexample
1198
1199 Alternatively you can discover which binary optimizations are enabled
1200 by @option{-O3} by using:
1201
1202 @smallexample
1203 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1204 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1205 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1206 @end smallexample
1207
1208 @item --version
1209 @opindex version
1210 Display the version number and copyrights of the invoked GCC@.
1211
1212 @include @value{srcdir}/../libiberty/at-file.texi
1213 @end table
1214
1215 @node Invoking G++
1216 @section Compiling C++ Programs
1217
1218 @cindex suffixes for C++ source
1219 @cindex C++ source file suffixes
1220 C++ source files conventionally use one of the suffixes @samp{.C},
1221 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1222 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1223 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1224 files with these names and compiles them as C++ programs even if you
1225 call the compiler the same way as for compiling C programs (usually
1226 with the name @command{gcc}).
1227
1228 @findex g++
1229 @findex c++
1230 However, the use of @command{gcc} does not add the C++ library.
1231 @command{g++} is a program that calls GCC and treats @samp{.c},
1232 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1233 files unless @option{-x} is used, and automatically specifies linking
1234 against the C++ library.  This program is also useful when
1235 precompiling a C header file with a @samp{.h} extension for use in C++
1236 compilations.  On many systems, @command{g++} is also installed with
1237 the name @command{c++}.
1238
1239 @cindex invoking @command{g++}
1240 When you compile C++ programs, you may specify many of the same
1241 command-line options that you use for compiling programs in any
1242 language; or command-line options meaningful for C and related
1243 languages; or options that are meaningful only for C++ programs.
1244 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1245 explanations of options for languages related to C@.
1246 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1247 explanations of options that are meaningful only for C++ programs.
1248
1249 @node C Dialect Options
1250 @section Options Controlling C Dialect
1251 @cindex dialect options
1252 @cindex language dialect options
1253 @cindex options, dialect
1254
1255 The following options control the dialect of C (or languages derived
1256 from C, such as C++, Objective-C and Objective-C++) that the compiler
1257 accepts:
1258
1259 @table @gcctabopt
1260 @cindex ANSI support
1261 @cindex ISO support
1262 @item -ansi
1263 @opindex ansi
1264 In C mode, support all ISO C90 programs.  In C++ mode,
1265 remove GNU extensions that conflict with ISO C++.
1266
1267 This turns off certain features of GCC that are incompatible with ISO
1268 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1269 such as the @code{asm} and @code{typeof} keywords, and
1270 predefined macros such as @code{unix} and @code{vax} that identify the
1271 type of system you are using.  It also enables the undesirable and
1272 rarely used ISO trigraph feature.  For the C compiler,
1273 it disables recognition of C++ style @samp{//} comments as well as
1274 the @code{inline} keyword.
1275
1276 The alternate keywords @code{__asm__}, @code{__extension__},
1277 @code{__inline__} and @code{__typeof__} continue to work despite
1278 @option{-ansi}.  You would not want to use them in an ISO C program, of
1279 course, but it is useful to put them in header files that might be included
1280 in compilations done with @option{-ansi}.  Alternate predefined macros
1281 such as @code{__unix__} and @code{__vax__} are also available, with or
1282 without @option{-ansi}.
1283
1284 The @option{-ansi} option does not cause non-ISO programs to be
1285 rejected gratuitously.  For that, @option{-pedantic} is required in
1286 addition to @option{-ansi}.  @xref{Warning Options}.
1287
1288 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1289 option is used.  Some header files may notice this macro and refrain
1290 from declaring certain functions or defining certain macros that the
1291 ISO standard doesn't call for; this is to avoid interfering with any
1292 programs that might use these names for other things.
1293
1294 Functions which would normally be built in but do not have semantics
1295 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1296 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1297 built-in functions provided by GCC}, for details of the functions
1298 affected.
1299
1300 @item -std=
1301 @opindex std
1302 Determine the language standard.  This option is currently only
1303 supported when compiling C or C++.  A value for this option must be
1304 provided; possible values are
1305
1306 @table @samp
1307 @item c89
1308 @itemx iso9899:1990
1309 ISO C90 (same as @option{-ansi}).
1310
1311 @item iso9899:199409
1312 ISO C90 as modified in amendment 1.
1313
1314 @item c99
1315 @itemx c9x
1316 @itemx iso9899:1999
1317 @itemx iso9899:199x
1318 ISO C99.  Note that this standard is not yet fully supported; see
1319 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1320 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1321
1322 @item gnu89
1323 Default, ISO C90 plus GNU extensions (including some C99 features).
1324
1325 @item gnu99
1326 @itemx gnu9x
1327 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1328 this will become the default.  The name @samp{gnu9x} is deprecated.
1329
1330 @item c++98
1331 The 1998 ISO C++ standard plus amendments.
1332
1333 @item gnu++98
1334 The same as @option{-std=c++98} plus GNU extensions.  This is the
1335 default for C++ code.
1336
1337 @item c++0x
1338 The working draft of the upcoming ISO C++0x standard. This option
1339 enables experimental features that are likely to be included in
1340 C++0x. The working draft is constantly changing, and any feature that is
1341 enabled by this flag may be removed from future versions of GCC if it is
1342 not part of the C++0x standard.
1343
1344 @item gnu++0x
1345 The same as @option{-std=c++0x} plus GNU extensions. As with
1346 @option{-std=c++0x}, this option enables experimental features that may
1347 be removed in future versions of GCC.
1348 @end table
1349
1350 Even when this option is not specified, you can still use some of the
1351 features of newer standards in so far as they do not conflict with
1352 previous C standards.  For example, you may use @code{__restrict__} even
1353 when @option{-std=c99} is not specified.
1354
1355 The @option{-std} options specifying some version of ISO C have the same
1356 effects as @option{-ansi}, except that features that were not in ISO C90
1357 but are in the specified version (for example, @samp{//} comments and
1358 the @code{inline} keyword in ISO C99) are not disabled.
1359
1360 @xref{Standards,,Language Standards Supported by GCC}, for details of
1361 these standard versions.
1362
1363 @item -fgnu89-inline
1364 @opindex fgnu89-inline
1365 The option @option{-fgnu89-inline} tells GCC to use the traditional
1366 GNU semantics for @code{inline} functions when in C99 mode.
1367 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1368 is accepted and ignored by GCC versions 4.1.3 up to but not including
1369 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1370 C99 mode.  Using this option is roughly equivalent to adding the
1371 @code{gnu_inline} function attribute to all inline functions
1372 (@pxref{Function Attributes}).
1373
1374 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1375 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1376 specifies the default behavior).  This option was first supported in
1377 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1378
1379 The preprocesor macros @code{__GNUC_GNU_INLINE__} and
1380 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1381 in effect for @code{inline} functions.  @xref{Common Predefined
1382 Macros,,,cpp,The C Preprocessor}.
1383
1384 @item -aux-info @var{filename}
1385 @opindex aux-info
1386 Output to the given filename prototyped declarations for all functions
1387 declared and/or defined in a translation unit, including those in header
1388 files.  This option is silently ignored in any language other than C@.
1389
1390 Besides declarations, the file indicates, in comments, the origin of
1391 each declaration (source file and line), whether the declaration was
1392 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1393 @samp{O} for old, respectively, in the first character after the line
1394 number and the colon), and whether it came from a declaration or a
1395 definition (@samp{C} or @samp{F}, respectively, in the following
1396 character).  In the case of function definitions, a K&R-style list of
1397 arguments followed by their declarations is also provided, inside
1398 comments, after the declaration.
1399
1400 @item -fno-asm
1401 @opindex fno-asm
1402 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1403 keyword, so that code can use these words as identifiers.  You can use
1404 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1405 instead.  @option{-ansi} implies @option{-fno-asm}.
1406
1407 In C++, this switch only affects the @code{typeof} keyword, since
1408 @code{asm} and @code{inline} are standard keywords.  You may want to
1409 use the @option{-fno-gnu-keywords} flag instead, which has the same
1410 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1411 switch only affects the @code{asm} and @code{typeof} keywords, since
1412 @code{inline} is a standard keyword in ISO C99.
1413
1414 @item -fno-builtin
1415 @itemx -fno-builtin-@var{function}
1416 @opindex fno-builtin
1417 @cindex built-in functions
1418 Don't recognize built-in functions that do not begin with
1419 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1420 functions provided by GCC}, for details of the functions affected,
1421 including those which are not built-in functions when @option{-ansi} or
1422 @option{-std} options for strict ISO C conformance are used because they
1423 do not have an ISO standard meaning.
1424
1425 GCC normally generates special code to handle certain built-in functions
1426 more efficiently; for instance, calls to @code{alloca} may become single
1427 instructions that adjust the stack directly, and calls to @code{memcpy}
1428 may become inline copy loops.  The resulting code is often both smaller
1429 and faster, but since the function calls no longer appear as such, you
1430 cannot set a breakpoint on those calls, nor can you change the behavior
1431 of the functions by linking with a different library.  In addition,
1432 when a function is recognized as a built-in function, GCC may use
1433 information about that function to warn about problems with calls to
1434 that function, or to generate more efficient code, even if the
1435 resulting code still contains calls to that function.  For example,
1436 warnings are given with @option{-Wformat} for bad calls to
1437 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1438 known not to modify global memory.
1439
1440 With the @option{-fno-builtin-@var{function}} option
1441 only the built-in function @var{function} is
1442 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1443 function is named this is not built-in in this version of GCC, this
1444 option is ignored.  There is no corresponding
1445 @option{-fbuiltin-@var{function}} option; if you wish to enable
1446 built-in functions selectively when using @option{-fno-builtin} or
1447 @option{-ffreestanding}, you may define macros such as:
1448
1449 @smallexample
1450 #define abs(n)          __builtin_abs ((n))
1451 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1452 @end smallexample
1453
1454 @item -fhosted
1455 @opindex fhosted
1456 @cindex hosted environment
1457
1458 Assert that compilation takes place in a hosted environment.  This implies
1459 @option{-fbuiltin}.  A hosted environment is one in which the
1460 entire standard library is available, and in which @code{main} has a return
1461 type of @code{int}.  Examples are nearly everything except a kernel.
1462 This is equivalent to @option{-fno-freestanding}.
1463
1464 @item -ffreestanding
1465 @opindex ffreestanding
1466 @cindex hosted environment
1467
1468 Assert that compilation takes place in a freestanding environment.  This
1469 implies @option{-fno-builtin}.  A freestanding environment
1470 is one in which the standard library may not exist, and program startup may
1471 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1472 This is equivalent to @option{-fno-hosted}.
1473
1474 @xref{Standards,,Language Standards Supported by GCC}, for details of
1475 freestanding and hosted environments.
1476
1477 @item -fopenmp
1478 @opindex fopenmp
1479 @cindex openmp parallel
1480 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1481 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1482 compiler generates parallel code according to the OpenMP Application
1483 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1484
1485 @item -fms-extensions
1486 @opindex fms-extensions
1487 Accept some non-standard constructs used in Microsoft header files.
1488
1489 Some cases of unnamed fields in structures and unions are only
1490 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1491 fields within structs/unions}, for details.
1492
1493 @item -trigraphs
1494 @opindex trigraphs
1495 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1496 options for strict ISO C conformance) implies @option{-trigraphs}.
1497
1498 @item -no-integrated-cpp
1499 @opindex no-integrated-cpp
1500 Performs a compilation in two passes: preprocessing and compiling.  This
1501 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1502 @option{-B} option.  The user supplied compilation step can then add in
1503 an additional preprocessing step after normal preprocessing but before
1504 compiling.  The default is to use the integrated cpp (internal cpp)
1505
1506 The semantics of this option will change if "cc1", "cc1plus", and
1507 "cc1obj" are merged.
1508
1509 @cindex traditional C language
1510 @cindex C language, traditional
1511 @item -traditional
1512 @itemx -traditional-cpp
1513 @opindex traditional-cpp
1514 @opindex traditional
1515 Formerly, these options caused GCC to attempt to emulate a pre-standard
1516 C compiler.  They are now only supported with the @option{-E} switch.
1517 The preprocessor continues to support a pre-standard mode.  See the GNU
1518 CPP manual for details.
1519
1520 @item -fcond-mismatch
1521 @opindex fcond-mismatch
1522 Allow conditional expressions with mismatched types in the second and
1523 third arguments.  The value of such an expression is void.  This option
1524 is not supported for C++.
1525
1526 @item -flax-vector-conversions
1527 @opindex flax-vector-conversions
1528 Allow implicit conversions between vectors with differing numbers of
1529 elements and/or incompatible element types.  This option should not be
1530 used for new code.
1531
1532 @item -funsigned-char
1533 @opindex funsigned-char
1534 Let the type @code{char} be unsigned, like @code{unsigned char}.
1535
1536 Each kind of machine has a default for what @code{char} should
1537 be.  It is either like @code{unsigned char} by default or like
1538 @code{signed char} by default.
1539
1540 Ideally, a portable program should always use @code{signed char} or
1541 @code{unsigned char} when it depends on the signedness of an object.
1542 But many programs have been written to use plain @code{char} and
1543 expect it to be signed, or expect it to be unsigned, depending on the
1544 machines they were written for.  This option, and its inverse, let you
1545 make such a program work with the opposite default.
1546
1547 The type @code{char} is always a distinct type from each of
1548 @code{signed char} or @code{unsigned char}, even though its behavior
1549 is always just like one of those two.
1550
1551 @item -fsigned-char
1552 @opindex fsigned-char
1553 Let the type @code{char} be signed, like @code{signed char}.
1554
1555 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1556 the negative form of @option{-funsigned-char}.  Likewise, the option
1557 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1558
1559 @item -fsigned-bitfields
1560 @itemx -funsigned-bitfields
1561 @itemx -fno-signed-bitfields
1562 @itemx -fno-unsigned-bitfields
1563 @opindex fsigned-bitfields
1564 @opindex funsigned-bitfields
1565 @opindex fno-signed-bitfields
1566 @opindex fno-unsigned-bitfields
1567 These options control whether a bit-field is signed or unsigned, when the
1568 declaration does not use either @code{signed} or @code{unsigned}.  By
1569 default, such a bit-field is signed, because this is consistent: the
1570 basic integer types such as @code{int} are signed types.
1571 @end table
1572
1573 @node C++ Dialect Options
1574 @section Options Controlling C++ Dialect
1575
1576 @cindex compiler options, C++
1577 @cindex C++ options, command line
1578 @cindex options, C++
1579 This section describes the command-line options that are only meaningful
1580 for C++ programs; but you can also use most of the GNU compiler options
1581 regardless of what language your program is in.  For example, you
1582 might compile a file @code{firstClass.C} like this:
1583
1584 @smallexample
1585 g++ -g -frepo -O -c firstClass.C
1586 @end smallexample
1587
1588 @noindent
1589 In this example, only @option{-frepo} is an option meant
1590 only for C++ programs; you can use the other options with any
1591 language supported by GCC@.
1592
1593 Here is a list of options that are @emph{only} for compiling C++ programs:
1594
1595 @table @gcctabopt
1596
1597 @item -fabi-version=@var{n}
1598 @opindex fabi-version
1599 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1600 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1601 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1602 the version that conforms most closely to the C++ ABI specification.
1603 Therefore, the ABI obtained using version 0 will change as ABI bugs
1604 are fixed.
1605
1606 The default is version 2.
1607
1608 @item -fno-access-control
1609 @opindex fno-access-control
1610 Turn off all access checking.  This switch is mainly useful for working
1611 around bugs in the access control code.
1612
1613 @item -fcheck-new
1614 @opindex fcheck-new
1615 Check that the pointer returned by @code{operator new} is non-null
1616 before attempting to modify the storage allocated.  This check is
1617 normally unnecessary because the C++ standard specifies that
1618 @code{operator new} will only return @code{0} if it is declared
1619 @samp{throw()}, in which case the compiler will always check the
1620 return value even without this option.  In all other cases, when
1621 @code{operator new} has a non-empty exception specification, memory
1622 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1623 @samp{new (nothrow)}.
1624
1625 @item -fconserve-space
1626 @opindex fconserve-space
1627 Put uninitialized or runtime-initialized global variables into the
1628 common segment, as C does.  This saves space in the executable at the
1629 cost of not diagnosing duplicate definitions.  If you compile with this
1630 flag and your program mysteriously crashes after @code{main()} has
1631 completed, you may have an object that is being destroyed twice because
1632 two definitions were merged.
1633
1634 This option is no longer useful on most targets, now that support has
1635 been added for putting variables into BSS without making them common.
1636
1637 @item -ffriend-injection
1638 @opindex ffriend-injection
1639 Inject friend functions into the enclosing namespace, so that they are
1640 visible outside the scope of the class in which they are declared.
1641 Friend functions were documented to work this way in the old Annotated
1642 C++ Reference Manual, and versions of G++ before 4.1 always worked
1643 that way.  However, in ISO C++ a friend function which is not declared
1644 in an enclosing scope can only be found using argument dependent
1645 lookup.  This option causes friends to be injected as they were in
1646 earlier releases.
1647
1648 This option is for compatibility, and may be removed in a future
1649 release of G++.
1650
1651 @item -fno-elide-constructors
1652 @opindex fno-elide-constructors
1653 The C++ standard allows an implementation to omit creating a temporary
1654 which is only used to initialize another object of the same type.
1655 Specifying this option disables that optimization, and forces G++ to
1656 call the copy constructor in all cases.
1657
1658 @item -fno-enforce-eh-specs
1659 @opindex fno-enforce-eh-specs
1660 Don't generate code to check for violation of exception specifications
1661 at runtime.  This option violates the C++ standard, but may be useful
1662 for reducing code size in production builds, much like defining
1663 @samp{NDEBUG}.  This does not give user code permission to throw
1664 exceptions in violation of the exception specifications; the compiler
1665 will still optimize based on the specifications, so throwing an
1666 unexpected exception will result in undefined behavior.
1667
1668 @item -ffor-scope
1669 @itemx -fno-for-scope
1670 @opindex ffor-scope
1671 @opindex fno-for-scope
1672 If @option{-ffor-scope} is specified, the scope of variables declared in
1673 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1674 as specified by the C++ standard.
1675 If @option{-fno-for-scope} is specified, the scope of variables declared in
1676 a @i{for-init-statement} extends to the end of the enclosing scope,
1677 as was the case in old versions of G++, and other (traditional)
1678 implementations of C++.
1679
1680 The default if neither flag is given to follow the standard,
1681 but to allow and give a warning for old-style code that would
1682 otherwise be invalid, or have different behavior.
1683
1684 @item -fno-gnu-keywords
1685 @opindex fno-gnu-keywords
1686 Do not recognize @code{typeof} as a keyword, so that code can use this
1687 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1688 @option{-ansi} implies @option{-fno-gnu-keywords}.
1689
1690 @item -fno-implicit-templates
1691 @opindex fno-implicit-templates
1692 Never emit code for non-inline templates which are instantiated
1693 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1694 @xref{Template Instantiation}, for more information.
1695
1696 @item -fno-implicit-inline-templates
1697 @opindex fno-implicit-inline-templates
1698 Don't emit code for implicit instantiations of inline templates, either.
1699 The default is to handle inlines differently so that compiles with and
1700 without optimization will need the same set of explicit instantiations.
1701
1702 @item -fno-implement-inlines
1703 @opindex fno-implement-inlines
1704 To save space, do not emit out-of-line copies of inline functions
1705 controlled by @samp{#pragma implementation}.  This will cause linker
1706 errors if these functions are not inlined everywhere they are called.
1707
1708 @item -fms-extensions
1709 @opindex fms-extensions
1710 Disable pedantic warnings about constructs used in MFC, such as implicit
1711 int and getting a pointer to member function via non-standard syntax.
1712
1713 @item -fno-nonansi-builtins
1714 @opindex fno-nonansi-builtins
1715 Disable built-in declarations of functions that are not mandated by
1716 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1717 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1718
1719 @item -fno-operator-names
1720 @opindex fno-operator-names
1721 Do not treat the operator name keywords @code{and}, @code{bitand},
1722 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1723 synonyms as keywords.
1724
1725 @item -fno-optional-diags
1726 @opindex fno-optional-diags
1727 Disable diagnostics that the standard says a compiler does not need to
1728 issue.  Currently, the only such diagnostic issued by G++ is the one for
1729 a name having multiple meanings within a class.
1730
1731 @item -fpermissive
1732 @opindex fpermissive
1733 Downgrade some diagnostics about nonconformant code from errors to
1734 warnings.  Thus, using @option{-fpermissive} will allow some
1735 nonconforming code to compile.
1736
1737 @item -frepo
1738 @opindex frepo
1739 Enable automatic template instantiation at link time.  This option also
1740 implies @option{-fno-implicit-templates}.  @xref{Template
1741 Instantiation}, for more information.
1742
1743 @item -fno-rtti
1744 @opindex fno-rtti
1745 Disable generation of information about every class with virtual
1746 functions for use by the C++ runtime type identification features
1747 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1748 of the language, you can save some space by using this flag.  Note that
1749 exception handling uses the same information, but it will generate it as
1750 needed. The @samp{dynamic_cast} operator can still be used for casts that
1751 do not require runtime type information, i.e. casts to @code{void *} or to
1752 unambiguous base classes.
1753
1754 @item -fstats
1755 @opindex fstats
1756 Emit statistics about front-end processing at the end of the compilation.
1757 This information is generally only useful to the G++ development team.
1758
1759 @item -ftemplate-depth-@var{n}
1760 @opindex ftemplate-depth
1761 Set the maximum instantiation depth for template classes to @var{n}.
1762 A limit on the template instantiation depth is needed to detect
1763 endless recursions during template class instantiation.  ANSI/ISO C++
1764 conforming programs must not rely on a maximum depth greater than 17.
1765
1766 @item -fno-threadsafe-statics
1767 @opindex fno-threadsafe-statics
1768 Do not emit the extra code to use the routines specified in the C++
1769 ABI for thread-safe initialization of local statics.  You can use this
1770 option to reduce code size slightly in code that doesn't need to be
1771 thread-safe.
1772
1773 @item -fuse-cxa-atexit
1774 @opindex fuse-cxa-atexit
1775 Register destructors for objects with static storage duration with the
1776 @code{__cxa_atexit} function rather than the @code{atexit} function.
1777 This option is required for fully standards-compliant handling of static
1778 destructors, but will only work if your C library supports
1779 @code{__cxa_atexit}.
1780
1781 @item -fno-use-cxa-get-exception-ptr
1782 @opindex fno-use-cxa-get-exception-ptr
1783 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1784 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1785 if the runtime routine is not available.
1786
1787 @item -fvisibility-inlines-hidden
1788 @opindex fvisibility-inlines-hidden
1789 This switch declares that the user does not attempt to compare
1790 pointers to inline methods where the addresses of the two functions
1791 were taken in different shared objects.
1792
1793 The effect of this is that GCC may, effectively, mark inline methods with
1794 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1795 appear in the export table of a DSO and do not require a PLT indirection
1796 when used within the DSO@.  Enabling this option can have a dramatic effect
1797 on load and link times of a DSO as it massively reduces the size of the
1798 dynamic export table when the library makes heavy use of templates.
1799
1800 The behavior of this switch is not quite the same as marking the
1801 methods as hidden directly, because it does not affect static variables
1802 local to the function or cause the compiler to deduce that
1803 the function is defined in only one shared object.
1804
1805 You may mark a method as having a visibility explicitly to negate the
1806 effect of the switch for that method.  For example, if you do want to
1807 compare pointers to a particular inline method, you might mark it as
1808 having default visibility.  Marking the enclosing class with explicit
1809 visibility will have no effect.
1810
1811 Explicitly instantiated inline methods are unaffected by this option
1812 as their linkage might otherwise cross a shared library boundary.
1813 @xref{Template Instantiation}.
1814
1815 @item -fno-weak
1816 @opindex fno-weak
1817 Do not use weak symbol support, even if it is provided by the linker.
1818 By default, G++ will use weak symbols if they are available.  This
1819 option exists only for testing, and should not be used by end-users;
1820 it will result in inferior code and has no benefits.  This option may
1821 be removed in a future release of G++.
1822
1823 @item -nostdinc++
1824 @opindex nostdinc++
1825 Do not search for header files in the standard directories specific to
1826 C++, but do still search the other standard directories.  (This option
1827 is used when building the C++ library.)
1828 @end table
1829
1830 In addition, these optimization, warning, and code generation options
1831 have meanings only for C++ programs:
1832
1833 @table @gcctabopt
1834 @item -fno-default-inline
1835 @opindex fno-default-inline
1836 Do not assume @samp{inline} for functions defined inside a class scope.
1837 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1838 functions will have linkage like inline functions; they just won't be
1839 inlined by default.
1840
1841 @item -Wabi @r{(C++ only)}
1842 @opindex Wabi
1843 Warn when G++ generates code that is probably not compatible with the
1844 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1845 all such cases, there are probably some cases that are not warned about,
1846 even though G++ is generating incompatible code.  There may also be
1847 cases where warnings are emitted even though the code that is generated
1848 will be compatible.
1849
1850 You should rewrite your code to avoid these warnings if you are
1851 concerned about the fact that code generated by G++ may not be binary
1852 compatible with code generated by other compilers.
1853
1854 The known incompatibilities at this point include:
1855
1856 @itemize @bullet
1857
1858 @item
1859 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1860 pack data into the same byte as a base class.  For example:
1861
1862 @smallexample
1863 struct A @{ virtual void f(); int f1 : 1; @};
1864 struct B : public A @{ int f2 : 1; @};
1865 @end smallexample
1866
1867 @noindent
1868 In this case, G++ will place @code{B::f2} into the same byte
1869 as@code{A::f1}; other compilers will not.  You can avoid this problem
1870 by explicitly padding @code{A} so that its size is a multiple of the
1871 byte size on your platform; that will cause G++ and other compilers to
1872 layout @code{B} identically.
1873
1874 @item
1875 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1876 tail padding when laying out virtual bases.  For example:
1877
1878 @smallexample
1879 struct A @{ virtual void f(); char c1; @};
1880 struct B @{ B(); char c2; @};
1881 struct C : public A, public virtual B @{@};
1882 @end smallexample
1883
1884 @noindent
1885 In this case, G++ will not place @code{B} into the tail-padding for
1886 @code{A}; other compilers will.  You can avoid this problem by
1887 explicitly padding @code{A} so that its size is a multiple of its
1888 alignment (ignoring virtual base classes); that will cause G++ and other
1889 compilers to layout @code{C} identically.
1890
1891 @item
1892 Incorrect handling of bit-fields with declared widths greater than that
1893 of their underlying types, when the bit-fields appear in a union.  For
1894 example:
1895
1896 @smallexample
1897 union U @{ int i : 4096; @};
1898 @end smallexample
1899
1900 @noindent
1901 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1902 union too small by the number of bits in an @code{int}.
1903
1904 @item
1905 Empty classes can be placed at incorrect offsets.  For example:
1906
1907 @smallexample
1908 struct A @{@};
1909
1910 struct B @{
1911   A a;
1912   virtual void f ();
1913 @};
1914
1915 struct C : public B, public A @{@};
1916 @end smallexample
1917
1918 @noindent
1919 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1920 it should be placed at offset zero.  G++ mistakenly believes that the
1921 @code{A} data member of @code{B} is already at offset zero.
1922
1923 @item
1924 Names of template functions whose types involve @code{typename} or
1925 template template parameters can be mangled incorrectly.
1926
1927 @smallexample
1928 template <typename Q>
1929 void f(typename Q::X) @{@}
1930
1931 template <template <typename> class Q>
1932 void f(typename Q<int>::X) @{@}
1933 @end smallexample
1934
1935 @noindent
1936 Instantiations of these templates may be mangled incorrectly.
1937
1938 @end itemize
1939
1940 @item -Wctor-dtor-privacy @r{(C++ only)}
1941 @opindex Wctor-dtor-privacy
1942 Warn when a class seems unusable because all the constructors or
1943 destructors in that class are private, and it has neither friends nor
1944 public static member functions.
1945
1946 @item -Wnon-virtual-dtor @r{(C++ only)}
1947 @opindex Wnon-virtual-dtor
1948 Warn when a class appears to be polymorphic, thereby requiring a virtual
1949 destructor, yet it declares a non-virtual one.  This warning is also
1950 enabled if -Weffc++ is specified.
1951
1952 @item -Wreorder @r{(C++ only)}
1953 @opindex Wreorder
1954 @cindex reordering, warning
1955 @cindex warning for reordering of member initializers
1956 Warn when the order of member initializers given in the code does not
1957 match the order in which they must be executed.  For instance:
1958
1959 @smallexample
1960 struct A @{
1961   int i;
1962   int j;
1963   A(): j (0), i (1) @{ @}
1964 @};
1965 @end smallexample
1966
1967 The compiler will rearrange the member initializers for @samp{i}
1968 and @samp{j} to match the declaration order of the members, emitting
1969 a warning to that effect.  This warning is enabled by @option{-Wall}.
1970 @end table
1971
1972 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1973
1974 @table @gcctabopt
1975 @item -Weffc++ @r{(C++ only)}
1976 @opindex Weffc++
1977 Warn about violations of the following style guidelines from Scott Meyers'
1978 @cite{Effective C++} book:
1979
1980 @itemize @bullet
1981 @item
1982 Item 11:  Define a copy constructor and an assignment operator for classes
1983 with dynamically allocated memory.
1984
1985 @item
1986 Item 12:  Prefer initialization to assignment in constructors.
1987
1988 @item
1989 Item 14:  Make destructors virtual in base classes.
1990
1991 @item
1992 Item 15:  Have @code{operator=} return a reference to @code{*this}.
1993
1994 @item
1995 Item 23:  Don't try to return a reference when you must return an object.
1996
1997 @end itemize
1998
1999 Also warn about violations of the following style guidelines from
2000 Scott Meyers' @cite{More Effective C++} book:
2001
2002 @itemize @bullet
2003 @item
2004 Item 6:  Distinguish between prefix and postfix forms of increment and
2005 decrement operators.
2006
2007 @item
2008 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2009
2010 @end itemize
2011
2012 When selecting this option, be aware that the standard library
2013 headers do not obey all of these guidelines; use @samp{grep -v}
2014 to filter out those warnings.
2015
2016 @item -Wno-deprecated @r{(C++ only)}
2017 @opindex Wno-deprecated
2018 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
2019
2020 @item -Wstrict-null-sentinel @r{(C++ only)}
2021 @opindex Wstrict-null-sentinel
2022 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2023 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2024 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2025 it is guaranteed to of the same size as a pointer.  But this use is
2026 not portable across different compilers.
2027
2028 @item -Wno-non-template-friend @r{(C++ only)}
2029 @opindex Wno-non-template-friend
2030 Disable warnings when non-templatized friend functions are declared
2031 within a template.  Since the advent of explicit template specification
2032 support in G++, if the name of the friend is an unqualified-id (i.e.,
2033 @samp{friend foo(int)}), the C++ language specification demands that the
2034 friend declare or define an ordinary, nontemplate function.  (Section
2035 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2036 could be interpreted as a particular specialization of a templatized
2037 function.  Because this non-conforming behavior is no longer the default
2038 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2039 check existing code for potential trouble spots and is on by default.
2040 This new compiler behavior can be turned off with
2041 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2042 but disables the helpful warning.
2043
2044 @item -Wold-style-cast @r{(C++ only)}
2045 @opindex Wold-style-cast
2046 Warn if an old-style (C-style) cast to a non-void type is used within
2047 a C++ program.  The new-style casts (@samp{dynamic_cast},
2048 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2049 less vulnerable to unintended effects and much easier to search for.
2050
2051 @item -Woverloaded-virtual @r{(C++ only)}
2052 @opindex Woverloaded-virtual
2053 @cindex overloaded virtual fn, warning
2054 @cindex warning for overloaded virtual fn
2055 Warn when a function declaration hides virtual functions from a
2056 base class.  For example, in:
2057
2058 @smallexample
2059 struct A @{
2060   virtual void f();
2061 @};
2062
2063 struct B: public A @{
2064   void f(int);
2065 @};
2066 @end smallexample
2067
2068 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2069 like:
2070
2071 @smallexample
2072 B* b;
2073 b->f();
2074 @end smallexample
2075
2076 will fail to compile.
2077
2078 @item -Wno-pmf-conversions @r{(C++ only)}
2079 @opindex Wno-pmf-conversions
2080 Disable the diagnostic for converting a bound pointer to member function
2081 to a plain pointer.
2082
2083 @item -Wsign-promo @r{(C++ only)}
2084 @opindex Wsign-promo
2085 Warn when overload resolution chooses a promotion from unsigned or
2086 enumerated type to a signed type, over a conversion to an unsigned type of
2087 the same size.  Previous versions of G++ would try to preserve
2088 unsignedness, but the standard mandates the current behavior.
2089
2090 @smallexample
2091 struct A @{
2092   operator int ();
2093   A& operator = (int);
2094 @};
2095
2096 main ()
2097 @{
2098   A a,b;
2099   a = b;
2100 @}
2101 @end smallexample
2102
2103 In this example, G++ will synthesize a default @samp{A& operator =
2104 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2105 @end table
2106
2107 @node Objective-C and Objective-C++ Dialect Options
2108 @section Options Controlling Objective-C and Objective-C++ Dialects
2109
2110 @cindex compiler options, Objective-C and Objective-C++
2111 @cindex Objective-C and Objective-C++ options, command line
2112 @cindex options, Objective-C and Objective-C++
2113 (NOTE: This manual does not describe the Objective-C and Objective-C++
2114 languages themselves.  See @xref{Standards,,Language Standards
2115 Supported by GCC}, for references.)
2116
2117 This section describes the command-line options that are only meaningful
2118 for Objective-C and Objective-C++ programs, but you can also use most of
2119 the language-independent GNU compiler options.
2120 For example, you might compile a file @code{some_class.m} like this:
2121
2122 @smallexample
2123 gcc -g -fgnu-runtime -O -c some_class.m
2124 @end smallexample
2125
2126 @noindent
2127 In this example, @option{-fgnu-runtime} is an option meant only for
2128 Objective-C and Objective-C++ programs; you can use the other options with
2129 any language supported by GCC@.
2130
2131 Note that since Objective-C is an extension of the C language, Objective-C
2132 compilations may also use options specific to the C front-end (e.g.,
2133 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2134 C++-specific options (e.g., @option{-Wabi}).
2135
2136 Here is a list of options that are @emph{only} for compiling Objective-C
2137 and Objective-C++ programs:
2138
2139 @table @gcctabopt
2140 @item -fconstant-string-class=@var{class-name}
2141 @opindex fconstant-string-class
2142 Use @var{class-name} as the name of the class to instantiate for each
2143 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2144 class name is @code{NXConstantString} if the GNU runtime is being used, and
2145 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2146 @option{-fconstant-cfstrings} option, if also present, will override the
2147 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2148 to be laid out as constant CoreFoundation strings.
2149
2150 @item -fgnu-runtime
2151 @opindex fgnu-runtime
2152 Generate object code compatible with the standard GNU Objective-C
2153 runtime.  This is the default for most types of systems.
2154
2155 @item -fnext-runtime
2156 @opindex fnext-runtime
2157 Generate output compatible with the NeXT runtime.  This is the default
2158 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2159 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2160 used.
2161
2162 @item -fno-nil-receivers
2163 @opindex fno-nil-receivers
2164 Assume that all Objective-C message dispatches (e.g.,
2165 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2166 is not @code{nil}.  This allows for more efficient entry points in the runtime
2167 to be used.  Currently, this option is only available in conjunction with
2168 the NeXT runtime on Mac OS X 10.3 and later.
2169
2170 @item -fobjc-call-cxx-cdtors
2171 @opindex fobjc-call-cxx-cdtors
2172 For each Objective-C class, check if any of its instance variables is a
2173 C++ object with a non-trivial default constructor.  If so, synthesize a
2174 special @code{- (id) .cxx_construct} instance method that will run
2175 non-trivial default constructors on any such instance variables, in order,
2176 and then return @code{self}.  Similarly, check if any instance variable
2177 is a C++ object with a non-trivial destructor, and if so, synthesize a
2178 special @code{- (void) .cxx_destruct} method that will run
2179 all such default destructors, in reverse order.
2180
2181 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2182 thusly generated will only operate on instance variables declared in the
2183 current Objective-C class, and not those inherited from superclasses.  It
2184 is the responsibility of the Objective-C runtime to invoke all such methods
2185 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2186 will be invoked by the runtime immediately after a new object
2187 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2188 be invoked immediately before the runtime deallocates an object instance.
2189
2190 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2191 support for invoking the @code{- (id) .cxx_construct} and
2192 @code{- (void) .cxx_destruct} methods.
2193
2194 @item -fobjc-direct-dispatch
2195 @opindex fobjc-direct-dispatch
2196 Allow fast jumps to the message dispatcher.  On Darwin this is
2197 accomplished via the comm page.
2198
2199 @item -fobjc-exceptions
2200 @opindex fobjc-exceptions
2201 Enable syntactic support for structured exception handling in Objective-C,
2202 similar to what is offered by C++ and Java.  This option is
2203 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2204 earlier.
2205
2206 @smallexample
2207   @@try @{
2208     @dots{}
2209        @@throw expr;
2210     @dots{}
2211   @}
2212   @@catch (AnObjCClass *exc) @{
2213     @dots{}
2214       @@throw expr;
2215     @dots{}
2216       @@throw;
2217     @dots{}
2218   @}
2219   @@catch (AnotherClass *exc) @{
2220     @dots{}
2221   @}
2222   @@catch (id allOthers) @{
2223     @dots{}
2224   @}
2225   @@finally @{
2226     @dots{}
2227       @@throw expr;
2228     @dots{}
2229   @}
2230 @end smallexample
2231
2232 The @code{@@throw} statement may appear anywhere in an Objective-C or
2233 Objective-C++ program; when used inside of a @code{@@catch} block, the
2234 @code{@@throw} may appear without an argument (as shown above), in which case
2235 the object caught by the @code{@@catch} will be rethrown.
2236
2237 Note that only (pointers to) Objective-C objects may be thrown and
2238 caught using this scheme.  When an object is thrown, it will be caught
2239 by the nearest @code{@@catch} clause capable of handling objects of that type,
2240 analogously to how @code{catch} blocks work in C++ and Java.  A
2241 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2242 any and all Objective-C exceptions not caught by previous @code{@@catch}
2243 clauses (if any).
2244
2245 The @code{@@finally} clause, if present, will be executed upon exit from the
2246 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2247 regardless of whether any exceptions are thrown, caught or rethrown
2248 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2249 of the @code{finally} clause in Java.
2250
2251 There are several caveats to using the new exception mechanism:
2252
2253 @itemize @bullet
2254 @item
2255 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2256 idioms provided by the @code{NSException} class, the new
2257 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2258 systems, due to additional functionality needed in the (NeXT) Objective-C
2259 runtime.
2260
2261 @item
2262 As mentioned above, the new exceptions do not support handling
2263 types other than Objective-C objects.   Furthermore, when used from
2264 Objective-C++, the Objective-C exception model does not interoperate with C++
2265 exceptions at this time.  This means you cannot @code{@@throw} an exception
2266 from Objective-C and @code{catch} it in C++, or vice versa
2267 (i.e., @code{throw @dots{} @@catch}).
2268 @end itemize
2269
2270 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2271 blocks for thread-safe execution:
2272
2273 @smallexample
2274   @@synchronized (ObjCClass *guard) @{
2275     @dots{}
2276   @}
2277 @end smallexample
2278
2279 Upon entering the @code{@@synchronized} block, a thread of execution shall
2280 first check whether a lock has been placed on the corresponding @code{guard}
2281 object by another thread.  If it has, the current thread shall wait until
2282 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2283 the current thread will place its own lock on it, execute the code contained in
2284 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2285 making @code{guard} available to other threads).
2286
2287 Unlike Java, Objective-C does not allow for entire methods to be marked
2288 @code{@@synchronized}.  Note that throwing exceptions out of
2289 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2290 to be unlocked properly.
2291
2292 @item -fobjc-gc
2293 @opindex fobjc-gc
2294 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2295
2296 @item -freplace-objc-classes
2297 @opindex freplace-objc-classes
2298 Emit a special marker instructing @command{ld(1)} not to statically link in
2299 the resulting object file, and allow @command{dyld(1)} to load it in at
2300 run time instead.  This is used in conjunction with the Fix-and-Continue
2301 debugging mode, where the object file in question may be recompiled and
2302 dynamically reloaded in the course of program execution, without the need
2303 to restart the program itself.  Currently, Fix-and-Continue functionality
2304 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2305 and later.
2306
2307 @item -fzero-link
2308 @opindex fzero-link
2309 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2310 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2311 compile time) with static class references that get initialized at load time,
2312 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2313 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2314 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2315 for individual class implementations to be modified during program execution.
2316
2317 @item -gen-decls
2318 @opindex gen-decls
2319 Dump interface declarations for all classes seen in the source file to a
2320 file named @file{@var{sourcename}.decl}.
2321
2322 @item -Wassign-intercept
2323 @opindex Wassign-intercept
2324 Warn whenever an Objective-C assignment is being intercepted by the
2325 garbage collector.
2326
2327 @item -Wno-protocol
2328 @opindex Wno-protocol
2329 If a class is declared to implement a protocol, a warning is issued for
2330 every method in the protocol that is not implemented by the class.  The
2331 default behavior is to issue a warning for every method not explicitly
2332 implemented in the class, even if a method implementation is inherited
2333 from the superclass.  If you use the @option{-Wno-protocol} option, then
2334 methods inherited from the superclass are considered to be implemented,
2335 and no warning is issued for them.
2336
2337 @item -Wselector
2338 @opindex Wselector
2339 Warn if multiple methods of different types for the same selector are
2340 found during compilation.  The check is performed on the list of methods
2341 in the final stage of compilation.  Additionally, a check is performed
2342 for each selector appearing in a @code{@@selector(@dots{})}
2343 expression, and a corresponding method for that selector has been found
2344 during compilation.  Because these checks scan the method table only at
2345 the end of compilation, these warnings are not produced if the final
2346 stage of compilation is not reached, for example because an error is
2347 found during compilation, or because the @option{-fsyntax-only} option is
2348 being used.
2349
2350 @item -Wstrict-selector-match
2351 @opindex Wstrict-selector-match
2352 Warn if multiple methods with differing argument and/or return types are
2353 found for a given selector when attempting to send a message using this
2354 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2355 is off (which is the default behavior), the compiler will omit such warnings
2356 if any differences found are confined to types which share the same size
2357 and alignment.
2358
2359 @item -Wundeclared-selector
2360 @opindex Wundeclared-selector
2361 Warn if a @code{@@selector(@dots{})} expression referring to an
2362 undeclared selector is found.  A selector is considered undeclared if no
2363 method with that name has been declared before the
2364 @code{@@selector(@dots{})} expression, either explicitly in an
2365 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2366 an @code{@@implementation} section.  This option always performs its
2367 checks as soon as a @code{@@selector(@dots{})} expression is found,
2368 while @option{-Wselector} only performs its checks in the final stage of
2369 compilation.  This also enforces the coding style convention
2370 that methods and selectors must be declared before being used.
2371
2372 @item -print-objc-runtime-info
2373 @opindex print-objc-runtime-info
2374 Generate C header describing the largest structure that is passed by
2375 value, if any.
2376
2377 @end table
2378
2379 @node Language Independent Options
2380 @section Options to Control Diagnostic Messages Formatting
2381 @cindex options to control diagnostics formatting
2382 @cindex diagnostic messages
2383 @cindex message formatting
2384
2385 Traditionally, diagnostic messages have been formatted irrespective of
2386 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2387 below can be used to control the diagnostic messages formatting
2388 algorithm, e.g.@: how many characters per line, how often source location
2389 information should be reported.  Right now, only the C++ front end can
2390 honor these options.  However it is expected, in the near future, that
2391 the remaining front ends would be able to digest them correctly.
2392
2393 @table @gcctabopt
2394 @item -fmessage-length=@var{n}
2395 @opindex fmessage-length
2396 Try to format error messages so that they fit on lines of about @var{n}
2397 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2398 the front ends supported by GCC@.  If @var{n} is zero, then no
2399 line-wrapping will be done; each error message will appear on a single
2400 line.
2401
2402 @opindex fdiagnostics-show-location
2403 @item -fdiagnostics-show-location=once
2404 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2405 reporter to emit @emph{once} source location information; that is, in
2406 case the message is too long to fit on a single physical line and has to
2407 be wrapped, the source location won't be emitted (as prefix) again,
2408 over and over, in subsequent continuation lines.  This is the default
2409 behavior.
2410
2411 @item -fdiagnostics-show-location=every-line
2412 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2413 messages reporter to emit the same source location information (as
2414 prefix) for physical lines that result from the process of breaking
2415 a message which is too long to fit on a single line.
2416
2417 @item -fdiagnostics-show-option
2418 @opindex fdiagnostics-show-option
2419 This option instructs the diagnostic machinery to add text to each
2420 diagnostic emitted, which indicates which command line option directly
2421 controls that diagnostic, when such an option is known to the
2422 diagnostic machinery.
2423
2424 @item -Wcoverage-mismatch
2425 @opindex Wcoverage-mismatch
2426 Warn if feedback profiles do not match when using the
2427 @option{-fprofile-use} option.
2428 If a source file was changed between @option{-fprofile-gen} and
2429 @option{-fprofile-use}, the files with the profile feedback can fail
2430 to match the source file and GCC can not use the profile feedback
2431 information.  By default, GCC emits an error message in this case.
2432 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2433 error.  GCC does not use appropriate feedback profiles, so using this
2434 option can result in poorly optimized code.  This option is useful
2435 only in the case of very minor changes such as bug fixes to an
2436 existing code-base.
2437
2438 @end table
2439
2440 @node Warning Options
2441 @section Options to Request or Suppress Warnings
2442 @cindex options to control warnings
2443 @cindex warning messages
2444 @cindex messages, warning
2445 @cindex suppressing warnings
2446
2447 Warnings are diagnostic messages that report constructions which
2448 are not inherently erroneous but which are risky or suggest there
2449 may have been an error.
2450
2451 You can request many specific warnings with options beginning @samp{-W},
2452 for example @option{-Wimplicit} to request warnings on implicit
2453 declarations.  Each of these specific warning options also has a
2454 negative form beginning @samp{-Wno-} to turn off warnings;
2455 for example, @option{-Wno-implicit}.  This manual lists only one of the
2456 two forms, whichever is not the default.
2457
2458 The following options control the amount and kinds of warnings produced
2459 by GCC; for further, language-specific options also refer to
2460 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2461 Options}.
2462
2463 @table @gcctabopt
2464 @cindex syntax checking
2465 @item -fsyntax-only
2466 @opindex fsyntax-only
2467 Check the code for syntax errors, but don't do anything beyond that.
2468
2469 @item -pedantic
2470 @opindex pedantic
2471 Issue all the warnings demanded by strict ISO C and ISO C++;
2472 reject all programs that use forbidden extensions, and some other
2473 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2474 version of the ISO C standard specified by any @option{-std} option used.
2475
2476 Valid ISO C and ISO C++ programs should compile properly with or without
2477 this option (though a rare few will require @option{-ansi} or a
2478 @option{-std} option specifying the required version of ISO C)@.  However,
2479 without this option, certain GNU extensions and traditional C and C++
2480 features are supported as well.  With this option, they are rejected.
2481
2482 @option{-pedantic} does not cause warning messages for use of the
2483 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2484 warnings are also disabled in the expression that follows
2485 @code{__extension__}.  However, only system header files should use
2486 these escape routes; application programs should avoid them.
2487 @xref{Alternate Keywords}.
2488
2489 Some users try to use @option{-pedantic} to check programs for strict ISO
2490 C conformance.  They soon find that it does not do quite what they want:
2491 it finds some non-ISO practices, but not all---only those for which
2492 ISO C @emph{requires} a diagnostic, and some others for which
2493 diagnostics have been added.
2494
2495 A feature to report any failure to conform to ISO C might be useful in
2496 some instances, but would require considerable additional work and would
2497 be quite different from @option{-pedantic}.  We don't have plans to
2498 support such a feature in the near future.
2499
2500 Where the standard specified with @option{-std} represents a GNU
2501 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2502 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2503 extended dialect is based.  Warnings from @option{-pedantic} are given
2504 where they are required by the base standard.  (It would not make sense
2505 for such warnings to be given only for features not in the specified GNU
2506 C dialect, since by definition the GNU dialects of C include all
2507 features the compiler supports with the given option, and there would be
2508 nothing to warn about.)
2509
2510 @item -pedantic-errors
2511 @opindex pedantic-errors
2512 Like @option{-pedantic}, except that errors are produced rather than
2513 warnings.
2514
2515 @item -w
2516 @opindex w
2517 Inhibit all warning messages.
2518
2519 @item -Wno-import
2520 @opindex Wno-import
2521 Inhibit warning messages about the use of @samp{#import}.
2522
2523 @item -Wchar-subscripts
2524 @opindex Wchar-subscripts
2525 Warn if an array subscript has type @code{char}.  This is a common cause
2526 of error, as programmers often forget that this type is signed on some
2527 machines.
2528 This warning is enabled by @option{-Wall}.
2529
2530 @item -Wcomment
2531 @opindex Wcomment
2532 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2533 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2534 This warning is enabled by @option{-Wall}.
2535
2536 @item -Wfatal-errors
2537 @opindex Wfatal-errors
2538 This option causes the compiler to abort compilation on the first error
2539 occurred rather than trying to keep going and printing further error
2540 messages.
2541
2542 @item -Wformat
2543 @opindex Wformat
2544 @opindex ffreestanding
2545 @opindex fno-builtin
2546 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2547 the arguments supplied have types appropriate to the format string
2548 specified, and that the conversions specified in the format string make
2549 sense.  This includes standard functions, and others specified by format
2550 attributes (@pxref{Function Attributes}), in the @code{printf},
2551 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2552 not in the C standard) families (or other target-specific families).
2553 Which functions are checked without format attributes having been
2554 specified depends on the standard version selected, and such checks of
2555 functions without the attribute specified are disabled by
2556 @option{-ffreestanding} or @option{-fno-builtin}.
2557
2558 The formats are checked against the format features supported by GNU
2559 libc version 2.2.  These include all ISO C90 and C99 features, as well
2560 as features from the Single Unix Specification and some BSD and GNU
2561 extensions.  Other library implementations may not support all these
2562 features; GCC does not support warning about features that go beyond a
2563 particular library's limitations.  However, if @option{-pedantic} is used
2564 with @option{-Wformat}, warnings will be given about format features not
2565 in the selected standard version (but not for @code{strfmon} formats,
2566 since those are not in any version of the C standard).  @xref{C Dialect
2567 Options,,Options Controlling C Dialect}.
2568
2569 Since @option{-Wformat} also checks for null format arguments for
2570 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2571
2572 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2573 aspects of format checking, the options @option{-Wformat-y2k},
2574 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2575 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2576 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2577
2578 @item -Wformat-y2k
2579 @opindex Wformat-y2k
2580 If @option{-Wformat} is specified, also warn about @code{strftime}
2581 formats which may yield only a two-digit year.
2582
2583 @item -Wno-format-extra-args
2584 @opindex Wno-format-extra-args
2585 If @option{-Wformat} is specified, do not warn about excess arguments to a
2586 @code{printf} or @code{scanf} format function.  The C standard specifies
2587 that such arguments are ignored.
2588
2589 Where the unused arguments lie between used arguments that are
2590 specified with @samp{$} operand number specifications, normally
2591 warnings are still given, since the implementation could not know what
2592 type to pass to @code{va_arg} to skip the unused arguments.  However,
2593 in the case of @code{scanf} formats, this option will suppress the
2594 warning if the unused arguments are all pointers, since the Single
2595 Unix Specification says that such unused arguments are allowed.
2596
2597 @item -Wno-format-zero-length
2598 @opindex Wno-format-zero-length
2599 If @option{-Wformat} is specified, do not warn about zero-length formats.
2600 The C standard specifies that zero-length formats are allowed.
2601
2602 @item -Wformat-nonliteral
2603 @opindex Wformat-nonliteral
2604 If @option{-Wformat} is specified, also warn if the format string is not a
2605 string literal and so cannot be checked, unless the format function
2606 takes its format arguments as a @code{va_list}.
2607
2608 @item -Wformat-security
2609 @opindex Wformat-security
2610 If @option{-Wformat} is specified, also warn about uses of format
2611 functions that represent possible security problems.  At present, this
2612 warns about calls to @code{printf} and @code{scanf} functions where the
2613 format string is not a string literal and there are no format arguments,
2614 as in @code{printf (foo);}.  This may be a security hole if the format
2615 string came from untrusted input and contains @samp{%n}.  (This is
2616 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2617 in future warnings may be added to @option{-Wformat-security} that are not
2618 included in @option{-Wformat-nonliteral}.)
2619
2620 @item -Wformat=2
2621 @opindex Wformat=2
2622 Enable @option{-Wformat} plus format checks not included in
2623 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2624 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2625
2626 @item -Wnonnull
2627 @opindex Wnonnull
2628 Warn about passing a null pointer for arguments marked as
2629 requiring a non-null value by the @code{nonnull} function attribute.
2630
2631 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2632 can be disabled with the @option{-Wno-nonnull} option.
2633
2634 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2635 @opindex Winit-self
2636 Warn about uninitialized variables which are initialized with themselves.
2637 Note this option can only be used with the @option{-Wuninitialized} option,
2638 which in turn only works with @option{-O1} and above.
2639
2640 For example, GCC will warn about @code{i} being uninitialized in the
2641 following snippet only when @option{-Winit-self} has been specified:
2642 @smallexample
2643 @group
2644 int f()
2645 @{
2646   int i = i;
2647   return i;
2648 @}
2649 @end group
2650 @end smallexample
2651
2652 @item -Wimplicit-int
2653 @opindex Wimplicit-int
2654 Warn when a declaration does not specify a type.
2655 This warning is enabled by @option{-Wall}.
2656
2657 @item -Wimplicit-function-declaration
2658 @opindex Wimplicit-function-declaration
2659 @opindex Wno-implicit-function-declaration
2660 Give a warning whenever a function is used before being declared. In
2661 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2662 enabled by default and it is made into an error by
2663 @option{-pedantic-errors}. This warning is also enabled by
2664 @option{-Wall}.
2665
2666 @item -Wimplicit
2667 @opindex Wimplicit
2668 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2669 This warning is enabled by @option{-Wall}.
2670
2671 @item -Wmain
2672 @opindex Wmain
2673 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2674 function with external linkage, returning int, taking either zero
2675 arguments, two, or three arguments of appropriate types.
2676 This warning is enabled by @option{-Wall}.
2677
2678 @item -Wmissing-braces
2679 @opindex Wmissing-braces
2680 Warn if an aggregate or union initializer is not fully bracketed.  In
2681 the following example, the initializer for @samp{a} is not fully
2682 bracketed, but that for @samp{b} is fully bracketed.
2683
2684 @smallexample
2685 int a[2][2] = @{ 0, 1, 2, 3 @};
2686 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2687 @end smallexample
2688
2689 This warning is enabled by @option{-Wall}.
2690
2691 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2692 @opindex Wmissing-include-dirs
2693 Warn if a user-supplied include directory does not exist.
2694
2695 @item -Wparentheses
2696 @opindex Wparentheses
2697 Warn if parentheses are omitted in certain contexts, such
2698 as when there is an assignment in a context where a truth value
2699 is expected, or when operators are nested whose precedence people
2700 often get confused about.
2701
2702 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2703 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2704 interpretation from that of ordinary mathematical notation.
2705
2706 Also warn about constructions where there may be confusion to which
2707 @code{if} statement an @code{else} branch belongs.  Here is an example of
2708 such a case:
2709
2710 @smallexample
2711 @group
2712 @{
2713   if (a)
2714     if (b)
2715       foo ();
2716   else
2717     bar ();
2718 @}
2719 @end group
2720 @end smallexample
2721
2722 In C/C++, every @code{else} branch belongs to the innermost possible
2723 @code{if} statement, which in this example is @code{if (b)}.  This is
2724 often not what the programmer expected, as illustrated in the above
2725 example by indentation the programmer chose.  When there is the
2726 potential for this confusion, GCC will issue a warning when this flag
2727 is specified.  To eliminate the warning, add explicit braces around
2728 the innermost @code{if} statement so there is no way the @code{else}
2729 could belong to the enclosing @code{if}.  The resulting code would
2730 look like this:
2731
2732 @smallexample
2733 @group
2734 @{
2735   if (a)
2736     @{
2737       if (b)
2738         foo ();
2739       else
2740         bar ();
2741     @}
2742 @}
2743 @end group
2744 @end smallexample
2745
2746 This warning is enabled by @option{-Wall}.
2747
2748 @item -Wsequence-point
2749 @opindex Wsequence-point
2750 Warn about code that may have undefined semantics because of violations
2751 of sequence point rules in the C and C++ standards.
2752
2753 The C and C++ standards defines the order in which expressions in a C/C++
2754 program are evaluated in terms of @dfn{sequence points}, which represent
2755 a partial ordering between the execution of parts of the program: those
2756 executed before the sequence point, and those executed after it.  These
2757 occur after the evaluation of a full expression (one which is not part
2758 of a larger expression), after the evaluation of the first operand of a
2759 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2760 function is called (but after the evaluation of its arguments and the
2761 expression denoting the called function), and in certain other places.
2762 Other than as expressed by the sequence point rules, the order of
2763 evaluation of subexpressions of an expression is not specified.  All
2764 these rules describe only a partial order rather than a total order,
2765 since, for example, if two functions are called within one expression
2766 with no sequence point between them, the order in which the functions
2767 are called is not specified.  However, the standards committee have
2768 ruled that function calls do not overlap.
2769
2770 It is not specified when between sequence points modifications to the
2771 values of objects take effect.  Programs whose behavior depends on this
2772 have undefined behavior; the C and C++ standards specify that ``Between
2773 the previous and next sequence point an object shall have its stored
2774 value modified at most once by the evaluation of an expression.  
2775 Furthermore, the prior value shall be read only to determine the value
2776 to be stored.''.  If a program breaks these rules, the results on any
2777 particular implementation are entirely unpredictable.
2778
2779 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2780 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2781 diagnosed by this option, and it may give an occasional false positive
2782 result, but in general it has been found fairly effective at detecting
2783 this sort of problem in programs.
2784
2785 The standard is worded confusingly, therefore there is some debate
2786 over the precise meaning of the sequence point rules in subtle cases.
2787 Links to discussions of the problem, including proposed formal
2788 definitions, may be found on the GCC readings page, at
2789 @w{@uref{http://gcc.gnu.org/readings.html}}.
2790
2791 This warning is enabled by @option{-Wall} for C and C++.
2792
2793 @item -Wreturn-type
2794 @opindex Wreturn-type
2795 Warn whenever a function is defined with a return-type that defaults to
2796 @code{int}.  Also warn about any @code{return} statement with no
2797 return-value in a function whose return-type is not @code{void}.
2798
2799 Also warn if the return type of a function has a type qualifier
2800 such as @code{const}.  For ISO C such a type qualifier has no effect,
2801 since the value returned by a function is not an lvalue.
2802 For C++, the warning is only emitted for scalar types or @code{void}.
2803 ISO C prohibits qualified @code{void} return types on function
2804 definitions, so such return types always receive a warning
2805 even without this option.
2806
2807 For C++, a function without return type always produces a diagnostic
2808 message, even when @option{-Wno-return-type} is specified.  The only
2809 exceptions are @samp{main} and functions defined in system headers.
2810
2811 This warning is enabled by @option{-Wall}.
2812
2813 @item -Wswitch
2814 @opindex Wswitch
2815 Warn whenever a @code{switch} statement has an index of enumerated type
2816 and lacks a @code{case} for one or more of the named codes of that
2817 enumeration.  (The presence of a @code{default} label prevents this
2818 warning.)  @code{case} labels outside the enumeration range also
2819 provoke warnings when this option is used.
2820 This warning is enabled by @option{-Wall}.
2821
2822 @item -Wswitch-default
2823 @opindex Wswitch-switch
2824 Warn whenever a @code{switch} statement does not have a @code{default}
2825 case.
2826
2827 @item -Wswitch-enum
2828 @opindex Wswitch-enum
2829 Warn whenever a @code{switch} statement has an index of enumerated type
2830 and lacks a @code{case} for one or more of the named codes of that
2831 enumeration.  @code{case} labels outside the enumeration range also
2832 provoke warnings when this option is used.
2833
2834 @item -Wtrigraphs
2835 @opindex Wtrigraphs
2836 Warn if any trigraphs are encountered that might change the meaning of
2837 the program (trigraphs within comments are not warned about).
2838 This warning is enabled by @option{-Wall}.
2839
2840 @item -Wunused-function
2841 @opindex Wunused-function
2842 Warn whenever a static function is declared but not defined or a
2843 non-inline static function is unused.
2844 This warning is enabled by @option{-Wall}.
2845
2846 @item -Wunused-label
2847 @opindex Wunused-label
2848 Warn whenever a label is declared but not used.
2849 This warning is enabled by @option{-Wall}.
2850
2851 To suppress this warning use the @samp{unused} attribute
2852 (@pxref{Variable Attributes}).
2853
2854 @item -Wunused-parameter
2855 @opindex Wunused-parameter
2856 Warn whenever a function parameter is unused aside from its declaration.
2857
2858 To suppress this warning use the @samp{unused} attribute
2859 (@pxref{Variable Attributes}).
2860
2861 @item -Wunused-variable
2862 @opindex Wunused-variable
2863 Warn whenever a local variable or non-constant static variable is unused
2864 aside from its declaration.
2865 This warning is enabled by @option{-Wall}.
2866
2867 To suppress this warning use the @samp{unused} attribute
2868 (@pxref{Variable Attributes}).
2869
2870 @item -Wunused-value
2871 @opindex Wunused-value
2872 Warn whenever a statement computes a result that is explicitly not
2873 used. To suppress this warning cast the unused expression to
2874 @samp{void}. This includes an expression-statement or the left-hand
2875 side of a comma expression that contains no side effects. For example,
2876 an expression such as @samp{x[i,j]} will cause a warning, while
2877 @samp{x[(void)i,j]} will not.
2878
2879 This warning is enabled by @option{-Wall}.
2880
2881 @item -Wunused
2882 @opindex Wunused
2883 All the above @option{-Wunused} options combined.
2884
2885 In order to get a warning about an unused function parameter, you must
2886 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2887 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2888
2889 @item -Wuninitialized
2890 @opindex Wuninitialized
2891 Warn if an automatic variable is used without first being initialized or
2892 if a variable may be clobbered by a @code{setjmp} call.
2893
2894 These warnings are possible only in optimizing compilation,
2895 because they require data flow information that is computed only
2896 when optimizing.  If you do not specify @option{-O}, you will not get
2897 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2898 requiring @option{-O}.
2899
2900 If you want to warn about code which uses the uninitialized value of the
2901 variable in its own initializer, use the @option{-Winit-self} option.
2902
2903 These warnings occur for individual uninitialized or clobbered
2904 elements of structure, union or array variables as well as for
2905 variables which are uninitialized or clobbered as a whole.  They do
2906 not occur for variables or elements declared @code{volatile}.  Because
2907 these warnings depend on optimization, the exact variables or elements
2908 for which there are warnings will depend on the precise optimization
2909 options and version of GCC used.
2910
2911 Note that there may be no warning about a variable that is used only
2912 to compute a value that itself is never used, because such
2913 computations may be deleted by data flow analysis before the warnings
2914 are printed.
2915
2916 These warnings are made optional because GCC is not smart
2917 enough to see all the reasons why the code might be correct
2918 despite appearing to have an error.  Here is one example of how
2919 this can happen:
2920
2921 @smallexample
2922 @group
2923 @{
2924   int x;
2925   switch (y)
2926     @{
2927     case 1: x = 1;
2928       break;
2929     case 2: x = 4;
2930       break;
2931     case 3: x = 5;
2932     @}
2933   foo (x);
2934 @}
2935 @end group
2936 @end smallexample
2937
2938 @noindent
2939 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2940 always initialized, but GCC doesn't know this.  Here is
2941 another common case:
2942
2943 @smallexample
2944 @{
2945   int save_y;
2946   if (change_y) save_y = y, y = new_y;
2947   @dots{}
2948   if (change_y) y = save_y;
2949 @}
2950 @end smallexample
2951
2952 @noindent
2953 This has no bug because @code{save_y} is used only if it is set.
2954
2955 @cindex @code{longjmp} warnings
2956 This option also warns when a non-volatile automatic variable might be
2957 changed by a call to @code{longjmp}.  These warnings as well are possible
2958 only in optimizing compilation.
2959
2960 The compiler sees only the calls to @code{setjmp}.  It cannot know
2961 where @code{longjmp} will be called; in fact, a signal handler could
2962 call it at any point in the code.  As a result, you may get a warning
2963 even when there is in fact no problem because @code{longjmp} cannot
2964 in fact be called at the place which would cause a problem.
2965
2966 Some spurious warnings can be avoided if you declare all the functions
2967 you use that never return as @code{noreturn}.  @xref{Function
2968 Attributes}.
2969
2970 This warning is enabled by @option{-Wall}.
2971
2972 @item -Wunknown-pragmas
2973 @opindex Wunknown-pragmas
2974 @cindex warning for unknown pragmas
2975 @cindex unknown pragmas, warning
2976 @cindex pragmas, warning of unknown
2977 Warn when a #pragma directive is encountered which is not understood by
2978 GCC@.  If this command line option is used, warnings will even be issued
2979 for unknown pragmas in system header files.  This is not the case if
2980 the warnings were only enabled by the @option{-Wall} command line option.
2981
2982 @item -Wno-pragmas
2983 @opindex Wno-pragmas
2984 @opindex Wpragmas
2985 Do not warn about misuses of pragmas, such as incorrect parameters,
2986 invalid syntax, or conflicts between pragmas.  See also
2987 @samp{-Wunknown-pragmas}.
2988
2989 @item -Wstrict-aliasing
2990 @opindex Wstrict-aliasing
2991 This option is only active when @option{-fstrict-aliasing} is active.
2992 It warns about code which might break the strict aliasing rules that the
2993 compiler is using for optimization.  The warning does not catch all
2994 cases, but does attempt to catch the more common pitfalls.  It is
2995 included in @option{-Wall}.
2996
2997 @item -Wstrict-aliasing=2
2998 @opindex Wstrict-aliasing=2
2999 This option is only active when @option{-fstrict-aliasing} is active.
3000 It warns about code which might break the strict aliasing rules that the
3001 compiler is using for optimization.  This warning catches more cases than
3002 @option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
3003 cases that are safe.
3004
3005 @item -Wstrict-overflow
3006 @item -Wstrict-overflow=@var{n}
3007 @opindex -Wstrict-overflow
3008 This option is only active when @option{-fstrict-overflow} is active.
3009 It warns about cases where the compiler optimizes based on the
3010 assumption that signed overflow does not occur.  Note that it does not
3011 warn about all cases where the code might overflow: it only warns
3012 about cases where the compiler implements some optimization.  Thus
3013 this warning depends on the optimization level.
3014
3015 An optimization which assumes that signed overflow does not occur is
3016 perfectly safe if the values of the variables involved are such that
3017 overflow never does, in fact, occur.  Therefore this warning can
3018 easily give a false positive: a warning about code which is not
3019 actually a problem.  To help focus on important issues, several
3020 warning levels are defined.
3021
3022 @table @option
3023 @item -Wstrict-overflow=1
3024 Warn about cases which are both questionable and easy to avoid.  For
3025 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3026 compiler will simplify this to @code{1}.  This level of
3027 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3028 are not, and must be explicitly requested.
3029
3030 @item -Wstrict-overflow=2
3031 Also warn about other cases where a comparison is simplified to a
3032 constant.  For example: @code{abs (x) >= 0}.  This can only be
3033 simplified when @option{-fstrict-overflow} is in effect, because
3034 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3035 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3036 @option{-Wstrict-overflow=2}.
3037
3038 @item -Wstrict-overflow=3
3039 Also warn about other cases where a comparison is simplified.  For
3040 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3041
3042 @item -Wstrict-overflow=4
3043 Also warn about other simplifications not covered by the above cases.
3044 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3045
3046 @item -Wstrict-overflow=5
3047 Also warn about cases where the compiler reduces the magnitude of a
3048 constant involved in a comparison.  For example: @code{x + 2 > y} will
3049 be simplified to @code{x + 1 >= y}.  This is reported only at the
3050 highest warning level because this simplification applies to many
3051 comparisons, so this warning level will give a very large number of
3052 false positives.
3053 @end table
3054
3055 @item -Warray-bounds
3056 @opindex Wno-array-bounds
3057 @opindex Warray-bounds
3058 This option is only active when @option{-ftree-vrp} is active
3059 (default for -O2 and above). It warns about subscripts to arrays
3060 that are always out of bounds. This warning is enabled by @option{-Wall}.
3061
3062 @item -Wall
3063 @opindex Wall
3064 All of the above @samp{-W} options combined.  This enables all the
3065 warnings about constructions that some users consider questionable, and
3066 that are easy to avoid (or modify to prevent the warning), even in
3067 conjunction with macros.  This also enables some language-specific
3068 warnings described in @ref{C++ Dialect Options} and
3069 @ref{Objective-C and Objective-C++ Dialect Options}.
3070 @end table
3071
3072 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
3073 Some of them warn about constructions that users generally do not
3074 consider questionable, but which occasionally you might wish to check
3075 for; others warn about constructions that are necessary or hard to avoid
3076 in some cases, and there is no simple way to modify the code to suppress
3077 the warning.
3078
3079 @table @gcctabopt
3080 @item -Wextra
3081 @opindex W
3082 @opindex Wextra
3083 (This option used to be called @option{-W}.  The older name is still
3084 supported, but the newer name is more descriptive.)  Print extra warning
3085 messages for these events:
3086
3087 @itemize @bullet
3088 @item
3089 A function can return either with or without a value.  (Falling
3090 off the end of the function body is considered returning without
3091 a value.)  For example, this function would evoke such a
3092 warning:
3093
3094 @smallexample
3095 @group
3096 foo (a)
3097 @{
3098   if (a > 0)
3099     return a;
3100 @}
3101 @end group
3102 @end smallexample
3103
3104 @item
3105 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
3106
3107 @item @r{(C only)}
3108 Storage-class specifiers like @code{static} are not the first things
3109 in a declaration.  According to the C Standard, this usage is
3110 obsolescent.  This warning can be independently controlled by
3111 @option{-Wold-style-declaration}.
3112
3113 @item
3114 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
3115 arguments.
3116
3117 @item
3118 A comparison between signed and unsigned values could produce an
3119 incorrect result when the signed value is converted to unsigned.
3120 (But don't warn if @option{-Wno-sign-compare} is also specified.)
3121
3122 @item
3123 An aggregate has an initializer which does not initialize all members.
3124 This warning can be independently controlled by
3125 @option{-Wmissing-field-initializers}.
3126
3127 @item
3128 An initialized field without side effects is overridden when using
3129 designated initializers (@pxref{Designated Inits, , Designated
3130 Initializers}).  This warning can be independently controlled by
3131 @option{-Woverride-init}.
3132
3133 @item @r{(C only)}
3134 A function parameter is declared without a type specifier in K&R-style
3135 functions.  This warning can be independently controlled by
3136 @option{-Wmissing-parameter-type}.
3137
3138 @item
3139 An empty body occurs in an @samp{if}, @samp{else} or
3140 @samp{do while} statement. This warning can be independently
3141 controlled by @option{-Wempty-body}.
3142
3143 @item
3144 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3145 @samp{>}, or @samp{>=}.
3146
3147 @item
3148 A variable might be changed by @samp{longjmp} or @samp{vfork}.
3149 This warning can be independently controlled by @option{-Wclobbered}.
3150
3151 @item @r{(C++ only)}
3152 An enumerator and a non-enumerator both appear in a conditional expression.
3153
3154 @item @r{(C++ only)}
3155 A non-static reference or non-static @samp{const} member appears in a
3156 class without constructors.
3157
3158 @item @r{(C++ only)}
3159 Ambiguous virtual bases.
3160
3161 @item @r{(C++ only)}
3162 Subscripting an array which has been declared @samp{register}.
3163
3164 @item @r{(C++ only)}
3165 Taking the address of a variable which has been declared @samp{register}.
3166
3167 @item @r{(C++ only)}
3168 A base class is not initialized in a derived class' copy constructor.
3169 @end itemize
3170
3171 @item -Wno-div-by-zero
3172 @opindex Wno-div-by-zero
3173 @opindex Wdiv-by-zero
3174 Do not warn about compile-time integer division by zero.  Floating point
3175 division by zero is not warned about, as it can be a legitimate way of
3176 obtaining infinities and NaNs.
3177
3178 @item -Wsystem-headers
3179 @opindex Wsystem-headers
3180 @cindex warnings from system headers
3181 @cindex system headers, warnings from
3182 Print warning messages for constructs found in system header files.
3183 Warnings from system headers are normally suppressed, on the assumption
3184 that they usually do not indicate real problems and would only make the
3185 compiler output harder to read.  Using this command line option tells
3186 GCC to emit warnings from system headers as if they occurred in user
3187 code.  However, note that using @option{-Wall} in conjunction with this
3188 option will @emph{not} warn about unknown pragmas in system
3189 headers---for that, @option{-Wunknown-pragmas} must also be used.
3190
3191 @item -Wfloat-equal
3192 @opindex Wfloat-equal
3193 Warn if floating point values are used in equality comparisons.
3194
3195 The idea behind this is that sometimes it is convenient (for the
3196 programmer) to consider floating-point values as approximations to
3197 infinitely precise real numbers.  If you are doing this, then you need
3198 to compute (by analyzing the code, or in some other way) the maximum or
3199 likely maximum error that the computation introduces, and allow for it
3200 when performing comparisons (and when producing output, but that's a
3201 different problem).  In particular, instead of testing for equality, you
3202 would check to see whether the two values have ranges that overlap; and
3203 this is done with the relational operators, so equality comparisons are
3204 probably mistaken.
3205
3206 @item -Wtraditional @r{(C only)}
3207 @opindex Wtraditional
3208 Warn about certain constructs that behave differently in traditional and
3209 ISO C@.  Also warn about ISO C constructs that have no traditional C
3210 equivalent, and/or problematic constructs which should be avoided.
3211
3212 @itemize @bullet
3213 @item
3214 Macro parameters that appear within string literals in the macro body.
3215 In traditional C macro replacement takes place within string literals,
3216 but does not in ISO C@.
3217
3218 @item
3219 In traditional C, some preprocessor directives did not exist.
3220 Traditional preprocessors would only consider a line to be a directive
3221 if the @samp{#} appeared in column 1 on the line.  Therefore
3222 @option{-Wtraditional} warns about directives that traditional C
3223 understands but would ignore because the @samp{#} does not appear as the
3224 first character on the line.  It also suggests you hide directives like
3225 @samp{#pragma} not understood by traditional C by indenting them.  Some
3226 traditional implementations would not recognize @samp{#elif}, so it
3227 suggests avoiding it altogether.
3228
3229 @item
3230 A function-like macro that appears without arguments.
3231
3232 @item
3233 The unary plus operator.
3234
3235 @item
3236 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3237 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3238 constants.)  Note, these suffixes appear in macros defined in the system
3239 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3240 Use of these macros in user code might normally lead to spurious
3241 warnings, however GCC's integrated preprocessor has enough context to
3242 avoid warning in these cases.
3243
3244 @item
3245 A function declared external in one block and then used after the end of
3246 the block.
3247
3248 @item
3249 A @code{switch} statement has an operand of type @code{long}.
3250
3251 @item
3252 A non-@code{static} function declaration follows a @code{static} one.
3253 This construct is not accepted by some traditional C compilers.
3254
3255 @item
3256 The ISO type of an integer constant has a different width or
3257 signedness from its traditional type.  This warning is only issued if
3258 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3259 typically represent bit patterns, are not warned about.
3260
3261 @item
3262 Usage of ISO string concatenation is detected.
3263
3264 @item
3265 Initialization of automatic aggregates.
3266
3267 @item
3268 Identifier conflicts with labels.  Traditional C lacks a separate
3269 namespace for labels.
3270
3271 @item
3272 Initialization of unions.  If the initializer is zero, the warning is
3273 omitted.  This is done under the assumption that the zero initializer in
3274 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3275 initializer warnings and relies on default initialization to zero in the
3276 traditional C case.
3277
3278 @item
3279 Conversions by prototypes between fixed/floating point values and vice
3280 versa.  The absence of these prototypes when compiling with traditional
3281 C would cause serious problems.  This is a subset of the possible
3282 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3283
3284 @item
3285 Use of ISO C style function definitions.  This warning intentionally is
3286 @emph{not} issued for prototype declarations or variadic functions
3287 because these ISO C features will appear in your code when using
3288 libiberty's traditional C compatibility macros, @code{PARAMS} and
3289 @code{VPARAMS}.  This warning is also bypassed for nested functions
3290 because that feature is already a GCC extension and thus not relevant to
3291 traditional C compatibility.
3292 @end itemize
3293
3294 @item -Wtraditional-conversion @r{(C only)}
3295 @opindex Wtraditional-conversion
3296 Warn if a prototype causes a type conversion that is different from what
3297 would happen to the same argument in the absence of a prototype.  This
3298 includes conversions of fixed point to floating and vice versa, and
3299 conversions changing the width or signedness of a fixed point argument
3300 except when the same as the default promotion.
3301
3302 @item -Wdeclaration-after-statement @r{(C only)}
3303 @opindex Wdeclaration-after-statement
3304 Warn when a declaration is found after a statement in a block.  This
3305 construct, known from C++, was introduced with ISO C99 and is by default
3306 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3307 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3308
3309 @item -Wundef
3310 @opindex Wundef
3311 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3312
3313 @item -Wno-endif-labels
3314 @opindex Wno-endif-labels
3315 @opindex Wendif-labels
3316 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3317
3318 @item -Wshadow
3319 @opindex Wshadow
3320 Warn whenever a local variable shadows another local variable, parameter or
3321 global variable or whenever a built-in function is shadowed.
3322
3323 @item -Wlarger-than-@var{len}
3324 @opindex Wlarger-than
3325 Warn whenever an object of larger than @var{len} bytes is defined.
3326
3327 @item -Wunsafe-loop-optimizations
3328 @opindex Wunsafe-loop-optimizations
3329 Warn if the loop cannot be optimized because the compiler could not
3330 assume anything on the bounds of the loop indices.  With
3331 @option{-funsafe-loop-optimizations} warn if the compiler made
3332 such assumptions.
3333
3334 @item -Wpointer-arith
3335 @opindex Wpointer-arith
3336 Warn about anything that depends on the ``size of'' a function type or
3337 of @code{void}.  GNU C assigns these types a size of 1, for
3338 convenience in calculations with @code{void *} pointers and pointers
3339 to functions.  In C++, warn also when an arithmetic operation involves
3340 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3341
3342 @item -Wbad-function-cast @r{(C only)}
3343 @opindex Wbad-function-cast
3344 Warn whenever a function call is cast to a non-matching type.
3345 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3346
3347 @item -Wc++-compat
3348 Warn about ISO C constructs that are outside of the common subset of
3349 ISO C and ISO C++, e.g.@: request for implicit conversion from
3350 @code{void *} to a pointer to non-@code{void} type.
3351
3352 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3353 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3354 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords 
3355 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3356
3357 @item -Wcast-qual
3358 @opindex Wcast-qual
3359 Warn whenever a pointer is cast so as to remove a type qualifier from
3360 the target type.  For example, warn if a @code{const char *} is cast
3361 to an ordinary @code{char *}.
3362
3363 @item -Wcast-align
3364 @opindex Wcast-align
3365 Warn whenever a pointer is cast such that the required alignment of the
3366 target is increased.  For example, warn if a @code{char *} is cast to
3367 an @code{int *} on machines where integers can only be accessed at
3368 two- or four-byte boundaries.
3369
3370 @item -Wwrite-strings
3371 @opindex Wwrite-strings
3372 When compiling C, give string constants the type @code{const
3373 char[@var{length}]} so that
3374 copying the address of one into a non-@code{const} @code{char *}
3375 pointer will get a warning; when compiling C++, warn about the
3376 deprecated conversion from string literals to @code{char *}.  This
3377 warning, by default, is enabled for C++ programs.
3378 These warnings will help you find at
3379 compile time code that can try to write into a string constant, but
3380 only if you have been very careful about using @code{const} in
3381 declarations and prototypes.  Otherwise, it will just be a nuisance;
3382 this is why we did not make @option{-Wall} request these warnings.
3383
3384 @item -Wclobbered
3385 @opindex Wclobbered
3386 Warn for variables that might be changed by @samp{longjmp} or
3387 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3388
3389 @item -Wconversion
3390 @opindex Wconversion
3391 Warn for implicit conversions that may alter a value. This includes
3392 conversions between real and integer, like @code{abs (x)} when
3393 @code{x} is @code{double}; conversions between signed and unsigned,
3394 like @code{unsigned ui = -1}; and conversions to smaller types, like
3395 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3396 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3397 changed by the conversion like in @code{abs (2.0)}.
3398
3399 @item -Wempty-body
3400 @opindex Wempty-body
3401 An empty body occurs in an @samp{if}, @samp{else} or @samp{do while}
3402 statement.  This warning is also enabled by @option{-Wextra}.
3403
3404 @item -Wsign-compare
3405 @opindex Wsign-compare
3406 @cindex warning for comparison of signed and unsigned values
3407 @cindex comparison of signed and unsigned values, warning
3408 @cindex signed and unsigned values, comparison warning
3409 Warn when a comparison between signed and unsigned values could produce
3410 an incorrect result when the signed value is converted to unsigned.
3411 This warning is also enabled by @option{-Wextra}; to get the other warnings
3412 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3413
3414 @item -Waddress
3415 @opindex Waddress
3416 @opindex Wno-address
3417 Warn about suspicious uses of memory addresses. These include using
3418 the address of a function in a conditional expression, such as
3419 @code{void func(void); if (func)}, and comparisons against the memory
3420 address of a string literal, such as @code{if (x == "abc")}.  Such
3421 uses typically indicate a programmer error: the address of a function
3422 always evaluates to true, so their use in a conditional usually
3423 indicate that the programmer forgot the parentheses in a function
3424 call; and comparisons against string literals result in unspecified
3425 behavior and are not portable in C, so they usually indicate that the
3426 programmer intended to use @code{strcmp}.  This warning is enabled by
3427 @option{-Wall}.
3428
3429 @item -Wlogical-op
3430 @opindex Wlogical-op
3431 @opindex Wno-logical-op
3432 Warn about suspicious uses of logical operators in expressions.
3433 This includes using logical operators in contexts where a
3434 bit-wise operator is likely to be expected.
3435
3436 @item -Waggregate-return
3437 @opindex Waggregate-return
3438 Warn if any functions that return structures or unions are defined or
3439 called.  (In languages where you can return an array, this also elicits
3440 a warning.)
3441
3442 @item -Wno-attributes
3443 @opindex Wno-attributes
3444 @opindex Wattributes
3445 Do not warn if an unexpected @code{__attribute__} is used, such as
3446 unrecognized attributes, function attributes applied to variables,
3447 etc.  This will not stop errors for incorrect use of supported
3448 attributes.
3449
3450 @item -Wstrict-prototypes @r{(C only)}
3451 @opindex Wstrict-prototypes
3452 Warn if a function is declared or defined without specifying the
3453 argument types.  (An old-style function definition is permitted without
3454 a warning if preceded by a declaration which specifies the argument
3455 types.)
3456
3457 @item -Wold-style-declaration @r{(C only)}
3458 @opindex Wold-style-declaration
3459 Warn for obsolescent usages, according to the C Standard, in a
3460 declaration. For example, warn if storage-class specifiers like
3461 @code{static} are not the first things in a declaration.  This warning
3462 is also enabled by @option{-Wextra}.
3463
3464 @item -Wold-style-definition @r{(C only)}
3465 @opindex Wold-style-definition
3466 Warn if an old-style function definition is used.  A warning is given
3467 even if there is a previous prototype.
3468
3469 @item -Wmissing-parameter-type @r{(C only)}
3470 @opindex Wmissing-parameter-type
3471 A function parameter is declared without a type specifier in K&R-style
3472 functions:
3473
3474 @smallexample
3475 void foo(bar) @{ @}
3476 @end smallexample
3477
3478 This warning is also enabled by @option{-Wextra}.
3479
3480 @item -Wmissing-prototypes @r{(C only)}
3481 @opindex Wmissing-prototypes
3482 Warn if a global function is defined without a previous prototype
3483 declaration.  This warning is issued even if the definition itself
3484 provides a prototype.  The aim is to detect global functions that fail
3485 to be declared in header files.
3486
3487 @item -Wmissing-declarations @r{(C and C++ only)}
3488 @opindex Wmissing-declarations
3489 Warn if a global function is defined without a previous declaration.
3490 Do so even if the definition itself provides a prototype.
3491 Use this option to detect global functions that are not declared in
3492 header files.  In C++, no warnings are issued for function templates,
3493 or for inline functions, or for functions in anonymous namespaces.
3494
3495 @item -Wmissing-field-initializers
3496 @opindex Wmissing-field-initializers
3497 @opindex W
3498 @opindex Wextra
3499 Warn if a structure's initializer has some fields missing.  For
3500 example, the following code would cause such a warning, because
3501 @code{x.h} is implicitly zero:
3502
3503 @smallexample
3504 struct s @{ int f, g, h; @};
3505 struct s x = @{ 3, 4 @};
3506 @end smallexample
3507
3508 This option does not warn about designated initializers, so the following
3509 modification would not trigger a warning:
3510
3511 @smallexample
3512 struct s @{ int f, g, h; @};
3513 struct s x = @{ .f = 3, .g = 4 @};
3514 @end smallexample
3515
3516 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3517 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3518
3519 @item -Wmissing-noreturn
3520 @opindex Wmissing-noreturn
3521 Warn about functions which might be candidates for attribute @code{noreturn}.
3522 Note these are only possible candidates, not absolute ones.  Care should
3523 be taken to manually verify functions actually do not ever return before
3524 adding the @code{noreturn} attribute, otherwise subtle code generation
3525 bugs could be introduced.  You will not get a warning for @code{main} in
3526 hosted C environments.
3527
3528 @item -Wmissing-format-attribute
3529 @opindex Wmissing-format-attribute
3530 @opindex Wformat
3531 Warn about function pointers which might be candidates for @code{format}
3532 attributes.  Note these are only possible candidates, not absolute ones.
3533 GCC will guess that function pointers with @code{format} attributes that
3534 are used in assignment, initialization, parameter passing or return
3535 statements should have a corresponding @code{format} attribute in the
3536 resulting type.  I.e.@: the left-hand side of the assignment or
3537 initialization, the type of the parameter variable, or the return type
3538 of the containing function respectively should also have a @code{format}
3539 attribute to avoid the warning.
3540
3541 GCC will also warn about function definitions which might be
3542 candidates for @code{format} attributes.  Again, these are only
3543 possible candidates.  GCC will guess that @code{format} attributes
3544 might be appropriate for any function that calls a function like
3545 @code{vprintf} or @code{vscanf}, but this might not always be the
3546 case, and some functions for which @code{format} attributes are
3547 appropriate may not be detected.
3548
3549 @item -Wno-multichar
3550 @opindex Wno-multichar
3551 @opindex Wmultichar
3552 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3553 Usually they indicate a typo in the user's code, as they have
3554 implementation-defined values, and should not be used in portable code.
3555
3556 @item -Wnormalized=<none|id|nfc|nfkc>
3557 @opindex Wnormalized
3558 @cindex NFC
3559 @cindex NFKC
3560 @cindex character set, input normalization
3561 In ISO C and ISO C++, two identifiers are different if they are
3562 different sequences of characters.  However, sometimes when characters
3563 outside the basic ASCII character set are used, you can have two
3564 different character sequences that look the same.  To avoid confusion,
3565 the ISO 10646 standard sets out some @dfn{normalization rules} which
3566 when applied ensure that two sequences that look the same are turned into
3567 the same sequence.  GCC can warn you if you are using identifiers which
3568 have not been normalized; this option controls that warning.
3569
3570 There are four levels of warning that GCC supports.  The default is
3571 @option{-Wnormalized=nfc}, which warns about any identifier which is
3572 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3573 recommended form for most uses.
3574
3575 Unfortunately, there are some characters which ISO C and ISO C++ allow
3576 in identifiers that when turned into NFC aren't allowable as
3577 identifiers.  That is, there's no way to use these symbols in portable
3578 ISO C or C++ and have all your identifiers in NFC.
3579 @option{-Wnormalized=id} suppresses the warning for these characters.
3580 It is hoped that future versions of the standards involved will correct
3581 this, which is why this option is not the default.
3582
3583 You can switch the warning off for all characters by writing
3584 @option{-Wnormalized=none}.  You would only want to do this if you
3585 were using some other normalization scheme (like ``D''), because
3586 otherwise you can easily create bugs that are literally impossible to see.
3587
3588 Some characters in ISO 10646 have distinct meanings but look identical
3589 in some fonts or display methodologies, especially once formatting has
3590 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3591 LETTER N'', will display just like a regular @code{n} which has been
3592 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3593 normalization scheme to convert all these into a standard form as
3594 well, and GCC will warn if your code is not in NFKC if you use
3595 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3596 about every identifier that contains the letter O because it might be
3597 confused with the digit 0, and so is not the default, but may be
3598 useful as a local coding convention if the programming environment is
3599 unable to be fixed to display these characters distinctly.
3600
3601 @item -Wno-deprecated-declarations
3602 @opindex Wno-deprecated-declarations
3603 Do not warn about uses of functions (@pxref{Function Attributes}),
3604 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3605 Attributes}) marked as deprecated by using the @code{deprecated}
3606 attribute.
3607
3608 @item -Wno-overflow
3609 @opindex Wno-overflow
3610 Do not warn about compile-time overflow in constant expressions.
3611
3612 @item -Woverride-init
3613 @opindex Woverride-init
3614 @opindex W
3615 @opindex Wextra
3616 Warn if an initialized field without side effects is overridden when
3617 using designated initializers (@pxref{Designated Inits, , Designated
3618 Initializers}).
3619
3620 This warning is included in @option{-Wextra}.  To get other
3621 @option{-Wextra} warnings without this one, use @samp{-Wextra
3622 -Wno-override-init}.
3623
3624 @item -Wpacked
3625 @opindex Wpacked
3626 Warn if a structure is given the packed attribute, but the packed
3627 attribute has no effect on the layout or size of the structure.
3628 Such structures may be mis-aligned for little benefit.  For
3629 instance, in this code, the variable @code{f.x} in @code{struct bar}
3630 will be misaligned even though @code{struct bar} does not itself
3631 have the packed attribute:
3632
3633 @smallexample
3634 @group
3635 struct foo @{
3636   int x;
3637   char a, b, c, d;
3638 @} __attribute__((packed));
3639 struct bar @{
3640   char z;
3641   struct foo f;
3642 @};
3643 @end group
3644 @end smallexample
3645
3646 @item -Wpadded
3647 @opindex Wpadded
3648 Warn if padding is included in a structure, either to align an element
3649 of the structure or to align the whole structure.  Sometimes when this
3650 happens it is possible to rearrange the fields of the structure to
3651 reduce the padding and so make the structure smaller.
3652
3653 @item -Wredundant-decls
3654 @opindex Wredundant-decls
3655 Warn if anything is declared more than once in the same scope, even in
3656 cases where multiple declaration is valid and changes nothing.
3657
3658 @item -Wnested-externs @r{(C only)}
3659 @opindex Wnested-externs
3660 Warn if an @code{extern} declaration is encountered within a function.
3661
3662 @item -Wunreachable-code
3663 @opindex Wunreachable-code
3664 Warn if the compiler detects that code will never be executed.
3665
3666 This option is intended to warn when the compiler detects that at
3667 least a whole line of source code will never be executed, because
3668 some condition is never satisfied or because it is after a
3669 procedure that never returns.
3670
3671 It is possible for this option to produce a warning even though there
3672 are circumstances under which part of the affected line can be executed,
3673 so care should be taken when removing apparently-unreachable code.
3674
3675 For instance, when a function is inlined, a warning may mean that the
3676 line is unreachable in only one inlined copy of the function.
3677
3678 This option is not made part of @option{-Wall} because in a debugging
3679 version of a program there is often substantial code which checks
3680 correct functioning of the program and is, hopefully, unreachable
3681 because the program does work.  Another common use of unreachable
3682 code is to provide behavior which is selectable at compile-time.
3683
3684 @item -Winline
3685 @opindex Winline
3686 Warn if a function can not be inlined and it was declared as inline.
3687 Even with this option, the compiler will not warn about failures to
3688 inline functions declared in system headers.
3689
3690 The compiler uses a variety of heuristics to determine whether or not
3691 to inline a function.  For example, the compiler takes into account
3692 the size of the function being inlined and the amount of inlining
3693 that has already been done in the current function.  Therefore,
3694 seemingly insignificant changes in the source program can cause the
3695 warnings produced by @option{-Winline} to appear or disappear.
3696
3697 @item -Wno-invalid-offsetof @r{(C++ only)}
3698 @opindex Wno-invalid-offsetof
3699 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3700 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3701 to a non-POD type is undefined.  In existing C++ implementations,
3702 however, @samp{offsetof} typically gives meaningful results even when
3703 applied to certain kinds of non-POD types. (Such as a simple
3704 @samp{struct} that fails to be a POD type only by virtue of having a
3705 constructor.)  This flag is for users who are aware that they are
3706 writing nonportable code and who have deliberately chosen to ignore the
3707 warning about it.
3708
3709 The restrictions on @samp{offsetof} may be relaxed in a future version
3710 of the C++ standard.
3711
3712 @item -Wno-int-to-pointer-cast @r{(C only)}
3713 @opindex Wno-int-to-pointer-cast
3714 Suppress warnings from casts to pointer type of an integer of a
3715 different size.
3716
3717 @item -Wno-pointer-to-int-cast @r{(C only)}
3718 @opindex Wno-pointer-to-int-cast
3719 Suppress warnings from casts from a pointer to an integer type of a
3720 different size.
3721
3722 @item -Winvalid-pch
3723 @opindex Winvalid-pch
3724 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3725 the search path but can't be used.
3726
3727 @item -Wlong-long
3728 @opindex Wlong-long
3729 @opindex Wno-long-long
3730 Warn if @samp{long long} type is used.  This is default.  To inhibit
3731 the warning messages, use @option{-Wno-long-long}.  Flags
3732 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3733 only when @option{-pedantic} flag is used.
3734
3735 @item -Wvariadic-macros
3736 @opindex Wvariadic-macros
3737 @opindex Wno-variadic-macros
3738 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3739 alternate syntax when in pedantic ISO C99 mode.  This is default.
3740 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3741
3742 @item -Wvla
3743 @opindex Wvla
3744 @opindex Wno-vla
3745 Warn if variable length array is used in the code.
3746 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
3747 the variable length array.
3748
3749 @item -Wvolatile-register-var
3750 @opindex Wvolatile-register-var
3751 @opindex Wno-volatile-register-var
3752 Warn if a register variable is declared volatile.  The volatile
3753 modifier does not inhibit all optimizations that may eliminate reads
3754 and/or writes to register variables.
3755
3756 @item -Wdisabled-optimization
3757 @opindex Wdisabled-optimization
3758 Warn if a requested optimization pass is disabled.  This warning does
3759 not generally indicate that there is anything wrong with your code; it
3760 merely indicates that GCC's optimizers were unable to handle the code
3761 effectively.  Often, the problem is that your code is too big or too
3762 complex; GCC will refuse to optimize programs when the optimization
3763 itself is likely to take inordinate amounts of time.
3764
3765 @item -Wpointer-sign
3766 @opindex Wpointer-sign
3767 @opindex Wno-pointer-sign
3768 Warn for pointer argument passing or assignment with different signedness.
3769 This option is only supported for C and Objective-C@.  It is implied by
3770 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3771 @option{-Wno-pointer-sign}.
3772
3773 @item -Werror
3774 @opindex Werror
3775 Make all warnings into errors.
3776
3777 @item -Werror=
3778 @opindex Werror=
3779 Make the specified warning into an errors.  The specifier for a
3780 warning is appended, for example @option{-Werror=switch} turns the
3781 warnings controlled by @option{-Wswitch} into errors.  This switch
3782 takes a negative form, to be used to negate @option{-Werror} for
3783 specific warnings, for example @option{-Wno-error=switch} makes
3784 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3785 is in effect.  You can use the @option{-fdiagnostics-show-option}
3786 option to have each controllable warning amended with the option which
3787 controls it, to determine what to use with this option.
3788
3789 Note that specifying @option{-Werror=}@var{foo} automatically implies
3790 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3791 imply anything.
3792
3793 @item -Wstack-protector
3794 @opindex Wstack-protector
3795 This option is only active when @option{-fstack-protector} is active.  It
3796 warns about functions that will not be protected against stack smashing.
3797
3798 @item -Woverlength-strings
3799 @opindex Woverlength-strings
3800 Warn about string constants which are longer than the ``minimum
3801 maximum'' length specified in the C standard.  Modern compilers
3802 generally allow string constants which are much longer than the
3803 standard's minimum limit, but very portable programs should avoid
3804 using longer strings.
3805
3806 The limit applies @emph{after} string constant concatenation, and does
3807 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3808 C99, it was raised to 4095.  C++98 does not specify a normative
3809 minimum maximum, so we do not diagnose overlength strings in C++@.
3810
3811 This option is implied by @option{-pedantic}, and can be disabled with
3812 @option{-Wno-overlength-strings}.
3813 @end table
3814
3815 @node Debugging Options
3816 @section Options for Debugging Your Program or GCC
3817 @cindex options, debugging
3818 @cindex debugging information options
3819
3820 GCC has various special options that are used for debugging
3821 either your program or GCC:
3822
3823 @table @gcctabopt
3824 @item -g
3825 @opindex g
3826 Produce debugging information in the operating system's native format
3827 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3828 information.
3829
3830 On most systems that use stabs format, @option{-g} enables use of extra
3831 debugging information that only GDB can use; this extra information
3832 makes debugging work better in GDB but will probably make other debuggers
3833 crash or
3834 refuse to read the program.  If you want to control for certain whether
3835 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3836 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3837
3838 GCC allows you to use @option{-g} with
3839 @option{-O}.  The shortcuts taken by optimized code may occasionally
3840 produce surprising results: some variables you declared may not exist
3841 at all; flow of control may briefly move where you did not expect it;
3842 some statements may not be executed because they compute constant
3843 results or their values were already at hand; some statements may
3844 execute in different places because they were moved out of loops.
3845
3846 Nevertheless it proves possible to debug optimized output.  This makes
3847 it reasonable to use the optimizer for programs that might have bugs.
3848
3849 The following options are useful when GCC is generated with the
3850 capability for more than one debugging format.
3851
3852 @item -ggdb
3853 @opindex ggdb
3854 Produce debugging information for use by GDB@.  This means to use the
3855 most expressive format available (DWARF 2, stabs, or the native format
3856 if neither of those are supported), including GDB extensions if at all
3857 possible.
3858
3859 @item -gstabs
3860 @opindex gstabs
3861 Produce debugging information in stabs format (if that is supported),
3862 without GDB extensions.  This is the format used by DBX on most BSD
3863 systems.  On MIPS, Alpha and System V Release 4 systems this option
3864 produces stabs debugging output which is not understood by DBX or SDB@.
3865 On System V Release 4 systems this option requires the GNU assembler.
3866
3867 @item -feliminate-unused-debug-symbols
3868 @opindex feliminate-unused-debug-symbols
3869 Produce debugging information in stabs format (if that is supported),
3870 for only symbols that are actually used.
3871
3872 @item -femit-class-debug-always
3873 Instead of emitting debugging information for a C++ class in only one
3874 object file, emit it in all object files using the class.  This option
3875 should be used only with debuggers that are unable to handle the way GCC
3876 normally emits debugging information for classes because using this
3877 option will increase the size of debugging information by as much as a
3878 factor of two.
3879
3880 @item -gstabs+
3881 @opindex gstabs+
3882 Produce debugging information in stabs format (if that is supported),
3883 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3884 use of these extensions is likely to make other debuggers crash or
3885 refuse to read the program.
3886
3887 @item -gcoff
3888 @opindex gcoff
3889 Produce debugging information in COFF format (if that is supported).
3890 This is the format used by SDB on most System V systems prior to
3891 System V Release 4.
3892
3893 @item -gxcoff
3894 @opindex gxcoff
3895 Produce debugging information in XCOFF format (if that is supported).
3896 This is the format used by the DBX debugger on IBM RS/6000 systems.
3897
3898 @item -gxcoff+
3899 @opindex gxcoff+
3900 Produce debugging information in XCOFF format (if that is supported),
3901 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3902 use of these extensions is likely to make other debuggers crash or
3903 refuse to read the program, and may cause assemblers other than the GNU
3904 assembler (GAS) to fail with an error.
3905
3906 @item -gdwarf-2
3907 @opindex gdwarf-2
3908 Produce debugging information in DWARF version 2 format (if that is
3909 supported).  This is the format used by DBX on IRIX 6.  With this
3910 option, GCC uses features of DWARF version 3 when they are useful;
3911 version 3 is upward compatible with version 2, but may still cause
3912 problems for older debuggers.
3913
3914 @item -gvms
3915 @opindex gvms
3916 Produce debugging information in VMS debug format (if that is
3917 supported).  This is the format used by DEBUG on VMS systems.
3918
3919 @item -g@var{level}
3920 @itemx -ggdb@var{level}
3921 @itemx -gstabs@var{level}
3922 @itemx -gcoff@var{level}
3923 @itemx -gxcoff@var{level}
3924 @itemx -gvms@var{level}
3925 Request debugging information and also use @var{level} to specify how
3926 much information.  The default level is 2.
3927
3928 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
3929 @option{-g}.
3930
3931 Level 1 produces minimal information, enough for making backtraces in
3932 parts of the program that you don't plan to debug.  This includes
3933 descriptions of functions and external variables, but no information
3934 about local variables and no line numbers.
3935
3936 Level 3 includes extra information, such as all the macro definitions
3937 present in the program.  Some debuggers support macro expansion when
3938 you use @option{-g3}.
3939
3940 @option{-gdwarf-2} does not accept a concatenated debug level, because
3941 GCC used to support an option @option{-gdwarf} that meant to generate
3942 debug information in version 1 of the DWARF format (which is very
3943 different from version 2), and it would have been too confusing.  That
3944 debug format is long obsolete, but the option cannot be changed now.
3945 Instead use an additional @option{-g@var{level}} option to change the
3946 debug level for DWARF2.
3947
3948 @item -feliminate-dwarf2-dups
3949 @opindex feliminate-dwarf2-dups
3950 Compress DWARF2 debugging information by eliminating duplicated
3951 information about each symbol.  This option only makes sense when
3952 generating DWARF2 debugging information with @option{-gdwarf-2}.
3953
3954 @cindex @command{prof}
3955 @item -p
3956 @opindex p
3957 Generate extra code to write profile information suitable for the
3958 analysis program @command{prof}.  You must use this option when compiling
3959 the source files you want data about, and you must also use it when
3960 linking.
3961
3962 @cindex @command{gprof}
3963 @item -pg
3964 @opindex pg
3965 Generate extra code to write profile information suitable for the
3966 analysis program @command{gprof}.  You must use this option when compiling
3967 the source files you want data about, and you must also use it when
3968 linking.
3969
3970 @item -Q
3971 @opindex Q
3972 Makes the compiler print out each function name as it is compiled, and
3973 print some statistics about each pass when it finishes.
3974
3975 @item -ftime-report
3976 @opindex ftime-report
3977 Makes the compiler print some statistics about the time consumed by each
3978 pass when it finishes.
3979
3980 @item -fmem-report
3981 @opindex fmem-report
3982 Makes the compiler print some statistics about permanent memory
3983 allocation when it finishes.
3984
3985 @item -fpre-ipa-mem-report
3986 @opindex fpre-ipa-mem-report
3987 @item -fpost-ipa-mem-report
3988 @opindex fpost-ipa-mem-report
3989 Makes the compiler print some statistics about permanent memory
3990 allocation before or after interprocedural optimization.
3991
3992 @item -fprofile-arcs
3993 @opindex fprofile-arcs
3994 Add code so that program flow @dfn{arcs} are instrumented.  During
3995 execution the program records how many times each branch and call is
3996 executed and how many times it is taken or returns.  When the compiled
3997 program exits it saves this data to a file called
3998 @file{@var{auxname}.gcda} for each source file.  The data may be used for
3999 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4000 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4001 @var{auxname} is generated from the name of the output file, if
4002 explicitly specified and it is not the final executable, otherwise it is
4003 the basename of the source file.  In both cases any suffix is removed
4004 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4005 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4006 @xref{Cross-profiling}.
4007
4008 @cindex @command{gcov}
4009 @item --coverage
4010 @opindex coverage
4011
4012 This option is used to compile and link code instrumented for coverage
4013 analysis.  The option is a synonym for @option{-fprofile-arcs}
4014 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4015 linking).  See the documentation for those options for more details.
4016
4017 @itemize
4018
4019 @item
4020 Compile the source files with @option{-fprofile-arcs} plus optimization
4021 and code generation options.  For test coverage analysis, use the
4022 additional @option{-ftest-coverage} option.  You do not need to profile
4023 every source file in a program.
4024
4025 @item
4026 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4027 (the latter implies the former).
4028
4029 @item
4030 Run the program on a representative workload to generate the arc profile
4031 information.  This may be repeated any number of times.  You can run
4032 concurrent instances of your program, and provided that the file system
4033 supports locking, the data files will be correctly updated.  Also
4034 @code{fork} calls are detected and correctly handled (double counting
4035 will not happen).
4036
4037 @item
4038 For profile-directed optimizations, compile the source files again with
4039 the same optimization and code generation options plus
4040 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4041 Control Optimization}).
4042
4043 @item
4044 For test coverage analysis, use @command{gcov} to produce human readable
4045 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4046 @command{gcov} documentation for further information.
4047
4048 @end itemize
4049
4050 With @option{-fprofile-arcs}, for each function of your program GCC
4051 creates a program flow graph, then finds a spanning tree for the graph.
4052 Only arcs that are not on the spanning tree have to be instrumented: the
4053 compiler adds code to count the number of times that these arcs are
4054 executed.  When an arc is the only exit or only entrance to a block, the
4055 instrumentation code can be added to the block; otherwise, a new basic
4056 block must be created to hold the instrumentation code.
4057
4058 @need 2000
4059 @item -ftest-coverage
4060 @opindex ftest-coverage
4061 Produce a notes file that the @command{gcov} code-coverage utility
4062 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4063 show program coverage.  Each source file's note file is called
4064 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4065 above for a description of @var{auxname} and instructions on how to
4066 generate test coverage data.  Coverage data will match the source files
4067 more closely, if you do not optimize.
4068
4069 @item -d@var{letters}
4070 @item -fdump-rtl-@var{pass}
4071 @opindex d
4072 Says to make debugging dumps during compilation at times specified by
4073 @var{letters}.    This is used for debugging the RTL-based passes of the
4074 compiler.  The file names for most of the dumps are made by appending a
4075 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4076 from the name of the output file, if explicitly specified and it is not
4077 an executable, otherwise it is the basename of the source file.
4078
4079 Most debug dumps can be enabled either passing a letter to the @option{-d}
4080 option, or with a long @option{-fdump-rtl} switch; here are the possible
4081 letters for use in @var{letters} and @var{pass}, and their meanings:
4082
4083 @table @gcctabopt
4084 @item -dA
4085 @opindex dA
4086 Annotate the assembler output with miscellaneous debugging information.
4087
4088 @item -dB
4089 @itemx -fdump-rtl-bbro
4090 @opindex dB
4091 @opindex fdump-rtl-bbro
4092 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4093
4094 @item -dc
4095 @itemx -fdump-rtl-combine
4096 @opindex dc
4097 @opindex fdump-rtl-combine
4098 Dump after the RTL instruction combination pass, to the file
4099 @file{@var{file}.129r.combine}.
4100
4101 @item -dC
4102 @itemx -fdump-rtl-ce1
4103 @itemx -fdump-rtl-ce2
4104 @opindex dC
4105 @opindex fdump-rtl-ce1
4106 @opindex fdump-rtl-ce2
4107 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4108 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4109 and @option{-fdump-rtl-ce2} enable dumping after the second if
4110 conversion, to the file @file{@var{file}.130r.ce2}.
4111
4112 @item -dd
4113 @itemx -fdump-rtl-btl
4114 @itemx -fdump-rtl-dbr
4115 @opindex dd
4116 @opindex fdump-rtl-btl
4117 @opindex fdump-rtl-dbr
4118 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4119 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4120 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4121 scheduling, to @file{@var{file}.36.dbr}.
4122
4123 @item -dD
4124 @opindex dD
4125 Dump all macro definitions, at the end of preprocessing, in addition to
4126 normal output.
4127
4128 @item -dE
4129 @itemx -fdump-rtl-ce3
4130 @opindex dE
4131 @opindex fdump-rtl-ce3
4132 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4133
4134 @item -df
4135 @itemx -fdump-rtl-cfg
4136 @itemx -fdump-rtl-life
4137 @opindex df
4138 @opindex fdump-rtl-cfg
4139 @opindex fdump-rtl-life
4140 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4141 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4142 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4143 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4144
4145 @item -dg
4146 @itemx -fdump-rtl-greg
4147 @opindex dg
4148 @opindex fdump-rtl-greg
4149 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4150
4151 @item -dG
4152 @itemx -fdump-rtl-gcse
4153 @itemx -fdump-rtl-bypass
4154 @opindex dG
4155 @opindex fdump-rtl-gcse
4156 @opindex fdump-rtl-bypass
4157 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4158 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4159 enable dumping after jump bypassing and control flow optimizations, to
4160 @file{@var{file}.115r.bypass}.
4161
4162 @item -dh
4163 @itemx -fdump-rtl-eh
4164 @opindex dh
4165 @opindex fdump-rtl-eh
4166 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4167
4168 @item -di
4169 @itemx -fdump-rtl-sibling
4170 @opindex di
4171 @opindex fdump-rtl-sibling
4172 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4173
4174 @item -dj
4175 @itemx -fdump-rtl-jump
4176 @opindex dj
4177 @opindex fdump-rtl-jump
4178 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4179
4180 @item -dk
4181 @itemx -fdump-rtl-stack
4182 @opindex dk
4183 @opindex fdump-rtl-stack
4184 Dump after conversion from GCC's "flat register file" registers to the
4185 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4186
4187 @item -dl
4188 @itemx -fdump-rtl-lreg
4189 @opindex dl
4190 @opindex fdump-rtl-lreg
4191 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4192
4193 @item -dL
4194 @itemx -fdump-rtl-loop2
4195 @opindex dL
4196 @opindex fdump-rtl-loop2
4197 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4198 loop optimization pass, to @file{@var{file}.119r.loop2},
4199 @file{@var{file}.120r.loop2_init},
4200 @file{@var{file}.121r.loop2_invariant}, and
4201 @file{@var{file}.125r.loop2_done}.
4202
4203 @item -dm
4204 @itemx -fdump-rtl-sms
4205 @opindex dm
4206 @opindex fdump-rtl-sms
4207 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4208
4209 @item -dM
4210 @itemx -fdump-rtl-mach
4211 @opindex dM
4212 @opindex fdump-rtl-mach
4213 Dump after performing the machine dependent reorganization pass, to
4214 @file{@var{file}.155r.mach}.
4215
4216 @item -dn
4217 @itemx -fdump-rtl-rnreg
4218 @opindex dn
4219 @opindex fdump-rtl-rnreg
4220 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4221
4222 @item -dN
4223 @itemx -fdump-rtl-regmove
4224 @opindex dN
4225 @opindex fdump-rtl-regmove
4226 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4227
4228 @item -do
4229 @itemx -fdump-rtl-postreload
4230 @opindex do
4231 @opindex fdump-rtl-postreload
4232 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4233
4234 @item -dr
4235 @itemx -fdump-rtl-expand
4236 @opindex dr
4237 @opindex fdump-rtl-expand
4238 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4239
4240 @item -dR
4241 @itemx -fdump-rtl-sched2
4242 @opindex dR
4243 @opindex fdump-rtl-sched2
4244 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4245
4246 @item -ds
4247 @itemx -fdump-rtl-cse
4248 @opindex ds
4249 @opindex fdump-rtl-cse
4250 Dump after CSE (including the jump optimization that sometimes follows
4251 CSE), to @file{@var{file}.113r.cse}.
4252
4253 @item -dS
4254 @itemx -fdump-rtl-sched1
4255 @opindex dS
4256 @opindex fdump-rtl-sched1
4257 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4258
4259 @item -dt
4260 @itemx -fdump-rtl-cse2
4261 @opindex dt
4262 @opindex fdump-rtl-cse2
4263 Dump after the second CSE pass (including the jump optimization that
4264 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4265
4266 @item -dT
4267 @itemx -fdump-rtl-tracer
4268 @opindex dT
4269 @opindex fdump-rtl-tracer
4270 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4271
4272 @item -dV
4273 @itemx -fdump-rtl-vpt
4274 @itemx -fdump-rtl-vartrack
4275 @opindex dV
4276 @opindex fdump-rtl-vpt
4277 @opindex fdump-rtl-vartrack
4278 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4279 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4280 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4281 to @file{@var{file}.154r.vartrack}.
4282
4283 @item -dw
4284 @itemx -fdump-rtl-flow2
4285 @opindex dw
4286 @opindex fdump-rtl-flow2
4287 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4288
4289 @item -dz
4290 @itemx -fdump-rtl-peephole2
4291 @opindex dz
4292 @opindex fdump-rtl-peephole2
4293 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4294
4295 @item -dZ
4296 @itemx -fdump-rtl-web
4297 @opindex dZ
4298 @opindex fdump-rtl-web
4299 Dump after live range splitting, to @file{@var{file}.126r.web}.
4300
4301 @item -da
4302 @itemx -fdump-rtl-all
4303 @opindex da
4304 @opindex fdump-rtl-all
4305 Produce all the dumps listed above.
4306
4307 @item -dH
4308 @opindex dH
4309 Produce a core dump whenever an error occurs.
4310
4311 @item -dm
4312 @opindex dm
4313 Print statistics on memory usage, at the end of the run, to
4314 standard error.
4315
4316 @item -dp
4317 @opindex dp
4318 Annotate the assembler output with a comment indicating which
4319 pattern and alternative was used.  The length of each instruction is
4320 also printed.
4321
4322 @item -dP
4323 @opindex dP
4324 Dump the RTL in the assembler output as a comment before each instruction.
4325 Also turns on @option{-dp} annotation.
4326
4327 @item -dv
4328 @opindex dv
4329 For each of the other indicated dump files (either with @option{-d} or
4330 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4331 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4332
4333 @item -dx
4334 @opindex dx
4335 Just generate RTL for a function instead of compiling it.  Usually used
4336 with @samp{r} (@option{-fdump-rtl-expand}).
4337
4338 @item -dy
4339 @opindex dy
4340 Dump debugging information during parsing, to standard error.
4341 @end table
4342
4343 @item -fdump-noaddr
4344 @opindex fdump-noaddr
4345 When doing debugging dumps (see @option{-d} option above), suppress
4346 address output.  This makes it more feasible to use diff on debugging
4347 dumps for compiler invocations with different compiler binaries and/or
4348 different text / bss / data / heap / stack / dso start locations.
4349
4350 @item -fdump-unnumbered
4351 @opindex fdump-unnumbered
4352 When doing debugging dumps (see @option{-d} option above), suppress instruction
4353 numbers, line number note and address output.  This makes it more feasible to
4354 use diff on debugging dumps for compiler invocations with different
4355 options, in particular with and without @option{-g}.
4356
4357 @item -fdump-translation-unit @r{(C++ only)}
4358 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4359 @opindex fdump-translation-unit
4360 Dump a representation of the tree structure for the entire translation
4361 unit to a file.  The file name is made by appending @file{.tu} to the
4362 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4363 controls the details of the dump as described for the
4364 @option{-fdump-tree} options.
4365
4366 @item -fdump-class-hierarchy @r{(C++ only)}
4367 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4368 @opindex fdump-class-hierarchy
4369 Dump a representation of each class's hierarchy and virtual function
4370 table layout to a file.  The file name is made by appending @file{.class}
4371 to the source file name.  If the @samp{-@var{options}} form is used,
4372 @var{options} controls the details of the dump as described for the
4373 @option{-fdump-tree} options.
4374
4375 @item -fdump-ipa-@var{switch}
4376 @opindex fdump-ipa
4377 Control the dumping at various stages of inter-procedural analysis
4378 language tree to a file.  The file name is generated by appending a switch
4379 specific suffix to the source file name.  The following dumps are possible:
4380
4381 @table @samp
4382 @item all
4383 Enables all inter-procedural analysis dumps; currently the only produced
4384 dump is the @samp{cgraph} dump.
4385
4386 @item cgraph
4387 Dumps information about call-graph optimization, unused function removal,
4388 and inlining decisions.
4389 @end table
4390
4391 @item -fdump-tree-@var{switch}
4392 @itemx -fdump-tree-@var{switch}-@var{options}
4393 @opindex fdump-tree
4394 Control the dumping at various stages of processing the intermediate
4395 language tree to a file.  The file name is generated by appending a switch
4396 specific suffix to the source file name.  If the @samp{-@var{options}}
4397 form is used, @var{options} is a list of @samp{-} separated options that
4398 control the details of the dump.  Not all options are applicable to all
4399 dumps, those which are not meaningful will be ignored.  The following
4400 options are available
4401
4402 @table @samp
4403 @item address
4404 Print the address of each node.  Usually this is not meaningful as it
4405 changes according to the environment and source file.  Its primary use
4406 is for tying up a dump file with a debug environment.
4407 @item slim
4408 Inhibit dumping of members of a scope or body of a function merely
4409 because that scope has been reached.  Only dump such items when they
4410 are directly reachable by some other path.  When dumping pretty-printed
4411 trees, this option inhibits dumping the bodies of control structures.
4412 @item raw
4413 Print a raw representation of the tree.  By default, trees are
4414 pretty-printed into a C-like representation.
4415 @item details
4416 Enable more detailed dumps (not honored by every dump option).
4417 @item stats
4418 Enable dumping various statistics about the pass (not honored by every dump
4419 option).
4420 @item blocks
4421 Enable showing basic block boundaries (disabled in raw dumps).
4422 @item vops
4423 Enable showing virtual operands for every statement.
4424 @item lineno
4425 Enable showing line numbers for statements.
4426 @item uid
4427 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4428 @item all
4429 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4430 @end table
4431
4432 The following tree dumps are possible:
4433 @table @samp
4434
4435 @item original
4436 Dump before any tree based optimization, to @file{@var{file}.original}.
4437
4438 @item optimized
4439 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4440
4441 @item inlined
4442 Dump after function inlining, to @file{@var{file}.inlined}.
4443
4444 @item gimple
4445 @opindex fdump-tree-gimple
4446 Dump each function before and after the gimplification pass to a file.  The
4447 file name is made by appending @file{.gimple} to the source file name.
4448
4449 @item cfg
4450 @opindex fdump-tree-cfg
4451 Dump the control flow graph of each function to a file.  The file name is
4452 made by appending @file{.cfg} to the source file name.
4453
4454 @item vcg
4455 @opindex fdump-tree-vcg
4456 Dump the control flow graph of each function to a file in VCG format.  The
4457 file name is made by appending @file{.vcg} to the source file name.  Note
4458 that if the file contains more than one function, the generated file cannot
4459 be used directly by VCG@.  You will need to cut and paste each function's
4460 graph into its own separate file first.
4461
4462 @item ch
4463 @opindex fdump-tree-ch
4464 Dump each function after copying loop headers.  The file name is made by
4465 appending @file{.ch} to the source file name.
4466
4467 @item ssa
4468 @opindex fdump-tree-ssa
4469 Dump SSA related information to a file.  The file name is made by appending
4470 @file{.ssa} to the source file name.
4471
4472 @item salias
4473 @opindex fdump-tree-salias
4474 Dump structure aliasing variable information to a file.  This file name
4475 is made by appending @file{.salias} to the source file name.
4476
4477 @item alias
4478 @opindex fdump-tree-alias
4479 Dump aliasing information for each function.  The file name is made by
4480 appending @file{.alias} to the source file name.
4481
4482 @item ccp
4483 @opindex fdump-tree-ccp
4484 Dump each function after CCP@.  The file name is made by appending
4485 @file{.ccp} to the source file name.
4486
4487 @item storeccp
4488 @opindex fdump-tree-storeccp
4489 Dump each function after STORE-CCP.  The file name is made by appending
4490 @file{.storeccp} to the source file name.
4491
4492 @item pre
4493 @opindex fdump-tree-pre
4494 Dump trees after partial redundancy elimination.  The file name is made
4495 by appending @file{.pre} to the source file name.
4496
4497 @item fre
4498 @opindex fdump-tree-fre
4499 Dump trees after full redundancy elimination.  The file name is made
4500 by appending @file{.fre} to the source file name.
4501
4502 @item copyprop
4503 @opindex fdump-tree-copyprop
4504 Dump trees after copy propagation.  The file name is made
4505 by appending @file{.copyprop} to the source file name.
4506
4507 @item store_copyprop
4508 @opindex fdump-tree-store_copyprop
4509 Dump trees after store copy-propagation.  The file name is made
4510 by appending @file{.store_copyprop} to the source file name.
4511
4512 @item dce
4513 @opindex fdump-tree-dce
4514 Dump each function after dead code elimination.  The file name is made by
4515 appending @file{.dce} to the source file name.
4516
4517 @item mudflap
4518 @opindex fdump-tree-mudflap
4519 Dump each function after adding mudflap instrumentation.  The file name is
4520 made by appending @file{.mudflap} to the source file name.
4521
4522 @item sra
4523 @opindex fdump-tree-sra
4524 Dump each function after performing scalar replacement of aggregates.  The
4525 file name is made by appending @file{.sra} to the source file name.
4526
4527 @item sink
4528 @opindex fdump-tree-sink
4529 Dump each function after performing code sinking.  The file name is made
4530 by appending @file{.sink} to the source file name. 
4531
4532 @item dom
4533 @opindex fdump-tree-dom
4534 Dump each function after applying dominator tree optimizations.  The file
4535 name is made by appending @file{.dom} to the source file name.
4536
4537 @item dse
4538 @opindex fdump-tree-dse
4539 Dump each function after applying dead store elimination.  The file
4540 name is made by appending @file{.dse} to the source file name.
4541
4542 @item phiopt
4543 @opindex fdump-tree-phiopt
4544 Dump each function after optimizing PHI nodes into straightline code.  The file
4545 name is made by appending @file{.phiopt} to the source file name.
4546
4547 @item forwprop
4548 @opindex fdump-tree-forwprop
4549 Dump each function after forward propagating single use variables.  The file
4550 name is made by appending @file{.forwprop} to the source file name.
4551
4552 @item copyrename
4553 @opindex fdump-tree-copyrename
4554 Dump each function after applying the copy rename optimization.  The file
4555 name is made by appending @file{.copyrename} to the source file name.
4556
4557 @item nrv
4558 @opindex fdump-tree-nrv
4559 Dump each function after applying the named return value optimization on
4560 generic trees.  The file name is made by appending @file{.nrv} to the source
4561 file name.
4562
4563 @item vect
4564 @opindex fdump-tree-vect
4565 Dump each function after applying vectorization of loops.  The file name is
4566 made by appending @file{.vect} to the source file name.
4567
4568 @item vrp
4569 @opindex fdump-tree-vrp
4570 Dump each function after Value Range Propagation (VRP).  The file name
4571 is made by appending @file{.vrp} to the source file name.
4572
4573 @item all
4574 @opindex fdump-tree-all
4575 Enable all the available tree dumps with the flags provided in this option.
4576 @end table
4577
4578 @item -ftree-vectorizer-verbose=@var{n}
4579 @opindex ftree-vectorizer-verbose
4580 This option controls the amount of debugging output the vectorizer prints.
4581 This information is written to standard error, unless 
4582 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified, 
4583 in which case it is output to the usual dump listing file, @file{.vect}.
4584 For @var{n}=0 no diagnostic information is reported.
4585 If @var{n}=1 the vectorizer reports each loop that got vectorized, 
4586 and the total number of loops that got vectorized.
4587 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed 
4588 the first analysis phase (vect_analyze_loop_form) - i.e. countable, 
4589 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity 
4590 level that @option{-fdump-tree-vect-stats} uses.
4591 Higher verbosity levels mean either more information dumped for each 
4592 reported loop, or same amount of information reported for more loops:
4593 If @var{n}=3, alignment related information is added to the reports.
4594 If @var{n}=4, data-references related information (e.g. memory dependences, 
4595 memory access-patterns) is added to the reports.
4596 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops 
4597 that did not pass the first analysis phase (i.e. may not be countable, or 
4598 may have complicated control-flow).
4599 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4600 For @var{n}=7, all the information the vectorizer generates during its 
4601 analysis and transformation is reported.  This is the same verbosity level
4602 that @option{-fdump-tree-vect-details} uses.
4603
4604 @item -frandom-seed=@var{string}
4605 @opindex frandom-string
4606 This option provides a seed that GCC uses when it would otherwise use
4607 random numbers.  It is used to generate certain symbol names
4608 that have to be different in every compiled file.  It is also used to
4609 place unique stamps in coverage data files and the object files that
4610 produce them.  You can use the @option{-frandom-seed} option to produce
4611 reproducibly identical object files.
4612
4613 The @var{string} should be different for every file you compile.
4614
4615 @item -fsched-verbose=@var{n}
4616 @opindex fsched-verbose
4617 On targets that use instruction scheduling, this option controls the
4618 amount of debugging output the scheduler prints.  This information is
4619 written to standard error, unless @option{-dS} or @option{-dR} is
4620 specified, in which case it is output to the usual dump
4621 listing file, @file{.sched} or @file{.sched2} respectively.  However
4622 for @var{n} greater than nine, the output is always printed to standard
4623 error.
4624
4625 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4626 same information as @option{-dRS}.  For @var{n} greater than one, it
4627 also output basic block probabilities, detailed ready list information
4628 and unit/insn info.  For @var{n} greater than two, it includes RTL
4629 at abort point, control-flow and regions info.  And for @var{n} over
4630 four, @option{-fsched-verbose} also includes dependence info.
4631
4632 @item -save-temps
4633 @opindex save-temps
4634 Store the usual ``temporary'' intermediate files permanently; place them
4635 in the current directory and name them based on the source file.  Thus,
4636 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4637 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4638 preprocessed @file{foo.i} output file even though the compiler now
4639 normally uses an integrated preprocessor.
4640
4641 When used in combination with the @option{-x} command line option,
4642 @option{-save-temps} is sensible enough to avoid over writing an
4643 input source file with the same extension as an intermediate file.
4644 The corresponding intermediate file may be obtained by renaming the
4645 source file before using @option{-save-temps}.
4646
4647 @item -time
4648 @opindex time
4649 Report the CPU time taken by each subprocess in the compilation
4650 sequence.  For C source files, this is the compiler proper and assembler
4651 (plus the linker if linking is done).  The output looks like this:
4652
4653 @smallexample
4654 # cc1 0.12 0.01
4655 # as 0.00 0.01
4656 @end smallexample
4657
4658 The first number on each line is the ``user time'', that is time spent
4659 executing the program itself.  The second number is ``system time'',
4660 time spent executing operating system routines on behalf of the program.
4661 Both numbers are in seconds.
4662
4663 @item -fvar-tracking
4664 @opindex fvar-tracking
4665 Run variable tracking pass.  It computes where variables are stored at each
4666 position in code.  Better debugging information is then generated
4667 (if the debugging information format supports this information).
4668
4669 It is enabled by default when compiling with optimization (@option{-Os},
4670 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4671 the debug info format supports it.
4672
4673 @item -print-file-name=@var{library}
4674 @opindex print-file-name
4675 Print the full absolute name of the library file @var{library} that
4676 would be used when linking---and don't do anything else.  With this
4677 option, GCC does not compile or link anything; it just prints the
4678 file name.
4679
4680 @item -print-multi-directory
4681 @opindex print-multi-directory
4682 Print the directory name corresponding to the multilib selected by any
4683 other switches present in the command line.  This directory is supposed
4684 to exist in @env{GCC_EXEC_PREFIX}.
4685
4686 @item -print-multi-lib
4687 @opindex print-multi-lib
4688 Print the mapping from multilib directory names to compiler switches
4689 that enable them.  The directory name is separated from the switches by
4690 @samp{;}, and each switch starts with an @samp{@@} instead of the
4691 @samp{-}, without spaces between multiple switches.  This is supposed to
4692 ease shell-processing.
4693
4694 @item -print-prog-name=@var{program}
4695 @opindex print-prog-name
4696 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4697
4698 @item -print-libgcc-file-name
4699 @opindex print-libgcc-file-name
4700 Same as @option{-print-file-name=libgcc.a}.
4701
4702 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4703 but you do want to link with @file{libgcc.a}.  You can do
4704
4705 @smallexample
4706 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4707 @end smallexample
4708
4709 @item -print-search-dirs
4710 @opindex print-search-dirs
4711 Print the name of the configured installation directory and a list of
4712 program and library directories @command{gcc} will search---and don't do anything else.
4713
4714 This is useful when @command{gcc} prints the error message
4715 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4716 To resolve this you either need to put @file{cpp0} and the other compiler
4717 components where @command{gcc} expects to find them, or you can set the environment
4718 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4719 Don't forget the trailing @samp{/}.
4720 @xref{Environment Variables}.
4721
4722 @item -print-sysroot-headers-suffix
4723 @opindex print-sysroot-headers-suffix
4724 Print the suffix added to the target sysroot when searching for
4725 headers, or give an error if the compiler is not configured with such
4726 a suffix---and don't do anything else.
4727
4728 @item -dumpmachine
4729 @opindex dumpmachine
4730 Print the compiler's target machine (for example,
4731 @samp{i686-pc-linux-gnu})---and don't do anything else.
4732
4733 @item -dumpversion
4734 @opindex dumpversion
4735 Print the compiler version (for example, @samp{3.0})---and don't do
4736 anything else.
4737
4738 @item -dumpspecs
4739 @opindex dumpspecs
4740 Print the compiler's built-in specs---and don't do anything else.  (This
4741 is used when GCC itself is being built.)  @xref{Spec Files}.
4742
4743 @item -feliminate-unused-debug-types
4744 @opindex feliminate-unused-debug-types
4745 Normally, when producing DWARF2 output, GCC will emit debugging
4746 information for all types declared in a compilation
4747 unit, regardless of whether or not they are actually used
4748 in that compilation unit.  Sometimes this is useful, such as
4749 if, in the debugger, you want to cast a value to a type that is
4750 not actually used in your program (but is declared).  More often,
4751 however, this results in a significant amount of wasted space.
4752 With this option, GCC will avoid producing debug symbol output
4753 for types that are nowhere used in the source file being compiled.
4754 @end table
4755
4756 @node Optimize Options
4757 @section Options That Control Optimization
4758 @cindex optimize options
4759 @cindex options, optimization
4760
4761 These options control various sorts of optimizations.
4762
4763 Without any optimization option, the compiler's goal is to reduce the
4764 cost of compilation and to make debugging produce the expected
4765 results.  Statements are independent: if you stop the program with a
4766 breakpoint between statements, you can then assign a new value to any
4767 variable or change the program counter to any other statement in the
4768 function and get exactly the results you would expect from the source
4769 code.
4770
4771 Turning on optimization flags makes the compiler attempt to improve
4772 the performance and/or code size at the expense of compilation time
4773 and possibly the ability to debug the program.
4774
4775 The compiler performs optimization based on the knowledge it has of
4776 the program.  Optimization levels @option{-O} and above, in
4777 particular, enable @emph{unit-at-a-time} mode, which allows the
4778 compiler to consider information gained from later functions in
4779 the file when compiling a function.  Compiling multiple files at
4780 once to a single output file in @emph{unit-at-a-time} mode allows
4781 the compiler to use information gained from all of the files when
4782 compiling each of them.
4783
4784 Not all optimizations are controlled directly by a flag.  Only
4785 optimizations that have a flag are listed.
4786
4787 @table @gcctabopt
4788 @item -O
4789 @itemx -O1
4790 @opindex O
4791 @opindex O1
4792 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4793 more memory for a large function.
4794
4795 With @option{-O}, the compiler tries to reduce code size and execution
4796 time, without performing any optimizations that take a great deal of
4797 compilation time.
4798
4799 @option{-O} turns on the following optimization flags:
4800 @gccoptlist{-fdefer-pop @gol
4801 -fdelayed-branch @gol
4802 -fguess-branch-probability @gol
4803 -fcprop-registers @gol
4804 -fif-conversion @gol
4805 -fif-conversion2 @gol
4806 -fsplit-wide-types @gol
4807 -ftree-ccp @gol
4808 -ftree-dce @gol
4809 -ftree-dominator-opts @gol
4810 -ftree-dse @gol
4811 -ftree-ter @gol
4812 -ftree-sra @gol
4813 -ftree-copyrename @gol
4814 -ftree-fre @gol
4815 -ftree-ch @gol
4816 -funit-at-a-time @gol
4817 -fmerge-constants}
4818
4819 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4820 where doing so does not interfere with debugging.
4821
4822 @item -O2
4823 @opindex O2
4824 Optimize even more.  GCC performs nearly all supported optimizations
4825 that do not involve a space-speed tradeoff.  The compiler does not
4826 perform loop unrolling or function inlining when you specify @option{-O2}.
4827 As compared to @option{-O}, this option increases both compilation time
4828 and the performance of the generated code.
4829
4830 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4831 also turns on the following optimization flags:
4832 @gccoptlist{-fthread-jumps @gol
4833 -fcrossjumping @gol
4834 -foptimize-sibling-calls @gol
4835 -fcse-follow-jumps  -fcse-skip-blocks @gol
4836 -fgcse  -fgcse-lm  @gol
4837 -fexpensive-optimizations @gol
4838 -frerun-cse-after-loop  @gol
4839 -fcaller-saves @gol
4840 -fpeephole2 @gol
4841 -fschedule-insns  -fschedule-insns2 @gol
4842 -fsched-interblock  -fsched-spec @gol
4843 -fregmove @gol
4844 -fstrict-aliasing -fstrict-overflow @gol
4845 -fdelete-null-pointer-checks @gol
4846 -freorder-blocks  -freorder-functions @gol
4847 -falign-functions  -falign-jumps @gol
4848 -falign-loops  -falign-labels @gol
4849 -ftree-vrp @gol
4850 -ftree-pre}
4851
4852 Please note the warning under @option{-fgcse} about
4853 invoking @option{-O2} on programs that use computed gotos.
4854
4855 @item -O3
4856 @opindex O3
4857 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4858 @option{-O2} and also turns on the @option{-finline-functions},
4859 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4860
4861 @item -O0
4862 @opindex O0
4863 Reduce compilation time and make debugging produce the expected
4864 results.  This is the default.
4865
4866 @item -Os
4867 @opindex Os
4868 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4869 do not typically increase code size.  It also performs further
4870 optimizations designed to reduce code size.
4871
4872 @option{-Os} disables the following optimization flags:
4873 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4874 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
4875 -fprefetch-loop-arrays  -ftree-vect-loop-version}
4876
4877 If you use multiple @option{-O} options, with or without level numbers,
4878 the last such option is the one that is effective.
4879 @end table
4880
4881 Options of the form @option{-f@var{flag}} specify machine-independent
4882 flags.  Most flags have both positive and negative forms; the negative
4883 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4884 below, only one of the forms is listed---the one you typically will
4885 use.  You can figure out the other form by either removing @samp{no-}
4886 or adding it.
4887
4888 The following options control specific optimizations.  They are either
4889 activated by @option{-O} options or are related to ones that are.  You
4890 can use the following flags in the rare cases when ``fine-tuning'' of
4891 optimizations to be performed is desired.
4892
4893 @table @gcctabopt
4894 @item -fno-default-inline
4895 @opindex fno-default-inline
4896 Do not make member functions inline by default merely because they are
4897 defined inside the class scope (C++ only).  Otherwise, when you specify
4898 @w{@option{-O}}, member functions defined inside class scope are compiled
4899 inline by default; i.e., you don't need to add @samp{inline} in front of
4900 the member function name.
4901
4902 @item -fno-defer-pop
4903 @opindex fno-defer-pop
4904 Always pop the arguments to each function call as soon as that function
4905 returns.  For machines which must pop arguments after a function call,
4906 the compiler normally lets arguments accumulate on the stack for several
4907 function calls and pops them all at once.
4908
4909 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4910
4911 @item -fforce-addr
4912 @opindex fforce-addr
4913 Force memory address constants to be copied into registers before
4914 doing arithmetic on them.
4915
4916 @item -fforward-propagate
4917 @opindex fforward-propagate
4918 Perform a forward propagation pass on RTL.  The pass tries to combine two
4919 instructions and checks if the result can be simplified.  If loop unrolling
4920 is active, two passes are performed and the second is scheduled after
4921 loop unrolling.
4922
4923 This option is enabled by default at optimization levels @option{-O2},
4924 @option{-O3}, @option{-Os}.
4925
4926 @item -fomit-frame-pointer
4927 @opindex fomit-frame-pointer
4928 Don't keep the frame pointer in a register for functions that
4929 don't need one.  This avoids the instructions to save, set up and
4930 restore frame pointers; it also makes an extra register available
4931 in many functions.  @strong{It also makes debugging impossible on
4932 some machines.}
4933
4934 On some machines, such as the VAX, this flag has no effect, because
4935 the standard calling sequence automatically handles the frame pointer
4936 and nothing is saved by pretending it doesn't exist.  The
4937 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4938 whether a target machine supports this flag.  @xref{Registers,,Register
4939 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4940
4941 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4942
4943 @item -foptimize-sibling-calls
4944 @opindex foptimize-sibling-calls
4945 Optimize sibling and tail recursive calls.
4946
4947 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4948
4949 @item -fno-inline
4950 @opindex fno-inline
4951 Don't pay attention to the @code{inline} keyword.  Normally this option
4952 is used to keep the compiler from expanding any functions inline.
4953 Note that if you are not optimizing, no functions can be expanded inline.
4954
4955 @item -finline-functions
4956 @opindex finline-functions
4957 Integrate all simple functions into their callers.  The compiler
4958 heuristically decides which functions are simple enough to be worth
4959 integrating in this way.
4960
4961 If all calls to a given function are integrated, and the function is
4962 declared @code{static}, then the function is normally not output as
4963 assembler code in its own right.
4964
4965 Enabled at level @option{-O3}.
4966
4967 @item -finline-functions-called-once
4968 @opindex finline-functions-called-once
4969 Consider all @code{static} functions called once for inlining into their
4970 caller even if they are not marked @code{inline}.  If a call to a given
4971 function is integrated, then the function is not output as assembler code
4972 in its own right.
4973
4974 Enabled if @option{-funit-at-a-time} is enabled.
4975
4976 @item -fearly-inlining
4977 @opindex fearly-inlining
4978 Inline functions marked by @code{always_inline} and functions whose body seems
4979 smaller than the function call overhead early before doing
4980 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4981 makes profiling significantly cheaper and usually inlining faster on programs
4982 having large chains of nested wrapper functions.
4983
4984 Enabled by default.
4985
4986 @item -finline-limit=@var{n}
4987 @opindex finline-limit
4988 By default, GCC limits the size of functions that can be inlined.  This flag
4989 allows the control of this limit for functions that are explicitly marked as
4990 inline (i.e., marked with the inline keyword or defined within the class
4991 definition in c++).  @var{n} is the size of functions that can be inlined in
4992 number of pseudo instructions (not counting parameter handling).  The default
4993 value of @var{n} is 600.
4994 Increasing this value can result in more inlined code at
4995 the cost of compilation time and memory consumption.  Decreasing usually makes
4996 the compilation faster and less code will be inlined (which presumably
4997 means slower programs).  This option is particularly useful for programs that
4998 use inlining heavily such as those based on recursive templates with C++.
4999
5000 Inlining is actually controlled by a number of parameters, which may be
5001 specified individually by using @option{--param @var{name}=@var{value}}.
5002 The @option{-finline-limit=@var{n}} option sets some of these parameters
5003 as follows:
5004
5005 @table @gcctabopt
5006 @item max-inline-insns-single
5007  is set to @var{n}/2.
5008 @item max-inline-insns-auto
5009  is set to @var{n}/2.
5010 @item min-inline-insns
5011  is set to 130 or @var{n}/4, whichever is smaller.
5012 @item max-inline-insns-rtl
5013  is set to @var{n}.
5014 @end table
5015
5016 See below for a documentation of the individual
5017 parameters controlling inlining.
5018
5019 @emph{Note:} pseudo instruction represents, in this particular context, an
5020 abstract measurement of function's size.  In no way does it represent a count
5021 of assembly instructions and as such its exact meaning might change from one
5022 release to an another.
5023
5024 @item -fkeep-inline-functions
5025 @opindex fkeep-inline-functions
5026 In C, emit @code{static} functions that are declared @code{inline}
5027 into the object file, even if the function has been inlined into all
5028 of its callers.  This switch does not affect functions using the
5029 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5030 inline functions into the object file.
5031
5032 @item -fkeep-static-consts
5033 @opindex fkeep-static-consts
5034 Emit variables declared @code{static const} when optimization isn't turned
5035 on, even if the variables aren't referenced.
5036
5037 GCC enables this option by default.  If you want to force the compiler to
5038 check if the variable was referenced, regardless of whether or not
5039 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5040
5041 @item -fmerge-constants
5042 Attempt to merge identical constants (string constants and floating point
5043 constants) across compilation units.
5044
5045 This option is the default for optimized compilation if the assembler and
5046 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5047 behavior.
5048
5049 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5050
5051 @item -fmerge-all-constants
5052 Attempt to merge identical constants and identical variables.
5053
5054 This option implies @option{-fmerge-constants}.  In addition to
5055 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5056 arrays or initialized constant variables with integral or floating point
5057 types.  Languages like C or C++ require each non-automatic variable to
5058 have distinct location, so using this option will result in non-conforming
5059 behavior.
5060
5061 @item -fmodulo-sched
5062 @opindex fmodulo-sched
5063 Perform swing modulo scheduling immediately before the first scheduling
5064 pass.  This pass looks at innermost loops and reorders their
5065 instructions by overlapping different iterations.
5066
5067 @item -fno-branch-count-reg
5068 @opindex fno-branch-count-reg
5069 Do not use ``decrement and branch'' instructions on a count register,
5070 but instead generate a sequence of instructions that decrement a
5071 register, compare it against zero, then branch based upon the result.
5072 This option is only meaningful on architectures that support such
5073 instructions, which include x86, PowerPC, IA-64 and S/390.
5074
5075 The default is @option{-fbranch-count-reg}.
5076
5077 @item -fno-function-cse
5078 @opindex fno-function-cse
5079 Do not put function addresses in registers; make each instruction that
5080 calls a constant function contain the function's address explicitly.
5081
5082 This option results in less efficient code, but some strange hacks
5083 that alter the assembler output may be confused by the optimizations
5084 performed when this option is not used.
5085
5086 The default is @option{-ffunction-cse}
5087
5088 @item -fno-zero-initialized-in-bss
5089 @opindex fno-zero-initialized-in-bss
5090 If the target supports a BSS section, GCC by default puts variables that
5091 are initialized to zero into BSS@.  This can save space in the resulting
5092 code.
5093
5094 This option turns off this behavior because some programs explicitly
5095 rely on variables going to the data section.  E.g., so that the
5096 resulting executable can find the beginning of that section and/or make
5097 assumptions based on that.
5098
5099 The default is @option{-fzero-initialized-in-bss}.
5100
5101 @item -fbounds-check
5102 @opindex fbounds-check
5103 For front-ends that support it, generate additional code to check that
5104 indices used to access arrays are within the declared range.  This is
5105 currently only supported by the Java and Fortran front-ends, where
5106 this option defaults to true and false respectively.
5107
5108 @item -fmudflap -fmudflapth -fmudflapir
5109 @opindex fmudflap
5110 @opindex fmudflapth
5111 @opindex fmudflapir
5112 @cindex bounds checking
5113 @cindex mudflap
5114 For front-ends that support it (C and C++), instrument all risky
5115 pointer/array dereferencing operations, some standard library
5116 string/heap functions, and some other associated constructs with
5117 range/validity tests.  Modules so instrumented should be immune to
5118 buffer overflows, invalid heap use, and some other classes of C/C++
5119 programming errors.  The instrumentation relies on a separate runtime
5120 library (@file{libmudflap}), which will be linked into a program if
5121 @option{-fmudflap} is given at link time.  Run-time behavior of the
5122 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5123 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5124 for its options.
5125
5126 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5127 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5128 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5129 instrumentation should ignore pointer reads.  This produces less
5130 instrumentation (and therefore faster execution) and still provides
5131 some protection against outright memory corrupting writes, but allows
5132 erroneously read data to propagate within a program.
5133
5134 @item -fthread-jumps
5135 @opindex fthread-jumps
5136 Perform optimizations where we check to see if a jump branches to a
5137 location where another comparison subsumed by the first is found.  If
5138 so, the first branch is redirected to either the destination of the
5139 second branch or a point immediately following it, depending on whether
5140 the condition is known to be true or false.
5141
5142 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5143
5144 @item -fsplit-wide-types
5145 @opindex -fsplit-wide-types
5146 When using a type that occupies multiple registers, such as @code{long
5147 long} on a 32-bit system, split the registers apart and allocate them
5148 independently.  This normally generates better code for those types,
5149 but may make debugging more difficult.
5150
5151 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5152 @option{-Os}.
5153
5154 @item -fcse-follow-jumps
5155 @opindex fcse-follow-jumps
5156 In common subexpression elimination, scan through jump instructions
5157 when the target of the jump is not reached by any other path.  For
5158 example, when CSE encounters an @code{if} statement with an
5159 @code{else} clause, CSE will follow the jump when the condition
5160 tested is false.
5161
5162 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5163
5164 @item -fcse-skip-blocks
5165 @opindex fcse-skip-blocks
5166 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5167 follow jumps which conditionally skip over blocks.  When CSE
5168 encounters a simple @code{if} statement with no else clause,
5169 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5170 body of the @code{if}.
5171
5172 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5173
5174 @item -frerun-cse-after-loop
5175 @opindex frerun-cse-after-loop
5176 Re-run common subexpression elimination after loop optimizations has been
5177 performed.
5178
5179 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5180
5181 @item -fgcse
5182 @opindex fgcse
5183 Perform a global common subexpression elimination pass.
5184 This pass also performs global constant and copy propagation.
5185
5186 @emph{Note:} When compiling a program using computed gotos, a GCC
5187 extension, you may get better runtime performance if you disable
5188 the global common subexpression elimination pass by adding
5189 @option{-fno-gcse} to the command line.
5190
5191 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5192
5193 @item -fgcse-lm
5194 @opindex fgcse-lm
5195 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5196 attempt to move loads which are only killed by stores into themselves.  This
5197 allows a loop containing a load/store sequence to be changed to a load outside
5198 the loop, and a copy/store within the loop.
5199
5200 Enabled by default when gcse is enabled.
5201
5202 @item -fgcse-sm
5203 @opindex fgcse-sm
5204 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5205 global common subexpression elimination.  This pass will attempt to move
5206 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5207 loops containing a load/store sequence can be changed to a load before
5208 the loop and a store after the loop.
5209
5210 Not enabled at any optimization level.
5211
5212 @item -fgcse-las
5213 @opindex fgcse-las
5214 When @option{-fgcse-las} is enabled, the global common subexpression
5215 elimination pass eliminates redundant loads that come after stores to the
5216 same memory location (both partial and full redundancies).
5217
5218 Not enabled at any optimization level.
5219
5220 @item -fgcse-after-reload
5221 @opindex fgcse-after-reload
5222 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5223 pass is performed after reload.  The purpose of this pass is to cleanup
5224 redundant spilling.
5225
5226 @item -funsafe-loop-optimizations
5227 @opindex funsafe-loop-optimizations
5228 If given, the loop optimizer will assume that loop indices do not
5229 overflow, and that the loops with nontrivial exit condition are not
5230 infinite.  This enables a wider range of loop optimizations even if
5231 the loop optimizer itself cannot prove that these assumptions are valid.
5232 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5233 if it finds this kind of loop.
5234
5235 @item -fcrossjumping
5236 @opindex crossjumping
5237 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5238 resulting code may or may not perform better than without cross-jumping.
5239
5240 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5241
5242 @item -fif-conversion
5243 @opindex if-conversion
5244 Attempt to transform conditional jumps into branch-less equivalents.  This
5245 include use of conditional moves, min, max, set flags and abs instructions, and
5246 some tricks doable by standard arithmetics.  The use of conditional execution
5247 on chips where it is available is controlled by @code{if-conversion2}.
5248
5249 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5250
5251 @item -fif-conversion2
5252 @opindex if-conversion2
5253 Use conditional execution (where available) to transform conditional jumps into
5254 branch-less equivalents.
5255
5256 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5257
5258 @item -fdelete-null-pointer-checks
5259 @opindex fdelete-null-pointer-checks
5260 Use global dataflow analysis to identify and eliminate useless checks
5261 for null pointers.  The compiler assumes that dereferencing a null
5262 pointer would have halted the program.  If a pointer is checked after
5263 it has already been dereferenced, it cannot be null.
5264
5265 In some environments, this assumption is not true, and programs can
5266 safely dereference null pointers.  Use
5267 @option{-fno-delete-null-pointer-checks} to disable this optimization
5268 for programs which depend on that behavior.
5269
5270 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5271
5272 @item -fexpensive-optimizations
5273 @opindex fexpensive-optimizations
5274 Perform a number of minor optimizations that are relatively expensive.
5275
5276 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5277
5278 @item -foptimize-register-move
5279 @itemx -fregmove
5280 @opindex foptimize-register-move
5281 @opindex fregmove
5282 Attempt to reassign register numbers in move instructions and as
5283 operands of other simple instructions in order to maximize the amount of
5284 register tying.  This is especially helpful on machines with two-operand
5285 instructions.
5286
5287 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5288 optimization.
5289
5290 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5291
5292 @item -fdelayed-branch
5293 @opindex fdelayed-branch
5294 If supported for the target machine, attempt to reorder instructions
5295 to exploit instruction slots available after delayed branch
5296 instructions.
5297
5298 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5299
5300 @item -fschedule-insns
5301 @opindex fschedule-insns
5302 If supported for the target machine, attempt to reorder instructions to
5303 eliminate execution stalls due to required data being unavailable.  This
5304 helps machines that have slow floating point or memory load instructions
5305 by allowing other instructions to be issued until the result of the load
5306 or floating point instruction is required.
5307
5308 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5309
5310 @item -fschedule-insns2
5311 @opindex fschedule-insns2
5312 Similar to @option{-fschedule-insns}, but requests an additional pass of
5313 instruction scheduling after register allocation has been done.  This is
5314 especially useful on machines with a relatively small number of
5315 registers and where memory load instructions take more than one cycle.
5316
5317 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5318
5319 @item -fno-sched-interblock
5320 @opindex fno-sched-interblock
5321 Don't schedule instructions across basic blocks.  This is normally
5322 enabled by default when scheduling before register allocation, i.e.@:
5323 with @option{-fschedule-insns} or at @option{-O2} or higher.
5324
5325 @item -fno-sched-spec
5326 @opindex fno-sched-spec
5327 Don't allow speculative motion of non-load instructions.  This is normally
5328 enabled by default when scheduling before register allocation, i.e.@:
5329 with @option{-fschedule-insns} or at @option{-O2} or higher.
5330
5331 @item -fsched-spec-load
5332 @opindex fsched-spec-load
5333 Allow speculative motion of some load instructions.  This only makes
5334 sense when scheduling before register allocation, i.e.@: with
5335 @option{-fschedule-insns} or at @option{-O2} or higher.
5336
5337 @item -fsched-spec-load-dangerous
5338 @opindex fsched-spec-load-dangerous
5339 Allow speculative motion of more load instructions.  This only makes
5340 sense when scheduling before register allocation, i.e.@: with
5341 @option{-fschedule-insns} or at @option{-O2} or higher.
5342
5343 @item -fsched-stalled-insns=@var{n}
5344 @opindex fsched-stalled-insns
5345 Define how many insns (if any) can be moved prematurely from the queue
5346 of stalled insns into the ready list, during the second scheduling pass.
5347
5348 @item -fsched-stalled-insns-dep=@var{n}
5349 @opindex fsched-stalled-insns-dep
5350 Define how many insn groups (cycles) will be examined for a dependency
5351 on a stalled insn that is candidate for premature removal from the queue
5352 of stalled insns.  Has an effect only during the second scheduling pass,
5353 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5354
5355 @item -fsched2-use-superblocks
5356 @opindex fsched2-use-superblocks
5357 When scheduling after register allocation, do use superblock scheduling
5358 algorithm.  Superblock scheduling allows motion across basic block boundaries
5359 resulting on faster schedules.  This option is experimental, as not all machine
5360 descriptions used by GCC model the CPU closely enough to avoid unreliable
5361 results from the algorithm.
5362
5363 This only makes sense when scheduling after register allocation, i.e.@: with
5364 @option{-fschedule-insns2} or at @option{-O2} or higher.
5365
5366 @item -fsched2-use-traces
5367 @opindex fsched2-use-traces
5368 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5369 allocation and additionally perform code duplication in order to increase the
5370 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5371 trace formation.
5372
5373 This mode should produce faster but significantly longer programs.  Also
5374 without @option{-fbranch-probabilities} the traces constructed may not
5375 match the reality and hurt the performance.  This only makes
5376 sense when scheduling after register allocation, i.e.@: with
5377 @option{-fschedule-insns2} or at @option{-O2} or higher.
5378
5379 @item -fsee
5380 @opindex fsee
5381 Eliminates redundant extension instructions and move the non redundant
5382 ones to optimal placement using LCM.
5383
5384 @item -freschedule-modulo-scheduled-loops
5385 @opindex fscheduling-in-modulo-scheduled-loops
5386 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5387 we may want to prevent the later scheduling passes from changing its schedule, we use this
5388 option to control that.
5389
5390 @item -fcaller-saves
5391 @opindex fcaller-saves
5392 Enable values to be allocated in registers that will be clobbered by
5393 function calls, by emitting extra instructions to save and restore the
5394 registers around such calls.  Such allocation is done only when it
5395 seems to result in better code than would otherwise be produced.
5396
5397 This option is always enabled by default on certain machines, usually
5398 those which have no call-preserved registers to use instead.
5399
5400 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5401
5402 @item -ftree-pre
5403 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5404 enabled by default at @option{-O2} and @option{-O3}.
5405
5406 @item -ftree-fre
5407 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5408 between FRE and PRE is that FRE only considers expressions
5409 that are computed on all paths leading to the redundant computation.
5410 This analysis faster than PRE, though it exposes fewer redundancies.
5411 This flag is enabled by default at @option{-O} and higher.
5412
5413 @item -ftree-copy-prop
5414 Perform copy propagation on trees.  This pass eliminates unnecessary
5415 copy operations.  This flag is enabled by default at @option{-O} and
5416 higher.
5417
5418 @item -ftree-store-copy-prop
5419 Perform copy propagation of memory loads and stores.  This pass
5420 eliminates unnecessary copy operations in memory references
5421 (structures, global variables, arrays, etc).  This flag is enabled by
5422 default at @option{-O2} and higher.
5423
5424 @item -ftree-salias
5425 Perform structural alias analysis on trees.  This flag
5426 is enabled by default at @option{-O} and higher.
5427
5428 @item -fipa-pta
5429 Perform interprocedural pointer analysis.
5430
5431 @item -ftree-sink
5432 Perform forward store motion  on trees.  This flag is
5433 enabled by default at @option{-O} and higher.
5434
5435 @item -ftree-ccp
5436 Perform sparse conditional constant propagation (CCP) on trees.  This
5437 pass only operates on local scalar variables and is enabled by default
5438 at @option{-O} and higher.
5439
5440 @item -ftree-store-ccp
5441 Perform sparse conditional constant propagation (CCP) on trees.  This
5442 pass operates on both local scalar variables and memory stores and
5443 loads (global variables, structures, arrays, etc).  This flag is
5444 enabled by default at @option{-O2} and higher.
5445
5446 @item -ftree-dce
5447 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5448 default at @option{-O} and higher.
5449
5450 @item -ftree-dominator-opts
5451 Perform a variety of simple scalar cleanups (constant/copy
5452 propagation, redundancy elimination, range propagation and expression
5453 simplification) based on a dominator tree traversal.  This also
5454 performs jump threading (to reduce jumps to jumps). This flag is
5455 enabled by default at @option{-O} and higher.
5456
5457 @item -ftree-ch
5458 Perform loop header copying on trees.  This is beneficial since it increases
5459 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5460 is enabled by default at @option{-O} and higher.  It is not enabled
5461 for @option{-Os}, since it usually increases code size.
5462
5463 @item -ftree-loop-optimize
5464 Perform loop optimizations on trees.  This flag is enabled by default
5465 at @option{-O} and higher.
5466
5467 @item -ftree-loop-linear
5468 Perform linear loop transformations on tree.  This flag can improve cache
5469 performance and allow further loop optimizations to take place.
5470
5471 @item -fcheck-data-deps
5472 Compare the results of several data dependence analyzers.  This option
5473 is used for debugging the data dependence analyzers.
5474
5475 @item -ftree-loop-im
5476 Perform loop invariant motion on trees.  This pass moves only invariants that
5477 would be hard to handle at RTL level (function calls, operations that expand to
5478 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5479 operands of conditions that are invariant out of the loop, so that we can use
5480 just trivial invariantness analysis in loop unswitching.  The pass also includes
5481 store motion.
5482
5483 @item -ftree-loop-ivcanon
5484 Create a canonical counter for number of iterations in the loop for that
5485 determining number of iterations requires complicated analysis.  Later
5486 optimizations then may determine the number easily.  Useful especially
5487 in connection with unrolling.
5488
5489 @item -fivopts
5490 Perform induction variable optimizations (strength reduction, induction
5491 variable merging and induction variable elimination) on trees.
5492
5493 @item -ftree-sra
5494 Perform scalar replacement of aggregates.  This pass replaces structure
5495 references with scalars to prevent committing structures to memory too
5496 early.  This flag is enabled by default at @option{-O} and higher.
5497
5498 @item -ftree-copyrename
5499 Perform copy renaming on trees.  This pass attempts to rename compiler
5500 temporaries to other variables at copy locations, usually resulting in
5501 variable names which more closely resemble the original variables.  This flag
5502 is enabled by default at @option{-O} and higher.
5503
5504 @item -ftree-ter
5505 Perform temporary expression replacement during the SSA->normal phase.  Single
5506 use/single def temporaries are replaced at their use location with their
5507 defining expression.  This results in non-GIMPLE code, but gives the expanders
5508 much more complex trees to work on resulting in better RTL generation.  This is
5509 enabled by default at @option{-O} and higher.
5510
5511 @item -ftree-vectorize
5512 Perform loop vectorization on trees.
5513
5514 @item -ftree-vect-loop-version
5515 @opindex ftree-vect-loop-version
5516 Perform loop versioning when doing loop vectorization on trees.  When a loop
5517 appears to be vectorizable except that data alignment or data dependence cannot
5518 be determined at compile time then vectorized and non-vectorized versions of
5519 the loop are generated along with runtime checks for alignment or dependence
5520 to control which version is executed.  This option is enabled by default
5521 except at level @option{-Os} where it is disabled.
5522
5523 @item -ftree-vrp
5524 Perform Value Range Propagation on trees.  This is similar to the
5525 constant propagation pass, but instead of values, ranges of values are
5526 propagated.  This allows the optimizers to remove unnecessary range
5527 checks like array bound checks and null pointer checks.  This is
5528 enabled by default at @option{-O2} and higher.  Null pointer check
5529 elimination is only done if @option{-fdelete-null-pointer-checks} is
5530 enabled.
5531
5532 @item -ftracer
5533 @opindex ftracer
5534 Perform tail duplication to enlarge superblock size.  This transformation
5535 simplifies the control flow of the function allowing other optimizations to do
5536 better job.
5537
5538 @item -funroll-loops
5539 @opindex funroll-loops
5540 Unroll loops whose number of iterations can be determined at compile
5541 time or upon entry to the loop.  @option{-funroll-loops} implies
5542 @option{-frerun-cse-after-loop}.  This option makes code larger,
5543 and may or may not make it run faster.
5544
5545 @item -funroll-all-loops
5546 @opindex funroll-all-loops
5547 Unroll all loops, even if their number of iterations is uncertain when
5548 the loop is entered.  This usually makes programs run more slowly.
5549 @option{-funroll-all-loops} implies the same options as
5550 @option{-funroll-loops},
5551
5552 @item -fsplit-ivs-in-unroller
5553 @opindex -fsplit-ivs-in-unroller
5554 Enables expressing of values of induction variables in later iterations
5555 of the unrolled loop using the value in the first iteration.  This breaks
5556 long dependency chains, thus improving efficiency of the scheduling passes.
5557
5558 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5559 same effect.  However in cases the loop body is more complicated than
5560 a single basic block, this is not reliable.  It also does not work at all
5561 on some of the architectures due to restrictions in the CSE pass.
5562
5563 This optimization is enabled by default.
5564
5565 @item -fvariable-expansion-in-unroller
5566 @opindex -fvariable-expansion-in-unroller
5567 With this option, the compiler will create multiple copies of some
5568 local variables when unrolling a loop which can result in superior code.
5569
5570 @item -fprefetch-loop-arrays
5571 @opindex fprefetch-loop-arrays
5572 If supported by the target machine, generate instructions to prefetch
5573 memory to improve the performance of loops that access large arrays.
5574
5575 This option may generate better or worse code; results are highly
5576 dependent on the structure of loops within the source code.
5577
5578 Disabled at level @option{-Os}.
5579
5580 @item -fno-peephole
5581 @itemx -fno-peephole2
5582 @opindex fno-peephole
5583 @opindex fno-peephole2
5584 Disable any machine-specific peephole optimizations.  The difference
5585 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5586 are implemented in the compiler; some targets use one, some use the
5587 other, a few use both.
5588
5589 @option{-fpeephole} is enabled by default.
5590 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5591
5592 @item -fno-guess-branch-probability
5593 @opindex fno-guess-branch-probability
5594 Do not guess branch probabilities using heuristics.
5595
5596 GCC will use heuristics to guess branch probabilities if they are
5597 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5598 heuristics are based on the control flow graph.  If some branch probabilities
5599 are specified by @samp{__builtin_expect}, then the heuristics will be
5600 used to guess branch probabilities for the rest of the control flow graph,
5601 taking the @samp{__builtin_expect} info into account.  The interactions
5602 between the heuristics and @samp{__builtin_expect} can be complex, and in
5603 some cases, it may be useful to disable the heuristics so that the effects
5604 of @samp{__builtin_expect} are easier to understand.
5605
5606 The default is @option{-fguess-branch-probability} at levels
5607 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5608
5609 @item -freorder-blocks
5610 @opindex freorder-blocks
5611 Reorder basic blocks in the compiled function in order to reduce number of
5612 taken branches and improve code locality.
5613
5614 Enabled at levels @option{-O2}, @option{-O3}.
5615
5616 @item -freorder-blocks-and-partition
5617 @opindex freorder-blocks-and-partition
5618 In addition to reordering basic blocks in the compiled function, in order
5619 to reduce number of taken branches, partitions hot and cold basic blocks
5620 into separate sections of the assembly and .o files, to improve
5621 paging and cache locality performance.
5622
5623 This optimization is automatically turned off in the presence of
5624 exception handling, for linkonce sections, for functions with a user-defined
5625 section attribute and on any architecture that does not support named
5626 sections.
5627
5628 @item -freorder-functions
5629 @opindex freorder-functions
5630 Reorder functions in the object file in order to
5631 improve code locality.  This is implemented by using special
5632 subsections @code{.text.hot} for most frequently executed functions and
5633 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5634 the linker so object file format must support named sections and linker must
5635 place them in a reasonable way.
5636
5637 Also profile feedback must be available in to make this option effective.  See
5638 @option{-fprofile-arcs} for details.
5639
5640 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5641
5642 @item -fstrict-aliasing
5643 @opindex fstrict-aliasing
5644 Allows the compiler to assume the strictest aliasing rules applicable to
5645 the language being compiled.  For C (and C++), this activates
5646 optimizations based on the type of expressions.  In particular, an
5647 object of one type is assumed never to reside at the same address as an
5648 object of a different type, unless the types are almost the same.  For
5649 example, an @code{unsigned int} can alias an @code{int}, but not a
5650 @code{void*} or a @code{double}.  A character type may alias any other
5651 type.
5652
5653 Pay special attention to code like this:
5654 @smallexample
5655 union a_union @{
5656   int i;
5657   double d;
5658 @};
5659
5660 int f() @{
5661   a_union t;
5662   t.d = 3.0;
5663   return t.i;
5664 @}
5665 @end smallexample
5666 The practice of reading from a different union member than the one most
5667 recently written to (called ``type-punning'') is common.  Even with
5668 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5669 is accessed through the union type.  So, the code above will work as
5670 expected.  However, this code might not:
5671 @smallexample
5672 int f() @{
5673   a_union t;
5674   int* ip;
5675   t.d = 3.0;
5676   ip = &t.i;
5677   return *ip;
5678 @}
5679 @end smallexample
5680
5681 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5682
5683 @item -fstrict-overflow
5684 @opindex fstrict-overflow
5685 Allow the compiler to assume strict signed overflow rules, depending
5686 on the language being compiled.  For C (and C++) this means that
5687 overflow when doing arithmetic with signed numbers is undefined, which
5688 means that the compiler may assume that it will not happen.  This
5689 permits various optimizations.  For example, the compiler will assume
5690 that an expression like @code{i + 10 > i} will always be true for
5691 signed @code{i}.  This assumption is only valid if signed overflow is
5692 undefined, as the expression is false if @code{i + 10} overflows when
5693 using twos complement arithmetic.  When this option is in effect any
5694 attempt to determine whether an operation on signed numbers will
5695 overflow must be written carefully to not actually involve overflow.
5696
5697 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5698 that signed overflow is fully defined: it wraps.  When
5699 @option{-fwrapv} is used, there is no difference between
5700 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5701 @option{-fwrapv} certain types of overflow are permitted.  For
5702 example, if the compiler gets an overflow when doing arithmetic on
5703 constants, the overflowed value can still be used with
5704 @option{-fwrapv}, but not otherwise.
5705
5706 The @option{-fstrict-overflow} option is enabled at levels
5707 @option{-O2}, @option{-O3}, @option{-Os}.
5708
5709 @item -falign-functions
5710 @itemx -falign-functions=@var{n}
5711 @opindex falign-functions
5712 Align the start of functions to the next power-of-two greater than
5713 @var{n}, skipping up to @var{n} bytes.  For instance,
5714 @option{-falign-functions=32} aligns functions to the next 32-byte
5715 boundary, but @option{-falign-functions=24} would align to the next
5716 32-byte boundary only if this can be done by skipping 23 bytes or less.
5717
5718 @option{-fno-align-functions} and @option{-falign-functions=1} are
5719 equivalent and mean that functions will not be aligned.
5720
5721 Some assemblers only support this flag when @var{n} is a power of two;
5722 in that case, it is rounded up.
5723
5724 If @var{n} is not specified or is zero, use a machine-dependent default.
5725
5726 Enabled at levels @option{-O2}, @option{-O3}.
5727
5728 @item -falign-labels
5729 @itemx -falign-labels=@var{n}
5730 @opindex falign-labels
5731 Align all branch targets to a power-of-two boundary, skipping up to
5732 @var{n} bytes like @option{-falign-functions}.  This option can easily
5733 make code slower, because it must insert dummy operations for when the
5734 branch target is reached in the usual flow of the code.
5735
5736 @option{-fno-align-labels} and @option{-falign-labels=1} are
5737 equivalent and mean that labels will not be aligned.
5738
5739 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5740 are greater than this value, then their values are used instead.
5741
5742 If @var{n} is not specified or is zero, use a machine-dependent default
5743 which is very likely to be @samp{1}, meaning no alignment.
5744
5745 Enabled at levels @option{-O2}, @option{-O3}.
5746
5747 @item -falign-loops
5748 @itemx -falign-loops=@var{n}
5749 @opindex falign-loops
5750 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5751 like @option{-falign-functions}.  The hope is that the loop will be
5752 executed many times, which will make up for any execution of the dummy
5753 operations.
5754
5755 @option{-fno-align-loops} and @option{-falign-loops=1} are
5756 equivalent and mean that loops will not be aligned.
5757
5758 If @var{n} is not specified or is zero, use a machine-dependent default.
5759
5760 Enabled at levels @option{-O2}, @option{-O3}.
5761
5762 @item -falign-jumps
5763 @itemx -falign-jumps=@var{n}
5764 @opindex falign-jumps
5765 Align branch targets to a power-of-two boundary, for branch targets
5766 where the targets can only be reached by jumping, skipping up to @var{n}
5767 bytes like @option{-falign-functions}.  In this case, no dummy operations
5768 need be executed.
5769
5770 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5771 equivalent and mean that loops will not be aligned.
5772
5773 If @var{n} is not specified or is zero, use a machine-dependent default.
5774
5775 Enabled at levels @option{-O2}, @option{-O3}.
5776
5777 @item -funit-at-a-time
5778 @opindex funit-at-a-time
5779 Parse the whole compilation unit before starting to produce code.
5780 This allows some extra optimizations to take place but consumes
5781 more memory (in general).  There are some compatibility issues
5782 with @emph{unit-at-a-time} mode:
5783 @itemize @bullet
5784 @item
5785 enabling @emph{unit-at-a-time} mode may change the order
5786 in which functions, variables, and top-level @code{asm} statements
5787 are emitted, and will likely break code relying on some particular
5788 ordering.  The majority of such top-level @code{asm} statements,
5789 though, can be replaced by @code{section} attributes.  The
5790 @option{fno-toplevel-reorder} option may be used to keep the ordering
5791 used in the input file, at the cost of some optimizations.
5792
5793 @item
5794 @emph{unit-at-a-time} mode removes unreferenced static variables
5795 and functions.  This may result in undefined references
5796 when an @code{asm} statement refers directly to variables or functions
5797 that are otherwise unused.  In that case either the variable/function
5798 shall be listed as an operand of the @code{asm} statement operand or,
5799 in the case of top-level @code{asm} statements the attribute @code{used}
5800 shall be used on the declaration.
5801
5802 @item
5803 Static functions now can use non-standard passing conventions that
5804 may break @code{asm} statements calling functions directly.  Again,
5805 attribute @code{used} will prevent this behavior.
5806 @end itemize
5807
5808 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5809 but this scheme may not be supported by future releases of GCC@.
5810
5811 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5812
5813 @item -fno-toplevel-reorder
5814 Do not reorder top-level functions, variables, and @code{asm}
5815 statements.  Output them in the same order that they appear in the
5816 input file.  When this option is used, unreferenced static variables
5817 will not be removed.  This option is intended to support existing code
5818 which relies on a particular ordering.  For new code, it is better to
5819 use attributes.
5820
5821 @item -fweb
5822 @opindex fweb
5823 Constructs webs as commonly used for register allocation purposes and assign
5824 each web individual pseudo register.  This allows the register allocation pass
5825 to operate on pseudos directly, but also strengthens several other optimization
5826 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5827 however, make debugging impossible, since variables will no longer stay in a
5828 ``home register''.
5829
5830 Enabled by default with @option{-funroll-loops}.
5831
5832 @item -fwhole-program
5833 @opindex fwhole-program
5834 Assume that the current compilation unit represents whole program being
5835 compiled.  All public functions and variables with the exception of @code{main}
5836 and those merged by attribute @code{externally_visible} become static functions
5837 and in a affect gets more aggressively optimized by interprocedural optimizers.
5838 While this option is equivalent to proper use of @code{static} keyword for
5839 programs consisting of single file, in combination with option
5840 @option{--combine} this flag can be used to compile most of smaller scale C
5841 programs since the functions and variables become local for the whole combined
5842 compilation unit, not for the single source file itself.
5843
5844
5845 @item -fno-cprop-registers
5846 @opindex fno-cprop-registers
5847 After register allocation and post-register allocation instruction splitting,
5848 we perform a copy-propagation pass to try to reduce scheduling dependencies
5849 and occasionally eliminate the copy.
5850
5851 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5852
5853 @item -fprofile-generate
5854 @opindex fprofile-generate
5855
5856 Enable options usually used for instrumenting application to produce
5857 profile useful for later recompilation with profile feedback based
5858 optimization.  You must use @option{-fprofile-generate} both when
5859 compiling and when linking your program.
5860
5861 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5862
5863 @item -fprofile-use
5864 @opindex fprofile-use
5865 Enable profile feedback directed optimizations, and optimizations
5866 generally profitable only with profile feedback available.
5867
5868 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5869 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
5870
5871 By default, GCC emits an error message if the feedback profiles do not
5872 match the source code.  This error can be turned into a warning by using
5873 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
5874 code.
5875 @end table
5876
5877 The following options control compiler behavior regarding floating
5878 point arithmetic.  These options trade off between speed and
5879 correctness.  All must be specifically enabled.
5880
5881 @table @gcctabopt
5882 @item -ffloat-store
5883 @opindex ffloat-store
5884 Do not store floating point variables in registers, and inhibit other
5885 options that might change whether a floating point value is taken from a
5886 register or memory.
5887
5888 @cindex floating point precision
5889 This option prevents undesirable excess precision on machines such as
5890 the 68000 where the floating registers (of the 68881) keep more
5891 precision than a @code{double} is supposed to have.  Similarly for the
5892 x86 architecture.  For most programs, the excess precision does only
5893 good, but a few programs rely on the precise definition of IEEE floating
5894 point.  Use @option{-ffloat-store} for such programs, after modifying
5895 them to store all pertinent intermediate computations into variables.
5896
5897 @item -ffast-math
5898 @opindex ffast-math
5899 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5900 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5901 @option{-fno-rounding-math}, @option{-fno-signaling-nans},
5902 @option{-fno-signed-zeros} and @option{fcx-limited-range}.
5903
5904 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5905
5906 This option should never be turned on by any @option{-O} option since
5907 it can result in incorrect output for programs which depend on
5908 an exact implementation of IEEE or ISO rules/specifications for
5909 math functions.
5910
5911 @item -fno-math-errno
5912 @opindex fno-math-errno
5913 Do not set ERRNO after calling math functions that are executed
5914 with a single instruction, e.g., sqrt.  A program that relies on
5915 IEEE exceptions for math error handling may want to use this flag
5916 for speed while maintaining IEEE arithmetic compatibility.
5917
5918 This option should never be turned on by any @option{-O} option since
5919 it can result in incorrect output for programs which depend on
5920 an exact implementation of IEEE or ISO rules/specifications for
5921 math functions.
5922
5923 The default is @option{-fmath-errno}.
5924
5925 On Darwin systems, the math library never sets @code{errno}.  There is
5926 therefore no reason for the compiler to consider the possibility that
5927 it might, and @option{-fno-math-errno} is the default.
5928
5929 @item -funsafe-math-optimizations
5930 @opindex funsafe-math-optimizations
5931 Allow optimizations for floating-point arithmetic that (a) assume
5932 that arguments and results are valid and (b) may violate IEEE or
5933 ANSI standards.  When used at link-time, it may include libraries
5934 or startup files that change the default FPU control word or other
5935 similar optimizations.
5936
5937 This option should never be turned on by any @option{-O} option since
5938 it can result in incorrect output for programs which depend on
5939 an exact implementation of IEEE or ISO rules/specifications for
5940 math functions.
5941
5942 The default is @option{-fno-unsafe-math-optimizations}.
5943
5944 @item -ffinite-math-only
5945 @opindex ffinite-math-only
5946 Allow optimizations for floating-point arithmetic that assume
5947 that arguments and results are not NaNs or +-Infs.
5948
5949 This option should never be turned on by any @option{-O} option since
5950 it can result in incorrect output for programs which depend on
5951 an exact implementation of IEEE or ISO rules/specifications.
5952
5953 The default is @option{-fno-finite-math-only}.
5954
5955 @item -fno-signed-zeros
5956 @opindex fno-signed-zeros
5957 Allow optimizations for floating point arithmetic that ignore the
5958 signedness of zero.  IEEE arithmetic specifies the behavior of
5959 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
5960 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
5961 This option implies that the sign of a zero result isn't significant.
5962
5963 The default is @option{-fsigned-zeros}.
5964
5965 @item -fno-trapping-math
5966 @opindex fno-trapping-math
5967 Compile code assuming that floating-point operations cannot generate
5968 user-visible traps.  These traps include division by zero, overflow,
5969 underflow, inexact result and invalid operation.  This option implies
5970 @option{-fno-signaling-nans}.  Setting this option may allow faster
5971 code if one relies on ``non-stop'' IEEE arithmetic, for example.
5972
5973 This option should never be turned on by any @option{-O} option since
5974 it can result in incorrect output for programs which depend on
5975 an exact implementation of IEEE or ISO rules/specifications for
5976 math functions.
5977
5978 The default is @option{-ftrapping-math}.
5979
5980 @item -frounding-math
5981 @opindex frounding-math
5982 Disable transformations and optimizations that assume default floating
5983 point rounding behavior.  This is round-to-zero for all floating point
5984 to integer conversions, and round-to-nearest for all other arithmetic
5985 truncations.  This option should be specified for programs that change
5986 the FP rounding mode dynamically, or that may be executed with a
5987 non-default rounding mode.  This option disables constant folding of
5988 floating point expressions at compile-time (which may be affected by
5989 rounding mode) and arithmetic transformations that are unsafe in the
5990 presence of sign-dependent rounding modes.
5991
5992 The default is @option{-fno-rounding-math}.
5993
5994 This option is experimental and does not currently guarantee to
5995 disable all GCC optimizations that are affected by rounding mode.
5996 Future versions of GCC may provide finer control of this setting
5997 using C99's @code{FENV_ACCESS} pragma.  This command line option
5998 will be used to specify the default state for @code{FENV_ACCESS}.
5999
6000 @item -frtl-abstract-sequences
6001 @opindex frtl-abstract-sequences
6002 It is a size optimization method. This option is to find identical
6003 sequences of code, which can be turned into pseudo-procedures  and
6004 then  replace  all  occurrences with  calls to  the  newly created
6005 subroutine. It is kind of an opposite of @option{-finline-functions}.
6006 This optimization runs at RTL level.
6007
6008 @item -fsignaling-nans
6009 @opindex fsignaling-nans
6010 Compile code assuming that IEEE signaling NaNs may generate user-visible
6011 traps during floating-point operations.  Setting this option disables
6012 optimizations that may change the number of exceptions visible with
6013 signaling NaNs.  This option implies @option{-ftrapping-math}.
6014
6015 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6016 be defined.
6017
6018 The default is @option{-fno-signaling-nans}.
6019
6020 This option is experimental and does not currently guarantee to
6021 disable all GCC optimizations that affect signaling NaN behavior.
6022
6023 @item -fsingle-precision-constant
6024 @opindex fsingle-precision-constant
6025 Treat floating point constant as single precision constant instead of
6026 implicitly converting it to double precision constant.
6027
6028 @item -fcx-limited-range
6029 @itemx -fno-cx-limited-range
6030 @opindex fcx-limited-range
6031 @opindex fno-cx-limited-range
6032 When enabled, this option states that a range reduction step is not
6033 needed when performing complex division.  The default is
6034 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
6035
6036 This option controls the default setting of the ISO C99 
6037 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6038 all languages.
6039
6040 @end table
6041
6042 The following options control optimizations that may improve
6043 performance, but are not enabled by any @option{-O} options.  This
6044 section includes experimental options that may produce broken code.
6045
6046 @table @gcctabopt
6047 @item -fbranch-probabilities
6048 @opindex fbranch-probabilities
6049 After running a program compiled with @option{-fprofile-arcs}
6050 (@pxref{Debugging Options,, Options for Debugging Your Program or
6051 @command{gcc}}), you can compile it a second time using
6052 @option{-fbranch-probabilities}, to improve optimizations based on
6053 the number of times each branch was taken.  When the program
6054 compiled with @option{-fprofile-arcs} exits it saves arc execution
6055 counts to a file called @file{@var{sourcename}.gcda} for each source
6056 file.  The information in this data file is very dependent on the
6057 structure of the generated code, so you must use the same source code
6058 and the same optimization options for both compilations.
6059
6060 With @option{-fbranch-probabilities}, GCC puts a
6061 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6062 These can be used to improve optimization.  Currently, they are only
6063 used in one place: in @file{reorg.c}, instead of guessing which path a
6064 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6065 exactly determine which path is taken more often.
6066
6067 @item -fprofile-values
6068 @opindex fprofile-values
6069 If combined with @option{-fprofile-arcs}, it adds code so that some
6070 data about values of expressions in the program is gathered.
6071
6072 With @option{-fbranch-probabilities}, it reads back the data gathered
6073 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6074 notes to instructions for their later usage in optimizations.
6075
6076 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6077
6078 @item -fvpt
6079 @opindex fvpt
6080 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6081 a code to gather information about values of expressions.
6082
6083 With @option{-fbranch-probabilities}, it reads back the data gathered
6084 and actually performs the optimizations based on them.
6085 Currently the optimizations include specialization of division operation
6086 using the knowledge about the value of the denominator.
6087
6088 @item -frename-registers
6089 @opindex frename-registers
6090 Attempt to avoid false dependencies in scheduled code by making use
6091 of registers left over after register allocation.  This optimization
6092 will most benefit processors with lots of registers.  Depending on the
6093 debug information format adopted by the target, however, it can
6094 make debugging impossible, since variables will no longer stay in
6095 a ``home register''.
6096
6097 Enabled by default with @option{-funroll-loops}.
6098
6099 @item -ftracer
6100 @opindex ftracer
6101 Perform tail duplication to enlarge superblock size.  This transformation
6102 simplifies the control flow of the function allowing other optimizations to do
6103 better job.
6104
6105 Enabled with @option{-fprofile-use}.
6106
6107 @item -funroll-loops
6108 @opindex funroll-loops
6109 Unroll loops whose number of iterations can be determined at compile time or
6110 upon entry to the loop.  @option{-funroll-loops} implies
6111 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}. 
6112 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6113 small constant number of iterations).  This option makes code larger, and may
6114 or may not make it run faster.
6115
6116 Enabled with @option{-fprofile-use}.
6117
6118 @item -funroll-all-loops
6119 @opindex funroll-all-loops
6120 Unroll all loops, even if their number of iterations is uncertain when
6121 the loop is entered.  This usually makes programs run more slowly.
6122 @option{-funroll-all-loops} implies the same options as
6123 @option{-funroll-loops}.
6124
6125 @item -fpeel-loops
6126 @opindex fpeel-loops
6127 Peels the loops for that there is enough information that they do not
6128 roll much (from profile feedback).  It also turns on complete loop peeling
6129 (i.e.@: complete removal of loops with small constant number of iterations).
6130
6131 Enabled with @option{-fprofile-use}.
6132
6133 @item -fmove-loop-invariants
6134 @opindex fmove-loop-invariants
6135 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6136 at level @option{-O1}
6137
6138 @item -funswitch-loops
6139 @opindex funswitch-loops
6140 Move branches with loop invariant conditions out of the loop, with duplicates
6141 of the loop on both branches (modified according to result of the condition).
6142
6143 @item -ffunction-sections
6144 @itemx -fdata-sections
6145 @opindex ffunction-sections
6146 @opindex fdata-sections
6147 Place each function or data item into its own section in the output
6148 file if the target supports arbitrary sections.  The name of the
6149 function or the name of the data item determines the section's name
6150 in the output file.
6151
6152 Use these options on systems where the linker can perform optimizations
6153 to improve locality of reference in the instruction space.  Most systems
6154 using the ELF object format and SPARC processors running Solaris 2 have
6155 linkers with such optimizations.  AIX may have these optimizations in
6156 the future.
6157
6158 Only use these options when there are significant benefits from doing
6159 so.  When you specify these options, the assembler and linker will
6160 create larger object and executable files and will also be slower.
6161 You will not be able to use @code{gprof} on all systems if you
6162 specify this option and you may have problems with debugging if
6163 you specify both this option and @option{-g}.
6164
6165 @item -fbranch-target-load-optimize
6166 @opindex fbranch-target-load-optimize
6167 Perform branch target register load optimization before prologue / epilogue
6168 threading.
6169 The use of target registers can typically be exposed only during reload,
6170 thus hoisting loads out of loops and doing inter-block scheduling needs
6171 a separate optimization pass.
6172
6173 @item -fbranch-target-load-optimize2
6174 @opindex fbranch-target-load-optimize2
6175 Perform branch target register load optimization after prologue / epilogue
6176 threading.
6177
6178 @item -fbtr-bb-exclusive
6179 @opindex fbtr-bb-exclusive
6180 When performing branch target register load optimization, don't reuse
6181 branch target registers in within any basic block.
6182
6183 @item -fstack-protector
6184 Emit extra code to check for buffer overflows, such as stack smashing
6185 attacks.  This is done by adding a guard variable to functions with
6186 vulnerable objects.  This includes functions that call alloca, and
6187 functions with buffers larger than 8 bytes.  The guards are initialized
6188 when a function is entered and then checked when the function exits.
6189 If a guard check fails, an error message is printed and the program exits.
6190
6191 @item -fstack-protector-all
6192 Like @option{-fstack-protector} except that all functions are protected.
6193
6194 @item -fsection-anchors
6195 @opindex fsection-anchors
6196 Try to reduce the number of symbolic address calculations by using
6197 shared ``anchor'' symbols to address nearby objects.  This transformation
6198 can help to reduce the number of GOT entries and GOT accesses on some
6199 targets.
6200
6201 For example, the implementation of the following function @code{foo}:
6202
6203 @smallexample
6204 static int a, b, c;
6205 int foo (void) @{ return a + b + c; @}
6206 @end smallexample
6207
6208 would usually calculate the addresses of all three variables, but if you
6209 compile it with @option{-fsection-anchors}, it will access the variables
6210 from a common anchor point instead.  The effect is similar to the
6211 following pseudocode (which isn't valid C):
6212
6213 @smallexample
6214 int foo (void)
6215 @{
6216   register int *xr = &x;
6217   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6218 @}
6219 @end smallexample
6220
6221 Not all targets support this option.
6222
6223 @item --param @var{name}=@var{value}
6224 @opindex param
6225 In some places, GCC uses various constants to control the amount of
6226 optimization that is done.  For example, GCC will not inline functions
6227 that contain more that a certain number of instructions.  You can
6228 control some of these constants on the command-line using the
6229 @option{--param} option.
6230
6231 The names of specific parameters, and the meaning of the values, are
6232 tied to the internals of the compiler, and are subject to change
6233 without notice in future releases.
6234
6235 In each case, the @var{value} is an integer.  The allowable choices for
6236 @var{name} are given in the following table:
6237
6238 @table @gcctabopt
6239 @item salias-max-implicit-fields
6240 The maximum number of fields in a variable without direct
6241 structure accesses for which structure aliasing will consider trying 
6242 to track each field.  The default is 5
6243
6244 @item salias-max-array-elements
6245 The maximum number of elements an array can have and its elements
6246 still be tracked individually by structure aliasing. The default is 4
6247
6248 @item sra-max-structure-size
6249 The maximum structure size, in bytes, at which the scalar replacement
6250 of aggregates (SRA) optimization will perform block copies.  The
6251 default value, 0, implies that GCC will select the most appropriate
6252 size itself.
6253
6254 @item sra-field-structure-ratio
6255 The threshold ratio (as a percentage) between instantiated fields and
6256 the complete structure size.  We say that if the ratio of the number
6257 of bytes in instantiated fields to the number of bytes in the complete
6258 structure exceeds this parameter, then block copies are not used.  The
6259 default is 75.
6260
6261 @item max-crossjump-edges
6262 The maximum number of incoming edges to consider for crossjumping.
6263 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6264 the number of edges incoming to each block.  Increasing values mean
6265 more aggressive optimization, making the compile time increase with
6266 probably small improvement in executable size.
6267
6268 @item min-crossjump-insns
6269 The minimum number of instructions which must be matched at the end
6270 of two blocks before crossjumping will be performed on them.  This
6271 value is ignored in the case where all instructions in the block being
6272 crossjumped from are matched.  The default value is 5.
6273
6274 @item max-grow-copy-bb-insns
6275 The maximum code size expansion factor when copying basic blocks
6276 instead of jumping.  The expansion is relative to a jump instruction.
6277 The default value is 8.
6278
6279 @item max-goto-duplication-insns
6280 The maximum number of instructions to duplicate to a block that jumps
6281 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6282 passes, GCC factors computed gotos early in the compilation process,
6283 and unfactors them as late as possible.  Only computed jumps at the
6284 end of a basic blocks with no more than max-goto-duplication-insns are
6285 unfactored.  The default value is 8.
6286
6287 @item max-delay-slot-insn-search
6288 The maximum number of instructions to consider when looking for an
6289 instruction to fill a delay slot.  If more than this arbitrary number of
6290 instructions is searched, the time savings from filling the delay slot
6291 will be minimal so stop searching.  Increasing values mean more
6292 aggressive optimization, making the compile time increase with probably
6293 small improvement in executable run time.
6294
6295 @item max-delay-slot-live-search
6296 When trying to fill delay slots, the maximum number of instructions to
6297 consider when searching for a block with valid live register
6298 information.  Increasing this arbitrarily chosen value means more
6299 aggressive optimization, increasing the compile time.  This parameter
6300 should be removed when the delay slot code is rewritten to maintain the
6301 control-flow graph.
6302
6303 @item max-gcse-memory
6304 The approximate maximum amount of memory that will be allocated in
6305 order to perform the global common subexpression elimination
6306 optimization.  If more memory than specified is required, the
6307 optimization will not be done.
6308
6309 @item max-gcse-passes
6310 The maximum number of passes of GCSE to run.  The default is 1.
6311
6312 @item max-pending-list-length
6313 The maximum number of pending dependencies scheduling will allow
6314 before flushing the current state and starting over.  Large functions
6315 with few branches or calls can create excessively large lists which
6316 needlessly consume memory and resources.
6317
6318 @item max-inline-insns-single
6319 Several parameters control the tree inliner used in gcc.
6320 This number sets the maximum number of instructions (counted in GCC's
6321 internal representation) in a single function that the tree inliner
6322 will consider for inlining.  This only affects functions declared
6323 inline and methods implemented in a class declaration (C++).
6324 The default value is 450.
6325
6326 @item max-inline-insns-auto
6327 When you use @option{-finline-functions} (included in @option{-O3}),
6328 a lot of functions that would otherwise not be considered for inlining
6329 by the compiler will be investigated.  To those functions, a different
6330 (more restrictive) limit compared to functions declared inline can
6331 be applied.
6332 The default value is 90.
6333
6334 @item large-function-insns
6335 The limit specifying really large functions.  For functions larger than this
6336 limit after inlining inlining is constrained by
6337 @option{--param large-function-growth}.  This parameter is useful primarily
6338 to avoid extreme compilation time caused by non-linear algorithms used by the
6339 backend.
6340 This parameter is ignored when @option{-funit-at-a-time} is not used.
6341 The default value is 2700.
6342
6343 @item large-function-growth
6344 Specifies maximal growth of large function caused by inlining in percents.
6345 This parameter is ignored when @option{-funit-at-a-time} is not used.
6346 The default value is 100 which limits large function growth to 2.0 times
6347 the original size.
6348
6349 @item large-unit-insns
6350 The limit specifying large translation unit.  Growth caused by inlining of
6351 units larger than this limit is limited by @option{--param inline-unit-growth}.
6352 For small units this might be too tight (consider unit consisting of function A
6353 that is inline and B that just calls A three time.  If B is small relative to
6354 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6355 large units consisting of small inlininable functions however the overall unit
6356 growth limit is needed to avoid exponential explosion of code size.  Thus for
6357 smaller units, the size is increased to @option{--param large-unit-insns}
6358 before applying @option{--param inline-unit-growth}.  The default is 10000
6359
6360 @item inline-unit-growth
6361 Specifies maximal overall growth of the compilation unit caused by inlining.
6362 This parameter is ignored when @option{-funit-at-a-time} is not used.
6363 The default value is 30 which limits unit growth to 1.3 times the original
6364 size.
6365
6366 @item large-stack-frame
6367 The limit specifying large stack frames.  While inlining the algorithm is trying
6368 to not grow past this limit too much.  Default value is 256 bytes.
6369
6370 @item large-stack-frame-growth
6371 Specifies maximal growth of large stack frames caused by inlining in percents.
6372 The default value is 1000 which limits large stack frame growth to 11 times
6373 the original size.
6374
6375 @item max-inline-insns-recursive
6376 @itemx max-inline-insns-recursive-auto
6377 Specifies maximum number of instructions out-of-line copy of self recursive inline
6378 function can grow into by performing recursive inlining.
6379
6380 For functions declared inline @option{--param max-inline-insns-recursive} is
6381 taken into account.  For function not declared inline, recursive inlining
6382 happens only when @option{-finline-functions} (included in @option{-O3}) is
6383 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6384 default value is 450.
6385
6386 @item max-inline-recursive-depth
6387 @itemx max-inline-recursive-depth-auto
6388 Specifies maximum recursion depth used by the recursive inlining.
6389
6390 For functions declared inline @option{--param max-inline-recursive-depth} is
6391 taken into account.  For function not declared inline, recursive inlining
6392 happens only when @option{-finline-functions} (included in @option{-O3}) is
6393 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6394 default value is 450.
6395
6396 @item min-inline-recursive-probability
6397 Recursive inlining is profitable only for function having deep recursion
6398 in average and can hurt for function having little recursion depth by
6399 increasing the prologue size or complexity of function body to other
6400 optimizers.
6401
6402 When profile feedback is available (see @option{-fprofile-generate}) the actual
6403 recursion depth can be guessed from probability that function will recurse via
6404 given call expression.  This parameter limits inlining only to call expression
6405 whose probability exceeds given threshold (in percents).  The default value is
6406 10.
6407
6408 @item inline-call-cost
6409 Specify cost of call instruction relative to simple arithmetics operations
6410 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6411 functions and at the same time increases size of leaf function that is believed to
6412 reduce function size by being inlined.  In effect it increases amount of
6413 inlining for code having large abstraction penalty (many functions that just
6414 pass the arguments to other functions) and decrease inlining for code with low
6415 abstraction penalty.  The default value is 16.
6416
6417 @item min-vect-loop-bound
6418 The minimum number of iterations under which a loop will not get vectorized 
6419 when @option{-ftree-vectorize} is used.  The number of iterations after 
6420 vectorization needs to be greater than the value specified by this option
6421 to allow vectorization.  The default value is 0.
6422
6423 @item max-unrolled-insns
6424 The maximum number of instructions that a loop should have if that loop
6425 is unrolled, and if the loop is unrolled, it determines how many times
6426 the loop code is unrolled.
6427
6428 @item max-average-unrolled-insns
6429 The maximum number of instructions biased by probabilities of their execution
6430 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6431 it determines how many times the loop code is unrolled.
6432
6433 @item max-unroll-times
6434 The maximum number of unrollings of a single loop.
6435
6436 @item max-peeled-insns
6437 The maximum number of instructions that a loop should have if that loop
6438 is peeled, and if the loop is peeled, it determines how many times
6439 the loop code is peeled.
6440
6441 @item max-peel-times
6442 The maximum number of peelings of a single loop.
6443
6444 @item max-completely-peeled-insns
6445 The maximum number of insns of a completely peeled loop.
6446
6447 @item max-completely-peel-times
6448 The maximum number of iterations of a loop to be suitable for complete peeling.
6449
6450 @item max-unswitch-insns
6451 The maximum number of insns of an unswitched loop.
6452
6453 @item max-unswitch-level
6454 The maximum number of branches unswitched in a single loop.
6455
6456 @item lim-expensive
6457 The minimum cost of an expensive expression in the loop invariant motion.
6458
6459 @item iv-consider-all-candidates-bound
6460 Bound on number of candidates for induction variables below that
6461 all candidates are considered for each use in induction variable
6462 optimizations.  Only the most relevant candidates are considered
6463 if there are more candidates, to avoid quadratic time complexity.
6464
6465 @item iv-max-considered-uses
6466 The induction variable optimizations give up on loops that contain more
6467 induction variable uses.
6468
6469 @item iv-always-prune-cand-set-bound
6470 If number of candidates in the set is smaller than this value,
6471 we always try to remove unnecessary ivs from the set during its
6472 optimization when a new iv is added to the set.
6473
6474 @item scev-max-expr-size
6475 Bound on size of expressions used in the scalar evolutions analyzer.
6476 Large expressions slow the analyzer.
6477
6478 @item omega-max-vars
6479 The maximum number of variables in an Omega constraint system.
6480 The default value is 128.
6481
6482 @item omega-max-geqs
6483 The maximum number of inequalities in an Omega constraint system.
6484 The default value is 256.
6485
6486 @item omega-max-eqs
6487 The maximum number of equalities in an Omega constraint system.
6488 The default value is 128.
6489
6490 @item omega-max-wild-cards
6491 The maximum number of wildcard variables that the Omega solver will
6492 be able to insert.  The default value is 18.
6493
6494 @item omega-hash-table-size
6495 The size of the hash table in the Omega solver.  The default value is
6496 550.
6497
6498 @item omega-max-keys
6499 The maximal number of keys used by the Omega solver.  The default
6500 value is 500.
6501
6502 @item omega-eliminate-redundant-constraints
6503 When set to 1, use expensive methods to eliminate all redundant
6504 constraints.  The default value is 0.
6505
6506 @item vect-max-version-checks
6507 The maximum number of runtime checks that can be performed when doing
6508 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6509 for more information.
6510
6511 @item max-iterations-to-track
6512
6513 The maximum number of iterations of a loop the brute force algorithm
6514 for analysis of # of iterations of the loop tries to evaluate.
6515
6516 @item hot-bb-count-fraction
6517 Select fraction of the maximal count of repetitions of basic block in program
6518 given basic block needs to have to be considered hot.
6519
6520 @item hot-bb-frequency-fraction
6521 Select fraction of the maximal frequency of executions of basic block in
6522 function given basic block needs to have to be considered hot
6523
6524 @item max-predicted-iterations
6525 The maximum number of loop iterations we predict statically.  This is useful
6526 in cases where function contain single loop with known bound and other loop
6527 with unknown.  We predict the known number of iterations correctly, while
6528 the unknown number of iterations average to roughly 10.  This means that the
6529 loop without bounds would appear artificially cold relative to the other one.
6530
6531 @item tracer-dynamic-coverage
6532 @itemx tracer-dynamic-coverage-feedback
6533
6534 This value is used to limit superblock formation once the given percentage of
6535 executed instructions is covered.  This limits unnecessary code size
6536 expansion.
6537
6538 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6539 feedback is available.  The real profiles (as opposed to statically estimated
6540 ones) are much less balanced allowing the threshold to be larger value.
6541
6542 @item tracer-max-code-growth
6543 Stop tail duplication once code growth has reached given percentage.  This is
6544 rather hokey argument, as most of the duplicates will be eliminated later in
6545 cross jumping, so it may be set to much higher values than is the desired code
6546 growth.
6547
6548 @item tracer-min-branch-ratio
6549
6550 Stop reverse growth when the reverse probability of best edge is less than this
6551 threshold (in percent).
6552
6553 @item tracer-min-branch-ratio
6554 @itemx tracer-min-branch-ratio-feedback
6555
6556 Stop forward growth if the best edge do have probability lower than this
6557 threshold.
6558
6559 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6560 compilation for profile feedback and one for compilation without.  The value
6561 for compilation with profile feedback needs to be more conservative (higher) in
6562 order to make tracer effective.
6563
6564 @item max-cse-path-length
6565
6566 Maximum number of basic blocks on path that cse considers.  The default is 10.
6567
6568 @item max-cse-insns
6569 The maximum instructions CSE process before flushing. The default is 1000.
6570
6571 @item max-aliased-vops
6572
6573 Maximum number of virtual operands per statement allowed to represent
6574 aliases before triggering the alias grouping heuristic.  Alias
6575 grouping reduces compile times and memory consumption needed for
6576 aliasing at the expense of precision loss in alias information.
6577
6578 @item ggc-min-expand
6579
6580 GCC uses a garbage collector to manage its own memory allocation.  This
6581 parameter specifies the minimum percentage by which the garbage
6582 collector's heap should be allowed to expand between collections.
6583 Tuning this may improve compilation speed; it has no effect on code
6584 generation.
6585
6586 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6587 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6588 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6589 GCC is not able to calculate RAM on a particular platform, the lower
6590 bound of 30% is used.  Setting this parameter and
6591 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6592 every opportunity.  This is extremely slow, but can be useful for
6593 debugging.
6594
6595 @item ggc-min-heapsize
6596
6597 Minimum size of the garbage collector's heap before it begins bothering
6598 to collect garbage.  The first collection occurs after the heap expands
6599 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6600 tuning this may improve compilation speed, and has no effect on code
6601 generation.
6602
6603 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6604 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6605 with a lower bound of 4096 (four megabytes) and an upper bound of
6606 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6607 particular platform, the lower bound is used.  Setting this parameter
6608 very large effectively disables garbage collection.  Setting this
6609 parameter and @option{ggc-min-expand} to zero causes a full collection
6610 to occur at every opportunity.
6611
6612 @item max-reload-search-insns
6613 The maximum number of instruction reload should look backward for equivalent
6614 register.  Increasing values mean more aggressive optimization, making the
6615 compile time increase with probably slightly better performance.  The default
6616 value is 100.
6617
6618 @item max-cselib-memory-locations
6619 The maximum number of memory locations cselib should take into account.
6620 Increasing values mean more aggressive optimization, making the compile time
6621 increase with probably slightly better performance.  The default value is 500.
6622
6623 @item max-flow-memory-locations
6624 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6625 The default value is 100.
6626
6627 @item reorder-blocks-duplicate
6628 @itemx reorder-blocks-duplicate-feedback
6629
6630 Used by basic block reordering pass to decide whether to use unconditional
6631 branch or duplicate the code on its destination.  Code is duplicated when its
6632 estimated size is smaller than this value multiplied by the estimated size of
6633 unconditional jump in the hot spots of the program.
6634
6635 The @option{reorder-block-duplicate-feedback} is used only when profile
6636 feedback is available and may be set to higher values than
6637 @option{reorder-block-duplicate} since information about the hot spots is more
6638 accurate.
6639
6640 @item max-sched-ready-insns
6641 The maximum number of instructions ready to be issued the scheduler should
6642 consider at any given time during the first scheduling pass.  Increasing
6643 values mean more thorough searches, making the compilation time increase
6644 with probably little benefit.  The default value is 100.
6645
6646 @item max-sched-region-blocks
6647 The maximum number of blocks in a region to be considered for
6648 interblock scheduling.  The default value is 10.
6649
6650 @item max-sched-region-insns
6651 The maximum number of insns in a region to be considered for
6652 interblock scheduling.  The default value is 100.
6653
6654 @item min-spec-prob
6655 The minimum probability (in percents) of reaching a source block
6656 for interblock speculative scheduling.  The default value is 40.
6657
6658 @item max-sched-extend-regions-iters
6659 The maximum number of iterations through CFG to extend regions.
6660 0 - disable region extension,
6661 N - do at most N iterations.
6662 The default value is 0.
6663
6664 @item max-sched-insn-conflict-delay
6665 The maximum conflict delay for an insn to be considered for speculative motion.
6666 The default value is 3.
6667
6668 @item sched-spec-prob-cutoff
6669 The minimal probability of speculation success (in percents), so that
6670 speculative insn will be scheduled.
6671 The default value is 40.
6672
6673 @item max-last-value-rtl
6674
6675 The maximum size measured as number of RTLs that can be recorded in an expression
6676 in combiner for a pseudo register as last known value of that register.  The default
6677 is 10000.
6678
6679 @item integer-share-limit
6680 Small integer constants can use a shared data structure, reducing the
6681 compiler's memory usage and increasing its speed.  This sets the maximum
6682 value of a shared integer constant's.  The default value is 256.
6683
6684 @item min-virtual-mappings
6685 Specifies the minimum number of virtual mappings in the incremental
6686 SSA updater that should be registered to trigger the virtual mappings
6687 heuristic defined by virtual-mappings-ratio.  The default value is
6688 100.
6689
6690 @item virtual-mappings-ratio
6691 If the number of virtual mappings is virtual-mappings-ratio bigger
6692 than the number of virtual symbols to be updated, then the incremental
6693 SSA updater switches to a full update for those symbols.  The default
6694 ratio is 3.
6695
6696 @item ssp-buffer-size
6697 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6698 protection when @option{-fstack-protection} is used.
6699
6700 @item max-jump-thread-duplication-stmts
6701 Maximum number of statements allowed in a block that needs to be
6702 duplicated when threading jumps.
6703
6704 @item max-fields-for-field-sensitive
6705 Maximum number of fields in a structure we will treat in
6706 a field sensitive manner during pointer analysis.
6707
6708 @item prefetch-latency
6709 Estimate on average number of instructions that are executed before
6710 prefetch finishes.  The distance we prefetch ahead is proportional
6711 to this constant.  Increasing this number may also lead to less
6712 streams being prefetched (see @option{simultaneous-prefetches}).
6713
6714 @item simultaneous-prefetches
6715 Maximum number of prefetches that can run at the same time.
6716
6717 @item l1-cache-line-size
6718 The size of cache line in L1 cache, in bytes.
6719
6720 @item l1-cache-size
6721 The number of cache lines in L1 cache.
6722
6723 @item verify-canonical-types
6724 Whether the compiler should verify the ``canonical'' types used for
6725 type equality comparisons within the C++ and Objective-C++ front
6726 ends. Set to 1 (the default when GCC is configured with
6727 --enable-checking) to enable verification, 0 to disable verification
6728 (the default when GCC is configured with --disable-checking).
6729
6730 @end table
6731 @end table
6732
6733 @node Preprocessor Options
6734 @section Options Controlling the Preprocessor
6735 @cindex preprocessor options
6736 @cindex options, preprocessor
6737
6738 These options control the C preprocessor, which is run on each C source
6739 file before actual compilation.
6740
6741 If you use the @option{-E} option, nothing is done except preprocessing.
6742 Some of these options make sense only together with @option{-E} because
6743 they cause the preprocessor output to be unsuitable for actual
6744 compilation.
6745
6746 @table @gcctabopt
6747 @opindex Wp
6748 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6749 and pass @var{option} directly through to the preprocessor.  If
6750 @var{option} contains commas, it is split into multiple options at the
6751 commas.  However, many options are modified, translated or interpreted
6752 by the compiler driver before being passed to the preprocessor, and
6753 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6754 interface is undocumented and subject to change, so whenever possible
6755 you should avoid using @option{-Wp} and let the driver handle the
6756 options instead.
6757
6758 @item -Xpreprocessor @var{option}
6759 @opindex preprocessor
6760 Pass @var{option} as an option to the preprocessor.  You can use this to
6761 supply system-specific preprocessor options which GCC does not know how to
6762 recognize.
6763
6764 If you want to pass an option that takes an argument, you must use
6765 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6766 @end table
6767
6768 @include cppopts.texi
6769
6770 @node Assembler Options
6771 @section Passing Options to the Assembler
6772
6773 @c prevent bad page break with this line
6774 You can pass options to the assembler.
6775
6776 @table @gcctabopt
6777 @item -Wa,@var{option}
6778 @opindex Wa
6779 Pass @var{option} as an option to the assembler.  If @var{option}
6780 contains commas, it is split into multiple options at the commas.
6781
6782 @item -Xassembler @var{option}
6783 @opindex Xassembler
6784 Pass @var{option} as an option to the assembler.  You can use this to
6785 supply system-specific assembler options which GCC does not know how to
6786 recognize.
6787
6788 If you want to pass an option that takes an argument, you must use
6789 @option{-Xassembler} twice, once for the option and once for the argument.
6790
6791 @end table
6792
6793 @node Link Options
6794 @section Options for Linking
6795 @cindex link options
6796 @cindex options, linking
6797
6798 These options come into play when the compiler links object files into
6799 an executable output file.  They are meaningless if the compiler is
6800 not doing a link step.
6801
6802 @table @gcctabopt
6803 @cindex file names
6804 @item @var{object-file-name}
6805 A file name that does not end in a special recognized suffix is
6806 considered to name an object file or library.  (Object files are
6807 distinguished from libraries by the linker according to the file
6808 contents.)  If linking is done, these object files are used as input
6809 to the linker.
6810
6811 @item -c
6812 @itemx -S
6813 @itemx -E
6814 @opindex c
6815 @opindex S
6816 @opindex E
6817 If any of these options is used, then the linker is not run, and
6818 object file names should not be used as arguments.  @xref{Overall
6819 Options}.
6820
6821 @cindex Libraries
6822 @item -l@var{library}
6823 @itemx -l @var{library}
6824 @opindex l
6825 Search the library named @var{library} when linking.  (The second
6826 alternative with the library as a separate argument is only for
6827 POSIX compliance and is not recommended.)
6828
6829 It makes a difference where in the command you write this option; the
6830 linker searches and processes libraries and object files in the order they
6831 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6832 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6833 to functions in @samp{z}, those functions may not be loaded.
6834
6835 The linker searches a standard list of directories for the library,
6836 which is actually a file named @file{lib@var{library}.a}.  The linker
6837 then uses this file as if it had been specified precisely by name.
6838
6839 The directories searched include several standard system directories
6840 plus any that you specify with @option{-L}.
6841
6842 Normally the files found this way are library files---archive files
6843 whose members are object files.  The linker handles an archive file by
6844 scanning through it for members which define symbols that have so far
6845 been referenced but not defined.  But if the file that is found is an
6846 ordinary object file, it is linked in the usual fashion.  The only
6847 difference between using an @option{-l} option and specifying a file name
6848 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6849 and searches several directories.
6850
6851 @item -lobjc
6852 @opindex lobjc
6853 You need this special case of the @option{-l} option in order to
6854 link an Objective-C or Objective-C++ program.
6855
6856 @item -nostartfiles
6857 @opindex nostartfiles
6858 Do not use the standard system startup files when linking.
6859 The standard system libraries are used normally, unless @option{-nostdlib}
6860 or @option{-nodefaultlibs} is used.
6861
6862 @item -nodefaultlibs
6863 @opindex nodefaultlibs
6864 Do not use the standard system libraries when linking.
6865 Only the libraries you specify will be passed to the linker.
6866 The standard startup files are used normally, unless @option{-nostartfiles}
6867 is used.  The compiler may generate calls to @code{memcmp},
6868 @code{memset}, @code{memcpy} and @code{memmove}.
6869 These entries are usually resolved by entries in
6870 libc.  These entry points should be supplied through some other
6871 mechanism when this option is specified.
6872
6873 @item -nostdlib
6874 @opindex nostdlib
6875 Do not use the standard system startup files or libraries when linking.
6876 No startup files and only the libraries you specify will be passed to
6877 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6878 @code{memcpy} and @code{memmove}.
6879 These entries are usually resolved by entries in
6880 libc.  These entry points should be supplied through some other
6881 mechanism when this option is specified.
6882
6883 @cindex @option{-lgcc}, use with @option{-nostdlib}
6884 @cindex @option{-nostdlib} and unresolved references
6885 @cindex unresolved references and @option{-nostdlib}
6886 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6887 @cindex @option{-nodefaultlibs} and unresolved references
6888 @cindex unresolved references and @option{-nodefaultlibs}
6889 One of the standard libraries bypassed by @option{-nostdlib} and
6890 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6891 that GCC uses to overcome shortcomings of particular machines, or special
6892 needs for some languages.
6893 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6894 Collection (GCC) Internals},
6895 for more discussion of @file{libgcc.a}.)
6896 In most cases, you need @file{libgcc.a} even when you want to avoid
6897 other standard libraries.  In other words, when you specify @option{-nostdlib}
6898 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6899 This ensures that you have no unresolved references to internal GCC
6900 library subroutines.  (For example, @samp{__main}, used to ensure C++
6901 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6902 GNU Compiler Collection (GCC) Internals}.)
6903
6904 @item -pie
6905 @opindex pie
6906 Produce a position independent executable on targets which support it.
6907 For predictable results, you must also specify the same set of options
6908 that were used to generate code (@option{-fpie}, @option{-fPIE},
6909 or model suboptions) when you specify this option.
6910
6911 @item -rdynamic
6912 @opindex rdynamic
6913 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6914 that support it. This instructs the linker to add all symbols, not
6915 only used ones, to the dynamic symbol table. This option is needed
6916 for some uses of @code{dlopen} or to allow obtaining backtraces
6917 from within a program.
6918
6919 @item -s
6920 @opindex s
6921 Remove all symbol table and relocation information from the executable.
6922
6923 @item -static
6924 @opindex static
6925 On systems that support dynamic linking, this prevents linking with the shared
6926 libraries.  On other systems, this option has no effect.
6927
6928 @item -shared
6929 @opindex shared
6930 Produce a shared object which can then be linked with other objects to
6931 form an executable.  Not all systems support this option.  For predictable
6932 results, you must also specify the same set of options that were used to
6933 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6934 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6935 needs to build supplementary stub code for constructors to work.  On
6936 multi-libbed systems, @samp{gcc -shared} must select the correct support
6937 libraries to link against.  Failing to supply the correct flags may lead
6938 to subtle defects.  Supplying them in cases where they are not necessary
6939 is innocuous.}
6940
6941 @item -shared-libgcc
6942 @itemx -static-libgcc
6943 @opindex shared-libgcc
6944 @opindex static-libgcc
6945 On systems that provide @file{libgcc} as a shared library, these options
6946 force the use of either the shared or static version respectively.
6947 If no shared version of @file{libgcc} was built when the compiler was
6948 configured, these options have no effect.
6949
6950 There are several situations in which an application should use the
6951 shared @file{libgcc} instead of the static version.  The most common
6952 of these is when the application wishes to throw and catch exceptions
6953 across different shared libraries.  In that case, each of the libraries
6954 as well as the application itself should use the shared @file{libgcc}.
6955
6956 Therefore, the G++ and GCJ drivers automatically add
6957 @option{-shared-libgcc} whenever you build a shared library or a main
6958 executable, because C++ and Java programs typically use exceptions, so
6959 this is the right thing to do.
6960
6961 If, instead, you use the GCC driver to create shared libraries, you may
6962 find that they will not always be linked with the shared @file{libgcc}.
6963 If GCC finds, at its configuration time, that you have a non-GNU linker
6964 or a GNU linker that does not support option @option{--eh-frame-hdr},
6965 it will link the shared version of @file{libgcc} into shared libraries
6966 by default.  Otherwise, it will take advantage of the linker and optimize
6967 away the linking with the shared version of @file{libgcc}, linking with
6968 the static version of libgcc by default.  This allows exceptions to
6969 propagate through such shared libraries, without incurring relocation
6970 costs at library load time.
6971
6972 However, if a library or main executable is supposed to throw or catch
6973 exceptions, you must link it using the G++ or GCJ driver, as appropriate
6974 for the languages used in the program, or using the option
6975 @option{-shared-libgcc}, such that it is linked with the shared
6976 @file{libgcc}.
6977
6978 @item -symbolic
6979 @opindex symbolic
6980 Bind references to global symbols when building a shared object.  Warn
6981 about any unresolved references (unless overridden by the link editor
6982 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
6983 this option.
6984
6985 @item -Xlinker @var{option}
6986 @opindex Xlinker
6987 Pass @var{option} as an option to the linker.  You can use this to
6988 supply system-specific linker options which GCC does not know how to
6989 recognize.
6990
6991 If you want to pass an option that takes an argument, you must use
6992 @option{-Xlinker} twice, once for the option and once for the argument.
6993 For example, to pass @option{-assert definitions}, you must write
6994 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
6995 @option{-Xlinker "-assert definitions"}, because this passes the entire
6996 string as a single argument, which is not what the linker expects.
6997
6998 @item -Wl,@var{option}
6999 @opindex Wl
7000 Pass @var{option} as an option to the linker.  If @var{option} contains
7001 commas, it is split into multiple options at the commas.
7002
7003 @item -u @var{symbol}
7004 @opindex u
7005 Pretend the symbol @var{symbol} is undefined, to force linking of
7006 library modules to define it.  You can use @option{-u} multiple times with
7007 different symbols to force loading of additional library modules.
7008 @end table
7009
7010 @node Directory Options
7011 @section Options for Directory Search
7012 @cindex directory options
7013 @cindex options, directory search
7014 @cindex search path
7015
7016 These options specify directories to search for header files, for
7017 libraries and for parts of the compiler:
7018
7019 @table @gcctabopt
7020 @item -I@var{dir}
7021 @opindex I
7022 Add the directory @var{dir} to the head of the list of directories to be
7023 searched for header files.  This can be used to override a system header
7024 file, substituting your own version, since these directories are
7025 searched before the system header file directories.  However, you should
7026 not use this option to add directories that contain vendor-supplied
7027 system header files (use @option{-isystem} for that).  If you use more than
7028 one @option{-I} option, the directories are scanned in left-to-right
7029 order; the standard system directories come after.
7030
7031 If a standard system include directory, or a directory specified with
7032 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7033 option will be ignored.  The directory will still be searched but as a
7034 system directory at its normal position in the system include chain.
7035 This is to ensure that GCC's procedure to fix buggy system headers and
7036 the ordering for the include_next directive are not inadvertently changed.
7037 If you really need to change the search order for system directories,
7038 use the @option{-nostdinc} and/or @option{-isystem} options.
7039
7040 @item -iquote@var{dir}
7041 @opindex iquote
7042 Add the directory @var{dir} to the head of the list of directories to
7043 be searched for header files only for the case of @samp{#include
7044 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7045 otherwise just like @option{-I}.
7046
7047 @item -L@var{dir}
7048 @opindex L
7049 Add directory @var{dir} to the list of directories to be searched
7050 for @option{-l}.
7051
7052 @item -B@var{prefix}
7053 @opindex B
7054 This option specifies where to find the executables, libraries,
7055 include files, and data files of the compiler itself.
7056
7057 The compiler driver program runs one or more of the subprograms
7058 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7059 @var{prefix} as a prefix for each program it tries to run, both with and
7060 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7061
7062 For each subprogram to be run, the compiler driver first tries the
7063 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7064 was not specified, the driver tries two standard prefixes, which are
7065 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7066 those results in a file name that is found, the unmodified program
7067 name is searched for using the directories specified in your
7068 @env{PATH} environment variable.
7069
7070 The compiler will check to see if the path provided by the @option{-B}
7071 refers to a directory, and if necessary it will add a directory
7072 separator character at the end of the path.
7073
7074 @option{-B} prefixes that effectively specify directory names also apply
7075 to libraries in the linker, because the compiler translates these
7076 options into @option{-L} options for the linker.  They also apply to
7077 includes files in the preprocessor, because the compiler translates these
7078 options into @option{-isystem} options for the preprocessor.  In this case,
7079 the compiler appends @samp{include} to the prefix.
7080
7081 The run-time support file @file{libgcc.a} can also be searched for using
7082 the @option{-B} prefix, if needed.  If it is not found there, the two
7083 standard prefixes above are tried, and that is all.  The file is left
7084 out of the link if it is not found by those means.
7085
7086 Another way to specify a prefix much like the @option{-B} prefix is to use
7087 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7088 Variables}.
7089
7090 As a special kludge, if the path provided by @option{-B} is
7091 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7092 9, then it will be replaced by @file{[dir/]include}.  This is to help
7093 with boot-strapping the compiler.
7094
7095 @item -specs=@var{file}
7096 @opindex specs
7097 Process @var{file} after the compiler reads in the standard @file{specs}
7098 file, in order to override the defaults that the @file{gcc} driver
7099 program uses when determining what switches to pass to @file{cc1},
7100 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7101 @option{-specs=@var{file}} can be specified on the command line, and they
7102 are processed in order, from left to right.
7103
7104 @item --sysroot=@var{dir}
7105 @opindex sysroot
7106 Use @var{dir} as the logical root directory for headers and libraries.
7107 For example, if the compiler would normally search for headers in
7108 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7109 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.  
7110
7111 If you use both this option and the @option{-isysroot} option, then
7112 the @option{--sysroot} option will apply to libraries, but the
7113 @option{-isysroot} option will apply to header files.
7114
7115 The GNU linker (beginning with version 2.16) has the necessary support
7116 for this option.  If your linker does not support this option, the
7117 header file aspect of @option{--sysroot} will still work, but the
7118 library aspect will not.
7119
7120 @item -I-
7121 @opindex I-
7122 This option has been deprecated.  Please use @option{-iquote} instead for
7123 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7124 Any directories you specify with @option{-I} options before the @option{-I-}
7125 option are searched only for the case of @samp{#include "@var{file}"};
7126 they are not searched for @samp{#include <@var{file}>}.
7127
7128 If additional directories are specified with @option{-I} options after
7129 the @option{-I-}, these directories are searched for all @samp{#include}
7130 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7131 this way.)
7132
7133 In addition, the @option{-I-} option inhibits the use of the current
7134 directory (where the current input file came from) as the first search
7135 directory for @samp{#include "@var{file}"}.  There is no way to
7136 override this effect of @option{-I-}.  With @option{-I.} you can specify
7137 searching the directory which was current when the compiler was
7138 invoked.  That is not exactly the same as what the preprocessor does
7139 by default, but it is often satisfactory.
7140
7141 @option{-I-} does not inhibit the use of the standard system directories
7142 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7143 independent.
7144 @end table
7145
7146 @c man end
7147
7148 @node Spec Files
7149 @section Specifying subprocesses and the switches to pass to them
7150 @cindex Spec Files
7151
7152 @command{gcc} is a driver program.  It performs its job by invoking a
7153 sequence of other programs to do the work of compiling, assembling and
7154 linking.  GCC interprets its command-line parameters and uses these to
7155 deduce which programs it should invoke, and which command-line options
7156 it ought to place on their command lines.  This behavior is controlled
7157 by @dfn{spec strings}.  In most cases there is one spec string for each
7158 program that GCC can invoke, but a few programs have multiple spec
7159 strings to control their behavior.  The spec strings built into GCC can
7160 be overridden by using the @option{-specs=} command-line switch to specify
7161 a spec file.
7162
7163 @dfn{Spec files} are plaintext files that are used to construct spec
7164 strings.  They consist of a sequence of directives separated by blank
7165 lines.  The type of directive is determined by the first non-whitespace
7166 character on the line and it can be one of the following:
7167
7168 @table @code
7169 @item %@var{command}
7170 Issues a @var{command} to the spec file processor.  The commands that can
7171 appear here are:
7172
7173 @table @code
7174 @item %include <@var{file}>
7175 @cindex %include
7176 Search for @var{file} and insert its text at the current point in the
7177 specs file.
7178
7179 @item %include_noerr <@var{file}>
7180 @cindex %include_noerr
7181 Just like @samp{%include}, but do not generate an error message if the include
7182 file cannot be found.
7183
7184 @item %rename @var{old_name} @var{new_name}
7185 @cindex %rename
7186 Rename the spec string @var{old_name} to @var{new_name}.
7187
7188 @end table
7189
7190 @item *[@var{spec_name}]:
7191 This tells the compiler to create, override or delete the named spec
7192 string.  All lines after this directive up to the next directive or
7193 blank line are considered to be the text for the spec string.  If this
7194 results in an empty string then the spec will be deleted.  (Or, if the
7195 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7196 does not currently exist a new spec will be created.  If the spec does
7197 exist then its contents will be overridden by the text of this
7198 directive, unless the first character of that text is the @samp{+}
7199 character, in which case the text will be appended to the spec.
7200
7201 @item [@var{suffix}]:
7202 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7203 and up to the next directive or blank line are considered to make up the
7204 spec string for the indicated suffix.  When the compiler encounters an
7205 input file with the named suffix, it will processes the spec string in
7206 order to work out how to compile that file.  For example:
7207
7208 @smallexample
7209 .ZZ:
7210 z-compile -input %i
7211 @end smallexample
7212
7213 This says that any input file whose name ends in @samp{.ZZ} should be
7214 passed to the program @samp{z-compile}, which should be invoked with the
7215 command-line switch @option{-input} and with the result of performing the
7216 @samp{%i} substitution.  (See below.)
7217
7218 As an alternative to providing a spec string, the text that follows a
7219 suffix directive can be one of the following:
7220
7221 @table @code
7222 @item @@@var{language}
7223 This says that the suffix is an alias for a known @var{language}.  This is
7224 similar to using the @option{-x} command-line switch to GCC to specify a
7225 language explicitly.  For example:
7226
7227 @smallexample
7228 .ZZ:
7229 @@c++
7230 @end smallexample
7231
7232 Says that .ZZ files are, in fact, C++ source files.
7233
7234 @item #@var{name}
7235 This causes an error messages saying:
7236
7237 @smallexample
7238 @var{name} compiler not installed on this system.
7239 @end smallexample
7240 @end table
7241
7242 GCC already has an extensive list of suffixes built into it.
7243 This directive will add an entry to the end of the list of suffixes, but
7244 since the list is searched from the end backwards, it is effectively
7245 possible to override earlier entries using this technique.
7246
7247 @end table
7248
7249 GCC has the following spec strings built into it.  Spec files can
7250 override these strings or create their own.  Note that individual
7251 targets can also add their own spec strings to this list.
7252
7253 @smallexample
7254 asm          Options to pass to the assembler
7255 asm_final    Options to pass to the assembler post-processor
7256 cpp          Options to pass to the C preprocessor
7257 cc1          Options to pass to the C compiler
7258 cc1plus      Options to pass to the C++ compiler
7259 endfile      Object files to include at the end of the link
7260 link         Options to pass to the linker
7261 lib          Libraries to include on the command line to the linker
7262 libgcc       Decides which GCC support library to pass to the linker
7263 linker       Sets the name of the linker
7264 predefines   Defines to be passed to the C preprocessor
7265 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7266              by default
7267 startfile    Object files to include at the start of the link
7268 @end smallexample
7269
7270 Here is a small example of a spec file:
7271
7272 @smallexample
7273 %rename lib                 old_lib
7274
7275 *lib:
7276 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7277 @end smallexample
7278
7279 This example renames the spec called @samp{lib} to @samp{old_lib} and
7280 then overrides the previous definition of @samp{lib} with a new one.
7281 The new definition adds in some extra command-line options before
7282 including the text of the old definition.
7283
7284 @dfn{Spec strings} are a list of command-line options to be passed to their
7285 corresponding program.  In addition, the spec strings can contain
7286 @samp{%}-prefixed sequences to substitute variable text or to
7287 conditionally insert text into the command line.  Using these constructs
7288 it is possible to generate quite complex command lines.
7289
7290 Here is a table of all defined @samp{%}-sequences for spec
7291 strings.  Note that spaces are not generated automatically around the
7292 results of expanding these sequences.  Therefore you can concatenate them
7293 together or combine them with constant text in a single argument.
7294
7295 @table @code
7296 @item %%
7297 Substitute one @samp{%} into the program name or argument.
7298
7299 @item %i
7300 Substitute the name of the input file being processed.
7301
7302 @item %b
7303 Substitute the basename of the input file being processed.
7304 This is the substring up to (and not including) the last period
7305 and not including the directory.
7306
7307 @item %B
7308 This is the same as @samp{%b}, but include the file suffix (text after
7309 the last period).
7310
7311 @item %d
7312 Marks the argument containing or following the @samp{%d} as a
7313 temporary file name, so that that file will be deleted if GCC exits
7314 successfully.  Unlike @samp{%g}, this contributes no text to the
7315 argument.
7316
7317 @item %g@var{suffix}
7318 Substitute a file name that has suffix @var{suffix} and is chosen
7319 once per compilation, and mark the argument in the same way as
7320 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7321 name is now chosen in a way that is hard to predict even when previously
7322 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7323 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7324 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7325 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7326 was simply substituted with a file name chosen once per compilation,
7327 without regard to any appended suffix (which was therefore treated
7328 just like ordinary text), making such attacks more likely to succeed.
7329
7330 @item %u@var{suffix}
7331 Like @samp{%g}, but generates a new temporary file name even if
7332 @samp{%u@var{suffix}} was already seen.
7333
7334 @item %U@var{suffix}
7335 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7336 new one if there is no such last file name.  In the absence of any
7337 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7338 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7339 would involve the generation of two distinct file names, one
7340 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7341 simply substituted with a file name chosen for the previous @samp{%u},
7342 without regard to any appended suffix.
7343
7344 @item %j@var{suffix}
7345 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7346 writable, and if save-temps is off; otherwise, substitute the name
7347 of a temporary file, just like @samp{%u}.  This temporary file is not
7348 meant for communication between processes, but rather as a junk
7349 disposal mechanism.
7350
7351 @item %|@var{suffix}
7352 @itemx %m@var{suffix}
7353 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7354 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7355 all.  These are the two most common ways to instruct a program that it
7356 should read from standard input or write to standard output.  If you
7357 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7358 construct: see for example @file{f/lang-specs.h}.
7359
7360 @item %.@var{SUFFIX}
7361 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7362 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7363 terminated by the next space or %.
7364
7365 @item %w
7366 Marks the argument containing or following the @samp{%w} as the
7367 designated output file of this compilation.  This puts the argument
7368 into the sequence of arguments that @samp{%o} will substitute later.
7369
7370 @item %o
7371 Substitutes the names of all the output files, with spaces
7372 automatically placed around them.  You should write spaces
7373 around the @samp{%o} as well or the results are undefined.
7374 @samp{%o} is for use in the specs for running the linker.
7375 Input files whose names have no recognized suffix are not compiled
7376 at all, but they are included among the output files, so they will
7377 be linked.
7378
7379 @item %O
7380 Substitutes the suffix for object files.  Note that this is
7381 handled specially when it immediately follows @samp{%g, %u, or %U},
7382 because of the need for those to form complete file names.  The
7383 handling is such that @samp{%O} is treated exactly as if it had already
7384 been substituted, except that @samp{%g, %u, and %U} do not currently
7385 support additional @var{suffix} characters following @samp{%O} as they would
7386 following, for example, @samp{.o}.
7387
7388 @item %p
7389 Substitutes the standard macro predefinitions for the
7390 current target machine.  Use this when running @code{cpp}.
7391
7392 @item %P
7393 Like @samp{%p}, but puts @samp{__} before and after the name of each
7394 predefined macro, except for macros that start with @samp{__} or with
7395 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7396 C@.
7397
7398 @item %I
7399 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7400 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7401 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7402 and @option{-imultilib} as necessary.
7403
7404 @item %s
7405 Current argument is the name of a library or startup file of some sort.
7406 Search for that file in a standard list of directories and substitute
7407 the full name found.
7408
7409 @item %e@var{str}
7410 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7411 Use this when inconsistent options are detected.
7412
7413 @item %(@var{name})
7414 Substitute the contents of spec string @var{name} at this point.
7415
7416 @item %[@var{name}]
7417 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7418
7419 @item %x@{@var{option}@}
7420 Accumulate an option for @samp{%X}.
7421
7422 @item %X
7423 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7424 spec string.
7425
7426 @item %Y
7427 Output the accumulated assembler options specified by @option{-Wa}.
7428
7429 @item %Z
7430 Output the accumulated preprocessor options specified by @option{-Wp}.
7431
7432 @item %a
7433 Process the @code{asm} spec.  This is used to compute the
7434 switches to be passed to the assembler.
7435
7436 @item %A
7437 Process the @code{asm_final} spec.  This is a spec string for
7438 passing switches to an assembler post-processor, if such a program is
7439 needed.
7440
7441 @item %l
7442 Process the @code{link} spec.  This is the spec for computing the
7443 command line passed to the linker.  Typically it will make use of the
7444 @samp{%L %G %S %D and %E} sequences.
7445
7446 @item %D
7447 Dump out a @option{-L} option for each directory that GCC believes might
7448 contain startup files.  If the target supports multilibs then the
7449 current multilib directory will be prepended to each of these paths.
7450
7451 @item %L
7452 Process the @code{lib} spec.  This is a spec string for deciding which
7453 libraries should be included on the command line to the linker.
7454
7455 @item %G
7456 Process the @code{libgcc} spec.  This is a spec string for deciding
7457 which GCC support library should be included on the command line to the linker.
7458
7459 @item %S
7460 Process the @code{startfile} spec.  This is a spec for deciding which
7461 object files should be the first ones passed to the linker.  Typically
7462 this might be a file named @file{crt0.o}.
7463
7464 @item %E
7465 Process the @code{endfile} spec.  This is a spec string that specifies
7466 the last object files that will be passed to the linker.
7467
7468 @item %C
7469 Process the @code{cpp} spec.  This is used to construct the arguments
7470 to be passed to the C preprocessor.
7471
7472 @item %1
7473 Process the @code{cc1} spec.  This is used to construct the options to be
7474 passed to the actual C compiler (@samp{cc1}).
7475
7476 @item %2
7477 Process the @code{cc1plus} spec.  This is used to construct the options to be
7478 passed to the actual C++ compiler (@samp{cc1plus}).
7479
7480 @item %*
7481 Substitute the variable part of a matched option.  See below.
7482 Note that each comma in the substituted string is replaced by
7483 a single space.
7484
7485 @item %<@code{S}
7486 Remove all occurrences of @code{-S} from the command line.  Note---this
7487 command is position dependent.  @samp{%} commands in the spec string
7488 before this one will see @code{-S}, @samp{%} commands in the spec string
7489 after this one will not.
7490
7491 @item %:@var{function}(@var{args})
7492 Call the named function @var{function}, passing it @var{args}.
7493 @var{args} is first processed as a nested spec string, then split
7494 into an argument vector in the usual fashion.  The function returns
7495 a string which is processed as if it had appeared literally as part
7496 of the current spec.
7497
7498 The following built-in spec functions are provided:
7499
7500 @table @code
7501 @item @code{getenv}
7502 The @code{getenv} spec function takes two arguments: an environment
7503 variable name and a string.  If the environment variable is not
7504 defined, a fatal error is issued.  Otherwise, the return value is the
7505 value of the environment variable concatenated with the string.  For
7506 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
7507
7508 @smallexample
7509 %:getenv(TOPDIR /include)
7510 @end smallexample
7511
7512 expands to @file{/path/to/top/include}.
7513
7514 @item @code{if-exists}
7515 The @code{if-exists} spec function takes one argument, an absolute
7516 pathname to a file.  If the file exists, @code{if-exists} returns the
7517 pathname.  Here is a small example of its usage:
7518
7519 @smallexample
7520 *startfile:
7521 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7522 @end smallexample
7523
7524 @item @code{if-exists-else}
7525 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7526 spec function, except that it takes two arguments.  The first argument is
7527 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7528 returns the pathname.  If it does not exist, it returns the second argument.
7529 This way, @code{if-exists-else} can be used to select one file or another,
7530 based on the existence of the first.  Here is a small example of its usage:
7531
7532 @smallexample
7533 *startfile:
7534 crt0%O%s %:if-exists(crti%O%s) \
7535 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7536 @end smallexample
7537
7538 @item @code{replace-outfile}
7539 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7540 first argument in the outfiles array and replaces it with the second argument.  Here
7541 is a small example of its usage:
7542
7543 @smallexample
7544 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7545 @end smallexample
7546
7547 @end table
7548
7549 @item %@{@code{S}@}
7550 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7551 If that switch was not specified, this substitutes nothing.  Note that
7552 the leading dash is omitted when specifying this option, and it is
7553 automatically inserted if the substitution is performed.  Thus the spec
7554 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7555 and would output the command line option @option{-foo}.
7556
7557 @item %W@{@code{S}@}
7558 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7559 deleted on failure.
7560
7561 @item %@{@code{S}*@}
7562 Substitutes all the switches specified to GCC whose names start
7563 with @code{-S}, but which also take an argument.  This is used for
7564 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7565 GCC considers @option{-o foo} as being
7566 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7567 text, including the space.  Thus two arguments would be generated.
7568
7569 @item %@{@code{S}*&@code{T}*@}
7570 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7571 (the order of @code{S} and @code{T} in the spec is not significant).
7572 There can be any number of ampersand-separated variables; for each the
7573 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7574
7575 @item %@{@code{S}:@code{X}@}
7576 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7577
7578 @item %@{!@code{S}:@code{X}@}
7579 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7580
7581 @item %@{@code{S}*:@code{X}@}
7582 Substitutes @code{X} if one or more switches whose names start with
7583 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7584 once, no matter how many such switches appeared.  However, if @code{%*}
7585 appears somewhere in @code{X}, then @code{X} will be substituted once
7586 for each matching switch, with the @code{%*} replaced by the part of
7587 that switch that matched the @code{*}.
7588
7589 @item %@{.@code{S}:@code{X}@}
7590 Substitutes @code{X}, if processing a file with suffix @code{S}.
7591
7592 @item %@{!.@code{S}:@code{X}@}
7593 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7594
7595 @item %@{,@code{S}:@code{X}@}
7596 Substitutes @code{X}, if processing a file for language @code{S}.
7597
7598 @item %@{!,@code{S}:@code{X}@}
7599 Substitutes @code{X}, if not processing a file for language @code{S}.
7600
7601 @item %@{@code{S}|@code{P}:@code{X}@}
7602 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
7603 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
7604 @code{*} sequences as well, although they have a stronger binding than
7605 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
7606 alternatives must be starred, and only the first matching alternative
7607 is substituted.
7608
7609 For example, a spec string like this:
7610
7611 @smallexample
7612 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7613 @end smallexample
7614
7615 will output the following command-line options from the following input
7616 command-line options:
7617
7618 @smallexample
7619 fred.c        -foo -baz
7620 jim.d         -bar -boggle
7621 -d fred.c     -foo -baz -boggle
7622 -d jim.d      -bar -baz -boggle
7623 @end smallexample
7624
7625 @item %@{S:X; T:Y; :D@}
7626
7627 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7628 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7629 be as many clauses as you need.  This may be combined with @code{.},
7630 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
7631
7632
7633 @end table
7634
7635 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7636 construct may contain other nested @samp{%} constructs or spaces, or
7637 even newlines.  They are processed as usual, as described above.
7638 Trailing white space in @code{X} is ignored.  White space may also
7639 appear anywhere on the left side of the colon in these constructs,
7640 except between @code{.} or @code{*} and the corresponding word.
7641
7642 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7643 handled specifically in these constructs.  If another value of
7644 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7645 @option{-W} switch is found later in the command line, the earlier
7646 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7647 just one letter, which passes all matching options.
7648
7649 The character @samp{|} at the beginning of the predicate text is used to
7650 indicate that a command should be piped to the following command, but
7651 only if @option{-pipe} is specified.
7652
7653 It is built into GCC which switches take arguments and which do not.
7654 (You might think it would be useful to generalize this to allow each
7655 compiler's spec to say which switches take arguments.  But this cannot
7656 be done in a consistent fashion.  GCC cannot even decide which input
7657 files have been specified without knowing which switches take arguments,
7658 and it must know which input files to compile in order to tell which
7659 compilers to run).
7660
7661 GCC also knows implicitly that arguments starting in @option{-l} are to be
7662 treated as compiler output files, and passed to the linker in their
7663 proper position among the other output files.
7664
7665 @c man begin OPTIONS
7666
7667 @node Target Options
7668 @section Specifying Target Machine and Compiler Version
7669 @cindex target options
7670 @cindex cross compiling
7671 @cindex specifying machine version
7672 @cindex specifying compiler version and target machine
7673 @cindex compiler version, specifying
7674 @cindex target machine, specifying
7675
7676 The usual way to run GCC is to run the executable called @file{gcc}, or
7677 @file{<machine>-gcc} when cross-compiling, or
7678 @file{<machine>-gcc-<version>} to run a version other than the one that
7679 was installed last.  Sometimes this is inconvenient, so GCC provides
7680 options that will switch to another cross-compiler or version.
7681
7682 @table @gcctabopt
7683 @item -b @var{machine}
7684 @opindex b
7685 The argument @var{machine} specifies the target machine for compilation.
7686
7687 The value to use for @var{machine} is the same as was specified as the
7688 machine type when configuring GCC as a cross-compiler.  For
7689 example, if a cross-compiler was configured with @samp{configure
7690 arm-elf}, meaning to compile for an arm processor with elf binaries,
7691 then you would specify @option{-b arm-elf} to run that cross compiler.
7692 Because there are other options beginning with @option{-b}, the
7693 configuration must contain a hyphen. 
7694
7695 @item -V @var{version}
7696 @opindex V
7697 The argument @var{version} specifies which version of GCC to run.
7698 This is useful when multiple versions are installed.  For example,
7699 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7700 @end table
7701
7702 The @option{-V} and @option{-b} options work by running the
7703 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7704 use them if you can just run that directly.
7705
7706 @node Submodel Options
7707 @section Hardware Models and Configurations
7708 @cindex submodel options
7709 @cindex specifying hardware config
7710 @cindex hardware models and configurations, specifying
7711 @cindex machine dependent options
7712
7713 Earlier we discussed the standard option @option{-b} which chooses among
7714 different installed compilers for completely different target
7715 machines, such as VAX vs.@: 68000 vs.@: 80386.
7716
7717 In addition, each of these target machine types can have its own
7718 special options, starting with @samp{-m}, to choose among various
7719 hardware models or configurations---for example, 68010 vs 68020,
7720 floating coprocessor or none.  A single installed version of the
7721 compiler can compile for any model or configuration, according to the
7722 options specified.
7723
7724 Some configurations of the compiler also support additional special
7725 options, usually for compatibility with other compilers on the same
7726 platform.
7727
7728 @c This list is ordered alphanumerically by subsection name.
7729 @c It should be the same order and spelling as these options are listed
7730 @c in Machine Dependent Options
7731
7732 @menu
7733 * ARC Options::
7734 * ARM Options::
7735 * AVR Options::
7736 * Blackfin Options::
7737 * CRIS Options::
7738 * CRX Options::
7739 * Darwin Options::
7740 * DEC Alpha Options::
7741 * DEC Alpha/VMS Options::
7742 * FRV Options::
7743 * GNU/Linux Options::
7744 * H8/300 Options::
7745 * HPPA Options::
7746 * i386 and x86-64 Options::
7747 * IA-64 Options::
7748 * M32C Options::
7749 * M32R/D Options::
7750 * M680x0 Options::
7751 * M68hc1x Options::
7752 * MCore Options::
7753 * MIPS Options::
7754 * MMIX Options::
7755 * MN10300 Options::
7756 * MT Options::
7757 * PDP-11 Options::
7758 * PowerPC Options::
7759 * RS/6000 and PowerPC Options::
7760 * S/390 and zSeries Options::
7761 * Score Options::
7762 * SH Options::
7763 * SPARC Options::
7764 * SPU Options::
7765 * System V Options::
7766 * TMS320C3x/C4x Options::
7767 * V850 Options::
7768 * VAX Options::
7769 * VxWorks Options::
7770 * x86-64 Options::
7771 * Xstormy16 Options::
7772 * Xtensa Options::
7773 * zSeries Options::
7774 @end menu
7775
7776 @node ARC Options
7777 @subsection ARC Options
7778 @cindex ARC Options
7779
7780 These options are defined for ARC implementations:
7781
7782 @table @gcctabopt
7783 @item -EL
7784 @opindex EL
7785 Compile code for little endian mode.  This is the default.
7786
7787 @item -EB
7788 @opindex EB
7789 Compile code for big endian mode.
7790
7791 @item -mmangle-cpu
7792 @opindex mmangle-cpu
7793 Prepend the name of the cpu to all public symbol names.
7794 In multiple-processor systems, there are many ARC variants with different
7795 instruction and register set characteristics.  This flag prevents code
7796 compiled for one cpu to be linked with code compiled for another.
7797 No facility exists for handling variants that are ``almost identical''.
7798 This is an all or nothing option.
7799
7800 @item -mcpu=@var{cpu}
7801 @opindex mcpu
7802 Compile code for ARC variant @var{cpu}.
7803 Which variants are supported depend on the configuration.
7804 All variants support @option{-mcpu=base}, this is the default.
7805
7806 @item -mtext=@var{text-section}
7807 @itemx -mdata=@var{data-section}
7808 @itemx -mrodata=@var{readonly-data-section}
7809 @opindex mtext
7810 @opindex mdata
7811 @opindex mrodata
7812 Put functions, data, and readonly data in @var{text-section},
7813 @var{data-section}, and @var{readonly-data-section} respectively
7814 by default.  This can be overridden with the @code{section} attribute.
7815 @xref{Variable Attributes}.
7816
7817 @end table
7818
7819 @node ARM Options
7820 @subsection ARM Options
7821 @cindex ARM options
7822
7823 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7824 architectures:
7825
7826 @table @gcctabopt
7827 @item -mabi=@var{name}
7828 @opindex mabi
7829 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7830 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
7831
7832 @item -mapcs-frame
7833 @opindex mapcs-frame
7834 Generate a stack frame that is compliant with the ARM Procedure Call
7835 Standard for all functions, even if this is not strictly necessary for
7836 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7837 with this option will cause the stack frames not to be generated for
7838 leaf functions.  The default is @option{-mno-apcs-frame}.
7839
7840 @item -mapcs
7841 @opindex mapcs
7842 This is a synonym for @option{-mapcs-frame}.
7843
7844 @ignore
7845 @c not currently implemented
7846 @item -mapcs-stack-check
7847 @opindex mapcs-stack-check
7848 Generate code to check the amount of stack space available upon entry to
7849 every function (that actually uses some stack space).  If there is
7850 insufficient space available then either the function
7851 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7852 called, depending upon the amount of stack space required.  The run time
7853 system is required to provide these functions.  The default is
7854 @option{-mno-apcs-stack-check}, since this produces smaller code.
7855
7856 @c not currently implemented
7857 @item -mapcs-float
7858 @opindex mapcs-float
7859 Pass floating point arguments using the float point registers.  This is
7860 one of the variants of the APCS@.  This option is recommended if the
7861 target hardware has a floating point unit or if a lot of floating point
7862 arithmetic is going to be performed by the code.  The default is
7863 @option{-mno-apcs-float}, since integer only code is slightly increased in
7864 size if @option{-mapcs-float} is used.
7865
7866 @c not currently implemented
7867 @item -mapcs-reentrant
7868 @opindex mapcs-reentrant
7869 Generate reentrant, position independent code.  The default is
7870 @option{-mno-apcs-reentrant}.
7871 @end ignore
7872
7873 @item -mthumb-interwork
7874 @opindex mthumb-interwork
7875 Generate code which supports calling between the ARM and Thumb
7876 instruction sets.  Without this option the two instruction sets cannot
7877 be reliably used inside one program.  The default is
7878 @option{-mno-thumb-interwork}, since slightly larger code is generated
7879 when @option{-mthumb-interwork} is specified.
7880
7881 @item -mno-sched-prolog
7882 @opindex mno-sched-prolog
7883 Prevent the reordering of instructions in the function prolog, or the
7884 merging of those instruction with the instructions in the function's
7885 body.  This means that all functions will start with a recognizable set
7886 of instructions (or in fact one of a choice from a small set of
7887 different function prologues), and this information can be used to
7888 locate the start if functions inside an executable piece of code.  The
7889 default is @option{-msched-prolog}.
7890
7891 @item -mhard-float
7892 @opindex mhard-float
7893 Generate output containing floating point instructions.  This is the
7894 default.
7895
7896 @item -msoft-float
7897 @opindex msoft-float
7898 Generate output containing library calls for floating point.
7899 @strong{Warning:} the requisite libraries are not available for all ARM
7900 targets.  Normally the facilities of the machine's usual C compiler are
7901 used, but this cannot be done directly in cross-compilation.  You must make
7902 your own arrangements to provide suitable library functions for
7903 cross-compilation.
7904
7905 @option{-msoft-float} changes the calling convention in the output file;
7906 therefore, it is only useful if you compile @emph{all} of a program with
7907 this option.  In particular, you need to compile @file{libgcc.a}, the
7908 library that comes with GCC, with @option{-msoft-float} in order for
7909 this to work.
7910
7911 @item -mfloat-abi=@var{name}
7912 @opindex mfloat-abi
7913 Specifies which ABI to use for floating point values.  Permissible values
7914 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7915
7916 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7917 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7918 of floating point instructions, but still uses the soft-float calling
7919 conventions.
7920
7921 @item -mlittle-endian
7922 @opindex mlittle-endian
7923 Generate code for a processor running in little-endian mode.  This is
7924 the default for all standard configurations.
7925
7926 @item -mbig-endian
7927 @opindex mbig-endian
7928 Generate code for a processor running in big-endian mode; the default is
7929 to compile code for a little-endian processor.
7930
7931 @item -mwords-little-endian
7932 @opindex mwords-little-endian
7933 This option only applies when generating code for big-endian processors.
7934 Generate code for a little-endian word order but a big-endian byte
7935 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7936 option should only be used if you require compatibility with code for
7937 big-endian ARM processors generated by versions of the compiler prior to
7938 2.8.
7939
7940 @item -mcpu=@var{name}
7941 @opindex mcpu
7942 This specifies the name of the target ARM processor.  GCC uses this name
7943 to determine what kind of instructions it can emit when generating
7944 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7945 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7946 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7947 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7948 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7949 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7950 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7951 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7952 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7953 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7954 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7955 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7956 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7957 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
7958 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
7959 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
7960
7961 @itemx -mtune=@var{name}
7962 @opindex mtune
7963 This option is very similar to the @option{-mcpu=} option, except that
7964 instead of specifying the actual target processor type, and hence
7965 restricting which instructions can be used, it specifies that GCC should
7966 tune the performance of the code as if the target were of the type
7967 specified in this option, but still choosing the instructions that it
7968 will generate based on the cpu specified by a @option{-mcpu=} option.
7969 For some ARM implementations better performance can be obtained by using
7970 this option.
7971
7972 @item -march=@var{name}
7973 @opindex march
7974 This specifies the name of the target ARM architecture.  GCC uses this
7975 name to determine what kind of instructions it can emit when generating
7976 assembly code.  This option can be used in conjunction with or instead
7977 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
7978 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
7979 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
7980 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a},
7981 @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{ep9312}.
7982
7983 @item -mfpu=@var{name}
7984 @itemx -mfpe=@var{number}
7985 @itemx -mfp=@var{number}
7986 @opindex mfpu
7987 @opindex mfpe
7988 @opindex mfp
7989 This specifies what floating point hardware (or hardware emulation) is
7990 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
7991 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
7992 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
7993 with older versions of GCC@.
7994
7995 If @option{-msoft-float} is specified this specifies the format of
7996 floating point values.
7997
7998 @item -mstructure-size-boundary=@var{n}
7999 @opindex mstructure-size-boundary
8000 The size of all structures and unions will be rounded up to a multiple
8001 of the number of bits set by this option.  Permissible values are 8, 32
8002 and 64.  The default value varies for different toolchains.  For the COFF
8003 targeted toolchain the default value is 8.  A value of 64 is only allowed
8004 if the underlying ABI supports it.
8005
8006 Specifying the larger number can produce faster, more efficient code, but
8007 can also increase the size of the program.  Different values are potentially
8008 incompatible.  Code compiled with one value cannot necessarily expect to
8009 work with code or libraries compiled with another value, if they exchange
8010 information using structures or unions.
8011
8012 @item -mabort-on-noreturn
8013 @opindex mabort-on-noreturn
8014 Generate a call to the function @code{abort} at the end of a
8015 @code{noreturn} function.  It will be executed if the function tries to
8016 return.
8017
8018 @item -mlong-calls
8019 @itemx -mno-long-calls
8020 @opindex mlong-calls
8021 @opindex mno-long-calls
8022 Tells the compiler to perform function calls by first loading the
8023 address of the function into a register and then performing a subroutine
8024 call on this register.  This switch is needed if the target function
8025 will lie outside of the 64 megabyte addressing range of the offset based
8026 version of subroutine call instruction.
8027
8028 Even if this switch is enabled, not all function calls will be turned
8029 into long calls.  The heuristic is that static functions, functions
8030 which have the @samp{short-call} attribute, functions that are inside
8031 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8032 definitions have already been compiled within the current compilation
8033 unit, will not be turned into long calls.  The exception to this rule is
8034 that weak function definitions, functions with the @samp{long-call}
8035 attribute or the @samp{section} attribute, and functions that are within
8036 the scope of a @samp{#pragma long_calls} directive, will always be
8037 turned into long calls.
8038
8039 This feature is not enabled by default.  Specifying
8040 @option{-mno-long-calls} will restore the default behavior, as will
8041 placing the function calls within the scope of a @samp{#pragma
8042 long_calls_off} directive.  Note these switches have no effect on how
8043 the compiler generates code to handle function calls via function
8044 pointers.
8045
8046 @item -mnop-fun-dllimport
8047 @opindex mnop-fun-dllimport
8048 Disable support for the @code{dllimport} attribute.
8049
8050 @item -msingle-pic-base
8051 @opindex msingle-pic-base
8052 Treat the register used for PIC addressing as read-only, rather than
8053 loading it in the prologue for each function.  The run-time system is
8054 responsible for initializing this register with an appropriate value
8055 before execution begins.
8056
8057 @item -mpic-register=@var{reg}
8058 @opindex mpic-register
8059 Specify the register to be used for PIC addressing.  The default is R10
8060 unless stack-checking is enabled, when R9 is used.
8061
8062 @item -mcirrus-fix-invalid-insns
8063 @opindex mcirrus-fix-invalid-insns
8064 @opindex mno-cirrus-fix-invalid-insns
8065 Insert NOPs into the instruction stream to in order to work around
8066 problems with invalid Maverick instruction combinations.  This option
8067 is only valid if the @option{-mcpu=ep9312} option has been used to
8068 enable generation of instructions for the Cirrus Maverick floating
8069 point co-processor.  This option is not enabled by default, since the
8070 problem is only present in older Maverick implementations.  The default
8071 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8072 switch.
8073
8074 @item -mpoke-function-name
8075 @opindex mpoke-function-name
8076 Write the name of each function into the text section, directly
8077 preceding the function prologue.  The generated code is similar to this:
8078
8079 @smallexample
8080      t0
8081          .ascii "arm_poke_function_name", 0
8082          .align
8083      t1
8084          .word 0xff000000 + (t1 - t0)
8085      arm_poke_function_name
8086          mov     ip, sp
8087          stmfd   sp!, @{fp, ip, lr, pc@}
8088          sub     fp, ip, #4
8089 @end smallexample
8090
8091 When performing a stack backtrace, code can inspect the value of
8092 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8093 location @code{pc - 12} and the top 8 bits are set, then we know that
8094 there is a function name embedded immediately preceding this location
8095 and has length @code{((pc[-3]) & 0xff000000)}.
8096
8097 @item -mthumb
8098 @opindex mthumb
8099 Generate code for the Thumb instruction set.  The default is to
8100 use the 32-bit ARM instruction set.
8101 This option automatically enables either 16-bit Thumb-1 or
8102 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8103 and @option{-march=@var{name}} options.
8104
8105 @item -mtpcs-frame
8106 @opindex mtpcs-frame
8107 Generate a stack frame that is compliant with the Thumb Procedure Call
8108 Standard for all non-leaf functions.  (A leaf function is one that does
8109 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8110
8111 @item -mtpcs-leaf-frame
8112 @opindex mtpcs-leaf-frame
8113 Generate a stack frame that is compliant with the Thumb Procedure Call
8114 Standard for all leaf functions.  (A leaf function is one that does
8115 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8116
8117 @item -mcallee-super-interworking
8118 @opindex mcallee-super-interworking
8119 Gives all externally visible functions in the file being compiled an ARM
8120 instruction set header which switches to Thumb mode before executing the
8121 rest of the function.  This allows these functions to be called from
8122 non-interworking code.
8123
8124 @item -mcaller-super-interworking
8125 @opindex mcaller-super-interworking
8126 Allows calls via function pointers (including virtual functions) to
8127 execute correctly regardless of whether the target code has been
8128 compiled for interworking or not.  There is a small overhead in the cost
8129 of executing a function pointer if this option is enabled.
8130
8131 @item -mtp=@var{name}
8132 @opindex mtp
8133 Specify the access model for the thread local storage pointer.  The valid
8134 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8135 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8136 (supported in the arm6k architecture), and @option{auto}, which uses the
8137 best available method for the selected processor.  The default setting is
8138 @option{auto}.
8139
8140 @end table
8141
8142 @node AVR Options
8143 @subsection AVR Options
8144 @cindex AVR Options
8145
8146 These options are defined for AVR implementations:
8147
8148 @table @gcctabopt
8149 @item -mmcu=@var{mcu}
8150 @opindex mmcu
8151 Specify ATMEL AVR instruction set or MCU type.
8152
8153 Instruction set avr1 is for the minimal AVR core, not supported by the C
8154 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8155 attiny11, attiny12, attiny15, attiny28).
8156
8157 Instruction set avr2 (default) is for the classic AVR core with up to
8158 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8159 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8160 at90c8534, at90s8535).
8161
8162 Instruction set avr3 is for the classic AVR core with up to 128K program
8163 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8164
8165 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8166 memory space (MCU types: atmega8, atmega83, atmega85).
8167
8168 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8169 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8170 atmega64, atmega128, at43usb355, at94k).
8171
8172 @item -msize
8173 @opindex msize
8174 Output instruction sizes to the asm file.
8175
8176 @item -minit-stack=@var{N}
8177 @opindex minit-stack
8178 Specify the initial stack address, which may be a symbol or numeric value,
8179 @samp{__stack} is the default.
8180
8181 @item -mno-interrupts
8182 @opindex mno-interrupts
8183 Generated code is not compatible with hardware interrupts.
8184 Code size will be smaller.
8185
8186 @item -mcall-prologues
8187 @opindex mcall-prologues
8188 Functions prologues/epilogues expanded as call to appropriate
8189 subroutines.  Code size will be smaller.
8190
8191 @item -mno-tablejump
8192 @opindex mno-tablejump
8193 Do not generate tablejump insns which sometimes increase code size.
8194
8195 @item -mtiny-stack
8196 @opindex mtiny-stack
8197 Change only the low 8 bits of the stack pointer.
8198
8199 @item -mint8
8200 @opindex mint8
8201 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8202 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8203 and long long will be 4 bytes.  Please note that this option does not
8204 comply to the C standards, but it will provide you with smaller code
8205 size.
8206 @end table
8207
8208 @node Blackfin Options
8209 @subsection Blackfin Options
8210 @cindex Blackfin Options
8211
8212 @table @gcctabopt
8213 @item -momit-leaf-frame-pointer
8214 @opindex momit-leaf-frame-pointer
8215 Don't keep the frame pointer in a register for leaf functions.  This
8216 avoids the instructions to save, set up and restore frame pointers and
8217 makes an extra register available in leaf functions.  The option
8218 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8219 which might make debugging harder.
8220
8221 @item -mspecld-anomaly
8222 @opindex mspecld-anomaly
8223 When enabled, the compiler will ensure that the generated code does not
8224 contain speculative loads after jump instructions.  This option is enabled
8225 by default.
8226
8227 @item -mno-specld-anomaly
8228 @opindex mno-specld-anomaly
8229 Don't generate extra code to prevent speculative loads from occurring.
8230
8231 @item -mcsync-anomaly
8232 @opindex mcsync-anomaly
8233 When enabled, the compiler will ensure that the generated code does not
8234 contain CSYNC or SSYNC instructions too soon after conditional branches.
8235 This option is enabled by default.
8236
8237 @item -mno-csync-anomaly
8238 @opindex mno-csync-anomaly
8239 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8240 occurring too soon after a conditional branch.
8241
8242 @item -mlow-64k
8243 @opindex mlow-64k
8244 When enabled, the compiler is free to take advantage of the knowledge that
8245 the entire program fits into the low 64k of memory.
8246
8247 @item -mno-low-64k
8248 @opindex mno-low-64k
8249 Assume that the program is arbitrarily large.  This is the default.
8250
8251 @item -mstack-check-l1
8252 @opindex mstack-check-l1
8253 Do stack checking using information placed into L1 scratchpad memory by the
8254 uClinux kernel.
8255
8256 @item -mid-shared-library
8257 @opindex mid-shared-library
8258 Generate code that supports shared libraries via the library ID method.
8259 This allows for execute in place and shared libraries in an environment
8260 without virtual memory management.  This option implies @option{-fPIC}.
8261
8262 @item -mno-id-shared-library
8263 @opindex mno-id-shared-library
8264 Generate code that doesn't assume ID based shared libraries are being used.
8265 This is the default.
8266
8267 @item -mleaf-id-shared-library
8268 @opindex mleaf-id-shared-library
8269 Generate code that supports shared libraries via the library ID method,
8270 but assumes that this library or executable won't link against any other
8271 ID shared libraries.  That allows the compiler to use faster code for jumps
8272 and calls.
8273
8274 @item -mno-leaf-id-shared-library
8275 @opindex mno-leaf-id-shared-library
8276 Do not assume that the code being compiled won't link against any ID shared
8277 libraries.  Slower code will be generated for jump and call insns.
8278
8279 @item -mshared-library-id=n
8280 @opindex mshared-library-id
8281 Specified the identification number of the ID based shared library being
8282 compiled.  Specifying a value of 0 will generate more compact code, specifying
8283 other values will force the allocation of that number to the current
8284 library but is no more space or time efficient than omitting this option.
8285
8286 @item -msep-data
8287 @opindex msep-data
8288 Generate code that allows the data segment to be located in a different
8289 area of memory from the text segment.  This allows for execute in place in
8290 an environment without virtual memory management by eliminating relocations
8291 against the text section.
8292
8293 @item -mno-sep-data
8294 @opindex mno-sep-data
8295 Generate code that assumes that the data segment follows the text segment.
8296 This is the default.
8297
8298 @item -mlong-calls
8299 @itemx -mno-long-calls
8300 @opindex mlong-calls
8301 @opindex mno-long-calls
8302 Tells the compiler to perform function calls by first loading the
8303 address of the function into a register and then performing a subroutine
8304 call on this register.  This switch is needed if the target function
8305 will lie outside of the 24 bit addressing range of the offset based
8306 version of subroutine call instruction.
8307
8308 This feature is not enabled by default.  Specifying
8309 @option{-mno-long-calls} will restore the default behavior.  Note these
8310 switches have no effect on how the compiler generates code to handle
8311 function calls via function pointers.
8312 @end table
8313
8314 @node CRIS Options
8315 @subsection CRIS Options
8316 @cindex CRIS Options
8317
8318 These options are defined specifically for the CRIS ports.
8319
8320 @table @gcctabopt
8321 @item -march=@var{architecture-type}
8322 @itemx -mcpu=@var{architecture-type}
8323 @opindex march
8324 @opindex mcpu
8325 Generate code for the specified architecture.  The choices for
8326 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8327 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8328 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8329 @samp{v10}.
8330
8331 @item -mtune=@var{architecture-type}
8332 @opindex mtune
8333 Tune to @var{architecture-type} everything applicable about the generated
8334 code, except for the ABI and the set of available instructions.  The
8335 choices for @var{architecture-type} are the same as for
8336 @option{-march=@var{architecture-type}}.
8337
8338 @item -mmax-stack-frame=@var{n}
8339 @opindex mmax-stack-frame
8340 Warn when the stack frame of a function exceeds @var{n} bytes.
8341
8342 @item -melinux-stacksize=@var{n}
8343 @opindex melinux-stacksize
8344 Only available with the @samp{cris-axis-aout} target.  Arranges for
8345 indications in the program to the kernel loader that the stack of the
8346 program should be set to @var{n} bytes.
8347
8348 @item -metrax4
8349 @itemx -metrax100
8350 @opindex metrax4
8351 @opindex metrax100
8352 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8353 @option{-march=v3} and @option{-march=v8} respectively.
8354
8355 @item -mmul-bug-workaround
8356 @itemx -mno-mul-bug-workaround
8357 @opindex mmul-bug-workaround
8358 @opindex mno-mul-bug-workaround
8359 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8360 models where it applies.  This option is active by default.
8361
8362 @item -mpdebug
8363 @opindex mpdebug
8364 Enable CRIS-specific verbose debug-related information in the assembly
8365 code.  This option also has the effect to turn off the @samp{#NO_APP}
8366 formatted-code indicator to the assembler at the beginning of the
8367 assembly file.
8368
8369 @item -mcc-init
8370 @opindex mcc-init
8371 Do not use condition-code results from previous instruction; always emit
8372 compare and test instructions before use of condition codes.
8373
8374 @item -mno-side-effects
8375 @opindex mno-side-effects
8376 Do not emit instructions with side-effects in addressing modes other than
8377 post-increment.
8378
8379 @item -mstack-align
8380 @itemx -mno-stack-align
8381 @itemx -mdata-align
8382 @itemx -mno-data-align
8383 @itemx -mconst-align
8384 @itemx -mno-const-align
8385 @opindex mstack-align
8386 @opindex mno-stack-align
8387 @opindex mdata-align
8388 @opindex mno-data-align
8389 @opindex mconst-align
8390 @opindex mno-const-align
8391 These options (no-options) arranges (eliminate arrangements) for the
8392 stack-frame, individual data and constants to be aligned for the maximum
8393 single data access size for the chosen CPU model.  The default is to
8394 arrange for 32-bit alignment.  ABI details such as structure layout are
8395 not affected by these options.
8396
8397 @item -m32-bit
8398 @itemx -m16-bit
8399 @itemx -m8-bit
8400 @opindex m32-bit
8401 @opindex m16-bit
8402 @opindex m8-bit
8403 Similar to the stack- data- and const-align options above, these options
8404 arrange for stack-frame, writable data and constants to all be 32-bit,
8405 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8406
8407 @item -mno-prologue-epilogue
8408 @itemx -mprologue-epilogue
8409 @opindex mno-prologue-epilogue
8410 @opindex mprologue-epilogue
8411 With @option{-mno-prologue-epilogue}, the normal function prologue and
8412 epilogue that sets up the stack-frame are omitted and no return
8413 instructions or return sequences are generated in the code.  Use this
8414 option only together with visual inspection of the compiled code: no
8415 warnings or errors are generated when call-saved registers must be saved,
8416 or storage for local variable needs to be allocated.
8417
8418 @item -mno-gotplt
8419 @itemx -mgotplt
8420 @opindex mno-gotplt
8421 @opindex mgotplt
8422 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8423 instruction sequences that load addresses for functions from the PLT part
8424 of the GOT rather than (traditional on other architectures) calls to the
8425 PLT@.  The default is @option{-mgotplt}.
8426
8427 @item -maout
8428 @opindex maout
8429 Legacy no-op option only recognized with the cris-axis-aout target.
8430
8431 @item -melf
8432 @opindex melf
8433 Legacy no-op option only recognized with the cris-axis-elf and
8434 cris-axis-linux-gnu targets.
8435
8436 @item -melinux
8437 @opindex melinux
8438 Only recognized with the cris-axis-aout target, where it selects a
8439 GNU/linux-like multilib, include files and instruction set for
8440 @option{-march=v8}.
8441
8442 @item -mlinux
8443 @opindex mlinux
8444 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8445
8446 @item -sim
8447 @opindex sim
8448 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8449 to link with input-output functions from a simulator library.  Code,
8450 initialized data and zero-initialized data are allocated consecutively.
8451
8452 @item -sim2
8453 @opindex sim2
8454 Like @option{-sim}, but pass linker options to locate initialized data at
8455 0x40000000 and zero-initialized data at 0x80000000.
8456 @end table
8457
8458 @node CRX Options
8459 @subsection CRX Options
8460 @cindex CRX Options
8461
8462 These options are defined specifically for the CRX ports.
8463
8464 @table @gcctabopt
8465
8466 @item -mmac
8467 @opindex mmac
8468 Enable the use of multiply-accumulate instructions. Disabled by default.
8469
8470 @item -mpush-args
8471 @opindex mpush-args
8472 Push instructions will be used to pass outgoing arguments when functions
8473 are called. Enabled by default.
8474 @end table
8475
8476 @node Darwin Options
8477 @subsection Darwin Options
8478 @cindex Darwin options
8479
8480 These options are defined for all architectures running the Darwin operating
8481 system.
8482
8483 FSF GCC on Darwin does not create ``fat'' object files; it will create
8484 an object file for the single architecture that it was built to
8485 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8486 @option{-arch} options are used; it does so by running the compiler or
8487 linker multiple times and joining the results together with
8488 @file{lipo}.
8489
8490 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8491 @samp{i686}) is determined by the flags that specify the ISA
8492 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8493 @option{-force_cpusubtype_ALL} option can be used to override this.
8494
8495 The Darwin tools vary in their behavior when presented with an ISA
8496 mismatch.  The assembler, @file{as}, will only permit instructions to
8497 be used that are valid for the subtype of the file it is generating,
8498 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8499 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8500 and print an error if asked to create a shared library with a less
8501 restrictive subtype than its input files (for instance, trying to put
8502 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8503 for executables, @file{ld}, will quietly give the executable the most
8504 restrictive subtype of any of its input files.
8505
8506 @table @gcctabopt
8507 @item -F@var{dir}
8508 @opindex F
8509 Add the framework directory @var{dir} to the head of the list of
8510 directories to be searched for header files.  These directories are
8511 interleaved with those specified by @option{-I} options and are
8512 scanned in a left-to-right order.
8513
8514 A framework directory is a directory with frameworks in it.  A
8515 framework is a directory with a @samp{"Headers"} and/or
8516 @samp{"PrivateHeaders"} directory contained directly in it that ends
8517 in @samp{".framework"}.  The name of a framework is the name of this
8518 directory excluding the @samp{".framework"}.  Headers associated with
8519 the framework are found in one of those two directories, with
8520 @samp{"Headers"} being searched first.  A subframework is a framework
8521 directory that is in a framework's @samp{"Frameworks"} directory.
8522 Includes of subframework headers can only appear in a header of a
8523 framework that contains the subframework, or in a sibling subframework
8524 header.  Two subframeworks are siblings if they occur in the same
8525 framework.  A subframework should not have the same name as a
8526 framework, a warning will be issued if this is violated.  Currently a
8527 subframework cannot have subframeworks, in the future, the mechanism
8528 may be extended to support this.  The standard frameworks can be found
8529 in @samp{"/System/Library/Frameworks"} and
8530 @samp{"/Library/Frameworks"}.  An example include looks like
8531 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8532 the name of the framework and header.h is found in the
8533 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8534
8535 @item -iframework@var{dir}
8536 @opindex iframework
8537 Like @option{-F} except the directory is a treated as a system
8538 directory.  The main difference between this @option{-iframework} and
8539 @option{-F} is that with @option{-iframework} the compiler does not
8540 warn about constructs contained within header files found via
8541 @var{dir}.  This option is valid only for the C family of languages.
8542
8543 @item -gused
8544 @opindex -gused
8545 Emit debugging information for symbols that are used.  For STABS
8546 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8547 This is by default ON@.
8548
8549 @item -gfull
8550 @opindex -gfull
8551 Emit debugging information for all symbols and types.
8552
8553 @item -mmacosx-version-min=@var{version}
8554 The earliest version of MacOS X that this executable will run on
8555 is @var{version}.  Typical values of @var{version} include @code{10.1},
8556 @code{10.2}, and @code{10.3.9}.
8557
8558 The default for this option is to make choices that seem to be most
8559 useful.  
8560
8561 @item -mkernel
8562 @opindex mkernel
8563 Enable kernel development mode.  The @option{-mkernel} option sets
8564 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8565 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8566 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8567 applicable.  This mode also sets @option{-mno-altivec},
8568 @option{-msoft-float}, @option{-fno-builtin} and
8569 @option{-mlong-branch} for PowerPC targets.
8570
8571 @item -mone-byte-bool
8572 @opindex -mone-byte-bool
8573 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8574 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8575 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8576 option has no effect on x86.
8577
8578 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8579 to generate code that is not binary compatible with code generated
8580 without that switch.  Using this switch may require recompiling all
8581 other modules in a program, including system libraries.  Use this
8582 switch to conform to a non-default data model.
8583
8584 @item -mfix-and-continue
8585 @itemx -ffix-and-continue
8586 @itemx -findirect-data
8587 @opindex mfix-and-continue
8588 @opindex ffix-and-continue
8589 @opindex findirect-data
8590 Generate code suitable for fast turn around development.  Needed to
8591 enable gdb to dynamically load @code{.o} files into already running
8592 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8593 are provided for backwards compatibility.
8594
8595 @item -all_load
8596 @opindex all_load
8597 Loads all members of static archive libraries.
8598 See man ld(1) for more information.
8599
8600 @item -arch_errors_fatal
8601 @opindex arch_errors_fatal
8602 Cause the errors having to do with files that have the wrong architecture
8603 to be fatal.
8604
8605 @item -bind_at_load
8606 @opindex bind_at_load
8607 Causes the output file to be marked such that the dynamic linker will
8608 bind all undefined references when the file is loaded or launched.
8609
8610 @item -bundle
8611 @opindex bundle
8612 Produce a Mach-o bundle format file.
8613 See man ld(1) for more information.
8614
8615 @item -bundle_loader @var{executable}
8616 @opindex bundle_loader
8617 This option specifies the @var{executable} that will be loading the build
8618 output file being linked.  See man ld(1) for more information.
8619
8620 @item -dynamiclib
8621 @opindex -dynamiclib
8622 When passed this option, GCC will produce a dynamic library instead of
8623 an executable when linking, using the Darwin @file{libtool} command.
8624
8625 @item -force_cpusubtype_ALL
8626 @opindex -force_cpusubtype_ALL
8627 This causes GCC's output file to have the @var{ALL} subtype, instead of
8628 one controlled by the @option{-mcpu} or @option{-march} option.
8629
8630 @item -allowable_client  @var{client_name}
8631 @itemx -client_name
8632 @itemx -compatibility_version
8633 @itemx -current_version
8634 @itemx -dead_strip
8635 @itemx -dependency-file
8636 @itemx -dylib_file
8637 @itemx -dylinker_install_name
8638 @itemx -dynamic
8639 @itemx -exported_symbols_list
8640 @itemx -filelist
8641 @itemx -flat_namespace
8642 @itemx -force_flat_namespace
8643 @itemx -headerpad_max_install_names
8644 @itemx -image_base
8645 @itemx -init
8646 @itemx -install_name
8647 @itemx -keep_private_externs
8648 @itemx -multi_module
8649 @itemx -multiply_defined
8650 @itemx -multiply_defined_unused
8651 @itemx -noall_load
8652 @itemx -no_dead_strip_inits_and_terms
8653 @itemx -nofixprebinding
8654 @itemx -nomultidefs
8655 @itemx -noprebind
8656 @itemx -noseglinkedit
8657 @itemx -pagezero_size
8658 @itemx -prebind
8659 @itemx -prebind_all_twolevel_modules
8660 @itemx -private_bundle
8661 @itemx -read_only_relocs
8662 @itemx -sectalign
8663 @itemx -sectobjectsymbols
8664 @itemx -whyload
8665 @itemx -seg1addr
8666 @itemx -sectcreate
8667 @itemx -sectobjectsymbols
8668 @itemx -sectorder
8669 @itemx -segaddr
8670 @itemx -segs_read_only_addr
8671 @itemx -segs_read_write_addr
8672 @itemx -seg_addr_table
8673 @itemx -seg_addr_table_filename
8674 @itemx -seglinkedit
8675 @itemx -segprot
8676 @itemx -segs_read_only_addr
8677 @itemx -segs_read_write_addr
8678 @itemx -single_module
8679 @itemx -static
8680 @itemx -sub_library
8681 @itemx -sub_umbrella
8682 @itemx -twolevel_namespace
8683 @itemx -umbrella
8684 @itemx -undefined
8685 @itemx -unexported_symbols_list
8686 @itemx -weak_reference_mismatches
8687 @itemx -whatsloaded
8688
8689 @opindex allowable_client
8690 @opindex client_name
8691 @opindex compatibility_version
8692 @opindex current_version
8693 @opindex dead_strip
8694 @opindex dependency-file
8695 @opindex dylib_file
8696 @opindex dylinker_install_name
8697 @opindex dynamic
8698 @opindex exported_symbols_list
8699 @opindex filelist
8700 @opindex flat_namespace
8701 @opindex force_flat_namespace
8702 @opindex headerpad_max_install_names
8703 @opindex image_base
8704 @opindex init
8705 @opindex install_name
8706 @opindex keep_private_externs
8707 @opindex multi_module
8708 @opindex multiply_defined
8709 @opindex multiply_defined_unused
8710 @opindex noall_load
8711 @opindex no_dead_strip_inits_and_terms
8712 @opindex nofixprebinding
8713 @opindex nomultidefs
8714 @opindex noprebind
8715 @opindex noseglinkedit
8716 @opindex pagezero_size
8717 @opindex prebind
8718 @opindex prebind_all_twolevel_modules
8719 @opindex private_bundle
8720 @opindex read_only_relocs
8721 @opindex sectalign
8722 @opindex sectobjectsymbols
8723 @opindex whyload
8724 @opindex seg1addr
8725 @opindex sectcreate
8726 @opindex sectobjectsymbols
8727 @opindex sectorder
8728 @opindex segaddr
8729 @opindex segs_read_only_addr
8730 @opindex segs_read_write_addr
8731 @opindex seg_addr_table
8732 @opindex seg_addr_table_filename
8733 @opindex seglinkedit
8734 @opindex segprot
8735 @opindex segs_read_only_addr
8736 @opindex segs_read_write_addr
8737 @opindex single_module
8738 @opindex static
8739 @opindex sub_library
8740 @opindex sub_umbrella
8741 @opindex twolevel_namespace
8742 @opindex umbrella
8743 @opindex undefined
8744 @opindex unexported_symbols_list
8745 @opindex weak_reference_mismatches
8746 @opindex whatsloaded
8747
8748 These options are passed to the Darwin linker.  The Darwin linker man page
8749 describes them in detail.
8750 @end table
8751
8752 @node DEC Alpha Options
8753 @subsection DEC Alpha Options
8754
8755 These @samp{-m} options are defined for the DEC Alpha implementations:
8756
8757 @table @gcctabopt
8758 @item -mno-soft-float
8759 @itemx -msoft-float
8760 @opindex mno-soft-float
8761 @opindex msoft-float
8762 Use (do not use) the hardware floating-point instructions for
8763 floating-point operations.  When @option{-msoft-float} is specified,
8764 functions in @file{libgcc.a} will be used to perform floating-point
8765 operations.  Unless they are replaced by routines that emulate the
8766 floating-point operations, or compiled in such a way as to call such
8767 emulations routines, these routines will issue floating-point
8768 operations.   If you are compiling for an Alpha without floating-point
8769 operations, you must ensure that the library is built so as not to call
8770 them.
8771
8772 Note that Alpha implementations without floating-point operations are
8773 required to have floating-point registers.
8774
8775 @item -mfp-reg
8776 @itemx -mno-fp-regs
8777 @opindex mfp-reg
8778 @opindex mno-fp-regs
8779 Generate code that uses (does not use) the floating-point register set.
8780 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8781 register set is not used, floating point operands are passed in integer
8782 registers as if they were integers and floating-point results are passed
8783 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8784 so any function with a floating-point argument or return value called by code
8785 compiled with @option{-mno-fp-regs} must also be compiled with that
8786 option.
8787
8788 A typical use of this option is building a kernel that does not use,
8789 and hence need not save and restore, any floating-point registers.
8790
8791 @item -mieee
8792 @opindex mieee
8793 The Alpha architecture implements floating-point hardware optimized for
8794 maximum performance.  It is mostly compliant with the IEEE floating
8795 point standard.  However, for full compliance, software assistance is
8796 required.  This option generates code fully IEEE compliant code
8797 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8798 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8799 defined during compilation.  The resulting code is less efficient but is
8800 able to correctly support denormalized numbers and exceptional IEEE
8801 values such as not-a-number and plus/minus infinity.  Other Alpha
8802 compilers call this option @option{-ieee_with_no_inexact}.
8803
8804 @item -mieee-with-inexact
8805 @opindex mieee-with-inexact
8806 This is like @option{-mieee} except the generated code also maintains
8807 the IEEE @var{inexact-flag}.  Turning on this option causes the
8808 generated code to implement fully-compliant IEEE math.  In addition to
8809 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8810 macro.  On some Alpha implementations the resulting code may execute
8811 significantly slower than the code generated by default.  Since there is
8812 very little code that depends on the @var{inexact-flag}, you should
8813 normally not specify this option.  Other Alpha compilers call this
8814 option @option{-ieee_with_inexact}.
8815
8816 @item -mfp-trap-mode=@var{trap-mode}
8817 @opindex mfp-trap-mode
8818 This option controls what floating-point related traps are enabled.
8819 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8820 The trap mode can be set to one of four values:
8821
8822 @table @samp
8823 @item n
8824 This is the default (normal) setting.  The only traps that are enabled
8825 are the ones that cannot be disabled in software (e.g., division by zero
8826 trap).
8827
8828 @item u
8829 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8830 as well.
8831
8832 @item su
8833 Like @samp{u}, but the instructions are marked to be safe for software
8834 completion (see Alpha architecture manual for details).
8835
8836 @item sui
8837 Like @samp{su}, but inexact traps are enabled as well.
8838 @end table
8839
8840 @item -mfp-rounding-mode=@var{rounding-mode}
8841 @opindex mfp-rounding-mode
8842 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8843 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8844 of:
8845
8846 @table @samp
8847 @item n
8848 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8849 the nearest machine number or towards the even machine number in case
8850 of a tie.
8851
8852 @item m
8853 Round towards minus infinity.
8854
8855 @item c
8856 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8857
8858 @item d
8859 Dynamic rounding mode.  A field in the floating point control register
8860 (@var{fpcr}, see Alpha architecture reference manual) controls the
8861 rounding mode in effect.  The C library initializes this register for
8862 rounding towards plus infinity.  Thus, unless your program modifies the
8863 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8864 @end table
8865
8866 @item -mtrap-precision=@var{trap-precision}
8867 @opindex mtrap-precision
8868 In the Alpha architecture, floating point traps are imprecise.  This
8869 means without software assistance it is impossible to recover from a
8870 floating trap and program execution normally needs to be terminated.
8871 GCC can generate code that can assist operating system trap handlers
8872 in determining the exact location that caused a floating point trap.
8873 Depending on the requirements of an application, different levels of
8874 precisions can be selected:
8875
8876 @table @samp
8877 @item p
8878 Program precision.  This option is the default and means a trap handler
8879 can only identify which program caused a floating point exception.
8880
8881 @item f
8882 Function precision.  The trap handler can determine the function that
8883 caused a floating point exception.
8884
8885 @item i
8886 Instruction precision.  The trap handler can determine the exact
8887 instruction that caused a floating point exception.
8888 @end table
8889
8890 Other Alpha compilers provide the equivalent options called
8891 @option{-scope_safe} and @option{-resumption_safe}.
8892
8893 @item -mieee-conformant
8894 @opindex mieee-conformant
8895 This option marks the generated code as IEEE conformant.  You must not
8896 use this option unless you also specify @option{-mtrap-precision=i} and either
8897 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8898 is to emit the line @samp{.eflag 48} in the function prologue of the
8899 generated assembly file.  Under DEC Unix, this has the effect that
8900 IEEE-conformant math library routines will be linked in.
8901
8902 @item -mbuild-constants
8903 @opindex mbuild-constants
8904 Normally GCC examines a 32- or 64-bit integer constant to
8905 see if it can construct it from smaller constants in two or three
8906 instructions.  If it cannot, it will output the constant as a literal and
8907 generate code to load it from the data segment at runtime.
8908
8909 Use this option to require GCC to construct @emph{all} integer constants
8910 using code, even if it takes more instructions (the maximum is six).
8911
8912 You would typically use this option to build a shared library dynamic
8913 loader.  Itself a shared library, it must relocate itself in memory
8914 before it can find the variables and constants in its own data segment.
8915
8916 @item -malpha-as
8917 @itemx -mgas
8918 @opindex malpha-as
8919 @opindex mgas
8920 Select whether to generate code to be assembled by the vendor-supplied
8921 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8922
8923 @item -mbwx
8924 @itemx -mno-bwx
8925 @itemx -mcix
8926 @itemx -mno-cix
8927 @itemx -mfix
8928 @itemx -mno-fix
8929 @itemx -mmax
8930 @itemx -mno-max
8931 @opindex mbwx
8932 @opindex mno-bwx
8933 @opindex mcix
8934 @opindex mno-cix
8935 @opindex mfix
8936 @opindex mno-fix
8937 @opindex mmax
8938 @opindex mno-max
8939 Indicate whether GCC should generate code to use the optional BWX,
8940 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8941 sets supported by the CPU type specified via @option{-mcpu=} option or that
8942 of the CPU on which GCC was built if none was specified.
8943
8944 @item -mfloat-vax
8945 @itemx -mfloat-ieee
8946 @opindex mfloat-vax
8947 @opindex mfloat-ieee
8948 Generate code that uses (does not use) VAX F and G floating point
8949 arithmetic instead of IEEE single and double precision.
8950
8951 @item -mexplicit-relocs
8952 @itemx -mno-explicit-relocs
8953 @opindex mexplicit-relocs
8954 @opindex mno-explicit-relocs
8955 Older Alpha assemblers provided no way to generate symbol relocations
8956 except via assembler macros.  Use of these macros does not allow
8957 optimal instruction scheduling.  GNU binutils as of version 2.12
8958 supports a new syntax that allows the compiler to explicitly mark
8959 which relocations should apply to which instructions.  This option
8960 is mostly useful for debugging, as GCC detects the capabilities of
8961 the assembler when it is built and sets the default accordingly.
8962
8963 @item -msmall-data
8964 @itemx -mlarge-data
8965 @opindex msmall-data
8966 @opindex mlarge-data
8967 When @option{-mexplicit-relocs} is in effect, static data is
8968 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
8969 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
8970 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
8971 16-bit relocations off of the @code{$gp} register.  This limits the
8972 size of the small data area to 64KB, but allows the variables to be
8973 directly accessed via a single instruction.
8974
8975 The default is @option{-mlarge-data}.  With this option the data area
8976 is limited to just below 2GB@.  Programs that require more than 2GB of
8977 data must use @code{malloc} or @code{mmap} to allocate the data in the
8978 heap instead of in the program's data segment.
8979
8980 When generating code for shared libraries, @option{-fpic} implies
8981 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
8982
8983 @item -msmall-text
8984 @itemx -mlarge-text
8985 @opindex msmall-text
8986 @opindex mlarge-text
8987 When @option{-msmall-text} is used, the compiler assumes that the
8988 code of the entire program (or shared library) fits in 4MB, and is
8989 thus reachable with a branch instruction.  When @option{-msmall-data}
8990 is used, the compiler can assume that all local symbols share the
8991 same @code{$gp} value, and thus reduce the number of instructions
8992 required for a function call from 4 to 1.
8993
8994 The default is @option{-mlarge-text}.
8995
8996 @item -mcpu=@var{cpu_type}
8997 @opindex mcpu
8998 Set the instruction set and instruction scheduling parameters for
8999 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9000 style name or the corresponding chip number.  GCC supports scheduling
9001 parameters for the EV4, EV5 and EV6 family of processors and will
9002 choose the default values for the instruction set from the processor
9003 you specify.  If you do not specify a processor type, GCC will default
9004 to the processor on which the compiler was built.
9005
9006 Supported values for @var{cpu_type} are
9007
9008 @table @samp
9009 @item ev4
9010 @itemx ev45
9011 @itemx 21064
9012 Schedules as an EV4 and has no instruction set extensions.
9013
9014 @item ev5
9015 @itemx 21164
9016 Schedules as an EV5 and has no instruction set extensions.
9017
9018 @item ev56
9019 @itemx 21164a
9020 Schedules as an EV5 and supports the BWX extension.
9021
9022 @item pca56
9023 @itemx 21164pc
9024 @itemx 21164PC
9025 Schedules as an EV5 and supports the BWX and MAX extensions.
9026
9027 @item ev6
9028 @itemx 21264
9029 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9030
9031 @item ev67
9032 @itemx 21264a
9033 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9034 @end table
9035
9036 @item -mtune=@var{cpu_type}
9037 @opindex mtune
9038 Set only the instruction scheduling parameters for machine type
9039 @var{cpu_type}.  The instruction set is not changed.
9040
9041 @item -mmemory-latency=@var{time}
9042 @opindex mmemory-latency
9043 Sets the latency the scheduler should assume for typical memory
9044 references as seen by the application.  This number is highly
9045 dependent on the memory access patterns used by the application
9046 and the size of the external cache on the machine.
9047
9048 Valid options for @var{time} are
9049
9050 @table @samp
9051 @item @var{number}
9052 A decimal number representing clock cycles.
9053
9054 @item L1
9055 @itemx L2
9056 @itemx L3
9057 @itemx main
9058 The compiler contains estimates of the number of clock cycles for
9059 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9060 (also called Dcache, Scache, and Bcache), as well as to main memory.
9061 Note that L3 is only valid for EV5.
9062
9063 @end table
9064 @end table
9065
9066 @node DEC Alpha/VMS Options
9067 @subsection DEC Alpha/VMS Options
9068
9069 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9070
9071 @table @gcctabopt
9072 @item -mvms-return-codes
9073 @opindex mvms-return-codes
9074 Return VMS condition codes from main.  The default is to return POSIX
9075 style condition (e.g.@ error) codes.
9076 @end table
9077
9078 @node FRV Options
9079 @subsection FRV Options
9080 @cindex FRV Options
9081
9082 @table @gcctabopt
9083 @item -mgpr-32
9084 @opindex mgpr-32
9085
9086 Only use the first 32 general purpose registers.
9087
9088 @item -mgpr-64
9089 @opindex mgpr-64
9090
9091 Use all 64 general purpose registers.
9092
9093 @item -mfpr-32
9094 @opindex mfpr-32
9095
9096 Use only the first 32 floating point registers.
9097
9098 @item -mfpr-64
9099 @opindex mfpr-64
9100
9101 Use all 64 floating point registers
9102
9103 @item -mhard-float
9104 @opindex mhard-float
9105
9106 Use hardware instructions for floating point operations.
9107
9108 @item -msoft-float
9109 @opindex msoft-float
9110
9111 Use library routines for floating point operations.
9112
9113 @item -malloc-cc
9114 @opindex malloc-cc
9115
9116 Dynamically allocate condition code registers.
9117
9118 @item -mfixed-cc
9119 @opindex mfixed-cc
9120
9121 Do not try to dynamically allocate condition code registers, only
9122 use @code{icc0} and @code{fcc0}.
9123
9124 @item -mdword
9125 @opindex mdword
9126
9127 Change ABI to use double word insns.
9128
9129 @item -mno-dword
9130 @opindex mno-dword
9131
9132 Do not use double word instructions.
9133
9134 @item -mdouble
9135 @opindex mdouble
9136
9137 Use floating point double instructions.
9138
9139 @item -mno-double
9140 @opindex mno-double
9141
9142 Do not use floating point double instructions.
9143
9144 @item -mmedia
9145 @opindex mmedia
9146
9147 Use media instructions.
9148
9149 @item -mno-media
9150 @opindex mno-media
9151
9152 Do not use media instructions.
9153
9154 @item -mmuladd
9155 @opindex mmuladd
9156
9157 Use multiply and add/subtract instructions.
9158
9159 @item -mno-muladd
9160 @opindex mno-muladd
9161
9162 Do not use multiply and add/subtract instructions.
9163
9164 @item -mfdpic
9165 @opindex mfdpic
9166
9167 Select the FDPIC ABI, that uses function descriptors to represent
9168 pointers to functions.  Without any PIC/PIE-related options, it
9169 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
9170 assumes GOT entries and small data are within a 12-bit range from the
9171 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
9172 are computed with 32 bits.
9173
9174 @item -minline-plt
9175 @opindex minline-plt
9176
9177 Enable inlining of PLT entries in function calls to functions that are
9178 not known to bind locally.  It has no effect without @option{-mfdpic}.
9179 It's enabled by default if optimizing for speed and compiling for
9180 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
9181 optimization option such as @option{-O3} or above is present in the
9182 command line.
9183
9184 @item -mTLS
9185 @opindex TLS
9186
9187 Assume a large TLS segment when generating thread-local code.
9188
9189 @item -mtls
9190 @opindex tls
9191
9192 Do not assume a large TLS segment when generating thread-local code.
9193
9194 @item -mgprel-ro
9195 @opindex mgprel-ro
9196
9197 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
9198 that is known to be in read-only sections.  It's enabled by default,
9199 except for @option{-fpic} or @option{-fpie}: even though it may help
9200 make the global offset table smaller, it trades 1 instruction for 4.
9201 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9202 one of which may be shared by multiple symbols, and it avoids the need
9203 for a GOT entry for the referenced symbol, so it's more likely to be a
9204 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9205
9206 @item -multilib-library-pic
9207 @opindex multilib-library-pic
9208
9209 Link with the (library, not FD) pic libraries.  It's implied by
9210 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9211 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9212 it explicitly.
9213
9214 @item -mlinked-fp
9215 @opindex mlinked-fp
9216
9217 Follow the EABI requirement of always creating a frame pointer whenever
9218 a stack frame is allocated.  This option is enabled by default and can
9219 be disabled with @option{-mno-linked-fp}.
9220
9221 @item -mlong-calls
9222 @opindex mlong-calls
9223
9224 Use indirect addressing to call functions outside the current
9225 compilation unit.  This allows the functions to be placed anywhere
9226 within the 32-bit address space.
9227
9228 @item -malign-labels
9229 @opindex malign-labels
9230
9231 Try to align labels to an 8-byte boundary by inserting nops into the
9232 previous packet.  This option only has an effect when VLIW packing
9233 is enabled.  It doesn't create new packets; it merely adds nops to
9234 existing ones.
9235
9236 @item -mlibrary-pic
9237 @opindex mlibrary-pic
9238
9239 Generate position-independent EABI code.
9240
9241 @item -macc-4
9242 @opindex macc-4
9243
9244 Use only the first four media accumulator registers.
9245
9246 @item -macc-8
9247 @opindex macc-8
9248
9249 Use all eight media accumulator registers.
9250
9251 @item -mpack
9252 @opindex mpack
9253
9254 Pack VLIW instructions.
9255
9256 @item -mno-pack
9257 @opindex mno-pack
9258
9259 Do not pack VLIW instructions.
9260
9261 @item -mno-eflags
9262 @opindex mno-eflags
9263
9264 Do not mark ABI switches in e_flags.
9265
9266 @item -mcond-move
9267 @opindex mcond-move
9268
9269 Enable the use of conditional-move instructions (default).
9270
9271 This switch is mainly for debugging the compiler and will likely be removed
9272 in a future version.
9273
9274 @item -mno-cond-move
9275 @opindex mno-cond-move
9276
9277 Disable the use of conditional-move instructions.
9278
9279 This switch is mainly for debugging the compiler and will likely be removed
9280 in a future version.
9281
9282 @item -mscc
9283 @opindex mscc
9284
9285 Enable the use of conditional set instructions (default).
9286
9287 This switch is mainly for debugging the compiler and will likely be removed
9288 in a future version.
9289
9290 @item -mno-scc
9291 @opindex mno-scc
9292
9293 Disable the use of conditional set instructions.
9294
9295 This switch is mainly for debugging the compiler and will likely be removed
9296 in a future version.
9297
9298 @item -mcond-exec
9299 @opindex mcond-exec
9300
9301 Enable the use of conditional execution (default).
9302
9303 This switch is mainly for debugging the compiler and will likely be removed
9304 in a future version.
9305
9306 @item -mno-cond-exec
9307 @opindex mno-cond-exec
9308
9309 Disable the use of conditional execution.
9310
9311 This switch is mainly for debugging the compiler and will likely be removed
9312 in a future version.
9313
9314 @item -mvliw-branch
9315 @opindex mvliw-branch
9316
9317 Run a pass to pack branches into VLIW instructions (default).
9318
9319 This switch is mainly for debugging the compiler and will likely be removed
9320 in a future version.
9321
9322 @item -mno-vliw-branch
9323 @opindex mno-vliw-branch
9324
9325 Do not run a pass to pack branches into VLIW instructions.
9326
9327 This switch is mainly for debugging the compiler and will likely be removed
9328 in a future version.
9329
9330 @item -mmulti-cond-exec
9331 @opindex mmulti-cond-exec
9332
9333 Enable optimization of @code{&&} and @code{||} in conditional execution
9334 (default).
9335
9336 This switch is mainly for debugging the compiler and will likely be removed
9337 in a future version.
9338
9339 @item -mno-multi-cond-exec
9340 @opindex mno-multi-cond-exec
9341
9342 Disable optimization of @code{&&} and @code{||} in conditional execution.
9343
9344 This switch is mainly for debugging the compiler and will likely be removed
9345 in a future version.
9346
9347 @item -mnested-cond-exec
9348 @opindex mnested-cond-exec
9349
9350 Enable nested conditional execution optimizations (default).
9351
9352 This switch is mainly for debugging the compiler and will likely be removed
9353 in a future version.
9354
9355 @item -mno-nested-cond-exec
9356 @opindex mno-nested-cond-exec
9357
9358 Disable nested conditional execution optimizations.
9359
9360 This switch is mainly for debugging the compiler and will likely be removed
9361 in a future version.
9362
9363 @item -moptimize-membar
9364 @opindex moptimize-membar
9365
9366 This switch removes redundant @code{membar} instructions from the
9367 compiler generated code.  It is enabled by default.
9368
9369 @item -mno-optimize-membar
9370 @opindex mno-optimize-membar
9371
9372 This switch disables the automatic removal of redundant @code{membar}
9373 instructions from the generated code.
9374
9375 @item -mtomcat-stats
9376 @opindex mtomcat-stats
9377
9378 Cause gas to print out tomcat statistics.
9379
9380 @item -mcpu=@var{cpu}
9381 @opindex mcpu
9382
9383 Select the processor type for which to generate code.  Possible values are
9384 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9385 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9386
9387 @end table
9388
9389 @node GNU/Linux Options
9390 @subsection GNU/Linux Options
9391
9392 These @samp{-m} options are defined for GNU/Linux targets:
9393
9394 @table @gcctabopt
9395 @item -mglibc
9396 @opindex mglibc
9397 Use the GNU C library instead of uClibc.  This is the default except
9398 on @samp{*-*-linux-*uclibc*} targets.
9399
9400 @item -muclibc
9401 @opindex muclibc
9402 Use uClibc instead of the GNU C library.  This is the default on
9403 @samp{*-*-linux-*uclibc*} targets.
9404 @end table
9405
9406 @node H8/300 Options
9407 @subsection H8/300 Options
9408
9409 These @samp{-m} options are defined for the H8/300 implementations:
9410
9411 @table @gcctabopt
9412 @item -mrelax
9413 @opindex mrelax
9414 Shorten some address references at link time, when possible; uses the
9415 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9416 ld, Using ld}, for a fuller description.
9417
9418 @item -mh
9419 @opindex mh
9420 Generate code for the H8/300H@.
9421
9422 @item -ms
9423 @opindex ms
9424 Generate code for the H8S@.
9425
9426 @item -mn
9427 @opindex mn
9428 Generate code for the H8S and H8/300H in the normal mode.  This switch
9429 must be used either with @option{-mh} or @option{-ms}.
9430
9431 @item -ms2600
9432 @opindex ms2600
9433 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9434
9435 @item -mint32
9436 @opindex mint32
9437 Make @code{int} data 32 bits by default.
9438
9439 @item -malign-300
9440 @opindex malign-300
9441 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9442 The default for the H8/300H and H8S is to align longs and floats on 4
9443 byte boundaries.
9444 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9445 This option has no effect on the H8/300.
9446 @end table
9447
9448 @node HPPA Options
9449 @subsection HPPA Options
9450 @cindex HPPA Options
9451
9452 These @samp{-m} options are defined for the HPPA family of computers:
9453
9454 @table @gcctabopt
9455 @item -march=@var{architecture-type}
9456 @opindex march
9457 Generate code for the specified architecture.  The choices for
9458 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9459 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9460 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9461 architecture option for your machine.  Code compiled for lower numbered
9462 architectures will run on higher numbered architectures, but not the
9463 other way around.
9464
9465 @item -mpa-risc-1-0
9466 @itemx -mpa-risc-1-1
9467 @itemx -mpa-risc-2-0
9468 @opindex mpa-risc-1-0
9469 @opindex mpa-risc-1-1
9470 @opindex mpa-risc-2-0
9471 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9472
9473 @item -mbig-switch
9474 @opindex mbig-switch
9475 Generate code suitable for big switch tables.  Use this option only if
9476 the assembler/linker complain about out of range branches within a switch
9477 table.
9478
9479 @item -mjump-in-delay
9480 @opindex mjump-in-delay
9481 Fill delay slots of function calls with unconditional jump instructions
9482 by modifying the return pointer for the function call to be the target
9483 of the conditional jump.
9484
9485 @item -mdisable-fpregs
9486 @opindex mdisable-fpregs
9487 Prevent floating point registers from being used in any manner.  This is
9488 necessary for compiling kernels which perform lazy context switching of
9489 floating point registers.  If you use this option and attempt to perform
9490 floating point operations, the compiler will abort.
9491
9492 @item -mdisable-indexing
9493 @opindex mdisable-indexing
9494 Prevent the compiler from using indexing address modes.  This avoids some
9495 rather obscure problems when compiling MIG generated code under MACH@.
9496
9497 @item -mno-space-regs
9498 @opindex mno-space-regs
9499 Generate code that assumes the target has no space registers.  This allows
9500 GCC to generate faster indirect calls and use unscaled index address modes.
9501
9502 Such code is suitable for level 0 PA systems and kernels.
9503
9504 @item -mfast-indirect-calls
9505 @opindex mfast-indirect-calls
9506 Generate code that assumes calls never cross space boundaries.  This
9507 allows GCC to emit code which performs faster indirect calls.
9508
9509 This option will not work in the presence of shared libraries or nested
9510 functions.
9511
9512 @item -mfixed-range=@var{register-range}
9513 @opindex mfixed-range
9514 Generate code treating the given register range as fixed registers.
9515 A fixed register is one that the register allocator can not use.  This is
9516 useful when compiling kernel code.  A register range is specified as
9517 two registers separated by a dash.  Multiple register ranges can be
9518 specified separated by a comma.
9519
9520 @item -mlong-load-store
9521 @opindex mlong-load-store
9522 Generate 3-instruction load and store sequences as sometimes required by
9523 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9524 the HP compilers.
9525
9526 @item -mportable-runtime
9527 @opindex mportable-runtime
9528 Use the portable calling conventions proposed by HP for ELF systems.
9529
9530 @item -mgas
9531 @opindex mgas
9532 Enable the use of assembler directives only GAS understands.
9533
9534 @item -mschedule=@var{cpu-type}
9535 @opindex mschedule
9536 Schedule code according to the constraints for the machine type
9537 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9538 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9539 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9540 proper scheduling option for your machine.  The default scheduling is
9541 @samp{8000}.
9542
9543 @item -mlinker-opt
9544 @opindex mlinker-opt
9545 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9546 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9547 linkers in which they give bogus error messages when linking some programs.
9548
9549 @item -msoft-float
9550 @opindex msoft-float
9551 Generate output containing library calls for floating point.
9552 @strong{Warning:} the requisite libraries are not available for all HPPA
9553 targets.  Normally the facilities of the machine's usual C compiler are
9554 used, but this cannot be done directly in cross-compilation.  You must make
9555 your own arrangements to provide suitable library functions for
9556 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9557 does provide software floating point support.
9558
9559 @option{-msoft-float} changes the calling convention in the output file;
9560 therefore, it is only useful if you compile @emph{all} of a program with
9561 this option.  In particular, you need to compile @file{libgcc.a}, the
9562 library that comes with GCC, with @option{-msoft-float} in order for
9563 this to work.
9564
9565 @item -msio
9566 @opindex msio
9567 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9568 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9569 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9570 options are available under HP-UX and HI-UX@.
9571
9572 @item -mgnu-ld
9573 @opindex gnu-ld
9574 Use GNU ld specific options.  This passes @option{-shared} to ld when
9575 building a shared library.  It is the default when GCC is configured,
9576 explicitly or implicitly, with the GNU linker.  This option does not
9577 have any affect on which ld is called, it only changes what parameters
9578 are passed to that ld.  The ld that is called is determined by the
9579 @option{--with-ld} configure option, GCC's program search path, and
9580 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9581 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9582 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9583
9584 @item -mhp-ld
9585 @opindex hp-ld
9586 Use HP ld specific options.  This passes @option{-b} to ld when building
9587 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9588 links.  It is the default when GCC is configured, explicitly or
9589 implicitly, with the HP linker.  This option does not have any affect on
9590 which ld is called, it only changes what parameters are passed to that
9591 ld.  The ld that is called is determined by the @option{--with-ld}
9592 configure option, GCC's program search path, and finally by the user's
9593 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9594 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9595 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9596
9597 @item -mlong-calls
9598 @opindex mno-long-calls
9599 Generate code that uses long call sequences.  This ensures that a call
9600 is always able to reach linker generated stubs.  The default is to generate
9601 long calls only when the distance from the call site to the beginning
9602 of the function or translation unit, as the case may be, exceeds a
9603 predefined limit set by the branch type being used.  The limits for
9604 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9605 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9606 240,000 bytes.
9607
9608 Distances are measured from the beginning of functions when using the
9609 @option{-ffunction-sections} option, or when using the @option{-mgas}
9610 and @option{-mno-portable-runtime} options together under HP-UX with
9611 the SOM linker.
9612
9613 It is normally not desirable to use this option as it will degrade
9614 performance.  However, it may be useful in large applications,
9615 particularly when partial linking is used to build the application.
9616
9617 The types of long calls used depends on the capabilities of the
9618 assembler and linker, and the type of code being generated.  The
9619 impact on systems that support long absolute calls, and long pic
9620 symbol-difference or pc-relative calls should be relatively small.
9621 However, an indirect call is used on 32-bit ELF systems in pic code
9622 and it is quite long.
9623
9624 @item -munix=@var{unix-std}
9625 @opindex march
9626 Generate compiler predefines and select a startfile for the specified
9627 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9628 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9629 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9630 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9631 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9632 and later.
9633
9634 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9635 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9636 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9637 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9638 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9639 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9640
9641 It is @emph{important} to note that this option changes the interfaces
9642 for various library routines.  It also affects the operational behavior
9643 of the C library.  Thus, @emph{extreme} care is needed in using this
9644 option.
9645
9646 Library code that is intended to operate with more than one UNIX
9647 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9648 as appropriate.  Most GNU software doesn't provide this capability.
9649
9650 @item -nolibdld
9651 @opindex nolibdld
9652 Suppress the generation of link options to search libdld.sl when the
9653 @option{-static} option is specified on HP-UX 10 and later.
9654
9655 @item -static
9656 @opindex static
9657 The HP-UX implementation of setlocale in libc has a dependency on
9658 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9659 when the @option{-static} option is specified, special link options
9660 are needed to resolve this dependency.
9661
9662 On HP-UX 10 and later, the GCC driver adds the necessary options to
9663 link with libdld.sl when the @option{-static} option is specified.
9664 This causes the resulting binary to be dynamic.  On the 64-bit port,
9665 the linkers generate dynamic binaries by default in any case.  The
9666 @option{-nolibdld} option can be used to prevent the GCC driver from
9667 adding these link options.
9668
9669 @item -threads
9670 @opindex threads
9671 Add support for multithreading with the @dfn{dce thread} library
9672 under HP-UX@.  This option sets flags for both the preprocessor and
9673 linker.
9674 @end table
9675
9676 @node i386 and x86-64 Options
9677 @subsection Intel 386 and AMD x86-64 Options
9678 @cindex i386 Options
9679 @cindex x86-64 Options
9680 @cindex Intel 386 Options
9681 @cindex AMD x86-64 Options
9682
9683 These @samp{-m} options are defined for the i386 and x86-64 family of
9684 computers:
9685
9686 @table @gcctabopt
9687 @item -mtune=@var{cpu-type}
9688 @opindex mtune
9689 Tune to @var{cpu-type} everything applicable about the generated code, except
9690 for the ABI and the set of available instructions.  The choices for
9691 @var{cpu-type} are:
9692 @table @emph
9693 @item generic
9694 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9695 If you know the CPU on which your code will run, then you should use
9696 the corresponding @option{-mtune} option instead of
9697 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9698 of your application will have, then you should use this option.
9699
9700 As new processors are deployed in the marketplace, the behavior of this
9701 option will change.  Therefore, if you upgrade to a newer version of
9702 GCC, the code generated option will change to reflect the processors
9703 that were most common when that version of GCC was released.
9704
9705 There is no @option{-march=generic} option because @option{-march}
9706 indicates the instruction set the compiler can use, and there is no
9707 generic instruction set applicable to all processors.  In contrast,
9708 @option{-mtune} indicates the processor (or, in this case, collection of
9709 processors) for which the code is optimized.
9710 @item native
9711 This selects the CPU to tune for at compilation time by determining
9712 the processor type of the compiling machine.  Using @option{-mtune=native}
9713 will produce code optimized for the local machine under the constraints
9714 of the selected instruction set.  Using @option{-march=native} will
9715 enable all instruction subsets supported by the local machine (hence
9716 the result might not run on different machines).
9717 @item i386
9718 Original Intel's i386 CPU@.
9719 @item i486
9720 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9721 @item i586, pentium
9722 Intel Pentium CPU with no MMX support.
9723 @item pentium-mmx
9724 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9725 @item pentiumpro
9726 Intel PentiumPro CPU@.
9727 @item i686
9728 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9729 instruction set will be used, so the code will run on all i686 family chips.
9730 @item pentium2
9731 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9732 @item pentium3, pentium3m
9733 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9734 support.
9735 @item pentium-m
9736 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9737 support.  Used by Centrino notebooks.
9738 @item pentium4, pentium4m
9739 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9740 @item prescott
9741 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9742 set support.
9743 @item nocona
9744 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9745 SSE2 and SSE3 instruction set support.
9746 @item core2
9747 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9748 instruction set support.
9749 @item k6
9750 AMD K6 CPU with MMX instruction set support.
9751 @item k6-2, k6-3
9752 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9753 @item athlon, athlon-tbird
9754 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9755 support.
9756 @item athlon-4, athlon-xp, athlon-mp
9757 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9758 instruction set support.
9759 @item k8, opteron, athlon64, athlon-fx
9760 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9761 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9762 @item amdfam10
9763 AMD Family 10 core based CPUs with x86-64 instruction set support.  (This
9764 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
9765 instruction set extensions.)
9766 @item winchip-c6
9767 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9768 set support.
9769 @item winchip2
9770 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9771 instruction set support.
9772 @item c3
9773 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9774 implemented for this chip.)
9775 @item c3-2
9776 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9777 implemented for this chip.)
9778 @item geode
9779 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9780 @end table
9781
9782 While picking a specific @var{cpu-type} will schedule things appropriately
9783 for that particular chip, the compiler will not generate any code that
9784 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9785 being used.
9786
9787 @item -march=@var{cpu-type}
9788 @opindex march
9789 Generate instructions for the machine type @var{cpu-type}.  The choices
9790 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9791 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9792
9793 @item -mcpu=@var{cpu-type}
9794 @opindex mcpu
9795 A deprecated synonym for @option{-mtune}.
9796
9797 @item -m386
9798 @itemx -m486
9799 @itemx -mpentium
9800 @itemx -mpentiumpro
9801 @opindex m386
9802 @opindex m486
9803 @opindex mpentium
9804 @opindex mpentiumpro
9805 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9806 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9807 These synonyms are deprecated.
9808
9809 @item -mfpmath=@var{unit}
9810 @opindex march
9811 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9812 for @var{unit} are:
9813
9814 @table @samp
9815 @item 387
9816 Use the standard 387 floating point coprocessor present majority of chips and
9817 emulated otherwise.  Code compiled with this option will run almost everywhere.
9818 The temporary results are computed in 80bit precision instead of precision
9819 specified by the type resulting in slightly different results compared to most
9820 of other chips.  See @option{-ffloat-store} for more detailed description.
9821
9822 This is the default choice for i386 compiler.
9823
9824 @item sse
9825 Use scalar floating point instructions present in the SSE instruction set.
9826 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9827 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9828 instruction set supports only single precision arithmetics, thus the double and
9829 extended precision arithmetics is still done using 387.  Later version, present
9830 only in Pentium4 and the future AMD x86-64 chips supports double precision
9831 arithmetics too.
9832
9833 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9834 or @option{-msse2} switches to enable SSE extensions and make this option
9835 effective.  For the x86-64 compiler, these extensions are enabled by default.
9836
9837 The resulting code should be considerably faster in the majority of cases and avoid
9838 the numerical instability problems of 387 code, but may break some existing
9839 code that expects temporaries to be 80bit.
9840
9841 This is the default choice for the x86-64 compiler.
9842
9843 @item sse,387
9844 Attempt to utilize both instruction sets at once.  This effectively double the
9845 amount of available registers and on chips with separate execution units for
9846 387 and SSE the execution resources too.  Use this option with care, as it is
9847 still experimental, because the GCC register allocator does not model separate
9848 functional units well resulting in instable performance.
9849 @end table
9850
9851 @item -masm=@var{dialect}
9852 @opindex masm=@var{dialect}
9853 Output asm instructions using selected @var{dialect}.  Supported
9854 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9855 not support @samp{intel}.
9856
9857 @item -mieee-fp
9858 @itemx -mno-ieee-fp
9859 @opindex mieee-fp
9860 @opindex mno-ieee-fp
9861 Control whether or not the compiler uses IEEE floating point
9862 comparisons.  These handle correctly the case where the result of a
9863 comparison is unordered.
9864
9865 @item -msoft-float
9866 @opindex msoft-float
9867 Generate output containing library calls for floating point.
9868 @strong{Warning:} the requisite libraries are not part of GCC@.
9869 Normally the facilities of the machine's usual C compiler are used, but
9870 this can't be done directly in cross-compilation.  You must make your
9871 own arrangements to provide suitable library functions for
9872 cross-compilation.
9873
9874 On machines where a function returns floating point results in the 80387
9875 register stack, some floating point opcodes may be emitted even if
9876 @option{-msoft-float} is used.
9877
9878 @item -mno-fp-ret-in-387
9879 @opindex mno-fp-ret-in-387
9880 Do not use the FPU registers for return values of functions.
9881
9882 The usual calling convention has functions return values of types
9883 @code{float} and @code{double} in an FPU register, even if there
9884 is no FPU@.  The idea is that the operating system should emulate
9885 an FPU@.
9886
9887 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9888 in ordinary CPU registers instead.
9889
9890 @item -mno-fancy-math-387
9891 @opindex mno-fancy-math-387
9892 Some 387 emulators do not support the @code{sin}, @code{cos} and
9893 @code{sqrt} instructions for the 387.  Specify this option to avoid
9894 generating those instructions.  This option is the default on FreeBSD,
9895 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9896 indicates that the target cpu will always have an FPU and so the
9897 instruction will not need emulation.  As of revision 2.6.1, these
9898 instructions are not generated unless you also use the
9899 @option{-funsafe-math-optimizations} switch.
9900
9901 @item -malign-double
9902 @itemx -mno-align-double
9903 @opindex malign-double
9904 @opindex mno-align-double
9905 Control whether GCC aligns @code{double}, @code{long double}, and
9906 @code{long long} variables on a two word boundary or a one word
9907 boundary.  Aligning @code{double} variables on a two word boundary will
9908 produce code that runs somewhat faster on a @samp{Pentium} at the
9909 expense of more memory.
9910
9911 On x86-64, @option{-malign-double} is enabled by default.
9912
9913 @strong{Warning:} if you use the @option{-malign-double} switch,
9914 structures containing the above types will be aligned differently than
9915 the published application binary interface specifications for the 386
9916 and will not be binary compatible with structures in code compiled
9917 without that switch.
9918
9919 @item -m96bit-long-double
9920 @itemx -m128bit-long-double
9921 @opindex m96bit-long-double
9922 @opindex m128bit-long-double
9923 These switches control the size of @code{long double} type.  The i386
9924 application binary interface specifies the size to be 96 bits,
9925 so @option{-m96bit-long-double} is the default in 32 bit mode.
9926
9927 Modern architectures (Pentium and newer) would prefer @code{long double}
9928 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9929 conforming to the ABI, this would not be possible.  So specifying a
9930 @option{-m128bit-long-double} will align @code{long double}
9931 to a 16 byte boundary by padding the @code{long double} with an additional
9932 32 bit zero.
9933
9934 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9935 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9936
9937 Notice that neither of these options enable any extra precision over the x87
9938 standard of 80 bits for a @code{long double}.
9939
9940 @strong{Warning:} if you override the default value for your target ABI, the
9941 structures and arrays containing @code{long double} variables will change
9942 their size as well as function calling convention for function taking
9943 @code{long double} will be modified.  Hence they will not be binary
9944 compatible with arrays or structures in code compiled without that switch.
9945
9946 @item -mmlarge-data-threshold=@var{number}
9947 @opindex mlarge-data-threshold=@var{number}
9948 When @option{-mcmodel=medium} is specified, the data greater than
9949 @var{threshold} are placed in large data section.  This value must be the
9950 same across all object linked into the binary and defaults to 65535.
9951
9952 @item -msvr3-shlib
9953 @itemx -mno-svr3-shlib
9954 @opindex msvr3-shlib
9955 @opindex mno-svr3-shlib
9956 Control whether GCC places uninitialized local variables into the
9957 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9958 into @code{bss}.  These options are meaningful only on System V Release 3.
9959
9960 @item -mrtd
9961 @opindex mrtd
9962 Use a different function-calling convention, in which functions that
9963 take a fixed number of arguments return with the @code{ret} @var{num}
9964 instruction, which pops their arguments while returning.  This saves one
9965 instruction in the caller since there is no need to pop the arguments
9966 there.
9967
9968 You can specify that an individual function is called with this calling
9969 sequence with the function attribute @samp{stdcall}.  You can also
9970 override the @option{-mrtd} option by using the function attribute
9971 @samp{cdecl}.  @xref{Function Attributes}.
9972
9973 @strong{Warning:} this calling convention is incompatible with the one
9974 normally used on Unix, so you cannot use it if you need to call
9975 libraries compiled with the Unix compiler.
9976
9977 Also, you must provide function prototypes for all functions that
9978 take variable numbers of arguments (including @code{printf});
9979 otherwise incorrect code will be generated for calls to those
9980 functions.
9981
9982 In addition, seriously incorrect code will result if you call a
9983 function with too many arguments.  (Normally, extra arguments are
9984 harmlessly ignored.)
9985
9986 @item -mregparm=@var{num}
9987 @opindex mregparm
9988 Control how many registers are used to pass integer arguments.  By
9989 default, no registers are used to pass arguments, and at most 3
9990 registers can be used.  You can control this behavior for a specific
9991 function by using the function attribute @samp{regparm}.
9992 @xref{Function Attributes}.
9993
9994 @strong{Warning:} if you use this switch, and
9995 @var{num} is nonzero, then you must build all modules with the same
9996 value, including any libraries.  This includes the system libraries and
9997 startup modules.
9998
9999 @item -msseregparm
10000 @opindex msseregparm
10001 Use SSE register passing conventions for float and double arguments
10002 and return values.  You can control this behavior for a specific
10003 function by using the function attribute @samp{sseregparm}.
10004 @xref{Function Attributes}.
10005
10006 @strong{Warning:} if you use this switch then you must build all
10007 modules with the same value, including any libraries.  This includes
10008 the system libraries and startup modules.
10009
10010 @item -mstackrealign
10011 @opindex mstackrealign
10012 Realign the stack at entry.  On the Intel x86, the
10013 @option{-mstackrealign} option will generate an alternate prologue and
10014 epilogue that realigns the runtime stack.  This supports mixing legacy
10015 codes that keep a 4-byte aligned stack with modern codes that keep a
10016 16-byte stack for SSE compatibility.  The alternate prologue and
10017 epilogue are slower and bigger than the regular ones, and the
10018 alternate prologue requires an extra scratch register; this lowers the
10019 number of registers available if used in conjunction with the
10020 @code{regparm} attribute.  The @option{-mstackrealign} option is
10021 incompatible with the nested function prologue; this is considered a
10022 hard error.  See also the attribute @code{force_align_arg_pointer},
10023 applicable to individual functions.
10024
10025 @item -mpreferred-stack-boundary=@var{num}
10026 @opindex mpreferred-stack-boundary
10027 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10028 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10029 the default is 4 (16 bytes or 128 bits).
10030
10031 On Pentium and PentiumPro, @code{double} and @code{long double} values
10032 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10033 suffer significant run time performance penalties.  On Pentium III, the
10034 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10035 properly if it is not 16 byte aligned.
10036
10037 To ensure proper alignment of this values on the stack, the stack boundary
10038 must be as aligned as that required by any value stored on the stack.
10039 Further, every function must be generated such that it keeps the stack
10040 aligned.  Thus calling a function compiled with a higher preferred
10041 stack boundary from a function compiled with a lower preferred stack
10042 boundary will most likely misalign the stack.  It is recommended that
10043 libraries that use callbacks always use the default setting.
10044
10045 This extra alignment does consume extra stack space, and generally
10046 increases code size.  Code that is sensitive to stack space usage, such
10047 as embedded systems and operating system kernels, may want to reduce the
10048 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10049
10050 @item -mmmx
10051 @itemx -mno-mmx
10052 @item -msse
10053 @itemx -mno-sse
10054 @item -msse2
10055 @itemx -mno-sse2
10056 @item -msse3
10057 @itemx -mno-sse3
10058 @item -mssse3
10059 @itemx -mno-ssse3
10060 @item -msse4a
10061 @item -mno-sse4a
10062 @item -m3dnow
10063 @itemx -mno-3dnow
10064 @item -mpopcnt
10065 @itemx -mno-popcnt
10066 @item -mabm
10067 @itemx -mno-abm
10068 @opindex mmmx
10069 @opindex mno-mmx
10070 @opindex msse
10071 @opindex mno-sse
10072 @opindex m3dnow
10073 @opindex mno-3dnow
10074 These switches enable or disable the use of instructions in the MMX,
10075 SSE, SSE2, SSE3, SSSE3, SSE4A, ABM or 3DNow! extended instruction sets.
10076 These extensions are also available as built-in functions: see
10077 @ref{X86 Built-in Functions}, for details of the functions enabled and
10078 disabled by these switches.
10079
10080 To have SSE/SSE2 instructions generated automatically from floating-point
10081 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10082
10083 These options will enable GCC to use these extended instructions in
10084 generated code, even without @option{-mfpmath=sse}.  Applications which
10085 perform runtime CPU detection must compile separate files for each
10086 supported architecture, using the appropriate flags.  In particular,
10087 the file containing the CPU detection code should be compiled without
10088 these options.
10089
10090 @item -mcx16
10091 @opindex -mcx16
10092 This option will enable GCC to use CMPXCHG16B instruction in generated code.
10093 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
10094 data types.  This is useful for high resolution counters that could be updated
10095 by multiple processors (or cores).  This instruction is generated as part of
10096 atomic built-in functions: see @ref{Atomic Builtins} for details.
10097
10098 @item -msahf
10099 @opindex -msahf
10100 This option will enable GCC to use SAHF instruction in generated 64-bit code.
10101 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
10102 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
10103 SAHF are load and store instructions, respectively, for certain status flags.
10104 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
10105 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
10106
10107 @item -mpush-args
10108 @itemx -mno-push-args
10109 @opindex mpush-args
10110 @opindex mno-push-args
10111 Use PUSH operations to store outgoing parameters.  This method is shorter
10112 and usually equally fast as method using SUB/MOV operations and is enabled
10113 by default.  In some cases disabling it may improve performance because of
10114 improved scheduling and reduced dependencies.
10115
10116 @item -maccumulate-outgoing-args
10117 @opindex maccumulate-outgoing-args
10118 If enabled, the maximum amount of space required for outgoing arguments will be
10119 computed in the function prologue.  This is faster on most modern CPUs
10120 because of reduced dependencies, improved scheduling and reduced stack usage
10121 when preferred stack boundary is not equal to 2.  The drawback is a notable
10122 increase in code size.  This switch implies @option{-mno-push-args}.
10123
10124 @item -mthreads
10125 @opindex mthreads
10126 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
10127 on thread-safe exception handling must compile and link all code with the
10128 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
10129 @option{-D_MT}; when linking, it links in a special thread helper library
10130 @option{-lmingwthrd} which cleans up per thread exception handling data.
10131
10132 @item -mno-align-stringops
10133 @opindex mno-align-stringops
10134 Do not align destination of inlined string operations.  This switch reduces
10135 code size and improves performance in case the destination is already aligned,
10136 but GCC doesn't know about it.
10137
10138 @item -minline-all-stringops
10139 @opindex minline-all-stringops
10140 By default GCC inlines string operations only when destination is known to be
10141 aligned at least to 4 byte boundary.  This enables more inlining, increase code
10142 size, but may improve performance of code that depends on fast memcpy, strlen
10143 and memset for short lengths.
10144
10145 @item -minline-stringops-dynamically
10146 @opindex minline-stringops-dynamically
10147 For string operation of unknown size, inline runtime checks so for small
10148 blocks inline code is used, while for large blocks library call is used.
10149
10150 @item -mstringop-strategy=@var{alg}
10151 @opindex mstringop-strategy=@var{alg}
10152 Overwrite internal decision heuristic about particular algorithm to inline
10153 string operation with.  The allowed values are @code{rep_byte},
10154 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
10155 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
10156 expanding inline loop, @code{libcall} for always expanding library call.
10157
10158 @item -momit-leaf-frame-pointer
10159 @opindex momit-leaf-frame-pointer
10160 Don't keep the frame pointer in a register for leaf functions.  This
10161 avoids the instructions to save, set up and restore frame pointers and
10162 makes an extra register available in leaf functions.  The option
10163 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10164 which might make debugging harder.
10165
10166 @item -mtls-direct-seg-refs
10167 @itemx -mno-tls-direct-seg-refs
10168 @opindex mtls-direct-seg-refs
10169 Controls whether TLS variables may be accessed with offsets from the
10170 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
10171 or whether the thread base pointer must be added.  Whether or not this
10172 is legal depends on the operating system, and whether it maps the
10173 segment to cover the entire TLS area.
10174
10175 For systems that use GNU libc, the default is on.
10176 @end table
10177
10178 These @samp{-m} switches are supported in addition to the above
10179 on AMD x86-64 processors in 64-bit environments.
10180
10181 @table @gcctabopt
10182 @item -m32
10183 @itemx -m64
10184 @opindex m32
10185 @opindex m64
10186 Generate code for a 32-bit or 64-bit environment.
10187 The 32-bit environment sets int, long and pointer to 32 bits and
10188 generates code that runs on any i386 system.
10189 The 64-bit environment sets int to 32 bits and long and pointer
10190 to 64 bits and generates code for AMD's x86-64 architecture.
10191
10192 @item -mno-red-zone
10193 @opindex no-red-zone
10194 Do not use a so called red zone for x86-64 code.  The red zone is mandated
10195 by the x86-64 ABI, it is a 128-byte area beyond the location of the
10196 stack pointer that will not be modified by signal or interrupt handlers
10197 and therefore can be used for temporary data without adjusting the stack
10198 pointer.  The flag @option{-mno-red-zone} disables this red zone.
10199
10200 @item -mcmodel=small
10201 @opindex mcmodel=small
10202 Generate code for the small code model: the program and its symbols must
10203 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
10204 Programs can be statically or dynamically linked.  This is the default
10205 code model.
10206
10207 @item -mcmodel=kernel
10208 @opindex mcmodel=kernel
10209 Generate code for the kernel code model.  The kernel runs in the
10210 negative 2 GB of the address space.
10211 This model has to be used for Linux kernel code.
10212
10213 @item -mcmodel=medium
10214 @opindex mcmodel=medium
10215 Generate code for the medium model: The program is linked in the lower 2
10216 GB of the address space but symbols can be located anywhere in the
10217 address space.  Programs can be statically or dynamically linked, but
10218 building of shared libraries are not supported with the medium model.
10219
10220 @item -mcmodel=large
10221 @opindex mcmodel=large
10222 Generate code for the large model: This model makes no assumptions
10223 about addresses and sizes of sections.  
10224 @end table
10225
10226 @node IA-64 Options
10227 @subsection IA-64 Options
10228 @cindex IA-64 Options
10229
10230 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10231
10232 @table @gcctabopt
10233 @item -mbig-endian
10234 @opindex mbig-endian
10235 Generate code for a big endian target.  This is the default for HP-UX@.
10236
10237 @item -mlittle-endian
10238 @opindex mlittle-endian
10239 Generate code for a little endian target.  This is the default for AIX5
10240 and GNU/Linux.
10241
10242 @item -mgnu-as
10243 @itemx -mno-gnu-as
10244 @opindex mgnu-as
10245 @opindex mno-gnu-as
10246 Generate (or don't) code for the GNU assembler.  This is the default.
10247 @c Also, this is the default if the configure option @option{--with-gnu-as}
10248 @c is used.
10249
10250 @item -mgnu-ld
10251 @itemx -mno-gnu-ld
10252 @opindex mgnu-ld
10253 @opindex mno-gnu-ld
10254 Generate (or don't) code for the GNU linker.  This is the default.
10255 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10256 @c is used.
10257
10258 @item -mno-pic
10259 @opindex mno-pic
10260 Generate code that does not use a global pointer register.  The result
10261 is not position independent code, and violates the IA-64 ABI@.
10262
10263 @item -mvolatile-asm-stop
10264 @itemx -mno-volatile-asm-stop
10265 @opindex mvolatile-asm-stop
10266 @opindex mno-volatile-asm-stop
10267 Generate (or don't) a stop bit immediately before and after volatile asm
10268 statements.
10269
10270 @item -mregister-names
10271 @itemx -mno-register-names
10272 @opindex mregister-names
10273 @opindex mno-register-names
10274 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10275 the stacked registers.  This may make assembler output more readable.
10276
10277 @item -mno-sdata
10278 @itemx -msdata
10279 @opindex mno-sdata
10280 @opindex msdata
10281 Disable (or enable) optimizations that use the small data section.  This may
10282 be useful for working around optimizer bugs.
10283
10284 @item -mconstant-gp
10285 @opindex mconstant-gp
10286 Generate code that uses a single constant global pointer value.  This is
10287 useful when compiling kernel code.
10288
10289 @item -mauto-pic
10290 @opindex mauto-pic
10291 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10292 This is useful when compiling firmware code.
10293
10294 @item -minline-float-divide-min-latency
10295 @opindex minline-float-divide-min-latency
10296 Generate code for inline divides of floating point values
10297 using the minimum latency algorithm.
10298
10299 @item -minline-float-divide-max-throughput
10300 @opindex minline-float-divide-max-throughput
10301 Generate code for inline divides of floating point values
10302 using the maximum throughput algorithm.
10303
10304 @item -minline-int-divide-min-latency
10305 @opindex minline-int-divide-min-latency
10306 Generate code for inline divides of integer values
10307 using the minimum latency algorithm.
10308
10309 @item -minline-int-divide-max-throughput
10310 @opindex minline-int-divide-max-throughput
10311 Generate code for inline divides of integer values
10312 using the maximum throughput algorithm.
10313
10314 @item -minline-sqrt-min-latency
10315 @opindex minline-sqrt-min-latency
10316 Generate code for inline square roots
10317 using the minimum latency algorithm.
10318
10319 @item -minline-sqrt-max-throughput
10320 @opindex minline-sqrt-max-throughput
10321 Generate code for inline square roots
10322 using the maximum throughput algorithm.
10323
10324 @item -mno-dwarf2-asm
10325 @itemx -mdwarf2-asm
10326 @opindex mno-dwarf2-asm
10327 @opindex mdwarf2-asm
10328 Don't (or do) generate assembler code for the DWARF2 line number debugging
10329 info.  This may be useful when not using the GNU assembler.
10330
10331 @item -mearly-stop-bits
10332 @itemx -mno-early-stop-bits
10333 @opindex mearly-stop-bits
10334 @opindex mno-early-stop-bits
10335 Allow stop bits to be placed earlier than immediately preceding the
10336 instruction that triggered the stop bit.  This can improve instruction
10337 scheduling, but does not always do so.
10338
10339 @item -mfixed-range=@var{register-range}
10340 @opindex mfixed-range
10341 Generate code treating the given register range as fixed registers.
10342 A fixed register is one that the register allocator can not use.  This is
10343 useful when compiling kernel code.  A register range is specified as
10344 two registers separated by a dash.  Multiple register ranges can be
10345 specified separated by a comma.
10346
10347 @item -mtls-size=@var{tls-size}
10348 @opindex mtls-size
10349 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10350 64.
10351
10352 @item -mtune=@var{cpu-type}
10353 @opindex mtune
10354 Tune the instruction scheduling for a particular CPU, Valid values are
10355 itanium, itanium1, merced, itanium2, and mckinley.
10356
10357 @item -mt
10358 @itemx -pthread
10359 @opindex mt
10360 @opindex pthread
10361 Add support for multithreading using the POSIX threads library.  This
10362 option sets flags for both the preprocessor and linker.  It does
10363 not affect the thread safety of object code produced by the compiler or
10364 that of libraries supplied with it.  These are HP-UX specific flags.
10365
10366 @item -milp32
10367 @itemx -mlp64
10368 @opindex milp32
10369 @opindex mlp64
10370 Generate code for a 32-bit or 64-bit environment.
10371 The 32-bit environment sets int, long and pointer to 32 bits.
10372 The 64-bit environment sets int to 32 bits and long and pointer
10373 to 64 bits.  These are HP-UX specific flags.
10374
10375 @item -mno-sched-br-data-spec
10376 @itemx -msched-br-data-spec
10377 @opindex -mno-sched-br-data-spec
10378 @opindex -msched-br-data-spec
10379 (Dis/En)able data speculative scheduling before reload.
10380 This will result in generation of the ld.a instructions and
10381 the corresponding check instructions (ld.c / chk.a).
10382 The default is 'disable'.
10383
10384 @item -msched-ar-data-spec
10385 @itemx -mno-sched-ar-data-spec
10386 @opindex -msched-ar-data-spec
10387 @opindex -mno-sched-ar-data-spec
10388 (En/Dis)able data speculative scheduling after reload.
10389 This will result in generation of the ld.a instructions and
10390 the corresponding check instructions (ld.c / chk.a).
10391 The default is 'enable'.
10392
10393 @item -mno-sched-control-spec
10394 @itemx -msched-control-spec
10395 @opindex -mno-sched-control-spec
10396 @opindex -msched-control-spec
10397 (Dis/En)able control speculative scheduling.  This feature is
10398 available only during region scheduling (i.e. before reload).
10399 This will result in generation of the ld.s instructions and
10400 the corresponding check instructions chk.s .
10401 The default is 'disable'.
10402
10403 @item -msched-br-in-data-spec
10404 @itemx -mno-sched-br-in-data-spec
10405 @opindex -msched-br-in-data-spec
10406 @opindex -mno-sched-br-in-data-spec
10407 (En/Dis)able speculative scheduling of the instructions that
10408 are dependent on the data speculative loads before reload.
10409 This is effective only with @option{-msched-br-data-spec} enabled.
10410 The default is 'enable'.
10411
10412 @item -msched-ar-in-data-spec
10413 @itemx -mno-sched-ar-in-data-spec
10414 @opindex -msched-ar-in-data-spec
10415 @opindex -mno-sched-ar-in-data-spec
10416 (En/Dis)able speculative scheduling of the instructions that
10417 are dependent on the data speculative loads after reload.
10418 This is effective only with @option{-msched-ar-data-spec} enabled.
10419 The default is 'enable'.
10420
10421 @item -msched-in-control-spec
10422 @itemx -mno-sched-in-control-spec
10423 @opindex -msched-in-control-spec
10424 @opindex -mno-sched-in-control-spec
10425 (En/Dis)able speculative scheduling of the instructions that
10426 are dependent on the control speculative loads.
10427 This is effective only with @option{-msched-control-spec} enabled.
10428 The default is 'enable'.
10429
10430 @item -msched-ldc
10431 @itemx -mno-sched-ldc
10432 @opindex -msched-ldc
10433 @opindex -mno-sched-ldc
10434 (En/Dis)able use of simple data speculation checks ld.c .
10435 If disabled, only chk.a instructions will be emitted to check
10436 data speculative loads.
10437 The default is 'enable'.
10438
10439 @item -mno-sched-control-ldc
10440 @itemx -msched-control-ldc
10441 @opindex -mno-sched-control-ldc
10442 @opindex -msched-control-ldc 
10443 (Dis/En)able use of ld.c instructions to check control speculative loads.
10444 If enabled, in case of control speculative load with no speculatively
10445 scheduled dependent instructions this load will be emitted as ld.sa and
10446 ld.c will be used to check it.
10447 The default is 'disable'.
10448
10449 @item -mno-sched-spec-verbose
10450 @itemx -msched-spec-verbose
10451 @opindex -mno-sched-spec-verbose
10452 @opindex -msched-spec-verbose
10453 (Dis/En)able printing of the information about speculative motions.
10454
10455 @item -mno-sched-prefer-non-data-spec-insns
10456 @itemx -msched-prefer-non-data-spec-insns
10457 @opindex -mno-sched-prefer-non-data-spec-insns
10458 @opindex -msched-prefer-non-data-spec-insns
10459 If enabled, data speculative instructions will be chosen for schedule
10460 only if there are no other choices at the moment.  This will make
10461 the use of the data speculation much more conservative.
10462 The default is 'disable'.
10463
10464 @item -mno-sched-prefer-non-control-spec-insns
10465 @itemx -msched-prefer-non-control-spec-insns
10466 @opindex -mno-sched-prefer-non-control-spec-insns
10467 @opindex -msched-prefer-non-control-spec-insns
10468 If enabled, control speculative instructions will be chosen for schedule
10469 only if there are no other choices at the moment.  This will make
10470 the use of the control speculation much more conservative.
10471 The default is 'disable'.
10472
10473 @item -mno-sched-count-spec-in-critical-path
10474 @itemx -msched-count-spec-in-critical-path
10475 @opindex -mno-sched-count-spec-in-critical-path
10476 @opindex -msched-count-spec-in-critical-path
10477 If enabled, speculative dependencies will be considered during
10478 computation of the instructions priorities.  This will make the use of the
10479 speculation a bit more conservative.
10480 The default is 'disable'.
10481
10482 @end table
10483
10484 @node M32C Options
10485 @subsection M32C Options
10486 @cindex M32C options
10487
10488 @table @gcctabopt
10489 @item -mcpu=@var{name}
10490 @opindex mcpu=
10491 Select the CPU for which code is generated.  @var{name} may be one of
10492 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10493 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10494 the M32C/80 series.
10495
10496 @item -msim
10497 @opindex msim
10498 Specifies that the program will be run on the simulator.  This causes
10499 an alternate runtime library to be linked in which supports, for
10500 example, file I/O.  You must not use this option when generating
10501 programs that will run on real hardware; you must provide your own
10502 runtime library for whatever I/O functions are needed.
10503
10504 @item -memregs=@var{number}
10505 @opindex memregs=
10506 Specifies the number of memory-based pseudo-registers GCC will use
10507 during code generation.  These pseudo-registers will be used like real
10508 registers, so there is a tradeoff between GCC's ability to fit the
10509 code into available registers, and the performance penalty of using
10510 memory instead of registers.  Note that all modules in a program must
10511 be compiled with the same value for this option.  Because of that, you
10512 must not use this option with the default runtime libraries gcc
10513 builds.
10514
10515 @end table
10516
10517 @node M32R/D Options
10518 @subsection M32R/D Options
10519 @cindex M32R/D options
10520
10521 These @option{-m} options are defined for Renesas M32R/D architectures:
10522
10523 @table @gcctabopt
10524 @item -m32r2
10525 @opindex m32r2
10526 Generate code for the M32R/2@.
10527
10528 @item -m32rx
10529 @opindex m32rx
10530 Generate code for the M32R/X@.
10531
10532 @item -m32r
10533 @opindex m32r
10534 Generate code for the M32R@.  This is the default.
10535
10536 @item -mmodel=small
10537 @opindex mmodel=small
10538 Assume all objects live in the lower 16MB of memory (so that their addresses
10539 can be loaded with the @code{ld24} instruction), and assume all subroutines
10540 are reachable with the @code{bl} instruction.
10541 This is the default.
10542
10543 The addressability of a particular object can be set with the
10544 @code{model} attribute.
10545
10546 @item -mmodel=medium
10547 @opindex mmodel=medium
10548 Assume objects may be anywhere in the 32-bit address space (the compiler
10549 will generate @code{seth/add3} instructions to load their addresses), and
10550 assume all subroutines are reachable with the @code{bl} instruction.
10551
10552 @item -mmodel=large
10553 @opindex mmodel=large
10554 Assume objects may be anywhere in the 32-bit address space (the compiler
10555 will generate @code{seth/add3} instructions to load their addresses), and
10556 assume subroutines may not be reachable with the @code{bl} instruction
10557 (the compiler will generate the much slower @code{seth/add3/jl}
10558 instruction sequence).
10559
10560 @item -msdata=none
10561 @opindex msdata=none
10562 Disable use of the small data area.  Variables will be put into
10563 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10564 @code{section} attribute has been specified).
10565 This is the default.
10566
10567 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10568 Objects may be explicitly put in the small data area with the
10569 @code{section} attribute using one of these sections.
10570
10571 @item -msdata=sdata
10572 @opindex msdata=sdata
10573 Put small global and static data in the small data area, but do not
10574 generate special code to reference them.
10575
10576 @item -msdata=use
10577 @opindex msdata=use
10578 Put small global and static data in the small data area, and generate
10579 special instructions to reference them.
10580
10581 @item -G @var{num}
10582 @opindex G
10583 @cindex smaller data references
10584 Put global and static objects less than or equal to @var{num} bytes
10585 into the small data or bss sections instead of the normal data or bss
10586 sections.  The default value of @var{num} is 8.
10587 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10588 for this option to have any effect.
10589
10590 All modules should be compiled with the same @option{-G @var{num}} value.
10591 Compiling with different values of @var{num} may or may not work; if it
10592 doesn't the linker will give an error message---incorrect code will not be
10593 generated.
10594
10595 @item -mdebug
10596 @opindex mdebug
10597 Makes the M32R specific code in the compiler display some statistics
10598 that might help in debugging programs.
10599
10600 @item -malign-loops
10601 @opindex malign-loops
10602 Align all loops to a 32-byte boundary.
10603
10604 @item -mno-align-loops
10605 @opindex mno-align-loops
10606 Do not enforce a 32-byte alignment for loops.  This is the default.
10607
10608 @item -missue-rate=@var{number}
10609 @opindex missue-rate=@var{number}
10610 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10611 or 2.
10612
10613 @item -mbranch-cost=@var{number}
10614 @opindex mbranch-cost=@var{number}
10615 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10616 preferred over conditional code, if it is 2, then the opposite will
10617 apply.
10618
10619 @item -mflush-trap=@var{number}
10620 @opindex mflush-trap=@var{number}
10621 Specifies the trap number to use to flush the cache.  The default is
10622 12.  Valid numbers are between 0 and 15 inclusive.
10623
10624 @item -mno-flush-trap
10625 @opindex mno-flush-trap
10626 Specifies that the cache cannot be flushed by using a trap.
10627
10628 @item -mflush-func=@var{name}
10629 @opindex mflush-func=@var{name}
10630 Specifies the name of the operating system function to call to flush
10631 the cache.  The default is @emph{_flush_cache}, but a function call
10632 will only be used if a trap is not available.
10633
10634 @item -mno-flush-func
10635 @opindex mno-flush-func
10636 Indicates that there is no OS function for flushing the cache.
10637
10638 @end table
10639
10640 @node M680x0 Options
10641 @subsection M680x0 Options
10642 @cindex M680x0 options
10643
10644 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
10645 The default settings depend on which architecture was selected when
10646 the compiler was configured; the defaults for the most common choices
10647 are given below.
10648
10649 @table @gcctabopt
10650 @item -march=@var{arch}
10651 @opindex march
10652 Generate code for a specific M680x0 or ColdFire instruction set
10653 architecture.  Permissible values of @var{arch} for M680x0
10654 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
10655 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
10656 architectures are selected according to Freescale's ISA classification
10657 and the permissible values are: @samp{isaa}, @samp{isaaplus},
10658 @samp{isab} and @samp{isac}.
10659
10660 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
10661 code for a ColdFire target.  The @var{arch} in this macro is one of the
10662 @option{-march} arguments given above.
10663
10664 When used together, @option{-march} and @option{-mtune} select code
10665 that runs on a family of similar processors but that is optimized
10666 for a particular microarchitecture.
10667
10668 @item -mcpu=@var{cpu}
10669 @opindex mcpu
10670 Generate code for a specific M680x0 or ColdFire processor.
10671 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
10672 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
10673 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
10674 below, which also classifies the CPUs into families:
10675
10676 @multitable @columnfractions 0.20 0.80
10677 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
10678 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
10679 @item @samp{5206e} @tab @samp{5206e}
10680 @item @samp{5208} @tab @samp{5207} @samp{5208}
10681 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
10682 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
10683 @item @samp{5216} @tab @samp{5214} @samp{5216}
10684 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
10685 @item @samp{5225} @tab @samp{5224} @samp{5225}
10686 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
10687 @item @samp{5249} @tab @samp{5249}
10688 @item @samp{5250} @tab @samp{5250}
10689 @item @samp{5271} @tab @samp{5270} @samp{5271}
10690 @item @samp{5272} @tab @samp{5272}
10691 @item @samp{5275} @tab @samp{5274} @samp{5275}
10692 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
10693 @item @samp{5307} @tab @samp{5307}
10694 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
10695 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
10696 @item @samp{5407} @tab @samp{5407}
10697 @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}
10698 @end multitable
10699
10700 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
10701 @var{arch} is compatible with @var{cpu}.  Other combinations of
10702 @option{-mcpu} and @option{-march} are rejected.
10703
10704 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
10705 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
10706 where the value of @var{family} is given by the table above.
10707
10708 @item -mtune=@var{tune}
10709 @opindex mtune
10710 Tune the code for a particular microarchitecture, within the
10711 constraints set by @option{-march} and @option{-mcpu}.
10712 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
10713 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
10714 and @samp{cpu32}.  The ColdFire microarchitectures
10715 are: @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
10716
10717 You can also use @option{-mtune=68020-40} for code that needs
10718 to run relatively well on 68020, 68030 and 68040 targets.
10719 @option{-mtune=68020-60} is similar but includes 68060 targets
10720 as well.  These two options select the same tuning decisions as
10721 @option{-m68020-40} and @option{-m68020-60} respectively.
10722
10723 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
10724 when tuning for 680x0 architecture @var{arch}.  It also defines
10725 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
10726 option is used.  If gcc is tuning for a range of architectures,
10727 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
10728 it defines the macros for every architecture in the range.
10729
10730 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
10731 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
10732 of the arguments given above.
10733
10734 @item -m68000
10735 @itemx -mc68000
10736 @opindex m68000
10737 @opindex mc68000
10738 Generate output for a 68000.  This is the default
10739 when the compiler is configured for 68000-based systems.
10740 It is equivalent to @option{-march=68000}.
10741
10742 Use this option for microcontrollers with a 68000 or EC000 core,
10743 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10744
10745 @item -m68010
10746 @opindex m68010
10747 Generate output for a 68010.  This is the default
10748 when the compiler is configured for 68010-based systems.
10749 It is equivalent to @option{-march=68010}.
10750
10751 @item -m68020
10752 @itemx -mc68020
10753 @opindex m68020
10754 @opindex mc68020
10755 Generate output for a 68020.  This is the default
10756 when the compiler is configured for 68020-based systems.
10757 It is equivalent to @option{-march=68020}.
10758
10759 @item -m68030
10760 @opindex m68030
10761 Generate output for a 68030.  This is the default when the compiler is
10762 configured for 68030-based systems.  It is equivalent to
10763 @option{-march=68030}.
10764
10765 @item -m68040
10766 @opindex m68040
10767 Generate output for a 68040.  This is the default when the compiler is
10768 configured for 68040-based systems.  It is equivalent to
10769 @option{-march=68040}.
10770
10771 This option inhibits the use of 68881/68882 instructions that have to be
10772 emulated by software on the 68040.  Use this option if your 68040 does not
10773 have code to emulate those instructions.
10774
10775 @item -m68060
10776 @opindex m68060
10777 Generate output for a 68060.  This is the default when the compiler is
10778 configured for 68060-based systems.  It is equivalent to
10779 @option{-march=68060}.
10780
10781 This option inhibits the use of 68020 and 68881/68882 instructions that
10782 have to be emulated by software on the 68060.  Use this option if your 68060
10783 does not have code to emulate those instructions.
10784
10785 @item -mcpu32
10786 @opindex mcpu32
10787 Generate output for a CPU32.  This is the default
10788 when the compiler is configured for CPU32-based systems.
10789 It is equivalent to @option{-march=cpu32}.
10790
10791 Use this option for microcontrollers with a
10792 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
10793 68336, 68340, 68341, 68349 and 68360.
10794
10795 @item -m5200
10796 @opindex m5200
10797 Generate output for a 520X ColdFire CPU.  This is the default
10798 when the compiler is configured for 520X-based systems.
10799 It is equivalent to @option{-mcpu=5206}, and is now deprecated
10800 in favor of that option.
10801
10802 Use this option for microcontroller with a 5200 core, including
10803 the MCF5202, MCF5203, MCF5204 and MCF5206.
10804
10805 @item -m5206e
10806 @opindex m5206e
10807 Generate output for a 5206e ColdFire CPU.  The option is now
10808 deprecated in favor of the equivalent @option{-mcpu=5206e}.
10809
10810 @item -m528x
10811 @opindex m528x
10812 Generate output for a member of the ColdFire 528X family.
10813 The option is now deprecated in favor of the equivalent
10814 @option{-mcpu=528x}.
10815
10816 @item -m5307
10817 @opindex m5307
10818 Generate output for a ColdFire 5307 CPU.  The option is now deprecated
10819 in favor of the equivalent @option{-mcpu=5307}.
10820
10821 @item -m5407
10822 @opindex m5407
10823 Generate output for a ColdFire 5407 CPU.  The option is now deprecated
10824 in favor of the equivalent @option{-mcpu=5407}.
10825
10826 @item -mcfv4e
10827 @opindex mcfv4e
10828 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
10829 This includes use of hardware floating point instructions.
10830 The option is equivalent to @option{-mcpu=547x}, and is now
10831 deprecated in favor of that option.
10832
10833 @item -m68020-40
10834 @opindex m68020-40
10835 Generate output for a 68040, without using any of the new instructions.
10836 This results in code which can run relatively efficiently on either a
10837 68020/68881 or a 68030 or a 68040.  The generated code does use the
10838 68881 instructions that are emulated on the 68040.
10839
10840 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
10841
10842 @item -m68020-60
10843 @opindex m68020-60
10844 Generate output for a 68060, without using any of the new instructions.
10845 This results in code which can run relatively efficiently on either a
10846 68020/68881 or a 68030 or a 68040.  The generated code does use the
10847 68881 instructions that are emulated on the 68060.
10848
10849 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
10850
10851 @item -mhard-float
10852 @itemx -m68881
10853 @opindex mhard-float
10854 @opindex m68881
10855 Generate floating-point instructions.  This is the default for 68020
10856 and above, and for ColdFire devices that have an FPU.  It defines the
10857 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
10858 on ColdFire targets.
10859
10860 @item -msoft-float
10861 @opindex msoft-float
10862 Do not generate floating-point instructions; use library calls instead.
10863 This is the default for 68000, 68010, and 68832 targets.  It is also
10864 the default for ColdFire devices that have no FPU.
10865
10866 @item -mdiv
10867 @itemx -mno-div
10868 @opindex mdiv
10869 @opindex mno-div
10870 Generate (do not generate) ColdFire hardware divide and remainder
10871 instructions.  If @option{-march} is used without @option{-mcpu},
10872 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
10873 architectures.  Otherwise, the default is taken from the target CPU
10874 (either the default CPU, or the one specified by @option{-mcpu}).  For
10875 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
10876 @option{-mcpu=5206e}.
10877
10878 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
10879
10880 @item -mshort
10881 @opindex mshort
10882 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10883 Additionally, parameters passed on the stack are also aligned to a
10884 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10885
10886 @item -mno-short
10887 @opindex -mno-short
10888 Do not consider type @code{int} to be 16 bits wide.  This is the default.
10889
10890 @item -mnobitfield
10891 @itemx -mno-bitfield
10892 @opindex mnobitfield
10893 @opindex mno-bitfield
10894 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10895 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10896
10897 @item -mbitfield
10898 @opindex mbitfield
10899 Do use the bit-field instructions.  The @option{-m68020} option implies
10900 @option{-mbitfield}.  This is the default if you use a configuration
10901 designed for a 68020.
10902
10903 @item -mrtd
10904 @opindex mrtd
10905 Use a different function-calling convention, in which functions
10906 that take a fixed number of arguments return with the @code{rtd}
10907 instruction, which pops their arguments while returning.  This
10908 saves one instruction in the caller since there is no need to pop
10909 the arguments there.
10910
10911 This calling convention is incompatible with the one normally
10912 used on Unix, so you cannot use it if you need to call libraries
10913 compiled with the Unix compiler.
10914
10915 Also, you must provide function prototypes for all functions that
10916 take variable numbers of arguments (including @code{printf});
10917 otherwise incorrect code will be generated for calls to those
10918 functions.
10919
10920 In addition, seriously incorrect code will result if you call a
10921 function with too many arguments.  (Normally, extra arguments are
10922 harmlessly ignored.)
10923
10924 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10925 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10926
10927 @item -mno-rtd
10928 @opindex mno-rtd
10929 Do not use the calling conventions selected by @option{-mrtd}.
10930 This is the default.
10931
10932 @item -malign-int
10933 @itemx -mno-align-int
10934 @opindex malign-int
10935 @opindex mno-align-int
10936 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10937 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10938 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10939 Aligning variables on 32-bit boundaries produces code that runs somewhat
10940 faster on processors with 32-bit busses at the expense of more memory.
10941
10942 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
10943 align structures containing the above types  differently than
10944 most published application binary interface specifications for the m68k.
10945
10946 @item -mpcrel
10947 @opindex mpcrel
10948 Use the pc-relative addressing mode of the 68000 directly, instead of
10949 using a global offset table.  At present, this option implies @option{-fpic},
10950 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
10951 not presently supported with @option{-mpcrel}, though this could be supported for
10952 68020 and higher processors.
10953
10954 @item -mno-strict-align
10955 @itemx -mstrict-align
10956 @opindex mno-strict-align
10957 @opindex mstrict-align
10958 Do not (do) assume that unaligned memory references will be handled by
10959 the system.
10960
10961 @item -msep-data
10962 Generate code that allows the data segment to be located in a different
10963 area of memory from the text segment.  This allows for execute in place in
10964 an environment without virtual memory management.  This option implies
10965 @option{-fPIC}.
10966
10967 @item -mno-sep-data
10968 Generate code that assumes that the data segment follows the text segment.
10969 This is the default.
10970
10971 @item -mid-shared-library
10972 Generate code that supports shared libraries via the library ID method.
10973 This allows for execute in place and shared libraries in an environment
10974 without virtual memory management.  This option implies @option{-fPIC}.
10975
10976 @item -mno-id-shared-library
10977 Generate code that doesn't assume ID based shared libraries are being used.
10978 This is the default.
10979
10980 @item -mshared-library-id=n
10981 Specified the identification number of the ID based shared library being
10982 compiled.  Specifying a value of 0 will generate more compact code, specifying
10983 other values will force the allocation of that number to the current
10984 library but is no more space or time efficient than omitting this option.
10985
10986 @end table
10987
10988 @node M68hc1x Options
10989 @subsection M68hc1x Options
10990 @cindex M68hc1x options
10991
10992 These are the @samp{-m} options defined for the 68hc11 and 68hc12
10993 microcontrollers.  The default values for these options depends on
10994 which style of microcontroller was selected when the compiler was configured;
10995 the defaults for the most common choices are given below.
10996
10997 @table @gcctabopt
10998 @item -m6811
10999 @itemx -m68hc11
11000 @opindex m6811
11001 @opindex m68hc11
11002 Generate output for a 68HC11.  This is the default
11003 when the compiler is configured for 68HC11-based systems.
11004
11005 @item -m6812
11006 @itemx -m68hc12
11007 @opindex m6812
11008 @opindex m68hc12
11009 Generate output for a 68HC12.  This is the default
11010 when the compiler is configured for 68HC12-based systems.
11011
11012 @item -m68S12
11013 @itemx -m68hcs12
11014 @opindex m68S12
11015 @opindex m68hcs12
11016 Generate output for a 68HCS12.
11017
11018 @item -mauto-incdec
11019 @opindex mauto-incdec
11020 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
11021 addressing modes.
11022
11023 @item -minmax
11024 @itemx -nominmax
11025 @opindex minmax
11026 @opindex mnominmax
11027 Enable the use of 68HC12 min and max instructions.
11028
11029 @item -mlong-calls
11030 @itemx -mno-long-calls
11031 @opindex mlong-calls
11032 @opindex mno-long-calls
11033 Treat all calls as being far away (near).  If calls are assumed to be
11034 far away, the compiler will use the @code{call} instruction to
11035 call a function and the @code{rtc} instruction for returning.
11036
11037 @item -mshort
11038 @opindex mshort
11039 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11040
11041 @item -msoft-reg-count=@var{count}
11042 @opindex msoft-reg-count
11043 Specify the number of pseudo-soft registers which are used for the
11044 code generation.  The maximum number is 32.  Using more pseudo-soft
11045 register may or may not result in better code depending on the program.
11046 The default is 4 for 68HC11 and 2 for 68HC12.
11047
11048 @end table
11049
11050 @node MCore Options
11051 @subsection MCore Options
11052 @cindex MCore options
11053
11054 These are the @samp{-m} options defined for the Motorola M*Core
11055 processors.
11056
11057 @table @gcctabopt
11058
11059 @item -mhardlit
11060 @itemx -mno-hardlit
11061 @opindex mhardlit
11062 @opindex mno-hardlit
11063 Inline constants into the code stream if it can be done in two
11064 instructions or less.
11065
11066 @item -mdiv
11067 @itemx -mno-div
11068 @opindex mdiv
11069 @opindex mno-div
11070 Use the divide instruction.  (Enabled by default).
11071
11072 @item -mrelax-immediate
11073 @itemx -mno-relax-immediate
11074 @opindex mrelax-immediate
11075 @opindex mno-relax-immediate
11076 Allow arbitrary sized immediates in bit operations.
11077
11078 @item -mwide-bitfields
11079 @itemx -mno-wide-bitfields
11080 @opindex mwide-bitfields
11081 @opindex mno-wide-bitfields
11082 Always treat bit-fields as int-sized.
11083
11084 @item -m4byte-functions
11085 @itemx -mno-4byte-functions
11086 @opindex m4byte-functions
11087 @opindex mno-4byte-functions
11088 Force all functions to be aligned to a four byte boundary.
11089
11090 @item -mcallgraph-data
11091 @itemx -mno-callgraph-data
11092 @opindex mcallgraph-data
11093 @opindex mno-callgraph-data
11094 Emit callgraph information.
11095
11096 @item -mslow-bytes
11097 @itemx -mno-slow-bytes
11098 @opindex mslow-bytes
11099 @opindex mno-slow-bytes
11100 Prefer word access when reading byte quantities.
11101
11102 @item -mlittle-endian
11103 @itemx -mbig-endian
11104 @opindex mlittle-endian
11105 @opindex mbig-endian
11106 Generate code for a little endian target.
11107
11108 @item -m210
11109 @itemx -m340
11110 @opindex m210
11111 @opindex m340
11112 Generate code for the 210 processor.
11113 @end table
11114
11115 @node MIPS Options
11116 @subsection MIPS Options
11117 @cindex MIPS options
11118
11119 @table @gcctabopt
11120
11121 @item -EB
11122 @opindex EB
11123 Generate big-endian code.
11124
11125 @item -EL
11126 @opindex EL
11127 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
11128 configurations.
11129
11130 @item -march=@var{arch}
11131 @opindex march
11132 Generate code that will run on @var{arch}, which can be the name of a
11133 generic MIPS ISA, or the name of a particular processor.
11134 The ISA names are:
11135 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
11136 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
11137 The processor names are:
11138 @samp{4kc}, @samp{4km}, @samp{4kp},
11139 @samp{4kec}, @samp{4kem}, @samp{4kep},
11140 @samp{5kc}, @samp{5kf},
11141 @samp{20kc},
11142 @samp{24kc}, @samp{24kf}, @samp{24kx},
11143 @samp{24kec}, @samp{24kef}, @samp{24kex},
11144 @samp{34kc}, @samp{34kf}, @samp{34kx},
11145 @samp{m4k},
11146 @samp{orion},
11147 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
11148 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
11149 @samp{rm7000}, @samp{rm9000},
11150 @samp{sb1},
11151 @samp{sr71000},
11152 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
11153 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
11154 The special value @samp{from-abi} selects the
11155 most compatible architecture for the selected ABI (that is,
11156 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
11157
11158 In processor names, a final @samp{000} can be abbreviated as @samp{k}
11159 (for example, @samp{-march=r2k}).  Prefixes are optional, and
11160 @samp{vr} may be written @samp{r}.
11161
11162 GCC defines two macros based on the value of this option.  The first
11163 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
11164 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
11165 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
11166 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
11167 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
11168
11169 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
11170 above.  In other words, it will have the full prefix and will not
11171 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
11172 the macro names the resolved architecture (either @samp{"mips1"} or
11173 @samp{"mips3"}).  It names the default architecture when no
11174 @option{-march} option is given.
11175
11176 @item -mtune=@var{arch}
11177 @opindex mtune
11178 Optimize for @var{arch}.  Among other things, this option controls
11179 the way instructions are scheduled, and the perceived cost of arithmetic
11180 operations.  The list of @var{arch} values is the same as for
11181 @option{-march}.
11182
11183 When this option is not used, GCC will optimize for the processor
11184 specified by @option{-march}.  By using @option{-march} and
11185 @option{-mtune} together, it is possible to generate code that will
11186 run on a family of processors, but optimize the code for one
11187 particular member of that family.
11188
11189 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
11190 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
11191 @samp{-march} ones described above.
11192
11193 @item -mips1
11194 @opindex mips1
11195 Equivalent to @samp{-march=mips1}.
11196
11197 @item -mips2
11198 @opindex mips2
11199 Equivalent to @samp{-march=mips2}.
11200
11201 @item -mips3
11202 @opindex mips3
11203 Equivalent to @samp{-march=mips3}.
11204
11205 @item -mips4
11206 @opindex mips4
11207 Equivalent to @samp{-march=mips4}.
11208
11209 @item -mips32
11210 @opindex mips32
11211 Equivalent to @samp{-march=mips32}.
11212
11213 @item -mips32r2
11214 @opindex mips32r2
11215 Equivalent to @samp{-march=mips32r2}.
11216
11217 @item -mips64
11218 @opindex mips64
11219 Equivalent to @samp{-march=mips64}.
11220
11221 @item -mips16
11222 @itemx -mno-mips16
11223 @opindex mips16
11224 @opindex mno-mips16
11225 Generate (do not generate) MIPS16 code.  If GCC is targetting a
11226 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
11227
11228 @item -mabi=32
11229 @itemx -mabi=o64
11230 @itemx -mabi=n32
11231 @itemx -mabi=64
11232 @itemx -mabi=eabi
11233 @opindex mabi=32
11234 @opindex mabi=o64
11235 @opindex mabi=n32
11236 @opindex mabi=64
11237 @opindex mabi=eabi
11238 Generate code for the given ABI@.
11239
11240 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
11241 generates 64-bit code when you select a 64-bit architecture, but you
11242 can use @option{-mgp32} to get 32-bit code instead.
11243
11244 For information about the O64 ABI, see
11245 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
11246
11247 GCC supports a variant of the o32 ABI in which floating-point registers
11248 are 64 rather than 32 bits wide.  You can select this combination with
11249 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
11250 and @samp{mfhc1} instructions and is therefore only supported for
11251 MIPS32R2 processors.
11252
11253 The register assignments for arguments and return values remain the
11254 same, but each scalar value is passed in a single 64-bit register
11255 rather than a pair of 32-bit registers.  For example, scalar
11256 floating-point values are returned in @samp{$f0} only, not a
11257 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
11258 remains the same, but all 64 bits are saved.
11259
11260 @item -mabicalls
11261 @itemx -mno-abicalls
11262 @opindex mabicalls
11263 @opindex mno-abicalls
11264 Generate (do not generate) code that is suitable for SVR4-style
11265 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
11266 systems.
11267
11268 @item -mshared
11269 @itemx -mno-shared
11270 Generate (do not generate) code that is fully position-independent,
11271 and that can therefore be linked into shared libraries.  This option
11272 only affects @option{-mabicalls}.
11273
11274 All @option{-mabicalls} code has traditionally been position-independent,
11275 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
11276 as an extension, the GNU toolchain allows executables to use absolute
11277 accesses for locally-binding symbols.  It can also use shorter GP
11278 initialization sequences and generate direct calls to locally-defined
11279 functions.  This mode is selected by @option{-mno-shared}.
11280
11281 @option{-mno-shared} depends on binutils 2.16 or higher and generates
11282 objects that can only be linked by the GNU linker.  However, the option
11283 does not affect the ABI of the final executable; it only affects the ABI
11284 of relocatable objects.  Using @option{-mno-shared} will generally make
11285 executables both smaller and quicker.
11286
11287 @option{-mshared} is the default.
11288
11289 @item -mxgot
11290 @itemx -mno-xgot
11291 @opindex mxgot
11292 @opindex mno-xgot
11293 Lift (do not lift) the usual restrictions on the size of the global
11294 offset table.
11295
11296 GCC normally uses a single instruction to load values from the GOT@.
11297 While this is relatively efficient, it will only work if the GOT
11298 is smaller than about 64k.  Anything larger will cause the linker
11299 to report an error such as:
11300
11301 @cindex relocation truncated to fit (MIPS)
11302 @smallexample
11303 relocation truncated to fit: R_MIPS_GOT16 foobar
11304 @end smallexample
11305
11306 If this happens, you should recompile your code with @option{-mxgot}.
11307 It should then work with very large GOTs, although it will also be
11308 less efficient, since it will take three instructions to fetch the
11309 value of a global symbol.
11310
11311 Note that some linkers can create multiple GOTs.  If you have such a
11312 linker, you should only need to use @option{-mxgot} when a single object
11313 file accesses more than 64k's worth of GOT entries.  Very few do.
11314
11315 These options have no effect unless GCC is generating position
11316 independent code.
11317
11318 @item -mgp32
11319 @opindex mgp32
11320 Assume that general-purpose registers are 32 bits wide.
11321
11322 @item -mgp64
11323 @opindex mgp64
11324 Assume that general-purpose registers are 64 bits wide.
11325
11326 @item -mfp32
11327 @opindex mfp32
11328 Assume that floating-point registers are 32 bits wide.
11329
11330 @item -mfp64
11331 @opindex mfp64
11332 Assume that floating-point registers are 64 bits wide.
11333
11334 @item -mhard-float
11335 @opindex mhard-float
11336 Use floating-point coprocessor instructions.
11337
11338 @item -msoft-float
11339 @opindex msoft-float
11340 Do not use floating-point coprocessor instructions.  Implement
11341 floating-point calculations using library calls instead.
11342
11343 @item -msingle-float
11344 @opindex msingle-float
11345 Assume that the floating-point coprocessor only supports single-precision
11346 operations.
11347
11348 @itemx -mdouble-float
11349 @opindex mdouble-float
11350 Assume that the floating-point coprocessor supports double-precision
11351 operations.  This is the default.
11352
11353 @itemx -mdsp
11354 @itemx -mno-dsp
11355 @opindex mdsp
11356 @opindex mno-dsp
11357 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
11358
11359 @itemx -mdspr2
11360 @itemx -mno-dspr2
11361 @opindex mdspr2
11362 @opindex mno-dspr2
11363 Use (do not use) the MIPS DSP ASE REV 2.  @xref{MIPS DSP Built-in Functions}.
11364 The option @option{-mdspr2} implies @option{-mdsp}.
11365
11366 @itemx -mpaired-single
11367 @itemx -mno-paired-single
11368 @opindex mpaired-single
11369 @opindex mno-paired-single
11370 Use (do not use) paired-single floating-point instructions.
11371 @xref{MIPS Paired-Single Support}.  This option can only be used
11372 when generating 64-bit code and requires hardware floating-point
11373 support to be enabled.
11374
11375 @itemx -mips3d
11376 @itemx -mno-mips3d
11377 @opindex mips3d
11378 @opindex mno-mips3d
11379 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
11380 The option @option{-mips3d} implies @option{-mpaired-single}.
11381
11382 @item -mlong64
11383 @opindex mlong64
11384 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
11385 an explanation of the default and the way that the pointer size is
11386 determined.
11387
11388 @item -mlong32
11389 @opindex mlong32
11390 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
11391
11392 The default size of @code{int}s, @code{long}s and pointers depends on
11393 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
11394 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
11395 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
11396 or the same size as integer registers, whichever is smaller.
11397
11398 @item -msym32
11399 @itemx -mno-sym32
11400 @opindex msym32
11401 @opindex mno-sym32
11402 Assume (do not assume) that all symbols have 32-bit values, regardless
11403 of the selected ABI@.  This option is useful in combination with
11404 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11405 to generate shorter and faster references to symbolic addresses.
11406
11407 @item -G @var{num}
11408 @opindex G
11409 @cindex smaller data references (MIPS)
11410 @cindex gp-relative references (MIPS)
11411 Put global and static items less than or equal to @var{num} bytes into
11412 the small data or bss section instead of the normal data or bss section.
11413 This allows the data to be accessed using a single instruction.
11414
11415 All modules should be compiled with the same @option{-G @var{num}}
11416 value.
11417
11418 @item -membedded-data
11419 @itemx -mno-embedded-data
11420 @opindex membedded-data
11421 @opindex mno-embedded-data
11422 Allocate variables to the read-only data section first if possible, then
11423 next in the small data section if possible, otherwise in data.  This gives
11424 slightly slower code than the default, but reduces the amount of RAM required
11425 when executing, and thus may be preferred for some embedded systems.
11426
11427 @item -muninit-const-in-rodata
11428 @itemx -mno-uninit-const-in-rodata
11429 @opindex muninit-const-in-rodata
11430 @opindex mno-uninit-const-in-rodata
11431 Put uninitialized @code{const} variables in the read-only data section.
11432 This option is only meaningful in conjunction with @option{-membedded-data}.
11433
11434 @item -msplit-addresses
11435 @itemx -mno-split-addresses
11436 @opindex msplit-addresses
11437 @opindex mno-split-addresses
11438 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
11439 relocation operators.  This option has been superseded by
11440 @option{-mexplicit-relocs} but is retained for backwards compatibility.
11441
11442 @item -mexplicit-relocs
11443 @itemx -mno-explicit-relocs
11444 @opindex mexplicit-relocs
11445 @opindex mno-explicit-relocs
11446 Use (do not use) assembler relocation operators when dealing with symbolic
11447 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
11448 is to use assembler macros instead.
11449
11450 @option{-mexplicit-relocs} is the default if GCC was configured
11451 to use an assembler that supports relocation operators.
11452
11453 @item -mcheck-zero-division
11454 @itemx -mno-check-zero-division
11455 @opindex mcheck-zero-division
11456 @opindex mno-check-zero-division
11457 Trap (do not trap) on integer division by zero.
11458
11459 The default is @option{-mcheck-zero-division}.
11460
11461 @item -mdivide-traps
11462 @itemx -mdivide-breaks
11463 @opindex mdivide-traps
11464 @opindex mdivide-breaks
11465 MIPS systems check for division by zero by generating either a
11466 conditional trap or a break instruction.  Using traps results in
11467 smaller code, but is only supported on MIPS II and later.  Also, some
11468 versions of the Linux kernel have a bug that prevents trap from
11469 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
11470 allow conditional traps on architectures that support them and
11471 @option{-mdivide-breaks} to force the use of breaks.
11472
11473 The default is usually @option{-mdivide-traps}, but this can be
11474 overridden at configure time using @option{--with-divide=breaks}.
11475 Divide-by-zero checks can be completely disabled using
11476 @option{-mno-check-zero-division}.
11477
11478 @item -mmemcpy
11479 @itemx -mno-memcpy
11480 @opindex mmemcpy
11481 @opindex mno-memcpy
11482 Force (do not force) the use of @code{memcpy()} for non-trivial block
11483 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
11484 most constant-sized copies.
11485
11486 @item -mlong-calls
11487 @itemx -mno-long-calls
11488 @opindex mlong-calls
11489 @opindex mno-long-calls
11490 Disable (do not disable) use of the @code{jal} instruction.  Calling
11491 functions using @code{jal} is more efficient but requires the caller
11492 and callee to be in the same 256 megabyte segment.
11493
11494 This option has no effect on abicalls code.  The default is
11495 @option{-mno-long-calls}.
11496
11497 @item -mmad
11498 @itemx -mno-mad
11499 @opindex mmad
11500 @opindex mno-mad
11501 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
11502 instructions, as provided by the R4650 ISA@.
11503
11504 @item -mfused-madd
11505 @itemx -mno-fused-madd
11506 @opindex mfused-madd
11507 @opindex mno-fused-madd
11508 Enable (disable) use of the floating point multiply-accumulate
11509 instructions, when they are available.  The default is
11510 @option{-mfused-madd}.
11511
11512 When multiply-accumulate instructions are used, the intermediate
11513 product is calculated to infinite precision and is not subject to
11514 the FCSR Flush to Zero bit.  This may be undesirable in some
11515 circumstances.
11516
11517 @item -nocpp
11518 @opindex nocpp
11519 Tell the MIPS assembler to not run its preprocessor over user
11520 assembler files (with a @samp{.s} suffix) when assembling them.
11521
11522 @item -mfix-r4000
11523 @itemx -mno-fix-r4000
11524 @opindex mfix-r4000
11525 @opindex mno-fix-r4000
11526 Work around certain R4000 CPU errata:
11527 @itemize @minus
11528 @item
11529 A double-word or a variable shift may give an incorrect result if executed
11530 immediately after starting an integer division.
11531 @item
11532 A double-word or a variable shift may give an incorrect result if executed
11533 while an integer multiplication is in progress.
11534 @item
11535 An integer division may give an incorrect result if started in a delay slot
11536 of a taken branch or a jump.
11537 @end itemize
11538
11539 @item -mfix-r4400
11540 @itemx -mno-fix-r4400
11541 @opindex mfix-r4400
11542 @opindex mno-fix-r4400
11543 Work around certain R4400 CPU errata:
11544 @itemize @minus
11545 @item
11546 A double-word or a variable shift may give an incorrect result if executed
11547 immediately after starting an integer division.
11548 @end itemize
11549
11550 @item -mfix-vr4120
11551 @itemx -mno-fix-vr4120
11552 @opindex mfix-vr4120
11553 Work around certain VR4120 errata:
11554 @itemize @minus
11555 @item
11556 @code{dmultu} does not always produce the correct result.
11557 @item
11558 @code{div} and @code{ddiv} do not always produce the correct result if one
11559 of the operands is negative.
11560 @end itemize
11561 The workarounds for the division errata rely on special functions in
11562 @file{libgcc.a}.  At present, these functions are only provided by
11563 the @code{mips64vr*-elf} configurations.
11564
11565 Other VR4120 errata require a nop to be inserted between certain pairs of
11566 instructions.  These errata are handled by the assembler, not by GCC itself.
11567
11568 @item -mfix-vr4130
11569 @opindex mfix-vr4130
11570 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11571 workarounds are implemented by the assembler rather than by GCC,
11572 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11573 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11574 instructions are available instead.
11575
11576 @item -mfix-sb1
11577 @itemx -mno-fix-sb1
11578 @opindex mfix-sb1
11579 Work around certain SB-1 CPU core errata.
11580 (This flag currently works around the SB-1 revision 2
11581 ``F1'' and ``F2'' floating point errata.)
11582
11583 @item -mflush-func=@var{func}
11584 @itemx -mno-flush-func
11585 @opindex mflush-func
11586 Specifies the function to call to flush the I and D caches, or to not
11587 call any such function.  If called, the function must take the same
11588 arguments as the common @code{_flush_func()}, that is, the address of the
11589 memory range for which the cache is being flushed, the size of the
11590 memory range, and the number 3 (to flush both caches).  The default
11591 depends on the target GCC was configured for, but commonly is either
11592 @samp{_flush_func} or @samp{__cpu_flush}.
11593
11594 @item -mbranch-likely
11595 @itemx -mno-branch-likely
11596 @opindex mbranch-likely
11597 @opindex mno-branch-likely
11598 Enable or disable use of Branch Likely instructions, regardless of the
11599 default for the selected architecture.  By default, Branch Likely
11600 instructions may be generated if they are supported by the selected
11601 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11602 and processors which implement those architectures; for those, Branch
11603 Likely instructions will not be generated by default because the MIPS32
11604 and MIPS64 architectures specifically deprecate their use.
11605
11606 @item -mfp-exceptions
11607 @itemx -mno-fp-exceptions
11608 @opindex mfp-exceptions
11609 Specifies whether FP exceptions are enabled.  This affects how we schedule
11610 FP instructions for some processors.  The default is that FP exceptions are
11611 enabled.
11612
11613 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11614 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11615 FP pipe.
11616
11617 @item -mvr4130-align
11618 @itemx -mno-vr4130-align
11619 @opindex mvr4130-align
11620 The VR4130 pipeline is two-way superscalar, but can only issue two
11621 instructions together if the first one is 8-byte aligned.  When this
11622 option is enabled, GCC will align pairs of instructions that it
11623 thinks should execute in parallel.
11624
11625 This option only has an effect when optimizing for the VR4130.
11626 It normally makes code faster, but at the expense of making it bigger.
11627 It is enabled by default at optimization level @option{-O3}.
11628 @end table
11629
11630 @node MMIX Options
11631 @subsection MMIX Options
11632 @cindex MMIX Options
11633
11634 These options are defined for the MMIX:
11635
11636 @table @gcctabopt
11637 @item -mlibfuncs
11638 @itemx -mno-libfuncs
11639 @opindex mlibfuncs
11640 @opindex mno-libfuncs
11641 Specify that intrinsic library functions are being compiled, passing all
11642 values in registers, no matter the size.
11643
11644 @item -mepsilon
11645 @itemx -mno-epsilon
11646 @opindex mepsilon
11647 @opindex mno-epsilon
11648 Generate floating-point comparison instructions that compare with respect
11649 to the @code{rE} epsilon register.
11650
11651 @item -mabi=mmixware
11652 @itemx -mabi=gnu
11653 @opindex mabi-mmixware
11654 @opindex mabi=gnu
11655 Generate code that passes function parameters and return values that (in
11656 the called function) are seen as registers @code{$0} and up, as opposed to
11657 the GNU ABI which uses global registers @code{$231} and up.
11658
11659 @item -mzero-extend
11660 @itemx -mno-zero-extend
11661 @opindex mzero-extend
11662 @opindex mno-zero-extend
11663 When reading data from memory in sizes shorter than 64 bits, use (do not
11664 use) zero-extending load instructions by default, rather than
11665 sign-extending ones.
11666
11667 @item -mknuthdiv
11668 @itemx -mno-knuthdiv
11669 @opindex mknuthdiv
11670 @opindex mno-knuthdiv
11671 Make the result of a division yielding a remainder have the same sign as
11672 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11673 remainder follows the sign of the dividend.  Both methods are
11674 arithmetically valid, the latter being almost exclusively used.
11675
11676 @item -mtoplevel-symbols
11677 @itemx -mno-toplevel-symbols
11678 @opindex mtoplevel-symbols
11679 @opindex mno-toplevel-symbols
11680 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11681 code can be used with the @code{PREFIX} assembly directive.
11682
11683 @item -melf
11684 @opindex melf
11685 Generate an executable in the ELF format, rather than the default
11686 @samp{mmo} format used by the @command{mmix} simulator.
11687
11688 @item -mbranch-predict
11689 @itemx -mno-branch-predict
11690 @opindex mbranch-predict
11691 @opindex mno-branch-predict
11692 Use (do not use) the probable-branch instructions, when static branch
11693 prediction indicates a probable branch.
11694
11695 @item -mbase-addresses
11696 @itemx -mno-base-addresses
11697 @opindex mbase-addresses
11698 @opindex mno-base-addresses
11699 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11700 base address automatically generates a request (handled by the assembler
11701 and the linker) for a constant to be set up in a global register.  The
11702 register is used for one or more base address requests within the range 0
11703 to 255 from the value held in the register.  The generally leads to short
11704 and fast code, but the number of different data items that can be
11705 addressed is limited.  This means that a program that uses lots of static
11706 data may require @option{-mno-base-addresses}.
11707
11708 @item -msingle-exit
11709 @itemx -mno-single-exit
11710 @opindex msingle-exit
11711 @opindex mno-single-exit
11712 Force (do not force) generated code to have a single exit point in each
11713 function.
11714 @end table
11715
11716 @node MN10300 Options
11717 @subsection MN10300 Options
11718 @cindex MN10300 options
11719
11720 These @option{-m} options are defined for Matsushita MN10300 architectures:
11721
11722 @table @gcctabopt
11723 @item -mmult-bug
11724 @opindex mmult-bug
11725 Generate code to avoid bugs in the multiply instructions for the MN10300
11726 processors.  This is the default.
11727
11728 @item -mno-mult-bug
11729 @opindex mno-mult-bug
11730 Do not generate code to avoid bugs in the multiply instructions for the
11731 MN10300 processors.
11732
11733 @item -mam33
11734 @opindex mam33
11735 Generate code which uses features specific to the AM33 processor.
11736
11737 @item -mno-am33
11738 @opindex mno-am33
11739 Do not generate code which uses features specific to the AM33 processor.  This
11740 is the default.
11741
11742 @item -mreturn-pointer-on-d0
11743 @opindex mreturn-pointer-on-d0
11744 When generating a function which returns a pointer, return the pointer
11745 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11746 only in a0, and attempts to call such functions without a prototype
11747 would result in errors.  Note that this option is on by default; use
11748 @option{-mno-return-pointer-on-d0} to disable it.
11749
11750 @item -mno-crt0
11751 @opindex mno-crt0
11752 Do not link in the C run-time initialization object file.
11753
11754 @item -mrelax
11755 @opindex mrelax
11756 Indicate to the linker that it should perform a relaxation optimization pass
11757 to shorten branches, calls and absolute memory addresses.  This option only
11758 has an effect when used on the command line for the final link step.
11759
11760 This option makes symbolic debugging impossible.
11761 @end table
11762
11763 @node MT Options
11764 @subsection MT Options
11765 @cindex MT options
11766
11767 These @option{-m} options are defined for Morpho MT architectures:
11768
11769 @table @gcctabopt
11770
11771 @item -march=@var{cpu-type}
11772 @opindex march
11773 Generate code that will run on @var{cpu-type}, which is the name of a system
11774 representing a certain processor type.  Possible values for
11775 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
11776 @samp{ms1-16-003} and @samp{ms2}.
11777
11778 When this option is not used, the default is @option{-march=ms1-16-002}.
11779
11780 @item -mbacc
11781 @opindex mbacc
11782 Use byte loads and stores when generating code.
11783
11784 @item -mno-bacc
11785 @opindex mno-bacc
11786 Do not use byte loads and stores when generating code.
11787
11788 @item -msim
11789 @opindex msim
11790 Use simulator runtime
11791
11792 @item -mno-crt0
11793 @opindex mno-crt0
11794 Do not link in the C run-time initialization object file
11795 @file{crti.o}.  Other run-time initialization and termination files
11796 such as @file{startup.o} and @file{exit.o} are still included on the
11797 linker command line.
11798
11799 @end table
11800
11801 @node PDP-11 Options
11802 @subsection PDP-11 Options
11803 @cindex PDP-11 Options
11804
11805 These options are defined for the PDP-11:
11806
11807 @table @gcctabopt
11808 @item -mfpu
11809 @opindex mfpu
11810 Use hardware FPP floating point.  This is the default.  (FIS floating
11811 point on the PDP-11/40 is not supported.)
11812
11813 @item -msoft-float
11814 @opindex msoft-float
11815 Do not use hardware floating point.
11816
11817 @item -mac0
11818 @opindex mac0
11819 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
11820
11821 @item -mno-ac0
11822 @opindex mno-ac0
11823 Return floating-point results in memory.  This is the default.
11824
11825 @item -m40
11826 @opindex m40
11827 Generate code for a PDP-11/40.
11828
11829 @item -m45
11830 @opindex m45
11831 Generate code for a PDP-11/45.  This is the default.
11832
11833 @item -m10
11834 @opindex m10
11835 Generate code for a PDP-11/10.
11836
11837 @item -mbcopy-builtin
11838 @opindex bcopy-builtin
11839 Use inline @code{movmemhi} patterns for copying memory.  This is the
11840 default.
11841
11842 @item -mbcopy
11843 @opindex mbcopy
11844 Do not use inline @code{movmemhi} patterns for copying memory.
11845
11846 @item -mint16
11847 @itemx -mno-int32
11848 @opindex mint16
11849 @opindex mno-int32
11850 Use 16-bit @code{int}.  This is the default.
11851
11852 @item -mint32
11853 @itemx -mno-int16
11854 @opindex mint32
11855 @opindex mno-int16
11856 Use 32-bit @code{int}.
11857
11858 @item -mfloat64
11859 @itemx -mno-float32
11860 @opindex mfloat64
11861 @opindex mno-float32
11862 Use 64-bit @code{float}.  This is the default.
11863
11864 @item -mfloat32
11865 @itemx -mno-float64
11866 @opindex mfloat32
11867 @opindex mno-float64
11868 Use 32-bit @code{float}.
11869
11870 @item -mabshi
11871 @opindex mabshi
11872 Use @code{abshi2} pattern.  This is the default.
11873
11874 @item -mno-abshi
11875 @opindex mno-abshi
11876 Do not use @code{abshi2} pattern.
11877
11878 @item -mbranch-expensive
11879 @opindex mbranch-expensive
11880 Pretend that branches are expensive.  This is for experimenting with
11881 code generation only.
11882
11883 @item -mbranch-cheap
11884 @opindex mbranch-cheap
11885 Do not pretend that branches are expensive.  This is the default.
11886
11887 @item -msplit
11888 @opindex msplit
11889 Generate code for a system with split I&D@.
11890
11891 @item -mno-split
11892 @opindex mno-split
11893 Generate code for a system without split I&D@.  This is the default.
11894
11895 @item -munix-asm
11896 @opindex munix-asm
11897 Use Unix assembler syntax.  This is the default when configured for
11898 @samp{pdp11-*-bsd}.
11899
11900 @item -mdec-asm
11901 @opindex mdec-asm
11902 Use DEC assembler syntax.  This is the default when configured for any
11903 PDP-11 target other than @samp{pdp11-*-bsd}.
11904 @end table
11905
11906 @node PowerPC Options
11907 @subsection PowerPC Options
11908 @cindex PowerPC options
11909
11910 These are listed under @xref{RS/6000 and PowerPC Options}.
11911
11912 @node RS/6000 and PowerPC Options
11913 @subsection IBM RS/6000 and PowerPC Options
11914 @cindex RS/6000 and PowerPC Options
11915 @cindex IBM RS/6000 and PowerPC Options
11916
11917 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11918 @table @gcctabopt
11919 @item -mpower
11920 @itemx -mno-power
11921 @itemx -mpower2
11922 @itemx -mno-power2
11923 @itemx -mpowerpc
11924 @itemx -mno-powerpc
11925 @itemx -mpowerpc-gpopt
11926 @itemx -mno-powerpc-gpopt
11927 @itemx -mpowerpc-gfxopt
11928 @itemx -mno-powerpc-gfxopt
11929 @itemx -mpowerpc64
11930 @itemx -mno-powerpc64
11931 @itemx -mmfcrf
11932 @itemx -mno-mfcrf
11933 @itemx -mpopcntb
11934 @itemx -mno-popcntb
11935 @itemx -mfprnd
11936 @itemx -mno-fprnd
11937 @itemx -mcmpb
11938 @itemx -mno-cmpb
11939 @itemx -mmfpgpr
11940 @itemx -mno-mfpgpr
11941 @itemx -mdfp
11942 @itemx -mno-dfp
11943 @opindex mpower
11944 @opindex mno-power
11945 @opindex mpower2
11946 @opindex mno-power2
11947 @opindex mpowerpc
11948 @opindex mno-powerpc
11949 @opindex mpowerpc-gpopt
11950 @opindex mno-powerpc-gpopt
11951 @opindex mpowerpc-gfxopt
11952 @opindex mno-powerpc-gfxopt
11953 @opindex mpowerpc64
11954 @opindex mno-powerpc64
11955 @opindex mmfcrf
11956 @opindex mno-mfcrf
11957 @opindex mpopcntb
11958 @opindex mno-popcntb
11959 @opindex mfprnd
11960 @opindex mno-fprnd
11961 @opindex mcmpb
11962 @opindex mno-cmpb
11963 @opindex mmfpgpr
11964 @opindex mno-mfpgpr
11965 @opindex mdfp
11966 @opindex mno-dfp
11967 GCC supports two related instruction set architectures for the
11968 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
11969 instructions supported by the @samp{rios} chip set used in the original
11970 RS/6000 systems and the @dfn{PowerPC} instruction set is the
11971 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
11972 the IBM 4xx, 6xx, and follow-on microprocessors.
11973
11974 Neither architecture is a subset of the other.  However there is a
11975 large common subset of instructions supported by both.  An MQ
11976 register is included in processors supporting the POWER architecture.
11977
11978 You use these options to specify which instructions are available on the
11979 processor you are using.  The default value of these options is
11980 determined when configuring GCC@.  Specifying the
11981 @option{-mcpu=@var{cpu_type}} overrides the specification of these
11982 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
11983 rather than the options listed above.
11984
11985 The @option{-mpower} option allows GCC to generate instructions that
11986 are found only in the POWER architecture and to use the MQ register.
11987 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
11988 to generate instructions that are present in the POWER2 architecture but
11989 not the original POWER architecture.
11990
11991 The @option{-mpowerpc} option allows GCC to generate instructions that
11992 are found only in the 32-bit subset of the PowerPC architecture.
11993 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
11994 GCC to use the optional PowerPC architecture instructions in the
11995 General Purpose group, including floating-point square root.  Specifying
11996 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
11997 use the optional PowerPC architecture instructions in the Graphics
11998 group, including floating-point select.
11999
12000 The @option{-mmfcrf} option allows GCC to generate the move from
12001 condition register field instruction implemented on the POWER4
12002 processor and other processors that support the PowerPC V2.01
12003 architecture.
12004 The @option{-mpopcntb} option allows GCC to generate the popcount and
12005 double precision FP reciprocal estimate instruction implemented on the
12006 POWER5 processor and other processors that support the PowerPC V2.02
12007 architecture.
12008 The @option{-mfprnd} option allows GCC to generate the FP round to
12009 integer instructions implemented on the POWER5+ processor and other
12010 processors that support the PowerPC V2.03 architecture.
12011 The @option{-mcmpb} option allows GCC to generate the compare bytes
12012 instruction implemented on the POWER6 processor and other processors
12013 that support the PowerPC V2.05 architecture.
12014 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
12015 general purpose register instructions implemented on the POWER6X
12016 processor and other processors that support the extended PowerPC V2.05
12017 architecture.
12018 The @option{-mdfp} option allows GCC to generate the decimal floating
12019 point instructions implemented on some POWER processors.
12020
12021 The @option{-mpowerpc64} option allows GCC to generate the additional
12022 64-bit instructions that are found in the full PowerPC64 architecture
12023 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
12024 @option{-mno-powerpc64}.
12025
12026 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
12027 will use only the instructions in the common subset of both
12028 architectures plus some special AIX common-mode calls, and will not use
12029 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
12030 permits GCC to use any instruction from either architecture and to
12031 allow use of the MQ register; specify this for the Motorola MPC601.
12032
12033 @item -mnew-mnemonics
12034 @itemx -mold-mnemonics
12035 @opindex mnew-mnemonics
12036 @opindex mold-mnemonics
12037 Select which mnemonics to use in the generated assembler code.  With
12038 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
12039 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
12040 assembler mnemonics defined for the POWER architecture.  Instructions
12041 defined in only one architecture have only one mnemonic; GCC uses that
12042 mnemonic irrespective of which of these options is specified.
12043
12044 GCC defaults to the mnemonics appropriate for the architecture in
12045 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
12046 value of these option.  Unless you are building a cross-compiler, you
12047 should normally not specify either @option{-mnew-mnemonics} or
12048 @option{-mold-mnemonics}, but should instead accept the default.
12049
12050 @item -mcpu=@var{cpu_type}
12051 @opindex mcpu
12052 Set architecture type, register usage, choice of mnemonics, and
12053 instruction scheduling parameters for machine type @var{cpu_type}.
12054 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
12055 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
12056 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
12057 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
12058 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
12059 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
12060 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
12061 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
12062 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
12063 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
12064
12065 @option{-mcpu=common} selects a completely generic processor.  Code
12066 generated under this option will run on any POWER or PowerPC processor.
12067 GCC will use only the instructions in the common subset of both
12068 architectures, and will not use the MQ register.  GCC assumes a generic
12069 processor model for scheduling purposes.
12070
12071 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
12072 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
12073 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
12074 types, with an appropriate, generic processor model assumed for
12075 scheduling purposes.
12076
12077 The other options specify a specific processor.  Code generated under
12078 those options will run best on that processor, and may not run at all on
12079 others.
12080
12081 The @option{-mcpu} options automatically enable or disable the
12082 following options:
12083
12084 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
12085 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
12086 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
12087
12088 The particular options set for any particular CPU will vary between
12089 compiler versions, depending on what setting seems to produce optimal
12090 code for that CPU; it doesn't necessarily reflect the actual hardware's
12091 capabilities.  If you wish to set an individual option to a particular
12092 value, you may specify it after the @option{-mcpu} option, like
12093 @samp{-mcpu=970 -mno-altivec}.
12094
12095 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
12096 not enabled or disabled by the @option{-mcpu} option at present because
12097 AIX does not have full support for these options.  You may still
12098 enable or disable them individually if you're sure it'll work in your
12099 environment.
12100
12101 @item -mtune=@var{cpu_type}
12102 @opindex mtune
12103 Set the instruction scheduling parameters for machine type
12104 @var{cpu_type}, but do not set the architecture type, register usage, or
12105 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
12106 values for @var{cpu_type} are used for @option{-mtune} as for
12107 @option{-mcpu}.  If both are specified, the code generated will use the
12108 architecture, registers, and mnemonics set by @option{-mcpu}, but the
12109 scheduling parameters set by @option{-mtune}.
12110
12111 @item -mswdiv
12112 @itemx -mno-swdiv
12113 @opindex mswdiv
12114 @opindex mno-swdiv
12115 Generate code to compute division as reciprocal estimate and iterative
12116 refinement, creating opportunities for increased throughput.  This
12117 feature requires: optional PowerPC Graphics instruction set for single
12118 precision and FRE instruction for double precision, assuming divides
12119 cannot generate user-visible traps, and the domain values not include
12120 Infinities, denormals or zero denominator.
12121
12122 @item -maltivec
12123 @itemx -mno-altivec
12124 @opindex maltivec
12125 @opindex mno-altivec
12126 Generate code that uses (does not use) AltiVec instructions, and also
12127 enable the use of built-in functions that allow more direct access to
12128 the AltiVec instruction set.  You may also need to set
12129 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
12130 enhancements.
12131
12132 @item -mvrsave
12133 @item -mno-vrsave
12134 @opindex mvrsave
12135 @opindex mno-vrsave
12136 Generate VRSAVE instructions when generating AltiVec code.
12137
12138 @item -msecure-plt
12139 @opindex msecure-plt
12140 Generate code that allows ld and ld.so to build executables and shared
12141 libraries with non-exec .plt and .got sections.  This is a PowerPC
12142 32-bit SYSV ABI option.
12143
12144 @item -mbss-plt
12145 @opindex mbss-plt
12146 Generate code that uses a BSS .plt section that ld.so fills in, and
12147 requires .plt and .got sections that are both writable and executable.
12148 This is a PowerPC 32-bit SYSV ABI option.
12149
12150 @item -misel
12151 @itemx -mno-isel
12152 @opindex misel
12153 @opindex mno-isel
12154 This switch enables or disables the generation of ISEL instructions.
12155
12156 @item -misel=@var{yes/no}
12157 This switch has been deprecated.  Use @option{-misel} and
12158 @option{-mno-isel} instead.
12159
12160 @item -mspe
12161 @itemx -mno-spe
12162 @opindex mspe
12163 @opindex mno-spe
12164 This switch enables or disables the generation of SPE simd
12165 instructions.
12166
12167 @item -mspe=@var{yes/no}
12168 This option has been deprecated.  Use @option{-mspe} and
12169 @option{-mno-spe} instead.
12170
12171 @item -mfloat-gprs=@var{yes/single/double/no}
12172 @itemx -mfloat-gprs
12173 @opindex mfloat-gprs
12174 This switch enables or disables the generation of floating point
12175 operations on the general purpose registers for architectures that
12176 support it.
12177
12178 The argument @var{yes} or @var{single} enables the use of
12179 single-precision floating point operations.
12180
12181 The argument @var{double} enables the use of single and
12182 double-precision floating point operations.
12183
12184 The argument @var{no} disables floating point operations on the
12185 general purpose registers.
12186
12187 This option is currently only available on the MPC854x.
12188
12189 @item -m32
12190 @itemx -m64
12191 @opindex m32
12192 @opindex m64
12193 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12194 targets (including GNU/Linux).  The 32-bit environment sets int, long
12195 and pointer to 32 bits and generates code that runs on any PowerPC
12196 variant.  The 64-bit environment sets int to 32 bits and long and
12197 pointer to 64 bits, and generates code for PowerPC64, as for
12198 @option{-mpowerpc64}.
12199
12200 @item -mfull-toc
12201 @itemx -mno-fp-in-toc
12202 @itemx -mno-sum-in-toc
12203 @itemx -mminimal-toc
12204 @opindex mfull-toc
12205 @opindex mno-fp-in-toc
12206 @opindex mno-sum-in-toc
12207 @opindex mminimal-toc
12208 Modify generation of the TOC (Table Of Contents), which is created for
12209 every executable file.  The @option{-mfull-toc} option is selected by
12210 default.  In that case, GCC will allocate at least one TOC entry for
12211 each unique non-automatic variable reference in your program.  GCC
12212 will also place floating-point constants in the TOC@.  However, only
12213 16,384 entries are available in the TOC@.
12214
12215 If you receive a linker error message that saying you have overflowed
12216 the available TOC space, you can reduce the amount of TOC space used
12217 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
12218 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
12219 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
12220 generate code to calculate the sum of an address and a constant at
12221 run-time instead of putting that sum into the TOC@.  You may specify one
12222 or both of these options.  Each causes GCC to produce very slightly
12223 slower and larger code at the expense of conserving TOC space.
12224
12225 If you still run out of space in the TOC even when you specify both of
12226 these options, specify @option{-mminimal-toc} instead.  This option causes
12227 GCC to make only one TOC entry for every file.  When you specify this
12228 option, GCC will produce code that is slower and larger but which
12229 uses extremely little TOC space.  You may wish to use this option
12230 only on files that contain less frequently executed code.
12231
12232 @item -maix64
12233 @itemx -maix32
12234 @opindex maix64
12235 @opindex maix32
12236 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
12237 @code{long} type, and the infrastructure needed to support them.
12238 Specifying @option{-maix64} implies @option{-mpowerpc64} and
12239 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
12240 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
12241
12242 @item -mxl-compat
12243 @itemx -mno-xl-compat
12244 @opindex mxl-compat
12245 @opindex mno-xl-compat
12246 Produce code that conforms more closely to IBM XL compiler semantics
12247 when using AIX-compatible ABI.  Pass floating-point arguments to
12248 prototyped functions beyond the register save area (RSA) on the stack
12249 in addition to argument FPRs.  Do not assume that most significant
12250 double in 128-bit long double value is properly rounded when comparing
12251 values and converting to double.  Use XL symbol names for long double
12252 support routines.
12253
12254 The AIX calling convention was extended but not initially documented to
12255 handle an obscure K&R C case of calling a function that takes the
12256 address of its arguments with fewer arguments than declared.  IBM XL
12257 compilers access floating point arguments which do not fit in the
12258 RSA from the stack when a subroutine is compiled without
12259 optimization.  Because always storing floating-point arguments on the
12260 stack is inefficient and rarely needed, this option is not enabled by
12261 default and only is necessary when calling subroutines compiled by IBM
12262 XL compilers without optimization.
12263
12264 @item -mpe
12265 @opindex mpe
12266 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
12267 application written to use message passing with special startup code to
12268 enable the application to run.  The system must have PE installed in the
12269 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
12270 must be overridden with the @option{-specs=} option to specify the
12271 appropriate directory location.  The Parallel Environment does not
12272 support threads, so the @option{-mpe} option and the @option{-pthread}
12273 option are incompatible.
12274
12275 @item -malign-natural
12276 @itemx -malign-power
12277 @opindex malign-natural
12278 @opindex malign-power
12279 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12280 @option{-malign-natural} overrides the ABI-defined alignment of larger
12281 types, such as floating-point doubles, on their natural size-based boundary.
12282 The option @option{-malign-power} instructs GCC to follow the ABI-specified
12283 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
12284
12285 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
12286 is not supported.
12287
12288 @item -msoft-float
12289 @itemx -mhard-float
12290 @opindex msoft-float
12291 @opindex mhard-float
12292 Generate code that does not use (uses) the floating-point register set.
12293 Software floating point emulation is provided if you use the
12294 @option{-msoft-float} option, and pass the option to GCC when linking.
12295
12296 @item -mmultiple
12297 @itemx -mno-multiple
12298 @opindex mmultiple
12299 @opindex mno-multiple
12300 Generate code that uses (does not use) the load multiple word
12301 instructions and the store multiple word instructions.  These
12302 instructions are generated by default on POWER systems, and not
12303 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
12304 endian PowerPC systems, since those instructions do not work when the
12305 processor is in little endian mode.  The exceptions are PPC740 and
12306 PPC750 which permit the instructions usage in little endian mode.
12307
12308 @item -mstring
12309 @itemx -mno-string
12310 @opindex mstring
12311 @opindex mno-string
12312 Generate code that uses (does not use) the load string instructions
12313 and the store string word instructions to save multiple registers and
12314 do small block moves.  These instructions are generated by default on
12315 POWER systems, and not generated on PowerPC systems.  Do not use
12316 @option{-mstring} on little endian PowerPC systems, since those
12317 instructions do not work when the processor is in little endian mode.
12318 The exceptions are PPC740 and PPC750 which permit the instructions
12319 usage in little endian mode.
12320
12321 @item -mupdate
12322 @itemx -mno-update
12323 @opindex mupdate
12324 @opindex mno-update
12325 Generate code that uses (does not use) the load or store instructions
12326 that update the base register to the address of the calculated memory
12327 location.  These instructions are generated by default.  If you use
12328 @option{-mno-update}, there is a small window between the time that the
12329 stack pointer is updated and the address of the previous frame is
12330 stored, which means code that walks the stack frame across interrupts or
12331 signals may get corrupted data.
12332
12333 @item -mfused-madd
12334 @itemx -mno-fused-madd
12335 @opindex mfused-madd
12336 @opindex mno-fused-madd
12337 Generate code that uses (does not use) the floating point multiply and
12338 accumulate instructions.  These instructions are generated by default if
12339 hardware floating is used.
12340
12341 @item -mmulhw
12342 @itemx -mno-mulhw
12343 @opindex mmulhw
12344 @opindex mno-mulhw
12345 Generate code that uses (does not use) the half-word multiply and
12346 multiply-accumulate instructions on the IBM 405 and 440 processors.
12347 These instructions are generated by default when targetting those
12348 processors.
12349
12350 @item -mdlmzb
12351 @itemx -mno-dlmzb
12352 @opindex mdlmzb
12353 @opindex mno-dlmzb
12354 Generate code that uses (does not use) the string-search @samp{dlmzb}
12355 instruction on the IBM 405 and 440 processors.  This instruction is
12356 generated by default when targetting those processors.
12357
12358 @item -mno-bit-align
12359 @itemx -mbit-align
12360 @opindex mno-bit-align
12361 @opindex mbit-align
12362 On System V.4 and embedded PowerPC systems do not (do) force structures
12363 and unions that contain bit-fields to be aligned to the base type of the
12364 bit-field.
12365
12366 For example, by default a structure containing nothing but 8
12367 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
12368 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
12369 the structure would be aligned to a 1 byte boundary and be one byte in
12370 size.
12371
12372 @item -mno-strict-align
12373 @itemx -mstrict-align
12374 @opindex mno-strict-align
12375 @opindex mstrict-align
12376 On System V.4 and embedded PowerPC systems do not (do) assume that
12377 unaligned memory references will be handled by the system.
12378
12379 @item -mrelocatable
12380 @itemx -mno-relocatable
12381 @opindex mrelocatable
12382 @opindex mno-relocatable
12383 On embedded PowerPC systems generate code that allows (does not allow)
12384 the program to be relocated to a different address at runtime.  If you
12385 use @option{-mrelocatable} on any module, all objects linked together must
12386 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
12387
12388 @item -mrelocatable-lib
12389 @itemx -mno-relocatable-lib
12390 @opindex mrelocatable-lib
12391 @opindex mno-relocatable-lib
12392 On embedded PowerPC systems generate code that allows (does not allow)
12393 the program to be relocated to a different address at runtime.  Modules
12394 compiled with @option{-mrelocatable-lib} can be linked with either modules
12395 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
12396 with modules compiled with the @option{-mrelocatable} options.
12397
12398 @item -mno-toc
12399 @itemx -mtoc
12400 @opindex mno-toc
12401 @opindex mtoc
12402 On System V.4 and embedded PowerPC systems do not (do) assume that
12403 register 2 contains a pointer to a global area pointing to the addresses
12404 used in the program.
12405
12406 @item -mlittle
12407 @itemx -mlittle-endian
12408 @opindex mlittle
12409 @opindex mlittle-endian
12410 On System V.4 and embedded PowerPC systems compile code for the
12411 processor in little endian mode.  The @option{-mlittle-endian} option is
12412 the same as @option{-mlittle}.
12413
12414 @item -mbig
12415 @itemx -mbig-endian
12416 @opindex mbig
12417 @opindex mbig-endian
12418 On System V.4 and embedded PowerPC systems compile code for the
12419 processor in big endian mode.  The @option{-mbig-endian} option is
12420 the same as @option{-mbig}.
12421
12422 @item -mdynamic-no-pic
12423 @opindex mdynamic-no-pic
12424 On Darwin and Mac OS X systems, compile code so that it is not
12425 relocatable, but that its external references are relocatable.  The
12426 resulting code is suitable for applications, but not shared
12427 libraries.
12428
12429 @item -mprioritize-restricted-insns=@var{priority}
12430 @opindex mprioritize-restricted-insns
12431 This option controls the priority that is assigned to
12432 dispatch-slot restricted instructions during the second scheduling
12433 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
12434 @var{no/highest/second-highest} priority to dispatch slot restricted
12435 instructions.
12436
12437 @item -msched-costly-dep=@var{dependence_type}
12438 @opindex msched-costly-dep
12439 This option controls which dependences are considered costly
12440 by the target during instruction scheduling.  The argument
12441 @var{dependence_type} takes one of the following values:
12442 @var{no}: no dependence is costly,
12443 @var{all}: all dependences are costly,
12444 @var{true_store_to_load}: a true dependence from store to load is costly,
12445 @var{store_to_load}: any dependence from store to load is costly,
12446 @var{number}: any dependence which latency >= @var{number} is costly.
12447
12448 @item -minsert-sched-nops=@var{scheme}
12449 @opindex minsert-sched-nops
12450 This option controls which nop insertion scheme will be used during
12451 the second scheduling pass.  The argument @var{scheme} takes one of the
12452 following values:
12453 @var{no}: Don't insert nops.
12454 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
12455 according to the scheduler's grouping.
12456 @var{regroup_exact}: Insert nops to force costly dependent insns into
12457 separate groups.  Insert exactly as many nops as needed to force an insn
12458 to a new group, according to the estimated processor grouping.
12459 @var{number}: Insert nops to force costly dependent insns into
12460 separate groups.  Insert @var{number} nops to force an insn to a new group.
12461
12462 @item -mcall-sysv
12463 @opindex mcall-sysv
12464 On System V.4 and embedded PowerPC systems compile code using calling
12465 conventions that adheres to the March 1995 draft of the System V
12466 Application Binary Interface, PowerPC processor supplement.  This is the
12467 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
12468
12469 @item -mcall-sysv-eabi
12470 @opindex mcall-sysv-eabi
12471 Specify both @option{-mcall-sysv} and @option{-meabi} options.
12472
12473 @item -mcall-sysv-noeabi
12474 @opindex mcall-sysv-noeabi
12475 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
12476
12477 @item -mcall-solaris
12478 @opindex mcall-solaris
12479 On System V.4 and embedded PowerPC systems compile code for the Solaris
12480 operating system.
12481
12482 @item -mcall-linux
12483 @opindex mcall-linux
12484 On System V.4 and embedded PowerPC systems compile code for the
12485 Linux-based GNU system.
12486
12487 @item -mcall-gnu
12488 @opindex mcall-gnu
12489 On System V.4 and embedded PowerPC systems compile code for the
12490 Hurd-based GNU system.
12491
12492 @item -mcall-netbsd
12493 @opindex mcall-netbsd
12494 On System V.4 and embedded PowerPC systems compile code for the
12495 NetBSD operating system.
12496
12497 @item -maix-struct-return
12498 @opindex maix-struct-return
12499 Return all structures in memory (as specified by the AIX ABI)@.
12500
12501 @item -msvr4-struct-return
12502 @opindex msvr4-struct-return
12503 Return structures smaller than 8 bytes in registers (as specified by the
12504 SVR4 ABI)@.
12505
12506 @item -mabi=@var{abi-type}
12507 @opindex mabi
12508 Extend the current ABI with a particular extension, or remove such extension.
12509 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
12510 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
12511
12512 @item -mabi=spe
12513 @opindex mabi=spe
12514 Extend the current ABI with SPE ABI extensions.  This does not change
12515 the default ABI, instead it adds the SPE ABI extensions to the current
12516 ABI@.
12517
12518 @item -mabi=no-spe
12519 @opindex mabi=no-spe
12520 Disable Booke SPE ABI extensions for the current ABI@.
12521
12522 @item -mabi=ibmlongdouble
12523 @opindex mabi=ibmlongdouble
12524 Change the current ABI to use IBM extended precision long double.
12525 This is a PowerPC 32-bit SYSV ABI option.
12526
12527 @item -mabi=ieeelongdouble
12528 @opindex mabi=ieeelongdouble
12529 Change the current ABI to use IEEE extended precision long double.
12530 This is a PowerPC 32-bit Linux ABI option.
12531
12532 @item -mprototype
12533 @itemx -mno-prototype
12534 @opindex mprototype
12535 @opindex mno-prototype
12536 On System V.4 and embedded PowerPC systems assume that all calls to
12537 variable argument functions are properly prototyped.  Otherwise, the
12538 compiler must insert an instruction before every non prototyped call to
12539 set or clear bit 6 of the condition code register (@var{CR}) to
12540 indicate whether floating point values were passed in the floating point
12541 registers in case the function takes a variable arguments.  With
12542 @option{-mprototype}, only calls to prototyped variable argument functions
12543 will set or clear the bit.
12544
12545 @item -msim
12546 @opindex msim
12547 On embedded PowerPC systems, assume that the startup module is called
12548 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12549 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12550 configurations.
12551
12552 @item -mmvme
12553 @opindex mmvme
12554 On embedded PowerPC systems, assume that the startup module is called
12555 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12556 @file{libc.a}.
12557
12558 @item -mads
12559 @opindex mads
12560 On embedded PowerPC systems, assume that the startup module is called
12561 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12562 @file{libc.a}.
12563
12564 @item -myellowknife
12565 @opindex myellowknife
12566 On embedded PowerPC systems, assume that the startup module is called
12567 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12568 @file{libc.a}.
12569
12570 @item -mvxworks
12571 @opindex mvxworks
12572 On System V.4 and embedded PowerPC systems, specify that you are
12573 compiling for a VxWorks system.
12574
12575 @item -mwindiss
12576 @opindex mwindiss
12577 Specify that you are compiling for the WindISS simulation environment.
12578
12579 @item -memb
12580 @opindex memb
12581 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12582 header to indicate that @samp{eabi} extended relocations are used.
12583
12584 @item -meabi
12585 @itemx -mno-eabi
12586 @opindex meabi
12587 @opindex mno-eabi
12588 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12589 Embedded Applications Binary Interface (eabi) which is a set of
12590 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12591 means that the stack is aligned to an 8 byte boundary, a function
12592 @code{__eabi} is called to from @code{main} to set up the eabi
12593 environment, and the @option{-msdata} option can use both @code{r2} and
12594 @code{r13} to point to two separate small data areas.  Selecting
12595 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12596 do not call an initialization function from @code{main}, and the
12597 @option{-msdata} option will only use @code{r13} to point to a single
12598 small data area.  The @option{-meabi} option is on by default if you
12599 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12600
12601 @item -msdata=eabi
12602 @opindex msdata=eabi
12603 On System V.4 and embedded PowerPC systems, put small initialized
12604 @code{const} global and static data in the @samp{.sdata2} section, which
12605 is pointed to by register @code{r2}.  Put small initialized
12606 non-@code{const} global and static data in the @samp{.sdata} section,
12607 which is pointed to by register @code{r13}.  Put small uninitialized
12608 global and static data in the @samp{.sbss} section, which is adjacent to
12609 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12610 incompatible with the @option{-mrelocatable} option.  The
12611 @option{-msdata=eabi} option also sets the @option{-memb} option.
12612
12613 @item -msdata=sysv
12614 @opindex msdata=sysv
12615 On System V.4 and embedded PowerPC systems, put small global and static
12616 data in the @samp{.sdata} section, which is pointed to by register
12617 @code{r13}.  Put small uninitialized global and static data in the
12618 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12619 The @option{-msdata=sysv} option is incompatible with the
12620 @option{-mrelocatable} option.
12621
12622 @item -msdata=default
12623 @itemx -msdata
12624 @opindex msdata=default
12625 @opindex msdata
12626 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12627 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12628 same as @option{-msdata=sysv}.
12629
12630 @item -msdata-data
12631 @opindex msdata-data
12632 On System V.4 and embedded PowerPC systems, put small global
12633 data in the @samp{.sdata} section.  Put small uninitialized global
12634 data in the @samp{.sbss} section.  Do not use register @code{r13}
12635 to address small data however.  This is the default behavior unless
12636 other @option{-msdata} options are used.
12637
12638 @item -msdata=none
12639 @itemx -mno-sdata
12640 @opindex msdata=none
12641 @opindex mno-sdata
12642 On embedded PowerPC systems, put all initialized global and static data
12643 in the @samp{.data} section, and all uninitialized data in the
12644 @samp{.bss} section.
12645
12646 @item -G @var{num}
12647 @opindex G
12648 @cindex smaller data references (PowerPC)
12649 @cindex .sdata/.sdata2 references (PowerPC)
12650 On embedded PowerPC systems, put global and static items less than or
12651 equal to @var{num} bytes into the small data or bss sections instead of
12652 the normal data or bss section.  By default, @var{num} is 8.  The
12653 @option{-G @var{num}} switch is also passed to the linker.
12654 All modules should be compiled with the same @option{-G @var{num}} value.
12655
12656 @item -mregnames
12657 @itemx -mno-regnames
12658 @opindex mregnames
12659 @opindex mno-regnames
12660 On System V.4 and embedded PowerPC systems do (do not) emit register
12661 names in the assembly language output using symbolic forms.
12662
12663 @item -mlongcall
12664 @itemx -mno-longcall
12665 @opindex mlongcall
12666 @opindex mno-longcall
12667 By default assume that all calls are far away so that a longer more
12668 expensive calling sequence is required.  This is required for calls
12669 further than 32 megabytes (33,554,432 bytes) from the current location.
12670 A short call will be generated if the compiler knows
12671 the call cannot be that far away.  This setting can be overridden by
12672 the @code{shortcall} function attribute, or by @code{#pragma
12673 longcall(0)}.
12674
12675 Some linkers are capable of detecting out-of-range calls and generating
12676 glue code on the fly.  On these systems, long calls are unnecessary and
12677 generate slower code.  As of this writing, the AIX linker can do this,
12678 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12679 to the GNU linker for 32-bit PowerPC systems as well.
12680
12681 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12682 callee, L42'', plus a ``branch island'' (glue code).  The two target
12683 addresses represent the callee and the ``branch island''.  The
12684 Darwin/PPC linker will prefer the first address and generate a ``bl
12685 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12686 otherwise, the linker will generate ``bl L42'' to call the ``branch
12687 island''.  The ``branch island'' is appended to the body of the
12688 calling function; it computes the full 32-bit address of the callee
12689 and jumps to it.
12690
12691 On Mach-O (Darwin) systems, this option directs the compiler emit to
12692 the glue for every direct call, and the Darwin linker decides whether
12693 to use or discard it.
12694
12695 In the future, we may cause GCC to ignore all longcall specifications
12696 when the linker is known to generate glue.
12697
12698 @item -pthread
12699 @opindex pthread
12700 Adds support for multithreading with the @dfn{pthreads} library.
12701 This option sets flags for both the preprocessor and linker.
12702
12703 @end table
12704
12705 @node S/390 and zSeries Options
12706 @subsection S/390 and zSeries Options
12707 @cindex S/390 and zSeries Options
12708
12709 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12710
12711 @table @gcctabopt
12712 @item -mhard-float
12713 @itemx -msoft-float
12714 @opindex mhard-float
12715 @opindex msoft-float
12716 Use (do not use) the hardware floating-point instructions and registers
12717 for floating-point operations.  When @option{-msoft-float} is specified,
12718 functions in @file{libgcc.a} will be used to perform floating-point
12719 operations.  When @option{-mhard-float} is specified, the compiler
12720 generates IEEE floating-point instructions.  This is the default.
12721
12722 @item -mlong-double-64
12723 @itemx -mlong-double-128
12724 @opindex mlong-double-64
12725 @opindex mlong-double-128
12726 These switches control the size of @code{long double} type. A size
12727 of 64bit makes the @code{long double} type equivalent to the @code{double}
12728 type. This is the default.
12729
12730 @item -mbackchain
12731 @itemx -mno-backchain
12732 @opindex mbackchain
12733 @opindex mno-backchain
12734 Store (do not store) the address of the caller's frame as backchain pointer
12735 into the callee's stack frame.
12736 A backchain may be needed to allow debugging using tools that do not understand
12737 DWARF-2 call frame information.
12738 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12739 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12740 the backchain is placed into the topmost word of the 96/160 byte register
12741 save area.
12742
12743 In general, code compiled with @option{-mbackchain} is call-compatible with
12744 code compiled with @option{-mmo-backchain}; however, use of the backchain
12745 for debugging purposes usually requires that the whole binary is built with
12746 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12747 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12748 to build a linux kernel use @option{-msoft-float}.
12749
12750 The default is to not maintain the backchain.
12751
12752 @item -mpacked-stack
12753 @item -mno-packed-stack
12754 @opindex mpacked-stack
12755 @opindex mno-packed-stack
12756 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12757 specified, the compiler uses the all fields of the 96/160 byte register save
12758 area only for their default purpose; unused fields still take up stack space.
12759 When @option{-mpacked-stack} is specified, register save slots are densely
12760 packed at the top of the register save area; unused space is reused for other
12761 purposes, allowing for more efficient use of the available stack space.
12762 However, when @option{-mbackchain} is also in effect, the topmost word of
12763 the save area is always used to store the backchain, and the return address
12764 register is always saved two words below the backchain.
12765
12766 As long as the stack frame backchain is not used, code generated with
12767 @option{-mpacked-stack} is call-compatible with code generated with
12768 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
12769 S/390 or zSeries generated code that uses the stack frame backchain at run
12770 time, not just for debugging purposes.  Such code is not call-compatible
12771 with code compiled with @option{-mpacked-stack}.  Also, note that the
12772 combination of @option{-mbackchain},
12773 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12774 to build a linux kernel use @option{-msoft-float}.
12775
12776 The default is to not use the packed stack layout.
12777
12778 @item -msmall-exec
12779 @itemx -mno-small-exec
12780 @opindex msmall-exec
12781 @opindex mno-small-exec
12782 Generate (or do not generate) code using the @code{bras} instruction
12783 to do subroutine calls.
12784 This only works reliably if the total executable size does not
12785 exceed 64k.  The default is to use the @code{basr} instruction instead,
12786 which does not have this limitation.
12787
12788 @item -m64
12789 @itemx -m31
12790 @opindex m64
12791 @opindex m31
12792 When @option{-m31} is specified, generate code compliant to the
12793 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
12794 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
12795 particular to generate 64-bit instructions.  For the @samp{s390}
12796 targets, the default is @option{-m31}, while the @samp{s390x}
12797 targets default to @option{-m64}.
12798
12799 @item -mzarch
12800 @itemx -mesa
12801 @opindex mzarch
12802 @opindex mesa
12803 When @option{-mzarch} is specified, generate code using the
12804 instructions available on z/Architecture.
12805 When @option{-mesa} is specified, generate code using the
12806 instructions available on ESA/390.  Note that @option{-mesa} is
12807 not possible with @option{-m64}.
12808 When generating code compliant to the GNU/Linux for S/390 ABI,
12809 the default is @option{-mesa}.  When generating code compliant
12810 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
12811
12812 @item -mmvcle
12813 @itemx -mno-mvcle
12814 @opindex mmvcle
12815 @opindex mno-mvcle
12816 Generate (or do not generate) code using the @code{mvcle} instruction
12817 to perform block moves.  When @option{-mno-mvcle} is specified,
12818 use a @code{mvc} loop instead.  This is the default unless optimizing for
12819 size.
12820
12821 @item -mdebug
12822 @itemx -mno-debug
12823 @opindex mdebug
12824 @opindex mno-debug
12825 Print (or do not print) additional debug information when compiling.
12826 The default is to not print debug information.
12827
12828 @item -march=@var{cpu-type}
12829 @opindex march
12830 Generate code that will run on @var{cpu-type}, which is the name of a system
12831 representing a certain processor type.  Possible values for
12832 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
12833 When generating code using the instructions available on z/Architecture,
12834 the default is @option{-march=z900}.  Otherwise, the default is
12835 @option{-march=g5}.
12836
12837 @item -mtune=@var{cpu-type}
12838 @opindex mtune
12839 Tune to @var{cpu-type} everything applicable about the generated code,
12840 except for the ABI and the set of available instructions.
12841 The list of @var{cpu-type} values is the same as for @option{-march}.
12842 The default is the value used for @option{-march}.
12843
12844 @item -mtpf-trace
12845 @itemx -mno-tpf-trace
12846 @opindex mtpf-trace
12847 @opindex mno-tpf-trace
12848 Generate code that adds (does not add) in TPF OS specific branches to trace
12849 routines in the operating system.  This option is off by default, even
12850 when compiling for the TPF OS@.
12851
12852 @item -mfused-madd
12853 @itemx -mno-fused-madd
12854 @opindex mfused-madd
12855 @opindex mno-fused-madd
12856 Generate code that uses (does not use) the floating point multiply and
12857 accumulate instructions.  These instructions are generated by default if
12858 hardware floating point is used.
12859
12860 @item -mwarn-framesize=@var{framesize}
12861 @opindex mwarn-framesize
12862 Emit a warning if the current function exceeds the given frame size.  Because
12863 this is a compile time check it doesn't need to be a real problem when the program
12864 runs.  It is intended to identify functions which most probably cause
12865 a stack overflow.  It is useful to be used in an environment with limited stack
12866 size e.g.@: the linux kernel.
12867
12868 @item -mwarn-dynamicstack
12869 @opindex mwarn-dynamicstack
12870 Emit a warning if the function calls alloca or uses dynamically
12871 sized arrays.  This is generally a bad idea with a limited stack size.
12872
12873 @item -mstack-guard=@var{stack-guard}
12874 @item -mstack-size=@var{stack-size}
12875 @opindex mstack-guard
12876 @opindex mstack-size
12877 If these options are provided the s390 back end emits additional instructions in
12878 the function prologue which trigger a trap if the stack size is @var{stack-guard}
12879 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
12880 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
12881 the frame size of the compiled function is chosen.
12882 These options are intended to be used to help debugging stack overflow problems.
12883 The additionally emitted code causes only little overhead and hence can also be
12884 used in production like systems without greater performance degradation.  The given
12885 values have to be exact powers of 2 and @var{stack-size} has to be greater than
12886 @var{stack-guard} without exceeding 64k.
12887 In order to be efficient the extra code makes the assumption that the stack starts
12888 at an address aligned to the value given by @var{stack-size}.
12889 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
12890 @end table
12891
12892 @node Score Options
12893 @subsection Score Options
12894 @cindex Score Options
12895
12896 These options are defined for Score implementations:
12897
12898 @table @gcctabopt
12899 @item -mel
12900 @opindex -mel
12901 Compile code for little endian mode. 
12902
12903 @item -meb
12904 @opindex meb
12905 Compile code for big endian mode.  This is the default.
12906
12907 @item -mmac
12908 @opindex mmac
12909 Enable the use of multiply-accumulate instructions. Disabled by default. 
12910
12911 @item -mscore5u
12912 @opindex mscore5u
12913 Specify the SCORE5U of the target architecture.
12914
12915 @item -mscore7
12916 @opindex mscore7
12917 Specify the SCORE7 of the target architecture. This is the default.
12918 @end table
12919
12920 @node SH Options
12921 @subsection SH Options
12922
12923 These @samp{-m} options are defined for the SH implementations:
12924
12925 @table @gcctabopt
12926 @item -m1
12927 @opindex m1
12928 Generate code for the SH1.
12929
12930 @item -m2
12931 @opindex m2
12932 Generate code for the SH2.
12933
12934 @item -m2e
12935 Generate code for the SH2e.
12936
12937 @item -m3
12938 @opindex m3
12939 Generate code for the SH3.
12940
12941 @item -m3e
12942 @opindex m3e
12943 Generate code for the SH3e.
12944
12945 @item -m4-nofpu
12946 @opindex m4-nofpu
12947 Generate code for the SH4 without a floating-point unit.
12948
12949 @item -m4-single-only
12950 @opindex m4-single-only
12951 Generate code for the SH4 with a floating-point unit that only
12952 supports single-precision arithmetic.
12953
12954 @item -m4-single
12955 @opindex m4-single
12956 Generate code for the SH4 assuming the floating-point unit is in
12957 single-precision mode by default.
12958
12959 @item -m4
12960 @opindex m4
12961 Generate code for the SH4.
12962
12963 @item -m4a-nofpu
12964 @opindex m4a-nofpu
12965 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
12966 floating-point unit is not used.
12967
12968 @item -m4a-single-only
12969 @opindex m4a-single-only
12970 Generate code for the SH4a, in such a way that no double-precision
12971 floating point operations are used.
12972
12973 @item -m4a-single
12974 @opindex m4a-single
12975 Generate code for the SH4a assuming the floating-point unit is in
12976 single-precision mode by default.
12977
12978 @item -m4a
12979 @opindex m4a
12980 Generate code for the SH4a.
12981
12982 @item -m4al
12983 @opindex m4al
12984 Same as @option{-m4a-nofpu}, except that it implicitly passes
12985 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
12986 instructions at the moment.
12987
12988 @item -mb
12989 @opindex mb
12990 Compile code for the processor in big endian mode.
12991
12992 @item -ml
12993 @opindex ml
12994 Compile code for the processor in little endian mode.
12995
12996 @item -mdalign
12997 @opindex mdalign
12998 Align doubles at 64-bit boundaries.  Note that this changes the calling
12999 conventions, and thus some functions from the standard C library will
13000 not work unless you recompile it first with @option{-mdalign}.
13001
13002 @item -mrelax
13003 @opindex mrelax
13004 Shorten some address references at link time, when possible; uses the
13005 linker option @option{-relax}.
13006
13007 @item -mbigtable
13008 @opindex mbigtable
13009 Use 32-bit offsets in @code{switch} tables.  The default is to use
13010 16-bit offsets.
13011
13012 @item -mfmovd
13013 @opindex mfmovd
13014 Enable the use of the instruction @code{fmovd}.
13015
13016 @item -mhitachi
13017 @opindex mhitachi
13018 Comply with the calling conventions defined by Renesas.
13019
13020 @item -mrenesas
13021 @opindex mhitachi
13022 Comply with the calling conventions defined by Renesas.
13023
13024 @item -mno-renesas
13025 @opindex mhitachi
13026 Comply with the calling conventions defined for GCC before the Renesas
13027 conventions were available.  This option is the default for all
13028 targets of the SH toolchain except for @samp{sh-symbianelf}.
13029
13030 @item -mnomacsave
13031 @opindex mnomacsave
13032 Mark the @code{MAC} register as call-clobbered, even if
13033 @option{-mhitachi} is given.
13034
13035 @item -mieee
13036 @opindex mieee
13037 Increase IEEE-compliance of floating-point code.
13038 At the moment, this is equivalent to @option{-fno-finite-math-only}.
13039 When generating 16 bit SH opcodes, getting IEEE-conforming results for
13040 comparisons of NANs / infinities incurs extra overhead in every
13041 floating point comparison, therefore the default is set to
13042 @option{-ffinite-math-only}.
13043
13044 @item -minline-ic_invalidate
13045 @opindex minline-ic_invalidate
13046 Inline code to invalidate instruction cache entries after setting up
13047 nested function trampolines.
13048 This option has no effect if -musermode is in effect and the selected
13049 code generation option (e.g. -m4) does not allow the use of the icbi
13050 instruction.
13051 If the selected code generation option does not allow the use of the icbi
13052 instruction, and -musermode is not in effect, the inlined code will
13053 manipulate the instruction cache address array directly with an associative
13054 write.  This not only requires privileged mode, but it will also
13055 fail if the cache line had been mapped via the TLB and has become unmapped.
13056
13057 @item -misize
13058 @opindex misize
13059 Dump instruction size and location in the assembly code.
13060
13061 @item -mpadstruct
13062 @opindex mpadstruct
13063 This option is deprecated.  It pads structures to multiple of 4 bytes,
13064 which is incompatible with the SH ABI@.
13065
13066 @item -mspace
13067 @opindex mspace
13068 Optimize for space instead of speed.  Implied by @option{-Os}.
13069
13070 @item -mprefergot
13071 @opindex mprefergot
13072 When generating position-independent code, emit function calls using
13073 the Global Offset Table instead of the Procedure Linkage Table.
13074
13075 @item -musermode
13076 @opindex musermode
13077 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
13078 if the inlined code would not work in user mode.
13079 This is the default when the target is @code{sh-*-linux*}.
13080
13081 @item -multcost=@var{number}
13082 @opindex multcost=@var{number}
13083 Set the cost to assume for a multiply insn.
13084
13085 @item -mdiv=@var{strategy}
13086 @opindex mdiv=@var{strategy}
13087 Set the division strategy to use for SHmedia code.  @var{strategy} must be
13088 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
13089 inv:call2, inv:fp .
13090 "fp" performs the operation in floating point.  This has a very high latency,
13091 but needs only a few instructions, so it might be a good choice if
13092 your code has enough easily exploitable ILP to allow the compiler to
13093 schedule the floating point instructions together with other instructions.
13094 Division by zero causes a floating point exception.
13095 "inv" uses integer operations to calculate the inverse of the divisor,
13096 and then multiplies the dividend with the inverse.  This strategy allows
13097 cse and hoisting of the inverse calculation.  Division by zero calculates
13098 an unspecified result, but does not trap.
13099 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
13100 have been found, or if the entire operation has been hoisted to the same
13101 place, the last stages of the inverse calculation are intertwined with the
13102 final multiply to reduce the overall latency, at the expense of using a few
13103 more instructions, and thus offering fewer scheduling opportunities with
13104 other code.
13105 "call" calls a library function that usually implements the inv:minlat
13106 strategy.
13107 This gives high code density for m5-*media-nofpu compilations.
13108 "call2" uses a different entry point of the same library function, where it
13109 assumes that a pointer to a lookup table has already been set up, which
13110 exposes the pointer load to cse / code hoisting optimizations.
13111 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
13112 code generation, but if the code stays unoptimized, revert to the "call",
13113 "call2", or "fp" strategies, respectively.  Note that the
13114 potentially-trapping side effect of division by zero is carried by a
13115 separate instruction, so it is possible that all the integer instructions
13116 are hoisted out, but the marker for the side effect stays where it is.
13117 A recombination to fp operations or a call is not possible in that case.
13118 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
13119 that the inverse calculation was nor separated from the multiply, they speed
13120 up division where the dividend fits into 20 bits (plus sign where applicable),
13121 by inserting a test to skip a number of operations in this case; this test
13122 slows down the case of larger dividends.  inv20u assumes the case of a such
13123 a small dividend to be unlikely, and inv20l assumes it to be likely.
13124
13125 @item -mdivsi3_libfunc=@var{name}
13126 @opindex mdivsi3_libfunc=@var{name}
13127 Set the name of the library function used for 32 bit signed division to
13128 @var{name}.  This only affect the name used in the call and inv:call
13129 division strategies, and the compiler will still expect the same
13130 sets of input/output/clobbered registers as if this option was not present.
13131
13132 @item -madjust-unroll
13133 @opindex madjust-unroll
13134 Throttle unrolling to avoid thrashing target registers.
13135 This option only has an effect if the gcc code base supports the
13136 TARGET_ADJUST_UNROLL_MAX target hook.
13137
13138 @item -mindexed-addressing
13139 @opindex mindexed-addressing
13140 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
13141 This is only safe if the hardware and/or OS implement 32 bit wrap-around
13142 semantics for the indexed addressing mode.  The architecture allows the
13143 implementation of processors with 64 bit MMU, which the OS could use to
13144 get 32 bit addressing, but since no current hardware implementation supports
13145 this or any other way to make the indexed addressing mode safe to use in
13146 the 32 bit ABI, the default is -mno-indexed-addressing.
13147
13148 @item -mgettrcost=@var{number}
13149 @opindex mgettrcost=@var{number}
13150 Set the cost assumed for the gettr instruction to @var{number}.
13151 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
13152
13153 @item -mpt-fixed
13154 @opindex mpt-fixed
13155 Assume pt* instructions won't trap.  This will generally generate better
13156 scheduled code, but is unsafe on current hardware.  The current architecture
13157 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
13158 This has the unintentional effect of making it unsafe to schedule ptabs /
13159 ptrel before a branch, or hoist it out of a loop.  For example,
13160 __do_global_ctors, a part of libgcc that runs constructors at program
13161 startup, calls functions in a list which is delimited by @minus{}1.  With the
13162 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
13163 That means that all the constructors will be run a bit quicker, but when
13164 the loop comes to the end of the list, the program crashes because ptabs
13165 loads @minus{}1 into a target register.  Since this option is unsafe for any
13166 hardware implementing the current architecture specification, the default
13167 is -mno-pt-fixed.  Unless the user specifies a specific cost with
13168 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
13169 this deters register allocation using target registers for storing
13170 ordinary integers.
13171
13172 @item -minvalid-symbols
13173 @opindex minvalid-symbols
13174 Assume symbols might be invalid.  Ordinary function symbols generated by
13175 the compiler will always be valid to load with movi/shori/ptabs or
13176 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
13177 to generate symbols that will cause ptabs / ptrel to trap.
13178 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
13179 It will then prevent cross-basic-block cse, hoisting and most scheduling
13180 of symbol loads.  The default is @option{-mno-invalid-symbols}.
13181 @end table
13182
13183 @node SPARC Options
13184 @subsection SPARC Options
13185 @cindex SPARC options
13186
13187 These @samp{-m} options are supported on the SPARC:
13188
13189 @table @gcctabopt
13190 @item -mno-app-regs
13191 @itemx -mapp-regs
13192 @opindex mno-app-regs
13193 @opindex mapp-regs
13194 Specify @option{-mapp-regs} to generate output using the global registers
13195 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
13196 is the default.
13197
13198 To be fully SVR4 ABI compliant at the cost of some performance loss,
13199 specify @option{-mno-app-regs}.  You should compile libraries and system
13200 software with this option.
13201
13202 @item -mfpu
13203 @itemx -mhard-float
13204 @opindex mfpu
13205 @opindex mhard-float
13206 Generate output containing floating point instructions.  This is the
13207 default.
13208
13209 @item -mno-fpu
13210 @itemx -msoft-float
13211 @opindex mno-fpu
13212 @opindex msoft-float
13213 Generate output containing library calls for floating point.
13214 @strong{Warning:} the requisite libraries are not available for all SPARC
13215 targets.  Normally the facilities of the machine's usual C compiler are
13216 used, but this cannot be done directly in cross-compilation.  You must make
13217 your own arrangements to provide suitable library functions for
13218 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
13219 @samp{sparclite-*-*} do provide software floating point support.
13220
13221 @option{-msoft-float} changes the calling convention in the output file;
13222 therefore, it is only useful if you compile @emph{all} of a program with
13223 this option.  In particular, you need to compile @file{libgcc.a}, the
13224 library that comes with GCC, with @option{-msoft-float} in order for
13225 this to work.
13226
13227 @item -mhard-quad-float
13228 @opindex mhard-quad-float
13229 Generate output containing quad-word (long double) floating point
13230 instructions.
13231
13232 @item -msoft-quad-float
13233 @opindex msoft-quad-float
13234 Generate output containing library calls for quad-word (long double)
13235 floating point instructions.  The functions called are those specified
13236 in the SPARC ABI@.  This is the default.
13237
13238 As of this writing, there are no SPARC implementations that have hardware
13239 support for the quad-word floating point instructions.  They all invoke
13240 a trap handler for one of these instructions, and then the trap handler
13241 emulates the effect of the instruction.  Because of the trap handler overhead,
13242 this is much slower than calling the ABI library routines.  Thus the
13243 @option{-msoft-quad-float} option is the default.
13244
13245 @item -mno-unaligned-doubles
13246 @itemx -munaligned-doubles
13247 @opindex mno-unaligned-doubles
13248 @opindex munaligned-doubles
13249 Assume that doubles have 8 byte alignment.  This is the default.
13250
13251 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
13252 alignment only if they are contained in another type, or if they have an
13253 absolute address.  Otherwise, it assumes they have 4 byte alignment.
13254 Specifying this option avoids some rare compatibility problems with code
13255 generated by other compilers.  It is not the default because it results
13256 in a performance loss, especially for floating point code.
13257
13258 @item -mno-faster-structs
13259 @itemx -mfaster-structs
13260 @opindex mno-faster-structs
13261 @opindex mfaster-structs
13262 With @option{-mfaster-structs}, the compiler assumes that structures
13263 should have 8 byte alignment.  This enables the use of pairs of
13264 @code{ldd} and @code{std} instructions for copies in structure
13265 assignment, in place of twice as many @code{ld} and @code{st} pairs.
13266 However, the use of this changed alignment directly violates the SPARC
13267 ABI@.  Thus, it's intended only for use on targets where the developer
13268 acknowledges that their resulting code will not be directly in line with
13269 the rules of the ABI@.
13270
13271 @item -mimpure-text
13272 @opindex mimpure-text
13273 @option{-mimpure-text}, used in addition to @option{-shared}, tells
13274 the compiler to not pass @option{-z text} to the linker when linking a
13275 shared object.  Using this option, you can link position-dependent
13276 code into a shared object.
13277
13278 @option{-mimpure-text} suppresses the ``relocations remain against
13279 allocatable but non-writable sections'' linker error message.
13280 However, the necessary relocations will trigger copy-on-write, and the
13281 shared object is not actually shared across processes.  Instead of
13282 using @option{-mimpure-text}, you should compile all source code with
13283 @option{-fpic} or @option{-fPIC}.
13284
13285 This option is only available on SunOS and Solaris.
13286
13287 @item -mcpu=@var{cpu_type}
13288 @opindex mcpu
13289 Set the instruction set, register set, and instruction scheduling parameters
13290 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
13291 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
13292 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
13293 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
13294 @samp{ultrasparc3}, and @samp{niagara}.
13295
13296 Default instruction scheduling parameters are used for values that select
13297 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
13298 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
13299
13300 Here is a list of each supported architecture and their supported
13301 implementations.
13302
13303 @smallexample
13304     v7:             cypress
13305     v8:             supersparc, hypersparc
13306     sparclite:      f930, f934, sparclite86x
13307     sparclet:       tsc701
13308     v9:             ultrasparc, ultrasparc3, niagara
13309 @end smallexample
13310
13311 By default (unless configured otherwise), GCC generates code for the V7
13312 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
13313 additionally optimizes it for the Cypress CY7C602 chip, as used in the
13314 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
13315 SPARCStation 1, 2, IPX etc.
13316
13317 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
13318 architecture.  The only difference from V7 code is that the compiler emits
13319 the integer multiply and integer divide instructions which exist in SPARC-V8
13320 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
13321 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
13322 2000 series.
13323
13324 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
13325 the SPARC architecture.  This adds the integer multiply, integer divide step
13326 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
13327 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
13328 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
13329 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
13330 MB86934 chip, which is the more recent SPARClite with FPU@.
13331
13332 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
13333 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
13334 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
13335 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
13336 optimizes it for the TEMIC SPARClet chip.
13337
13338 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
13339 architecture.  This adds 64-bit integer and floating-point move instructions,
13340 3 additional floating-point condition code registers and conditional move
13341 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
13342 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
13343 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
13344 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
13345 @option{-mcpu=niagara}, the compiler additionally optimizes it for
13346 Sun UltraSPARC T1 chips.
13347
13348 @item -mtune=@var{cpu_type}
13349 @opindex mtune
13350 Set the instruction scheduling parameters for machine type
13351 @var{cpu_type}, but do not set the instruction set or register set that the
13352 option @option{-mcpu=@var{cpu_type}} would.
13353
13354 The same values for @option{-mcpu=@var{cpu_type}} can be used for
13355 @option{-mtune=@var{cpu_type}}, but the only useful values are those
13356 that select a particular cpu implementation.  Those are @samp{cypress},
13357 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
13358 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
13359 @samp{ultrasparc3}, and @samp{niagara}.
13360
13361 @item -mv8plus
13362 @itemx -mno-v8plus
13363 @opindex mv8plus
13364 @opindex mno-v8plus
13365 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
13366 difference from the V8 ABI is that the global and out registers are
13367 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
13368 mode for all SPARC-V9 processors.
13369
13370 @item -mvis
13371 @itemx -mno-vis
13372 @opindex mvis
13373 @opindex mno-vis
13374 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
13375 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
13376 @end table
13377
13378 These @samp{-m} options are supported in addition to the above
13379 on SPARC-V9 processors in 64-bit environments:
13380
13381 @table @gcctabopt
13382 @item -mlittle-endian
13383 @opindex mlittle-endian
13384 Generate code for a processor running in little-endian mode.  It is only
13385 available for a few configurations and most notably not on Solaris and Linux.
13386
13387 @item -m32
13388 @itemx -m64
13389 @opindex m32
13390 @opindex m64
13391 Generate code for a 32-bit or 64-bit environment.
13392 The 32-bit environment sets int, long and pointer to 32 bits.
13393 The 64-bit environment sets int to 32 bits and long and pointer
13394 to 64 bits.
13395
13396 @item -mcmodel=medlow
13397 @opindex mcmodel=medlow
13398 Generate code for the Medium/Low code model: 64-bit addresses, programs
13399 must be linked in the low 32 bits of memory.  Programs can be statically
13400 or dynamically linked.
13401
13402 @item -mcmodel=medmid
13403 @opindex mcmodel=medmid
13404 Generate code for the Medium/Middle code model: 64-bit addresses, programs
13405 must be linked in the low 44 bits of memory, the text and data segments must
13406 be less than 2GB in size and the data segment must be located within 2GB of
13407 the text segment.
13408
13409 @item -mcmodel=medany
13410 @opindex mcmodel=medany
13411 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
13412 may be linked anywhere in memory, the text and data segments must be less
13413 than 2GB in size and the data segment must be located within 2GB of the
13414 text segment.
13415
13416 @item -mcmodel=embmedany
13417 @opindex mcmodel=embmedany
13418 Generate code for the Medium/Anywhere code model for embedded systems:
13419 64-bit addresses, the text and data segments must be less than 2GB in
13420 size, both starting anywhere in memory (determined at link time).  The
13421 global register %g4 points to the base of the data segment.  Programs
13422 are statically linked and PIC is not supported.
13423
13424 @item -mstack-bias
13425 @itemx -mno-stack-bias
13426 @opindex mstack-bias
13427 @opindex mno-stack-bias
13428 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
13429 frame pointer if present, are offset by @minus{}2047 which must be added back
13430 when making stack frame references.  This is the default in 64-bit mode.
13431 Otherwise, assume no such offset is present.
13432 @end table
13433
13434 These switches are supported in addition to the above on Solaris:
13435
13436 @table @gcctabopt
13437 @item -threads
13438 @opindex threads
13439 Add support for multithreading using the Solaris threads library.  This
13440 option sets flags for both the preprocessor and linker.  This option does
13441 not affect the thread safety of object code produced by the compiler or
13442 that of libraries supplied with it.
13443
13444 @item -pthreads
13445 @opindex pthreads
13446 Add support for multithreading using the POSIX threads library.  This
13447 option sets flags for both the preprocessor and linker.  This option does
13448 not affect the thread safety of object code produced  by the compiler or
13449 that of libraries supplied with it.
13450
13451 @item -pthread
13452 @opindex pthread
13453 This is a synonym for @option{-pthreads}.
13454 @end table
13455
13456 @node SPU Options
13457 @subsection SPU Options
13458 @cindex SPU options
13459
13460 These @samp{-m} options are supported on the SPU:
13461
13462 @table @gcctabopt
13463 @item -mwarn-reloc
13464 @itemx -merror-reloc
13465 @opindex mwarn-reloc
13466 @opindex merror-reloc
13467
13468 The loader for SPU does not handle dynamic relocations.  By default, GCC
13469 will give an error when it generates code that requires a dynamic
13470 relocation.  @option{-mno-error-reloc} disables the error,
13471 @option{-mwarn-reloc} will generate a warning instead.
13472
13473 @item -msafe-dma
13474 @itemx -munsafe-dma
13475 @opindex msafe-dma
13476 @opindex munsafe-dma
13477
13478 Instructions which initiate or test completion of DMA must not be
13479 reordered with respect to loads and stores of the memory which is being
13480 accessed.  Users typically address this problem using the volatile
13481 keyword, but that can lead to inefficient code in places where the
13482 memory is known to not change.  Rather than mark the memory as volatile
13483 we treat the DMA instructions as potentially effecting all memory.  With
13484 @option{-munsafe-dma} users must use the volatile keyword to protect
13485 memory accesses.
13486
13487 @item -mbranch-hints
13488 @opindex mbranch-hints
13489
13490 By default, GCC will generate a branch hint instruction to avoid
13491 pipeline stalls for always taken or probably taken branches.  A hint
13492 will not be generated closer than 8 instructions away from its branch.
13493 There is little reason to disable them, except for debugging purposes,
13494 or to make an object a little bit smaller.
13495
13496 @item -msmall-mem
13497 @itemx -mlarge-mem
13498 @opindex msmall-mem
13499 @opindex mlarge-mem
13500
13501 By default, GCC generates code assuming that addresses are never larger
13502 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
13503 a full 32 bit address.
13504
13505 @item -mstdmain
13506 @opindex mstdmain
13507
13508 By default, GCC links against startup code that assumes the SPU-style
13509 main function interface (which has an unconventional parameter list).
13510 With @option{-mstdmain}, GCC will link your program against startup
13511 code that assumes a C99-style interface to @code{main}, including a
13512 local copy of @code{argv} strings.
13513
13514 @item -mfixed-range=@var{register-range}
13515 @opindex mfixed-range
13516 Generate code treating the given register range as fixed registers.
13517 A fixed register is one that the register allocator can not use.  This is
13518 useful when compiling kernel code.  A register range is specified as
13519 two registers separated by a dash.  Multiple register ranges can be
13520 specified separated by a comma.
13521
13522 @end table
13523
13524 @node System V Options
13525 @subsection Options for System V
13526
13527 These additional options are available on System V Release 4 for
13528 compatibility with other compilers on those systems:
13529
13530 @table @gcctabopt
13531 @item -G
13532 @opindex G
13533 Create a shared object.
13534 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13535
13536 @item -Qy
13537 @opindex Qy
13538 Identify the versions of each tool used by the compiler, in a
13539 @code{.ident} assembler directive in the output.
13540
13541 @item -Qn
13542 @opindex Qn
13543 Refrain from adding @code{.ident} directives to the output file (this is
13544 the default).
13545
13546 @item -YP,@var{dirs}
13547 @opindex YP
13548 Search the directories @var{dirs}, and no others, for libraries
13549 specified with @option{-l}.
13550
13551 @item -Ym,@var{dir}
13552 @opindex Ym
13553 Look in the directory @var{dir} to find the M4 preprocessor.
13554 The assembler uses this option.
13555 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13556 @c the generic assembler that comes with Solaris takes just -Ym.
13557 @end table
13558
13559 @node TMS320C3x/C4x Options
13560 @subsection TMS320C3x/C4x Options
13561 @cindex TMS320C3x/C4x Options
13562
13563 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
13564
13565 @table @gcctabopt
13566
13567 @item -mcpu=@var{cpu_type}
13568 @opindex mcpu
13569 Set the instruction set, register set, and instruction scheduling
13570 parameters for machine type @var{cpu_type}.  Supported values for
13571 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
13572 @samp{c44}.  The default is @samp{c40} to generate code for the
13573 TMS320C40.
13574
13575 @item -mbig-memory
13576 @itemx -mbig
13577 @itemx -msmall-memory
13578 @itemx -msmall
13579 @opindex mbig-memory
13580 @opindex mbig
13581 @opindex msmall-memory
13582 @opindex msmall
13583 Generates code for the big or small memory model.  The small memory
13584 model assumed that all data fits into one 64K word page.  At run-time
13585 the data page (DP) register must be set to point to the 64K page
13586 containing the .bss and .data program sections.  The big memory model is
13587 the default and requires reloading of the DP register for every direct
13588 memory access.
13589
13590 @item -mbk
13591 @itemx -mno-bk
13592 @opindex mbk
13593 @opindex mno-bk
13594 Allow (disallow) allocation of general integer operands into the block
13595 count register BK@.
13596
13597 @item -mdb
13598 @itemx -mno-db
13599 @opindex mdb
13600 @opindex mno-db
13601 Enable (disable) generation of code using decrement and branch,
13602 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13603 on the safe side, this is disabled for the C3x, since the maximum
13604 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13605 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13606 that it can utilize the decrement and branch instruction, but will give
13607 up if there is more than one memory reference in the loop.  Thus a loop
13608 where the loop counter is decremented can generate slightly more
13609 efficient code, in cases where the RPTB instruction cannot be utilized.
13610
13611 @item -mdp-isr-reload
13612 @itemx -mparanoid
13613 @opindex mdp-isr-reload
13614 @opindex mparanoid
13615 Force the DP register to be saved on entry to an interrupt service
13616 routine (ISR), reloaded to point to the data section, and restored on
13617 exit from the ISR@.  This should not be required unless someone has
13618 violated the small memory model by modifying the DP register, say within
13619 an object library.
13620
13621 @item -mmpyi
13622 @itemx -mno-mpyi
13623 @opindex mmpyi
13624 @opindex mno-mpyi
13625 For the C3x use the 24-bit MPYI instruction for integer multiplies
13626 instead of a library call to guarantee 32-bit results.  Note that if one
13627 of the operands is a constant, then the multiplication will be performed
13628 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13629 then squaring operations are performed inline instead of a library call.
13630
13631 @item -mfast-fix
13632 @itemx -mno-fast-fix
13633 @opindex mfast-fix
13634 @opindex mno-fast-fix
13635 The C3x/C4x FIX instruction to convert a floating point value to an
13636 integer value chooses the nearest integer less than or equal to the
13637 floating point value rather than to the nearest integer.  Thus if the
13638 floating point number is negative, the result will be incorrectly
13639 truncated an additional code is necessary to detect and correct this
13640 case.  This option can be used to disable generation of the additional
13641 code required to correct the result.
13642
13643 @item -mrptb
13644 @itemx -mno-rptb
13645 @opindex mrptb
13646 @opindex mno-rptb
13647 Enable (disable) generation of repeat block sequences using the RPTB
13648 instruction for zero overhead looping.  The RPTB construct is only used
13649 for innermost loops that do not call functions or jump across the loop
13650 boundaries.  There is no advantage having nested RPTB loops due to the
13651 overhead required to save and restore the RC, RS, and RE registers.
13652 This is enabled by default with @option{-O2}.
13653
13654 @item -mrpts=@var{count}
13655 @itemx -mno-rpts
13656 @opindex mrpts
13657 @opindex mno-rpts
13658 Enable (disable) the use of the single instruction repeat instruction
13659 RPTS@.  If a repeat block contains a single instruction, and the loop
13660 count can be guaranteed to be less than the value @var{count}, GCC will
13661 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13662 then a RPTS will be emitted even if the loop count cannot be determined
13663 at compile time.  Note that the repeated instruction following RPTS does
13664 not have to be reloaded from memory each iteration, thus freeing up the
13665 CPU buses for operands.  However, since interrupts are blocked by this
13666 instruction, it is disabled by default.
13667
13668 @item -mloop-unsigned
13669 @itemx -mno-loop-unsigned
13670 @opindex mloop-unsigned
13671 @opindex mno-loop-unsigned
13672 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13673 is @math{2^{31} + 1} since these instructions test if the iteration count is
13674 negative to terminate the loop.  If the iteration count is unsigned
13675 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13676 exceeded.  This switch allows an unsigned iteration count.
13677
13678 @item -mti
13679 @opindex mti
13680 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13681 with.  This also enforces compatibility with the API employed by the TI
13682 C3x C compiler.  For example, long doubles are passed as structures
13683 rather than in floating point registers.
13684
13685 @item -mregparm
13686 @itemx -mmemparm
13687 @opindex mregparm
13688 @opindex mmemparm
13689 Generate code that uses registers (stack) for passing arguments to functions.
13690 By default, arguments are passed in registers where possible rather
13691 than by pushing arguments on to the stack.
13692
13693 @item -mparallel-insns
13694 @itemx -mno-parallel-insns
13695 @opindex mparallel-insns
13696 @opindex mno-parallel-insns
13697 Allow the generation of parallel instructions.  This is enabled by
13698 default with @option{-O2}.
13699
13700 @item -mparallel-mpy
13701 @itemx -mno-parallel-mpy
13702 @opindex mparallel-mpy
13703 @opindex mno-parallel-mpy
13704 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13705 provided @option{-mparallel-insns} is also specified.  These instructions have
13706 tight register constraints which can pessimize the code generation
13707 of large functions.
13708
13709 @end table
13710
13711 @node V850 Options
13712 @subsection V850 Options
13713 @cindex V850 Options
13714
13715 These @samp{-m} options are defined for V850 implementations:
13716
13717 @table @gcctabopt
13718 @item -mlong-calls
13719 @itemx -mno-long-calls
13720 @opindex mlong-calls
13721 @opindex mno-long-calls
13722 Treat all calls as being far away (near).  If calls are assumed to be
13723 far away, the compiler will always load the functions address up into a
13724 register, and call indirect through the pointer.
13725
13726 @item -mno-ep
13727 @itemx -mep
13728 @opindex mno-ep
13729 @opindex mep
13730 Do not optimize (do optimize) basic blocks that use the same index
13731 pointer 4 or more times to copy pointer into the @code{ep} register, and
13732 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13733 option is on by default if you optimize.
13734
13735 @item -mno-prolog-function
13736 @itemx -mprolog-function
13737 @opindex mno-prolog-function
13738 @opindex mprolog-function
13739 Do not use (do use) external functions to save and restore registers
13740 at the prologue and epilogue of a function.  The external functions
13741 are slower, but use less code space if more than one function saves
13742 the same number of registers.  The @option{-mprolog-function} option
13743 is on by default if you optimize.
13744
13745 @item -mspace
13746 @opindex mspace
13747 Try to make the code as small as possible.  At present, this just turns
13748 on the @option{-mep} and @option{-mprolog-function} options.
13749
13750 @item -mtda=@var{n}
13751 @opindex mtda
13752 Put static or global variables whose size is @var{n} bytes or less into
13753 the tiny data area that register @code{ep} points to.  The tiny data
13754 area can hold up to 256 bytes in total (128 bytes for byte references).
13755
13756 @item -msda=@var{n}
13757 @opindex msda
13758 Put static or global variables whose size is @var{n} bytes or less into
13759 the small data area that register @code{gp} points to.  The small data
13760 area can hold up to 64 kilobytes.
13761
13762 @item -mzda=@var{n}
13763 @opindex mzda
13764 Put static or global variables whose size is @var{n} bytes or less into
13765 the first 32 kilobytes of memory.
13766
13767 @item -mv850
13768 @opindex mv850
13769 Specify that the target processor is the V850.
13770
13771 @item -mbig-switch
13772 @opindex mbig-switch
13773 Generate code suitable for big switch tables.  Use this option only if
13774 the assembler/linker complain about out of range branches within a switch
13775 table.
13776
13777 @item -mapp-regs
13778 @opindex mapp-regs
13779 This option will cause r2 and r5 to be used in the code generated by
13780 the compiler.  This setting is the default.
13781
13782 @item -mno-app-regs
13783 @opindex mno-app-regs
13784 This option will cause r2 and r5 to be treated as fixed registers.
13785
13786 @item -mv850e1
13787 @opindex mv850e1
13788 Specify that the target processor is the V850E1.  The preprocessor
13789 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
13790 this option is used.
13791
13792 @item -mv850e
13793 @opindex mv850e
13794 Specify that the target processor is the V850E@.  The preprocessor
13795 constant @samp{__v850e__} will be defined if this option is used.
13796
13797 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
13798 are defined then a default target processor will be chosen and the
13799 relevant @samp{__v850*__} preprocessor constant will be defined.
13800
13801 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
13802 defined, regardless of which processor variant is the target.
13803
13804 @item -mdisable-callt
13805 @opindex mdisable-callt
13806 This option will suppress generation of the CALLT instruction for the
13807 v850e and v850e1 flavors of the v850 architecture.  The default is
13808 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
13809
13810 @end table
13811
13812 @node VAX Options
13813 @subsection VAX Options
13814 @cindex VAX options
13815
13816 These @samp{-m} options are defined for the VAX:
13817
13818 @table @gcctabopt
13819 @item -munix
13820 @opindex munix
13821 Do not output certain jump instructions (@code{aobleq} and so on)
13822 that the Unix assembler for the VAX cannot handle across long
13823 ranges.
13824
13825 @item -mgnu
13826 @opindex mgnu
13827 Do output those jump instructions, on the assumption that you
13828 will assemble with the GNU assembler.
13829
13830 @item -mg
13831 @opindex mg
13832 Output code for g-format floating point numbers instead of d-format.
13833 @end table
13834
13835 @node VxWorks Options
13836 @subsection VxWorks Options
13837 @cindex VxWorks Options
13838
13839 The options in this section are defined for all VxWorks targets.
13840 Options specific to the target hardware are listed with the other
13841 options for that target.
13842
13843 @table @gcctabopt
13844 @item -mrtp
13845 @opindex mrtp
13846 GCC can generate code for both VxWorks kernels and real time processes
13847 (RTPs).  This option switches from the former to the latter.  It also
13848 defines the preprocessor macro @code{__RTP__}.
13849
13850 @item -non-static
13851 @opindex non-static
13852 Link an RTP executable against shared libraries rather than static
13853 libraries.  The options @option{-static} and @option{-shared} can
13854 also be used for RTPs (@pxref{Link Options}); @option{-static}
13855 is the default.
13856
13857 @item -Bstatic
13858 @itemx -Bdynamic
13859 @opindex Bstatic
13860 @opindex Bdynamic
13861 These options are passed down to the linker.  They are defined for
13862 compatibility with Diab.
13863
13864 @item -Xbind-lazy
13865 @opindex Xbind-lazy
13866 Enable lazy binding of function calls.  This option is equivalent to
13867 @option{-Wl,-z,now} and is defined for compatibility with Diab.
13868
13869 @item -Xbind-now
13870 @opindex Xbind-now
13871 Disable lazy binding of function calls.  This option is the default and
13872 is defined for compatibility with Diab.
13873 @end table
13874
13875 @node x86-64 Options
13876 @subsection x86-64 Options
13877 @cindex x86-64 options
13878
13879 These are listed under @xref{i386 and x86-64 Options}.
13880
13881 @node Xstormy16 Options
13882 @subsection Xstormy16 Options
13883 @cindex Xstormy16 Options
13884
13885 These options are defined for Xstormy16:
13886
13887 @table @gcctabopt
13888 @item -msim
13889 @opindex msim
13890 Choose startup files and linker script suitable for the simulator.
13891 @end table
13892
13893 @node Xtensa Options
13894 @subsection Xtensa Options
13895 @cindex Xtensa Options
13896
13897 These options are supported for Xtensa targets:
13898
13899 @table @gcctabopt
13900 @item -mconst16
13901 @itemx -mno-const16
13902 @opindex mconst16
13903 @opindex mno-const16
13904 Enable or disable use of @code{CONST16} instructions for loading
13905 constant values.  The @code{CONST16} instruction is currently not a
13906 standard option from Tensilica.  When enabled, @code{CONST16}
13907 instructions are always used in place of the standard @code{L32R}
13908 instructions.  The use of @code{CONST16} is enabled by default only if
13909 the @code{L32R} instruction is not available.
13910
13911 @item -mfused-madd
13912 @itemx -mno-fused-madd
13913 @opindex mfused-madd
13914 @opindex mno-fused-madd
13915 Enable or disable use of fused multiply/add and multiply/subtract
13916 instructions in the floating-point option.  This has no effect if the
13917 floating-point option is not also enabled.  Disabling fused multiply/add
13918 and multiply/subtract instructions forces the compiler to use separate
13919 instructions for the multiply and add/subtract operations.  This may be
13920 desirable in some cases where strict IEEE 754-compliant results are
13921 required: the fused multiply add/subtract instructions do not round the
13922 intermediate result, thereby producing results with @emph{more} bits of
13923 precision than specified by the IEEE standard.  Disabling fused multiply
13924 add/subtract instructions also ensures that the program output is not
13925 sensitive to the compiler's ability to combine multiply and add/subtract
13926 operations.
13927
13928 @item -mtext-section-literals
13929 @itemx -mno-text-section-literals
13930 @opindex mtext-section-literals
13931 @opindex mno-text-section-literals
13932 Control the treatment of literal pools.  The default is
13933 @option{-mno-text-section-literals}, which places literals in a separate
13934 section in the output file.  This allows the literal pool to be placed
13935 in a data RAM/ROM, and it also allows the linker to combine literal
13936 pools from separate object files to remove redundant literals and
13937 improve code size.  With @option{-mtext-section-literals}, the literals
13938 are interspersed in the text section in order to keep them as close as
13939 possible to their references.  This may be necessary for large assembly
13940 files.
13941
13942 @item -mtarget-align
13943 @itemx -mno-target-align
13944 @opindex mtarget-align
13945 @opindex mno-target-align
13946 When this option is enabled, GCC instructs the assembler to
13947 automatically align instructions to reduce branch penalties at the
13948 expense of some code density.  The assembler attempts to widen density
13949 instructions to align branch targets and the instructions following call
13950 instructions.  If there are not enough preceding safe density
13951 instructions to align a target, no widening will be performed.  The
13952 default is @option{-mtarget-align}.  These options do not affect the
13953 treatment of auto-aligned instructions like @code{LOOP}, which the
13954 assembler will always align, either by widening density instructions or
13955 by inserting no-op instructions.
13956
13957 @item -mlongcalls
13958 @itemx -mno-longcalls
13959 @opindex mlongcalls
13960 @opindex mno-longcalls
13961 When this option is enabled, GCC instructs the assembler to translate
13962 direct calls to indirect calls unless it can determine that the target
13963 of a direct call is in the range allowed by the call instruction.  This
13964 translation typically occurs for calls to functions in other source
13965 files.  Specifically, the assembler translates a direct @code{CALL}
13966 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
13967 The default is @option{-mno-longcalls}.  This option should be used in
13968 programs where the call target can potentially be out of range.  This
13969 option is implemented in the assembler, not the compiler, so the
13970 assembly code generated by GCC will still show direct call
13971 instructions---look at the disassembled object code to see the actual
13972 instructions.  Note that the assembler will use an indirect call for
13973 every cross-file call, not just those that really will be out of range.
13974 @end table
13975
13976 @node zSeries Options
13977 @subsection zSeries Options
13978 @cindex zSeries options
13979
13980 These are listed under @xref{S/390 and zSeries Options}.
13981
13982 @node Code Gen Options
13983 @section Options for Code Generation Conventions
13984 @cindex code generation conventions
13985 @cindex options, code generation
13986 @cindex run-time options
13987
13988 These machine-independent options control the interface conventions
13989 used in code generation.
13990
13991 Most of them have both positive and negative forms; the negative form
13992 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
13993 one of the forms is listed---the one which is not the default.  You
13994 can figure out the other form by either removing @samp{no-} or adding
13995 it.
13996
13997 @table @gcctabopt
13998 @item -fbounds-check
13999 @opindex fbounds-check
14000 For front-ends that support it, generate additional code to check that
14001 indices used to access arrays are within the declared range.  This is
14002 currently only supported by the Java and Fortran front-ends, where
14003 this option defaults to true and false respectively.
14004
14005 @item -ftrapv
14006 @opindex ftrapv
14007 This option generates traps for signed overflow on addition, subtraction,
14008 multiplication operations.
14009
14010 @item -fwrapv
14011 @opindex fwrapv
14012 This option instructs the compiler to assume that signed arithmetic
14013 overflow of addition, subtraction and multiplication wraps around
14014 using twos-complement representation.  This flag enables some optimizations
14015 and disables others.  This option is enabled by default for the Java
14016 front-end, as required by the Java language specification.
14017
14018 @item -fexceptions
14019 @opindex fexceptions
14020 Enable exception handling.  Generates extra code needed to propagate
14021 exceptions.  For some targets, this implies GCC will generate frame
14022 unwind information for all functions, which can produce significant data
14023 size overhead, although it does not affect execution.  If you do not
14024 specify this option, GCC will enable it by default for languages like
14025 C++ which normally require exception handling, and disable it for
14026 languages like C that do not normally require it.  However, you may need
14027 to enable this option when compiling C code that needs to interoperate
14028 properly with exception handlers written in C++.  You may also wish to
14029 disable this option if you are compiling older C++ programs that don't
14030 use exception handling.
14031
14032 @item -fnon-call-exceptions
14033 @opindex fnon-call-exceptions
14034 Generate code that allows trapping instructions to throw exceptions.
14035 Note that this requires platform-specific runtime support that does
14036 not exist everywhere.  Moreover, it only allows @emph{trapping}
14037 instructions to throw exceptions, i.e.@: memory references or floating
14038 point instructions.  It does not allow exceptions to be thrown from
14039 arbitrary signal handlers such as @code{SIGALRM}.
14040
14041 @item -funwind-tables
14042 @opindex funwind-tables
14043 Similar to @option{-fexceptions}, except that it will just generate any needed
14044 static data, but will not affect the generated code in any other way.
14045 You will normally not enable this option; instead, a language processor
14046 that needs this handling would enable it on your behalf.
14047
14048 @item -fasynchronous-unwind-tables
14049 @opindex fasynchronous-unwind-tables
14050 Generate unwind table in dwarf2 format, if supported by target machine.  The
14051 table is exact at each instruction boundary, so it can be used for stack
14052 unwinding from asynchronous events (such as debugger or garbage collector).
14053
14054 @item -fpcc-struct-return
14055 @opindex fpcc-struct-return
14056 Return ``short'' @code{struct} and @code{union} values in memory like
14057 longer ones, rather than in registers.  This convention is less
14058 efficient, but it has the advantage of allowing intercallability between
14059 GCC-compiled files and files compiled with other compilers, particularly
14060 the Portable C Compiler (pcc).
14061
14062 The precise convention for returning structures in memory depends
14063 on the target configuration macros.
14064
14065 Short structures and unions are those whose size and alignment match
14066 that of some integer type.
14067
14068 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
14069 switch is not binary compatible with code compiled with the
14070 @option{-freg-struct-return} switch.
14071 Use it to conform to a non-default application binary interface.
14072
14073 @item -freg-struct-return
14074 @opindex freg-struct-return
14075 Return @code{struct} and @code{union} values in registers when possible.
14076 This is more efficient for small structures than
14077 @option{-fpcc-struct-return}.
14078
14079 If you specify neither @option{-fpcc-struct-return} nor
14080 @option{-freg-struct-return}, GCC defaults to whichever convention is
14081 standard for the target.  If there is no standard convention, GCC
14082 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14083 the principal compiler.  In those cases, we can choose the standard, and
14084 we chose the more efficient register return alternative.
14085
14086 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14087 switch is not binary compatible with code compiled with the
14088 @option{-fpcc-struct-return} switch.
14089 Use it to conform to a non-default application binary interface.
14090
14091 @item -fshort-enums
14092 @opindex fshort-enums
14093 Allocate to an @code{enum} type only as many bytes as it needs for the
14094 declared range of possible values.  Specifically, the @code{enum} type
14095 will be equivalent to the smallest integer type which has enough room.
14096
14097 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14098 code that is not binary compatible with code generated without that switch.
14099 Use it to conform to a non-default application binary interface.
14100
14101 @item -fshort-double
14102 @opindex fshort-double
14103 Use the same size for @code{double} as for @code{float}.
14104
14105 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
14106 code that is not binary compatible with code generated without that switch.
14107 Use it to conform to a non-default application binary interface.
14108
14109 @item -fshort-wchar
14110 @opindex fshort-wchar
14111 Override the underlying type for @samp{wchar_t} to be @samp{short
14112 unsigned int} instead of the default for the target.  This option is
14113 useful for building programs to run under WINE@.
14114
14115 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14116 code that is not binary compatible with code generated without that switch.
14117 Use it to conform to a non-default application binary interface.
14118
14119 @item -fno-common
14120 @opindex fno-common
14121 In C, allocate even uninitialized global variables in the data section of the
14122 object file, rather than generating them as common blocks.  This has the
14123 effect that if the same variable is declared (without @code{extern}) in
14124 two different compilations, you will get an error when you link them.
14125 The only reason this might be useful is if you wish to verify that the
14126 program will work on other systems which always work this way.
14127
14128 @item -fno-ident
14129 @opindex fno-ident
14130 Ignore the @samp{#ident} directive.
14131
14132 @item -finhibit-size-directive
14133 @opindex finhibit-size-directive
14134 Don't output a @code{.size} assembler directive, or anything else that
14135 would cause trouble if the function is split in the middle, and the
14136 two halves are placed at locations far apart in memory.  This option is
14137 used when compiling @file{crtstuff.c}; you should not need to use it
14138 for anything else.
14139
14140 @item -fverbose-asm
14141 @opindex fverbose-asm
14142 Put extra commentary information in the generated assembly code to
14143 make it more readable.  This option is generally only of use to those
14144 who actually need to read the generated assembly code (perhaps while
14145 debugging the compiler itself).
14146
14147 @option{-fno-verbose-asm}, the default, causes the
14148 extra information to be omitted and is useful when comparing two assembler
14149 files.
14150
14151 @item -frecord-gcc-switches
14152 @opindex frecord-gcc-switches
14153 This switch causes the command line that was used to invoke the
14154 compiler to be recorded into the object file that is being created.
14155 This switch is only implemented on some targets and the exact format
14156 of the recording is target and binary file format dependent, but it
14157 usually takes the form of a section containing ASCII text.  This
14158 switch is related to the @option{-fverbose-asm} switch, but that
14159 switch only records information in the assembler output file as
14160 comments, so it never reaches the object file.
14161
14162 @item -fpic
14163 @opindex fpic
14164 @cindex global offset table
14165 @cindex PIC
14166 Generate position-independent code (PIC) suitable for use in a shared
14167 library, if supported for the target machine.  Such code accesses all
14168 constant addresses through a global offset table (GOT)@.  The dynamic
14169 loader resolves the GOT entries when the program starts (the dynamic
14170 loader is not part of GCC; it is part of the operating system).  If
14171 the GOT size for the linked executable exceeds a machine-specific
14172 maximum size, you get an error message from the linker indicating that
14173 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14174 instead.  (These maximums are 8k on the SPARC and 32k
14175 on the m68k and RS/6000.  The 386 has no such limit.)
14176
14177 Position-independent code requires special support, and therefore works
14178 only on certain machines.  For the 386, GCC supports PIC for System V
14179 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14180 position-independent.
14181
14182 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14183 are defined to 1.
14184
14185 @item -fPIC
14186 @opindex fPIC
14187 If supported for the target machine, emit position-independent code,
14188 suitable for dynamic linking and avoiding any limit on the size of the
14189 global offset table.  This option makes a difference on the m68k,
14190 PowerPC and SPARC@.
14191
14192 Position-independent code requires special support, and therefore works
14193 only on certain machines.
14194
14195 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14196 are defined to 2.
14197
14198 @item -fpie
14199 @itemx -fPIE
14200 @opindex fpie
14201 @opindex fPIE
14202 These options are similar to @option{-fpic} and @option{-fPIC}, but
14203 generated position independent code can be only linked into executables.
14204 Usually these options are used when @option{-pie} GCC option will be
14205 used during linking.
14206
14207 @item -fno-jump-tables
14208 @opindex fno-jump-tables
14209 Do not use jump tables for switch statements even where it would be
14210 more efficient than other code generation strategies.  This option is
14211 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14212 building code which forms part of a dynamic linker and cannot
14213 reference the address of a jump table.  On some targets, jump tables
14214 do not require a GOT and this option is not needed.
14215
14216 @item -ffixed-@var{reg}
14217 @opindex ffixed
14218 Treat the register named @var{reg} as a fixed register; generated code
14219 should never refer to it (except perhaps as a stack pointer, frame
14220 pointer or in some other fixed role).
14221
14222 @var{reg} must be the name of a register.  The register names accepted
14223 are machine-specific and are defined in the @code{REGISTER_NAMES}
14224 macro in the machine description macro file.
14225
14226 This flag does not have a negative form, because it specifies a
14227 three-way choice.
14228
14229 @item -fcall-used-@var{reg}
14230 @opindex fcall-used
14231 Treat the register named @var{reg} as an allocable register that is
14232 clobbered by function calls.  It may be allocated for temporaries or
14233 variables that do not live across a call.  Functions compiled this way
14234 will not save and restore the register @var{reg}.
14235
14236 It is an error to used this flag with the frame pointer or stack pointer.
14237 Use of this flag for other registers that have fixed pervasive roles in
14238 the machine's execution model will produce disastrous results.
14239
14240 This flag does not have a negative form, because it specifies a
14241 three-way choice.
14242
14243 @item -fcall-saved-@var{reg}
14244 @opindex fcall-saved
14245 Treat the register named @var{reg} as an allocable register saved by
14246 functions.  It may be allocated even for temporaries or variables that
14247 live across a call.  Functions compiled this way will save and restore
14248 the register @var{reg} if they use it.
14249
14250 It is an error to used this flag with the frame pointer or stack pointer.
14251 Use of this flag for other registers that have fixed pervasive roles in
14252 the machine's execution model will produce disastrous results.
14253
14254 A different sort of disaster will result from the use of this flag for
14255 a register in which function values may be returned.
14256
14257 This flag does not have a negative form, because it specifies a
14258 three-way choice.
14259
14260 @item -fpack-struct[=@var{n}]
14261 @opindex fpack-struct
14262 Without a value specified, pack all structure members together without
14263 holes.  When a value is specified (which must be a small power of two), pack
14264 structure members according to this value, representing the maximum
14265 alignment (that is, objects with default alignment requirements larger than
14266 this will be output potentially unaligned at the next fitting location.
14267
14268 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14269 code that is not binary compatible with code generated without that switch.
14270 Additionally, it makes the code suboptimal.
14271 Use it to conform to a non-default application binary interface.
14272
14273 @item -finstrument-functions
14274 @opindex finstrument-functions
14275 Generate instrumentation calls for entry and exit to functions.  Just
14276 after function entry and just before function exit, the following
14277 profiling functions will be called with the address of the current
14278 function and its call site.  (On some platforms,
14279 @code{__builtin_return_address} does not work beyond the current
14280 function, so the call site information may not be available to the
14281 profiling functions otherwise.)
14282
14283 @smallexample
14284 void __cyg_profile_func_enter (void *this_fn,
14285                                void *call_site);
14286 void __cyg_profile_func_exit  (void *this_fn,
14287                                void *call_site);
14288 @end smallexample
14289
14290 The first argument is the address of the start of the current function,
14291 which may be looked up exactly in the symbol table.
14292
14293 This instrumentation is also done for functions expanded inline in other
14294 functions.  The profiling calls will indicate where, conceptually, the
14295 inline function is entered and exited.  This means that addressable
14296 versions of such functions must be available.  If all your uses of a
14297 function are expanded inline, this may mean an additional expansion of
14298 code size.  If you use @samp{extern inline} in your C code, an
14299 addressable version of such functions must be provided.  (This is
14300 normally the case anyways, but if you get lucky and the optimizer always
14301 expands the functions inline, you might have gotten away without
14302 providing static copies.)
14303
14304 A function may be given the attribute @code{no_instrument_function}, in
14305 which case this instrumentation will not be done.  This can be used, for
14306 example, for the profiling functions listed above, high-priority
14307 interrupt routines, and any functions from which the profiling functions
14308 cannot safely be called (perhaps signal handlers, if the profiling
14309 routines generate output or allocate memory).
14310
14311 @item -fstack-check
14312 @opindex fstack-check
14313 Generate code to verify that you do not go beyond the boundary of the
14314 stack.  You should specify this flag if you are running in an
14315 environment with multiple threads, but only rarely need to specify it in
14316 a single-threaded environment since stack overflow is automatically
14317 detected on nearly all systems if there is only one stack.
14318
14319 Note that this switch does not actually cause checking to be done; the
14320 operating system must do that.  The switch causes generation of code
14321 to ensure that the operating system sees the stack being extended.
14322
14323 @item -fstack-limit-register=@var{reg}
14324 @itemx -fstack-limit-symbol=@var{sym}
14325 @itemx -fno-stack-limit
14326 @opindex fstack-limit-register
14327 @opindex fstack-limit-symbol
14328 @opindex fno-stack-limit
14329 Generate code to ensure that the stack does not grow beyond a certain value,
14330 either the value of a register or the address of a symbol.  If the stack
14331 would grow beyond the value, a signal is raised.  For most targets,
14332 the signal is raised before the stack overruns the boundary, so
14333 it is possible to catch the signal without taking special precautions.
14334
14335 For instance, if the stack starts at absolute address @samp{0x80000000}
14336 and grows downwards, you can use the flags
14337 @option{-fstack-limit-symbol=__stack_limit} and
14338 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
14339 of 128KB@.  Note that this may only work with the GNU linker.
14340
14341 @cindex aliasing of parameters
14342 @cindex parameters, aliased
14343 @item -fargument-alias
14344 @itemx -fargument-noalias
14345 @itemx -fargument-noalias-global
14346 @itemx -fargument-noalias-anything
14347 @opindex fargument-alias
14348 @opindex fargument-noalias
14349 @opindex fargument-noalias-global
14350 @opindex fargument-noalias-anything
14351 Specify the possible relationships among parameters and between
14352 parameters and global data.
14353
14354 @option{-fargument-alias} specifies that arguments (parameters) may
14355 alias each other and may alias global storage.@*
14356 @option{-fargument-noalias} specifies that arguments do not alias
14357 each other, but may alias global storage.@*
14358 @option{-fargument-noalias-global} specifies that arguments do not
14359 alias each other and do not alias global storage.
14360 @option{-fargument-noalias-anything} specifies that arguments do not
14361 alias any other storage.
14362
14363 Each language will automatically use whatever option is required by
14364 the language standard.  You should not need to use these options yourself.
14365
14366 @item -fleading-underscore
14367 @opindex fleading-underscore
14368 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
14369 change the way C symbols are represented in the object file.  One use
14370 is to help link with legacy assembly code.
14371
14372 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
14373 generate code that is not binary compatible with code generated without that
14374 switch.  Use it to conform to a non-default application binary interface.
14375 Not all targets provide complete support for this switch.
14376
14377 @item -ftls-model=@var{model}
14378 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
14379 The @var{model} argument should be one of @code{global-dynamic},
14380 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
14381
14382 The default without @option{-fpic} is @code{initial-exec}; with
14383 @option{-fpic} the default is @code{global-dynamic}.
14384
14385 @item -fvisibility=@var{default|internal|hidden|protected}
14386 @opindex fvisibility
14387 Set the default ELF image symbol visibility to the specified option---all
14388 symbols will be marked with this unless overridden within the code.
14389 Using this feature can very substantially improve linking and
14390 load times of shared object libraries, produce more optimized
14391 code, provide near-perfect API export and prevent symbol clashes.
14392 It is @strong{strongly} recommended that you use this in any shared objects
14393 you distribute.
14394
14395 Despite the nomenclature, @code{default} always means public ie;
14396 available to be linked against from outside the shared object.
14397 @code{protected} and @code{internal} are pretty useless in real-world
14398 usage so the only other commonly used option will be @code{hidden}.
14399 The default if @option{-fvisibility} isn't specified is
14400 @code{default}, i.e., make every
14401 symbol public---this causes the same behavior as previous versions of
14402 GCC@.
14403
14404 A good explanation of the benefits offered by ensuring ELF
14405 symbols have the correct visibility is given by ``How To Write
14406 Shared Libraries'' by Ulrich Drepper (which can be found at
14407 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
14408 solution made possible by this option to marking things hidden when
14409 the default is public is to make the default hidden and mark things
14410 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
14411 and @code{__attribute__ ((visibility("default")))} instead of
14412 @code{__declspec(dllexport)} you get almost identical semantics with
14413 identical syntax.  This is a great boon to those working with
14414 cross-platform projects.
14415
14416 For those adding visibility support to existing code, you may find
14417 @samp{#pragma GCC visibility} of use.  This works by you enclosing
14418 the declarations you wish to set visibility for with (for example)
14419 @samp{#pragma GCC visibility push(hidden)} and
14420 @samp{#pragma GCC visibility pop}.
14421 Bear in mind that symbol visibility should be viewed @strong{as
14422 part of the API interface contract} and thus all new code should
14423 always specify visibility when it is not the default ie; declarations
14424 only for use within the local DSO should @strong{always} be marked explicitly
14425 as hidden as so to avoid PLT indirection overheads---making this
14426 abundantly clear also aids readability and self-documentation of the code.
14427 Note that due to ISO C++ specification requirements, operator new and
14428 operator delete must always be of default visibility.
14429
14430 Be aware that headers from outside your project, in particular system
14431 headers and headers from any other library you use, may not be
14432 expecting to be compiled with visibility other than the default.  You
14433 may need to explicitly say @samp{#pragma GCC visibility push(default)}
14434 before including any such headers.
14435
14436 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
14437 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
14438 no modifications.  However, this means that calls to @samp{extern}
14439 functions with no explicit visibility will use the PLT, so it is more
14440 effective to use @samp{__attribute ((visibility))} and/or
14441 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
14442 declarations should be treated as hidden.
14443
14444 Note that @samp{-fvisibility} does affect C++ vague linkage
14445 entities. This means that, for instance, an exception class that will
14446 be thrown between DSOs must be explicitly marked with default
14447 visibility so that the @samp{type_info} nodes will be unified between
14448 the DSOs.
14449
14450 An overview of these techniques, their benefits and how to use them
14451 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
14452
14453 @end table
14454
14455 @c man end
14456
14457 @node Environment Variables
14458 @section Environment Variables Affecting GCC
14459 @cindex environment variables
14460
14461 @c man begin ENVIRONMENT
14462 This section describes several environment variables that affect how GCC
14463 operates.  Some of them work by specifying directories or prefixes to use
14464 when searching for various kinds of files.  Some are used to specify other
14465 aspects of the compilation environment.
14466
14467 Note that you can also specify places to search using options such as
14468 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
14469 take precedence over places specified using environment variables, which
14470 in turn take precedence over those specified by the configuration of GCC@.
14471 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
14472 GNU Compiler Collection (GCC) Internals}.
14473
14474 @table @env
14475 @item LANG
14476 @itemx LC_CTYPE
14477 @c @itemx LC_COLLATE
14478 @itemx LC_MESSAGES
14479 @c @itemx LC_MONETARY
14480 @c @itemx LC_NUMERIC
14481 @c @itemx LC_TIME
14482 @itemx LC_ALL
14483 @findex LANG
14484 @findex LC_CTYPE
14485 @c @findex LC_COLLATE
14486 @findex LC_MESSAGES
14487 @c @findex LC_MONETARY
14488 @c @findex LC_NUMERIC
14489 @c @findex LC_TIME
14490 @findex LC_ALL
14491 @cindex locale
14492 These environment variables control the way that GCC uses
14493 localization information that allow GCC to work with different
14494 national conventions.  GCC inspects the locale categories
14495 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
14496 so.  These locale categories can be set to any value supported by your
14497 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
14498 Kingdom encoded in UTF-8.
14499
14500 The @env{LC_CTYPE} environment variable specifies character
14501 classification.  GCC uses it to determine the character boundaries in
14502 a string; this is needed for some multibyte encodings that contain quote
14503 and escape characters that would otherwise be interpreted as a string
14504 end or escape.
14505
14506 The @env{LC_MESSAGES} environment variable specifies the language to
14507 use in diagnostic messages.
14508
14509 If the @env{LC_ALL} environment variable is set, it overrides the value
14510 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
14511 and @env{LC_MESSAGES} default to the value of the @env{LANG}
14512 environment variable.  If none of these variables are set, GCC
14513 defaults to traditional C English behavior.
14514
14515 @item TMPDIR
14516 @findex TMPDIR
14517 If @env{TMPDIR} is set, it specifies the directory to use for temporary
14518 files.  GCC uses temporary files to hold the output of one stage of
14519 compilation which is to be used as input to the next stage: for example,
14520 the output of the preprocessor, which is the input to the compiler
14521 proper.
14522
14523 @item GCC_EXEC_PREFIX
14524 @findex GCC_EXEC_PREFIX
14525 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
14526 names of the subprograms executed by the compiler.  No slash is added
14527 when this prefix is combined with the name of a subprogram, but you can
14528 specify a prefix that ends with a slash if you wish.
14529
14530 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
14531 an appropriate prefix to use based on the pathname it was invoked with.
14532
14533 If GCC cannot find the subprogram using the specified prefix, it
14534 tries looking in the usual places for the subprogram.
14535
14536 The default value of @env{GCC_EXEC_PREFIX} is
14537 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
14538 the installed compiler. In many cases @var{prefix} is the value
14539 of @code{prefix} when you ran the @file{configure} script.
14540
14541 Other prefixes specified with @option{-B} take precedence over this prefix.
14542
14543 This prefix is also used for finding files such as @file{crt0.o} that are
14544 used for linking.
14545
14546 In addition, the prefix is used in an unusual way in finding the
14547 directories to search for header files.  For each of the standard
14548 directories whose name normally begins with @samp{/usr/local/lib/gcc}
14549 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
14550 replacing that beginning with the specified prefix to produce an
14551 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
14552 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
14553 These alternate directories are searched first; the standard directories
14554 come next. If a standard directory begins with the configured 
14555 @var{prefix} then the value of @var{prefix} is replaced by 
14556 @env{GCC_EXEC_PREFIX} when looking for header files.
14557
14558 @item COMPILER_PATH
14559 @findex COMPILER_PATH
14560 The value of @env{COMPILER_PATH} is a colon-separated list of
14561 directories, much like @env{PATH}.  GCC tries the directories thus
14562 specified when searching for subprograms, if it can't find the
14563 subprograms using @env{GCC_EXEC_PREFIX}.
14564
14565 @item LIBRARY_PATH
14566 @findex LIBRARY_PATH
14567 The value of @env{LIBRARY_PATH} is a colon-separated list of
14568 directories, much like @env{PATH}.  When configured as a native compiler,
14569 GCC tries the directories thus specified when searching for special
14570 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
14571 using GCC also uses these directories when searching for ordinary
14572 libraries for the @option{-l} option (but directories specified with
14573 @option{-L} come first).
14574
14575 @item LANG
14576 @findex LANG
14577 @cindex locale definition
14578 This variable is used to pass locale information to the compiler.  One way in
14579 which this information is used is to determine the character set to be used
14580 when character literals, string literals and comments are parsed in C and C++.
14581 When the compiler is configured to allow multibyte characters,
14582 the following values for @env{LANG} are recognized:
14583
14584 @table @samp
14585 @item C-JIS
14586 Recognize JIS characters.
14587 @item C-SJIS
14588 Recognize SJIS characters.
14589 @item C-EUCJP
14590 Recognize EUCJP characters.
14591 @end table
14592
14593 If @env{LANG} is not defined, or if it has some other value, then the
14594 compiler will use mblen and mbtowc as defined by the default locale to
14595 recognize and translate multibyte characters.
14596 @end table
14597
14598 @noindent
14599 Some additional environments variables affect the behavior of the
14600 preprocessor.
14601
14602 @include cppenv.texi
14603
14604 @c man end
14605
14606 @node Precompiled Headers
14607 @section Using Precompiled Headers
14608 @cindex precompiled headers
14609 @cindex speed of compilation
14610
14611 Often large projects have many header files that are included in every
14612 source file.  The time the compiler takes to process these header files
14613 over and over again can account for nearly all of the time required to
14614 build the project.  To make builds faster, GCC allows users to
14615 `precompile' a header file; then, if builds can use the precompiled
14616 header file they will be much faster.
14617
14618 To create a precompiled header file, simply compile it as you would any
14619 other file, if necessary using the @option{-x} option to make the driver
14620 treat it as a C or C++ header file.  You will probably want to use a
14621 tool like @command{make} to keep the precompiled header up-to-date when
14622 the headers it contains change.
14623
14624 A precompiled header file will be searched for when @code{#include} is
14625 seen in the compilation.  As it searches for the included file
14626 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
14627 compiler looks for a precompiled header in each directory just before it
14628 looks for the include file in that directory.  The name searched for is
14629 the name specified in the @code{#include} with @samp{.gch} appended.  If
14630 the precompiled header file can't be used, it is ignored.
14631
14632 For instance, if you have @code{#include "all.h"}, and you have
14633 @file{all.h.gch} in the same directory as @file{all.h}, then the
14634 precompiled header file will be used if possible, and the original
14635 header will be used otherwise.
14636
14637 Alternatively, you might decide to put the precompiled header file in a
14638 directory and use @option{-I} to ensure that directory is searched
14639 before (or instead of) the directory containing the original header.
14640 Then, if you want to check that the precompiled header file is always
14641 used, you can put a file of the same name as the original header in this
14642 directory containing an @code{#error} command.
14643
14644 This also works with @option{-include}.  So yet another way to use
14645 precompiled headers, good for projects not designed with precompiled
14646 header files in mind, is to simply take most of the header files used by
14647 a project, include them from another header file, precompile that header
14648 file, and @option{-include} the precompiled header.  If the header files
14649 have guards against multiple inclusion, they will be skipped because
14650 they've already been included (in the precompiled header).
14651
14652 If you need to precompile the same header file for different
14653 languages, targets, or compiler options, you can instead make a
14654 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14655 header in the directory, perhaps using @option{-o}.  It doesn't matter
14656 what you call the files in the directory, every precompiled header in
14657 the directory will be considered.  The first precompiled header
14658 encountered in the directory that is valid for this compilation will
14659 be used; they're searched in no particular order.
14660
14661 There are many other possibilities, limited only by your imagination,
14662 good sense, and the constraints of your build system.
14663
14664 A precompiled header file can be used only when these conditions apply:
14665
14666 @itemize
14667 @item
14668 Only one precompiled header can be used in a particular compilation.
14669
14670 @item
14671 A precompiled header can't be used once the first C token is seen.  You
14672 can have preprocessor directives before a precompiled header; you can
14673 even include a precompiled header from inside another header, so long as
14674 there are no C tokens before the @code{#include}.
14675
14676 @item
14677 The precompiled header file must be produced for the same language as
14678 the current compilation.  You can't use a C precompiled header for a C++
14679 compilation.
14680
14681 @item
14682 The precompiled header file must have been produced by the same compiler
14683 binary as the current compilation is using.
14684
14685 @item
14686 Any macros defined before the precompiled header is included must
14687 either be defined in the same way as when the precompiled header was
14688 generated, or must not affect the precompiled header, which usually
14689 means that they don't appear in the precompiled header at all.
14690
14691 The @option{-D} option is one way to define a macro before a
14692 precompiled header is included; using a @code{#define} can also do it.
14693 There are also some options that define macros implicitly, like
14694 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14695 defined this way.
14696
14697 @item If debugging information is output when using the precompiled
14698 header, using @option{-g} or similar, the same kind of debugging information
14699 must have been output when building the precompiled header.  However,
14700 a precompiled header built using @option{-g} can be used in a compilation
14701 when no debugging information is being output.
14702
14703 @item The same @option{-m} options must generally be used when building
14704 and using the precompiled header.  @xref{Submodel Options},
14705 for any cases where this rule is relaxed.
14706
14707 @item Each of the following options must be the same when building and using
14708 the precompiled header:
14709
14710 @gccoptlist{-fexceptions -funit-at-a-time}
14711
14712 @item
14713 Some other command-line options starting with @option{-f},
14714 @option{-p}, or @option{-O} must be defined in the same way as when
14715 the precompiled header was generated.  At present, it's not clear
14716 which options are safe to change and which are not; the safest choice
14717 is to use exactly the same options when generating and using the
14718 precompiled header.  The following are known to be safe:
14719
14720 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
14721 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
14722 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
14723 -pedantic-errors}
14724
14725 @end itemize
14726
14727 For all of these except the last, the compiler will automatically
14728 ignore the precompiled header if the conditions aren't met.  If you
14729 find an option combination that doesn't work and doesn't cause the
14730 precompiled header to be ignored, please consider filing a bug report,
14731 see @ref{Bugs}.
14732
14733 If you do use differing options when generating and using the
14734 precompiled header, the actual behavior will be a mixture of the
14735 behavior for the options.  For instance, if you use @option{-g} to
14736 generate the precompiled header but not when using it, you may or may
14737 not get debugging information for routines in the precompiled header.
14738
14739 @node Running Protoize
14740 @section Running Protoize
14741
14742 The program @code{protoize} is an optional part of GCC@.  You can use
14743 it to add prototypes to a program, thus converting the program to ISO
14744 C in one respect.  The companion program @code{unprotoize} does the
14745 reverse: it removes argument types from any prototypes that are found.
14746
14747 When you run these programs, you must specify a set of source files as
14748 command line arguments.  The conversion programs start out by compiling
14749 these files to see what functions they define.  The information gathered
14750 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
14751
14752 After scanning comes actual conversion.  The specified files are all
14753 eligible to be converted; any files they include (whether sources or
14754 just headers) are eligible as well.
14755
14756 But not all the eligible files are converted.  By default,
14757 @code{protoize} and @code{unprotoize} convert only source and header
14758 files in the current directory.  You can specify additional directories
14759 whose files should be converted with the @option{-d @var{directory}}
14760 option.  You can also specify particular files to exclude with the
14761 @option{-x @var{file}} option.  A file is converted if it is eligible, its
14762 directory name matches one of the specified directory names, and its
14763 name within the directory has not been excluded.
14764
14765 Basic conversion with @code{protoize} consists of rewriting most
14766 function definitions and function declarations to specify the types of
14767 the arguments.  The only ones not rewritten are those for varargs
14768 functions.
14769
14770 @code{protoize} optionally inserts prototype declarations at the
14771 beginning of the source file, to make them available for any calls that
14772 precede the function's definition.  Or it can insert prototype
14773 declarations with block scope in the blocks where undeclared functions
14774 are called.
14775
14776 Basic conversion with @code{unprotoize} consists of rewriting most
14777 function declarations to remove any argument types, and rewriting
14778 function definitions to the old-style pre-ISO form.
14779
14780 Both conversion programs print a warning for any function declaration or
14781 definition that they can't convert.  You can suppress these warnings
14782 with @option{-q}.
14783
14784 The output from @code{protoize} or @code{unprotoize} replaces the
14785 original source file.  The original file is renamed to a name ending
14786 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
14787 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
14788 for DOS) file already exists, then the source file is simply discarded.
14789
14790 @code{protoize} and @code{unprotoize} both depend on GCC itself to
14791 scan the program and collect information about the functions it uses.
14792 So neither of these programs will work until GCC is installed.
14793
14794 Here is a table of the options you can use with @code{protoize} and
14795 @code{unprotoize}.  Each option works with both programs unless
14796 otherwise stated.
14797
14798 @table @code
14799 @item -B @var{directory}
14800 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
14801 usual directory (normally @file{/usr/local/lib}).  This file contains
14802 prototype information about standard system functions.  This option
14803 applies only to @code{protoize}.
14804
14805 @item -c @var{compilation-options}
14806 Use @var{compilation-options} as the options when running @command{gcc} to
14807 produce the @samp{.X} files.  The special option @option{-aux-info} is
14808 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
14809
14810 Note that the compilation options must be given as a single argument to
14811 @code{protoize} or @code{unprotoize}.  If you want to specify several
14812 @command{gcc} options, you must quote the entire set of compilation options
14813 to make them a single word in the shell.
14814
14815 There are certain @command{gcc} arguments that you cannot use, because they
14816 would produce the wrong kind of output.  These include @option{-g},
14817 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
14818 the @var{compilation-options}, they are ignored.
14819
14820 @item -C
14821 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
14822 systems) instead of @samp{.c}.  This is convenient if you are converting
14823 a C program to C++.  This option applies only to @code{protoize}.
14824
14825 @item -g
14826 Add explicit global declarations.  This means inserting explicit
14827 declarations at the beginning of each source file for each function
14828 that is called in the file and was not declared.  These declarations
14829 precede the first function definition that contains a call to an
14830 undeclared function.  This option applies only to @code{protoize}.
14831
14832 @item -i @var{string}
14833 Indent old-style parameter declarations with the string @var{string}.
14834 This option applies only to @code{protoize}.
14835
14836 @code{unprotoize} converts prototyped function definitions to old-style
14837 function definitions, where the arguments are declared between the
14838 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
14839 uses five spaces as the indentation.  If you want to indent with just
14840 one space instead, use @option{-i " "}.
14841
14842 @item -k
14843 Keep the @samp{.X} files.  Normally, they are deleted after conversion
14844 is finished.
14845
14846 @item -l
14847 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
14848 a prototype declaration for each function in each block which calls the
14849 function without any declaration.  This option applies only to
14850 @code{protoize}.
14851
14852 @item -n
14853 Make no real changes.  This mode just prints information about the conversions
14854 that would have been done without @option{-n}.
14855
14856 @item -N
14857 Make no @samp{.save} files.  The original files are simply deleted.
14858 Use this option with caution.
14859
14860 @item -p @var{program}
14861 Use the program @var{program} as the compiler.  Normally, the name
14862 @file{gcc} is used.
14863
14864 @item -q
14865 Work quietly.  Most warnings are suppressed.
14866
14867 @item -v
14868 Print the version number, just like @option{-v} for @command{gcc}.
14869 @end table
14870
14871 If you need special compiler options to compile one of your program's
14872 source files, then you should generate that file's @samp{.X} file
14873 specially, by running @command{gcc} on that source file with the
14874 appropriate options and the option @option{-aux-info}.  Then run
14875 @code{protoize} on the entire set of files.  @code{protoize} will use
14876 the existing @samp{.X} file because it is newer than the source file.
14877 For example:
14878
14879 @smallexample
14880 gcc -Dfoo=bar file1.c -aux-info file1.X
14881 protoize *.c
14882 @end smallexample
14883
14884 @noindent
14885 You need to include the special files along with the rest in the
14886 @code{protoize} command, even though their @samp{.X} files already
14887 exist, because otherwise they won't get converted.
14888
14889 @xref{Protoize Caveats}, for more information on how to use
14890 @code{protoize} successfully.