OSDN Git Service

* doc/invoke.texi: Fix cpp.info cross-reference.
[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} @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{x86-64 Options}
775 See i386 and x86-64 Options.
776
777 @emph{Xstormy16 Options}
778 @gccoptlist{-msim}
779
780 @emph{Xtensa Options}
781 @gccoptlist{-mconst16 -mno-const16 @gol
782 -mfused-madd  -mno-fused-madd @gol
783 -mtext-section-literals  -mno-text-section-literals @gol
784 -mtarget-align  -mno-target-align @gol
785 -mlongcalls  -mno-longcalls}
786
787 @emph{zSeries Options}
788 See S/390 and zSeries Options.
789
790 @item Code Generation Options
791 @xref{Code Gen Options,,Options for Code Generation Conventions}.
792 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
793 -ffixed-@var{reg}  -fexceptions @gol
794 -fnon-call-exceptions  -funwind-tables @gol
795 -fasynchronous-unwind-tables @gol
796 -finhibit-size-directive  -finstrument-functions @gol
797 -fno-common  -fno-ident @gol
798 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
799 -fno-jump-tables @gol
800 -frecord-gcc-switches @gol
801 -freg-struct-return  -fshort-enums @gol
802 -fshort-double  -fshort-wchar @gol
803 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
804 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
805 -fargument-alias  -fargument-noalias @gol
806 -fargument-noalias-global  -fargument-noalias-anything
807 -fleading-underscore  -ftls-model=@var{model} @gol
808 -ftrapv  -fwrapv  -fbounds-check @gol
809 -fvisibility}
810 @end table
811
812 @menu
813 * Overall Options::     Controlling the kind of output:
814                         an executable, object files, assembler files,
815                         or preprocessed source.
816 * C Dialect Options::   Controlling the variant of C language compiled.
817 * C++ Dialect Options:: Variations on C++.
818 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
819                         and Objective-C++.
820 * Language Independent Options:: Controlling how diagnostics should be
821                         formatted.
822 * Warning Options::     How picky should the compiler be?
823 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
824 * Optimize Options::    How much optimization?
825 * Preprocessor Options:: Controlling header files and macro definitions.
826                          Also, getting dependency information for Make.
827 * Assembler Options::   Passing options to the assembler.
828 * Link Options::        Specifying libraries and so on.
829 * Directory Options::   Where to find header files and libraries.
830                         Where to find the compiler executable files.
831 * Spec Files::          How to pass switches to sub-processes.
832 * Target Options::      Running a cross-compiler, or an old version of GCC.
833 @end menu
834
835 @node Overall Options
836 @section Options Controlling the Kind of Output
837
838 Compilation can involve up to four stages: preprocessing, compilation
839 proper, assembly and linking, always in that order.  GCC is capable of
840 preprocessing and compiling several files either into several
841 assembler input files, or into one assembler input file; then each
842 assembler input file produces an object file, and linking combines all
843 the object files (those newly compiled, and those specified as input)
844 into an executable file.
845
846 @cindex file name suffix
847 For any given input file, the file name suffix determines what kind of
848 compilation is done:
849
850 @table @gcctabopt
851 @item @var{file}.c
852 C source code which must be preprocessed.
853
854 @item @var{file}.i
855 C source code which should not be preprocessed.
856
857 @item @var{file}.ii
858 C++ source code which should not be preprocessed.
859
860 @item @var{file}.m
861 Objective-C source code.  Note that you must link with the @file{libobjc}
862 library to make an Objective-C program work.
863
864 @item @var{file}.mi
865 Objective-C source code which should not be preprocessed.
866
867 @item @var{file}.mm
868 @itemx @var{file}.M
869 Objective-C++ source code.  Note that you must link with the @file{libobjc}
870 library to make an Objective-C++ program work.  Note that @samp{.M} refers
871 to a literal capital M@.
872
873 @item @var{file}.mii
874 Objective-C++ source code which should not be preprocessed.
875
876 @item @var{file}.h
877 C, C++, Objective-C or Objective-C++ header file to be turned into a
878 precompiled header.
879
880 @item @var{file}.cc
881 @itemx @var{file}.cp
882 @itemx @var{file}.cxx
883 @itemx @var{file}.cpp
884 @itemx @var{file}.CPP
885 @itemx @var{file}.c++
886 @itemx @var{file}.C
887 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
888 the last two letters must both be literally @samp{x}.  Likewise,
889 @samp{.C} refers to a literal capital C@.
890
891 @item @var{file}.mm
892 @itemx @var{file}.M
893 Objective-C++ source code which must be preprocessed.
894
895 @item @var{file}.mii
896 Objective-C++ source code which should not be preprocessed.
897
898 @item @var{file}.hh
899 @itemx @var{file}.H
900 C++ header file to be turned into a precompiled header.
901
902 @item @var{file}.f
903 @itemx @var{file}.for
904 @itemx @var{file}.FOR
905 Fixed form Fortran source code which should not be preprocessed.
906
907 @item @var{file}.F
908 @itemx @var{file}.fpp
909 @itemx @var{file}.FPP
910 Fixed form Fortran source code which must be preprocessed (with the traditional
911 preprocessor).
912
913 @item @var{file}.f90
914 @itemx @var{file}.f95
915 Free form Fortran source code which should not be preprocessed.
916
917 @item @var{file}.F90
918 @itemx @var{file}.F95
919 Free form Fortran source code which must be preprocessed (with the
920 traditional preprocessor).
921
922 @c FIXME: Descriptions of Java file types.
923 @c @var{file}.java
924 @c @var{file}.class
925 @c @var{file}.zip
926 @c @var{file}.jar
927
928 @item @var{file}.ads
929 Ada source code file which contains a library unit declaration (a
930 declaration of a package, subprogram, or generic, or a generic
931 instantiation), or a library unit renaming declaration (a package,
932 generic, or subprogram renaming declaration).  Such files are also
933 called @dfn{specs}.
934
935 @itemx @var{file}.adb
936 Ada source code file containing a library unit body (a subprogram or
937 package body).  Such files are also called @dfn{bodies}.
938
939 @c GCC also knows about some suffixes for languages not yet included:
940 @c Pascal:
941 @c @var{file}.p
942 @c @var{file}.pas
943 @c Ratfor:
944 @c @var{file}.r
945
946 @item @var{file}.s
947 Assembler code.
948
949 @item @var{file}.S
950 Assembler code which must be preprocessed.
951
952 @item @var{other}
953 An object file to be fed straight into linking.
954 Any file name with no recognized suffix is treated this way.
955 @end table
956
957 @opindex x
958 You can specify the input language explicitly with the @option{-x} option:
959
960 @table @gcctabopt
961 @item -x @var{language}
962 Specify explicitly the @var{language} for the following input files
963 (rather than letting the compiler choose a default based on the file
964 name suffix).  This option applies to all following input files until
965 the next @option{-x} option.  Possible values for @var{language} are:
966 @smallexample
967 c  c-header  c-cpp-output
968 c++  c++-header  c++-cpp-output
969 objective-c  objective-c-header  objective-c-cpp-output
970 objective-c++ objective-c++-header objective-c++-cpp-output
971 assembler  assembler-with-cpp
972 ada
973 f95  f95-cpp-input
974 java
975 treelang
976 @end smallexample
977
978 @item -x none
979 Turn off any specification of a language, so that subsequent files are
980 handled according to their file name suffixes (as they are if @option{-x}
981 has not been used at all).
982
983 @item -pass-exit-codes
984 @opindex pass-exit-codes
985 Normally the @command{gcc} program will exit with the code of 1 if any
986 phase of the compiler returns a non-success return code.  If you specify
987 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
988 numerically highest error produced by any phase that returned an error
989 indication.  The C, C++, and Fortran frontends return 4, if an internal
990 compiler error is encountered.
991 @end table
992
993 If you only want some of the stages of compilation, you can use
994 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
995 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
996 @command{gcc} is to stop.  Note that some combinations (for example,
997 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
998
999 @table @gcctabopt
1000 @item -c
1001 @opindex c
1002 Compile or assemble the source files, but do not link.  The linking
1003 stage simply is not done.  The ultimate output is in the form of an
1004 object file for each source file.
1005
1006 By default, the object file name for a source file is made by replacing
1007 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1008
1009 Unrecognized input files, not requiring compilation or assembly, are
1010 ignored.
1011
1012 @item -S
1013 @opindex S
1014 Stop after the stage of compilation proper; do not assemble.  The output
1015 is in the form of an assembler code file for each non-assembler input
1016 file specified.
1017
1018 By default, the assembler file name for a source file is made by
1019 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1020
1021 Input files that don't require compilation are ignored.
1022
1023 @item -E
1024 @opindex E
1025 Stop after the preprocessing stage; do not run the compiler proper.  The
1026 output is in the form of preprocessed source code, which is sent to the
1027 standard output.
1028
1029 Input files which don't require preprocessing are ignored.
1030
1031 @cindex output file option
1032 @item -o @var{file}
1033 @opindex o
1034 Place output in file @var{file}.  This applies regardless to whatever
1035 sort of output is being produced, whether it be an executable file,
1036 an object file, an assembler file or preprocessed C code.
1037
1038 If @option{-o} is not specified, the default is to put an executable
1039 file in @file{a.out}, the object file for
1040 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1041 assembler file in @file{@var{source}.s}, a precompiled header file in
1042 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1043 standard output.
1044
1045 @item -v
1046 @opindex v
1047 Print (on standard error output) the commands executed to run the stages
1048 of compilation.  Also print the version number of the compiler driver
1049 program and of the preprocessor and the compiler proper.
1050
1051 @item -###
1052 @opindex ###
1053 Like @option{-v} except the commands are not executed and all command
1054 arguments are quoted.  This is useful for shell scripts to capture the
1055 driver-generated command lines.
1056
1057 @item -pipe
1058 @opindex pipe
1059 Use pipes rather than temporary files for communication between the
1060 various stages of compilation.  This fails to work on some systems where
1061 the assembler is unable to read from a pipe; but the GNU assembler has
1062 no trouble.
1063
1064 @item -combine
1065 @opindex combine
1066 If you are compiling multiple source files, this option tells the driver
1067 to pass all the source files to the compiler at once (for those
1068 languages for which the compiler can handle this).  This will allow
1069 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1070 language for which this is supported is C@.  If you pass source files for
1071 multiple languages to the driver, using this option, the driver will invoke
1072 the compiler(s) that support IMA once each, passing each compiler all the
1073 source files appropriate for it.  For those languages that do not support
1074 IMA this option will be ignored, and the compiler will be invoked once for
1075 each source file in that language.  If you use this option in conjunction
1076 with @option{-save-temps}, the compiler will generate multiple
1077 pre-processed files
1078 (one for each source file), but only one (combined) @file{.o} or
1079 @file{.s} file.
1080
1081 @item --help
1082 @opindex help
1083 Print (on the standard output) a description of the command line options
1084 understood by @command{gcc}.  If the @option{-v} option is also specified
1085 then @option{--help} will also be passed on to the various processes
1086 invoked by @command{gcc}, so that they can display the command line options
1087 they accept.  If the @option{-Wextra} option has also been specified
1088 (prior to the @option{--help} option), then command line options which
1089 have no documentation associated with them will also be displayed.
1090
1091 @item --target-help
1092 @opindex target-help
1093 Print (on the standard output) a description of target-specific command
1094 line options for each tool.
1095
1096 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1097 Print (on the standard output) a description of the command line
1098 options understood by the compiler that fit into a specific class.
1099 The class can be one of @var{optimizers}, @var{warnings}, @var{target}
1100 or @var{params}:
1101
1102 @table @gcctabopt
1103 @item @var{optimizers}
1104 This will display all of the optimization options supported by the
1105 compiler.
1106
1107 @item @var{warnings}
1108 This will display all of the options controlling warning messages
1109 produced by the compiler.
1110
1111 @item @var{target}
1112 This will display target-specific options.  Unlike the
1113 @option{--target-help} option however, target-specific options of the
1114 linker and assembler will not be displayed.  This is because those
1115 tools do not currently support the extended @option{--help=} syntax.
1116
1117 @item @var{params}
1118 This will display the values recognized by the @option{--param}
1119 option.
1120 @end table
1121
1122 It is possible to further refine the output of the @option{--help=}
1123 option by adding a comma separated list of qualifiers after the
1124 class.  These can be any from the following list:
1125
1126 @table @gcctabopt
1127 @item undocumented
1128 Display only those options which are undocumented.
1129
1130 @item joined
1131 Display options which take an argument that appears after an equal
1132 sign in the same continuous piece of text, such as:
1133 @samp{--help=target}.
1134
1135 @item separate
1136 Display options which take an argument that appears as a separate word
1137 following the original option, such as: @samp{-o output-file}.
1138 @end table
1139
1140 Thus for example to display all the undocumented target-specific
1141 switches supported by the compiler the following can be used:
1142
1143 @smallexample
1144 --help=target,undocumented
1145 @end smallexample
1146
1147 The sense of a qualifier can be inverted by prefixing it with the
1148 @var{^} character, so for example to display all binary warning
1149 options (i.e. ones that are either on or off and that do not take an
1150 argument), which have a description the following can be used:
1151
1152 @smallexample
1153 --help=warnings,^joined,^undocumented
1154 @end smallexample
1155
1156 A class can also be used as a qualifier, although this usually
1157 restricts the output by so much that there is nothing to display.  One
1158 case where it does work however is when one of the classes is
1159 @var{target}.  So for example to display all the target-specific
1160 optimization options the following can be used:
1161
1162 @smallexample
1163 --help=target,optimizers
1164 @end smallexample
1165
1166 The @option{--help=} option can be repeated on the command line.  Each
1167 successive use will display its requested class of options, skipping
1168 those that have already been displayed.
1169
1170 If the @option{-Q} option appears on the command line before the
1171 @option{--help=} option, then the descriptive text displayed by
1172 @option{--help=} is changed.  Instead of describing the displayed
1173 options, an indication is given as to whether the option is enabled,
1174 disabled or set to a specific value (assuming that the compiler
1175 knows this at the point where the @option{--help=} option is used).
1176
1177 Here is a truncated example from the ARM port of @command{gcc}:
1178
1179 @smallexample
1180   % gcc -Q -mabi=2 --help=target -c
1181   The following options are target specific:
1182   -mabi=                                2
1183   -mabort-on-noreturn                   [disabled]
1184   -mapcs                                [disabled]
1185 @end smallexample
1186
1187 The output is sensitive to the effects of previous command line
1188 options, so for example it is possible to find out which optimizations
1189 are enabled at @option{-O2} by using:
1190
1191 @smallexample
1192 -O2 --help=optimizers
1193 @end smallexample
1194
1195 Alternatively you can discover which binary optimizations are enabled
1196 by @option{-O3} by using:
1197
1198 @smallexample
1199 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1200 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1201 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1202 @end smallexample
1203
1204 @item --version
1205 @opindex version
1206 Display the version number and copyrights of the invoked GCC@.
1207
1208 @include @value{srcdir}/../libiberty/at-file.texi
1209 @end table
1210
1211 @node Invoking G++
1212 @section Compiling C++ Programs
1213
1214 @cindex suffixes for C++ source
1215 @cindex C++ source file suffixes
1216 C++ source files conventionally use one of the suffixes @samp{.C},
1217 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1218 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1219 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1220 files with these names and compiles them as C++ programs even if you
1221 call the compiler the same way as for compiling C programs (usually
1222 with the name @command{gcc}).
1223
1224 @findex g++
1225 @findex c++
1226 However, the use of @command{gcc} does not add the C++ library.
1227 @command{g++} is a program that calls GCC and treats @samp{.c},
1228 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1229 files unless @option{-x} is used, and automatically specifies linking
1230 against the C++ library.  This program is also useful when
1231 precompiling a C header file with a @samp{.h} extension for use in C++
1232 compilations.  On many systems, @command{g++} is also installed with
1233 the name @command{c++}.
1234
1235 @cindex invoking @command{g++}
1236 When you compile C++ programs, you may specify many of the same
1237 command-line options that you use for compiling programs in any
1238 language; or command-line options meaningful for C and related
1239 languages; or options that are meaningful only for C++ programs.
1240 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1241 explanations of options for languages related to C@.
1242 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1243 explanations of options that are meaningful only for C++ programs.
1244
1245 @node C Dialect Options
1246 @section Options Controlling C Dialect
1247 @cindex dialect options
1248 @cindex language dialect options
1249 @cindex options, dialect
1250
1251 The following options control the dialect of C (or languages derived
1252 from C, such as C++, Objective-C and Objective-C++) that the compiler
1253 accepts:
1254
1255 @table @gcctabopt
1256 @cindex ANSI support
1257 @cindex ISO support
1258 @item -ansi
1259 @opindex ansi
1260 In C mode, support all ISO C90 programs.  In C++ mode,
1261 remove GNU extensions that conflict with ISO C++.
1262
1263 This turns off certain features of GCC that are incompatible with ISO
1264 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1265 such as the @code{asm} and @code{typeof} keywords, and
1266 predefined macros such as @code{unix} and @code{vax} that identify the
1267 type of system you are using.  It also enables the undesirable and
1268 rarely used ISO trigraph feature.  For the C compiler,
1269 it disables recognition of C++ style @samp{//} comments as well as
1270 the @code{inline} keyword.
1271
1272 The alternate keywords @code{__asm__}, @code{__extension__},
1273 @code{__inline__} and @code{__typeof__} continue to work despite
1274 @option{-ansi}.  You would not want to use them in an ISO C program, of
1275 course, but it is useful to put them in header files that might be included
1276 in compilations done with @option{-ansi}.  Alternate predefined macros
1277 such as @code{__unix__} and @code{__vax__} are also available, with or
1278 without @option{-ansi}.
1279
1280 The @option{-ansi} option does not cause non-ISO programs to be
1281 rejected gratuitously.  For that, @option{-pedantic} is required in
1282 addition to @option{-ansi}.  @xref{Warning Options}.
1283
1284 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1285 option is used.  Some header files may notice this macro and refrain
1286 from declaring certain functions or defining certain macros that the
1287 ISO standard doesn't call for; this is to avoid interfering with any
1288 programs that might use these names for other things.
1289
1290 Functions which would normally be built in but do not have semantics
1291 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1292 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1293 built-in functions provided by GCC}, for details of the functions
1294 affected.
1295
1296 @item -std=
1297 @opindex std
1298 Determine the language standard.  This option is currently only
1299 supported when compiling C or C++.  A value for this option must be
1300 provided; possible values are
1301
1302 @table @samp
1303 @item c89
1304 @itemx iso9899:1990
1305 ISO C90 (same as @option{-ansi}).
1306
1307 @item iso9899:199409
1308 ISO C90 as modified in amendment 1.
1309
1310 @item c99
1311 @itemx c9x
1312 @itemx iso9899:1999
1313 @itemx iso9899:199x
1314 ISO C99.  Note that this standard is not yet fully supported; see
1315 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1316 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1317
1318 @item gnu89
1319 Default, ISO C90 plus GNU extensions (including some C99 features).
1320
1321 @item gnu99
1322 @itemx gnu9x
1323 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1324 this will become the default.  The name @samp{gnu9x} is deprecated.
1325
1326 @item c++98
1327 The 1998 ISO C++ standard plus amendments.
1328
1329 @item gnu++98
1330 The same as @option{-std=c++98} plus GNU extensions.  This is the
1331 default for C++ code.
1332
1333 @item c++0x
1334 The working draft of the upcoming ISO C++0x standard. This option
1335 enables experimental features that are likely to be included in
1336 C++0x. The working draft is constantly changing, and any feature that is
1337 enabled by this flag may be removed from future versions of GCC if it is
1338 not part of the C++0x standard.
1339
1340 @item gnu++0x
1341 The same as @option{-std=c++0x} plus GNU extensions. As with
1342 @option{-std=c++0x}, this option enables experimental features that may
1343 be removed in future versions of GCC.
1344 @end table
1345
1346 Even when this option is not specified, you can still use some of the
1347 features of newer standards in so far as they do not conflict with
1348 previous C standards.  For example, you may use @code{__restrict__} even
1349 when @option{-std=c99} is not specified.
1350
1351 The @option{-std} options specifying some version of ISO C have the same
1352 effects as @option{-ansi}, except that features that were not in ISO C90
1353 but are in the specified version (for example, @samp{//} comments and
1354 the @code{inline} keyword in ISO C99) are not disabled.
1355
1356 @xref{Standards,,Language Standards Supported by GCC}, for details of
1357 these standard versions.
1358
1359 @item -fgnu89-inline
1360 @opindex fgnu89-inline
1361 The option @option{-fgnu89-inline} tells GCC to use the traditional
1362 GNU semantics for @code{inline} functions when in C99 mode.
1363 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1364 is accepted and ignored by GCC versions 4.1.3 up to but not including
1365 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1366 C99 mode.  Using this option is roughly equivalent to adding the
1367 @code{gnu_inline} function attribute to all inline functions
1368 (@pxref{Function Attributes}).
1369
1370 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1371 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1372 specifies the default behavior).  This option was first supported in
1373 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1374
1375 The preprocesor macros @code{__GNUC_GNU_INLINE__} and
1376 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1377 in effect for @code{inline} functions.  @xref{Common Predefined
1378 Macros,,,cpp,The C Preprocessor}.
1379
1380 @item -aux-info @var{filename}
1381 @opindex aux-info
1382 Output to the given filename prototyped declarations for all functions
1383 declared and/or defined in a translation unit, including those in header
1384 files.  This option is silently ignored in any language other than C@.
1385
1386 Besides declarations, the file indicates, in comments, the origin of
1387 each declaration (source file and line), whether the declaration was
1388 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1389 @samp{O} for old, respectively, in the first character after the line
1390 number and the colon), and whether it came from a declaration or a
1391 definition (@samp{C} or @samp{F}, respectively, in the following
1392 character).  In the case of function definitions, a K&R-style list of
1393 arguments followed by their declarations is also provided, inside
1394 comments, after the declaration.
1395
1396 @item -fno-asm
1397 @opindex fno-asm
1398 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1399 keyword, so that code can use these words as identifiers.  You can use
1400 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1401 instead.  @option{-ansi} implies @option{-fno-asm}.
1402
1403 In C++, this switch only affects the @code{typeof} keyword, since
1404 @code{asm} and @code{inline} are standard keywords.  You may want to
1405 use the @option{-fno-gnu-keywords} flag instead, which has the same
1406 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1407 switch only affects the @code{asm} and @code{typeof} keywords, since
1408 @code{inline} is a standard keyword in ISO C99.
1409
1410 @item -fno-builtin
1411 @itemx -fno-builtin-@var{function}
1412 @opindex fno-builtin
1413 @cindex built-in functions
1414 Don't recognize built-in functions that do not begin with
1415 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1416 functions provided by GCC}, for details of the functions affected,
1417 including those which are not built-in functions when @option{-ansi} or
1418 @option{-std} options for strict ISO C conformance are used because they
1419 do not have an ISO standard meaning.
1420
1421 GCC normally generates special code to handle certain built-in functions
1422 more efficiently; for instance, calls to @code{alloca} may become single
1423 instructions that adjust the stack directly, and calls to @code{memcpy}
1424 may become inline copy loops.  The resulting code is often both smaller
1425 and faster, but since the function calls no longer appear as such, you
1426 cannot set a breakpoint on those calls, nor can you change the behavior
1427 of the functions by linking with a different library.  In addition,
1428 when a function is recognized as a built-in function, GCC may use
1429 information about that function to warn about problems with calls to
1430 that function, or to generate more efficient code, even if the
1431 resulting code still contains calls to that function.  For example,
1432 warnings are given with @option{-Wformat} for bad calls to
1433 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1434 known not to modify global memory.
1435
1436 With the @option{-fno-builtin-@var{function}} option
1437 only the built-in function @var{function} is
1438 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1439 function is named this is not built-in in this version of GCC, this
1440 option is ignored.  There is no corresponding
1441 @option{-fbuiltin-@var{function}} option; if you wish to enable
1442 built-in functions selectively when using @option{-fno-builtin} or
1443 @option{-ffreestanding}, you may define macros such as:
1444
1445 @smallexample
1446 #define abs(n)          __builtin_abs ((n))
1447 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1448 @end smallexample
1449
1450 @item -fhosted
1451 @opindex fhosted
1452 @cindex hosted environment
1453
1454 Assert that compilation takes place in a hosted environment.  This implies
1455 @option{-fbuiltin}.  A hosted environment is one in which the
1456 entire standard library is available, and in which @code{main} has a return
1457 type of @code{int}.  Examples are nearly everything except a kernel.
1458 This is equivalent to @option{-fno-freestanding}.
1459
1460 @item -ffreestanding
1461 @opindex ffreestanding
1462 @cindex hosted environment
1463
1464 Assert that compilation takes place in a freestanding environment.  This
1465 implies @option{-fno-builtin}.  A freestanding environment
1466 is one in which the standard library may not exist, and program startup may
1467 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1468 This is equivalent to @option{-fno-hosted}.
1469
1470 @xref{Standards,,Language Standards Supported by GCC}, for details of
1471 freestanding and hosted environments.
1472
1473 @item -fopenmp
1474 @opindex fopenmp
1475 @cindex openmp parallel
1476 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1477 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1478 compiler generates parallel code according to the OpenMP Application
1479 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1480
1481 @item -fms-extensions
1482 @opindex fms-extensions
1483 Accept some non-standard constructs used in Microsoft header files.
1484
1485 Some cases of unnamed fields in structures and unions are only
1486 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1487 fields within structs/unions}, for details.
1488
1489 @item -trigraphs
1490 @opindex trigraphs
1491 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1492 options for strict ISO C conformance) implies @option{-trigraphs}.
1493
1494 @item -no-integrated-cpp
1495 @opindex no-integrated-cpp
1496 Performs a compilation in two passes: preprocessing and compiling.  This
1497 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1498 @option{-B} option.  The user supplied compilation step can then add in
1499 an additional preprocessing step after normal preprocessing but before
1500 compiling.  The default is to use the integrated cpp (internal cpp)
1501
1502 The semantics of this option will change if "cc1", "cc1plus", and
1503 "cc1obj" are merged.
1504
1505 @cindex traditional C language
1506 @cindex C language, traditional
1507 @item -traditional
1508 @itemx -traditional-cpp
1509 @opindex traditional-cpp
1510 @opindex traditional
1511 Formerly, these options caused GCC to attempt to emulate a pre-standard
1512 C compiler.  They are now only supported with the @option{-E} switch.
1513 The preprocessor continues to support a pre-standard mode.  See the GNU
1514 CPP manual for details.
1515
1516 @item -fcond-mismatch
1517 @opindex fcond-mismatch
1518 Allow conditional expressions with mismatched types in the second and
1519 third arguments.  The value of such an expression is void.  This option
1520 is not supported for C++.
1521
1522 @item -flax-vector-conversions
1523 @opindex flax-vector-conversions
1524 Allow implicit conversions between vectors with differing numbers of
1525 elements and/or incompatible element types.  This option should not be
1526 used for new code.
1527
1528 @item -funsigned-char
1529 @opindex funsigned-char
1530 Let the type @code{char} be unsigned, like @code{unsigned char}.
1531
1532 Each kind of machine has a default for what @code{char} should
1533 be.  It is either like @code{unsigned char} by default or like
1534 @code{signed char} by default.
1535
1536 Ideally, a portable program should always use @code{signed char} or
1537 @code{unsigned char} when it depends on the signedness of an object.
1538 But many programs have been written to use plain @code{char} and
1539 expect it to be signed, or expect it to be unsigned, depending on the
1540 machines they were written for.  This option, and its inverse, let you
1541 make such a program work with the opposite default.
1542
1543 The type @code{char} is always a distinct type from each of
1544 @code{signed char} or @code{unsigned char}, even though its behavior
1545 is always just like one of those two.
1546
1547 @item -fsigned-char
1548 @opindex fsigned-char
1549 Let the type @code{char} be signed, like @code{signed char}.
1550
1551 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1552 the negative form of @option{-funsigned-char}.  Likewise, the option
1553 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1554
1555 @item -fsigned-bitfields
1556 @itemx -funsigned-bitfields
1557 @itemx -fno-signed-bitfields
1558 @itemx -fno-unsigned-bitfields
1559 @opindex fsigned-bitfields
1560 @opindex funsigned-bitfields
1561 @opindex fno-signed-bitfields
1562 @opindex fno-unsigned-bitfields
1563 These options control whether a bit-field is signed or unsigned, when the
1564 declaration does not use either @code{signed} or @code{unsigned}.  By
1565 default, such a bit-field is signed, because this is consistent: the
1566 basic integer types such as @code{int} are signed types.
1567 @end table
1568
1569 @node C++ Dialect Options
1570 @section Options Controlling C++ Dialect
1571
1572 @cindex compiler options, C++
1573 @cindex C++ options, command line
1574 @cindex options, C++
1575 This section describes the command-line options that are only meaningful
1576 for C++ programs; but you can also use most of the GNU compiler options
1577 regardless of what language your program is in.  For example, you
1578 might compile a file @code{firstClass.C} like this:
1579
1580 @smallexample
1581 g++ -g -frepo -O -c firstClass.C
1582 @end smallexample
1583
1584 @noindent
1585 In this example, only @option{-frepo} is an option meant
1586 only for C++ programs; you can use the other options with any
1587 language supported by GCC@.
1588
1589 Here is a list of options that are @emph{only} for compiling C++ programs:
1590
1591 @table @gcctabopt
1592
1593 @item -fabi-version=@var{n}
1594 @opindex fabi-version
1595 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1596 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1597 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1598 the version that conforms most closely to the C++ ABI specification.
1599 Therefore, the ABI obtained using version 0 will change as ABI bugs
1600 are fixed.
1601
1602 The default is version 2.
1603
1604 @item -fno-access-control
1605 @opindex fno-access-control
1606 Turn off all access checking.  This switch is mainly useful for working
1607 around bugs in the access control code.
1608
1609 @item -fcheck-new
1610 @opindex fcheck-new
1611 Check that the pointer returned by @code{operator new} is non-null
1612 before attempting to modify the storage allocated.  This check is
1613 normally unnecessary because the C++ standard specifies that
1614 @code{operator new} will only return @code{0} if it is declared
1615 @samp{throw()}, in which case the compiler will always check the
1616 return value even without this option.  In all other cases, when
1617 @code{operator new} has a non-empty exception specification, memory
1618 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1619 @samp{new (nothrow)}.
1620
1621 @item -fconserve-space
1622 @opindex fconserve-space
1623 Put uninitialized or runtime-initialized global variables into the
1624 common segment, as C does.  This saves space in the executable at the
1625 cost of not diagnosing duplicate definitions.  If you compile with this
1626 flag and your program mysteriously crashes after @code{main()} has
1627 completed, you may have an object that is being destroyed twice because
1628 two definitions were merged.
1629
1630 This option is no longer useful on most targets, now that support has
1631 been added for putting variables into BSS without making them common.
1632
1633 @item -ffriend-injection
1634 @opindex ffriend-injection
1635 Inject friend functions into the enclosing namespace, so that they are
1636 visible outside the scope of the class in which they are declared.
1637 Friend functions were documented to work this way in the old Annotated
1638 C++ Reference Manual, and versions of G++ before 4.1 always worked
1639 that way.  However, in ISO C++ a friend function which is not declared
1640 in an enclosing scope can only be found using argument dependent
1641 lookup.  This option causes friends to be injected as they were in
1642 earlier releases.
1643
1644 This option is for compatibility, and may be removed in a future
1645 release of G++.
1646
1647 @item -fno-elide-constructors
1648 @opindex fno-elide-constructors
1649 The C++ standard allows an implementation to omit creating a temporary
1650 which is only used to initialize another object of the same type.
1651 Specifying this option disables that optimization, and forces G++ to
1652 call the copy constructor in all cases.
1653
1654 @item -fno-enforce-eh-specs
1655 @opindex fno-enforce-eh-specs
1656 Don't generate code to check for violation of exception specifications
1657 at runtime.  This option violates the C++ standard, but may be useful
1658 for reducing code size in production builds, much like defining
1659 @samp{NDEBUG}.  This does not give user code permission to throw
1660 exceptions in violation of the exception specifications; the compiler
1661 will still optimize based on the specifications, so throwing an
1662 unexpected exception will result in undefined behavior.
1663
1664 @item -ffor-scope
1665 @itemx -fno-for-scope
1666 @opindex ffor-scope
1667 @opindex fno-for-scope
1668 If @option{-ffor-scope} is specified, the scope of variables declared in
1669 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1670 as specified by the C++ standard.
1671 If @option{-fno-for-scope} is specified, the scope of variables declared in
1672 a @i{for-init-statement} extends to the end of the enclosing scope,
1673 as was the case in old versions of G++, and other (traditional)
1674 implementations of C++.
1675
1676 The default if neither flag is given to follow the standard,
1677 but to allow and give a warning for old-style code that would
1678 otherwise be invalid, or have different behavior.
1679
1680 @item -fno-gnu-keywords
1681 @opindex fno-gnu-keywords
1682 Do not recognize @code{typeof} as a keyword, so that code can use this
1683 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1684 @option{-ansi} implies @option{-fno-gnu-keywords}.
1685
1686 @item -fno-implicit-templates
1687 @opindex fno-implicit-templates
1688 Never emit code for non-inline templates which are instantiated
1689 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1690 @xref{Template Instantiation}, for more information.
1691
1692 @item -fno-implicit-inline-templates
1693 @opindex fno-implicit-inline-templates
1694 Don't emit code for implicit instantiations of inline templates, either.
1695 The default is to handle inlines differently so that compiles with and
1696 without optimization will need the same set of explicit instantiations.
1697
1698 @item -fno-implement-inlines
1699 @opindex fno-implement-inlines
1700 To save space, do not emit out-of-line copies of inline functions
1701 controlled by @samp{#pragma implementation}.  This will cause linker
1702 errors if these functions are not inlined everywhere they are called.
1703
1704 @item -fms-extensions
1705 @opindex fms-extensions
1706 Disable pedantic warnings about constructs used in MFC, such as implicit
1707 int and getting a pointer to member function via non-standard syntax.
1708
1709 @item -fno-nonansi-builtins
1710 @opindex fno-nonansi-builtins
1711 Disable built-in declarations of functions that are not mandated by
1712 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1713 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1714
1715 @item -fno-operator-names
1716 @opindex fno-operator-names
1717 Do not treat the operator name keywords @code{and}, @code{bitand},
1718 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1719 synonyms as keywords.
1720
1721 @item -fno-optional-diags
1722 @opindex fno-optional-diags
1723 Disable diagnostics that the standard says a compiler does not need to
1724 issue.  Currently, the only such diagnostic issued by G++ is the one for
1725 a name having multiple meanings within a class.
1726
1727 @item -fpermissive
1728 @opindex fpermissive
1729 Downgrade some diagnostics about nonconformant code from errors to
1730 warnings.  Thus, using @option{-fpermissive} will allow some
1731 nonconforming code to compile.
1732
1733 @item -frepo
1734 @opindex frepo
1735 Enable automatic template instantiation at link time.  This option also
1736 implies @option{-fno-implicit-templates}.  @xref{Template
1737 Instantiation}, for more information.
1738
1739 @item -fno-rtti
1740 @opindex fno-rtti
1741 Disable generation of information about every class with virtual
1742 functions for use by the C++ runtime type identification features
1743 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1744 of the language, you can save some space by using this flag.  Note that
1745 exception handling uses the same information, but it will generate it as
1746 needed. The @samp{dynamic_cast} operator can still be used for casts that
1747 do not require runtime type information, i.e. casts to @code{void *} or to
1748 unambiguous base classes.
1749
1750 @item -fstats
1751 @opindex fstats
1752 Emit statistics about front-end processing at the end of the compilation.
1753 This information is generally only useful to the G++ development team.
1754
1755 @item -ftemplate-depth-@var{n}
1756 @opindex ftemplate-depth
1757 Set the maximum instantiation depth for template classes to @var{n}.
1758 A limit on the template instantiation depth is needed to detect
1759 endless recursions during template class instantiation.  ANSI/ISO C++
1760 conforming programs must not rely on a maximum depth greater than 17.
1761
1762 @item -fno-threadsafe-statics
1763 @opindex fno-threadsafe-statics
1764 Do not emit the extra code to use the routines specified in the C++
1765 ABI for thread-safe initialization of local statics.  You can use this
1766 option to reduce code size slightly in code that doesn't need to be
1767 thread-safe.
1768
1769 @item -fuse-cxa-atexit
1770 @opindex fuse-cxa-atexit
1771 Register destructors for objects with static storage duration with the
1772 @code{__cxa_atexit} function rather than the @code{atexit} function.
1773 This option is required for fully standards-compliant handling of static
1774 destructors, but will only work if your C library supports
1775 @code{__cxa_atexit}.
1776
1777 @item -fno-use-cxa-get-exception-ptr
1778 @opindex fno-use-cxa-get-exception-ptr
1779 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1780 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1781 if the runtime routine is not available.
1782
1783 @item -fvisibility-inlines-hidden
1784 @opindex fvisibility-inlines-hidden
1785 This switch declares that the user does not attempt to compare
1786 pointers to inline methods where the addresses of the two functions
1787 were taken in different shared objects.
1788
1789 The effect of this is that GCC may, effectively, mark inline methods with
1790 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1791 appear in the export table of a DSO and do not require a PLT indirection
1792 when used within the DSO@.  Enabling this option can have a dramatic effect
1793 on load and link times of a DSO as it massively reduces the size of the
1794 dynamic export table when the library makes heavy use of templates.
1795
1796 The behavior of this switch is not quite the same as marking the
1797 methods as hidden directly, because it does not affect static variables
1798 local to the function or cause the compiler to deduce that
1799 the function is defined in only one shared object.
1800
1801 You may mark a method as having a visibility explicitly to negate the
1802 effect of the switch for that method.  For example, if you do want to
1803 compare pointers to a particular inline method, you might mark it as
1804 having default visibility.  Marking the enclosing class with explicit
1805 visibility will have no effect.
1806
1807 Explicitly instantiated inline methods are unaffected by this option
1808 as their linkage might otherwise cross a shared library boundary.
1809 @xref{Template Instantiation}.
1810
1811 @item -fno-weak
1812 @opindex fno-weak
1813 Do not use weak symbol support, even if it is provided by the linker.
1814 By default, G++ will use weak symbols if they are available.  This
1815 option exists only for testing, and should not be used by end-users;
1816 it will result in inferior code and has no benefits.  This option may
1817 be removed in a future release of G++.
1818
1819 @item -nostdinc++
1820 @opindex nostdinc++
1821 Do not search for header files in the standard directories specific to
1822 C++, but do still search the other standard directories.  (This option
1823 is used when building the C++ library.)
1824 @end table
1825
1826 In addition, these optimization, warning, and code generation options
1827 have meanings only for C++ programs:
1828
1829 @table @gcctabopt
1830 @item -fno-default-inline
1831 @opindex fno-default-inline
1832 Do not assume @samp{inline} for functions defined inside a class scope.
1833 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1834 functions will have linkage like inline functions; they just won't be
1835 inlined by default.
1836
1837 @item -Wabi @r{(C++ only)}
1838 @opindex Wabi
1839 Warn when G++ generates code that is probably not compatible with the
1840 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1841 all such cases, there are probably some cases that are not warned about,
1842 even though G++ is generating incompatible code.  There may also be
1843 cases where warnings are emitted even though the code that is generated
1844 will be compatible.
1845
1846 You should rewrite your code to avoid these warnings if you are
1847 concerned about the fact that code generated by G++ may not be binary
1848 compatible with code generated by other compilers.
1849
1850 The known incompatibilities at this point include:
1851
1852 @itemize @bullet
1853
1854 @item
1855 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1856 pack data into the same byte as a base class.  For example:
1857
1858 @smallexample
1859 struct A @{ virtual void f(); int f1 : 1; @};
1860 struct B : public A @{ int f2 : 1; @};
1861 @end smallexample
1862
1863 @noindent
1864 In this case, G++ will place @code{B::f2} into the same byte
1865 as@code{A::f1}; other compilers will not.  You can avoid this problem
1866 by explicitly padding @code{A} so that its size is a multiple of the
1867 byte size on your platform; that will cause G++ and other compilers to
1868 layout @code{B} identically.
1869
1870 @item
1871 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1872 tail padding when laying out virtual bases.  For example:
1873
1874 @smallexample
1875 struct A @{ virtual void f(); char c1; @};
1876 struct B @{ B(); char c2; @};
1877 struct C : public A, public virtual B @{@};
1878 @end smallexample
1879
1880 @noindent
1881 In this case, G++ will not place @code{B} into the tail-padding for
1882 @code{A}; other compilers will.  You can avoid this problem by
1883 explicitly padding @code{A} so that its size is a multiple of its
1884 alignment (ignoring virtual base classes); that will cause G++ and other
1885 compilers to layout @code{C} identically.
1886
1887 @item
1888 Incorrect handling of bit-fields with declared widths greater than that
1889 of their underlying types, when the bit-fields appear in a union.  For
1890 example:
1891
1892 @smallexample
1893 union U @{ int i : 4096; @};
1894 @end smallexample
1895
1896 @noindent
1897 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1898 union too small by the number of bits in an @code{int}.
1899
1900 @item
1901 Empty classes can be placed at incorrect offsets.  For example:
1902
1903 @smallexample
1904 struct A @{@};
1905
1906 struct B @{
1907   A a;
1908   virtual void f ();
1909 @};
1910
1911 struct C : public B, public A @{@};
1912 @end smallexample
1913
1914 @noindent
1915 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1916 it should be placed at offset zero.  G++ mistakenly believes that the
1917 @code{A} data member of @code{B} is already at offset zero.
1918
1919 @item
1920 Names of template functions whose types involve @code{typename} or
1921 template template parameters can be mangled incorrectly.
1922
1923 @smallexample
1924 template <typename Q>
1925 void f(typename Q::X) @{@}
1926
1927 template <template <typename> class Q>
1928 void f(typename Q<int>::X) @{@}
1929 @end smallexample
1930
1931 @noindent
1932 Instantiations of these templates may be mangled incorrectly.
1933
1934 @end itemize
1935
1936 @item -Wctor-dtor-privacy @r{(C++ only)}
1937 @opindex Wctor-dtor-privacy
1938 Warn when a class seems unusable because all the constructors or
1939 destructors in that class are private, and it has neither friends nor
1940 public static member functions.
1941
1942 @item -Wnon-virtual-dtor @r{(C++ only)}
1943 @opindex Wnon-virtual-dtor
1944 Warn when a class appears to be polymorphic, thereby requiring a virtual
1945 destructor, yet it declares a non-virtual one.  This warning is also
1946 enabled if -Weffc++ is specified.
1947
1948 @item -Wreorder @r{(C++ only)}
1949 @opindex Wreorder
1950 @cindex reordering, warning
1951 @cindex warning for reordering of member initializers
1952 Warn when the order of member initializers given in the code does not
1953 match the order in which they must be executed.  For instance:
1954
1955 @smallexample
1956 struct A @{
1957   int i;
1958   int j;
1959   A(): j (0), i (1) @{ @}
1960 @};
1961 @end smallexample
1962
1963 The compiler will rearrange the member initializers for @samp{i}
1964 and @samp{j} to match the declaration order of the members, emitting
1965 a warning to that effect.  This warning is enabled by @option{-Wall}.
1966 @end table
1967
1968 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1969
1970 @table @gcctabopt
1971 @item -Weffc++ @r{(C++ only)}
1972 @opindex Weffc++
1973 Warn about violations of the following style guidelines from Scott Meyers'
1974 @cite{Effective C++} book:
1975
1976 @itemize @bullet
1977 @item
1978 Item 11:  Define a copy constructor and an assignment operator for classes
1979 with dynamically allocated memory.
1980
1981 @item
1982 Item 12:  Prefer initialization to assignment in constructors.
1983
1984 @item
1985 Item 14:  Make destructors virtual in base classes.
1986
1987 @item
1988 Item 15:  Have @code{operator=} return a reference to @code{*this}.
1989
1990 @item
1991 Item 23:  Don't try to return a reference when you must return an object.
1992
1993 @end itemize
1994
1995 Also warn about violations of the following style guidelines from
1996 Scott Meyers' @cite{More Effective C++} book:
1997
1998 @itemize @bullet
1999 @item
2000 Item 6:  Distinguish between prefix and postfix forms of increment and
2001 decrement operators.
2002
2003 @item
2004 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2005
2006 @end itemize
2007
2008 When selecting this option, be aware that the standard library
2009 headers do not obey all of these guidelines; use @samp{grep -v}
2010 to filter out those warnings.
2011
2012 @item -Wno-deprecated @r{(C++ only)}
2013 @opindex Wno-deprecated
2014 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
2015
2016 @item -Wstrict-null-sentinel @r{(C++ only)}
2017 @opindex Wstrict-null-sentinel
2018 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2019 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2020 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2021 it is guaranteed to of the same size as a pointer.  But this use is
2022 not portable across different compilers.
2023
2024 @item -Wno-non-template-friend @r{(C++ only)}
2025 @opindex Wno-non-template-friend
2026 Disable warnings when non-templatized friend functions are declared
2027 within a template.  Since the advent of explicit template specification
2028 support in G++, if the name of the friend is an unqualified-id (i.e.,
2029 @samp{friend foo(int)}), the C++ language specification demands that the
2030 friend declare or define an ordinary, nontemplate function.  (Section
2031 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2032 could be interpreted as a particular specialization of a templatized
2033 function.  Because this non-conforming behavior is no longer the default
2034 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2035 check existing code for potential trouble spots and is on by default.
2036 This new compiler behavior can be turned off with
2037 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2038 but disables the helpful warning.
2039
2040 @item -Wold-style-cast @r{(C++ only)}
2041 @opindex Wold-style-cast
2042 Warn if an old-style (C-style) cast to a non-void type is used within
2043 a C++ program.  The new-style casts (@samp{dynamic_cast},
2044 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2045 less vulnerable to unintended effects and much easier to search for.
2046
2047 @item -Woverloaded-virtual @r{(C++ only)}
2048 @opindex Woverloaded-virtual
2049 @cindex overloaded virtual fn, warning
2050 @cindex warning for overloaded virtual fn
2051 Warn when a function declaration hides virtual functions from a
2052 base class.  For example, in:
2053
2054 @smallexample
2055 struct A @{
2056   virtual void f();
2057 @};
2058
2059 struct B: public A @{
2060   void f(int);
2061 @};
2062 @end smallexample
2063
2064 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2065 like:
2066
2067 @smallexample
2068 B* b;
2069 b->f();
2070 @end smallexample
2071
2072 will fail to compile.
2073
2074 @item -Wno-pmf-conversions @r{(C++ only)}
2075 @opindex Wno-pmf-conversions
2076 Disable the diagnostic for converting a bound pointer to member function
2077 to a plain pointer.
2078
2079 @item -Wsign-promo @r{(C++ only)}
2080 @opindex Wsign-promo
2081 Warn when overload resolution chooses a promotion from unsigned or
2082 enumerated type to a signed type, over a conversion to an unsigned type of
2083 the same size.  Previous versions of G++ would try to preserve
2084 unsignedness, but the standard mandates the current behavior.
2085
2086 @smallexample
2087 struct A @{
2088   operator int ();
2089   A& operator = (int);
2090 @};
2091
2092 main ()
2093 @{
2094   A a,b;
2095   a = b;
2096 @}
2097 @end smallexample
2098
2099 In this example, G++ will synthesize a default @samp{A& operator =
2100 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2101 @end table
2102
2103 @node Objective-C and Objective-C++ Dialect Options
2104 @section Options Controlling Objective-C and Objective-C++ Dialects
2105
2106 @cindex compiler options, Objective-C and Objective-C++
2107 @cindex Objective-C and Objective-C++ options, command line
2108 @cindex options, Objective-C and Objective-C++
2109 (NOTE: This manual does not describe the Objective-C and Objective-C++
2110 languages themselves.  See @xref{Standards,,Language Standards
2111 Supported by GCC}, for references.)
2112
2113 This section describes the command-line options that are only meaningful
2114 for Objective-C and Objective-C++ programs, but you can also use most of
2115 the language-independent GNU compiler options.
2116 For example, you might compile a file @code{some_class.m} like this:
2117
2118 @smallexample
2119 gcc -g -fgnu-runtime -O -c some_class.m
2120 @end smallexample
2121
2122 @noindent
2123 In this example, @option{-fgnu-runtime} is an option meant only for
2124 Objective-C and Objective-C++ programs; you can use the other options with
2125 any language supported by GCC@.
2126
2127 Note that since Objective-C is an extension of the C language, Objective-C
2128 compilations may also use options specific to the C front-end (e.g.,
2129 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2130 C++-specific options (e.g., @option{-Wabi}).
2131
2132 Here is a list of options that are @emph{only} for compiling Objective-C
2133 and Objective-C++ programs:
2134
2135 @table @gcctabopt
2136 @item -fconstant-string-class=@var{class-name}
2137 @opindex fconstant-string-class
2138 Use @var{class-name} as the name of the class to instantiate for each
2139 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2140 class name is @code{NXConstantString} if the GNU runtime is being used, and
2141 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2142 @option{-fconstant-cfstrings} option, if also present, will override the
2143 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2144 to be laid out as constant CoreFoundation strings.
2145
2146 @item -fgnu-runtime
2147 @opindex fgnu-runtime
2148 Generate object code compatible with the standard GNU Objective-C
2149 runtime.  This is the default for most types of systems.
2150
2151 @item -fnext-runtime
2152 @opindex fnext-runtime
2153 Generate output compatible with the NeXT runtime.  This is the default
2154 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2155 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2156 used.
2157
2158 @item -fno-nil-receivers
2159 @opindex fno-nil-receivers
2160 Assume that all Objective-C message dispatches (e.g.,
2161 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2162 is not @code{nil}.  This allows for more efficient entry points in the runtime
2163 to be used.  Currently, this option is only available in conjunction with
2164 the NeXT runtime on Mac OS X 10.3 and later.
2165
2166 @item -fobjc-call-cxx-cdtors
2167 @opindex fobjc-call-cxx-cdtors
2168 For each Objective-C class, check if any of its instance variables is a
2169 C++ object with a non-trivial default constructor.  If so, synthesize a
2170 special @code{- (id) .cxx_construct} instance method that will run
2171 non-trivial default constructors on any such instance variables, in order,
2172 and then return @code{self}.  Similarly, check if any instance variable
2173 is a C++ object with a non-trivial destructor, and if so, synthesize a
2174 special @code{- (void) .cxx_destruct} method that will run
2175 all such default destructors, in reverse order.
2176
2177 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2178 thusly generated will only operate on instance variables declared in the
2179 current Objective-C class, and not those inherited from superclasses.  It
2180 is the responsibility of the Objective-C runtime to invoke all such methods
2181 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2182 will be invoked by the runtime immediately after a new object
2183 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2184 be invoked immediately before the runtime deallocates an object instance.
2185
2186 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2187 support for invoking the @code{- (id) .cxx_construct} and
2188 @code{- (void) .cxx_destruct} methods.
2189
2190 @item -fobjc-direct-dispatch
2191 @opindex fobjc-direct-dispatch
2192 Allow fast jumps to the message dispatcher.  On Darwin this is
2193 accomplished via the comm page.
2194
2195 @item -fobjc-exceptions
2196 @opindex fobjc-exceptions
2197 Enable syntactic support for structured exception handling in Objective-C,
2198 similar to what is offered by C++ and Java.  This option is
2199 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2200 earlier.
2201
2202 @smallexample
2203   @@try @{
2204     @dots{}
2205        @@throw expr;
2206     @dots{}
2207   @}
2208   @@catch (AnObjCClass *exc) @{
2209     @dots{}
2210       @@throw expr;
2211     @dots{}
2212       @@throw;
2213     @dots{}
2214   @}
2215   @@catch (AnotherClass *exc) @{
2216     @dots{}
2217   @}
2218   @@catch (id allOthers) @{
2219     @dots{}
2220   @}
2221   @@finally @{
2222     @dots{}
2223       @@throw expr;
2224     @dots{}
2225   @}
2226 @end smallexample
2227
2228 The @code{@@throw} statement may appear anywhere in an Objective-C or
2229 Objective-C++ program; when used inside of a @code{@@catch} block, the
2230 @code{@@throw} may appear without an argument (as shown above), in which case
2231 the object caught by the @code{@@catch} will be rethrown.
2232
2233 Note that only (pointers to) Objective-C objects may be thrown and
2234 caught using this scheme.  When an object is thrown, it will be caught
2235 by the nearest @code{@@catch} clause capable of handling objects of that type,
2236 analogously to how @code{catch} blocks work in C++ and Java.  A
2237 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2238 any and all Objective-C exceptions not caught by previous @code{@@catch}
2239 clauses (if any).
2240
2241 The @code{@@finally} clause, if present, will be executed upon exit from the
2242 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2243 regardless of whether any exceptions are thrown, caught or rethrown
2244 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2245 of the @code{finally} clause in Java.
2246
2247 There are several caveats to using the new exception mechanism:
2248
2249 @itemize @bullet
2250 @item
2251 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2252 idioms provided by the @code{NSException} class, the new
2253 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2254 systems, due to additional functionality needed in the (NeXT) Objective-C
2255 runtime.
2256
2257 @item
2258 As mentioned above, the new exceptions do not support handling
2259 types other than Objective-C objects.   Furthermore, when used from
2260 Objective-C++, the Objective-C exception model does not interoperate with C++
2261 exceptions at this time.  This means you cannot @code{@@throw} an exception
2262 from Objective-C and @code{catch} it in C++, or vice versa
2263 (i.e., @code{throw @dots{} @@catch}).
2264 @end itemize
2265
2266 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2267 blocks for thread-safe execution:
2268
2269 @smallexample
2270   @@synchronized (ObjCClass *guard) @{
2271     @dots{}
2272   @}
2273 @end smallexample
2274
2275 Upon entering the @code{@@synchronized} block, a thread of execution shall
2276 first check whether a lock has been placed on the corresponding @code{guard}
2277 object by another thread.  If it has, the current thread shall wait until
2278 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2279 the current thread will place its own lock on it, execute the code contained in
2280 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2281 making @code{guard} available to other threads).
2282
2283 Unlike Java, Objective-C does not allow for entire methods to be marked
2284 @code{@@synchronized}.  Note that throwing exceptions out of
2285 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2286 to be unlocked properly.
2287
2288 @item -fobjc-gc
2289 @opindex fobjc-gc
2290 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2291
2292 @item -freplace-objc-classes
2293 @opindex freplace-objc-classes
2294 Emit a special marker instructing @command{ld(1)} not to statically link in
2295 the resulting object file, and allow @command{dyld(1)} to load it in at
2296 run time instead.  This is used in conjunction with the Fix-and-Continue
2297 debugging mode, where the object file in question may be recompiled and
2298 dynamically reloaded in the course of program execution, without the need
2299 to restart the program itself.  Currently, Fix-and-Continue functionality
2300 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2301 and later.
2302
2303 @item -fzero-link
2304 @opindex fzero-link
2305 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2306 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2307 compile time) with static class references that get initialized at load time,
2308 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2309 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2310 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2311 for individual class implementations to be modified during program execution.
2312
2313 @item -gen-decls
2314 @opindex gen-decls
2315 Dump interface declarations for all classes seen in the source file to a
2316 file named @file{@var{sourcename}.decl}.
2317
2318 @item -Wassign-intercept
2319 @opindex Wassign-intercept
2320 Warn whenever an Objective-C assignment is being intercepted by the
2321 garbage collector.
2322
2323 @item -Wno-protocol
2324 @opindex Wno-protocol
2325 If a class is declared to implement a protocol, a warning is issued for
2326 every method in the protocol that is not implemented by the class.  The
2327 default behavior is to issue a warning for every method not explicitly
2328 implemented in the class, even if a method implementation is inherited
2329 from the superclass.  If you use the @option{-Wno-protocol} option, then
2330 methods inherited from the superclass are considered to be implemented,
2331 and no warning is issued for them.
2332
2333 @item -Wselector
2334 @opindex Wselector
2335 Warn if multiple methods of different types for the same selector are
2336 found during compilation.  The check is performed on the list of methods
2337 in the final stage of compilation.  Additionally, a check is performed
2338 for each selector appearing in a @code{@@selector(@dots{})}
2339 expression, and a corresponding method for that selector has been found
2340 during compilation.  Because these checks scan the method table only at
2341 the end of compilation, these warnings are not produced if the final
2342 stage of compilation is not reached, for example because an error is
2343 found during compilation, or because the @option{-fsyntax-only} option is
2344 being used.
2345
2346 @item -Wstrict-selector-match
2347 @opindex Wstrict-selector-match
2348 Warn if multiple methods with differing argument and/or return types are
2349 found for a given selector when attempting to send a message using this
2350 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2351 is off (which is the default behavior), the compiler will omit such warnings
2352 if any differences found are confined to types which share the same size
2353 and alignment.
2354
2355 @item -Wundeclared-selector
2356 @opindex Wundeclared-selector
2357 Warn if a @code{@@selector(@dots{})} expression referring to an
2358 undeclared selector is found.  A selector is considered undeclared if no
2359 method with that name has been declared before the
2360 @code{@@selector(@dots{})} expression, either explicitly in an
2361 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2362 an @code{@@implementation} section.  This option always performs its
2363 checks as soon as a @code{@@selector(@dots{})} expression is found,
2364 while @option{-Wselector} only performs its checks in the final stage of
2365 compilation.  This also enforces the coding style convention
2366 that methods and selectors must be declared before being used.
2367
2368 @item -print-objc-runtime-info
2369 @opindex print-objc-runtime-info
2370 Generate C header describing the largest structure that is passed by
2371 value, if any.
2372
2373 @end table
2374
2375 @node Language Independent Options
2376 @section Options to Control Diagnostic Messages Formatting
2377 @cindex options to control diagnostics formatting
2378 @cindex diagnostic messages
2379 @cindex message formatting
2380
2381 Traditionally, diagnostic messages have been formatted irrespective of
2382 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2383 below can be used to control the diagnostic messages formatting
2384 algorithm, e.g.@: how many characters per line, how often source location
2385 information should be reported.  Right now, only the C++ front end can
2386 honor these options.  However it is expected, in the near future, that
2387 the remaining front ends would be able to digest them correctly.
2388
2389 @table @gcctabopt
2390 @item -fmessage-length=@var{n}
2391 @opindex fmessage-length
2392 Try to format error messages so that they fit on lines of about @var{n}
2393 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2394 the front ends supported by GCC@.  If @var{n} is zero, then no
2395 line-wrapping will be done; each error message will appear on a single
2396 line.
2397
2398 @opindex fdiagnostics-show-location
2399 @item -fdiagnostics-show-location=once
2400 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2401 reporter to emit @emph{once} source location information; that is, in
2402 case the message is too long to fit on a single physical line and has to
2403 be wrapped, the source location won't be emitted (as prefix) again,
2404 over and over, in subsequent continuation lines.  This is the default
2405 behavior.
2406
2407 @item -fdiagnostics-show-location=every-line
2408 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2409 messages reporter to emit the same source location information (as
2410 prefix) for physical lines that result from the process of breaking
2411 a message which is too long to fit on a single line.
2412
2413 @item -fdiagnostics-show-option
2414 @opindex fdiagnostics-show-option
2415 This option instructs the diagnostic machinery to add text to each
2416 diagnostic emitted, which indicates which command line option directly
2417 controls that diagnostic, when such an option is known to the
2418 diagnostic machinery.
2419
2420 @item -Wcoverage-mismatch
2421 @opindex Wcoverage-mismatch
2422 Warn if feedback profiles do not match when using the
2423 @option{-fprofile-use} option.
2424 If a source file was changed between @option{-fprofile-gen} and
2425 @option{-fprofile-use}, the files with the profile feedback can fail
2426 to match the source file and GCC can not use the profile feedback
2427 information.  By default, GCC emits an error message in this case.
2428 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2429 error.  GCC does not use appropriate feedback profiles, so using this
2430 option can result in poorly optimized code.  This option is useful
2431 only in the case of very minor changes such as bug fixes to an
2432 existing code-base.
2433
2434 @end table
2435
2436 @node Warning Options
2437 @section Options to Request or Suppress Warnings
2438 @cindex options to control warnings
2439 @cindex warning messages
2440 @cindex messages, warning
2441 @cindex suppressing warnings
2442
2443 Warnings are diagnostic messages that report constructions which
2444 are not inherently erroneous but which are risky or suggest there
2445 may have been an error.
2446
2447 You can request many specific warnings with options beginning @samp{-W},
2448 for example @option{-Wimplicit} to request warnings on implicit
2449 declarations.  Each of these specific warning options also has a
2450 negative form beginning @samp{-Wno-} to turn off warnings;
2451 for example, @option{-Wno-implicit}.  This manual lists only one of the
2452 two forms, whichever is not the default.
2453
2454 The following options control the amount and kinds of warnings produced
2455 by GCC; for further, language-specific options also refer to
2456 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2457 Options}.
2458
2459 @table @gcctabopt
2460 @cindex syntax checking
2461 @item -fsyntax-only
2462 @opindex fsyntax-only
2463 Check the code for syntax errors, but don't do anything beyond that.
2464
2465 @item -pedantic
2466 @opindex pedantic
2467 Issue all the warnings demanded by strict ISO C and ISO C++;
2468 reject all programs that use forbidden extensions, and some other
2469 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2470 version of the ISO C standard specified by any @option{-std} option used.
2471
2472 Valid ISO C and ISO C++ programs should compile properly with or without
2473 this option (though a rare few will require @option{-ansi} or a
2474 @option{-std} option specifying the required version of ISO C)@.  However,
2475 without this option, certain GNU extensions and traditional C and C++
2476 features are supported as well.  With this option, they are rejected.
2477
2478 @option{-pedantic} does not cause warning messages for use of the
2479 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2480 warnings are also disabled in the expression that follows
2481 @code{__extension__}.  However, only system header files should use
2482 these escape routes; application programs should avoid them.
2483 @xref{Alternate Keywords}.
2484
2485 Some users try to use @option{-pedantic} to check programs for strict ISO
2486 C conformance.  They soon find that it does not do quite what they want:
2487 it finds some non-ISO practices, but not all---only those for which
2488 ISO C @emph{requires} a diagnostic, and some others for which
2489 diagnostics have been added.
2490
2491 A feature to report any failure to conform to ISO C might be useful in
2492 some instances, but would require considerable additional work and would
2493 be quite different from @option{-pedantic}.  We don't have plans to
2494 support such a feature in the near future.
2495
2496 Where the standard specified with @option{-std} represents a GNU
2497 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2498 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2499 extended dialect is based.  Warnings from @option{-pedantic} are given
2500 where they are required by the base standard.  (It would not make sense
2501 for such warnings to be given only for features not in the specified GNU
2502 C dialect, since by definition the GNU dialects of C include all
2503 features the compiler supports with the given option, and there would be
2504 nothing to warn about.)
2505
2506 @item -pedantic-errors
2507 @opindex pedantic-errors
2508 Like @option{-pedantic}, except that errors are produced rather than
2509 warnings.
2510
2511 @item -w
2512 @opindex w
2513 Inhibit all warning messages.
2514
2515 @item -Wno-import
2516 @opindex Wno-import
2517 Inhibit warning messages about the use of @samp{#import}.
2518
2519 @item -Wchar-subscripts
2520 @opindex Wchar-subscripts
2521 Warn if an array subscript has type @code{char}.  This is a common cause
2522 of error, as programmers often forget that this type is signed on some
2523 machines.
2524 This warning is enabled by @option{-Wall}.
2525
2526 @item -Wcomment
2527 @opindex Wcomment
2528 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2529 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2530 This warning is enabled by @option{-Wall}.
2531
2532 @item -Wfatal-errors
2533 @opindex Wfatal-errors
2534 This option causes the compiler to abort compilation on the first error
2535 occurred rather than trying to keep going and printing further error
2536 messages.
2537
2538 @item -Wformat
2539 @opindex Wformat
2540 @opindex ffreestanding
2541 @opindex fno-builtin
2542 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2543 the arguments supplied have types appropriate to the format string
2544 specified, and that the conversions specified in the format string make
2545 sense.  This includes standard functions, and others specified by format
2546 attributes (@pxref{Function Attributes}), in the @code{printf},
2547 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2548 not in the C standard) families (or other target-specific families).
2549 Which functions are checked without format attributes having been
2550 specified depends on the standard version selected, and such checks of
2551 functions without the attribute specified are disabled by
2552 @option{-ffreestanding} or @option{-fno-builtin}.
2553
2554 The formats are checked against the format features supported by GNU
2555 libc version 2.2.  These include all ISO C90 and C99 features, as well
2556 as features from the Single Unix Specification and some BSD and GNU
2557 extensions.  Other library implementations may not support all these
2558 features; GCC does not support warning about features that go beyond a
2559 particular library's limitations.  However, if @option{-pedantic} is used
2560 with @option{-Wformat}, warnings will be given about format features not
2561 in the selected standard version (but not for @code{strfmon} formats,
2562 since those are not in any version of the C standard).  @xref{C Dialect
2563 Options,,Options Controlling C Dialect}.
2564
2565 Since @option{-Wformat} also checks for null format arguments for
2566 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2567
2568 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2569 aspects of format checking, the options @option{-Wformat-y2k},
2570 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2571 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2572 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2573
2574 @item -Wformat-y2k
2575 @opindex Wformat-y2k
2576 If @option{-Wformat} is specified, also warn about @code{strftime}
2577 formats which may yield only a two-digit year.
2578
2579 @item -Wno-format-extra-args
2580 @opindex Wno-format-extra-args
2581 If @option{-Wformat} is specified, do not warn about excess arguments to a
2582 @code{printf} or @code{scanf} format function.  The C standard specifies
2583 that such arguments are ignored.
2584
2585 Where the unused arguments lie between used arguments that are
2586 specified with @samp{$} operand number specifications, normally
2587 warnings are still given, since the implementation could not know what
2588 type to pass to @code{va_arg} to skip the unused arguments.  However,
2589 in the case of @code{scanf} formats, this option will suppress the
2590 warning if the unused arguments are all pointers, since the Single
2591 Unix Specification says that such unused arguments are allowed.
2592
2593 @item -Wno-format-zero-length
2594 @opindex Wno-format-zero-length
2595 If @option{-Wformat} is specified, do not warn about zero-length formats.
2596 The C standard specifies that zero-length formats are allowed.
2597
2598 @item -Wformat-nonliteral
2599 @opindex Wformat-nonliteral
2600 If @option{-Wformat} is specified, also warn if the format string is not a
2601 string literal and so cannot be checked, unless the format function
2602 takes its format arguments as a @code{va_list}.
2603
2604 @item -Wformat-security
2605 @opindex Wformat-security
2606 If @option{-Wformat} is specified, also warn about uses of format
2607 functions that represent possible security problems.  At present, this
2608 warns about calls to @code{printf} and @code{scanf} functions where the
2609 format string is not a string literal and there are no format arguments,
2610 as in @code{printf (foo);}.  This may be a security hole if the format
2611 string came from untrusted input and contains @samp{%n}.  (This is
2612 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2613 in future warnings may be added to @option{-Wformat-security} that are not
2614 included in @option{-Wformat-nonliteral}.)
2615
2616 @item -Wformat=2
2617 @opindex Wformat=2
2618 Enable @option{-Wformat} plus format checks not included in
2619 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2620 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2621
2622 @item -Wnonnull
2623 @opindex Wnonnull
2624 Warn about passing a null pointer for arguments marked as
2625 requiring a non-null value by the @code{nonnull} function attribute.
2626
2627 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2628 can be disabled with the @option{-Wno-nonnull} option.
2629
2630 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2631 @opindex Winit-self
2632 Warn about uninitialized variables which are initialized with themselves.
2633 Note this option can only be used with the @option{-Wuninitialized} option,
2634 which in turn only works with @option{-O1} and above.
2635
2636 For example, GCC will warn about @code{i} being uninitialized in the
2637 following snippet only when @option{-Winit-self} has been specified:
2638 @smallexample
2639 @group
2640 int f()
2641 @{
2642   int i = i;
2643   return i;
2644 @}
2645 @end group
2646 @end smallexample
2647
2648 @item -Wimplicit-int
2649 @opindex Wimplicit-int
2650 Warn when a declaration does not specify a type.
2651 This warning is enabled by @option{-Wall}.
2652
2653 @item -Wimplicit-function-declaration
2654 @opindex Wimplicit-function-declaration
2655 @opindex Wno-implicit-function-declaration
2656 Give a warning whenever a function is used before being declared. In
2657 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2658 enabled by default and it is made into an error by
2659 @option{-pedantic-errors}. This warning is also enabled by
2660 @option{-Wall}.
2661
2662 @item -Wimplicit
2663 @opindex Wimplicit
2664 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2665 This warning is enabled by @option{-Wall}.
2666
2667 @item -Wmain
2668 @opindex Wmain
2669 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2670 function with external linkage, returning int, taking either zero
2671 arguments, two, or three arguments of appropriate types.
2672 This warning is enabled by @option{-Wall}.
2673
2674 @item -Wmissing-braces
2675 @opindex Wmissing-braces
2676 Warn if an aggregate or union initializer is not fully bracketed.  In
2677 the following example, the initializer for @samp{a} is not fully
2678 bracketed, but that for @samp{b} is fully bracketed.
2679
2680 @smallexample
2681 int a[2][2] = @{ 0, 1, 2, 3 @};
2682 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2683 @end smallexample
2684
2685 This warning is enabled by @option{-Wall}.
2686
2687 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2688 @opindex Wmissing-include-dirs
2689 Warn if a user-supplied include directory does not exist.
2690
2691 @item -Wparentheses
2692 @opindex Wparentheses
2693 Warn if parentheses are omitted in certain contexts, such
2694 as when there is an assignment in a context where a truth value
2695 is expected, or when operators are nested whose precedence people
2696 often get confused about.
2697
2698 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2699 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2700 interpretation from that of ordinary mathematical notation.
2701
2702 Also warn about constructions where there may be confusion to which
2703 @code{if} statement an @code{else} branch belongs.  Here is an example of
2704 such a case:
2705
2706 @smallexample
2707 @group
2708 @{
2709   if (a)
2710     if (b)
2711       foo ();
2712   else
2713     bar ();
2714 @}
2715 @end group
2716 @end smallexample
2717
2718 In C/C++, every @code{else} branch belongs to the innermost possible
2719 @code{if} statement, which in this example is @code{if (b)}.  This is
2720 often not what the programmer expected, as illustrated in the above
2721 example by indentation the programmer chose.  When there is the
2722 potential for this confusion, GCC will issue a warning when this flag
2723 is specified.  To eliminate the warning, add explicit braces around
2724 the innermost @code{if} statement so there is no way the @code{else}
2725 could belong to the enclosing @code{if}.  The resulting code would
2726 look like this:
2727
2728 @smallexample
2729 @group
2730 @{
2731   if (a)
2732     @{
2733       if (b)
2734         foo ();
2735       else
2736         bar ();
2737     @}
2738 @}
2739 @end group
2740 @end smallexample
2741
2742 This warning is enabled by @option{-Wall}.
2743
2744 @item -Wsequence-point
2745 @opindex Wsequence-point
2746 Warn about code that may have undefined semantics because of violations
2747 of sequence point rules in the C and C++ standards.
2748
2749 The C and C++ standards defines the order in which expressions in a C/C++
2750 program are evaluated in terms of @dfn{sequence points}, which represent
2751 a partial ordering between the execution of parts of the program: those
2752 executed before the sequence point, and those executed after it.  These
2753 occur after the evaluation of a full expression (one which is not part
2754 of a larger expression), after the evaluation of the first operand of a
2755 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2756 function is called (but after the evaluation of its arguments and the
2757 expression denoting the called function), and in certain other places.
2758 Other than as expressed by the sequence point rules, the order of
2759 evaluation of subexpressions of an expression is not specified.  All
2760 these rules describe only a partial order rather than a total order,
2761 since, for example, if two functions are called within one expression
2762 with no sequence point between them, the order in which the functions
2763 are called is not specified.  However, the standards committee have
2764 ruled that function calls do not overlap.
2765
2766 It is not specified when between sequence points modifications to the
2767 values of objects take effect.  Programs whose behavior depends on this
2768 have undefined behavior; the C and C++ standards specify that ``Between
2769 the previous and next sequence point an object shall have its stored
2770 value modified at most once by the evaluation of an expression.  
2771 Furthermore, the prior value shall be read only to determine the value
2772 to be stored.''.  If a program breaks these rules, the results on any
2773 particular implementation are entirely unpredictable.
2774
2775 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2776 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2777 diagnosed by this option, and it may give an occasional false positive
2778 result, but in general it has been found fairly effective at detecting
2779 this sort of problem in programs.
2780
2781 The standard is worded confusingly, therefore there is some debate
2782 over the precise meaning of the sequence point rules in subtle cases.
2783 Links to discussions of the problem, including proposed formal
2784 definitions, may be found on the GCC readings page, at
2785 @w{@uref{http://gcc.gnu.org/readings.html}}.
2786
2787 This warning is enabled by @option{-Wall} for C and C++.
2788
2789 @item -Wreturn-type
2790 @opindex Wreturn-type
2791 Warn whenever a function is defined with a return-type that defaults to
2792 @code{int}.  Also warn about any @code{return} statement with no
2793 return-value in a function whose return-type is not @code{void}.
2794
2795 Also warn if the return type of a function has a type qualifier
2796 such as @code{const}.  For ISO C such a type qualifier has no effect,
2797 since the value returned by a function is not an lvalue.
2798 For C++, the warning is only emitted for scalar types or @code{void}.
2799 ISO C prohibits qualified @code{void} return types on function
2800 definitions, so such return types always receive a warning
2801 even without this option.
2802
2803 For C++, a function without return type always produces a diagnostic
2804 message, even when @option{-Wno-return-type} is specified.  The only
2805 exceptions are @samp{main} and functions defined in system headers.
2806
2807 This warning is enabled by @option{-Wall}.
2808
2809 @item -Wswitch
2810 @opindex Wswitch
2811 Warn whenever a @code{switch} statement has an index of enumerated type
2812 and lacks a @code{case} for one or more of the named codes of that
2813 enumeration.  (The presence of a @code{default} label prevents this
2814 warning.)  @code{case} labels outside the enumeration range also
2815 provoke warnings when this option is used.
2816 This warning is enabled by @option{-Wall}.
2817
2818 @item -Wswitch-default
2819 @opindex Wswitch-switch
2820 Warn whenever a @code{switch} statement does not have a @code{default}
2821 case.
2822
2823 @item -Wswitch-enum
2824 @opindex Wswitch-enum
2825 Warn whenever a @code{switch} statement has an index of enumerated type
2826 and lacks a @code{case} for one or more of the named codes of that
2827 enumeration.  @code{case} labels outside the enumeration range also
2828 provoke warnings when this option is used.
2829
2830 @item -Wtrigraphs
2831 @opindex Wtrigraphs
2832 Warn if any trigraphs are encountered that might change the meaning of
2833 the program (trigraphs within comments are not warned about).
2834 This warning is enabled by @option{-Wall}.
2835
2836 @item -Wunused-function
2837 @opindex Wunused-function
2838 Warn whenever a static function is declared but not defined or a
2839 non-inline static function is unused.
2840 This warning is enabled by @option{-Wall}.
2841
2842 @item -Wunused-label
2843 @opindex Wunused-label
2844 Warn whenever a label is declared but not used.
2845 This warning is enabled by @option{-Wall}.
2846
2847 To suppress this warning use the @samp{unused} attribute
2848 (@pxref{Variable Attributes}).
2849
2850 @item -Wunused-parameter
2851 @opindex Wunused-parameter
2852 Warn whenever a function parameter is unused aside from its declaration.
2853
2854 To suppress this warning use the @samp{unused} attribute
2855 (@pxref{Variable Attributes}).
2856
2857 @item -Wunused-variable
2858 @opindex Wunused-variable
2859 Warn whenever a local variable or non-constant static variable is unused
2860 aside from its declaration.
2861 This warning is enabled by @option{-Wall}.
2862
2863 To suppress this warning use the @samp{unused} attribute
2864 (@pxref{Variable Attributes}).
2865
2866 @item -Wunused-value
2867 @opindex Wunused-value
2868 Warn whenever a statement computes a result that is explicitly not
2869 used. To suppress this warning cast the unused expression to
2870 @samp{void}. This includes an expression-statement or the left-hand
2871 side of a comma expression that contains no side effects. For example,
2872 an expression such as @samp{x[i,j]} will cause a warning, while
2873 @samp{x[(void)i,j]} will not.
2874
2875 This warning is enabled by @option{-Wall}.
2876
2877 @item -Wunused
2878 @opindex Wunused
2879 All the above @option{-Wunused} options combined.
2880
2881 In order to get a warning about an unused function parameter, you must
2882 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2883 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2884
2885 @item -Wuninitialized
2886 @opindex Wuninitialized
2887 Warn if an automatic variable is used without first being initialized or
2888 if a variable may be clobbered by a @code{setjmp} call.
2889
2890 These warnings are possible only in optimizing compilation,
2891 because they require data flow information that is computed only
2892 when optimizing.  If you do not specify @option{-O}, you will not get
2893 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2894 requiring @option{-O}.
2895
2896 If you want to warn about code which uses the uninitialized value of the
2897 variable in its own initializer, use the @option{-Winit-self} option.
2898
2899 These warnings occur for individual uninitialized or clobbered
2900 elements of structure, union or array variables as well as for
2901 variables which are uninitialized or clobbered as a whole.  They do
2902 not occur for variables or elements declared @code{volatile}.  Because
2903 these warnings depend on optimization, the exact variables or elements
2904 for which there are warnings will depend on the precise optimization
2905 options and version of GCC used.
2906
2907 Note that there may be no warning about a variable that is used only
2908 to compute a value that itself is never used, because such
2909 computations may be deleted by data flow analysis before the warnings
2910 are printed.
2911
2912 These warnings are made optional because GCC is not smart
2913 enough to see all the reasons why the code might be correct
2914 despite appearing to have an error.  Here is one example of how
2915 this can happen:
2916
2917 @smallexample
2918 @group
2919 @{
2920   int x;
2921   switch (y)
2922     @{
2923     case 1: x = 1;
2924       break;
2925     case 2: x = 4;
2926       break;
2927     case 3: x = 5;
2928     @}
2929   foo (x);
2930 @}
2931 @end group
2932 @end smallexample
2933
2934 @noindent
2935 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2936 always initialized, but GCC doesn't know this.  Here is
2937 another common case:
2938
2939 @smallexample
2940 @{
2941   int save_y;
2942   if (change_y) save_y = y, y = new_y;
2943   @dots{}
2944   if (change_y) y = save_y;
2945 @}
2946 @end smallexample
2947
2948 @noindent
2949 This has no bug because @code{save_y} is used only if it is set.
2950
2951 @cindex @code{longjmp} warnings
2952 This option also warns when a non-volatile automatic variable might be
2953 changed by a call to @code{longjmp}.  These warnings as well are possible
2954 only in optimizing compilation.
2955
2956 The compiler sees only the calls to @code{setjmp}.  It cannot know
2957 where @code{longjmp} will be called; in fact, a signal handler could
2958 call it at any point in the code.  As a result, you may get a warning
2959 even when there is in fact no problem because @code{longjmp} cannot
2960 in fact be called at the place which would cause a problem.
2961
2962 Some spurious warnings can be avoided if you declare all the functions
2963 you use that never return as @code{noreturn}.  @xref{Function
2964 Attributes}.
2965
2966 This warning is enabled by @option{-Wall}.
2967
2968 @item -Wunknown-pragmas
2969 @opindex Wunknown-pragmas
2970 @cindex warning for unknown pragmas
2971 @cindex unknown pragmas, warning
2972 @cindex pragmas, warning of unknown
2973 Warn when a #pragma directive is encountered which is not understood by
2974 GCC@.  If this command line option is used, warnings will even be issued
2975 for unknown pragmas in system header files.  This is not the case if
2976 the warnings were only enabled by the @option{-Wall} command line option.
2977
2978 @item -Wno-pragmas
2979 @opindex Wno-pragmas
2980 @opindex Wpragmas
2981 Do not warn about misuses of pragmas, such as incorrect parameters,
2982 invalid syntax, or conflicts between pragmas.  See also
2983 @samp{-Wunknown-pragmas}.
2984
2985 @item -Wstrict-aliasing
2986 @opindex Wstrict-aliasing
2987 This option is only active when @option{-fstrict-aliasing} is active.
2988 It warns about code which might break the strict aliasing rules that the
2989 compiler is using for optimization.  The warning does not catch all
2990 cases, but does attempt to catch the more common pitfalls.  It is
2991 included in @option{-Wall}.
2992
2993 @item -Wstrict-aliasing=2
2994 @opindex Wstrict-aliasing=2
2995 This option is only active when @option{-fstrict-aliasing} is active.
2996 It warns about code which might break the strict aliasing rules that the
2997 compiler is using for optimization.  This warning catches more cases than
2998 @option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
2999 cases that are safe.
3000
3001 @item -Wstrict-overflow
3002 @item -Wstrict-overflow=@var{n}
3003 @opindex -Wstrict-overflow
3004 This option is only active when @option{-fstrict-overflow} is active.
3005 It warns about cases where the compiler optimizes based on the
3006 assumption that signed overflow does not occur.  Note that it does not
3007 warn about all cases where the code might overflow: it only warns
3008 about cases where the compiler implements some optimization.  Thus
3009 this warning depends on the optimization level.
3010
3011 An optimization which assumes that signed overflow does not occur is
3012 perfectly safe if the values of the variables involved are such that
3013 overflow never does, in fact, occur.  Therefore this warning can
3014 easily give a false positive: a warning about code which is not
3015 actually a problem.  To help focus on important issues, several
3016 warning levels are defined.
3017
3018 @table @option
3019 @item -Wstrict-overflow=1
3020 Warn about cases which are both questionable and easy to avoid.  For
3021 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3022 compiler will simplify this to @code{1}.  This level of
3023 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3024 are not, and must be explicitly requested.
3025
3026 @item -Wstrict-overflow=2
3027 Also warn about other cases where a comparison is simplified to a
3028 constant.  For example: @code{abs (x) >= 0}.  This can only be
3029 simplified when @option{-fstrict-overflow} is in effect, because
3030 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3031 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3032 @option{-Wstrict-overflow=2}.
3033
3034 @item -Wstrict-overflow=3
3035 Also warn about other cases where a comparison is simplified.  For
3036 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3037
3038 @item -Wstrict-overflow=4
3039 Also warn about other simplifications not covered by the above cases.
3040 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3041
3042 @item -Wstrict-overflow=5
3043 Also warn about cases where the compiler reduces the magnitude of a
3044 constant involved in a comparison.  For example: @code{x + 2 > y} will
3045 be simplified to @code{x + 1 >= y}.  This is reported only at the
3046 highest warning level because this simplification applies to many
3047 comparisons, so this warning level will give a very large number of
3048 false positives.
3049 @end table
3050
3051 @item -Warray-bounds
3052 @opindex Wno-array-bounds
3053 @opindex Warray-bounds
3054 This option is only active when @option{-ftree-vrp} is active
3055 (default for -O2 and above). It warns about subscripts to arrays
3056 that are always out of bounds. This warning is enabled by @option{-Wall}.
3057
3058 @item -Wall
3059 @opindex Wall
3060 All of the above @samp{-W} options combined.  This enables all the
3061 warnings about constructions that some users consider questionable, and
3062 that are easy to avoid (or modify to prevent the warning), even in
3063 conjunction with macros.  This also enables some language-specific
3064 warnings described in @ref{C++ Dialect Options} and
3065 @ref{Objective-C and Objective-C++ Dialect Options}.
3066 @end table
3067
3068 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
3069 Some of them warn about constructions that users generally do not
3070 consider questionable, but which occasionally you might wish to check
3071 for; others warn about constructions that are necessary or hard to avoid
3072 in some cases, and there is no simple way to modify the code to suppress
3073 the warning.
3074
3075 @table @gcctabopt
3076 @item -Wextra
3077 @opindex W
3078 @opindex Wextra
3079 (This option used to be called @option{-W}.  The older name is still
3080 supported, but the newer name is more descriptive.)  Print extra warning
3081 messages for these events:
3082
3083 @itemize @bullet
3084 @item
3085 A function can return either with or without a value.  (Falling
3086 off the end of the function body is considered returning without
3087 a value.)  For example, this function would evoke such a
3088 warning:
3089
3090 @smallexample
3091 @group
3092 foo (a)
3093 @{
3094   if (a > 0)
3095     return a;
3096 @}
3097 @end group
3098 @end smallexample
3099
3100 @item
3101 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
3102
3103 @item @r{(C only)}
3104 Storage-class specifiers like @code{static} are not the first things
3105 in a declaration.  According to the C Standard, this usage is
3106 obsolescent.  This warning can be independently controlled by
3107 @option{-Wold-style-declaration}.
3108
3109 @item
3110 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
3111 arguments.
3112
3113 @item
3114 A comparison between signed and unsigned values could produce an
3115 incorrect result when the signed value is converted to unsigned.
3116 (But don't warn if @option{-Wno-sign-compare} is also specified.)
3117
3118 @item
3119 An aggregate has an initializer which does not initialize all members.
3120 This warning can be independently controlled by
3121 @option{-Wmissing-field-initializers}.
3122
3123 @item
3124 An initialized field without side effects is overridden when using
3125 designated initializers (@pxref{Designated Inits, , Designated
3126 Initializers}).  This warning can be independently controlled by
3127 @option{-Woverride-init}.
3128
3129 @item @r{(C only)}
3130 A function parameter is declared without a type specifier in K&R-style
3131 functions.  This warning can be independently controlled by
3132 @option{-Wmissing-parameter-type}.
3133
3134 @item
3135 An empty body occurs in an @samp{if} or @samp{else} statement. This
3136 warning can be independently controlled by @option{-Wempty-body}.
3137
3138 @item
3139 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3140 @samp{>}, or @samp{>=}.
3141
3142 @item
3143 A variable might be changed by @samp{longjmp} or @samp{vfork}.
3144 This warning can be independently controlled by @option{-Wclobbered}.
3145
3146 @item @r{(C++ only)}
3147 An enumerator and a non-enumerator both appear in a conditional expression.
3148
3149 @item @r{(C++ only)}
3150 A non-static reference or non-static @samp{const} member appears in a
3151 class without constructors.
3152
3153 @item @r{(C++ only)}
3154 Ambiguous virtual bases.
3155
3156 @item @r{(C++ only)}
3157 Subscripting an array which has been declared @samp{register}.
3158
3159 @item @r{(C++ only)}
3160 Taking the address of a variable which has been declared @samp{register}.
3161
3162 @item @r{(C++ only)}
3163 A base class is not initialized in a derived class' copy constructor.
3164 @end itemize
3165
3166 @item -Wno-div-by-zero
3167 @opindex Wno-div-by-zero
3168 @opindex Wdiv-by-zero
3169 Do not warn about compile-time integer division by zero.  Floating point
3170 division by zero is not warned about, as it can be a legitimate way of
3171 obtaining infinities and NaNs.
3172
3173 @item -Wsystem-headers
3174 @opindex Wsystem-headers
3175 @cindex warnings from system headers
3176 @cindex system headers, warnings from
3177 Print warning messages for constructs found in system header files.
3178 Warnings from system headers are normally suppressed, on the assumption
3179 that they usually do not indicate real problems and would only make the
3180 compiler output harder to read.  Using this command line option tells
3181 GCC to emit warnings from system headers as if they occurred in user
3182 code.  However, note that using @option{-Wall} in conjunction with this
3183 option will @emph{not} warn about unknown pragmas in system
3184 headers---for that, @option{-Wunknown-pragmas} must also be used.
3185
3186 @item -Wfloat-equal
3187 @opindex Wfloat-equal
3188 Warn if floating point values are used in equality comparisons.
3189
3190 The idea behind this is that sometimes it is convenient (for the
3191 programmer) to consider floating-point values as approximations to
3192 infinitely precise real numbers.  If you are doing this, then you need
3193 to compute (by analyzing the code, or in some other way) the maximum or
3194 likely maximum error that the computation introduces, and allow for it
3195 when performing comparisons (and when producing output, but that's a
3196 different problem).  In particular, instead of testing for equality, you
3197 would check to see whether the two values have ranges that overlap; and
3198 this is done with the relational operators, so equality comparisons are
3199 probably mistaken.
3200
3201 @item -Wtraditional @r{(C only)}
3202 @opindex Wtraditional
3203 Warn about certain constructs that behave differently in traditional and
3204 ISO C@.  Also warn about ISO C constructs that have no traditional C
3205 equivalent, and/or problematic constructs which should be avoided.
3206
3207 @itemize @bullet
3208 @item
3209 Macro parameters that appear within string literals in the macro body.
3210 In traditional C macro replacement takes place within string literals,
3211 but does not in ISO C@.
3212
3213 @item
3214 In traditional C, some preprocessor directives did not exist.
3215 Traditional preprocessors would only consider a line to be a directive
3216 if the @samp{#} appeared in column 1 on the line.  Therefore
3217 @option{-Wtraditional} warns about directives that traditional C
3218 understands but would ignore because the @samp{#} does not appear as the
3219 first character on the line.  It also suggests you hide directives like
3220 @samp{#pragma} not understood by traditional C by indenting them.  Some
3221 traditional implementations would not recognize @samp{#elif}, so it
3222 suggests avoiding it altogether.
3223
3224 @item
3225 A function-like macro that appears without arguments.
3226
3227 @item
3228 The unary plus operator.
3229
3230 @item
3231 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3232 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3233 constants.)  Note, these suffixes appear in macros defined in the system
3234 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3235 Use of these macros in user code might normally lead to spurious
3236 warnings, however GCC's integrated preprocessor has enough context to
3237 avoid warning in these cases.
3238
3239 @item
3240 A function declared external in one block and then used after the end of
3241 the block.
3242
3243 @item
3244 A @code{switch} statement has an operand of type @code{long}.
3245
3246 @item
3247 A non-@code{static} function declaration follows a @code{static} one.
3248 This construct is not accepted by some traditional C compilers.
3249
3250 @item
3251 The ISO type of an integer constant has a different width or
3252 signedness from its traditional type.  This warning is only issued if
3253 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3254 typically represent bit patterns, are not warned about.
3255
3256 @item
3257 Usage of ISO string concatenation is detected.
3258
3259 @item
3260 Initialization of automatic aggregates.
3261
3262 @item
3263 Identifier conflicts with labels.  Traditional C lacks a separate
3264 namespace for labels.
3265
3266 @item
3267 Initialization of unions.  If the initializer is zero, the warning is
3268 omitted.  This is done under the assumption that the zero initializer in
3269 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3270 initializer warnings and relies on default initialization to zero in the
3271 traditional C case.
3272
3273 @item
3274 Conversions by prototypes between fixed/floating point values and vice
3275 versa.  The absence of these prototypes when compiling with traditional
3276 C would cause serious problems.  This is a subset of the possible
3277 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3278
3279 @item
3280 Use of ISO C style function definitions.  This warning intentionally is
3281 @emph{not} issued for prototype declarations or variadic functions
3282 because these ISO C features will appear in your code when using
3283 libiberty's traditional C compatibility macros, @code{PARAMS} and
3284 @code{VPARAMS}.  This warning is also bypassed for nested functions
3285 because that feature is already a GCC extension and thus not relevant to
3286 traditional C compatibility.
3287 @end itemize
3288
3289 @item -Wtraditional-conversion @r{(C only)}
3290 @opindex Wtraditional-conversion
3291 Warn if a prototype causes a type conversion that is different from what
3292 would happen to the same argument in the absence of a prototype.  This
3293 includes conversions of fixed point to floating and vice versa, and
3294 conversions changing the width or signedness of a fixed point argument
3295 except when the same as the default promotion.
3296
3297 @item -Wdeclaration-after-statement @r{(C only)}
3298 @opindex Wdeclaration-after-statement
3299 Warn when a declaration is found after a statement in a block.  This
3300 construct, known from C++, was introduced with ISO C99 and is by default
3301 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3302 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3303
3304 @item -Wundef
3305 @opindex Wundef
3306 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3307
3308 @item -Wno-endif-labels
3309 @opindex Wno-endif-labels
3310 @opindex Wendif-labels
3311 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3312
3313 @item -Wshadow
3314 @opindex Wshadow
3315 Warn whenever a local variable shadows another local variable, parameter or
3316 global variable or whenever a built-in function is shadowed.
3317
3318 @item -Wlarger-than-@var{len}
3319 @opindex Wlarger-than
3320 Warn whenever an object of larger than @var{len} bytes is defined.
3321
3322 @item -Wunsafe-loop-optimizations
3323 @opindex Wunsafe-loop-optimizations
3324 Warn if the loop cannot be optimized because the compiler could not
3325 assume anything on the bounds of the loop indices.  With
3326 @option{-funsafe-loop-optimizations} warn if the compiler made
3327 such assumptions.
3328
3329 @item -Wpointer-arith
3330 @opindex Wpointer-arith
3331 Warn about anything that depends on the ``size of'' a function type or
3332 of @code{void}.  GNU C assigns these types a size of 1, for
3333 convenience in calculations with @code{void *} pointers and pointers
3334 to functions.  In C++, warn also when an arithmetic operation involves
3335 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3336
3337 @item -Wbad-function-cast @r{(C only)}
3338 @opindex Wbad-function-cast
3339 Warn whenever a function call is cast to a non-matching type.
3340 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3341
3342 @item -Wc++-compat
3343 Warn about ISO C constructs that are outside of the common subset of
3344 ISO C and ISO C++, e.g.@: request for implicit conversion from
3345 @code{void *} to a pointer to non-@code{void} type.
3346
3347 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3348 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3349 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords 
3350 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3351
3352 @item -Wcast-qual
3353 @opindex Wcast-qual
3354 Warn whenever a pointer is cast so as to remove a type qualifier from
3355 the target type.  For example, warn if a @code{const char *} is cast
3356 to an ordinary @code{char *}.
3357
3358 @item -Wcast-align
3359 @opindex Wcast-align
3360 Warn whenever a pointer is cast such that the required alignment of the
3361 target is increased.  For example, warn if a @code{char *} is cast to
3362 an @code{int *} on machines where integers can only be accessed at
3363 two- or four-byte boundaries.
3364
3365 @item -Wwrite-strings
3366 @opindex Wwrite-strings
3367 When compiling C, give string constants the type @code{const
3368 char[@var{length}]} so that
3369 copying the address of one into a non-@code{const} @code{char *}
3370 pointer will get a warning; when compiling C++, warn about the
3371 deprecated conversion from string literals to @code{char *}.  This
3372 warning, by default, is enabled for C++ programs.
3373 These warnings will help you find at
3374 compile time code that can try to write into a string constant, but
3375 only if you have been very careful about using @code{const} in
3376 declarations and prototypes.  Otherwise, it will just be a nuisance;
3377 this is why we did not make @option{-Wall} request these warnings.
3378
3379 @item -Wclobbered
3380 @opindex Wclobbered
3381 Warn for variables that might be changed by @samp{longjmp} or
3382 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3383
3384 @item -Wconversion
3385 @opindex Wconversion
3386 Warn for implicit conversions that may alter a value. This includes
3387 conversions between real and integer, like @code{abs (x)} when
3388 @code{x} is @code{double}; conversions between signed and unsigned,
3389 like @code{unsigned ui = -1}; and conversions to smaller types, like
3390 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3391 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3392 changed by the conversion like in @code{abs (2.0)}.
3393
3394 @item -Wempty-body
3395 @opindex Wempty-body
3396 An empty body occurs in an @samp{if} or @samp{else} statement. 
3397 This warning is also enabled by @option{-Wextra}.
3398
3399 @item -Wsign-compare
3400 @opindex Wsign-compare
3401 @cindex warning for comparison of signed and unsigned values
3402 @cindex comparison of signed and unsigned values, warning
3403 @cindex signed and unsigned values, comparison warning
3404 Warn when a comparison between signed and unsigned values could produce
3405 an incorrect result when the signed value is converted to unsigned.
3406 This warning is also enabled by @option{-Wextra}; to get the other warnings
3407 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3408
3409 @item -Waddress
3410 @opindex Waddress
3411 @opindex Wno-address
3412 Warn about suspicious uses of memory addresses. These include using
3413 the address of a function in a conditional expression, such as
3414 @code{void func(void); if (func)}, and comparisons against the memory
3415 address of a string literal, such as @code{if (x == "abc")}.  Such
3416 uses typically indicate a programmer error: the address of a function
3417 always evaluates to true, so their use in a conditional usually
3418 indicate that the programmer forgot the parentheses in a function
3419 call; and comparisons against string literals result in unspecified
3420 behavior and are not portable in C, so they usually indicate that the
3421 programmer intended to use @code{strcmp}.  This warning is enabled by
3422 @option{-Wall}.
3423
3424 @item -Wlogical-op
3425 @opindex Wlogical-op
3426 @opindex Wno-logical-op
3427 Warn about suspicious uses of logical operators in expressions.
3428 This includes using logical operators in contexts where a
3429 bit-wise operator is likely to be expected.
3430
3431 @item -Waggregate-return
3432 @opindex Waggregate-return
3433 Warn if any functions that return structures or unions are defined or
3434 called.  (In languages where you can return an array, this also elicits
3435 a warning.)
3436
3437 @item -Wno-attributes
3438 @opindex Wno-attributes
3439 @opindex Wattributes
3440 Do not warn if an unexpected @code{__attribute__} is used, such as
3441 unrecognized attributes, function attributes applied to variables,
3442 etc.  This will not stop errors for incorrect use of supported
3443 attributes.
3444
3445 @item -Wstrict-prototypes @r{(C only)}
3446 @opindex Wstrict-prototypes
3447 Warn if a function is declared or defined without specifying the
3448 argument types.  (An old-style function definition is permitted without
3449 a warning if preceded by a declaration which specifies the argument
3450 types.)
3451
3452 @item -Wold-style-declaration @r{(C only)}
3453 @opindex Wold-style-declaration
3454 Warn for obsolescent usages, according to the C Standard, in a
3455 declaration. For example, warn if storage-class specifiers like
3456 @code{static} are not the first things in a declaration.  This warning
3457 is also enabled by @option{-Wextra}.
3458
3459 @item -Wold-style-definition @r{(C only)}
3460 @opindex Wold-style-definition
3461 Warn if an old-style function definition is used.  A warning is given
3462 even if there is a previous prototype.
3463
3464 @item -Wmissing-parameter-type @r{(C only)}
3465 @opindex Wmissing-parameter-type
3466 A function parameter is declared without a type specifier in K&R-style
3467 functions:
3468
3469 @smallexample
3470 void foo(bar) @{ @}
3471 @end smallexample
3472
3473 This warning is also enabled by @option{-Wextra}.
3474
3475 @item -Wmissing-prototypes @r{(C only)}
3476 @opindex Wmissing-prototypes
3477 Warn if a global function is defined without a previous prototype
3478 declaration.  This warning is issued even if the definition itself
3479 provides a prototype.  The aim is to detect global functions that fail
3480 to be declared in header files.
3481
3482 @item -Wmissing-declarations @r{(C and C++ only)}
3483 @opindex Wmissing-declarations
3484 Warn if a global function is defined without a previous declaration.
3485 Do so even if the definition itself provides a prototype.
3486 Use this option to detect global functions that are not declared in
3487 header files.  In C++, no warnings are issued for function templates,
3488 or for inline functions, or for functions in anonymous namespaces.
3489
3490 @item -Wmissing-field-initializers
3491 @opindex Wmissing-field-initializers
3492 @opindex W
3493 @opindex Wextra
3494 Warn if a structure's initializer has some fields missing.  For
3495 example, the following code would cause such a warning, because
3496 @code{x.h} is implicitly zero:
3497
3498 @smallexample
3499 struct s @{ int f, g, h; @};
3500 struct s x = @{ 3, 4 @};
3501 @end smallexample
3502
3503 This option does not warn about designated initializers, so the following
3504 modification would not trigger a warning:
3505
3506 @smallexample
3507 struct s @{ int f, g, h; @};
3508 struct s x = @{ .f = 3, .g = 4 @};
3509 @end smallexample
3510
3511 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3512 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3513
3514 @item -Wmissing-noreturn
3515 @opindex Wmissing-noreturn
3516 Warn about functions which might be candidates for attribute @code{noreturn}.
3517 Note these are only possible candidates, not absolute ones.  Care should
3518 be taken to manually verify functions actually do not ever return before
3519 adding the @code{noreturn} attribute, otherwise subtle code generation
3520 bugs could be introduced.  You will not get a warning for @code{main} in
3521 hosted C environments.
3522
3523 @item -Wmissing-format-attribute
3524 @opindex Wmissing-format-attribute
3525 @opindex Wformat
3526 Warn about function pointers which might be candidates for @code{format}
3527 attributes.  Note these are only possible candidates, not absolute ones.
3528 GCC will guess that function pointers with @code{format} attributes that
3529 are used in assignment, initialization, parameter passing or return
3530 statements should have a corresponding @code{format} attribute in the
3531 resulting type.  I.e.@: the left-hand side of the assignment or
3532 initialization, the type of the parameter variable, or the return type
3533 of the containing function respectively should also have a @code{format}
3534 attribute to avoid the warning.
3535
3536 GCC will also warn about function definitions which might be
3537 candidates for @code{format} attributes.  Again, these are only
3538 possible candidates.  GCC will guess that @code{format} attributes
3539 might be appropriate for any function that calls a function like
3540 @code{vprintf} or @code{vscanf}, but this might not always be the
3541 case, and some functions for which @code{format} attributes are
3542 appropriate may not be detected.
3543
3544 @item -Wno-multichar
3545 @opindex Wno-multichar
3546 @opindex Wmultichar
3547 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3548 Usually they indicate a typo in the user's code, as they have
3549 implementation-defined values, and should not be used in portable code.
3550
3551 @item -Wnormalized=<none|id|nfc|nfkc>
3552 @opindex Wnormalized
3553 @cindex NFC
3554 @cindex NFKC
3555 @cindex character set, input normalization
3556 In ISO C and ISO C++, two identifiers are different if they are
3557 different sequences of characters.  However, sometimes when characters
3558 outside the basic ASCII character set are used, you can have two
3559 different character sequences that look the same.  To avoid confusion,
3560 the ISO 10646 standard sets out some @dfn{normalization rules} which
3561 when applied ensure that two sequences that look the same are turned into
3562 the same sequence.  GCC can warn you if you are using identifiers which
3563 have not been normalized; this option controls that warning.
3564
3565 There are four levels of warning that GCC supports.  The default is
3566 @option{-Wnormalized=nfc}, which warns about any identifier which is
3567 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3568 recommended form for most uses.
3569
3570 Unfortunately, there are some characters which ISO C and ISO C++ allow
3571 in identifiers that when turned into NFC aren't allowable as
3572 identifiers.  That is, there's no way to use these symbols in portable
3573 ISO C or C++ and have all your identifiers in NFC.
3574 @option{-Wnormalized=id} suppresses the warning for these characters.
3575 It is hoped that future versions of the standards involved will correct
3576 this, which is why this option is not the default.
3577
3578 You can switch the warning off for all characters by writing
3579 @option{-Wnormalized=none}.  You would only want to do this if you
3580 were using some other normalization scheme (like ``D''), because
3581 otherwise you can easily create bugs that are literally impossible to see.
3582
3583 Some characters in ISO 10646 have distinct meanings but look identical
3584 in some fonts or display methodologies, especially once formatting has
3585 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3586 LETTER N'', will display just like a regular @code{n} which has been
3587 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3588 normalization scheme to convert all these into a standard form as
3589 well, and GCC will warn if your code is not in NFKC if you use
3590 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3591 about every identifier that contains the letter O because it might be
3592 confused with the digit 0, and so is not the default, but may be
3593 useful as a local coding convention if the programming environment is
3594 unable to be fixed to display these characters distinctly.
3595
3596 @item -Wno-deprecated-declarations
3597 @opindex Wno-deprecated-declarations
3598 Do not warn about uses of functions (@pxref{Function Attributes}),
3599 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3600 Attributes}) marked as deprecated by using the @code{deprecated}
3601 attribute.
3602
3603 @item -Wno-overflow
3604 @opindex Wno-overflow
3605 Do not warn about compile-time overflow in constant expressions.
3606
3607 @item -Woverride-init
3608 @opindex Woverride-init
3609 @opindex W
3610 @opindex Wextra
3611 Warn if an initialized field without side effects is overridden when
3612 using designated initializers (@pxref{Designated Inits, , Designated
3613 Initializers}).
3614
3615 This warning is included in @option{-Wextra}.  To get other
3616 @option{-Wextra} warnings without this one, use @samp{-Wextra
3617 -Wno-override-init}.
3618
3619 @item -Wpacked
3620 @opindex Wpacked
3621 Warn if a structure is given the packed attribute, but the packed
3622 attribute has no effect on the layout or size of the structure.
3623 Such structures may be mis-aligned for little benefit.  For
3624 instance, in this code, the variable @code{f.x} in @code{struct bar}
3625 will be misaligned even though @code{struct bar} does not itself
3626 have the packed attribute:
3627
3628 @smallexample
3629 @group
3630 struct foo @{
3631   int x;
3632   char a, b, c, d;
3633 @} __attribute__((packed));
3634 struct bar @{
3635   char z;
3636   struct foo f;
3637 @};
3638 @end group
3639 @end smallexample
3640
3641 @item -Wpadded
3642 @opindex Wpadded
3643 Warn if padding is included in a structure, either to align an element
3644 of the structure or to align the whole structure.  Sometimes when this
3645 happens it is possible to rearrange the fields of the structure to
3646 reduce the padding and so make the structure smaller.
3647
3648 @item -Wredundant-decls
3649 @opindex Wredundant-decls
3650 Warn if anything is declared more than once in the same scope, even in
3651 cases where multiple declaration is valid and changes nothing.
3652
3653 @item -Wnested-externs @r{(C only)}
3654 @opindex Wnested-externs
3655 Warn if an @code{extern} declaration is encountered within a function.
3656
3657 @item -Wunreachable-code
3658 @opindex Wunreachable-code
3659 Warn if the compiler detects that code will never be executed.
3660
3661 This option is intended to warn when the compiler detects that at
3662 least a whole line of source code will never be executed, because
3663 some condition is never satisfied or because it is after a
3664 procedure that never returns.
3665
3666 It is possible for this option to produce a warning even though there
3667 are circumstances under which part of the affected line can be executed,
3668 so care should be taken when removing apparently-unreachable code.
3669
3670 For instance, when a function is inlined, a warning may mean that the
3671 line is unreachable in only one inlined copy of the function.
3672
3673 This option is not made part of @option{-Wall} because in a debugging
3674 version of a program there is often substantial code which checks
3675 correct functioning of the program and is, hopefully, unreachable
3676 because the program does work.  Another common use of unreachable
3677 code is to provide behavior which is selectable at compile-time.
3678
3679 @item -Winline
3680 @opindex Winline
3681 Warn if a function can not be inlined and it was declared as inline.
3682 Even with this option, the compiler will not warn about failures to
3683 inline functions declared in system headers.
3684
3685 The compiler uses a variety of heuristics to determine whether or not
3686 to inline a function.  For example, the compiler takes into account
3687 the size of the function being inlined and the amount of inlining
3688 that has already been done in the current function.  Therefore,
3689 seemingly insignificant changes in the source program can cause the
3690 warnings produced by @option{-Winline} to appear or disappear.
3691
3692 @item -Wno-invalid-offsetof @r{(C++ only)}
3693 @opindex Wno-invalid-offsetof
3694 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3695 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3696 to a non-POD type is undefined.  In existing C++ implementations,
3697 however, @samp{offsetof} typically gives meaningful results even when
3698 applied to certain kinds of non-POD types. (Such as a simple
3699 @samp{struct} that fails to be a POD type only by virtue of having a
3700 constructor.)  This flag is for users who are aware that they are
3701 writing nonportable code and who have deliberately chosen to ignore the
3702 warning about it.
3703
3704 The restrictions on @samp{offsetof} may be relaxed in a future version
3705 of the C++ standard.
3706
3707 @item -Wno-int-to-pointer-cast @r{(C only)}
3708 @opindex Wno-int-to-pointer-cast
3709 Suppress warnings from casts to pointer type of an integer of a
3710 different size.
3711
3712 @item -Wno-pointer-to-int-cast @r{(C only)}
3713 @opindex Wno-pointer-to-int-cast
3714 Suppress warnings from casts from a pointer to an integer type of a
3715 different size.
3716
3717 @item -Winvalid-pch
3718 @opindex Winvalid-pch
3719 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3720 the search path but can't be used.
3721
3722 @item -Wlong-long
3723 @opindex Wlong-long
3724 @opindex Wno-long-long
3725 Warn if @samp{long long} type is used.  This is default.  To inhibit
3726 the warning messages, use @option{-Wno-long-long}.  Flags
3727 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3728 only when @option{-pedantic} flag is used.
3729
3730 @item -Wvariadic-macros
3731 @opindex Wvariadic-macros
3732 @opindex Wno-variadic-macros
3733 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3734 alternate syntax when in pedantic ISO C99 mode.  This is default.
3735 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3736
3737 @item -Wvla
3738 @opindex Wvla
3739 @opindex Wno-vla
3740 Warn if variable length array is used in the code.
3741 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
3742 the variable length array.
3743
3744 @item -Wvolatile-register-var
3745 @opindex Wvolatile-register-var
3746 @opindex Wno-volatile-register-var
3747 Warn if a register variable is declared volatile.  The volatile
3748 modifier does not inhibit all optimizations that may eliminate reads
3749 and/or writes to register variables.
3750
3751 @item -Wdisabled-optimization
3752 @opindex Wdisabled-optimization
3753 Warn if a requested optimization pass is disabled.  This warning does
3754 not generally indicate that there is anything wrong with your code; it
3755 merely indicates that GCC's optimizers were unable to handle the code
3756 effectively.  Often, the problem is that your code is too big or too
3757 complex; GCC will refuse to optimize programs when the optimization
3758 itself is likely to take inordinate amounts of time.
3759
3760 @item -Wpointer-sign
3761 @opindex Wpointer-sign
3762 @opindex Wno-pointer-sign
3763 Warn for pointer argument passing or assignment with different signedness.
3764 This option is only supported for C and Objective-C@.  It is implied by
3765 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3766 @option{-Wno-pointer-sign}.
3767
3768 @item -Werror
3769 @opindex Werror
3770 Make all warnings into errors.
3771
3772 @item -Werror=
3773 @opindex Werror=
3774 Make the specified warning into an errors.  The specifier for a
3775 warning is appended, for example @option{-Werror=switch} turns the
3776 warnings controlled by @option{-Wswitch} into errors.  This switch
3777 takes a negative form, to be used to negate @option{-Werror} for
3778 specific warnings, for example @option{-Wno-error=switch} makes
3779 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3780 is in effect.  You can use the @option{-fdiagnostics-show-option}
3781 option to have each controllable warning amended with the option which
3782 controls it, to determine what to use with this option.
3783
3784 Note that specifying @option{-Werror=}@var{foo} automatically implies
3785 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3786 imply anything.
3787
3788 @item -Wstack-protector
3789 @opindex Wstack-protector
3790 This option is only active when @option{-fstack-protector} is active.  It
3791 warns about functions that will not be protected against stack smashing.
3792
3793 @item -Woverlength-strings
3794 @opindex Woverlength-strings
3795 Warn about string constants which are longer than the ``minimum
3796 maximum'' length specified in the C standard.  Modern compilers
3797 generally allow string constants which are much longer than the
3798 standard's minimum limit, but very portable programs should avoid
3799 using longer strings.
3800
3801 The limit applies @emph{after} string constant concatenation, and does
3802 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3803 C99, it was raised to 4095.  C++98 does not specify a normative
3804 minimum maximum, so we do not diagnose overlength strings in C++@.
3805
3806 This option is implied by @option{-pedantic}, and can be disabled with
3807 @option{-Wno-overlength-strings}.
3808 @end table
3809
3810 @node Debugging Options
3811 @section Options for Debugging Your Program or GCC
3812 @cindex options, debugging
3813 @cindex debugging information options
3814
3815 GCC has various special options that are used for debugging
3816 either your program or GCC:
3817
3818 @table @gcctabopt
3819 @item -g
3820 @opindex g
3821 Produce debugging information in the operating system's native format
3822 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3823 information.
3824
3825 On most systems that use stabs format, @option{-g} enables use of extra
3826 debugging information that only GDB can use; this extra information
3827 makes debugging work better in GDB but will probably make other debuggers
3828 crash or
3829 refuse to read the program.  If you want to control for certain whether
3830 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3831 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3832
3833 GCC allows you to use @option{-g} with
3834 @option{-O}.  The shortcuts taken by optimized code may occasionally
3835 produce surprising results: some variables you declared may not exist
3836 at all; flow of control may briefly move where you did not expect it;
3837 some statements may not be executed because they compute constant
3838 results or their values were already at hand; some statements may
3839 execute in different places because they were moved out of loops.
3840
3841 Nevertheless it proves possible to debug optimized output.  This makes
3842 it reasonable to use the optimizer for programs that might have bugs.
3843
3844 The following options are useful when GCC is generated with the
3845 capability for more than one debugging format.
3846
3847 @item -ggdb
3848 @opindex ggdb
3849 Produce debugging information for use by GDB@.  This means to use the
3850 most expressive format available (DWARF 2, stabs, or the native format
3851 if neither of those are supported), including GDB extensions if at all
3852 possible.
3853
3854 @item -gstabs
3855 @opindex gstabs
3856 Produce debugging information in stabs format (if that is supported),
3857 without GDB extensions.  This is the format used by DBX on most BSD
3858 systems.  On MIPS, Alpha and System V Release 4 systems this option
3859 produces stabs debugging output which is not understood by DBX or SDB@.
3860 On System V Release 4 systems this option requires the GNU assembler.
3861
3862 @item -feliminate-unused-debug-symbols
3863 @opindex feliminate-unused-debug-symbols
3864 Produce debugging information in stabs format (if that is supported),
3865 for only symbols that are actually used.
3866
3867 @item -femit-class-debug-always
3868 Instead of emitting debugging information for a C++ class in only one
3869 object file, emit it in all object files using the class.  This option
3870 should be used only with debuggers that are unable to handle the way GCC
3871 normally emits debugging information for classes because using this
3872 option will increase the size of debugging information by as much as a
3873 factor of two.
3874
3875 @item -gstabs+
3876 @opindex gstabs+
3877 Produce debugging information in stabs format (if that is supported),
3878 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3879 use of these extensions is likely to make other debuggers crash or
3880 refuse to read the program.
3881
3882 @item -gcoff
3883 @opindex gcoff
3884 Produce debugging information in COFF format (if that is supported).
3885 This is the format used by SDB on most System V systems prior to
3886 System V Release 4.
3887
3888 @item -gxcoff
3889 @opindex gxcoff
3890 Produce debugging information in XCOFF format (if that is supported).
3891 This is the format used by the DBX debugger on IBM RS/6000 systems.
3892
3893 @item -gxcoff+
3894 @opindex gxcoff+
3895 Produce debugging information in XCOFF format (if that is supported),
3896 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3897 use of these extensions is likely to make other debuggers crash or
3898 refuse to read the program, and may cause assemblers other than the GNU
3899 assembler (GAS) to fail with an error.
3900
3901 @item -gdwarf-2
3902 @opindex gdwarf-2
3903 Produce debugging information in DWARF version 2 format (if that is
3904 supported).  This is the format used by DBX on IRIX 6.  With this
3905 option, GCC uses features of DWARF version 3 when they are useful;
3906 version 3 is upward compatible with version 2, but may still cause
3907 problems for older debuggers.
3908
3909 @item -gvms
3910 @opindex gvms
3911 Produce debugging information in VMS debug format (if that is
3912 supported).  This is the format used by DEBUG on VMS systems.
3913
3914 @item -g@var{level}
3915 @itemx -ggdb@var{level}
3916 @itemx -gstabs@var{level}
3917 @itemx -gcoff@var{level}
3918 @itemx -gxcoff@var{level}
3919 @itemx -gvms@var{level}
3920 Request debugging information and also use @var{level} to specify how
3921 much information.  The default level is 2.
3922
3923 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
3924 @option{-g}.
3925
3926 Level 1 produces minimal information, enough for making backtraces in
3927 parts of the program that you don't plan to debug.  This includes
3928 descriptions of functions and external variables, but no information
3929 about local variables and no line numbers.
3930
3931 Level 3 includes extra information, such as all the macro definitions
3932 present in the program.  Some debuggers support macro expansion when
3933 you use @option{-g3}.
3934
3935 @option{-gdwarf-2} does not accept a concatenated debug level, because
3936 GCC used to support an option @option{-gdwarf} that meant to generate
3937 debug information in version 1 of the DWARF format (which is very
3938 different from version 2), and it would have been too confusing.  That
3939 debug format is long obsolete, but the option cannot be changed now.
3940 Instead use an additional @option{-g@var{level}} option to change the
3941 debug level for DWARF2.
3942
3943 @item -feliminate-dwarf2-dups
3944 @opindex feliminate-dwarf2-dups
3945 Compress DWARF2 debugging information by eliminating duplicated
3946 information about each symbol.  This option only makes sense when
3947 generating DWARF2 debugging information with @option{-gdwarf-2}.
3948
3949 @cindex @command{prof}
3950 @item -p
3951 @opindex p
3952 Generate extra code to write profile information suitable for the
3953 analysis program @command{prof}.  You must use this option when compiling
3954 the source files you want data about, and you must also use it when
3955 linking.
3956
3957 @cindex @command{gprof}
3958 @item -pg
3959 @opindex pg
3960 Generate extra code to write profile information suitable for the
3961 analysis program @command{gprof}.  You must use this option when compiling
3962 the source files you want data about, and you must also use it when
3963 linking.
3964
3965 @item -Q
3966 @opindex Q
3967 Makes the compiler print out each function name as it is compiled, and
3968 print some statistics about each pass when it finishes.
3969
3970 @item -ftime-report
3971 @opindex ftime-report
3972 Makes the compiler print some statistics about the time consumed by each
3973 pass when it finishes.
3974
3975 @item -fmem-report
3976 @opindex fmem-report
3977 Makes the compiler print some statistics about permanent memory
3978 allocation when it finishes.
3979
3980 @item -fpre-ipa-mem-report
3981 @opindex fpre-ipa-mem-report
3982 @item -fpost-ipa-mem-report
3983 @opindex fpost-ipa-mem-report
3984 Makes the compiler print some statistics about permanent memory
3985 allocation before or after interprocedural optimization.
3986
3987 @item -fprofile-arcs
3988 @opindex fprofile-arcs
3989 Add code so that program flow @dfn{arcs} are instrumented.  During
3990 execution the program records how many times each branch and call is
3991 executed and how many times it is taken or returns.  When the compiled
3992 program exits it saves this data to a file called
3993 @file{@var{auxname}.gcda} for each source file.  The data may be used for
3994 profile-directed optimizations (@option{-fbranch-probabilities}), or for
3995 test coverage analysis (@option{-ftest-coverage}).  Each object file's
3996 @var{auxname} is generated from the name of the output file, if
3997 explicitly specified and it is not the final executable, otherwise it is
3998 the basename of the source file.  In both cases any suffix is removed
3999 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4000 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4001 @xref{Cross-profiling}.
4002
4003 @cindex @command{gcov}
4004 @item --coverage
4005 @opindex coverage
4006
4007 This option is used to compile and link code instrumented for coverage
4008 analysis.  The option is a synonym for @option{-fprofile-arcs}
4009 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4010 linking).  See the documentation for those options for more details.
4011
4012 @itemize
4013
4014 @item
4015 Compile the source files with @option{-fprofile-arcs} plus optimization
4016 and code generation options.  For test coverage analysis, use the
4017 additional @option{-ftest-coverage} option.  You do not need to profile
4018 every source file in a program.
4019
4020 @item
4021 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4022 (the latter implies the former).
4023
4024 @item
4025 Run the program on a representative workload to generate the arc profile
4026 information.  This may be repeated any number of times.  You can run
4027 concurrent instances of your program, and provided that the file system
4028 supports locking, the data files will be correctly updated.  Also
4029 @code{fork} calls are detected and correctly handled (double counting
4030 will not happen).
4031
4032 @item
4033 For profile-directed optimizations, compile the source files again with
4034 the same optimization and code generation options plus
4035 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4036 Control Optimization}).
4037
4038 @item
4039 For test coverage analysis, use @command{gcov} to produce human readable
4040 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4041 @command{gcov} documentation for further information.
4042
4043 @end itemize
4044
4045 With @option{-fprofile-arcs}, for each function of your program GCC
4046 creates a program flow graph, then finds a spanning tree for the graph.
4047 Only arcs that are not on the spanning tree have to be instrumented: the
4048 compiler adds code to count the number of times that these arcs are
4049 executed.  When an arc is the only exit or only entrance to a block, the
4050 instrumentation code can be added to the block; otherwise, a new basic
4051 block must be created to hold the instrumentation code.
4052
4053 @need 2000
4054 @item -ftest-coverage
4055 @opindex ftest-coverage
4056 Produce a notes file that the @command{gcov} code-coverage utility
4057 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4058 show program coverage.  Each source file's note file is called
4059 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4060 above for a description of @var{auxname} and instructions on how to
4061 generate test coverage data.  Coverage data will match the source files
4062 more closely, if you do not optimize.
4063
4064 @item -d@var{letters}
4065 @item -fdump-rtl-@var{pass}
4066 @opindex d
4067 Says to make debugging dumps during compilation at times specified by
4068 @var{letters}.    This is used for debugging the RTL-based passes of the
4069 compiler.  The file names for most of the dumps are made by appending a
4070 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4071 from the name of the output file, if explicitly specified and it is not
4072 an executable, otherwise it is the basename of the source file.
4073
4074 Most debug dumps can be enabled either passing a letter to the @option{-d}
4075 option, or with a long @option{-fdump-rtl} switch; here are the possible
4076 letters for use in @var{letters} and @var{pass}, and their meanings:
4077
4078 @table @gcctabopt
4079 @item -dA
4080 @opindex dA
4081 Annotate the assembler output with miscellaneous debugging information.
4082
4083 @item -dB
4084 @itemx -fdump-rtl-bbro
4085 @opindex dB
4086 @opindex fdump-rtl-bbro
4087 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4088
4089 @item -dc
4090 @itemx -fdump-rtl-combine
4091 @opindex dc
4092 @opindex fdump-rtl-combine
4093 Dump after the RTL instruction combination pass, to the file
4094 @file{@var{file}.129r.combine}.
4095
4096 @item -dC
4097 @itemx -fdump-rtl-ce1
4098 @itemx -fdump-rtl-ce2
4099 @opindex dC
4100 @opindex fdump-rtl-ce1
4101 @opindex fdump-rtl-ce2
4102 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4103 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4104 and @option{-fdump-rtl-ce2} enable dumping after the second if
4105 conversion, to the file @file{@var{file}.130r.ce2}.
4106
4107 @item -dd
4108 @itemx -fdump-rtl-btl
4109 @itemx -fdump-rtl-dbr
4110 @opindex dd
4111 @opindex fdump-rtl-btl
4112 @opindex fdump-rtl-dbr
4113 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4114 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4115 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4116 scheduling, to @file{@var{file}.36.dbr}.
4117
4118 @item -dD
4119 @opindex dD
4120 Dump all macro definitions, at the end of preprocessing, in addition to
4121 normal output.
4122
4123 @item -dE
4124 @itemx -fdump-rtl-ce3
4125 @opindex dE
4126 @opindex fdump-rtl-ce3
4127 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4128
4129 @item -df
4130 @itemx -fdump-rtl-cfg
4131 @itemx -fdump-rtl-life
4132 @opindex df
4133 @opindex fdump-rtl-cfg
4134 @opindex fdump-rtl-life
4135 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4136 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4137 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4138 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4139
4140 @item -dg
4141 @itemx -fdump-rtl-greg
4142 @opindex dg
4143 @opindex fdump-rtl-greg
4144 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4145
4146 @item -dG
4147 @itemx -fdump-rtl-gcse
4148 @itemx -fdump-rtl-bypass
4149 @opindex dG
4150 @opindex fdump-rtl-gcse
4151 @opindex fdump-rtl-bypass
4152 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4153 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4154 enable dumping after jump bypassing and control flow optimizations, to
4155 @file{@var{file}.115r.bypass}.
4156
4157 @item -dh
4158 @itemx -fdump-rtl-eh
4159 @opindex dh
4160 @opindex fdump-rtl-eh
4161 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4162
4163 @item -di
4164 @itemx -fdump-rtl-sibling
4165 @opindex di
4166 @opindex fdump-rtl-sibling
4167 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4168
4169 @item -dj
4170 @itemx -fdump-rtl-jump
4171 @opindex dj
4172 @opindex fdump-rtl-jump
4173 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4174
4175 @item -dk
4176 @itemx -fdump-rtl-stack
4177 @opindex dk
4178 @opindex fdump-rtl-stack
4179 Dump after conversion from GCC's "flat register file" registers to the
4180 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4181
4182 @item -dl
4183 @itemx -fdump-rtl-lreg
4184 @opindex dl
4185 @opindex fdump-rtl-lreg
4186 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4187
4188 @item -dL
4189 @itemx -fdump-rtl-loop2
4190 @opindex dL
4191 @opindex fdump-rtl-loop2
4192 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4193 loop optimization pass, to @file{@var{file}.119r.loop2},
4194 @file{@var{file}.120r.loop2_init},
4195 @file{@var{file}.121r.loop2_invariant}, and
4196 @file{@var{file}.125r.loop2_done}.
4197
4198 @item -dm
4199 @itemx -fdump-rtl-sms
4200 @opindex dm
4201 @opindex fdump-rtl-sms
4202 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4203
4204 @item -dM
4205 @itemx -fdump-rtl-mach
4206 @opindex dM
4207 @opindex fdump-rtl-mach
4208 Dump after performing the machine dependent reorganization pass, to
4209 @file{@var{file}.155r.mach}.
4210
4211 @item -dn
4212 @itemx -fdump-rtl-rnreg
4213 @opindex dn
4214 @opindex fdump-rtl-rnreg
4215 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4216
4217 @item -dN
4218 @itemx -fdump-rtl-regmove
4219 @opindex dN
4220 @opindex fdump-rtl-regmove
4221 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4222
4223 @item -do
4224 @itemx -fdump-rtl-postreload
4225 @opindex do
4226 @opindex fdump-rtl-postreload
4227 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4228
4229 @item -dr
4230 @itemx -fdump-rtl-expand
4231 @opindex dr
4232 @opindex fdump-rtl-expand
4233 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4234
4235 @item -dR
4236 @itemx -fdump-rtl-sched2
4237 @opindex dR
4238 @opindex fdump-rtl-sched2
4239 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4240
4241 @item -ds
4242 @itemx -fdump-rtl-cse
4243 @opindex ds
4244 @opindex fdump-rtl-cse
4245 Dump after CSE (including the jump optimization that sometimes follows
4246 CSE), to @file{@var{file}.113r.cse}.
4247
4248 @item -dS
4249 @itemx -fdump-rtl-sched1
4250 @opindex dS
4251 @opindex fdump-rtl-sched1
4252 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4253
4254 @item -dt
4255 @itemx -fdump-rtl-cse2
4256 @opindex dt
4257 @opindex fdump-rtl-cse2
4258 Dump after the second CSE pass (including the jump optimization that
4259 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4260
4261 @item -dT
4262 @itemx -fdump-rtl-tracer
4263 @opindex dT
4264 @opindex fdump-rtl-tracer
4265 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4266
4267 @item -dV
4268 @itemx -fdump-rtl-vpt
4269 @itemx -fdump-rtl-vartrack
4270 @opindex dV
4271 @opindex fdump-rtl-vpt
4272 @opindex fdump-rtl-vartrack
4273 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4274 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4275 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4276 to @file{@var{file}.154r.vartrack}.
4277
4278 @item -dw
4279 @itemx -fdump-rtl-flow2
4280 @opindex dw
4281 @opindex fdump-rtl-flow2
4282 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4283
4284 @item -dz
4285 @itemx -fdump-rtl-peephole2
4286 @opindex dz
4287 @opindex fdump-rtl-peephole2
4288 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4289
4290 @item -dZ
4291 @itemx -fdump-rtl-web
4292 @opindex dZ
4293 @opindex fdump-rtl-web
4294 Dump after live range splitting, to @file{@var{file}.126r.web}.
4295
4296 @item -da
4297 @itemx -fdump-rtl-all
4298 @opindex da
4299 @opindex fdump-rtl-all
4300 Produce all the dumps listed above.
4301
4302 @item -dH
4303 @opindex dH
4304 Produce a core dump whenever an error occurs.
4305
4306 @item -dm
4307 @opindex dm
4308 Print statistics on memory usage, at the end of the run, to
4309 standard error.
4310
4311 @item -dp
4312 @opindex dp
4313 Annotate the assembler output with a comment indicating which
4314 pattern and alternative was used.  The length of each instruction is
4315 also printed.
4316
4317 @item -dP
4318 @opindex dP
4319 Dump the RTL in the assembler output as a comment before each instruction.
4320 Also turns on @option{-dp} annotation.
4321
4322 @item -dv
4323 @opindex dv
4324 For each of the other indicated dump files (either with @option{-d} or
4325 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4326 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4327
4328 @item -dx
4329 @opindex dx
4330 Just generate RTL for a function instead of compiling it.  Usually used
4331 with @samp{r} (@option{-fdump-rtl-expand}).
4332
4333 @item -dy
4334 @opindex dy
4335 Dump debugging information during parsing, to standard error.
4336 @end table
4337
4338 @item -fdump-noaddr
4339 @opindex fdump-noaddr
4340 When doing debugging dumps (see @option{-d} option above), suppress
4341 address output.  This makes it more feasible to use diff on debugging
4342 dumps for compiler invocations with different compiler binaries and/or
4343 different text / bss / data / heap / stack / dso start locations.
4344
4345 @item -fdump-unnumbered
4346 @opindex fdump-unnumbered
4347 When doing debugging dumps (see @option{-d} option above), suppress instruction
4348 numbers, line number note and address output.  This makes it more feasible to
4349 use diff on debugging dumps for compiler invocations with different
4350 options, in particular with and without @option{-g}.
4351
4352 @item -fdump-translation-unit @r{(C++ only)}
4353 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4354 @opindex fdump-translation-unit
4355 Dump a representation of the tree structure for the entire translation
4356 unit to a file.  The file name is made by appending @file{.tu} to the
4357 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4358 controls the details of the dump as described for the
4359 @option{-fdump-tree} options.
4360
4361 @item -fdump-class-hierarchy @r{(C++ only)}
4362 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4363 @opindex fdump-class-hierarchy
4364 Dump a representation of each class's hierarchy and virtual function
4365 table layout to a file.  The file name is made by appending @file{.class}
4366 to the source file name.  If the @samp{-@var{options}} form is used,
4367 @var{options} controls the details of the dump as described for the
4368 @option{-fdump-tree} options.
4369
4370 @item -fdump-ipa-@var{switch}
4371 @opindex fdump-ipa
4372 Control the dumping at various stages of inter-procedural analysis
4373 language tree to a file.  The file name is generated by appending a switch
4374 specific suffix to the source file name.  The following dumps are possible:
4375
4376 @table @samp
4377 @item all
4378 Enables all inter-procedural analysis dumps; currently the only produced
4379 dump is the @samp{cgraph} dump.
4380
4381 @item cgraph
4382 Dumps information about call-graph optimization, unused function removal,
4383 and inlining decisions.
4384 @end table
4385
4386 @item -fdump-tree-@var{switch}
4387 @itemx -fdump-tree-@var{switch}-@var{options}
4388 @opindex fdump-tree
4389 Control the dumping at various stages of processing the intermediate
4390 language tree to a file.  The file name is generated by appending a switch
4391 specific suffix to the source file name.  If the @samp{-@var{options}}
4392 form is used, @var{options} is a list of @samp{-} separated options that
4393 control the details of the dump.  Not all options are applicable to all
4394 dumps, those which are not meaningful will be ignored.  The following
4395 options are available
4396
4397 @table @samp
4398 @item address
4399 Print the address of each node.  Usually this is not meaningful as it
4400 changes according to the environment and source file.  Its primary use
4401 is for tying up a dump file with a debug environment.
4402 @item slim
4403 Inhibit dumping of members of a scope or body of a function merely
4404 because that scope has been reached.  Only dump such items when they
4405 are directly reachable by some other path.  When dumping pretty-printed
4406 trees, this option inhibits dumping the bodies of control structures.
4407 @item raw
4408 Print a raw representation of the tree.  By default, trees are
4409 pretty-printed into a C-like representation.
4410 @item details
4411 Enable more detailed dumps (not honored by every dump option).
4412 @item stats
4413 Enable dumping various statistics about the pass (not honored by every dump
4414 option).
4415 @item blocks
4416 Enable showing basic block boundaries (disabled in raw dumps).
4417 @item vops
4418 Enable showing virtual operands for every statement.
4419 @item lineno
4420 Enable showing line numbers for statements.
4421 @item uid
4422 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4423 @item all
4424 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4425 @end table
4426
4427 The following tree dumps are possible:
4428 @table @samp
4429
4430 @item original
4431 Dump before any tree based optimization, to @file{@var{file}.original}.
4432
4433 @item optimized
4434 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4435
4436 @item inlined
4437 Dump after function inlining, to @file{@var{file}.inlined}.
4438
4439 @item gimple
4440 @opindex fdump-tree-gimple
4441 Dump each function before and after the gimplification pass to a file.  The
4442 file name is made by appending @file{.gimple} to the source file name.
4443
4444 @item cfg
4445 @opindex fdump-tree-cfg
4446 Dump the control flow graph of each function to a file.  The file name is
4447 made by appending @file{.cfg} to the source file name.
4448
4449 @item vcg
4450 @opindex fdump-tree-vcg
4451 Dump the control flow graph of each function to a file in VCG format.  The
4452 file name is made by appending @file{.vcg} to the source file name.  Note
4453 that if the file contains more than one function, the generated file cannot
4454 be used directly by VCG@.  You will need to cut and paste each function's
4455 graph into its own separate file first.
4456
4457 @item ch
4458 @opindex fdump-tree-ch
4459 Dump each function after copying loop headers.  The file name is made by
4460 appending @file{.ch} to the source file name.
4461
4462 @item ssa
4463 @opindex fdump-tree-ssa
4464 Dump SSA related information to a file.  The file name is made by appending
4465 @file{.ssa} to the source file name.
4466
4467 @item salias
4468 @opindex fdump-tree-salias
4469 Dump structure aliasing variable information to a file.  This file name
4470 is made by appending @file{.salias} to the source file name.
4471
4472 @item alias
4473 @opindex fdump-tree-alias
4474 Dump aliasing information for each function.  The file name is made by
4475 appending @file{.alias} to the source file name.
4476
4477 @item ccp
4478 @opindex fdump-tree-ccp
4479 Dump each function after CCP@.  The file name is made by appending
4480 @file{.ccp} to the source file name.
4481
4482 @item storeccp
4483 @opindex fdump-tree-storeccp
4484 Dump each function after STORE-CCP.  The file name is made by appending
4485 @file{.storeccp} to the source file name.
4486
4487 @item pre
4488 @opindex fdump-tree-pre
4489 Dump trees after partial redundancy elimination.  The file name is made
4490 by appending @file{.pre} to the source file name.
4491
4492 @item fre
4493 @opindex fdump-tree-fre
4494 Dump trees after full redundancy elimination.  The file name is made
4495 by appending @file{.fre} to the source file name.
4496
4497 @item copyprop
4498 @opindex fdump-tree-copyprop
4499 Dump trees after copy propagation.  The file name is made
4500 by appending @file{.copyprop} to the source file name.
4501
4502 @item store_copyprop
4503 @opindex fdump-tree-store_copyprop
4504 Dump trees after store copy-propagation.  The file name is made
4505 by appending @file{.store_copyprop} to the source file name.
4506
4507 @item dce
4508 @opindex fdump-tree-dce
4509 Dump each function after dead code elimination.  The file name is made by
4510 appending @file{.dce} to the source file name.
4511
4512 @item mudflap
4513 @opindex fdump-tree-mudflap
4514 Dump each function after adding mudflap instrumentation.  The file name is
4515 made by appending @file{.mudflap} to the source file name.
4516
4517 @item sra
4518 @opindex fdump-tree-sra
4519 Dump each function after performing scalar replacement of aggregates.  The
4520 file name is made by appending @file{.sra} to the source file name.
4521
4522 @item sink
4523 @opindex fdump-tree-sink
4524 Dump each function after performing code sinking.  The file name is made
4525 by appending @file{.sink} to the source file name. 
4526
4527 @item dom
4528 @opindex fdump-tree-dom
4529 Dump each function after applying dominator tree optimizations.  The file
4530 name is made by appending @file{.dom} to the source file name.
4531
4532 @item dse
4533 @opindex fdump-tree-dse
4534 Dump each function after applying dead store elimination.  The file
4535 name is made by appending @file{.dse} to the source file name.
4536
4537 @item phiopt
4538 @opindex fdump-tree-phiopt
4539 Dump each function after optimizing PHI nodes into straightline code.  The file
4540 name is made by appending @file{.phiopt} to the source file name.
4541
4542 @item forwprop
4543 @opindex fdump-tree-forwprop
4544 Dump each function after forward propagating single use variables.  The file
4545 name is made by appending @file{.forwprop} to the source file name.
4546
4547 @item copyrename
4548 @opindex fdump-tree-copyrename
4549 Dump each function after applying the copy rename optimization.  The file
4550 name is made by appending @file{.copyrename} to the source file name.
4551
4552 @item nrv
4553 @opindex fdump-tree-nrv
4554 Dump each function after applying the named return value optimization on
4555 generic trees.  The file name is made by appending @file{.nrv} to the source
4556 file name.
4557
4558 @item vect
4559 @opindex fdump-tree-vect
4560 Dump each function after applying vectorization of loops.  The file name is
4561 made by appending @file{.vect} to the source file name.
4562
4563 @item vrp
4564 @opindex fdump-tree-vrp
4565 Dump each function after Value Range Propagation (VRP).  The file name
4566 is made by appending @file{.vrp} to the source file name.
4567
4568 @item all
4569 @opindex fdump-tree-all
4570 Enable all the available tree dumps with the flags provided in this option.
4571 @end table
4572
4573 @item -ftree-vectorizer-verbose=@var{n}
4574 @opindex ftree-vectorizer-verbose
4575 This option controls the amount of debugging output the vectorizer prints.
4576 This information is written to standard error, unless 
4577 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified, 
4578 in which case it is output to the usual dump listing file, @file{.vect}.
4579 For @var{n}=0 no diagnostic information is reported.
4580 If @var{n}=1 the vectorizer reports each loop that got vectorized, 
4581 and the total number of loops that got vectorized.
4582 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed 
4583 the first analysis phase (vect_analyze_loop_form) - i.e. countable, 
4584 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity 
4585 level that @option{-fdump-tree-vect-stats} uses.
4586 Higher verbosity levels mean either more information dumped for each 
4587 reported loop, or same amount of information reported for more loops:
4588 If @var{n}=3, alignment related information is added to the reports.
4589 If @var{n}=4, data-references related information (e.g. memory dependences, 
4590 memory access-patterns) is added to the reports.
4591 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops 
4592 that did not pass the first analysis phase (i.e. may not be countable, or 
4593 may have complicated control-flow).
4594 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4595 For @var{n}=7, all the information the vectorizer generates during its 
4596 analysis and transformation is reported.  This is the same verbosity level
4597 that @option{-fdump-tree-vect-details} uses.
4598
4599 @item -frandom-seed=@var{string}
4600 @opindex frandom-string
4601 This option provides a seed that GCC uses when it would otherwise use
4602 random numbers.  It is used to generate certain symbol names
4603 that have to be different in every compiled file.  It is also used to
4604 place unique stamps in coverage data files and the object files that
4605 produce them.  You can use the @option{-frandom-seed} option to produce
4606 reproducibly identical object files.
4607
4608 The @var{string} should be different for every file you compile.
4609
4610 @item -fsched-verbose=@var{n}
4611 @opindex fsched-verbose
4612 On targets that use instruction scheduling, this option controls the
4613 amount of debugging output the scheduler prints.  This information is
4614 written to standard error, unless @option{-dS} or @option{-dR} is
4615 specified, in which case it is output to the usual dump
4616 listing file, @file{.sched} or @file{.sched2} respectively.  However
4617 for @var{n} greater than nine, the output is always printed to standard
4618 error.
4619
4620 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4621 same information as @option{-dRS}.  For @var{n} greater than one, it
4622 also output basic block probabilities, detailed ready list information
4623 and unit/insn info.  For @var{n} greater than two, it includes RTL
4624 at abort point, control-flow and regions info.  And for @var{n} over
4625 four, @option{-fsched-verbose} also includes dependence info.
4626
4627 @item -save-temps
4628 @opindex save-temps
4629 Store the usual ``temporary'' intermediate files permanently; place them
4630 in the current directory and name them based on the source file.  Thus,
4631 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4632 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4633 preprocessed @file{foo.i} output file even though the compiler now
4634 normally uses an integrated preprocessor.
4635
4636 When used in combination with the @option{-x} command line option,
4637 @option{-save-temps} is sensible enough to avoid over writing an
4638 input source file with the same extension as an intermediate file.
4639 The corresponding intermediate file may be obtained by renaming the
4640 source file before using @option{-save-temps}.
4641
4642 @item -time
4643 @opindex time
4644 Report the CPU time taken by each subprocess in the compilation
4645 sequence.  For C source files, this is the compiler proper and assembler
4646 (plus the linker if linking is done).  The output looks like this:
4647
4648 @smallexample
4649 # cc1 0.12 0.01
4650 # as 0.00 0.01
4651 @end smallexample
4652
4653 The first number on each line is the ``user time'', that is time spent
4654 executing the program itself.  The second number is ``system time'',
4655 time spent executing operating system routines on behalf of the program.
4656 Both numbers are in seconds.
4657
4658 @item -fvar-tracking
4659 @opindex fvar-tracking
4660 Run variable tracking pass.  It computes where variables are stored at each
4661 position in code.  Better debugging information is then generated
4662 (if the debugging information format supports this information).
4663
4664 It is enabled by default when compiling with optimization (@option{-Os},
4665 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4666 the debug info format supports it.
4667
4668 @item -print-file-name=@var{library}
4669 @opindex print-file-name
4670 Print the full absolute name of the library file @var{library} that
4671 would be used when linking---and don't do anything else.  With this
4672 option, GCC does not compile or link anything; it just prints the
4673 file name.
4674
4675 @item -print-multi-directory
4676 @opindex print-multi-directory
4677 Print the directory name corresponding to the multilib selected by any
4678 other switches present in the command line.  This directory is supposed
4679 to exist in @env{GCC_EXEC_PREFIX}.
4680
4681 @item -print-multi-lib
4682 @opindex print-multi-lib
4683 Print the mapping from multilib directory names to compiler switches
4684 that enable them.  The directory name is separated from the switches by
4685 @samp{;}, and each switch starts with an @samp{@@} instead of the
4686 @samp{-}, without spaces between multiple switches.  This is supposed to
4687 ease shell-processing.
4688
4689 @item -print-prog-name=@var{program}
4690 @opindex print-prog-name
4691 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4692
4693 @item -print-libgcc-file-name
4694 @opindex print-libgcc-file-name
4695 Same as @option{-print-file-name=libgcc.a}.
4696
4697 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4698 but you do want to link with @file{libgcc.a}.  You can do
4699
4700 @smallexample
4701 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4702 @end smallexample
4703
4704 @item -print-search-dirs
4705 @opindex print-search-dirs
4706 Print the name of the configured installation directory and a list of
4707 program and library directories @command{gcc} will search---and don't do anything else.
4708
4709 This is useful when @command{gcc} prints the error message
4710 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4711 To resolve this you either need to put @file{cpp0} and the other compiler
4712 components where @command{gcc} expects to find them, or you can set the environment
4713 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4714 Don't forget the trailing @samp{/}.
4715 @xref{Environment Variables}.
4716
4717 @item -print-sysroot-headers-suffix
4718 @opindex print-sysroot-headers-suffix
4719 Print the suffix added to the target sysroot when searching for
4720 headers, or give an error if the compiler is not configured with such
4721 a suffix---and don't do anything else.
4722
4723 @item -dumpmachine
4724 @opindex dumpmachine
4725 Print the compiler's target machine (for example,
4726 @samp{i686-pc-linux-gnu})---and don't do anything else.
4727
4728 @item -dumpversion
4729 @opindex dumpversion
4730 Print the compiler version (for example, @samp{3.0})---and don't do
4731 anything else.
4732
4733 @item -dumpspecs
4734 @opindex dumpspecs
4735 Print the compiler's built-in specs---and don't do anything else.  (This
4736 is used when GCC itself is being built.)  @xref{Spec Files}.
4737
4738 @item -feliminate-unused-debug-types
4739 @opindex feliminate-unused-debug-types
4740 Normally, when producing DWARF2 output, GCC will emit debugging
4741 information for all types declared in a compilation
4742 unit, regardless of whether or not they are actually used
4743 in that compilation unit.  Sometimes this is useful, such as
4744 if, in the debugger, you want to cast a value to a type that is
4745 not actually used in your program (but is declared).  More often,
4746 however, this results in a significant amount of wasted space.
4747 With this option, GCC will avoid producing debug symbol output
4748 for types that are nowhere used in the source file being compiled.
4749 @end table
4750
4751 @node Optimize Options
4752 @section Options That Control Optimization
4753 @cindex optimize options
4754 @cindex options, optimization
4755
4756 These options control various sorts of optimizations.
4757
4758 Without any optimization option, the compiler's goal is to reduce the
4759 cost of compilation and to make debugging produce the expected
4760 results.  Statements are independent: if you stop the program with a
4761 breakpoint between statements, you can then assign a new value to any
4762 variable or change the program counter to any other statement in the
4763 function and get exactly the results you would expect from the source
4764 code.
4765
4766 Turning on optimization flags makes the compiler attempt to improve
4767 the performance and/or code size at the expense of compilation time
4768 and possibly the ability to debug the program.
4769
4770 The compiler performs optimization based on the knowledge it has of
4771 the program.  Optimization levels @option{-O} and above, in
4772 particular, enable @emph{unit-at-a-time} mode, which allows the
4773 compiler to consider information gained from later functions in
4774 the file when compiling a function.  Compiling multiple files at
4775 once to a single output file in @emph{unit-at-a-time} mode allows
4776 the compiler to use information gained from all of the files when
4777 compiling each of them.
4778
4779 Not all optimizations are controlled directly by a flag.  Only
4780 optimizations that have a flag are listed.
4781
4782 @table @gcctabopt
4783 @item -O
4784 @itemx -O1
4785 @opindex O
4786 @opindex O1
4787 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4788 more memory for a large function.
4789
4790 With @option{-O}, the compiler tries to reduce code size and execution
4791 time, without performing any optimizations that take a great deal of
4792 compilation time.
4793
4794 @option{-O} turns on the following optimization flags:
4795 @gccoptlist{-fdefer-pop @gol
4796 -fdelayed-branch @gol
4797 -fguess-branch-probability @gol
4798 -fcprop-registers @gol
4799 -fif-conversion @gol
4800 -fif-conversion2 @gol
4801 -fsplit-wide-types @gol
4802 -ftree-ccp @gol
4803 -ftree-dce @gol
4804 -ftree-dominator-opts @gol
4805 -ftree-dse @gol
4806 -ftree-ter @gol
4807 -ftree-sra @gol
4808 -ftree-copyrename @gol
4809 -ftree-fre @gol
4810 -ftree-ch @gol
4811 -funit-at-a-time @gol
4812 -fmerge-constants}
4813
4814 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4815 where doing so does not interfere with debugging.
4816
4817 @item -O2
4818 @opindex O2
4819 Optimize even more.  GCC performs nearly all supported optimizations
4820 that do not involve a space-speed tradeoff.  The compiler does not
4821 perform loop unrolling or function inlining when you specify @option{-O2}.
4822 As compared to @option{-O}, this option increases both compilation time
4823 and the performance of the generated code.
4824
4825 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4826 also turns on the following optimization flags:
4827 @gccoptlist{-fthread-jumps @gol
4828 -fcrossjumping @gol
4829 -foptimize-sibling-calls @gol
4830 -fcse-follow-jumps  -fcse-skip-blocks @gol
4831 -fgcse  -fgcse-lm  @gol
4832 -fexpensive-optimizations @gol
4833 -frerun-cse-after-loop  @gol
4834 -fcaller-saves @gol
4835 -fpeephole2 @gol
4836 -fschedule-insns  -fschedule-insns2 @gol
4837 -fsched-interblock  -fsched-spec @gol
4838 -fregmove @gol
4839 -fstrict-aliasing -fstrict-overflow @gol
4840 -fdelete-null-pointer-checks @gol
4841 -freorder-blocks  -freorder-functions @gol
4842 -falign-functions  -falign-jumps @gol
4843 -falign-loops  -falign-labels @gol
4844 -ftree-vrp @gol
4845 -ftree-pre}
4846
4847 Please note the warning under @option{-fgcse} about
4848 invoking @option{-O2} on programs that use computed gotos.
4849
4850 @item -O3
4851 @opindex O3
4852 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4853 @option{-O2} and also turns on the @option{-finline-functions},
4854 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4855
4856 @item -O0
4857 @opindex O0
4858 Reduce compilation time and make debugging produce the expected
4859 results.  This is the default.
4860
4861 @item -Os
4862 @opindex Os
4863 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4864 do not typically increase code size.  It also performs further
4865 optimizations designed to reduce code size.
4866
4867 @option{-Os} disables the following optimization flags:
4868 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4869 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
4870 -fprefetch-loop-arrays  -ftree-vect-loop-version}
4871
4872 If you use multiple @option{-O} options, with or without level numbers,
4873 the last such option is the one that is effective.
4874 @end table
4875
4876 Options of the form @option{-f@var{flag}} specify machine-independent
4877 flags.  Most flags have both positive and negative forms; the negative
4878 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4879 below, only one of the forms is listed---the one you typically will
4880 use.  You can figure out the other form by either removing @samp{no-}
4881 or adding it.
4882
4883 The following options control specific optimizations.  They are either
4884 activated by @option{-O} options or are related to ones that are.  You
4885 can use the following flags in the rare cases when ``fine-tuning'' of
4886 optimizations to be performed is desired.
4887
4888 @table @gcctabopt
4889 @item -fno-default-inline
4890 @opindex fno-default-inline
4891 Do not make member functions inline by default merely because they are
4892 defined inside the class scope (C++ only).  Otherwise, when you specify
4893 @w{@option{-O}}, member functions defined inside class scope are compiled
4894 inline by default; i.e., you don't need to add @samp{inline} in front of
4895 the member function name.
4896
4897 @item -fno-defer-pop
4898 @opindex fno-defer-pop
4899 Always pop the arguments to each function call as soon as that function
4900 returns.  For machines which must pop arguments after a function call,
4901 the compiler normally lets arguments accumulate on the stack for several
4902 function calls and pops them all at once.
4903
4904 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4905
4906 @item -fforce-addr
4907 @opindex fforce-addr
4908 Force memory address constants to be copied into registers before
4909 doing arithmetic on them.
4910
4911 @item -fforward-propagate
4912 @opindex fforward-propagate
4913 Perform a forward propagation pass on RTL.  The pass tries to combine two
4914 instructions and checks if the result can be simplified.  If loop unrolling
4915 is active, two passes are performed and the second is scheduled after
4916 loop unrolling.
4917
4918 This option is enabled by default at optimization levels @option{-O2},
4919 @option{-O3}, @option{-Os}.
4920
4921 @item -fomit-frame-pointer
4922 @opindex fomit-frame-pointer
4923 Don't keep the frame pointer in a register for functions that
4924 don't need one.  This avoids the instructions to save, set up and
4925 restore frame pointers; it also makes an extra register available
4926 in many functions.  @strong{It also makes debugging impossible on
4927 some machines.}
4928
4929 On some machines, such as the VAX, this flag has no effect, because
4930 the standard calling sequence automatically handles the frame pointer
4931 and nothing is saved by pretending it doesn't exist.  The
4932 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4933 whether a target machine supports this flag.  @xref{Registers,,Register
4934 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4935
4936 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4937
4938 @item -foptimize-sibling-calls
4939 @opindex foptimize-sibling-calls
4940 Optimize sibling and tail recursive calls.
4941
4942 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4943
4944 @item -fno-inline
4945 @opindex fno-inline
4946 Don't pay attention to the @code{inline} keyword.  Normally this option
4947 is used to keep the compiler from expanding any functions inline.
4948 Note that if you are not optimizing, no functions can be expanded inline.
4949
4950 @item -finline-functions
4951 @opindex finline-functions
4952 Integrate all simple functions into their callers.  The compiler
4953 heuristically decides which functions are simple enough to be worth
4954 integrating in this way.
4955
4956 If all calls to a given function are integrated, and the function is
4957 declared @code{static}, then the function is normally not output as
4958 assembler code in its own right.
4959
4960 Enabled at level @option{-O3}.
4961
4962 @item -finline-functions-called-once
4963 @opindex finline-functions-called-once
4964 Consider all @code{static} functions called once for inlining into their
4965 caller even if they are not marked @code{inline}.  If a call to a given
4966 function is integrated, then the function is not output as assembler code
4967 in its own right.
4968
4969 Enabled if @option{-funit-at-a-time} is enabled.
4970
4971 @item -fearly-inlining
4972 @opindex fearly-inlining
4973 Inline functions marked by @code{always_inline} and functions whose body seems
4974 smaller than the function call overhead early before doing
4975 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4976 makes profiling significantly cheaper and usually inlining faster on programs
4977 having large chains of nested wrapper functions.
4978
4979 Enabled by default.
4980
4981 @item -finline-limit=@var{n}
4982 @opindex finline-limit
4983 By default, GCC limits the size of functions that can be inlined.  This flag
4984 allows the control of this limit for functions that are explicitly marked as
4985 inline (i.e., marked with the inline keyword or defined within the class
4986 definition in c++).  @var{n} is the size of functions that can be inlined in
4987 number of pseudo instructions (not counting parameter handling).  The default
4988 value of @var{n} is 600.
4989 Increasing this value can result in more inlined code at
4990 the cost of compilation time and memory consumption.  Decreasing usually makes
4991 the compilation faster and less code will be inlined (which presumably
4992 means slower programs).  This option is particularly useful for programs that
4993 use inlining heavily such as those based on recursive templates with C++.
4994
4995 Inlining is actually controlled by a number of parameters, which may be
4996 specified individually by using @option{--param @var{name}=@var{value}}.
4997 The @option{-finline-limit=@var{n}} option sets some of these parameters
4998 as follows:
4999
5000 @table @gcctabopt
5001 @item max-inline-insns-single
5002  is set to @var{n}/2.
5003 @item max-inline-insns-auto
5004  is set to @var{n}/2.
5005 @item min-inline-insns
5006  is set to 130 or @var{n}/4, whichever is smaller.
5007 @item max-inline-insns-rtl
5008  is set to @var{n}.
5009 @end table
5010
5011 See below for a documentation of the individual
5012 parameters controlling inlining.
5013
5014 @emph{Note:} pseudo instruction represents, in this particular context, an
5015 abstract measurement of function's size.  In no way does it represent a count
5016 of assembly instructions and as such its exact meaning might change from one
5017 release to an another.
5018
5019 @item -fkeep-inline-functions
5020 @opindex fkeep-inline-functions
5021 In C, emit @code{static} functions that are declared @code{inline}
5022 into the object file, even if the function has been inlined into all
5023 of its callers.  This switch does not affect functions using the
5024 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5025 inline functions into the object file.
5026
5027 @item -fkeep-static-consts
5028 @opindex fkeep-static-consts
5029 Emit variables declared @code{static const} when optimization isn't turned
5030 on, even if the variables aren't referenced.
5031
5032 GCC enables this option by default.  If you want to force the compiler to
5033 check if the variable was referenced, regardless of whether or not
5034 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5035
5036 @item -fmerge-constants
5037 Attempt to merge identical constants (string constants and floating point
5038 constants) across compilation units.
5039
5040 This option is the default for optimized compilation if the assembler and
5041 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5042 behavior.
5043
5044 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5045
5046 @item -fmerge-all-constants
5047 Attempt to merge identical constants and identical variables.
5048
5049 This option implies @option{-fmerge-constants}.  In addition to
5050 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5051 arrays or initialized constant variables with integral or floating point
5052 types.  Languages like C or C++ require each non-automatic variable to
5053 have distinct location, so using this option will result in non-conforming
5054 behavior.
5055
5056 @item -fmodulo-sched
5057 @opindex fmodulo-sched
5058 Perform swing modulo scheduling immediately before the first scheduling
5059 pass.  This pass looks at innermost loops and reorders their
5060 instructions by overlapping different iterations.
5061
5062 @item -fno-branch-count-reg
5063 @opindex fno-branch-count-reg
5064 Do not use ``decrement and branch'' instructions on a count register,
5065 but instead generate a sequence of instructions that decrement a
5066 register, compare it against zero, then branch based upon the result.
5067 This option is only meaningful on architectures that support such
5068 instructions, which include x86, PowerPC, IA-64 and S/390.
5069
5070 The default is @option{-fbranch-count-reg}.
5071
5072 @item -fno-function-cse
5073 @opindex fno-function-cse
5074 Do not put function addresses in registers; make each instruction that
5075 calls a constant function contain the function's address explicitly.
5076
5077 This option results in less efficient code, but some strange hacks
5078 that alter the assembler output may be confused by the optimizations
5079 performed when this option is not used.
5080
5081 The default is @option{-ffunction-cse}
5082
5083 @item -fno-zero-initialized-in-bss
5084 @opindex fno-zero-initialized-in-bss
5085 If the target supports a BSS section, GCC by default puts variables that
5086 are initialized to zero into BSS@.  This can save space in the resulting
5087 code.
5088
5089 This option turns off this behavior because some programs explicitly
5090 rely on variables going to the data section.  E.g., so that the
5091 resulting executable can find the beginning of that section and/or make
5092 assumptions based on that.
5093
5094 The default is @option{-fzero-initialized-in-bss}.
5095
5096 @item -fbounds-check
5097 @opindex fbounds-check
5098 For front-ends that support it, generate additional code to check that
5099 indices used to access arrays are within the declared range.  This is
5100 currently only supported by the Java and Fortran front-ends, where
5101 this option defaults to true and false respectively.
5102
5103 @item -fmudflap -fmudflapth -fmudflapir
5104 @opindex fmudflap
5105 @opindex fmudflapth
5106 @opindex fmudflapir
5107 @cindex bounds checking
5108 @cindex mudflap
5109 For front-ends that support it (C and C++), instrument all risky
5110 pointer/array dereferencing operations, some standard library
5111 string/heap functions, and some other associated constructs with
5112 range/validity tests.  Modules so instrumented should be immune to
5113 buffer overflows, invalid heap use, and some other classes of C/C++
5114 programming errors.  The instrumentation relies on a separate runtime
5115 library (@file{libmudflap}), which will be linked into a program if
5116 @option{-fmudflap} is given at link time.  Run-time behavior of the
5117 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5118 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5119 for its options.
5120
5121 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5122 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5123 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5124 instrumentation should ignore pointer reads.  This produces less
5125 instrumentation (and therefore faster execution) and still provides
5126 some protection against outright memory corrupting writes, but allows
5127 erroneously read data to propagate within a program.
5128
5129 @item -fthread-jumps
5130 @opindex fthread-jumps
5131 Perform optimizations where we check to see if a jump branches to a
5132 location where another comparison subsumed by the first is found.  If
5133 so, the first branch is redirected to either the destination of the
5134 second branch or a point immediately following it, depending on whether
5135 the condition is known to be true or false.
5136
5137 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5138
5139 @item -fsplit-wide-types
5140 @opindex -fsplit-wide-types
5141 When using a type that occupies multiple registers, such as @code{long
5142 long} on a 32-bit system, split the registers apart and allocate them
5143 independently.  This normally generates better code for those types,
5144 but may make debugging more difficult.
5145
5146 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5147 @option{-Os}.
5148
5149 @item -fcse-follow-jumps
5150 @opindex fcse-follow-jumps
5151 In common subexpression elimination, scan through jump instructions
5152 when the target of the jump is not reached by any other path.  For
5153 example, when CSE encounters an @code{if} statement with an
5154 @code{else} clause, CSE will follow the jump when the condition
5155 tested is false.
5156
5157 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5158
5159 @item -fcse-skip-blocks
5160 @opindex fcse-skip-blocks
5161 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5162 follow jumps which conditionally skip over blocks.  When CSE
5163 encounters a simple @code{if} statement with no else clause,
5164 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5165 body of the @code{if}.
5166
5167 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5168
5169 @item -frerun-cse-after-loop
5170 @opindex frerun-cse-after-loop
5171 Re-run common subexpression elimination after loop optimizations has been
5172 performed.
5173
5174 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5175
5176 @item -fgcse
5177 @opindex fgcse
5178 Perform a global common subexpression elimination pass.
5179 This pass also performs global constant and copy propagation.
5180
5181 @emph{Note:} When compiling a program using computed gotos, a GCC
5182 extension, you may get better runtime performance if you disable
5183 the global common subexpression elimination pass by adding
5184 @option{-fno-gcse} to the command line.
5185
5186 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5187
5188 @item -fgcse-lm
5189 @opindex fgcse-lm
5190 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5191 attempt to move loads which are only killed by stores into themselves.  This
5192 allows a loop containing a load/store sequence to be changed to a load outside
5193 the loop, and a copy/store within the loop.
5194
5195 Enabled by default when gcse is enabled.
5196
5197 @item -fgcse-sm
5198 @opindex fgcse-sm
5199 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5200 global common subexpression elimination.  This pass will attempt to move
5201 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5202 loops containing a load/store sequence can be changed to a load before
5203 the loop and a store after the loop.
5204
5205 Not enabled at any optimization level.
5206
5207 @item -fgcse-las
5208 @opindex fgcse-las
5209 When @option{-fgcse-las} is enabled, the global common subexpression
5210 elimination pass eliminates redundant loads that come after stores to the
5211 same memory location (both partial and full redundancies).
5212
5213 Not enabled at any optimization level.
5214
5215 @item -fgcse-after-reload
5216 @opindex fgcse-after-reload
5217 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5218 pass is performed after reload.  The purpose of this pass is to cleanup
5219 redundant spilling.
5220
5221 @item -funsafe-loop-optimizations
5222 @opindex funsafe-loop-optimizations
5223 If given, the loop optimizer will assume that loop indices do not
5224 overflow, and that the loops with nontrivial exit condition are not
5225 infinite.  This enables a wider range of loop optimizations even if
5226 the loop optimizer itself cannot prove that these assumptions are valid.
5227 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5228 if it finds this kind of loop.
5229
5230 @item -fcrossjumping
5231 @opindex crossjumping
5232 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5233 resulting code may or may not perform better than without cross-jumping.
5234
5235 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5236
5237 @item -fif-conversion
5238 @opindex if-conversion
5239 Attempt to transform conditional jumps into branch-less equivalents.  This
5240 include use of conditional moves, min, max, set flags and abs instructions, and
5241 some tricks doable by standard arithmetics.  The use of conditional execution
5242 on chips where it is available is controlled by @code{if-conversion2}.
5243
5244 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5245
5246 @item -fif-conversion2
5247 @opindex if-conversion2
5248 Use conditional execution (where available) to transform conditional jumps into
5249 branch-less equivalents.
5250
5251 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5252
5253 @item -fdelete-null-pointer-checks
5254 @opindex fdelete-null-pointer-checks
5255 Use global dataflow analysis to identify and eliminate useless checks
5256 for null pointers.  The compiler assumes that dereferencing a null
5257 pointer would have halted the program.  If a pointer is checked after
5258 it has already been dereferenced, it cannot be null.
5259
5260 In some environments, this assumption is not true, and programs can
5261 safely dereference null pointers.  Use
5262 @option{-fno-delete-null-pointer-checks} to disable this optimization
5263 for programs which depend on that behavior.
5264
5265 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5266
5267 @item -fexpensive-optimizations
5268 @opindex fexpensive-optimizations
5269 Perform a number of minor optimizations that are relatively expensive.
5270
5271 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5272
5273 @item -foptimize-register-move
5274 @itemx -fregmove
5275 @opindex foptimize-register-move
5276 @opindex fregmove
5277 Attempt to reassign register numbers in move instructions and as
5278 operands of other simple instructions in order to maximize the amount of
5279 register tying.  This is especially helpful on machines with two-operand
5280 instructions.
5281
5282 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5283 optimization.
5284
5285 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5286
5287 @item -fdelayed-branch
5288 @opindex fdelayed-branch
5289 If supported for the target machine, attempt to reorder instructions
5290 to exploit instruction slots available after delayed branch
5291 instructions.
5292
5293 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5294
5295 @item -fschedule-insns
5296 @opindex fschedule-insns
5297 If supported for the target machine, attempt to reorder instructions to
5298 eliminate execution stalls due to required data being unavailable.  This
5299 helps machines that have slow floating point or memory load instructions
5300 by allowing other instructions to be issued until the result of the load
5301 or floating point instruction is required.
5302
5303 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5304
5305 @item -fschedule-insns2
5306 @opindex fschedule-insns2
5307 Similar to @option{-fschedule-insns}, but requests an additional pass of
5308 instruction scheduling after register allocation has been done.  This is
5309 especially useful on machines with a relatively small number of
5310 registers and where memory load instructions take more than one cycle.
5311
5312 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5313
5314 @item -fno-sched-interblock
5315 @opindex fno-sched-interblock
5316 Don't schedule instructions across basic blocks.  This is normally
5317 enabled by default when scheduling before register allocation, i.e.@:
5318 with @option{-fschedule-insns} or at @option{-O2} or higher.
5319
5320 @item -fno-sched-spec
5321 @opindex fno-sched-spec
5322 Don't allow speculative motion of non-load instructions.  This is normally
5323 enabled by default when scheduling before register allocation, i.e.@:
5324 with @option{-fschedule-insns} or at @option{-O2} or higher.
5325
5326 @item -fsched-spec-load
5327 @opindex fsched-spec-load
5328 Allow speculative motion of some load instructions.  This only makes
5329 sense when scheduling before register allocation, i.e.@: with
5330 @option{-fschedule-insns} or at @option{-O2} or higher.
5331
5332 @item -fsched-spec-load-dangerous
5333 @opindex fsched-spec-load-dangerous
5334 Allow speculative motion of more load instructions.  This only makes
5335 sense when scheduling before register allocation, i.e.@: with
5336 @option{-fschedule-insns} or at @option{-O2} or higher.
5337
5338 @item -fsched-stalled-insns=@var{n}
5339 @opindex fsched-stalled-insns
5340 Define how many insns (if any) can be moved prematurely from the queue
5341 of stalled insns into the ready list, during the second scheduling pass.
5342
5343 @item -fsched-stalled-insns-dep=@var{n}
5344 @opindex fsched-stalled-insns-dep
5345 Define how many insn groups (cycles) will be examined for a dependency
5346 on a stalled insn that is candidate for premature removal from the queue
5347 of stalled insns.  Has an effect only during the second scheduling pass,
5348 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5349
5350 @item -fsched2-use-superblocks
5351 @opindex fsched2-use-superblocks
5352 When scheduling after register allocation, do use superblock scheduling
5353 algorithm.  Superblock scheduling allows motion across basic block boundaries
5354 resulting on faster schedules.  This option is experimental, as not all machine
5355 descriptions used by GCC model the CPU closely enough to avoid unreliable
5356 results from the algorithm.
5357
5358 This only makes sense when scheduling after register allocation, i.e.@: with
5359 @option{-fschedule-insns2} or at @option{-O2} or higher.
5360
5361 @item -fsched2-use-traces
5362 @opindex fsched2-use-traces
5363 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5364 allocation and additionally perform code duplication in order to increase the
5365 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5366 trace formation.
5367
5368 This mode should produce faster but significantly longer programs.  Also
5369 without @option{-fbranch-probabilities} the traces constructed may not
5370 match the reality and hurt the performance.  This only makes
5371 sense when scheduling after register allocation, i.e.@: with
5372 @option{-fschedule-insns2} or at @option{-O2} or higher.
5373
5374 @item -fsee
5375 @opindex fsee
5376 Eliminates redundant extension instructions and move the non redundant
5377 ones to optimal placement using LCM.
5378
5379 @item -freschedule-modulo-scheduled-loops
5380 @opindex fscheduling-in-modulo-scheduled-loops
5381 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5382 we may want to prevent the later scheduling passes from changing its schedule, we use this
5383 option to control that.
5384
5385 @item -fcaller-saves
5386 @opindex fcaller-saves
5387 Enable values to be allocated in registers that will be clobbered by
5388 function calls, by emitting extra instructions to save and restore the
5389 registers around such calls.  Such allocation is done only when it
5390 seems to result in better code than would otherwise be produced.
5391
5392 This option is always enabled by default on certain machines, usually
5393 those which have no call-preserved registers to use instead.
5394
5395 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5396
5397 @item -ftree-pre
5398 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5399 enabled by default at @option{-O2} and @option{-O3}.
5400
5401 @item -ftree-fre
5402 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5403 between FRE and PRE is that FRE only considers expressions
5404 that are computed on all paths leading to the redundant computation.
5405 This analysis faster than PRE, though it exposes fewer redundancies.
5406 This flag is enabled by default at @option{-O} and higher.
5407
5408 @item -ftree-copy-prop
5409 Perform copy propagation on trees.  This pass eliminates unnecessary
5410 copy operations.  This flag is enabled by default at @option{-O} and
5411 higher.
5412
5413 @item -ftree-store-copy-prop
5414 Perform copy propagation of memory loads and stores.  This pass
5415 eliminates unnecessary copy operations in memory references
5416 (structures, global variables, arrays, etc).  This flag is enabled by
5417 default at @option{-O2} and higher.
5418
5419 @item -ftree-salias
5420 Perform structural alias analysis on trees.  This flag
5421 is enabled by default at @option{-O} and higher.
5422
5423 @item -fipa-pta
5424 Perform interprocedural pointer analysis.
5425
5426 @item -ftree-sink
5427 Perform forward store motion  on trees.  This flag is
5428 enabled by default at @option{-O} and higher.
5429
5430 @item -ftree-ccp
5431 Perform sparse conditional constant propagation (CCP) on trees.  This
5432 pass only operates on local scalar variables and is enabled by default
5433 at @option{-O} and higher.
5434
5435 @item -ftree-store-ccp
5436 Perform sparse conditional constant propagation (CCP) on trees.  This
5437 pass operates on both local scalar variables and memory stores and
5438 loads (global variables, structures, arrays, etc).  This flag is
5439 enabled by default at @option{-O2} and higher.
5440
5441 @item -ftree-dce
5442 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5443 default at @option{-O} and higher.
5444
5445 @item -ftree-dominator-opts
5446 Perform a variety of simple scalar cleanups (constant/copy
5447 propagation, redundancy elimination, range propagation and expression
5448 simplification) based on a dominator tree traversal.  This also
5449 performs jump threading (to reduce jumps to jumps). This flag is
5450 enabled by default at @option{-O} and higher.
5451
5452 @item -ftree-ch
5453 Perform loop header copying on trees.  This is beneficial since it increases
5454 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5455 is enabled by default at @option{-O} and higher.  It is not enabled
5456 for @option{-Os}, since it usually increases code size.
5457
5458 @item -ftree-loop-optimize
5459 Perform loop optimizations on trees.  This flag is enabled by default
5460 at @option{-O} and higher.
5461
5462 @item -ftree-loop-linear
5463 Perform linear loop transformations on tree.  This flag can improve cache
5464 performance and allow further loop optimizations to take place.
5465
5466 @item -fcheck-data-deps
5467 Compare the results of several data dependence analyzers.  This option
5468 is used for debugging the data dependence analyzers.
5469
5470 @item -ftree-loop-im
5471 Perform loop invariant motion on trees.  This pass moves only invariants that
5472 would be hard to handle at RTL level (function calls, operations that expand to
5473 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5474 operands of conditions that are invariant out of the loop, so that we can use
5475 just trivial invariantness analysis in loop unswitching.  The pass also includes
5476 store motion.
5477
5478 @item -ftree-loop-ivcanon
5479 Create a canonical counter for number of iterations in the loop for that
5480 determining number of iterations requires complicated analysis.  Later
5481 optimizations then may determine the number easily.  Useful especially
5482 in connection with unrolling.
5483
5484 @item -fivopts
5485 Perform induction variable optimizations (strength reduction, induction
5486 variable merging and induction variable elimination) on trees.
5487
5488 @item -ftree-sra
5489 Perform scalar replacement of aggregates.  This pass replaces structure
5490 references with scalars to prevent committing structures to memory too
5491 early.  This flag is enabled by default at @option{-O} and higher.
5492
5493 @item -ftree-copyrename
5494 Perform copy renaming on trees.  This pass attempts to rename compiler
5495 temporaries to other variables at copy locations, usually resulting in
5496 variable names which more closely resemble the original variables.  This flag
5497 is enabled by default at @option{-O} and higher.
5498
5499 @item -ftree-ter
5500 Perform temporary expression replacement during the SSA->normal phase.  Single
5501 use/single def temporaries are replaced at their use location with their
5502 defining expression.  This results in non-GIMPLE code, but gives the expanders
5503 much more complex trees to work on resulting in better RTL generation.  This is
5504 enabled by default at @option{-O} and higher.
5505
5506 @item -ftree-vectorize
5507 Perform loop vectorization on trees.
5508
5509 @item -ftree-vect-loop-version
5510 @opindex ftree-vect-loop-version
5511 Perform loop versioning when doing loop vectorization on trees.  When a loop
5512 appears to be vectorizable except that data alignment or data dependence cannot
5513 be determined at compile time then vectorized and non-vectorized versions of
5514 the loop are generated along with runtime checks for alignment or dependence
5515 to control which version is executed.  This option is enabled by default
5516 except at level @option{-Os} where it is disabled.
5517
5518 @item -ftree-vrp
5519 Perform Value Range Propagation on trees.  This is similar to the
5520 constant propagation pass, but instead of values, ranges of values are
5521 propagated.  This allows the optimizers to remove unnecessary range
5522 checks like array bound checks and null pointer checks.  This is
5523 enabled by default at @option{-O2} and higher.  Null pointer check
5524 elimination is only done if @option{-fdelete-null-pointer-checks} is
5525 enabled.
5526
5527 @item -ftracer
5528 @opindex ftracer
5529 Perform tail duplication to enlarge superblock size.  This transformation
5530 simplifies the control flow of the function allowing other optimizations to do
5531 better job.
5532
5533 @item -funroll-loops
5534 @opindex funroll-loops
5535 Unroll loops whose number of iterations can be determined at compile
5536 time or upon entry to the loop.  @option{-funroll-loops} implies
5537 @option{-frerun-cse-after-loop}.  This option makes code larger,
5538 and may or may not make it run faster.
5539
5540 @item -funroll-all-loops
5541 @opindex funroll-all-loops
5542 Unroll all loops, even if their number of iterations is uncertain when
5543 the loop is entered.  This usually makes programs run more slowly.
5544 @option{-funroll-all-loops} implies the same options as
5545 @option{-funroll-loops},
5546
5547 @item -fsplit-ivs-in-unroller
5548 @opindex -fsplit-ivs-in-unroller
5549 Enables expressing of values of induction variables in later iterations
5550 of the unrolled loop using the value in the first iteration.  This breaks
5551 long dependency chains, thus improving efficiency of the scheduling passes.
5552
5553 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5554 same effect.  However in cases the loop body is more complicated than
5555 a single basic block, this is not reliable.  It also does not work at all
5556 on some of the architectures due to restrictions in the CSE pass.
5557
5558 This optimization is enabled by default.
5559
5560 @item -fvariable-expansion-in-unroller
5561 @opindex -fvariable-expansion-in-unroller
5562 With this option, the compiler will create multiple copies of some
5563 local variables when unrolling a loop which can result in superior code.
5564
5565 @item -fprefetch-loop-arrays
5566 @opindex fprefetch-loop-arrays
5567 If supported by the target machine, generate instructions to prefetch
5568 memory to improve the performance of loops that access large arrays.
5569
5570 This option may generate better or worse code; results are highly
5571 dependent on the structure of loops within the source code.
5572
5573 Disabled at level @option{-Os}.
5574
5575 @item -fno-peephole
5576 @itemx -fno-peephole2
5577 @opindex fno-peephole
5578 @opindex fno-peephole2
5579 Disable any machine-specific peephole optimizations.  The difference
5580 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5581 are implemented in the compiler; some targets use one, some use the
5582 other, a few use both.
5583
5584 @option{-fpeephole} is enabled by default.
5585 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5586
5587 @item -fno-guess-branch-probability
5588 @opindex fno-guess-branch-probability
5589 Do not guess branch probabilities using heuristics.
5590
5591 GCC will use heuristics to guess branch probabilities if they are
5592 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5593 heuristics are based on the control flow graph.  If some branch probabilities
5594 are specified by @samp{__builtin_expect}, then the heuristics will be
5595 used to guess branch probabilities for the rest of the control flow graph,
5596 taking the @samp{__builtin_expect} info into account.  The interactions
5597 between the heuristics and @samp{__builtin_expect} can be complex, and in
5598 some cases, it may be useful to disable the heuristics so that the effects
5599 of @samp{__builtin_expect} are easier to understand.
5600
5601 The default is @option{-fguess-branch-probability} at levels
5602 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5603
5604 @item -freorder-blocks
5605 @opindex freorder-blocks
5606 Reorder basic blocks in the compiled function in order to reduce number of
5607 taken branches and improve code locality.
5608
5609 Enabled at levels @option{-O2}, @option{-O3}.
5610
5611 @item -freorder-blocks-and-partition
5612 @opindex freorder-blocks-and-partition
5613 In addition to reordering basic blocks in the compiled function, in order
5614 to reduce number of taken branches, partitions hot and cold basic blocks
5615 into separate sections of the assembly and .o files, to improve
5616 paging and cache locality performance.
5617
5618 This optimization is automatically turned off in the presence of
5619 exception handling, for linkonce sections, for functions with a user-defined
5620 section attribute and on any architecture that does not support named
5621 sections.
5622
5623 @item -freorder-functions
5624 @opindex freorder-functions
5625 Reorder functions in the object file in order to
5626 improve code locality.  This is implemented by using special
5627 subsections @code{.text.hot} for most frequently executed functions and
5628 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5629 the linker so object file format must support named sections and linker must
5630 place them in a reasonable way.
5631
5632 Also profile feedback must be available in to make this option effective.  See
5633 @option{-fprofile-arcs} for details.
5634
5635 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5636
5637 @item -fstrict-aliasing
5638 @opindex fstrict-aliasing
5639 Allows the compiler to assume the strictest aliasing rules applicable to
5640 the language being compiled.  For C (and C++), this activates
5641 optimizations based on the type of expressions.  In particular, an
5642 object of one type is assumed never to reside at the same address as an
5643 object of a different type, unless the types are almost the same.  For
5644 example, an @code{unsigned int} can alias an @code{int}, but not a
5645 @code{void*} or a @code{double}.  A character type may alias any other
5646 type.
5647
5648 Pay special attention to code like this:
5649 @smallexample
5650 union a_union @{
5651   int i;
5652   double d;
5653 @};
5654
5655 int f() @{
5656   a_union t;
5657   t.d = 3.0;
5658   return t.i;
5659 @}
5660 @end smallexample
5661 The practice of reading from a different union member than the one most
5662 recently written to (called ``type-punning'') is common.  Even with
5663 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5664 is accessed through the union type.  So, the code above will work as
5665 expected.  However, this code might not:
5666 @smallexample
5667 int f() @{
5668   a_union t;
5669   int* ip;
5670   t.d = 3.0;
5671   ip = &t.i;
5672   return *ip;
5673 @}
5674 @end smallexample
5675
5676 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5677
5678 @item -fstrict-overflow
5679 @opindex fstrict-overflow
5680 Allow the compiler to assume strict signed overflow rules, depending
5681 on the language being compiled.  For C (and C++) this means that
5682 overflow when doing arithmetic with signed numbers is undefined, which
5683 means that the compiler may assume that it will not happen.  This
5684 permits various optimizations.  For example, the compiler will assume
5685 that an expression like @code{i + 10 > i} will always be true for
5686 signed @code{i}.  This assumption is only valid if signed overflow is
5687 undefined, as the expression is false if @code{i + 10} overflows when
5688 using twos complement arithmetic.  When this option is in effect any
5689 attempt to determine whether an operation on signed numbers will
5690 overflow must be written carefully to not actually involve overflow.
5691
5692 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5693 that signed overflow is fully defined: it wraps.  When
5694 @option{-fwrapv} is used, there is no difference between
5695 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5696 @option{-fwrapv} certain types of overflow are permitted.  For
5697 example, if the compiler gets an overflow when doing arithmetic on
5698 constants, the overflowed value can still be used with
5699 @option{-fwrapv}, but not otherwise.
5700
5701 The @option{-fstrict-overflow} option is enabled at levels
5702 @option{-O2}, @option{-O3}, @option{-Os}.
5703
5704 @item -falign-functions
5705 @itemx -falign-functions=@var{n}
5706 @opindex falign-functions
5707 Align the start of functions to the next power-of-two greater than
5708 @var{n}, skipping up to @var{n} bytes.  For instance,
5709 @option{-falign-functions=32} aligns functions to the next 32-byte
5710 boundary, but @option{-falign-functions=24} would align to the next
5711 32-byte boundary only if this can be done by skipping 23 bytes or less.
5712
5713 @option{-fno-align-functions} and @option{-falign-functions=1} are
5714 equivalent and mean that functions will not be aligned.
5715
5716 Some assemblers only support this flag when @var{n} is a power of two;
5717 in that case, it is rounded up.
5718
5719 If @var{n} is not specified or is zero, use a machine-dependent default.
5720
5721 Enabled at levels @option{-O2}, @option{-O3}.
5722
5723 @item -falign-labels
5724 @itemx -falign-labels=@var{n}
5725 @opindex falign-labels
5726 Align all branch targets to a power-of-two boundary, skipping up to
5727 @var{n} bytes like @option{-falign-functions}.  This option can easily
5728 make code slower, because it must insert dummy operations for when the
5729 branch target is reached in the usual flow of the code.
5730
5731 @option{-fno-align-labels} and @option{-falign-labels=1} are
5732 equivalent and mean that labels will not be aligned.
5733
5734 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5735 are greater than this value, then their values are used instead.
5736
5737 If @var{n} is not specified or is zero, use a machine-dependent default
5738 which is very likely to be @samp{1}, meaning no alignment.
5739
5740 Enabled at levels @option{-O2}, @option{-O3}.
5741
5742 @item -falign-loops
5743 @itemx -falign-loops=@var{n}
5744 @opindex falign-loops
5745 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5746 like @option{-falign-functions}.  The hope is that the loop will be
5747 executed many times, which will make up for any execution of the dummy
5748 operations.
5749
5750 @option{-fno-align-loops} and @option{-falign-loops=1} are
5751 equivalent and mean that loops will not be aligned.
5752
5753 If @var{n} is not specified or is zero, use a machine-dependent default.
5754
5755 Enabled at levels @option{-O2}, @option{-O3}.
5756
5757 @item -falign-jumps
5758 @itemx -falign-jumps=@var{n}
5759 @opindex falign-jumps
5760 Align branch targets to a power-of-two boundary, for branch targets
5761 where the targets can only be reached by jumping, skipping up to @var{n}
5762 bytes like @option{-falign-functions}.  In this case, no dummy operations
5763 need be executed.
5764
5765 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5766 equivalent and mean that loops will not be aligned.
5767
5768 If @var{n} is not specified or is zero, use a machine-dependent default.
5769
5770 Enabled at levels @option{-O2}, @option{-O3}.
5771
5772 @item -funit-at-a-time
5773 @opindex funit-at-a-time
5774 Parse the whole compilation unit before starting to produce code.
5775 This allows some extra optimizations to take place but consumes
5776 more memory (in general).  There are some compatibility issues
5777 with @emph{unit-at-a-time} mode:
5778 @itemize @bullet
5779 @item
5780 enabling @emph{unit-at-a-time} mode may change the order
5781 in which functions, variables, and top-level @code{asm} statements
5782 are emitted, and will likely break code relying on some particular
5783 ordering.  The majority of such top-level @code{asm} statements,
5784 though, can be replaced by @code{section} attributes.  The
5785 @option{fno-toplevel-reorder} option may be used to keep the ordering
5786 used in the input file, at the cost of some optimizations.
5787
5788 @item
5789 @emph{unit-at-a-time} mode removes unreferenced static variables
5790 and functions.  This may result in undefined references
5791 when an @code{asm} statement refers directly to variables or functions
5792 that are otherwise unused.  In that case either the variable/function
5793 shall be listed as an operand of the @code{asm} statement operand or,
5794 in the case of top-level @code{asm} statements the attribute @code{used}
5795 shall be used on the declaration.
5796
5797 @item
5798 Static functions now can use non-standard passing conventions that
5799 may break @code{asm} statements calling functions directly.  Again,
5800 attribute @code{used} will prevent this behavior.
5801 @end itemize
5802
5803 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5804 but this scheme may not be supported by future releases of GCC@.
5805
5806 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5807
5808 @item -fno-toplevel-reorder
5809 Do not reorder top-level functions, variables, and @code{asm}
5810 statements.  Output them in the same order that they appear in the
5811 input file.  When this option is used, unreferenced static variables
5812 will not be removed.  This option is intended to support existing code
5813 which relies on a particular ordering.  For new code, it is better to
5814 use attributes.
5815
5816 @item -fweb
5817 @opindex fweb
5818 Constructs webs as commonly used for register allocation purposes and assign
5819 each web individual pseudo register.  This allows the register allocation pass
5820 to operate on pseudos directly, but also strengthens several other optimization
5821 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5822 however, make debugging impossible, since variables will no longer stay in a
5823 ``home register''.
5824
5825 Enabled by default with @option{-funroll-loops}.
5826
5827 @item -fwhole-program
5828 @opindex fwhole-program
5829 Assume that the current compilation unit represents whole program being
5830 compiled.  All public functions and variables with the exception of @code{main}
5831 and those merged by attribute @code{externally_visible} become static functions
5832 and in a affect gets more aggressively optimized by interprocedural optimizers.
5833 While this option is equivalent to proper use of @code{static} keyword for
5834 programs consisting of single file, in combination with option
5835 @option{--combine} this flag can be used to compile most of smaller scale C
5836 programs since the functions and variables become local for the whole combined
5837 compilation unit, not for the single source file itself.
5838
5839
5840 @item -fno-cprop-registers
5841 @opindex fno-cprop-registers
5842 After register allocation and post-register allocation instruction splitting,
5843 we perform a copy-propagation pass to try to reduce scheduling dependencies
5844 and occasionally eliminate the copy.
5845
5846 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5847
5848 @item -fprofile-generate
5849 @opindex fprofile-generate
5850
5851 Enable options usually used for instrumenting application to produce
5852 profile useful for later recompilation with profile feedback based
5853 optimization.  You must use @option{-fprofile-generate} both when
5854 compiling and when linking your program.
5855
5856 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5857
5858 @item -fprofile-use
5859 @opindex fprofile-use
5860 Enable profile feedback directed optimizations, and optimizations
5861 generally profitable only with profile feedback available.
5862
5863 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5864 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
5865
5866 By default, GCC emits an error message if the feedback profiles do not
5867 match the source code.  This error can be turned into a warning by using
5868 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
5869 code.
5870 @end table
5871
5872 The following options control compiler behavior regarding floating
5873 point arithmetic.  These options trade off between speed and
5874 correctness.  All must be specifically enabled.
5875
5876 @table @gcctabopt
5877 @item -ffloat-store
5878 @opindex ffloat-store
5879 Do not store floating point variables in registers, and inhibit other
5880 options that might change whether a floating point value is taken from a
5881 register or memory.
5882
5883 @cindex floating point precision
5884 This option prevents undesirable excess precision on machines such as
5885 the 68000 where the floating registers (of the 68881) keep more
5886 precision than a @code{double} is supposed to have.  Similarly for the
5887 x86 architecture.  For most programs, the excess precision does only
5888 good, but a few programs rely on the precise definition of IEEE floating
5889 point.  Use @option{-ffloat-store} for such programs, after modifying
5890 them to store all pertinent intermediate computations into variables.
5891
5892 @item -ffast-math
5893 @opindex ffast-math
5894 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5895 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5896 @option{-fno-rounding-math}, @option{-fno-signaling-nans},
5897 @option{-fno-signed-zeros} and @option{fcx-limited-range}.
5898
5899 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5900
5901 This option should never be turned on by any @option{-O} option since
5902 it can result in incorrect output for programs which depend on
5903 an exact implementation of IEEE or ISO rules/specifications for
5904 math functions.
5905
5906 @item -fno-math-errno
5907 @opindex fno-math-errno
5908 Do not set ERRNO after calling math functions that are executed
5909 with a single instruction, e.g., sqrt.  A program that relies on
5910 IEEE exceptions for math error handling may want to use this flag
5911 for speed while maintaining IEEE arithmetic compatibility.
5912
5913 This option should never be turned on by any @option{-O} option since
5914 it can result in incorrect output for programs which depend on
5915 an exact implementation of IEEE or ISO rules/specifications for
5916 math functions.
5917
5918 The default is @option{-fmath-errno}.
5919
5920 On Darwin systems, the math library never sets @code{errno}.  There is
5921 therefore no reason for the compiler to consider the possibility that
5922 it might, and @option{-fno-math-errno} is the default.
5923
5924 @item -funsafe-math-optimizations
5925 @opindex funsafe-math-optimizations
5926 Allow optimizations for floating-point arithmetic that (a) assume
5927 that arguments and results are valid and (b) may violate IEEE or
5928 ANSI standards.  When used at link-time, it may include libraries
5929 or startup files that change the default FPU control word or other
5930 similar optimizations.
5931
5932 This option should never be turned on by any @option{-O} option since
5933 it can result in incorrect output for programs which depend on
5934 an exact implementation of IEEE or ISO rules/specifications for
5935 math functions.
5936
5937 The default is @option{-fno-unsafe-math-optimizations}.
5938
5939 @item -ffinite-math-only
5940 @opindex ffinite-math-only
5941 Allow optimizations for floating-point arithmetic that assume
5942 that arguments and results are not NaNs or +-Infs.
5943
5944 This option should never be turned on by any @option{-O} option since
5945 it can result in incorrect output for programs which depend on
5946 an exact implementation of IEEE or ISO rules/specifications.
5947
5948 The default is @option{-fno-finite-math-only}.
5949
5950 @item -fno-signed-zeros
5951 @opindex fno-signed-zeros
5952 Allow optimizations for floating point arithmetic that ignore the
5953 signedness of zero.  IEEE arithmetic specifies the behavior of
5954 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
5955 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
5956 This option implies that the sign of a zero result isn't significant.
5957
5958 The default is @option{-fsigned-zeros}.
5959
5960 @item -fno-trapping-math
5961 @opindex fno-trapping-math
5962 Compile code assuming that floating-point operations cannot generate
5963 user-visible traps.  These traps include division by zero, overflow,
5964 underflow, inexact result and invalid operation.  This option implies
5965 @option{-fno-signaling-nans}.  Setting this option may allow faster
5966 code if one relies on ``non-stop'' IEEE arithmetic, for example.
5967
5968 This option should never be turned on by any @option{-O} option since
5969 it can result in incorrect output for programs which depend on
5970 an exact implementation of IEEE or ISO rules/specifications for
5971 math functions.
5972
5973 The default is @option{-ftrapping-math}.
5974
5975 @item -frounding-math
5976 @opindex frounding-math
5977 Disable transformations and optimizations that assume default floating
5978 point rounding behavior.  This is round-to-zero for all floating point
5979 to integer conversions, and round-to-nearest for all other arithmetic
5980 truncations.  This option should be specified for programs that change
5981 the FP rounding mode dynamically, or that may be executed with a
5982 non-default rounding mode.  This option disables constant folding of
5983 floating point expressions at compile-time (which may be affected by
5984 rounding mode) and arithmetic transformations that are unsafe in the
5985 presence of sign-dependent rounding modes.
5986
5987 The default is @option{-fno-rounding-math}.
5988
5989 This option is experimental and does not currently guarantee to
5990 disable all GCC optimizations that are affected by rounding mode.
5991 Future versions of GCC may provide finer control of this setting
5992 using C99's @code{FENV_ACCESS} pragma.  This command line option
5993 will be used to specify the default state for @code{FENV_ACCESS}.
5994
5995 @item -frtl-abstract-sequences
5996 @opindex frtl-abstract-sequences
5997 It is a size optimization method. This option is to find identical
5998 sequences of code, which can be turned into pseudo-procedures  and
5999 then  replace  all  occurrences with  calls to  the  newly created
6000 subroutine. It is kind of an opposite of @option{-finline-functions}.
6001 This optimization runs at RTL level.
6002
6003 @item -fsignaling-nans
6004 @opindex fsignaling-nans
6005 Compile code assuming that IEEE signaling NaNs may generate user-visible
6006 traps during floating-point operations.  Setting this option disables
6007 optimizations that may change the number of exceptions visible with
6008 signaling NaNs.  This option implies @option{-ftrapping-math}.
6009
6010 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6011 be defined.
6012
6013 The default is @option{-fno-signaling-nans}.
6014
6015 This option is experimental and does not currently guarantee to
6016 disable all GCC optimizations that affect signaling NaN behavior.
6017
6018 @item -fsingle-precision-constant
6019 @opindex fsingle-precision-constant
6020 Treat floating point constant as single precision constant instead of
6021 implicitly converting it to double precision constant.
6022
6023 @item -fcx-limited-range
6024 @itemx -fno-cx-limited-range
6025 @opindex fcx-limited-range
6026 @opindex fno-cx-limited-range
6027 When enabled, this option states that a range reduction step is not
6028 needed when performing complex division.  The default is
6029 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
6030
6031 This option controls the default setting of the ISO C99 
6032 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6033 all languages.
6034
6035 @end table
6036
6037 The following options control optimizations that may improve
6038 performance, but are not enabled by any @option{-O} options.  This
6039 section includes experimental options that may produce broken code.
6040
6041 @table @gcctabopt
6042 @item -fbranch-probabilities
6043 @opindex fbranch-probabilities
6044 After running a program compiled with @option{-fprofile-arcs}
6045 (@pxref{Debugging Options,, Options for Debugging Your Program or
6046 @command{gcc}}), you can compile it a second time using
6047 @option{-fbranch-probabilities}, to improve optimizations based on
6048 the number of times each branch was taken.  When the program
6049 compiled with @option{-fprofile-arcs} exits it saves arc execution
6050 counts to a file called @file{@var{sourcename}.gcda} for each source
6051 file.  The information in this data file is very dependent on the
6052 structure of the generated code, so you must use the same source code
6053 and the same optimization options for both compilations.
6054
6055 With @option{-fbranch-probabilities}, GCC puts a
6056 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6057 These can be used to improve optimization.  Currently, they are only
6058 used in one place: in @file{reorg.c}, instead of guessing which path a
6059 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6060 exactly determine which path is taken more often.
6061
6062 @item -fprofile-values
6063 @opindex fprofile-values
6064 If combined with @option{-fprofile-arcs}, it adds code so that some
6065 data about values of expressions in the program is gathered.
6066
6067 With @option{-fbranch-probabilities}, it reads back the data gathered
6068 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6069 notes to instructions for their later usage in optimizations.
6070
6071 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6072
6073 @item -fvpt
6074 @opindex fvpt
6075 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6076 a code to gather information about values of expressions.
6077
6078 With @option{-fbranch-probabilities}, it reads back the data gathered
6079 and actually performs the optimizations based on them.
6080 Currently the optimizations include specialization of division operation
6081 using the knowledge about the value of the denominator.
6082
6083 @item -frename-registers
6084 @opindex frename-registers
6085 Attempt to avoid false dependencies in scheduled code by making use
6086 of registers left over after register allocation.  This optimization
6087 will most benefit processors with lots of registers.  Depending on the
6088 debug information format adopted by the target, however, it can
6089 make debugging impossible, since variables will no longer stay in
6090 a ``home register''.
6091
6092 Enabled by default with @option{-funroll-loops}.
6093
6094 @item -ftracer
6095 @opindex ftracer
6096 Perform tail duplication to enlarge superblock size.  This transformation
6097 simplifies the control flow of the function allowing other optimizations to do
6098 better job.
6099
6100 Enabled with @option{-fprofile-use}.
6101
6102 @item -funroll-loops
6103 @opindex funroll-loops
6104 Unroll loops whose number of iterations can be determined at compile time or
6105 upon entry to the loop.  @option{-funroll-loops} implies
6106 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}. 
6107 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6108 small constant number of iterations).  This option makes code larger, and may
6109 or may not make it run faster.
6110
6111 Enabled with @option{-fprofile-use}.
6112
6113 @item -funroll-all-loops
6114 @opindex funroll-all-loops
6115 Unroll all loops, even if their number of iterations is uncertain when
6116 the loop is entered.  This usually makes programs run more slowly.
6117 @option{-funroll-all-loops} implies the same options as
6118 @option{-funroll-loops}.
6119
6120 @item -fpeel-loops
6121 @opindex fpeel-loops
6122 Peels the loops for that there is enough information that they do not
6123 roll much (from profile feedback).  It also turns on complete loop peeling
6124 (i.e.@: complete removal of loops with small constant number of iterations).
6125
6126 Enabled with @option{-fprofile-use}.
6127
6128 @item -fmove-loop-invariants
6129 @opindex fmove-loop-invariants
6130 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6131 at level @option{-O1}
6132
6133 @item -funswitch-loops
6134 @opindex funswitch-loops
6135 Move branches with loop invariant conditions out of the loop, with duplicates
6136 of the loop on both branches (modified according to result of the condition).
6137
6138 @item -ffunction-sections
6139 @itemx -fdata-sections
6140 @opindex ffunction-sections
6141 @opindex fdata-sections
6142 Place each function or data item into its own section in the output
6143 file if the target supports arbitrary sections.  The name of the
6144 function or the name of the data item determines the section's name
6145 in the output file.
6146
6147 Use these options on systems where the linker can perform optimizations
6148 to improve locality of reference in the instruction space.  Most systems
6149 using the ELF object format and SPARC processors running Solaris 2 have
6150 linkers with such optimizations.  AIX may have these optimizations in
6151 the future.
6152
6153 Only use these options when there are significant benefits from doing
6154 so.  When you specify these options, the assembler and linker will
6155 create larger object and executable files and will also be slower.
6156 You will not be able to use @code{gprof} on all systems if you
6157 specify this option and you may have problems with debugging if
6158 you specify both this option and @option{-g}.
6159
6160 @item -fbranch-target-load-optimize
6161 @opindex fbranch-target-load-optimize
6162 Perform branch target register load optimization before prologue / epilogue
6163 threading.
6164 The use of target registers can typically be exposed only during reload,
6165 thus hoisting loads out of loops and doing inter-block scheduling needs
6166 a separate optimization pass.
6167
6168 @item -fbranch-target-load-optimize2
6169 @opindex fbranch-target-load-optimize2
6170 Perform branch target register load optimization after prologue / epilogue
6171 threading.
6172
6173 @item -fbtr-bb-exclusive
6174 @opindex fbtr-bb-exclusive
6175 When performing branch target register load optimization, don't reuse
6176 branch target registers in within any basic block.
6177
6178 @item -fstack-protector
6179 Emit extra code to check for buffer overflows, such as stack smashing
6180 attacks.  This is done by adding a guard variable to functions with
6181 vulnerable objects.  This includes functions that call alloca, and
6182 functions with buffers larger than 8 bytes.  The guards are initialized
6183 when a function is entered and then checked when the function exits.
6184 If a guard check fails, an error message is printed and the program exits.
6185
6186 @item -fstack-protector-all
6187 Like @option{-fstack-protector} except that all functions are protected.
6188
6189 @item -fsection-anchors
6190 @opindex fsection-anchors
6191 Try to reduce the number of symbolic address calculations by using
6192 shared ``anchor'' symbols to address nearby objects.  This transformation
6193 can help to reduce the number of GOT entries and GOT accesses on some
6194 targets.
6195
6196 For example, the implementation of the following function @code{foo}:
6197
6198 @smallexample
6199 static int a, b, c;
6200 int foo (void) @{ return a + b + c; @}
6201 @end smallexample
6202
6203 would usually calculate the addresses of all three variables, but if you
6204 compile it with @option{-fsection-anchors}, it will access the variables
6205 from a common anchor point instead.  The effect is similar to the
6206 following pseudocode (which isn't valid C):
6207
6208 @smallexample
6209 int foo (void)
6210 @{
6211   register int *xr = &x;
6212   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6213 @}
6214 @end smallexample
6215
6216 Not all targets support this option.
6217
6218 @item --param @var{name}=@var{value}
6219 @opindex param
6220 In some places, GCC uses various constants to control the amount of
6221 optimization that is done.  For example, GCC will not inline functions
6222 that contain more that a certain number of instructions.  You can
6223 control some of these constants on the command-line using the
6224 @option{--param} option.
6225
6226 The names of specific parameters, and the meaning of the values, are
6227 tied to the internals of the compiler, and are subject to change
6228 without notice in future releases.
6229
6230 In each case, the @var{value} is an integer.  The allowable choices for
6231 @var{name} are given in the following table:
6232
6233 @table @gcctabopt
6234 @item salias-max-implicit-fields
6235 The maximum number of fields in a variable without direct
6236 structure accesses for which structure aliasing will consider trying 
6237 to track each field.  The default is 5
6238
6239 @item salias-max-array-elements
6240 The maximum number of elements an array can have and its elements
6241 still be tracked individually by structure aliasing. The default is 4
6242
6243 @item sra-max-structure-size
6244 The maximum structure size, in bytes, at which the scalar replacement
6245 of aggregates (SRA) optimization will perform block copies.  The
6246 default value, 0, implies that GCC will select the most appropriate
6247 size itself.
6248
6249 @item sra-field-structure-ratio
6250 The threshold ratio (as a percentage) between instantiated fields and
6251 the complete structure size.  We say that if the ratio of the number
6252 of bytes in instantiated fields to the number of bytes in the complete
6253 structure exceeds this parameter, then block copies are not used.  The
6254 default is 75.
6255
6256 @item max-crossjump-edges
6257 The maximum number of incoming edges to consider for crossjumping.
6258 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6259 the number of edges incoming to each block.  Increasing values mean
6260 more aggressive optimization, making the compile time increase with
6261 probably small improvement in executable size.
6262
6263 @item min-crossjump-insns
6264 The minimum number of instructions which must be matched at the end
6265 of two blocks before crossjumping will be performed on them.  This
6266 value is ignored in the case where all instructions in the block being
6267 crossjumped from are matched.  The default value is 5.
6268
6269 @item max-grow-copy-bb-insns
6270 The maximum code size expansion factor when copying basic blocks
6271 instead of jumping.  The expansion is relative to a jump instruction.
6272 The default value is 8.
6273
6274 @item max-goto-duplication-insns
6275 The maximum number of instructions to duplicate to a block that jumps
6276 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6277 passes, GCC factors computed gotos early in the compilation process,
6278 and unfactors them as late as possible.  Only computed jumps at the
6279 end of a basic blocks with no more than max-goto-duplication-insns are
6280 unfactored.  The default value is 8.
6281
6282 @item max-delay-slot-insn-search
6283 The maximum number of instructions to consider when looking for an
6284 instruction to fill a delay slot.  If more than this arbitrary number of
6285 instructions is searched, the time savings from filling the delay slot
6286 will be minimal so stop searching.  Increasing values mean more
6287 aggressive optimization, making the compile time increase with probably
6288 small improvement in executable run time.
6289
6290 @item max-delay-slot-live-search
6291 When trying to fill delay slots, the maximum number of instructions to
6292 consider when searching for a block with valid live register
6293 information.  Increasing this arbitrarily chosen value means more
6294 aggressive optimization, increasing the compile time.  This parameter
6295 should be removed when the delay slot code is rewritten to maintain the
6296 control-flow graph.
6297
6298 @item max-gcse-memory
6299 The approximate maximum amount of memory that will be allocated in
6300 order to perform the global common subexpression elimination
6301 optimization.  If more memory than specified is required, the
6302 optimization will not be done.
6303
6304 @item max-gcse-passes
6305 The maximum number of passes of GCSE to run.  The default is 1.
6306
6307 @item max-pending-list-length
6308 The maximum number of pending dependencies scheduling will allow
6309 before flushing the current state and starting over.  Large functions
6310 with few branches or calls can create excessively large lists which
6311 needlessly consume memory and resources.
6312
6313 @item max-inline-insns-single
6314 Several parameters control the tree inliner used in gcc.
6315 This number sets the maximum number of instructions (counted in GCC's
6316 internal representation) in a single function that the tree inliner
6317 will consider for inlining.  This only affects functions declared
6318 inline and methods implemented in a class declaration (C++).
6319 The default value is 450.
6320
6321 @item max-inline-insns-auto
6322 When you use @option{-finline-functions} (included in @option{-O3}),
6323 a lot of functions that would otherwise not be considered for inlining
6324 by the compiler will be investigated.  To those functions, a different
6325 (more restrictive) limit compared to functions declared inline can
6326 be applied.
6327 The default value is 90.
6328
6329 @item large-function-insns
6330 The limit specifying really large functions.  For functions larger than this
6331 limit after inlining inlining is constrained by
6332 @option{--param large-function-growth}.  This parameter is useful primarily
6333 to avoid extreme compilation time caused by non-linear algorithms used by the
6334 backend.
6335 This parameter is ignored when @option{-funit-at-a-time} is not used.
6336 The default value is 2700.
6337
6338 @item large-function-growth
6339 Specifies maximal growth of large function caused by inlining in percents.
6340 This parameter is ignored when @option{-funit-at-a-time} is not used.
6341 The default value is 100 which limits large function growth to 2.0 times
6342 the original size.
6343
6344 @item large-unit-insns
6345 The limit specifying large translation unit.  Growth caused by inlining of
6346 units larger than this limit is limited by @option{--param inline-unit-growth}.
6347 For small units this might be too tight (consider unit consisting of function A
6348 that is inline and B that just calls A three time.  If B is small relative to
6349 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6350 large units consisting of small inlininable functions however the overall unit
6351 growth limit is needed to avoid exponential explosion of code size.  Thus for
6352 smaller units, the size is increased to @option{--param large-unit-insns}
6353 before applying @option{--param inline-unit-growth}.  The default is 10000
6354
6355 @item inline-unit-growth
6356 Specifies maximal overall growth of the compilation unit caused by inlining.
6357 This parameter is ignored when @option{-funit-at-a-time} is not used.
6358 The default value is 30 which limits unit growth to 1.3 times the original
6359 size.
6360
6361 @item large-stack-frame
6362 The limit specifying large stack frames.  While inlining the algorithm is trying
6363 to not grow past this limit too much.  Default value is 256 bytes.
6364
6365 @item large-stack-frame-growth
6366 Specifies maximal growth of large stack frames caused by inlining in percents.
6367 The default value is 1000 which limits large stack frame growth to 11 times
6368 the original size.
6369
6370 @item max-inline-insns-recursive
6371 @itemx max-inline-insns-recursive-auto
6372 Specifies maximum number of instructions out-of-line copy of self recursive inline
6373 function can grow into by performing recursive inlining.
6374
6375 For functions declared inline @option{--param max-inline-insns-recursive} is
6376 taken into account.  For function not declared inline, recursive inlining
6377 happens only when @option{-finline-functions} (included in @option{-O3}) is
6378 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6379 default value is 450.
6380
6381 @item max-inline-recursive-depth
6382 @itemx max-inline-recursive-depth-auto
6383 Specifies maximum recursion depth used by the recursive inlining.
6384
6385 For functions declared inline @option{--param max-inline-recursive-depth} is
6386 taken into account.  For function not declared inline, recursive inlining
6387 happens only when @option{-finline-functions} (included in @option{-O3}) is
6388 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6389 default value is 450.
6390
6391 @item min-inline-recursive-probability
6392 Recursive inlining is profitable only for function having deep recursion
6393 in average and can hurt for function having little recursion depth by
6394 increasing the prologue size or complexity of function body to other
6395 optimizers.
6396
6397 When profile feedback is available (see @option{-fprofile-generate}) the actual
6398 recursion depth can be guessed from probability that function will recurse via
6399 given call expression.  This parameter limits inlining only to call expression
6400 whose probability exceeds given threshold (in percents).  The default value is
6401 10.
6402
6403 @item inline-call-cost
6404 Specify cost of call instruction relative to simple arithmetics operations
6405 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6406 functions and at the same time increases size of leaf function that is believed to
6407 reduce function size by being inlined.  In effect it increases amount of
6408 inlining for code having large abstraction penalty (many functions that just
6409 pass the arguments to other functions) and decrease inlining for code with low
6410 abstraction penalty.  The default value is 16.
6411
6412 @item min-vect-loop-bound
6413 The minimum number of iterations under which a loop will not get vectorized 
6414 when @option{-ftree-vectorize} is used.  The number of iterations after 
6415 vectorization needs to be greater than the value specified by this option
6416 to allow vectorization.  The default value is 0.
6417
6418 @item max-unrolled-insns
6419 The maximum number of instructions that a loop should have if that loop
6420 is unrolled, and if the loop is unrolled, it determines how many times
6421 the loop code is unrolled.
6422
6423 @item max-average-unrolled-insns
6424 The maximum number of instructions biased by probabilities of their execution
6425 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6426 it determines how many times the loop code is unrolled.
6427
6428 @item max-unroll-times
6429 The maximum number of unrollings of a single loop.
6430
6431 @item max-peeled-insns
6432 The maximum number of instructions that a loop should have if that loop
6433 is peeled, and if the loop is peeled, it determines how many times
6434 the loop code is peeled.
6435
6436 @item max-peel-times
6437 The maximum number of peelings of a single loop.
6438
6439 @item max-completely-peeled-insns
6440 The maximum number of insns of a completely peeled loop.
6441
6442 @item max-completely-peel-times
6443 The maximum number of iterations of a loop to be suitable for complete peeling.
6444
6445 @item max-unswitch-insns
6446 The maximum number of insns of an unswitched loop.
6447
6448 @item max-unswitch-level
6449 The maximum number of branches unswitched in a single loop.
6450
6451 @item lim-expensive
6452 The minimum cost of an expensive expression in the loop invariant motion.
6453
6454 @item iv-consider-all-candidates-bound
6455 Bound on number of candidates for induction variables below that
6456 all candidates are considered for each use in induction variable
6457 optimizations.  Only the most relevant candidates are considered
6458 if there are more candidates, to avoid quadratic time complexity.
6459
6460 @item iv-max-considered-uses
6461 The induction variable optimizations give up on loops that contain more
6462 induction variable uses.
6463
6464 @item iv-always-prune-cand-set-bound
6465 If number of candidates in the set is smaller than this value,
6466 we always try to remove unnecessary ivs from the set during its
6467 optimization when a new iv is added to the set.
6468
6469 @item scev-max-expr-size
6470 Bound on size of expressions used in the scalar evolutions analyzer.
6471 Large expressions slow the analyzer.
6472
6473 @item omega-max-vars
6474 The maximum number of variables in an Omega constraint system.
6475 The default value is 128.
6476
6477 @item omega-max-geqs
6478 The maximum number of inequalities in an Omega constraint system.
6479 The default value is 256.
6480
6481 @item omega-max-eqs
6482 The maximum number of equalities in an Omega constraint system.
6483 The default value is 128.
6484
6485 @item omega-max-wild-cards
6486 The maximum number of wildcard variables that the Omega solver will
6487 be able to insert.  The default value is 18.
6488
6489 @item omega-hash-table-size
6490 The size of the hash table in the Omega solver.  The default value is
6491 550.
6492
6493 @item omega-max-keys
6494 The maximal number of keys used by the Omega solver.  The default
6495 value is 500.
6496
6497 @item omega-eliminate-redundant-constraints
6498 When set to 1, use expensive methods to eliminate all redundant
6499 constraints.  The default value is 0.
6500
6501 @item vect-max-version-checks
6502 The maximum number of runtime checks that can be performed when doing
6503 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6504 for more information.
6505
6506 @item max-iterations-to-track
6507
6508 The maximum number of iterations of a loop the brute force algorithm
6509 for analysis of # of iterations of the loop tries to evaluate.
6510
6511 @item hot-bb-count-fraction
6512 Select fraction of the maximal count of repetitions of basic block in program
6513 given basic block needs to have to be considered hot.
6514
6515 @item hot-bb-frequency-fraction
6516 Select fraction of the maximal frequency of executions of basic block in
6517 function given basic block needs to have to be considered hot
6518
6519 @item max-predicted-iterations
6520 The maximum number of loop iterations we predict statically.  This is useful
6521 in cases where function contain single loop with known bound and other loop
6522 with unknown.  We predict the known number of iterations correctly, while
6523 the unknown number of iterations average to roughly 10.  This means that the
6524 loop without bounds would appear artificially cold relative to the other one.
6525
6526 @item tracer-dynamic-coverage
6527 @itemx tracer-dynamic-coverage-feedback
6528
6529 This value is used to limit superblock formation once the given percentage of
6530 executed instructions is covered.  This limits unnecessary code size
6531 expansion.
6532
6533 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6534 feedback is available.  The real profiles (as opposed to statically estimated
6535 ones) are much less balanced allowing the threshold to be larger value.
6536
6537 @item tracer-max-code-growth
6538 Stop tail duplication once code growth has reached given percentage.  This is
6539 rather hokey argument, as most of the duplicates will be eliminated later in
6540 cross jumping, so it may be set to much higher values than is the desired code
6541 growth.
6542
6543 @item tracer-min-branch-ratio
6544
6545 Stop reverse growth when the reverse probability of best edge is less than this
6546 threshold (in percent).
6547
6548 @item tracer-min-branch-ratio
6549 @itemx tracer-min-branch-ratio-feedback
6550
6551 Stop forward growth if the best edge do have probability lower than this
6552 threshold.
6553
6554 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6555 compilation for profile feedback and one for compilation without.  The value
6556 for compilation with profile feedback needs to be more conservative (higher) in
6557 order to make tracer effective.
6558
6559 @item max-cse-path-length
6560
6561 Maximum number of basic blocks on path that cse considers.  The default is 10.
6562
6563 @item max-cse-insns
6564 The maximum instructions CSE process before flushing. The default is 1000.
6565
6566 @item max-aliased-vops
6567
6568 Maximum number of virtual operands per statement allowed to represent
6569 aliases before triggering the alias grouping heuristic.  Alias
6570 grouping reduces compile times and memory consumption needed for
6571 aliasing at the expense of precision loss in alias information.
6572
6573 @item ggc-min-expand
6574
6575 GCC uses a garbage collector to manage its own memory allocation.  This
6576 parameter specifies the minimum percentage by which the garbage
6577 collector's heap should be allowed to expand between collections.
6578 Tuning this may improve compilation speed; it has no effect on code
6579 generation.
6580
6581 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6582 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6583 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6584 GCC is not able to calculate RAM on a particular platform, the lower
6585 bound of 30% is used.  Setting this parameter and
6586 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6587 every opportunity.  This is extremely slow, but can be useful for
6588 debugging.
6589
6590 @item ggc-min-heapsize
6591
6592 Minimum size of the garbage collector's heap before it begins bothering
6593 to collect garbage.  The first collection occurs after the heap expands
6594 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6595 tuning this may improve compilation speed, and has no effect on code
6596 generation.
6597
6598 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6599 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6600 with a lower bound of 4096 (four megabytes) and an upper bound of
6601 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6602 particular platform, the lower bound is used.  Setting this parameter
6603 very large effectively disables garbage collection.  Setting this
6604 parameter and @option{ggc-min-expand} to zero causes a full collection
6605 to occur at every opportunity.
6606
6607 @item max-reload-search-insns
6608 The maximum number of instruction reload should look backward for equivalent
6609 register.  Increasing values mean more aggressive optimization, making the
6610 compile time increase with probably slightly better performance.  The default
6611 value is 100.
6612
6613 @item max-cselib-memory-locations
6614 The maximum number of memory locations cselib should take into account.
6615 Increasing values mean more aggressive optimization, making the compile time
6616 increase with probably slightly better performance.  The default value is 500.
6617
6618 @item max-flow-memory-locations
6619 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6620 The default value is 100.
6621
6622 @item reorder-blocks-duplicate
6623 @itemx reorder-blocks-duplicate-feedback
6624
6625 Used by basic block reordering pass to decide whether to use unconditional
6626 branch or duplicate the code on its destination.  Code is duplicated when its
6627 estimated size is smaller than this value multiplied by the estimated size of
6628 unconditional jump in the hot spots of the program.
6629
6630 The @option{reorder-block-duplicate-feedback} is used only when profile
6631 feedback is available and may be set to higher values than
6632 @option{reorder-block-duplicate} since information about the hot spots is more
6633 accurate.
6634
6635 @item max-sched-ready-insns
6636 The maximum number of instructions ready to be issued the scheduler should
6637 consider at any given time during the first scheduling pass.  Increasing
6638 values mean more thorough searches, making the compilation time increase
6639 with probably little benefit.  The default value is 100.
6640
6641 @item max-sched-region-blocks
6642 The maximum number of blocks in a region to be considered for
6643 interblock scheduling.  The default value is 10.
6644
6645 @item max-sched-region-insns
6646 The maximum number of insns in a region to be considered for
6647 interblock scheduling.  The default value is 100.
6648
6649 @item min-spec-prob
6650 The minimum probability (in percents) of reaching a source block
6651 for interblock speculative scheduling.  The default value is 40.
6652
6653 @item max-sched-extend-regions-iters
6654 The maximum number of iterations through CFG to extend regions.
6655 0 - disable region extension,
6656 N - do at most N iterations.
6657 The default value is 0.
6658
6659 @item max-sched-insn-conflict-delay
6660 The maximum conflict delay for an insn to be considered for speculative motion.
6661 The default value is 3.
6662
6663 @item sched-spec-prob-cutoff
6664 The minimal probability of speculation success (in percents), so that
6665 speculative insn will be scheduled.
6666 The default value is 40.
6667
6668 @item max-last-value-rtl
6669
6670 The maximum size measured as number of RTLs that can be recorded in an expression
6671 in combiner for a pseudo register as last known value of that register.  The default
6672 is 10000.
6673
6674 @item integer-share-limit
6675 Small integer constants can use a shared data structure, reducing the
6676 compiler's memory usage and increasing its speed.  This sets the maximum
6677 value of a shared integer constant's.  The default value is 256.
6678
6679 @item min-virtual-mappings
6680 Specifies the minimum number of virtual mappings in the incremental
6681 SSA updater that should be registered to trigger the virtual mappings
6682 heuristic defined by virtual-mappings-ratio.  The default value is
6683 100.
6684
6685 @item virtual-mappings-ratio
6686 If the number of virtual mappings is virtual-mappings-ratio bigger
6687 than the number of virtual symbols to be updated, then the incremental
6688 SSA updater switches to a full update for those symbols.  The default
6689 ratio is 3.
6690
6691 @item ssp-buffer-size
6692 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6693 protection when @option{-fstack-protection} is used.
6694
6695 @item max-jump-thread-duplication-stmts
6696 Maximum number of statements allowed in a block that needs to be
6697 duplicated when threading jumps.
6698
6699 @item max-fields-for-field-sensitive
6700 Maximum number of fields in a structure we will treat in
6701 a field sensitive manner during pointer analysis.
6702
6703 @item prefetch-latency
6704 Estimate on average number of instructions that are executed before
6705 prefetch finishes.  The distance we prefetch ahead is proportional
6706 to this constant.  Increasing this number may also lead to less
6707 streams being prefetched (see @option{simultaneous-prefetches}).
6708
6709 @item simultaneous-prefetches
6710 Maximum number of prefetches that can run at the same time.
6711
6712 @item l1-cache-line-size
6713 The size of cache line in L1 cache, in bytes.
6714
6715 @item l1-cache-size
6716 The number of cache lines in L1 cache.
6717
6718 @item verify-canonical-types
6719 Whether the compiler should verify the ``canonical'' types used for
6720 type equality comparisons within the C++ and Objective-C++ front
6721 ends. Set to 1 (the default when GCC is configured with
6722 --enable-checking) to enable verification, 0 to disable verification
6723 (the default when GCC is configured with --disable-checking).
6724
6725 @end table
6726 @end table
6727
6728 @node Preprocessor Options
6729 @section Options Controlling the Preprocessor
6730 @cindex preprocessor options
6731 @cindex options, preprocessor
6732
6733 These options control the C preprocessor, which is run on each C source
6734 file before actual compilation.
6735
6736 If you use the @option{-E} option, nothing is done except preprocessing.
6737 Some of these options make sense only together with @option{-E} because
6738 they cause the preprocessor output to be unsuitable for actual
6739 compilation.
6740
6741 @table @gcctabopt
6742 @opindex Wp
6743 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6744 and pass @var{option} directly through to the preprocessor.  If
6745 @var{option} contains commas, it is split into multiple options at the
6746 commas.  However, many options are modified, translated or interpreted
6747 by the compiler driver before being passed to the preprocessor, and
6748 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6749 interface is undocumented and subject to change, so whenever possible
6750 you should avoid using @option{-Wp} and let the driver handle the
6751 options instead.
6752
6753 @item -Xpreprocessor @var{option}
6754 @opindex preprocessor
6755 Pass @var{option} as an option to the preprocessor.  You can use this to
6756 supply system-specific preprocessor options which GCC does not know how to
6757 recognize.
6758
6759 If you want to pass an option that takes an argument, you must use
6760 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6761 @end table
6762
6763 @include cppopts.texi
6764
6765 @node Assembler Options
6766 @section Passing Options to the Assembler
6767
6768 @c prevent bad page break with this line
6769 You can pass options to the assembler.
6770
6771 @table @gcctabopt
6772 @item -Wa,@var{option}
6773 @opindex Wa
6774 Pass @var{option} as an option to the assembler.  If @var{option}
6775 contains commas, it is split into multiple options at the commas.
6776
6777 @item -Xassembler @var{option}
6778 @opindex Xassembler
6779 Pass @var{option} as an option to the assembler.  You can use this to
6780 supply system-specific assembler options which GCC does not know how to
6781 recognize.
6782
6783 If you want to pass an option that takes an argument, you must use
6784 @option{-Xassembler} twice, once for the option and once for the argument.
6785
6786 @end table
6787
6788 @node Link Options
6789 @section Options for Linking
6790 @cindex link options
6791 @cindex options, linking
6792
6793 These options come into play when the compiler links object files into
6794 an executable output file.  They are meaningless if the compiler is
6795 not doing a link step.
6796
6797 @table @gcctabopt
6798 @cindex file names
6799 @item @var{object-file-name}
6800 A file name that does not end in a special recognized suffix is
6801 considered to name an object file or library.  (Object files are
6802 distinguished from libraries by the linker according to the file
6803 contents.)  If linking is done, these object files are used as input
6804 to the linker.
6805
6806 @item -c
6807 @itemx -S
6808 @itemx -E
6809 @opindex c
6810 @opindex S
6811 @opindex E
6812 If any of these options is used, then the linker is not run, and
6813 object file names should not be used as arguments.  @xref{Overall
6814 Options}.
6815
6816 @cindex Libraries
6817 @item -l@var{library}
6818 @itemx -l @var{library}
6819 @opindex l
6820 Search the library named @var{library} when linking.  (The second
6821 alternative with the library as a separate argument is only for
6822 POSIX compliance and is not recommended.)
6823
6824 It makes a difference where in the command you write this option; the
6825 linker searches and processes libraries and object files in the order they
6826 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6827 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6828 to functions in @samp{z}, those functions may not be loaded.
6829
6830 The linker searches a standard list of directories for the library,
6831 which is actually a file named @file{lib@var{library}.a}.  The linker
6832 then uses this file as if it had been specified precisely by name.
6833
6834 The directories searched include several standard system directories
6835 plus any that you specify with @option{-L}.
6836
6837 Normally the files found this way are library files---archive files
6838 whose members are object files.  The linker handles an archive file by
6839 scanning through it for members which define symbols that have so far
6840 been referenced but not defined.  But if the file that is found is an
6841 ordinary object file, it is linked in the usual fashion.  The only
6842 difference between using an @option{-l} option and specifying a file name
6843 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6844 and searches several directories.
6845
6846 @item -lobjc
6847 @opindex lobjc
6848 You need this special case of the @option{-l} option in order to
6849 link an Objective-C or Objective-C++ program.
6850
6851 @item -nostartfiles
6852 @opindex nostartfiles
6853 Do not use the standard system startup files when linking.
6854 The standard system libraries are used normally, unless @option{-nostdlib}
6855 or @option{-nodefaultlibs} is used.
6856
6857 @item -nodefaultlibs
6858 @opindex nodefaultlibs
6859 Do not use the standard system libraries when linking.
6860 Only the libraries you specify will be passed to the linker.
6861 The standard startup files are used normally, unless @option{-nostartfiles}
6862 is used.  The compiler may generate calls to @code{memcmp},
6863 @code{memset}, @code{memcpy} and @code{memmove}.
6864 These entries are usually resolved by entries in
6865 libc.  These entry points should be supplied through some other
6866 mechanism when this option is specified.
6867
6868 @item -nostdlib
6869 @opindex nostdlib
6870 Do not use the standard system startup files or libraries when linking.
6871 No startup files and only the libraries you specify will be passed to
6872 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6873 @code{memcpy} and @code{memmove}.
6874 These entries are usually resolved by entries in
6875 libc.  These entry points should be supplied through some other
6876 mechanism when this option is specified.
6877
6878 @cindex @option{-lgcc}, use with @option{-nostdlib}
6879 @cindex @option{-nostdlib} and unresolved references
6880 @cindex unresolved references and @option{-nostdlib}
6881 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6882 @cindex @option{-nodefaultlibs} and unresolved references
6883 @cindex unresolved references and @option{-nodefaultlibs}
6884 One of the standard libraries bypassed by @option{-nostdlib} and
6885 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6886 that GCC uses to overcome shortcomings of particular machines, or special
6887 needs for some languages.
6888 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6889 Collection (GCC) Internals},
6890 for more discussion of @file{libgcc.a}.)
6891 In most cases, you need @file{libgcc.a} even when you want to avoid
6892 other standard libraries.  In other words, when you specify @option{-nostdlib}
6893 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6894 This ensures that you have no unresolved references to internal GCC
6895 library subroutines.  (For example, @samp{__main}, used to ensure C++
6896 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6897 GNU Compiler Collection (GCC) Internals}.)
6898
6899 @item -pie
6900 @opindex pie
6901 Produce a position independent executable on targets which support it.
6902 For predictable results, you must also specify the same set of options
6903 that were used to generate code (@option{-fpie}, @option{-fPIE},
6904 or model suboptions) when you specify this option.
6905
6906 @item -rdynamic
6907 @opindex rdynamic
6908 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6909 that support it. This instructs the linker to add all symbols, not
6910 only used ones, to the dynamic symbol table. This option is needed
6911 for some uses of @code{dlopen} or to allow obtaining backtraces
6912 from within a program.
6913
6914 @item -s
6915 @opindex s
6916 Remove all symbol table and relocation information from the executable.
6917
6918 @item -static
6919 @opindex static
6920 On systems that support dynamic linking, this prevents linking with the shared
6921 libraries.  On other systems, this option has no effect.
6922
6923 @item -shared
6924 @opindex shared
6925 Produce a shared object which can then be linked with other objects to
6926 form an executable.  Not all systems support this option.  For predictable
6927 results, you must also specify the same set of options that were used to
6928 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6929 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6930 needs to build supplementary stub code for constructors to work.  On
6931 multi-libbed systems, @samp{gcc -shared} must select the correct support
6932 libraries to link against.  Failing to supply the correct flags may lead
6933 to subtle defects.  Supplying them in cases where they are not necessary
6934 is innocuous.}
6935
6936 @item -shared-libgcc
6937 @itemx -static-libgcc
6938 @opindex shared-libgcc
6939 @opindex static-libgcc
6940 On systems that provide @file{libgcc} as a shared library, these options
6941 force the use of either the shared or static version respectively.
6942 If no shared version of @file{libgcc} was built when the compiler was
6943 configured, these options have no effect.
6944
6945 There are several situations in which an application should use the
6946 shared @file{libgcc} instead of the static version.  The most common
6947 of these is when the application wishes to throw and catch exceptions
6948 across different shared libraries.  In that case, each of the libraries
6949 as well as the application itself should use the shared @file{libgcc}.
6950
6951 Therefore, the G++ and GCJ drivers automatically add
6952 @option{-shared-libgcc} whenever you build a shared library or a main
6953 executable, because C++ and Java programs typically use exceptions, so
6954 this is the right thing to do.
6955
6956 If, instead, you use the GCC driver to create shared libraries, you may
6957 find that they will not always be linked with the shared @file{libgcc}.
6958 If GCC finds, at its configuration time, that you have a non-GNU linker
6959 or a GNU linker that does not support option @option{--eh-frame-hdr},
6960 it will link the shared version of @file{libgcc} into shared libraries
6961 by default.  Otherwise, it will take advantage of the linker and optimize
6962 away the linking with the shared version of @file{libgcc}, linking with
6963 the static version of libgcc by default.  This allows exceptions to
6964 propagate through such shared libraries, without incurring relocation
6965 costs at library load time.
6966
6967 However, if a library or main executable is supposed to throw or catch
6968 exceptions, you must link it using the G++ or GCJ driver, as appropriate
6969 for the languages used in the program, or using the option
6970 @option{-shared-libgcc}, such that it is linked with the shared
6971 @file{libgcc}.
6972
6973 @item -symbolic
6974 @opindex symbolic
6975 Bind references to global symbols when building a shared object.  Warn
6976 about any unresolved references (unless overridden by the link editor
6977 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
6978 this option.
6979
6980 @item -Xlinker @var{option}
6981 @opindex Xlinker
6982 Pass @var{option} as an option to the linker.  You can use this to
6983 supply system-specific linker options which GCC does not know how to
6984 recognize.
6985
6986 If you want to pass an option that takes an argument, you must use
6987 @option{-Xlinker} twice, once for the option and once for the argument.
6988 For example, to pass @option{-assert definitions}, you must write
6989 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
6990 @option{-Xlinker "-assert definitions"}, because this passes the entire
6991 string as a single argument, which is not what the linker expects.
6992
6993 @item -Wl,@var{option}
6994 @opindex Wl
6995 Pass @var{option} as an option to the linker.  If @var{option} contains
6996 commas, it is split into multiple options at the commas.
6997
6998 @item -u @var{symbol}
6999 @opindex u
7000 Pretend the symbol @var{symbol} is undefined, to force linking of
7001 library modules to define it.  You can use @option{-u} multiple times with
7002 different symbols to force loading of additional library modules.
7003 @end table
7004
7005 @node Directory Options
7006 @section Options for Directory Search
7007 @cindex directory options
7008 @cindex options, directory search
7009 @cindex search path
7010
7011 These options specify directories to search for header files, for
7012 libraries and for parts of the compiler:
7013
7014 @table @gcctabopt
7015 @item -I@var{dir}
7016 @opindex I
7017 Add the directory @var{dir} to the head of the list of directories to be
7018 searched for header files.  This can be used to override a system header
7019 file, substituting your own version, since these directories are
7020 searched before the system header file directories.  However, you should
7021 not use this option to add directories that contain vendor-supplied
7022 system header files (use @option{-isystem} for that).  If you use more than
7023 one @option{-I} option, the directories are scanned in left-to-right
7024 order; the standard system directories come after.
7025
7026 If a standard system include directory, or a directory specified with
7027 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7028 option will be ignored.  The directory will still be searched but as a
7029 system directory at its normal position in the system include chain.
7030 This is to ensure that GCC's procedure to fix buggy system headers and
7031 the ordering for the include_next directive are not inadvertently changed.
7032 If you really need to change the search order for system directories,
7033 use the @option{-nostdinc} and/or @option{-isystem} options.
7034
7035 @item -iquote@var{dir}
7036 @opindex iquote
7037 Add the directory @var{dir} to the head of the list of directories to
7038 be searched for header files only for the case of @samp{#include
7039 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7040 otherwise just like @option{-I}.
7041
7042 @item -L@var{dir}
7043 @opindex L
7044 Add directory @var{dir} to the list of directories to be searched
7045 for @option{-l}.
7046
7047 @item -B@var{prefix}
7048 @opindex B
7049 This option specifies where to find the executables, libraries,
7050 include files, and data files of the compiler itself.
7051
7052 The compiler driver program runs one or more of the subprograms
7053 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7054 @var{prefix} as a prefix for each program it tries to run, both with and
7055 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7056
7057 For each subprogram to be run, the compiler driver first tries the
7058 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7059 was not specified, the driver tries two standard prefixes, which are
7060 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7061 those results in a file name that is found, the unmodified program
7062 name is searched for using the directories specified in your
7063 @env{PATH} environment variable.
7064
7065 The compiler will check to see if the path provided by the @option{-B}
7066 refers to a directory, and if necessary it will add a directory
7067 separator character at the end of the path.
7068
7069 @option{-B} prefixes that effectively specify directory names also apply
7070 to libraries in the linker, because the compiler translates these
7071 options into @option{-L} options for the linker.  They also apply to
7072 includes files in the preprocessor, because the compiler translates these
7073 options into @option{-isystem} options for the preprocessor.  In this case,
7074 the compiler appends @samp{include} to the prefix.
7075
7076 The run-time support file @file{libgcc.a} can also be searched for using
7077 the @option{-B} prefix, if needed.  If it is not found there, the two
7078 standard prefixes above are tried, and that is all.  The file is left
7079 out of the link if it is not found by those means.
7080
7081 Another way to specify a prefix much like the @option{-B} prefix is to use
7082 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7083 Variables}.
7084
7085 As a special kludge, if the path provided by @option{-B} is
7086 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7087 9, then it will be replaced by @file{[dir/]include}.  This is to help
7088 with boot-strapping the compiler.
7089
7090 @item -specs=@var{file}
7091 @opindex specs
7092 Process @var{file} after the compiler reads in the standard @file{specs}
7093 file, in order to override the defaults that the @file{gcc} driver
7094 program uses when determining what switches to pass to @file{cc1},
7095 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7096 @option{-specs=@var{file}} can be specified on the command line, and they
7097 are processed in order, from left to right.
7098
7099 @item --sysroot=@var{dir}
7100 @opindex sysroot
7101 Use @var{dir} as the logical root directory for headers and libraries.
7102 For example, if the compiler would normally search for headers in
7103 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7104 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.  
7105
7106 If you use both this option and the @option{-isysroot} option, then
7107 the @option{--sysroot} option will apply to libraries, but the
7108 @option{-isysroot} option will apply to header files.
7109
7110 The GNU linker (beginning with version 2.16) has the necessary support
7111 for this option.  If your linker does not support this option, the
7112 header file aspect of @option{--sysroot} will still work, but the
7113 library aspect will not.
7114
7115 @item -I-
7116 @opindex I-
7117 This option has been deprecated.  Please use @option{-iquote} instead for
7118 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7119 Any directories you specify with @option{-I} options before the @option{-I-}
7120 option are searched only for the case of @samp{#include "@var{file}"};
7121 they are not searched for @samp{#include <@var{file}>}.
7122
7123 If additional directories are specified with @option{-I} options after
7124 the @option{-I-}, these directories are searched for all @samp{#include}
7125 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7126 this way.)
7127
7128 In addition, the @option{-I-} option inhibits the use of the current
7129 directory (where the current input file came from) as the first search
7130 directory for @samp{#include "@var{file}"}.  There is no way to
7131 override this effect of @option{-I-}.  With @option{-I.} you can specify
7132 searching the directory which was current when the compiler was
7133 invoked.  That is not exactly the same as what the preprocessor does
7134 by default, but it is often satisfactory.
7135
7136 @option{-I-} does not inhibit the use of the standard system directories
7137 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7138 independent.
7139 @end table
7140
7141 @c man end
7142
7143 @node Spec Files
7144 @section Specifying subprocesses and the switches to pass to them
7145 @cindex Spec Files
7146
7147 @command{gcc} is a driver program.  It performs its job by invoking a
7148 sequence of other programs to do the work of compiling, assembling and
7149 linking.  GCC interprets its command-line parameters and uses these to
7150 deduce which programs it should invoke, and which command-line options
7151 it ought to place on their command lines.  This behavior is controlled
7152 by @dfn{spec strings}.  In most cases there is one spec string for each
7153 program that GCC can invoke, but a few programs have multiple spec
7154 strings to control their behavior.  The spec strings built into GCC can
7155 be overridden by using the @option{-specs=} command-line switch to specify
7156 a spec file.
7157
7158 @dfn{Spec files} are plaintext files that are used to construct spec
7159 strings.  They consist of a sequence of directives separated by blank
7160 lines.  The type of directive is determined by the first non-whitespace
7161 character on the line and it can be one of the following:
7162
7163 @table @code
7164 @item %@var{command}
7165 Issues a @var{command} to the spec file processor.  The commands that can
7166 appear here are:
7167
7168 @table @code
7169 @item %include <@var{file}>
7170 @cindex %include
7171 Search for @var{file} and insert its text at the current point in the
7172 specs file.
7173
7174 @item %include_noerr <@var{file}>
7175 @cindex %include_noerr
7176 Just like @samp{%include}, but do not generate an error message if the include
7177 file cannot be found.
7178
7179 @item %rename @var{old_name} @var{new_name}
7180 @cindex %rename
7181 Rename the spec string @var{old_name} to @var{new_name}.
7182
7183 @end table
7184
7185 @item *[@var{spec_name}]:
7186 This tells the compiler to create, override or delete the named spec
7187 string.  All lines after this directive up to the next directive or
7188 blank line are considered to be the text for the spec string.  If this
7189 results in an empty string then the spec will be deleted.  (Or, if the
7190 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7191 does not currently exist a new spec will be created.  If the spec does
7192 exist then its contents will be overridden by the text of this
7193 directive, unless the first character of that text is the @samp{+}
7194 character, in which case the text will be appended to the spec.
7195
7196 @item [@var{suffix}]:
7197 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7198 and up to the next directive or blank line are considered to make up the
7199 spec string for the indicated suffix.  When the compiler encounters an
7200 input file with the named suffix, it will processes the spec string in
7201 order to work out how to compile that file.  For example:
7202
7203 @smallexample
7204 .ZZ:
7205 z-compile -input %i
7206 @end smallexample
7207
7208 This says that any input file whose name ends in @samp{.ZZ} should be
7209 passed to the program @samp{z-compile}, which should be invoked with the
7210 command-line switch @option{-input} and with the result of performing the
7211 @samp{%i} substitution.  (See below.)
7212
7213 As an alternative to providing a spec string, the text that follows a
7214 suffix directive can be one of the following:
7215
7216 @table @code
7217 @item @@@var{language}
7218 This says that the suffix is an alias for a known @var{language}.  This is
7219 similar to using the @option{-x} command-line switch to GCC to specify a
7220 language explicitly.  For example:
7221
7222 @smallexample
7223 .ZZ:
7224 @@c++
7225 @end smallexample
7226
7227 Says that .ZZ files are, in fact, C++ source files.
7228
7229 @item #@var{name}
7230 This causes an error messages saying:
7231
7232 @smallexample
7233 @var{name} compiler not installed on this system.
7234 @end smallexample
7235 @end table
7236
7237 GCC already has an extensive list of suffixes built into it.
7238 This directive will add an entry to the end of the list of suffixes, but
7239 since the list is searched from the end backwards, it is effectively
7240 possible to override earlier entries using this technique.
7241
7242 @end table
7243
7244 GCC has the following spec strings built into it.  Spec files can
7245 override these strings or create their own.  Note that individual
7246 targets can also add their own spec strings to this list.
7247
7248 @smallexample
7249 asm          Options to pass to the assembler
7250 asm_final    Options to pass to the assembler post-processor
7251 cpp          Options to pass to the C preprocessor
7252 cc1          Options to pass to the C compiler
7253 cc1plus      Options to pass to the C++ compiler
7254 endfile      Object files to include at the end of the link
7255 link         Options to pass to the linker
7256 lib          Libraries to include on the command line to the linker
7257 libgcc       Decides which GCC support library to pass to the linker
7258 linker       Sets the name of the linker
7259 predefines   Defines to be passed to the C preprocessor
7260 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7261              by default
7262 startfile    Object files to include at the start of the link
7263 @end smallexample
7264
7265 Here is a small example of a spec file:
7266
7267 @smallexample
7268 %rename lib                 old_lib
7269
7270 *lib:
7271 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7272 @end smallexample
7273
7274 This example renames the spec called @samp{lib} to @samp{old_lib} and
7275 then overrides the previous definition of @samp{lib} with a new one.
7276 The new definition adds in some extra command-line options before
7277 including the text of the old definition.
7278
7279 @dfn{Spec strings} are a list of command-line options to be passed to their
7280 corresponding program.  In addition, the spec strings can contain
7281 @samp{%}-prefixed sequences to substitute variable text or to
7282 conditionally insert text into the command line.  Using these constructs
7283 it is possible to generate quite complex command lines.
7284
7285 Here is a table of all defined @samp{%}-sequences for spec
7286 strings.  Note that spaces are not generated automatically around the
7287 results of expanding these sequences.  Therefore you can concatenate them
7288 together or combine them with constant text in a single argument.
7289
7290 @table @code
7291 @item %%
7292 Substitute one @samp{%} into the program name or argument.
7293
7294 @item %i
7295 Substitute the name of the input file being processed.
7296
7297 @item %b
7298 Substitute the basename of the input file being processed.
7299 This is the substring up to (and not including) the last period
7300 and not including the directory.
7301
7302 @item %B
7303 This is the same as @samp{%b}, but include the file suffix (text after
7304 the last period).
7305
7306 @item %d
7307 Marks the argument containing or following the @samp{%d} as a
7308 temporary file name, so that that file will be deleted if GCC exits
7309 successfully.  Unlike @samp{%g}, this contributes no text to the
7310 argument.
7311
7312 @item %g@var{suffix}
7313 Substitute a file name that has suffix @var{suffix} and is chosen
7314 once per compilation, and mark the argument in the same way as
7315 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7316 name is now chosen in a way that is hard to predict even when previously
7317 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7318 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7319 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7320 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7321 was simply substituted with a file name chosen once per compilation,
7322 without regard to any appended suffix (which was therefore treated
7323 just like ordinary text), making such attacks more likely to succeed.
7324
7325 @item %u@var{suffix}
7326 Like @samp{%g}, but generates a new temporary file name even if
7327 @samp{%u@var{suffix}} was already seen.
7328
7329 @item %U@var{suffix}
7330 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7331 new one if there is no such last file name.  In the absence of any
7332 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7333 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7334 would involve the generation of two distinct file names, one
7335 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7336 simply substituted with a file name chosen for the previous @samp{%u},
7337 without regard to any appended suffix.
7338
7339 @item %j@var{suffix}
7340 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7341 writable, and if save-temps is off; otherwise, substitute the name
7342 of a temporary file, just like @samp{%u}.  This temporary file is not
7343 meant for communication between processes, but rather as a junk
7344 disposal mechanism.
7345
7346 @item %|@var{suffix}
7347 @itemx %m@var{suffix}
7348 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7349 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7350 all.  These are the two most common ways to instruct a program that it
7351 should read from standard input or write to standard output.  If you
7352 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7353 construct: see for example @file{f/lang-specs.h}.
7354
7355 @item %.@var{SUFFIX}
7356 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7357 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7358 terminated by the next space or %.
7359
7360 @item %w
7361 Marks the argument containing or following the @samp{%w} as the
7362 designated output file of this compilation.  This puts the argument
7363 into the sequence of arguments that @samp{%o} will substitute later.
7364
7365 @item %o
7366 Substitutes the names of all the output files, with spaces
7367 automatically placed around them.  You should write spaces
7368 around the @samp{%o} as well or the results are undefined.
7369 @samp{%o} is for use in the specs for running the linker.
7370 Input files whose names have no recognized suffix are not compiled
7371 at all, but they are included among the output files, so they will
7372 be linked.
7373
7374 @item %O
7375 Substitutes the suffix for object files.  Note that this is
7376 handled specially when it immediately follows @samp{%g, %u, or %U},
7377 because of the need for those to form complete file names.  The
7378 handling is such that @samp{%O} is treated exactly as if it had already
7379 been substituted, except that @samp{%g, %u, and %U} do not currently
7380 support additional @var{suffix} characters following @samp{%O} as they would
7381 following, for example, @samp{.o}.
7382
7383 @item %p
7384 Substitutes the standard macro predefinitions for the
7385 current target machine.  Use this when running @code{cpp}.
7386
7387 @item %P
7388 Like @samp{%p}, but puts @samp{__} before and after the name of each
7389 predefined macro, except for macros that start with @samp{__} or with
7390 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7391 C@.
7392
7393 @item %I
7394 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7395 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7396 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7397 and @option{-imultilib} as necessary.
7398
7399 @item %s
7400 Current argument is the name of a library or startup file of some sort.
7401 Search for that file in a standard list of directories and substitute
7402 the full name found.
7403
7404 @item %e@var{str}
7405 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7406 Use this when inconsistent options are detected.
7407
7408 @item %(@var{name})
7409 Substitute the contents of spec string @var{name} at this point.
7410
7411 @item %[@var{name}]
7412 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7413
7414 @item %x@{@var{option}@}
7415 Accumulate an option for @samp{%X}.
7416
7417 @item %X
7418 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7419 spec string.
7420
7421 @item %Y
7422 Output the accumulated assembler options specified by @option{-Wa}.
7423
7424 @item %Z
7425 Output the accumulated preprocessor options specified by @option{-Wp}.
7426
7427 @item %a
7428 Process the @code{asm} spec.  This is used to compute the
7429 switches to be passed to the assembler.
7430
7431 @item %A
7432 Process the @code{asm_final} spec.  This is a spec string for
7433 passing switches to an assembler post-processor, if such a program is
7434 needed.
7435
7436 @item %l
7437 Process the @code{link} spec.  This is the spec for computing the
7438 command line passed to the linker.  Typically it will make use of the
7439 @samp{%L %G %S %D and %E} sequences.
7440
7441 @item %D
7442 Dump out a @option{-L} option for each directory that GCC believes might
7443 contain startup files.  If the target supports multilibs then the
7444 current multilib directory will be prepended to each of these paths.
7445
7446 @item %L
7447 Process the @code{lib} spec.  This is a spec string for deciding which
7448 libraries should be included on the command line to the linker.
7449
7450 @item %G
7451 Process the @code{libgcc} spec.  This is a spec string for deciding
7452 which GCC support library should be included on the command line to the linker.
7453
7454 @item %S
7455 Process the @code{startfile} spec.  This is a spec for deciding which
7456 object files should be the first ones passed to the linker.  Typically
7457 this might be a file named @file{crt0.o}.
7458
7459 @item %E
7460 Process the @code{endfile} spec.  This is a spec string that specifies
7461 the last object files that will be passed to the linker.
7462
7463 @item %C
7464 Process the @code{cpp} spec.  This is used to construct the arguments
7465 to be passed to the C preprocessor.
7466
7467 @item %1
7468 Process the @code{cc1} spec.  This is used to construct the options to be
7469 passed to the actual C compiler (@samp{cc1}).
7470
7471 @item %2
7472 Process the @code{cc1plus} spec.  This is used to construct the options to be
7473 passed to the actual C++ compiler (@samp{cc1plus}).
7474
7475 @item %*
7476 Substitute the variable part of a matched option.  See below.
7477 Note that each comma in the substituted string is replaced by
7478 a single space.
7479
7480 @item %<@code{S}
7481 Remove all occurrences of @code{-S} from the command line.  Note---this
7482 command is position dependent.  @samp{%} commands in the spec string
7483 before this one will see @code{-S}, @samp{%} commands in the spec string
7484 after this one will not.
7485
7486 @item %:@var{function}(@var{args})
7487 Call the named function @var{function}, passing it @var{args}.
7488 @var{args} is first processed as a nested spec string, then split
7489 into an argument vector in the usual fashion.  The function returns
7490 a string which is processed as if it had appeared literally as part
7491 of the current spec.
7492
7493 The following built-in spec functions are provided:
7494
7495 @table @code
7496 @item @code{getenv}
7497 The @code{getenv} spec function takes two arguments: an environment
7498 variable name and a string.  If the environment variable is not
7499 defined, a fatal error is issued.  Otherwise, the return value is the
7500 value of the environment variable concatenated with the string.  For
7501 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
7502
7503 @smallexample
7504 %:getenv(TOPDIR /include)
7505 @end smallexample
7506
7507 expands to @file{/path/to/top/include}.
7508
7509 @item @code{if-exists}
7510 The @code{if-exists} spec function takes one argument, an absolute
7511 pathname to a file.  If the file exists, @code{if-exists} returns the
7512 pathname.  Here is a small example of its usage:
7513
7514 @smallexample
7515 *startfile:
7516 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7517 @end smallexample
7518
7519 @item @code{if-exists-else}
7520 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7521 spec function, except that it takes two arguments.  The first argument is
7522 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7523 returns the pathname.  If it does not exist, it returns the second argument.
7524 This way, @code{if-exists-else} can be used to select one file or another,
7525 based on the existence of the first.  Here is a small example of its usage:
7526
7527 @smallexample
7528 *startfile:
7529 crt0%O%s %:if-exists(crti%O%s) \
7530 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7531 @end smallexample
7532
7533 @item @code{replace-outfile}
7534 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7535 first argument in the outfiles array and replaces it with the second argument.  Here
7536 is a small example of its usage:
7537
7538 @smallexample
7539 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7540 @end smallexample
7541
7542 @end table
7543
7544 @item %@{@code{S}@}
7545 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7546 If that switch was not specified, this substitutes nothing.  Note that
7547 the leading dash is omitted when specifying this option, and it is
7548 automatically inserted if the substitution is performed.  Thus the spec
7549 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7550 and would output the command line option @option{-foo}.
7551
7552 @item %W@{@code{S}@}
7553 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7554 deleted on failure.
7555
7556 @item %@{@code{S}*@}
7557 Substitutes all the switches specified to GCC whose names start
7558 with @code{-S}, but which also take an argument.  This is used for
7559 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7560 GCC considers @option{-o foo} as being
7561 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7562 text, including the space.  Thus two arguments would be generated.
7563
7564 @item %@{@code{S}*&@code{T}*@}
7565 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7566 (the order of @code{S} and @code{T} in the spec is not significant).
7567 There can be any number of ampersand-separated variables; for each the
7568 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7569
7570 @item %@{@code{S}:@code{X}@}
7571 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7572
7573 @item %@{!@code{S}:@code{X}@}
7574 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7575
7576 @item %@{@code{S}*:@code{X}@}
7577 Substitutes @code{X} if one or more switches whose names start with
7578 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7579 once, no matter how many such switches appeared.  However, if @code{%*}
7580 appears somewhere in @code{X}, then @code{X} will be substituted once
7581 for each matching switch, with the @code{%*} replaced by the part of
7582 that switch that matched the @code{*}.
7583
7584 @item %@{.@code{S}:@code{X}@}
7585 Substitutes @code{X}, if processing a file with suffix @code{S}.
7586
7587 @item %@{!.@code{S}:@code{X}@}
7588 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7589
7590 @item %@{@code{S}|@code{P}:@code{X}@}
7591 Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@.
7592 This may be combined with @samp{!}, @samp{.}, and @code{*} sequences as well,
7593 although they have a stronger binding than the @samp{|}.  If @code{%*}
7594 appears in @code{X}, all of the alternatives must be starred, and only
7595 the first matching alternative is substituted.
7596
7597 For example, a spec string like this:
7598
7599 @smallexample
7600 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7601 @end smallexample
7602
7603 will output the following command-line options from the following input
7604 command-line options:
7605
7606 @smallexample
7607 fred.c        -foo -baz
7608 jim.d         -bar -boggle
7609 -d fred.c     -foo -baz -boggle
7610 -d jim.d      -bar -baz -boggle
7611 @end smallexample
7612
7613 @item %@{S:X; T:Y; :D@}
7614
7615 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7616 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7617 be as many clauses as you need.  This may be combined with @code{.},
7618 @code{!}, @code{|}, and @code{*} as needed.
7619
7620
7621 @end table
7622
7623 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7624 construct may contain other nested @samp{%} constructs or spaces, or
7625 even newlines.  They are processed as usual, as described above.
7626 Trailing white space in @code{X} is ignored.  White space may also
7627 appear anywhere on the left side of the colon in these constructs,
7628 except between @code{.} or @code{*} and the corresponding word.
7629
7630 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7631 handled specifically in these constructs.  If another value of
7632 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7633 @option{-W} switch is found later in the command line, the earlier
7634 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7635 just one letter, which passes all matching options.
7636
7637 The character @samp{|} at the beginning of the predicate text is used to
7638 indicate that a command should be piped to the following command, but
7639 only if @option{-pipe} is specified.
7640
7641 It is built into GCC which switches take arguments and which do not.
7642 (You might think it would be useful to generalize this to allow each
7643 compiler's spec to say which switches take arguments.  But this cannot
7644 be done in a consistent fashion.  GCC cannot even decide which input
7645 files have been specified without knowing which switches take arguments,
7646 and it must know which input files to compile in order to tell which
7647 compilers to run).
7648
7649 GCC also knows implicitly that arguments starting in @option{-l} are to be
7650 treated as compiler output files, and passed to the linker in their
7651 proper position among the other output files.
7652
7653 @c man begin OPTIONS
7654
7655 @node Target Options
7656 @section Specifying Target Machine and Compiler Version
7657 @cindex target options
7658 @cindex cross compiling
7659 @cindex specifying machine version
7660 @cindex specifying compiler version and target machine
7661 @cindex compiler version, specifying
7662 @cindex target machine, specifying
7663
7664 The usual way to run GCC is to run the executable called @file{gcc}, or
7665 @file{<machine>-gcc} when cross-compiling, or
7666 @file{<machine>-gcc-<version>} to run a version other than the one that
7667 was installed last.  Sometimes this is inconvenient, so GCC provides
7668 options that will switch to another cross-compiler or version.
7669
7670 @table @gcctabopt
7671 @item -b @var{machine}
7672 @opindex b
7673 The argument @var{machine} specifies the target machine for compilation.
7674
7675 The value to use for @var{machine} is the same as was specified as the
7676 machine type when configuring GCC as a cross-compiler.  For
7677 example, if a cross-compiler was configured with @samp{configure
7678 arm-elf}, meaning to compile for an arm processor with elf binaries,
7679 then you would specify @option{-b arm-elf} to run that cross compiler.
7680 Because there are other options beginning with @option{-b}, the
7681 configuration must contain a hyphen. 
7682
7683 @item -V @var{version}
7684 @opindex V
7685 The argument @var{version} specifies which version of GCC to run.
7686 This is useful when multiple versions are installed.  For example,
7687 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7688 @end table
7689
7690 The @option{-V} and @option{-b} options work by running the
7691 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7692 use them if you can just run that directly.
7693
7694 @node Submodel Options
7695 @section Hardware Models and Configurations
7696 @cindex submodel options
7697 @cindex specifying hardware config
7698 @cindex hardware models and configurations, specifying
7699 @cindex machine dependent options
7700
7701 Earlier we discussed the standard option @option{-b} which chooses among
7702 different installed compilers for completely different target
7703 machines, such as VAX vs.@: 68000 vs.@: 80386.
7704
7705 In addition, each of these target machine types can have its own
7706 special options, starting with @samp{-m}, to choose among various
7707 hardware models or configurations---for example, 68010 vs 68020,
7708 floating coprocessor or none.  A single installed version of the
7709 compiler can compile for any model or configuration, according to the
7710 options specified.
7711
7712 Some configurations of the compiler also support additional special
7713 options, usually for compatibility with other compilers on the same
7714 platform.
7715
7716 @c This list is ordered alphanumerically by subsection name.
7717 @c It should be the same order and spelling as these options are listed
7718 @c in Machine Dependent Options
7719
7720 @menu
7721 * ARC Options::
7722 * ARM Options::
7723 * AVR Options::
7724 * Blackfin Options::
7725 * CRIS Options::
7726 * CRX Options::
7727 * Darwin Options::
7728 * DEC Alpha Options::
7729 * DEC Alpha/VMS Options::
7730 * FRV Options::
7731 * GNU/Linux Options::
7732 * H8/300 Options::
7733 * HPPA Options::
7734 * i386 and x86-64 Options::
7735 * IA-64 Options::
7736 * M32C Options::
7737 * M32R/D Options::
7738 * M680x0 Options::
7739 * M68hc1x Options::
7740 * MCore Options::
7741 * MIPS Options::
7742 * MMIX Options::
7743 * MN10300 Options::
7744 * MT Options::
7745 * PDP-11 Options::
7746 * PowerPC Options::
7747 * RS/6000 and PowerPC Options::
7748 * S/390 and zSeries Options::
7749 * Score Options::
7750 * SH Options::
7751 * SPARC Options::
7752 * SPU Options::
7753 * System V Options::
7754 * TMS320C3x/C4x Options::
7755 * V850 Options::
7756 * VAX Options::
7757 * x86-64 Options::
7758 * Xstormy16 Options::
7759 * Xtensa Options::
7760 * zSeries Options::
7761 @end menu
7762
7763 @node ARC Options
7764 @subsection ARC Options
7765 @cindex ARC Options
7766
7767 These options are defined for ARC implementations:
7768
7769 @table @gcctabopt
7770 @item -EL
7771 @opindex EL
7772 Compile code for little endian mode.  This is the default.
7773
7774 @item -EB
7775 @opindex EB
7776 Compile code for big endian mode.
7777
7778 @item -mmangle-cpu
7779 @opindex mmangle-cpu
7780 Prepend the name of the cpu to all public symbol names.
7781 In multiple-processor systems, there are many ARC variants with different
7782 instruction and register set characteristics.  This flag prevents code
7783 compiled for one cpu to be linked with code compiled for another.
7784 No facility exists for handling variants that are ``almost identical''.
7785 This is an all or nothing option.
7786
7787 @item -mcpu=@var{cpu}
7788 @opindex mcpu
7789 Compile code for ARC variant @var{cpu}.
7790 Which variants are supported depend on the configuration.
7791 All variants support @option{-mcpu=base}, this is the default.
7792
7793 @item -mtext=@var{text-section}
7794 @itemx -mdata=@var{data-section}
7795 @itemx -mrodata=@var{readonly-data-section}
7796 @opindex mtext
7797 @opindex mdata
7798 @opindex mrodata
7799 Put functions, data, and readonly data in @var{text-section},
7800 @var{data-section}, and @var{readonly-data-section} respectively
7801 by default.  This can be overridden with the @code{section} attribute.
7802 @xref{Variable Attributes}.
7803
7804 @end table
7805
7806 @node ARM Options
7807 @subsection ARM Options
7808 @cindex ARM options
7809
7810 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7811 architectures:
7812
7813 @table @gcctabopt
7814 @item -mabi=@var{name}
7815 @opindex mabi
7816 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7817 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
7818
7819 @item -mapcs-frame
7820 @opindex mapcs-frame
7821 Generate a stack frame that is compliant with the ARM Procedure Call
7822 Standard for all functions, even if this is not strictly necessary for
7823 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7824 with this option will cause the stack frames not to be generated for
7825 leaf functions.  The default is @option{-mno-apcs-frame}.
7826
7827 @item -mapcs
7828 @opindex mapcs
7829 This is a synonym for @option{-mapcs-frame}.
7830
7831 @ignore
7832 @c not currently implemented
7833 @item -mapcs-stack-check
7834 @opindex mapcs-stack-check
7835 Generate code to check the amount of stack space available upon entry to
7836 every function (that actually uses some stack space).  If there is
7837 insufficient space available then either the function
7838 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7839 called, depending upon the amount of stack space required.  The run time
7840 system is required to provide these functions.  The default is
7841 @option{-mno-apcs-stack-check}, since this produces smaller code.
7842
7843 @c not currently implemented
7844 @item -mapcs-float
7845 @opindex mapcs-float
7846 Pass floating point arguments using the float point registers.  This is
7847 one of the variants of the APCS@.  This option is recommended if the
7848 target hardware has a floating point unit or if a lot of floating point
7849 arithmetic is going to be performed by the code.  The default is
7850 @option{-mno-apcs-float}, since integer only code is slightly increased in
7851 size if @option{-mapcs-float} is used.
7852
7853 @c not currently implemented
7854 @item -mapcs-reentrant
7855 @opindex mapcs-reentrant
7856 Generate reentrant, position independent code.  The default is
7857 @option{-mno-apcs-reentrant}.
7858 @end ignore
7859
7860 @item -mthumb-interwork
7861 @opindex mthumb-interwork
7862 Generate code which supports calling between the ARM and Thumb
7863 instruction sets.  Without this option the two instruction sets cannot
7864 be reliably used inside one program.  The default is
7865 @option{-mno-thumb-interwork}, since slightly larger code is generated
7866 when @option{-mthumb-interwork} is specified.
7867
7868 @item -mno-sched-prolog
7869 @opindex mno-sched-prolog
7870 Prevent the reordering of instructions in the function prolog, or the
7871 merging of those instruction with the instructions in the function's
7872 body.  This means that all functions will start with a recognizable set
7873 of instructions (or in fact one of a choice from a small set of
7874 different function prologues), and this information can be used to
7875 locate the start if functions inside an executable piece of code.  The
7876 default is @option{-msched-prolog}.
7877
7878 @item -mhard-float
7879 @opindex mhard-float
7880 Generate output containing floating point instructions.  This is the
7881 default.
7882
7883 @item -msoft-float
7884 @opindex msoft-float
7885 Generate output containing library calls for floating point.
7886 @strong{Warning:} the requisite libraries are not available for all ARM
7887 targets.  Normally the facilities of the machine's usual C compiler are
7888 used, but this cannot be done directly in cross-compilation.  You must make
7889 your own arrangements to provide suitable library functions for
7890 cross-compilation.
7891
7892 @option{-msoft-float} changes the calling convention in the output file;
7893 therefore, it is only useful if you compile @emph{all} of a program with
7894 this option.  In particular, you need to compile @file{libgcc.a}, the
7895 library that comes with GCC, with @option{-msoft-float} in order for
7896 this to work.
7897
7898 @item -mfloat-abi=@var{name}
7899 @opindex mfloat-abi
7900 Specifies which ABI to use for floating point values.  Permissible values
7901 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7902
7903 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7904 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7905 of floating point instructions, but still uses the soft-float calling
7906 conventions.
7907
7908 @item -mlittle-endian
7909 @opindex mlittle-endian
7910 Generate code for a processor running in little-endian mode.  This is
7911 the default for all standard configurations.
7912
7913 @item -mbig-endian
7914 @opindex mbig-endian
7915 Generate code for a processor running in big-endian mode; the default is
7916 to compile code for a little-endian processor.
7917
7918 @item -mwords-little-endian
7919 @opindex mwords-little-endian
7920 This option only applies when generating code for big-endian processors.
7921 Generate code for a little-endian word order but a big-endian byte
7922 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7923 option should only be used if you require compatibility with code for
7924 big-endian ARM processors generated by versions of the compiler prior to
7925 2.8.
7926
7927 @item -mcpu=@var{name}
7928 @opindex mcpu
7929 This specifies the name of the target ARM processor.  GCC uses this name
7930 to determine what kind of instructions it can emit when generating
7931 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7932 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7933 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7934 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7935 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7936 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7937 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7938 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7939 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7940 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7941 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7942 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7943 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7944 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
7945 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
7946 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
7947
7948 @itemx -mtune=@var{name}
7949 @opindex mtune
7950 This option is very similar to the @option{-mcpu=} option, except that
7951 instead of specifying the actual target processor type, and hence
7952 restricting which instructions can be used, it specifies that GCC should
7953 tune the performance of the code as if the target were of the type
7954 specified in this option, but still choosing the instructions that it
7955 will generate based on the cpu specified by a @option{-mcpu=} option.
7956 For some ARM implementations better performance can be obtained by using
7957 this option.
7958
7959 @item -march=@var{name}
7960 @opindex march
7961 This specifies the name of the target ARM architecture.  GCC uses this
7962 name to determine what kind of instructions it can emit when generating
7963 assembly code.  This option can be used in conjunction with or instead
7964 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
7965 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
7966 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
7967 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a},
7968 @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{ep9312}.
7969
7970 @item -mfpu=@var{name}
7971 @itemx -mfpe=@var{number}
7972 @itemx -mfp=@var{number}
7973 @opindex mfpu
7974 @opindex mfpe
7975 @opindex mfp
7976 This specifies what floating point hardware (or hardware emulation) is
7977 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
7978 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
7979 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
7980 with older versions of GCC@.
7981
7982 If @option{-msoft-float} is specified this specifies the format of
7983 floating point values.
7984
7985 @item -mstructure-size-boundary=@var{n}
7986 @opindex mstructure-size-boundary
7987 The size of all structures and unions will be rounded up to a multiple
7988 of the number of bits set by this option.  Permissible values are 8, 32
7989 and 64.  The default value varies for different toolchains.  For the COFF
7990 targeted toolchain the default value is 8.  A value of 64 is only allowed
7991 if the underlying ABI supports it.
7992
7993 Specifying the larger number can produce faster, more efficient code, but
7994 can also increase the size of the program.  Different values are potentially
7995 incompatible.  Code compiled with one value cannot necessarily expect to
7996 work with code or libraries compiled with another value, if they exchange
7997 information using structures or unions.
7998
7999 @item -mabort-on-noreturn
8000 @opindex mabort-on-noreturn
8001 Generate a call to the function @code{abort} at the end of a
8002 @code{noreturn} function.  It will be executed if the function tries to
8003 return.
8004
8005 @item -mlong-calls
8006 @itemx -mno-long-calls
8007 @opindex mlong-calls
8008 @opindex mno-long-calls
8009 Tells the compiler to perform function calls by first loading the
8010 address of the function into a register and then performing a subroutine
8011 call on this register.  This switch is needed if the target function
8012 will lie outside of the 64 megabyte addressing range of the offset based
8013 version of subroutine call instruction.
8014
8015 Even if this switch is enabled, not all function calls will be turned
8016 into long calls.  The heuristic is that static functions, functions
8017 which have the @samp{short-call} attribute, functions that are inside
8018 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8019 definitions have already been compiled within the current compilation
8020 unit, will not be turned into long calls.  The exception to this rule is
8021 that weak function definitions, functions with the @samp{long-call}
8022 attribute or the @samp{section} attribute, and functions that are within
8023 the scope of a @samp{#pragma long_calls} directive, will always be
8024 turned into long calls.
8025
8026 This feature is not enabled by default.  Specifying
8027 @option{-mno-long-calls} will restore the default behavior, as will
8028 placing the function calls within the scope of a @samp{#pragma
8029 long_calls_off} directive.  Note these switches have no effect on how
8030 the compiler generates code to handle function calls via function
8031 pointers.
8032
8033 @item -mnop-fun-dllimport
8034 @opindex mnop-fun-dllimport
8035 Disable support for the @code{dllimport} attribute.
8036
8037 @item -msingle-pic-base
8038 @opindex msingle-pic-base
8039 Treat the register used for PIC addressing as read-only, rather than
8040 loading it in the prologue for each function.  The run-time system is
8041 responsible for initializing this register with an appropriate value
8042 before execution begins.
8043
8044 @item -mpic-register=@var{reg}
8045 @opindex mpic-register
8046 Specify the register to be used for PIC addressing.  The default is R10
8047 unless stack-checking is enabled, when R9 is used.
8048
8049 @item -mcirrus-fix-invalid-insns
8050 @opindex mcirrus-fix-invalid-insns
8051 @opindex mno-cirrus-fix-invalid-insns
8052 Insert NOPs into the instruction stream to in order to work around
8053 problems with invalid Maverick instruction combinations.  This option
8054 is only valid if the @option{-mcpu=ep9312} option has been used to
8055 enable generation of instructions for the Cirrus Maverick floating
8056 point co-processor.  This option is not enabled by default, since the
8057 problem is only present in older Maverick implementations.  The default
8058 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8059 switch.
8060
8061 @item -mpoke-function-name
8062 @opindex mpoke-function-name
8063 Write the name of each function into the text section, directly
8064 preceding the function prologue.  The generated code is similar to this:
8065
8066 @smallexample
8067      t0
8068          .ascii "arm_poke_function_name", 0
8069          .align
8070      t1
8071          .word 0xff000000 + (t1 - t0)
8072      arm_poke_function_name
8073          mov     ip, sp
8074          stmfd   sp!, @{fp, ip, lr, pc@}
8075          sub     fp, ip, #4
8076 @end smallexample
8077
8078 When performing a stack backtrace, code can inspect the value of
8079 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8080 location @code{pc - 12} and the top 8 bits are set, then we know that
8081 there is a function name embedded immediately preceding this location
8082 and has length @code{((pc[-3]) & 0xff000000)}.
8083
8084 @item -mthumb
8085 @opindex mthumb
8086 Generate code for the Thumb instruction set.  The default is to
8087 use the 32-bit ARM instruction set.
8088 This option automatically enables either 16-bit Thumb-1 or
8089 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8090 and @option{-march=@var{name}} options.
8091
8092 @item -mtpcs-frame
8093 @opindex mtpcs-frame
8094 Generate a stack frame that is compliant with the Thumb Procedure Call
8095 Standard for all non-leaf functions.  (A leaf function is one that does
8096 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8097
8098 @item -mtpcs-leaf-frame
8099 @opindex mtpcs-leaf-frame
8100 Generate a stack frame that is compliant with the Thumb Procedure Call
8101 Standard for all leaf functions.  (A leaf function is one that does
8102 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8103
8104 @item -mcallee-super-interworking
8105 @opindex mcallee-super-interworking
8106 Gives all externally visible functions in the file being compiled an ARM
8107 instruction set header which switches to Thumb mode before executing the
8108 rest of the function.  This allows these functions to be called from
8109 non-interworking code.
8110
8111 @item -mcaller-super-interworking
8112 @opindex mcaller-super-interworking
8113 Allows calls via function pointers (including virtual functions) to
8114 execute correctly regardless of whether the target code has been
8115 compiled for interworking or not.  There is a small overhead in the cost
8116 of executing a function pointer if this option is enabled.
8117
8118 @item -mtp=@var{name}
8119 @opindex mtp
8120 Specify the access model for the thread local storage pointer.  The valid
8121 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8122 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8123 (supported in the arm6k architecture), and @option{auto}, which uses the
8124 best available method for the selected processor.  The default setting is
8125 @option{auto}.
8126
8127 @end table
8128
8129 @node AVR Options
8130 @subsection AVR Options
8131 @cindex AVR Options
8132
8133 These options are defined for AVR implementations:
8134
8135 @table @gcctabopt
8136 @item -mmcu=@var{mcu}
8137 @opindex mmcu
8138 Specify ATMEL AVR instruction set or MCU type.
8139
8140 Instruction set avr1 is for the minimal AVR core, not supported by the C
8141 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8142 attiny11, attiny12, attiny15, attiny28).
8143
8144 Instruction set avr2 (default) is for the classic AVR core with up to
8145 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8146 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8147 at90c8534, at90s8535).
8148
8149 Instruction set avr3 is for the classic AVR core with up to 128K program
8150 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8151
8152 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8153 memory space (MCU types: atmega8, atmega83, atmega85).
8154
8155 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8156 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8157 atmega64, atmega128, at43usb355, at94k).
8158
8159 @item -msize
8160 @opindex msize
8161 Output instruction sizes to the asm file.
8162
8163 @item -minit-stack=@var{N}
8164 @opindex minit-stack
8165 Specify the initial stack address, which may be a symbol or numeric value,
8166 @samp{__stack} is the default.
8167
8168 @item -mno-interrupts
8169 @opindex mno-interrupts
8170 Generated code is not compatible with hardware interrupts.
8171 Code size will be smaller.
8172
8173 @item -mcall-prologues
8174 @opindex mcall-prologues
8175 Functions prologues/epilogues expanded as call to appropriate
8176 subroutines.  Code size will be smaller.
8177
8178 @item -mno-tablejump
8179 @opindex mno-tablejump
8180 Do not generate tablejump insns which sometimes increase code size.
8181
8182 @item -mtiny-stack
8183 @opindex mtiny-stack
8184 Change only the low 8 bits of the stack pointer.
8185
8186 @item -mint8
8187 @opindex mint8
8188 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8189 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8190 and long long will be 4 bytes.  Please note that this option does not
8191 comply to the C standards, but it will provide you with smaller code
8192 size.
8193 @end table
8194
8195 @node Blackfin Options
8196 @subsection Blackfin Options
8197 @cindex Blackfin Options
8198
8199 @table @gcctabopt
8200 @item -momit-leaf-frame-pointer
8201 @opindex momit-leaf-frame-pointer
8202 Don't keep the frame pointer in a register for leaf functions.  This
8203 avoids the instructions to save, set up and restore frame pointers and
8204 makes an extra register available in leaf functions.  The option
8205 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8206 which might make debugging harder.
8207
8208 @item -mspecld-anomaly
8209 @opindex mspecld-anomaly
8210 When enabled, the compiler will ensure that the generated code does not
8211 contain speculative loads after jump instructions.  This option is enabled
8212 by default.
8213
8214 @item -mno-specld-anomaly
8215 @opindex mno-specld-anomaly
8216 Don't generate extra code to prevent speculative loads from occurring.
8217
8218 @item -mcsync-anomaly
8219 @opindex mcsync-anomaly
8220 When enabled, the compiler will ensure that the generated code does not
8221 contain CSYNC or SSYNC instructions too soon after conditional branches.
8222 This option is enabled by default.
8223
8224 @item -mno-csync-anomaly
8225 @opindex mno-csync-anomaly
8226 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8227 occurring too soon after a conditional branch.
8228
8229 @item -mlow-64k
8230 @opindex mlow-64k
8231 When enabled, the compiler is free to take advantage of the knowledge that
8232 the entire program fits into the low 64k of memory.
8233
8234 @item -mno-low-64k
8235 @opindex mno-low-64k
8236 Assume that the program is arbitrarily large.  This is the default.
8237
8238 @item -mstack-check-l1
8239 @opindex mstack-check-l1
8240 Do stack checking using information placed into L1 scratchpad memory by the
8241 uClinux kernel.
8242
8243 @item -mid-shared-library
8244 @opindex mid-shared-library
8245 Generate code that supports shared libraries via the library ID method.
8246 This allows for execute in place and shared libraries in an environment
8247 without virtual memory management.  This option implies @option{-fPIC}.
8248
8249 @item -mno-id-shared-library
8250 @opindex mno-id-shared-library
8251 Generate code that doesn't assume ID based shared libraries are being used.
8252 This is the default.
8253
8254 @item -mleaf-id-shared-library
8255 @opindex mleaf-id-shared-library
8256 Generate code that supports shared libraries via the library ID method,
8257 but assumes that this library or executable won't link against any other
8258 ID shared libraries.  That allows the compiler to use faster code for jumps
8259 and calls.
8260
8261 @item -mno-leaf-id-shared-library
8262 @opindex mno-leaf-id-shared-library
8263 Do not assume that the code being compiled won't link against any ID shared
8264 libraries.  Slower code will be generated for jump and call insns.
8265
8266 @item -mshared-library-id=n
8267 @opindex mshared-library-id
8268 Specified the identification number of the ID based shared library being
8269 compiled.  Specifying a value of 0 will generate more compact code, specifying
8270 other values will force the allocation of that number to the current
8271 library but is no more space or time efficient than omitting this option.
8272
8273 @item -msep-data
8274 @opindex msep-data
8275 Generate code that allows the data segment to be located in a different
8276 area of memory from the text segment.  This allows for execute in place in
8277 an environment without virtual memory management by eliminating relocations
8278 against the text section.
8279
8280 @item -mno-sep-data
8281 @opindex mno-sep-data
8282 Generate code that assumes that the data segment follows the text segment.
8283 This is the default.
8284
8285 @item -mlong-calls
8286 @itemx -mno-long-calls
8287 @opindex mlong-calls
8288 @opindex mno-long-calls
8289 Tells the compiler to perform function calls by first loading the
8290 address of the function into a register and then performing a subroutine
8291 call on this register.  This switch is needed if the target function
8292 will lie outside of the 24 bit addressing range of the offset based
8293 version of subroutine call instruction.
8294
8295 This feature is not enabled by default.  Specifying
8296 @option{-mno-long-calls} will restore the default behavior.  Note these
8297 switches have no effect on how the compiler generates code to handle
8298 function calls via function pointers.
8299 @end table
8300
8301 @node CRIS Options
8302 @subsection CRIS Options
8303 @cindex CRIS Options
8304
8305 These options are defined specifically for the CRIS ports.
8306
8307 @table @gcctabopt
8308 @item -march=@var{architecture-type}
8309 @itemx -mcpu=@var{architecture-type}
8310 @opindex march
8311 @opindex mcpu
8312 Generate code for the specified architecture.  The choices for
8313 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8314 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8315 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8316 @samp{v10}.
8317
8318 @item -mtune=@var{architecture-type}
8319 @opindex mtune
8320 Tune to @var{architecture-type} everything applicable about the generated
8321 code, except for the ABI and the set of available instructions.  The
8322 choices for @var{architecture-type} are the same as for
8323 @option{-march=@var{architecture-type}}.
8324
8325 @item -mmax-stack-frame=@var{n}
8326 @opindex mmax-stack-frame
8327 Warn when the stack frame of a function exceeds @var{n} bytes.
8328
8329 @item -melinux-stacksize=@var{n}
8330 @opindex melinux-stacksize
8331 Only available with the @samp{cris-axis-aout} target.  Arranges for
8332 indications in the program to the kernel loader that the stack of the
8333 program should be set to @var{n} bytes.
8334
8335 @item -metrax4
8336 @itemx -metrax100
8337 @opindex metrax4
8338 @opindex metrax100
8339 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8340 @option{-march=v3} and @option{-march=v8} respectively.
8341
8342 @item -mmul-bug-workaround
8343 @itemx -mno-mul-bug-workaround
8344 @opindex mmul-bug-workaround
8345 @opindex mno-mul-bug-workaround
8346 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8347 models where it applies.  This option is active by default.
8348
8349 @item -mpdebug
8350 @opindex mpdebug
8351 Enable CRIS-specific verbose debug-related information in the assembly
8352 code.  This option also has the effect to turn off the @samp{#NO_APP}
8353 formatted-code indicator to the assembler at the beginning of the
8354 assembly file.
8355
8356 @item -mcc-init
8357 @opindex mcc-init
8358 Do not use condition-code results from previous instruction; always emit
8359 compare and test instructions before use of condition codes.
8360
8361 @item -mno-side-effects
8362 @opindex mno-side-effects
8363 Do not emit instructions with side-effects in addressing modes other than
8364 post-increment.
8365
8366 @item -mstack-align
8367 @itemx -mno-stack-align
8368 @itemx -mdata-align
8369 @itemx -mno-data-align
8370 @itemx -mconst-align
8371 @itemx -mno-const-align
8372 @opindex mstack-align
8373 @opindex mno-stack-align
8374 @opindex mdata-align
8375 @opindex mno-data-align
8376 @opindex mconst-align
8377 @opindex mno-const-align
8378 These options (no-options) arranges (eliminate arrangements) for the
8379 stack-frame, individual data and constants to be aligned for the maximum
8380 single data access size for the chosen CPU model.  The default is to
8381 arrange for 32-bit alignment.  ABI details such as structure layout are
8382 not affected by these options.
8383
8384 @item -m32-bit
8385 @itemx -m16-bit
8386 @itemx -m8-bit
8387 @opindex m32-bit
8388 @opindex m16-bit
8389 @opindex m8-bit
8390 Similar to the stack- data- and const-align options above, these options
8391 arrange for stack-frame, writable data and constants to all be 32-bit,
8392 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8393
8394 @item -mno-prologue-epilogue
8395 @itemx -mprologue-epilogue
8396 @opindex mno-prologue-epilogue
8397 @opindex mprologue-epilogue
8398 With @option{-mno-prologue-epilogue}, the normal function prologue and
8399 epilogue that sets up the stack-frame are omitted and no return
8400 instructions or return sequences are generated in the code.  Use this
8401 option only together with visual inspection of the compiled code: no
8402 warnings or errors are generated when call-saved registers must be saved,
8403 or storage for local variable needs to be allocated.
8404
8405 @item -mno-gotplt
8406 @itemx -mgotplt
8407 @opindex mno-gotplt
8408 @opindex mgotplt
8409 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8410 instruction sequences that load addresses for functions from the PLT part
8411 of the GOT rather than (traditional on other architectures) calls to the
8412 PLT@.  The default is @option{-mgotplt}.
8413
8414 @item -maout
8415 @opindex maout
8416 Legacy no-op option only recognized with the cris-axis-aout target.
8417
8418 @item -melf
8419 @opindex melf
8420 Legacy no-op option only recognized with the cris-axis-elf and
8421 cris-axis-linux-gnu targets.
8422
8423 @item -melinux
8424 @opindex melinux
8425 Only recognized with the cris-axis-aout target, where it selects a
8426 GNU/linux-like multilib, include files and instruction set for
8427 @option{-march=v8}.
8428
8429 @item -mlinux
8430 @opindex mlinux
8431 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8432
8433 @item -sim
8434 @opindex sim
8435 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8436 to link with input-output functions from a simulator library.  Code,
8437 initialized data and zero-initialized data are allocated consecutively.
8438
8439 @item -sim2
8440 @opindex sim2
8441 Like @option{-sim}, but pass linker options to locate initialized data at
8442 0x40000000 and zero-initialized data at 0x80000000.
8443 @end table
8444
8445 @node CRX Options
8446 @subsection CRX Options
8447 @cindex CRX Options
8448
8449 These options are defined specifically for the CRX ports.
8450
8451 @table @gcctabopt
8452
8453 @item -mmac
8454 @opindex mmac
8455 Enable the use of multiply-accumulate instructions. Disabled by default.
8456
8457 @item -mpush-args
8458 @opindex mpush-args
8459 Push instructions will be used to pass outgoing arguments when functions
8460 are called. Enabled by default.
8461 @end table
8462
8463 @node Darwin Options
8464 @subsection Darwin Options
8465 @cindex Darwin options
8466
8467 These options are defined for all architectures running the Darwin operating
8468 system.
8469
8470 FSF GCC on Darwin does not create ``fat'' object files; it will create
8471 an object file for the single architecture that it was built to
8472 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8473 @option{-arch} options are used; it does so by running the compiler or
8474 linker multiple times and joining the results together with
8475 @file{lipo}.
8476
8477 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8478 @samp{i686}) is determined by the flags that specify the ISA
8479 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8480 @option{-force_cpusubtype_ALL} option can be used to override this.
8481
8482 The Darwin tools vary in their behavior when presented with an ISA
8483 mismatch.  The assembler, @file{as}, will only permit instructions to
8484 be used that are valid for the subtype of the file it is generating,
8485 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8486 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8487 and print an error if asked to create a shared library with a less
8488 restrictive subtype than its input files (for instance, trying to put
8489 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8490 for executables, @file{ld}, will quietly give the executable the most
8491 restrictive subtype of any of its input files.
8492
8493 @table @gcctabopt
8494 @item -F@var{dir}
8495 @opindex F
8496 Add the framework directory @var{dir} to the head of the list of
8497 directories to be searched for header files.  These directories are
8498 interleaved with those specified by @option{-I} options and are
8499 scanned in a left-to-right order.
8500
8501 A framework directory is a directory with frameworks in it.  A
8502 framework is a directory with a @samp{"Headers"} and/or
8503 @samp{"PrivateHeaders"} directory contained directly in it that ends
8504 in @samp{".framework"}.  The name of a framework is the name of this
8505 directory excluding the @samp{".framework"}.  Headers associated with
8506 the framework are found in one of those two directories, with
8507 @samp{"Headers"} being searched first.  A subframework is a framework
8508 directory that is in a framework's @samp{"Frameworks"} directory.
8509 Includes of subframework headers can only appear in a header of a
8510 framework that contains the subframework, or in a sibling subframework
8511 header.  Two subframeworks are siblings if they occur in the same
8512 framework.  A subframework should not have the same name as a
8513 framework, a warning will be issued if this is violated.  Currently a
8514 subframework cannot have subframeworks, in the future, the mechanism
8515 may be extended to support this.  The standard frameworks can be found
8516 in @samp{"/System/Library/Frameworks"} and
8517 @samp{"/Library/Frameworks"}.  An example include looks like
8518 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8519 the name of the framework and header.h is found in the
8520 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8521
8522 @item -iframework@var{dir}
8523 @opindex iframework
8524 Like @option{-F} except the directory is a treated as a system
8525 directory.  The main difference between this @option{-iframework} and
8526 @option{-F} is that with @option{-iframework} the compiler does not
8527 warn about constructs contained within header files found via
8528 @var{dir}.  This option is valid only for the C family of languages.
8529
8530 @item -gused
8531 @opindex -gused
8532 Emit debugging information for symbols that are used.  For STABS
8533 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8534 This is by default ON@.
8535
8536 @item -gfull
8537 @opindex -gfull
8538 Emit debugging information for all symbols and types.
8539
8540 @item -mmacosx-version-min=@var{version}
8541 The earliest version of MacOS X that this executable will run on
8542 is @var{version}.  Typical values of @var{version} include @code{10.1},
8543 @code{10.2}, and @code{10.3.9}.
8544
8545 The default for this option is to make choices that seem to be most
8546 useful.  
8547
8548 @item -mkernel
8549 @opindex mkernel
8550 Enable kernel development mode.  The @option{-mkernel} option sets
8551 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8552 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8553 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8554 applicable.  This mode also sets @option{-mno-altivec},
8555 @option{-msoft-float}, @option{-fno-builtin} and
8556 @option{-mlong-branch} for PowerPC targets.
8557
8558 @item -mone-byte-bool
8559 @opindex -mone-byte-bool
8560 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8561 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8562 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8563 option has no effect on x86.
8564
8565 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8566 to generate code that is not binary compatible with code generated
8567 without that switch.  Using this switch may require recompiling all
8568 other modules in a program, including system libraries.  Use this
8569 switch to conform to a non-default data model.
8570
8571 @item -mfix-and-continue
8572 @itemx -ffix-and-continue
8573 @itemx -findirect-data
8574 @opindex mfix-and-continue
8575 @opindex ffix-and-continue
8576 @opindex findirect-data
8577 Generate code suitable for fast turn around development.  Needed to
8578 enable gdb to dynamically load @code{.o} files into already running
8579 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8580 are provided for backwards compatibility.
8581
8582 @item -all_load
8583 @opindex all_load
8584 Loads all members of static archive libraries.
8585 See man ld(1) for more information.
8586
8587 @item -arch_errors_fatal
8588 @opindex arch_errors_fatal
8589 Cause the errors having to do with files that have the wrong architecture
8590 to be fatal.
8591
8592 @item -bind_at_load
8593 @opindex bind_at_load
8594 Causes the output file to be marked such that the dynamic linker will
8595 bind all undefined references when the file is loaded or launched.
8596
8597 @item -bundle
8598 @opindex bundle
8599 Produce a Mach-o bundle format file.
8600 See man ld(1) for more information.
8601
8602 @item -bundle_loader @var{executable}
8603 @opindex bundle_loader
8604 This option specifies the @var{executable} that will be loading the build
8605 output file being linked.  See man ld(1) for more information.
8606
8607 @item -dynamiclib
8608 @opindex -dynamiclib
8609 When passed this option, GCC will produce a dynamic library instead of
8610 an executable when linking, using the Darwin @file{libtool} command.
8611
8612 @item -force_cpusubtype_ALL
8613 @opindex -force_cpusubtype_ALL
8614 This causes GCC's output file to have the @var{ALL} subtype, instead of
8615 one controlled by the @option{-mcpu} or @option{-march} option.
8616
8617 @item -allowable_client  @var{client_name}
8618 @itemx -client_name
8619 @itemx -compatibility_version
8620 @itemx -current_version
8621 @itemx -dead_strip
8622 @itemx -dependency-file
8623 @itemx -dylib_file
8624 @itemx -dylinker_install_name
8625 @itemx -dynamic
8626 @itemx -exported_symbols_list
8627 @itemx -filelist
8628 @itemx -flat_namespace
8629 @itemx -force_flat_namespace
8630 @itemx -headerpad_max_install_names
8631 @itemx -image_base
8632 @itemx -init
8633 @itemx -install_name
8634 @itemx -keep_private_externs
8635 @itemx -multi_module
8636 @itemx -multiply_defined
8637 @itemx -multiply_defined_unused
8638 @itemx -noall_load
8639 @itemx -no_dead_strip_inits_and_terms
8640 @itemx -nofixprebinding
8641 @itemx -nomultidefs
8642 @itemx -noprebind
8643 @itemx -noseglinkedit
8644 @itemx -pagezero_size
8645 @itemx -prebind
8646 @itemx -prebind_all_twolevel_modules
8647 @itemx -private_bundle
8648 @itemx -read_only_relocs
8649 @itemx -sectalign
8650 @itemx -sectobjectsymbols
8651 @itemx -whyload
8652 @itemx -seg1addr
8653 @itemx -sectcreate
8654 @itemx -sectobjectsymbols
8655 @itemx -sectorder
8656 @itemx -segaddr
8657 @itemx -segs_read_only_addr
8658 @itemx -segs_read_write_addr
8659 @itemx -seg_addr_table
8660 @itemx -seg_addr_table_filename
8661 @itemx -seglinkedit
8662 @itemx -segprot
8663 @itemx -segs_read_only_addr
8664 @itemx -segs_read_write_addr
8665 @itemx -single_module
8666 @itemx -static
8667 @itemx -sub_library
8668 @itemx -sub_umbrella
8669 @itemx -twolevel_namespace
8670 @itemx -umbrella
8671 @itemx -undefined
8672 @itemx -unexported_symbols_list
8673 @itemx -weak_reference_mismatches
8674 @itemx -whatsloaded
8675
8676 @opindex allowable_client
8677 @opindex client_name
8678 @opindex compatibility_version
8679 @opindex current_version
8680 @opindex dead_strip
8681 @opindex dependency-file
8682 @opindex dylib_file
8683 @opindex dylinker_install_name
8684 @opindex dynamic
8685 @opindex exported_symbols_list
8686 @opindex filelist
8687 @opindex flat_namespace
8688 @opindex force_flat_namespace
8689 @opindex headerpad_max_install_names
8690 @opindex image_base
8691 @opindex init
8692 @opindex install_name
8693 @opindex keep_private_externs
8694 @opindex multi_module
8695 @opindex multiply_defined
8696 @opindex multiply_defined_unused
8697 @opindex noall_load
8698 @opindex no_dead_strip_inits_and_terms
8699 @opindex nofixprebinding
8700 @opindex nomultidefs
8701 @opindex noprebind
8702 @opindex noseglinkedit
8703 @opindex pagezero_size
8704 @opindex prebind
8705 @opindex prebind_all_twolevel_modules
8706 @opindex private_bundle
8707 @opindex read_only_relocs
8708 @opindex sectalign
8709 @opindex sectobjectsymbols
8710 @opindex whyload
8711 @opindex seg1addr
8712 @opindex sectcreate
8713 @opindex sectobjectsymbols
8714 @opindex sectorder
8715 @opindex segaddr
8716 @opindex segs_read_only_addr
8717 @opindex segs_read_write_addr
8718 @opindex seg_addr_table
8719 @opindex seg_addr_table_filename
8720 @opindex seglinkedit
8721 @opindex segprot
8722 @opindex segs_read_only_addr
8723 @opindex segs_read_write_addr
8724 @opindex single_module
8725 @opindex static
8726 @opindex sub_library
8727 @opindex sub_umbrella
8728 @opindex twolevel_namespace
8729 @opindex umbrella
8730 @opindex undefined
8731 @opindex unexported_symbols_list
8732 @opindex weak_reference_mismatches
8733 @opindex whatsloaded
8734
8735 These options are passed to the Darwin linker.  The Darwin linker man page
8736 describes them in detail.
8737 @end table
8738
8739 @node DEC Alpha Options
8740 @subsection DEC Alpha Options
8741
8742 These @samp{-m} options are defined for the DEC Alpha implementations:
8743
8744 @table @gcctabopt
8745 @item -mno-soft-float
8746 @itemx -msoft-float
8747 @opindex mno-soft-float
8748 @opindex msoft-float
8749 Use (do not use) the hardware floating-point instructions for
8750 floating-point operations.  When @option{-msoft-float} is specified,
8751 functions in @file{libgcc.a} will be used to perform floating-point
8752 operations.  Unless they are replaced by routines that emulate the
8753 floating-point operations, or compiled in such a way as to call such
8754 emulations routines, these routines will issue floating-point
8755 operations.   If you are compiling for an Alpha without floating-point
8756 operations, you must ensure that the library is built so as not to call
8757 them.
8758
8759 Note that Alpha implementations without floating-point operations are
8760 required to have floating-point registers.
8761
8762 @item -mfp-reg
8763 @itemx -mno-fp-regs
8764 @opindex mfp-reg
8765 @opindex mno-fp-regs
8766 Generate code that uses (does not use) the floating-point register set.
8767 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8768 register set is not used, floating point operands are passed in integer
8769 registers as if they were integers and floating-point results are passed
8770 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8771 so any function with a floating-point argument or return value called by code
8772 compiled with @option{-mno-fp-regs} must also be compiled with that
8773 option.
8774
8775 A typical use of this option is building a kernel that does not use,
8776 and hence need not save and restore, any floating-point registers.
8777
8778 @item -mieee
8779 @opindex mieee
8780 The Alpha architecture implements floating-point hardware optimized for
8781 maximum performance.  It is mostly compliant with the IEEE floating
8782 point standard.  However, for full compliance, software assistance is
8783 required.  This option generates code fully IEEE compliant code
8784 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8785 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8786 defined during compilation.  The resulting code is less efficient but is
8787 able to correctly support denormalized numbers and exceptional IEEE
8788 values such as not-a-number and plus/minus infinity.  Other Alpha
8789 compilers call this option @option{-ieee_with_no_inexact}.
8790
8791 @item -mieee-with-inexact
8792 @opindex mieee-with-inexact
8793 This is like @option{-mieee} except the generated code also maintains
8794 the IEEE @var{inexact-flag}.  Turning on this option causes the
8795 generated code to implement fully-compliant IEEE math.  In addition to
8796 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8797 macro.  On some Alpha implementations the resulting code may execute
8798 significantly slower than the code generated by default.  Since there is
8799 very little code that depends on the @var{inexact-flag}, you should
8800 normally not specify this option.  Other Alpha compilers call this
8801 option @option{-ieee_with_inexact}.
8802
8803 @item -mfp-trap-mode=@var{trap-mode}
8804 @opindex mfp-trap-mode
8805 This option controls what floating-point related traps are enabled.
8806 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8807 The trap mode can be set to one of four values:
8808
8809 @table @samp
8810 @item n
8811 This is the default (normal) setting.  The only traps that are enabled
8812 are the ones that cannot be disabled in software (e.g., division by zero
8813 trap).
8814
8815 @item u
8816 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8817 as well.
8818
8819 @item su
8820 Like @samp{u}, but the instructions are marked to be safe for software
8821 completion (see Alpha architecture manual for details).
8822
8823 @item sui
8824 Like @samp{su}, but inexact traps are enabled as well.
8825 @end table
8826
8827 @item -mfp-rounding-mode=@var{rounding-mode}
8828 @opindex mfp-rounding-mode
8829 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8830 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8831 of:
8832
8833 @table @samp
8834 @item n
8835 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8836 the nearest machine number or towards the even machine number in case
8837 of a tie.
8838
8839 @item m
8840 Round towards minus infinity.
8841
8842 @item c
8843 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8844
8845 @item d
8846 Dynamic rounding mode.  A field in the floating point control register
8847 (@var{fpcr}, see Alpha architecture reference manual) controls the
8848 rounding mode in effect.  The C library initializes this register for
8849 rounding towards plus infinity.  Thus, unless your program modifies the
8850 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8851 @end table
8852
8853 @item -mtrap-precision=@var{trap-precision}
8854 @opindex mtrap-precision
8855 In the Alpha architecture, floating point traps are imprecise.  This
8856 means without software assistance it is impossible to recover from a
8857 floating trap and program execution normally needs to be terminated.
8858 GCC can generate code that can assist operating system trap handlers
8859 in determining the exact location that caused a floating point trap.
8860 Depending on the requirements of an application, different levels of
8861 precisions can be selected:
8862
8863 @table @samp
8864 @item p
8865 Program precision.  This option is the default and means a trap handler
8866 can only identify which program caused a floating point exception.
8867
8868 @item f
8869 Function precision.  The trap handler can determine the function that
8870 caused a floating point exception.
8871
8872 @item i
8873 Instruction precision.  The trap handler can determine the exact
8874 instruction that caused a floating point exception.
8875 @end table
8876
8877 Other Alpha compilers provide the equivalent options called
8878 @option{-scope_safe} and @option{-resumption_safe}.
8879
8880 @item -mieee-conformant
8881 @opindex mieee-conformant
8882 This option marks the generated code as IEEE conformant.  You must not
8883 use this option unless you also specify @option{-mtrap-precision=i} and either
8884 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8885 is to emit the line @samp{.eflag 48} in the function prologue of the
8886 generated assembly file.  Under DEC Unix, this has the effect that
8887 IEEE-conformant math library routines will be linked in.
8888
8889 @item -mbuild-constants
8890 @opindex mbuild-constants
8891 Normally GCC examines a 32- or 64-bit integer constant to
8892 see if it can construct it from smaller constants in two or three
8893 instructions.  If it cannot, it will output the constant as a literal and
8894 generate code to load it from the data segment at runtime.
8895
8896 Use this option to require GCC to construct @emph{all} integer constants
8897 using code, even if it takes more instructions (the maximum is six).
8898
8899 You would typically use this option to build a shared library dynamic
8900 loader.  Itself a shared library, it must relocate itself in memory
8901 before it can find the variables and constants in its own data segment.
8902
8903 @item -malpha-as
8904 @itemx -mgas
8905 @opindex malpha-as
8906 @opindex mgas
8907 Select whether to generate code to be assembled by the vendor-supplied
8908 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8909
8910 @item -mbwx
8911 @itemx -mno-bwx
8912 @itemx -mcix
8913 @itemx -mno-cix
8914 @itemx -mfix
8915 @itemx -mno-fix
8916 @itemx -mmax
8917 @itemx -mno-max
8918 @opindex mbwx
8919 @opindex mno-bwx
8920 @opindex mcix
8921 @opindex mno-cix
8922 @opindex mfix
8923 @opindex mno-fix
8924 @opindex mmax
8925 @opindex mno-max
8926 Indicate whether GCC should generate code to use the optional BWX,
8927 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8928 sets supported by the CPU type specified via @option{-mcpu=} option or that
8929 of the CPU on which GCC was built if none was specified.
8930
8931 @item -mfloat-vax
8932 @itemx -mfloat-ieee
8933 @opindex mfloat-vax
8934 @opindex mfloat-ieee
8935 Generate code that uses (does not use) VAX F and G floating point
8936 arithmetic instead of IEEE single and double precision.
8937
8938 @item -mexplicit-relocs
8939 @itemx -mno-explicit-relocs
8940 @opindex mexplicit-relocs
8941 @opindex mno-explicit-relocs
8942 Older Alpha assemblers provided no way to generate symbol relocations
8943 except via assembler macros.  Use of these macros does not allow
8944 optimal instruction scheduling.  GNU binutils as of version 2.12
8945 supports a new syntax that allows the compiler to explicitly mark
8946 which relocations should apply to which instructions.  This option
8947 is mostly useful for debugging, as GCC detects the capabilities of
8948 the assembler when it is built and sets the default accordingly.
8949
8950 @item -msmall-data
8951 @itemx -mlarge-data
8952 @opindex msmall-data
8953 @opindex mlarge-data
8954 When @option{-mexplicit-relocs} is in effect, static data is
8955 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
8956 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
8957 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
8958 16-bit relocations off of the @code{$gp} register.  This limits the
8959 size of the small data area to 64KB, but allows the variables to be
8960 directly accessed via a single instruction.
8961
8962 The default is @option{-mlarge-data}.  With this option the data area
8963 is limited to just below 2GB@.  Programs that require more than 2GB of
8964 data must use @code{malloc} or @code{mmap} to allocate the data in the
8965 heap instead of in the program's data segment.
8966
8967 When generating code for shared libraries, @option{-fpic} implies
8968 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
8969
8970 @item -msmall-text
8971 @itemx -mlarge-text
8972 @opindex msmall-text
8973 @opindex mlarge-text
8974 When @option{-msmall-text} is used, the compiler assumes that the
8975 code of the entire program (or shared library) fits in 4MB, and is
8976 thus reachable with a branch instruction.  When @option{-msmall-data}
8977 is used, the compiler can assume that all local symbols share the
8978 same @code{$gp} value, and thus reduce the number of instructions
8979 required for a function call from 4 to 1.
8980
8981 The default is @option{-mlarge-text}.
8982
8983 @item -mcpu=@var{cpu_type}
8984 @opindex mcpu
8985 Set the instruction set and instruction scheduling parameters for
8986 machine type @var{cpu_type}.  You can specify either the @samp{EV}
8987 style name or the corresponding chip number.  GCC supports scheduling
8988 parameters for the EV4, EV5 and EV6 family of processors and will
8989 choose the default values for the instruction set from the processor
8990 you specify.  If you do not specify a processor type, GCC will default
8991 to the processor on which the compiler was built.
8992
8993 Supported values for @var{cpu_type} are
8994
8995 @table @samp
8996 @item ev4
8997 @itemx ev45
8998 @itemx 21064
8999 Schedules as an EV4 and has no instruction set extensions.
9000
9001 @item ev5
9002 @itemx 21164
9003 Schedules as an EV5 and has no instruction set extensions.
9004
9005 @item ev56
9006 @itemx 21164a
9007 Schedules as an EV5 and supports the BWX extension.
9008
9009 @item pca56
9010 @itemx 21164pc
9011 @itemx 21164PC
9012 Schedules as an EV5 and supports the BWX and MAX extensions.
9013
9014 @item ev6
9015 @itemx 21264
9016 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9017
9018 @item ev67
9019 @itemx 21264a
9020 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9021 @end table
9022
9023 @item -mtune=@var{cpu_type}
9024 @opindex mtune
9025 Set only the instruction scheduling parameters for machine type
9026 @var{cpu_type}.  The instruction set is not changed.
9027
9028 @item -mmemory-latency=@var{time}
9029 @opindex mmemory-latency
9030 Sets the latency the scheduler should assume for typical memory
9031 references as seen by the application.  This number is highly
9032 dependent on the memory access patterns used by the application
9033 and the size of the external cache on the machine.
9034
9035 Valid options for @var{time} are
9036
9037 @table @samp
9038 @item @var{number}
9039 A decimal number representing clock cycles.
9040
9041 @item L1
9042 @itemx L2
9043 @itemx L3
9044 @itemx main
9045 The compiler contains estimates of the number of clock cycles for
9046 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9047 (also called Dcache, Scache, and Bcache), as well as to main memory.
9048 Note that L3 is only valid for EV5.
9049
9050 @end table
9051 @end table
9052
9053 @node DEC Alpha/VMS Options
9054 @subsection DEC Alpha/VMS Options
9055
9056 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9057
9058 @table @gcctabopt
9059 @item -mvms-return-codes
9060 @opindex mvms-return-codes
9061 Return VMS condition codes from main.  The default is to return POSIX
9062 style condition (e.g.@ error) codes.
9063 @end table
9064
9065 @node FRV Options
9066 @subsection FRV Options
9067 @cindex FRV Options
9068
9069 @table @gcctabopt
9070 @item -mgpr-32
9071 @opindex mgpr-32
9072
9073 Only use the first 32 general purpose registers.
9074
9075 @item -mgpr-64
9076 @opindex mgpr-64
9077
9078 Use all 64 general purpose registers.
9079
9080 @item -mfpr-32
9081 @opindex mfpr-32
9082
9083 Use only the first 32 floating point registers.
9084
9085 @item -mfpr-64
9086 @opindex mfpr-64
9087
9088 Use all 64 floating point registers
9089
9090 @item -mhard-float
9091 @opindex mhard-float
9092
9093 Use hardware instructions for floating point operations.
9094
9095 @item -msoft-float
9096 @opindex msoft-float
9097
9098 Use library routines for floating point operations.
9099
9100 @item -malloc-cc
9101 @opindex malloc-cc
9102
9103 Dynamically allocate condition code registers.
9104
9105 @item -mfixed-cc
9106 @opindex mfixed-cc
9107
9108 Do not try to dynamically allocate condition code registers, only
9109 use @code{icc0} and @code{fcc0}.
9110
9111 @item -mdword
9112 @opindex mdword
9113
9114 Change ABI to use double word insns.
9115
9116 @item -mno-dword
9117 @opindex mno-dword
9118
9119 Do not use double word instructions.
9120
9121 @item -mdouble
9122 @opindex mdouble
9123
9124 Use floating point double instructions.
9125
9126 @item -mno-double
9127 @opindex mno-double
9128
9129 Do not use floating point double instructions.
9130
9131 @item -mmedia
9132 @opindex mmedia
9133
9134 Use media instructions.
9135
9136 @item -mno-media
9137 @opindex mno-media
9138
9139 Do not use media instructions.
9140
9141 @item -mmuladd
9142 @opindex mmuladd
9143
9144 Use multiply and add/subtract instructions.
9145
9146 @item -mno-muladd
9147 @opindex mno-muladd
9148
9149 Do not use multiply and add/subtract instructions.
9150
9151 @item -mfdpic
9152 @opindex mfdpic
9153
9154 Select the FDPIC ABI, that uses function descriptors to represent
9155 pointers to functions.  Without any PIC/PIE-related options, it
9156 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
9157 assumes GOT entries and small data are within a 12-bit range from the
9158 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
9159 are computed with 32 bits.
9160
9161 @item -minline-plt
9162 @opindex minline-plt
9163
9164 Enable inlining of PLT entries in function calls to functions that are
9165 not known to bind locally.  It has no effect without @option{-mfdpic}.
9166 It's enabled by default if optimizing for speed and compiling for
9167 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
9168 optimization option such as @option{-O3} or above is present in the
9169 command line.
9170
9171 @item -mTLS
9172 @opindex TLS
9173
9174 Assume a large TLS segment when generating thread-local code.
9175
9176 @item -mtls
9177 @opindex tls
9178
9179 Do not assume a large TLS segment when generating thread-local code.
9180
9181 @item -mgprel-ro
9182 @opindex mgprel-ro
9183
9184 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
9185 that is known to be in read-only sections.  It's enabled by default,
9186 except for @option{-fpic} or @option{-fpie}: even though it may help
9187 make the global offset table smaller, it trades 1 instruction for 4.
9188 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9189 one of which may be shared by multiple symbols, and it avoids the need
9190 for a GOT entry for the referenced symbol, so it's more likely to be a
9191 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9192
9193 @item -multilib-library-pic
9194 @opindex multilib-library-pic
9195
9196 Link with the (library, not FD) pic libraries.  It's implied by
9197 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9198 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9199 it explicitly.
9200
9201 @item -mlinked-fp
9202 @opindex mlinked-fp
9203
9204 Follow the EABI requirement of always creating a frame pointer whenever
9205 a stack frame is allocated.  This option is enabled by default and can
9206 be disabled with @option{-mno-linked-fp}.
9207
9208 @item -mlong-calls
9209 @opindex mlong-calls
9210
9211 Use indirect addressing to call functions outside the current
9212 compilation unit.  This allows the functions to be placed anywhere
9213 within the 32-bit address space.
9214
9215 @item -malign-labels
9216 @opindex malign-labels
9217
9218 Try to align labels to an 8-byte boundary by inserting nops into the
9219 previous packet.  This option only has an effect when VLIW packing
9220 is enabled.  It doesn't create new packets; it merely adds nops to
9221 existing ones.
9222
9223 @item -mlibrary-pic
9224 @opindex mlibrary-pic
9225
9226 Generate position-independent EABI code.
9227
9228 @item -macc-4
9229 @opindex macc-4
9230
9231 Use only the first four media accumulator registers.
9232
9233 @item -macc-8
9234 @opindex macc-8
9235
9236 Use all eight media accumulator registers.
9237
9238 @item -mpack
9239 @opindex mpack
9240
9241 Pack VLIW instructions.
9242
9243 @item -mno-pack
9244 @opindex mno-pack
9245
9246 Do not pack VLIW instructions.
9247
9248 @item -mno-eflags
9249 @opindex mno-eflags
9250
9251 Do not mark ABI switches in e_flags.
9252
9253 @item -mcond-move
9254 @opindex mcond-move
9255
9256 Enable the use of conditional-move instructions (default).
9257
9258 This switch is mainly for debugging the compiler and will likely be removed
9259 in a future version.
9260
9261 @item -mno-cond-move
9262 @opindex mno-cond-move
9263
9264 Disable the use of conditional-move instructions.
9265
9266 This switch is mainly for debugging the compiler and will likely be removed
9267 in a future version.
9268
9269 @item -mscc
9270 @opindex mscc
9271
9272 Enable the use of conditional set instructions (default).
9273
9274 This switch is mainly for debugging the compiler and will likely be removed
9275 in a future version.
9276
9277 @item -mno-scc
9278 @opindex mno-scc
9279
9280 Disable the use of conditional set instructions.
9281
9282 This switch is mainly for debugging the compiler and will likely be removed
9283 in a future version.
9284
9285 @item -mcond-exec
9286 @opindex mcond-exec
9287
9288 Enable the use of conditional execution (default).
9289
9290 This switch is mainly for debugging the compiler and will likely be removed
9291 in a future version.
9292
9293 @item -mno-cond-exec
9294 @opindex mno-cond-exec
9295
9296 Disable the use of conditional execution.
9297
9298 This switch is mainly for debugging the compiler and will likely be removed
9299 in a future version.
9300
9301 @item -mvliw-branch
9302 @opindex mvliw-branch
9303
9304 Run a pass to pack branches into VLIW instructions (default).
9305
9306 This switch is mainly for debugging the compiler and will likely be removed
9307 in a future version.
9308
9309 @item -mno-vliw-branch
9310 @opindex mno-vliw-branch
9311
9312 Do not run a pass to pack branches into VLIW instructions.
9313
9314 This switch is mainly for debugging the compiler and will likely be removed
9315 in a future version.
9316
9317 @item -mmulti-cond-exec
9318 @opindex mmulti-cond-exec
9319
9320 Enable optimization of @code{&&} and @code{||} in conditional execution
9321 (default).
9322
9323 This switch is mainly for debugging the compiler and will likely be removed
9324 in a future version.
9325
9326 @item -mno-multi-cond-exec
9327 @opindex mno-multi-cond-exec
9328
9329 Disable optimization of @code{&&} and @code{||} in conditional execution.
9330
9331 This switch is mainly for debugging the compiler and will likely be removed
9332 in a future version.
9333
9334 @item -mnested-cond-exec
9335 @opindex mnested-cond-exec
9336
9337 Enable nested conditional execution optimizations (default).
9338
9339 This switch is mainly for debugging the compiler and will likely be removed
9340 in a future version.
9341
9342 @item -mno-nested-cond-exec
9343 @opindex mno-nested-cond-exec
9344
9345 Disable nested conditional execution optimizations.
9346
9347 This switch is mainly for debugging the compiler and will likely be removed
9348 in a future version.
9349
9350 @item -moptimize-membar
9351 @opindex moptimize-membar
9352
9353 This switch removes redundant @code{membar} instructions from the
9354 compiler generated code.  It is enabled by default.
9355
9356 @item -mno-optimize-membar
9357 @opindex mno-optimize-membar
9358
9359 This switch disables the automatic removal of redundant @code{membar}
9360 instructions from the generated code.
9361
9362 @item -mtomcat-stats
9363 @opindex mtomcat-stats
9364
9365 Cause gas to print out tomcat statistics.
9366
9367 @item -mcpu=@var{cpu}
9368 @opindex mcpu
9369
9370 Select the processor type for which to generate code.  Possible values are
9371 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9372 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9373
9374 @end table
9375
9376 @node GNU/Linux Options
9377 @subsection GNU/Linux Options
9378
9379 These @samp{-m} options are defined for GNU/Linux targets:
9380
9381 @table @gcctabopt
9382 @item -mglibc
9383 @opindex mglibc
9384 Use the GNU C library instead of uClibc.  This is the default except
9385 on @samp{*-*-linux-*uclibc*} targets.
9386
9387 @item -muclibc
9388 @opindex muclibc
9389 Use uClibc instead of the GNU C library.  This is the default on
9390 @samp{*-*-linux-*uclibc*} targets.
9391 @end table
9392
9393 @node H8/300 Options
9394 @subsection H8/300 Options
9395
9396 These @samp{-m} options are defined for the H8/300 implementations:
9397
9398 @table @gcctabopt
9399 @item -mrelax
9400 @opindex mrelax
9401 Shorten some address references at link time, when possible; uses the
9402 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9403 ld, Using ld}, for a fuller description.
9404
9405 @item -mh
9406 @opindex mh
9407 Generate code for the H8/300H@.
9408
9409 @item -ms
9410 @opindex ms
9411 Generate code for the H8S@.
9412
9413 @item -mn
9414 @opindex mn
9415 Generate code for the H8S and H8/300H in the normal mode.  This switch
9416 must be used either with @option{-mh} or @option{-ms}.
9417
9418 @item -ms2600
9419 @opindex ms2600
9420 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9421
9422 @item -mint32
9423 @opindex mint32
9424 Make @code{int} data 32 bits by default.
9425
9426 @item -malign-300
9427 @opindex malign-300
9428 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9429 The default for the H8/300H and H8S is to align longs and floats on 4
9430 byte boundaries.
9431 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9432 This option has no effect on the H8/300.
9433 @end table
9434
9435 @node HPPA Options
9436 @subsection HPPA Options
9437 @cindex HPPA Options
9438
9439 These @samp{-m} options are defined for the HPPA family of computers:
9440
9441 @table @gcctabopt
9442 @item -march=@var{architecture-type}
9443 @opindex march
9444 Generate code for the specified architecture.  The choices for
9445 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9446 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9447 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9448 architecture option for your machine.  Code compiled for lower numbered
9449 architectures will run on higher numbered architectures, but not the
9450 other way around.
9451
9452 @item -mpa-risc-1-0
9453 @itemx -mpa-risc-1-1
9454 @itemx -mpa-risc-2-0
9455 @opindex mpa-risc-1-0
9456 @opindex mpa-risc-1-1
9457 @opindex mpa-risc-2-0
9458 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9459
9460 @item -mbig-switch
9461 @opindex mbig-switch
9462 Generate code suitable for big switch tables.  Use this option only if
9463 the assembler/linker complain about out of range branches within a switch
9464 table.
9465
9466 @item -mjump-in-delay
9467 @opindex mjump-in-delay
9468 Fill delay slots of function calls with unconditional jump instructions
9469 by modifying the return pointer for the function call to be the target
9470 of the conditional jump.
9471
9472 @item -mdisable-fpregs
9473 @opindex mdisable-fpregs
9474 Prevent floating point registers from being used in any manner.  This is
9475 necessary for compiling kernels which perform lazy context switching of
9476 floating point registers.  If you use this option and attempt to perform
9477 floating point operations, the compiler will abort.
9478
9479 @item -mdisable-indexing
9480 @opindex mdisable-indexing
9481 Prevent the compiler from using indexing address modes.  This avoids some
9482 rather obscure problems when compiling MIG generated code under MACH@.
9483
9484 @item -mno-space-regs
9485 @opindex mno-space-regs
9486 Generate code that assumes the target has no space registers.  This allows
9487 GCC to generate faster indirect calls and use unscaled index address modes.
9488
9489 Such code is suitable for level 0 PA systems and kernels.
9490
9491 @item -mfast-indirect-calls
9492 @opindex mfast-indirect-calls
9493 Generate code that assumes calls never cross space boundaries.  This
9494 allows GCC to emit code which performs faster indirect calls.
9495
9496 This option will not work in the presence of shared libraries or nested
9497 functions.
9498
9499 @item -mfixed-range=@var{register-range}
9500 @opindex mfixed-range
9501 Generate code treating the given register range as fixed registers.
9502 A fixed register is one that the register allocator can not use.  This is
9503 useful when compiling kernel code.  A register range is specified as
9504 two registers separated by a dash.  Multiple register ranges can be
9505 specified separated by a comma.
9506
9507 @item -mlong-load-store
9508 @opindex mlong-load-store
9509 Generate 3-instruction load and store sequences as sometimes required by
9510 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9511 the HP compilers.
9512
9513 @item -mportable-runtime
9514 @opindex mportable-runtime
9515 Use the portable calling conventions proposed by HP for ELF systems.
9516
9517 @item -mgas
9518 @opindex mgas
9519 Enable the use of assembler directives only GAS understands.
9520
9521 @item -mschedule=@var{cpu-type}
9522 @opindex mschedule
9523 Schedule code according to the constraints for the machine type
9524 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9525 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9526 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9527 proper scheduling option for your machine.  The default scheduling is
9528 @samp{8000}.
9529
9530 @item -mlinker-opt
9531 @opindex mlinker-opt
9532 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9533 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9534 linkers in which they give bogus error messages when linking some programs.
9535
9536 @item -msoft-float
9537 @opindex msoft-float
9538 Generate output containing library calls for floating point.
9539 @strong{Warning:} the requisite libraries are not available for all HPPA
9540 targets.  Normally the facilities of the machine's usual C compiler are
9541 used, but this cannot be done directly in cross-compilation.  You must make
9542 your own arrangements to provide suitable library functions for
9543 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9544 does provide software floating point support.
9545
9546 @option{-msoft-float} changes the calling convention in the output file;
9547 therefore, it is only useful if you compile @emph{all} of a program with
9548 this option.  In particular, you need to compile @file{libgcc.a}, the
9549 library that comes with GCC, with @option{-msoft-float} in order for
9550 this to work.
9551
9552 @item -msio
9553 @opindex msio
9554 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9555 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9556 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9557 options are available under HP-UX and HI-UX@.
9558
9559 @item -mgnu-ld
9560 @opindex gnu-ld
9561 Use GNU ld specific options.  This passes @option{-shared} to ld when
9562 building a shared library.  It is the default when GCC is configured,
9563 explicitly or implicitly, with the GNU linker.  This option does not
9564 have any affect on which ld is called, it only changes what parameters
9565 are passed to that ld.  The ld that is called is determined by the
9566 @option{--with-ld} configure option, GCC's program search path, and
9567 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9568 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9569 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9570
9571 @item -mhp-ld
9572 @opindex hp-ld
9573 Use HP ld specific options.  This passes @option{-b} to ld when building
9574 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9575 links.  It is the default when GCC is configured, explicitly or
9576 implicitly, with the HP linker.  This option does not have any affect on
9577 which ld is called, it only changes what parameters are passed to that
9578 ld.  The ld that is called is determined by the @option{--with-ld}
9579 configure option, GCC's program search path, and finally by the user's
9580 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9581 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9582 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9583
9584 @item -mlong-calls
9585 @opindex mno-long-calls
9586 Generate code that uses long call sequences.  This ensures that a call
9587 is always able to reach linker generated stubs.  The default is to generate
9588 long calls only when the distance from the call site to the beginning
9589 of the function or translation unit, as the case may be, exceeds a
9590 predefined limit set by the branch type being used.  The limits for
9591 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9592 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9593 240,000 bytes.
9594
9595 Distances are measured from the beginning of functions when using the
9596 @option{-ffunction-sections} option, or when using the @option{-mgas}
9597 and @option{-mno-portable-runtime} options together under HP-UX with
9598 the SOM linker.
9599
9600 It is normally not desirable to use this option as it will degrade
9601 performance.  However, it may be useful in large applications,
9602 particularly when partial linking is used to build the application.
9603
9604 The types of long calls used depends on the capabilities of the
9605 assembler and linker, and the type of code being generated.  The
9606 impact on systems that support long absolute calls, and long pic
9607 symbol-difference or pc-relative calls should be relatively small.
9608 However, an indirect call is used on 32-bit ELF systems in pic code
9609 and it is quite long.
9610
9611 @item -munix=@var{unix-std}
9612 @opindex march
9613 Generate compiler predefines and select a startfile for the specified
9614 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9615 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9616 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9617 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9618 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9619 and later.
9620
9621 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9622 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9623 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9624 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9625 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9626 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9627
9628 It is @emph{important} to note that this option changes the interfaces
9629 for various library routines.  It also affects the operational behavior
9630 of the C library.  Thus, @emph{extreme} care is needed in using this
9631 option.
9632
9633 Library code that is intended to operate with more than one UNIX
9634 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9635 as appropriate.  Most GNU software doesn't provide this capability.
9636
9637 @item -nolibdld
9638 @opindex nolibdld
9639 Suppress the generation of link options to search libdld.sl when the
9640 @option{-static} option is specified on HP-UX 10 and later.
9641
9642 @item -static
9643 @opindex static
9644 The HP-UX implementation of setlocale in libc has a dependency on
9645 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9646 when the @option{-static} option is specified, special link options
9647 are needed to resolve this dependency.
9648
9649 On HP-UX 10 and later, the GCC driver adds the necessary options to
9650 link with libdld.sl when the @option{-static} option is specified.
9651 This causes the resulting binary to be dynamic.  On the 64-bit port,
9652 the linkers generate dynamic binaries by default in any case.  The
9653 @option{-nolibdld} option can be used to prevent the GCC driver from
9654 adding these link options.
9655
9656 @item -threads
9657 @opindex threads
9658 Add support for multithreading with the @dfn{dce thread} library
9659 under HP-UX@.  This option sets flags for both the preprocessor and
9660 linker.
9661 @end table
9662
9663 @node i386 and x86-64 Options
9664 @subsection Intel 386 and AMD x86-64 Options
9665 @cindex i386 Options
9666 @cindex x86-64 Options
9667 @cindex Intel 386 Options
9668 @cindex AMD x86-64 Options
9669
9670 These @samp{-m} options are defined for the i386 and x86-64 family of
9671 computers:
9672
9673 @table @gcctabopt
9674 @item -mtune=@var{cpu-type}
9675 @opindex mtune
9676 Tune to @var{cpu-type} everything applicable about the generated code, except
9677 for the ABI and the set of available instructions.  The choices for
9678 @var{cpu-type} are:
9679 @table @emph
9680 @item generic
9681 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9682 If you know the CPU on which your code will run, then you should use
9683 the corresponding @option{-mtune} option instead of
9684 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9685 of your application will have, then you should use this option.
9686
9687 As new processors are deployed in the marketplace, the behavior of this
9688 option will change.  Therefore, if you upgrade to a newer version of
9689 GCC, the code generated option will change to reflect the processors
9690 that were most common when that version of GCC was released.
9691
9692 There is no @option{-march=generic} option because @option{-march}
9693 indicates the instruction set the compiler can use, and there is no
9694 generic instruction set applicable to all processors.  In contrast,
9695 @option{-mtune} indicates the processor (or, in this case, collection of
9696 processors) for which the code is optimized.
9697 @item native
9698 This selects the CPU to tune for at compilation time by determining
9699 the processor type of the compiling machine.  Using @option{-mtune=native}
9700 will produce code optimized for the local machine under the constraints
9701 of the selected instruction set.  Using @option{-march=native} will
9702 enable all instruction subsets supported by the local machine (hence
9703 the result might not run on different machines).
9704 @item i386
9705 Original Intel's i386 CPU@.
9706 @item i486
9707 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9708 @item i586, pentium
9709 Intel Pentium CPU with no MMX support.
9710 @item pentium-mmx
9711 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9712 @item pentiumpro
9713 Intel PentiumPro CPU@.
9714 @item i686
9715 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9716 instruction set will be used, so the code will run on all i686 family chips.
9717 @item pentium2
9718 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9719 @item pentium3, pentium3m
9720 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9721 support.
9722 @item pentium-m
9723 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9724 support.  Used by Centrino notebooks.
9725 @item pentium4, pentium4m
9726 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9727 @item prescott
9728 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9729 set support.
9730 @item nocona
9731 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9732 SSE2 and SSE3 instruction set support.
9733 @item core2
9734 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9735 instruction set support.
9736 @item k6
9737 AMD K6 CPU with MMX instruction set support.
9738 @item k6-2, k6-3
9739 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9740 @item athlon, athlon-tbird
9741 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9742 support.
9743 @item athlon-4, athlon-xp, athlon-mp
9744 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9745 instruction set support.
9746 @item k8, opteron, athlon64, athlon-fx
9747 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9748 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9749 @item amdfam10
9750 AMD Family 10 core based CPUs with x86-64 instruction set support.  (This
9751 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
9752 instruction set extensions.)
9753 @item winchip-c6
9754 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9755 set support.
9756 @item winchip2
9757 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9758 instruction set support.
9759 @item c3
9760 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9761 implemented for this chip.)
9762 @item c3-2
9763 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9764 implemented for this chip.)
9765 @item geode
9766 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9767 @end table
9768
9769 While picking a specific @var{cpu-type} will schedule things appropriately
9770 for that particular chip, the compiler will not generate any code that
9771 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9772 being used.
9773
9774 @item -march=@var{cpu-type}
9775 @opindex march
9776 Generate instructions for the machine type @var{cpu-type}.  The choices
9777 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9778 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9779
9780 @item -mcpu=@var{cpu-type}
9781 @opindex mcpu
9782 A deprecated synonym for @option{-mtune}.
9783
9784 @item -m386
9785 @itemx -m486
9786 @itemx -mpentium
9787 @itemx -mpentiumpro
9788 @opindex m386
9789 @opindex m486
9790 @opindex mpentium
9791 @opindex mpentiumpro
9792 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9793 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9794 These synonyms are deprecated.
9795
9796 @item -mfpmath=@var{unit}
9797 @opindex march
9798 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9799 for @var{unit} are:
9800
9801 @table @samp
9802 @item 387
9803 Use the standard 387 floating point coprocessor present majority of chips and
9804 emulated otherwise.  Code compiled with this option will run almost everywhere.
9805 The temporary results are computed in 80bit precision instead of precision
9806 specified by the type resulting in slightly different results compared to most
9807 of other chips.  See @option{-ffloat-store} for more detailed description.
9808
9809 This is the default choice for i386 compiler.
9810
9811 @item sse
9812 Use scalar floating point instructions present in the SSE instruction set.
9813 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9814 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9815 instruction set supports only single precision arithmetics, thus the double and
9816 extended precision arithmetics is still done using 387.  Later version, present
9817 only in Pentium4 and the future AMD x86-64 chips supports double precision
9818 arithmetics too.
9819
9820 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9821 or @option{-msse2} switches to enable SSE extensions and make this option
9822 effective.  For the x86-64 compiler, these extensions are enabled by default.
9823
9824 The resulting code should be considerably faster in the majority of cases and avoid
9825 the numerical instability problems of 387 code, but may break some existing
9826 code that expects temporaries to be 80bit.
9827
9828 This is the default choice for the x86-64 compiler.
9829
9830 @item sse,387
9831 Attempt to utilize both instruction sets at once.  This effectively double the
9832 amount of available registers and on chips with separate execution units for
9833 387 and SSE the execution resources too.  Use this option with care, as it is
9834 still experimental, because the GCC register allocator does not model separate
9835 functional units well resulting in instable performance.
9836 @end table
9837
9838 @item -masm=@var{dialect}
9839 @opindex masm=@var{dialect}
9840 Output asm instructions using selected @var{dialect}.  Supported
9841 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9842 not support @samp{intel}.
9843
9844 @item -mieee-fp
9845 @itemx -mno-ieee-fp
9846 @opindex mieee-fp
9847 @opindex mno-ieee-fp
9848 Control whether or not the compiler uses IEEE floating point
9849 comparisons.  These handle correctly the case where the result of a
9850 comparison is unordered.
9851
9852 @item -msoft-float
9853 @opindex msoft-float
9854 Generate output containing library calls for floating point.
9855 @strong{Warning:} the requisite libraries are not part of GCC@.
9856 Normally the facilities of the machine's usual C compiler are used, but
9857 this can't be done directly in cross-compilation.  You must make your
9858 own arrangements to provide suitable library functions for
9859 cross-compilation.
9860
9861 On machines where a function returns floating point results in the 80387
9862 register stack, some floating point opcodes may be emitted even if
9863 @option{-msoft-float} is used.
9864
9865 @item -mno-fp-ret-in-387
9866 @opindex mno-fp-ret-in-387
9867 Do not use the FPU registers for return values of functions.
9868
9869 The usual calling convention has functions return values of types
9870 @code{float} and @code{double} in an FPU register, even if there
9871 is no FPU@.  The idea is that the operating system should emulate
9872 an FPU@.
9873
9874 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9875 in ordinary CPU registers instead.
9876
9877 @item -mno-fancy-math-387
9878 @opindex mno-fancy-math-387
9879 Some 387 emulators do not support the @code{sin}, @code{cos} and
9880 @code{sqrt} instructions for the 387.  Specify this option to avoid
9881 generating those instructions.  This option is the default on FreeBSD,
9882 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9883 indicates that the target cpu will always have an FPU and so the
9884 instruction will not need emulation.  As of revision 2.6.1, these
9885 instructions are not generated unless you also use the
9886 @option{-funsafe-math-optimizations} switch.
9887
9888 @item -malign-double
9889 @itemx -mno-align-double
9890 @opindex malign-double
9891 @opindex mno-align-double
9892 Control whether GCC aligns @code{double}, @code{long double}, and
9893 @code{long long} variables on a two word boundary or a one word
9894 boundary.  Aligning @code{double} variables on a two word boundary will
9895 produce code that runs somewhat faster on a @samp{Pentium} at the
9896 expense of more memory.
9897
9898 On x86-64, @option{-malign-double} is enabled by default.
9899
9900 @strong{Warning:} if you use the @option{-malign-double} switch,
9901 structures containing the above types will be aligned differently than
9902 the published application binary interface specifications for the 386
9903 and will not be binary compatible with structures in code compiled
9904 without that switch.
9905
9906 @item -m96bit-long-double
9907 @itemx -m128bit-long-double
9908 @opindex m96bit-long-double
9909 @opindex m128bit-long-double
9910 These switches control the size of @code{long double} type.  The i386
9911 application binary interface specifies the size to be 96 bits,
9912 so @option{-m96bit-long-double} is the default in 32 bit mode.
9913
9914 Modern architectures (Pentium and newer) would prefer @code{long double}
9915 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9916 conforming to the ABI, this would not be possible.  So specifying a
9917 @option{-m128bit-long-double} will align @code{long double}
9918 to a 16 byte boundary by padding the @code{long double} with an additional
9919 32 bit zero.
9920
9921 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9922 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9923
9924 Notice that neither of these options enable any extra precision over the x87
9925 standard of 80 bits for a @code{long double}.
9926
9927 @strong{Warning:} if you override the default value for your target ABI, the
9928 structures and arrays containing @code{long double} variables will change
9929 their size as well as function calling convention for function taking
9930 @code{long double} will be modified.  Hence they will not be binary
9931 compatible with arrays or structures in code compiled without that switch.
9932
9933 @item -mmlarge-data-threshold=@var{number}
9934 @opindex mlarge-data-threshold=@var{number}
9935 When @option{-mcmodel=medium} is specified, the data greater than
9936 @var{threshold} are placed in large data section.  This value must be the
9937 same across all object linked into the binary and defaults to 65535.
9938
9939 @item -msvr3-shlib
9940 @itemx -mno-svr3-shlib
9941 @opindex msvr3-shlib
9942 @opindex mno-svr3-shlib
9943 Control whether GCC places uninitialized local variables into the
9944 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9945 into @code{bss}.  These options are meaningful only on System V Release 3.
9946
9947 @item -mrtd
9948 @opindex mrtd
9949 Use a different function-calling convention, in which functions that
9950 take a fixed number of arguments return with the @code{ret} @var{num}
9951 instruction, which pops their arguments while returning.  This saves one
9952 instruction in the caller since there is no need to pop the arguments
9953 there.
9954
9955 You can specify that an individual function is called with this calling
9956 sequence with the function attribute @samp{stdcall}.  You can also
9957 override the @option{-mrtd} option by using the function attribute
9958 @samp{cdecl}.  @xref{Function Attributes}.
9959
9960 @strong{Warning:} this calling convention is incompatible with the one
9961 normally used on Unix, so you cannot use it if you need to call
9962 libraries compiled with the Unix compiler.
9963
9964 Also, you must provide function prototypes for all functions that
9965 take variable numbers of arguments (including @code{printf});
9966 otherwise incorrect code will be generated for calls to those
9967 functions.
9968
9969 In addition, seriously incorrect code will result if you call a
9970 function with too many arguments.  (Normally, extra arguments are
9971 harmlessly ignored.)
9972
9973 @item -mregparm=@var{num}
9974 @opindex mregparm
9975 Control how many registers are used to pass integer arguments.  By
9976 default, no registers are used to pass arguments, and at most 3
9977 registers can be used.  You can control this behavior for a specific
9978 function by using the function attribute @samp{regparm}.
9979 @xref{Function Attributes}.
9980
9981 @strong{Warning:} if you use this switch, and
9982 @var{num} is nonzero, then you must build all modules with the same
9983 value, including any libraries.  This includes the system libraries and
9984 startup modules.
9985
9986 @item -msseregparm
9987 @opindex msseregparm
9988 Use SSE register passing conventions for float and double arguments
9989 and return values.  You can control this behavior for a specific
9990 function by using the function attribute @samp{sseregparm}.
9991 @xref{Function Attributes}.
9992
9993 @strong{Warning:} if you use this switch then you must build all
9994 modules with the same value, including any libraries.  This includes
9995 the system libraries and startup modules.
9996
9997 @item -mstackrealign
9998 @opindex mstackrealign
9999 Realign the stack at entry.  On the Intel x86, the
10000 @option{-mstackrealign} option will generate an alternate prologue and
10001 epilogue that realigns the runtime stack.  This supports mixing legacy
10002 codes that keep a 4-byte aligned stack with modern codes that keep a
10003 16-byte stack for SSE compatibility.  The alternate prologue and
10004 epilogue are slower and bigger than the regular ones, and the
10005 alternate prologue requires an extra scratch register; this lowers the
10006 number of registers available if used in conjunction with the
10007 @code{regparm} attribute.  The @option{-mstackrealign} option is
10008 incompatible with the nested function prologue; this is considered a
10009 hard error.  See also the attribute @code{force_align_arg_pointer},
10010 applicable to individual functions.
10011
10012 @item -mpreferred-stack-boundary=@var{num}
10013 @opindex mpreferred-stack-boundary
10014 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10015 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10016 the default is 4 (16 bytes or 128 bits).
10017
10018 On Pentium and PentiumPro, @code{double} and @code{long double} values
10019 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10020 suffer significant run time performance penalties.  On Pentium III, the
10021 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10022 properly if it is not 16 byte aligned.
10023
10024 To ensure proper alignment of this values on the stack, the stack boundary
10025 must be as aligned as that required by any value stored on the stack.
10026 Further, every function must be generated such that it keeps the stack
10027 aligned.  Thus calling a function compiled with a higher preferred
10028 stack boundary from a function compiled with a lower preferred stack
10029 boundary will most likely misalign the stack.  It is recommended that
10030 libraries that use callbacks always use the default setting.
10031
10032 This extra alignment does consume extra stack space, and generally
10033 increases code size.  Code that is sensitive to stack space usage, such
10034 as embedded systems and operating system kernels, may want to reduce the
10035 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10036
10037 @item -mmmx
10038 @itemx -mno-mmx
10039 @item -msse
10040 @itemx -mno-sse
10041 @item -msse2
10042 @itemx -mno-sse2
10043 @item -msse3
10044 @itemx -mno-sse3
10045 @item -mssse3
10046 @itemx -mno-ssse3
10047 @item -msse4a
10048 @item -mno-sse4a
10049 @item -m3dnow
10050 @itemx -mno-3dnow
10051 @item -mpopcnt
10052 @itemx -mno-popcnt
10053 @item -mabm
10054 @itemx -mno-abm
10055 @opindex mmmx
10056 @opindex mno-mmx
10057 @opindex msse
10058 @opindex mno-sse
10059 @opindex m3dnow
10060 @opindex mno-3dnow
10061 These switches enable or disable the use of instructions in the MMX,
10062 SSE, SSE2, SSE3, SSSE3, SSE4A, ABM or 3DNow! extended instruction sets.
10063 These extensions are also available as built-in functions: see
10064 @ref{X86 Built-in Functions}, for details of the functions enabled and
10065 disabled by these switches.
10066
10067 To have SSE/SSE2 instructions generated automatically from floating-point
10068 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10069
10070 These options will enable GCC to use these extended instructions in
10071 generated code, even without @option{-mfpmath=sse}.  Applications which
10072 perform runtime CPU detection must compile separate files for each
10073 supported architecture, using the appropriate flags.  In particular,
10074 the file containing the CPU detection code should be compiled without
10075 these options.
10076
10077 @item -mpush-args
10078 @itemx -mno-push-args
10079 @opindex mpush-args
10080 @opindex mno-push-args
10081 Use PUSH operations to store outgoing parameters.  This method is shorter
10082 and usually equally fast as method using SUB/MOV operations and is enabled
10083 by default.  In some cases disabling it may improve performance because of
10084 improved scheduling and reduced dependencies.
10085
10086 @item -maccumulate-outgoing-args
10087 @opindex maccumulate-outgoing-args
10088 If enabled, the maximum amount of space required for outgoing arguments will be
10089 computed in the function prologue.  This is faster on most modern CPUs
10090 because of reduced dependencies, improved scheduling and reduced stack usage
10091 when preferred stack boundary is not equal to 2.  The drawback is a notable
10092 increase in code size.  This switch implies @option{-mno-push-args}.
10093
10094 @item -mthreads
10095 @opindex mthreads
10096 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
10097 on thread-safe exception handling must compile and link all code with the
10098 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
10099 @option{-D_MT}; when linking, it links in a special thread helper library
10100 @option{-lmingwthrd} which cleans up per thread exception handling data.
10101
10102 @item -mno-align-stringops
10103 @opindex mno-align-stringops
10104 Do not align destination of inlined string operations.  This switch reduces
10105 code size and improves performance in case the destination is already aligned,
10106 but GCC doesn't know about it.
10107
10108 @item -minline-all-stringops
10109 @opindex minline-all-stringops
10110 By default GCC inlines string operations only when destination is known to be
10111 aligned at least to 4 byte boundary.  This enables more inlining, increase code
10112 size, but may improve performance of code that depends on fast memcpy, strlen
10113 and memset for short lengths.
10114
10115 @item -minline-stringops-dynamically
10116 @opindex minline-stringops-dynamically
10117 For string operation of unknown size, inline runtime checks so for small
10118 blocks inline code is used, while for large blocks library call is used.
10119
10120 @item -mstringop-strategy=@var{alg}
10121 @opindex mstringop-strategy=@var{alg}
10122 Overwrite internal decision heuristic about particular algorithm to inline
10123 string operation with.  The allowed values are @code{rep_byte},
10124 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
10125 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
10126 expanding inline loop, @code{libcall} for always expanding library call.
10127
10128 @item -momit-leaf-frame-pointer
10129 @opindex momit-leaf-frame-pointer
10130 Don't keep the frame pointer in a register for leaf functions.  This
10131 avoids the instructions to save, set up and restore frame pointers and
10132 makes an extra register available in leaf functions.  The option
10133 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10134 which might make debugging harder.
10135
10136 @item -mtls-direct-seg-refs
10137 @itemx -mno-tls-direct-seg-refs
10138 @opindex mtls-direct-seg-refs
10139 Controls whether TLS variables may be accessed with offsets from the
10140 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
10141 or whether the thread base pointer must be added.  Whether or not this
10142 is legal depends on the operating system, and whether it maps the
10143 segment to cover the entire TLS area.
10144
10145 For systems that use GNU libc, the default is on.
10146 @end table
10147
10148 These @samp{-m} switches are supported in addition to the above
10149 on AMD x86-64 processors in 64-bit environments.
10150
10151 @table @gcctabopt
10152 @item -m32
10153 @itemx -m64
10154 @opindex m32
10155 @opindex m64
10156 Generate code for a 32-bit or 64-bit environment.
10157 The 32-bit environment sets int, long and pointer to 32 bits and
10158 generates code that runs on any i386 system.
10159 The 64-bit environment sets int to 32 bits and long and pointer
10160 to 64 bits and generates code for AMD's x86-64 architecture.
10161
10162 @item -mno-red-zone
10163 @opindex no-red-zone
10164 Do not use a so called red zone for x86-64 code.  The red zone is mandated
10165 by the x86-64 ABI, it is a 128-byte area beyond the location of the
10166 stack pointer that will not be modified by signal or interrupt handlers
10167 and therefore can be used for temporary data without adjusting the stack
10168 pointer.  The flag @option{-mno-red-zone} disables this red zone.
10169
10170 @item -mcmodel=small
10171 @opindex mcmodel=small
10172 Generate code for the small code model: the program and its symbols must
10173 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
10174 Programs can be statically or dynamically linked.  This is the default
10175 code model.
10176
10177 @item -mcmodel=kernel
10178 @opindex mcmodel=kernel
10179 Generate code for the kernel code model.  The kernel runs in the
10180 negative 2 GB of the address space.
10181 This model has to be used for Linux kernel code.
10182
10183 @item -mcmodel=medium
10184 @opindex mcmodel=medium
10185 Generate code for the medium model: The program is linked in the lower 2
10186 GB of the address space but symbols can be located anywhere in the
10187 address space.  Programs can be statically or dynamically linked, but
10188 building of shared libraries are not supported with the medium model.
10189
10190 @item -mcmodel=large
10191 @opindex mcmodel=large
10192 Generate code for the large model: This model makes no assumptions
10193 about addresses and sizes of sections.  
10194 @end table
10195
10196 @node IA-64 Options
10197 @subsection IA-64 Options
10198 @cindex IA-64 Options
10199
10200 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10201
10202 @table @gcctabopt
10203 @item -mbig-endian
10204 @opindex mbig-endian
10205 Generate code for a big endian target.  This is the default for HP-UX@.
10206
10207 @item -mlittle-endian
10208 @opindex mlittle-endian
10209 Generate code for a little endian target.  This is the default for AIX5
10210 and GNU/Linux.
10211
10212 @item -mgnu-as
10213 @itemx -mno-gnu-as
10214 @opindex mgnu-as
10215 @opindex mno-gnu-as
10216 Generate (or don't) code for the GNU assembler.  This is the default.
10217 @c Also, this is the default if the configure option @option{--with-gnu-as}
10218 @c is used.
10219
10220 @item -mgnu-ld
10221 @itemx -mno-gnu-ld
10222 @opindex mgnu-ld
10223 @opindex mno-gnu-ld
10224 Generate (or don't) code for the GNU linker.  This is the default.
10225 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10226 @c is used.
10227
10228 @item -mno-pic
10229 @opindex mno-pic
10230 Generate code that does not use a global pointer register.  The result
10231 is not position independent code, and violates the IA-64 ABI@.
10232
10233 @item -mvolatile-asm-stop
10234 @itemx -mno-volatile-asm-stop
10235 @opindex mvolatile-asm-stop
10236 @opindex mno-volatile-asm-stop
10237 Generate (or don't) a stop bit immediately before and after volatile asm
10238 statements.
10239
10240 @item -mregister-names
10241 @itemx -mno-register-names
10242 @opindex mregister-names
10243 @opindex mno-register-names
10244 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10245 the stacked registers.  This may make assembler output more readable.
10246
10247 @item -mno-sdata
10248 @itemx -msdata
10249 @opindex mno-sdata
10250 @opindex msdata
10251 Disable (or enable) optimizations that use the small data section.  This may
10252 be useful for working around optimizer bugs.
10253
10254 @item -mconstant-gp
10255 @opindex mconstant-gp
10256 Generate code that uses a single constant global pointer value.  This is
10257 useful when compiling kernel code.
10258
10259 @item -mauto-pic
10260 @opindex mauto-pic
10261 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10262 This is useful when compiling firmware code.
10263
10264 @item -minline-float-divide-min-latency
10265 @opindex minline-float-divide-min-latency
10266 Generate code for inline divides of floating point values
10267 using the minimum latency algorithm.
10268
10269 @item -minline-float-divide-max-throughput
10270 @opindex minline-float-divide-max-throughput
10271 Generate code for inline divides of floating point values
10272 using the maximum throughput algorithm.
10273
10274 @item -minline-int-divide-min-latency
10275 @opindex minline-int-divide-min-latency
10276 Generate code for inline divides of integer values
10277 using the minimum latency algorithm.
10278
10279 @item -minline-int-divide-max-throughput
10280 @opindex minline-int-divide-max-throughput
10281 Generate code for inline divides of integer values
10282 using the maximum throughput algorithm.
10283
10284 @item -minline-sqrt-min-latency
10285 @opindex minline-sqrt-min-latency
10286 Generate code for inline square roots
10287 using the minimum latency algorithm.
10288
10289 @item -minline-sqrt-max-throughput
10290 @opindex minline-sqrt-max-throughput
10291 Generate code for inline square roots
10292 using the maximum throughput algorithm.
10293
10294 @item -mno-dwarf2-asm
10295 @itemx -mdwarf2-asm
10296 @opindex mno-dwarf2-asm
10297 @opindex mdwarf2-asm
10298 Don't (or do) generate assembler code for the DWARF2 line number debugging
10299 info.  This may be useful when not using the GNU assembler.
10300
10301 @item -mearly-stop-bits
10302 @itemx -mno-early-stop-bits
10303 @opindex mearly-stop-bits
10304 @opindex mno-early-stop-bits
10305 Allow stop bits to be placed earlier than immediately preceding the
10306 instruction that triggered the stop bit.  This can improve instruction
10307 scheduling, but does not always do so.
10308
10309 @item -mfixed-range=@var{register-range}
10310 @opindex mfixed-range
10311 Generate code treating the given register range as fixed registers.
10312 A fixed register is one that the register allocator can not use.  This is
10313 useful when compiling kernel code.  A register range is specified as
10314 two registers separated by a dash.  Multiple register ranges can be
10315 specified separated by a comma.
10316
10317 @item -mtls-size=@var{tls-size}
10318 @opindex mtls-size
10319 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10320 64.
10321
10322 @item -mtune=@var{cpu-type}
10323 @opindex mtune
10324 Tune the instruction scheduling for a particular CPU, Valid values are
10325 itanium, itanium1, merced, itanium2, and mckinley.
10326
10327 @item -mt
10328 @itemx -pthread
10329 @opindex mt
10330 @opindex pthread
10331 Add support for multithreading using the POSIX threads library.  This
10332 option sets flags for both the preprocessor and linker.  It does
10333 not affect the thread safety of object code produced by the compiler or
10334 that of libraries supplied with it.  These are HP-UX specific flags.
10335
10336 @item -milp32
10337 @itemx -mlp64
10338 @opindex milp32
10339 @opindex mlp64
10340 Generate code for a 32-bit or 64-bit environment.
10341 The 32-bit environment sets int, long and pointer to 32 bits.
10342 The 64-bit environment sets int to 32 bits and long and pointer
10343 to 64 bits.  These are HP-UX specific flags.
10344
10345 @item -mno-sched-br-data-spec
10346 @itemx -msched-br-data-spec
10347 @opindex -mno-sched-br-data-spec
10348 @opindex -msched-br-data-spec
10349 (Dis/En)able data speculative scheduling before reload.
10350 This will result in generation of the ld.a instructions and
10351 the corresponding check instructions (ld.c / chk.a).
10352 The default is 'disable'.
10353
10354 @item -msched-ar-data-spec
10355 @itemx -mno-sched-ar-data-spec
10356 @opindex -msched-ar-data-spec
10357 @opindex -mno-sched-ar-data-spec
10358 (En/Dis)able data speculative scheduling after reload.
10359 This will result in generation of the ld.a instructions and
10360 the corresponding check instructions (ld.c / chk.a).
10361 The default is 'enable'.
10362
10363 @item -mno-sched-control-spec
10364 @itemx -msched-control-spec
10365 @opindex -mno-sched-control-spec
10366 @opindex -msched-control-spec
10367 (Dis/En)able control speculative scheduling.  This feature is
10368 available only during region scheduling (i.e. before reload).
10369 This will result in generation of the ld.s instructions and
10370 the corresponding check instructions chk.s .
10371 The default is 'disable'.
10372
10373 @item -msched-br-in-data-spec
10374 @itemx -mno-sched-br-in-data-spec
10375 @opindex -msched-br-in-data-spec
10376 @opindex -mno-sched-br-in-data-spec
10377 (En/Dis)able speculative scheduling of the instructions that
10378 are dependent on the data speculative loads before reload.
10379 This is effective only with @option{-msched-br-data-spec} enabled.
10380 The default is 'enable'.
10381
10382 @item -msched-ar-in-data-spec
10383 @itemx -mno-sched-ar-in-data-spec
10384 @opindex -msched-ar-in-data-spec
10385 @opindex -mno-sched-ar-in-data-spec
10386 (En/Dis)able speculative scheduling of the instructions that
10387 are dependent on the data speculative loads after reload.
10388 This is effective only with @option{-msched-ar-data-spec} enabled.
10389 The default is 'enable'.
10390
10391 @item -msched-in-control-spec
10392 @itemx -mno-sched-in-control-spec
10393 @opindex -msched-in-control-spec
10394 @opindex -mno-sched-in-control-spec
10395 (En/Dis)able speculative scheduling of the instructions that
10396 are dependent on the control speculative loads.
10397 This is effective only with @option{-msched-control-spec} enabled.
10398 The default is 'enable'.
10399
10400 @item -msched-ldc
10401 @itemx -mno-sched-ldc
10402 @opindex -msched-ldc
10403 @opindex -mno-sched-ldc
10404 (En/Dis)able use of simple data speculation checks ld.c .
10405 If disabled, only chk.a instructions will be emitted to check
10406 data speculative loads.
10407 The default is 'enable'.
10408
10409 @item -mno-sched-control-ldc
10410 @itemx -msched-control-ldc
10411 @opindex -mno-sched-control-ldc
10412 @opindex -msched-control-ldc 
10413 (Dis/En)able use of ld.c instructions to check control speculative loads.
10414 If enabled, in case of control speculative load with no speculatively
10415 scheduled dependent instructions this load will be emitted as ld.sa and
10416 ld.c will be used to check it.
10417 The default is 'disable'.
10418
10419 @item -mno-sched-spec-verbose
10420 @itemx -msched-spec-verbose
10421 @opindex -mno-sched-spec-verbose
10422 @opindex -msched-spec-verbose
10423 (Dis/En)able printing of the information about speculative motions.
10424
10425 @item -mno-sched-prefer-non-data-spec-insns
10426 @itemx -msched-prefer-non-data-spec-insns
10427 @opindex -mno-sched-prefer-non-data-spec-insns
10428 @opindex -msched-prefer-non-data-spec-insns
10429 If enabled, data speculative instructions will be chosen for schedule
10430 only if there are no other choices at the moment.  This will make
10431 the use of the data speculation much more conservative.
10432 The default is 'disable'.
10433
10434 @item -mno-sched-prefer-non-control-spec-insns
10435 @itemx -msched-prefer-non-control-spec-insns
10436 @opindex -mno-sched-prefer-non-control-spec-insns
10437 @opindex -msched-prefer-non-control-spec-insns
10438 If enabled, control speculative instructions will be chosen for schedule
10439 only if there are no other choices at the moment.  This will make
10440 the use of the control speculation much more conservative.
10441 The default is 'disable'.
10442
10443 @item -mno-sched-count-spec-in-critical-path
10444 @itemx -msched-count-spec-in-critical-path
10445 @opindex -mno-sched-count-spec-in-critical-path
10446 @opindex -msched-count-spec-in-critical-path
10447 If enabled, speculative dependencies will be considered during
10448 computation of the instructions priorities.  This will make the use of the
10449 speculation a bit more conservative.
10450 The default is 'disable'.
10451
10452 @end table
10453
10454 @node M32C Options
10455 @subsection M32C Options
10456 @cindex M32C options
10457
10458 @table @gcctabopt
10459 @item -mcpu=@var{name}
10460 @opindex mcpu=
10461 Select the CPU for which code is generated.  @var{name} may be one of
10462 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10463 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10464 the M32C/80 series.
10465
10466 @item -msim
10467 @opindex msim
10468 Specifies that the program will be run on the simulator.  This causes
10469 an alternate runtime library to be linked in which supports, for
10470 example, file I/O.  You must not use this option when generating
10471 programs that will run on real hardware; you must provide your own
10472 runtime library for whatever I/O functions are needed.
10473
10474 @item -memregs=@var{number}
10475 @opindex memregs=
10476 Specifies the number of memory-based pseudo-registers GCC will use
10477 during code generation.  These pseudo-registers will be used like real
10478 registers, so there is a tradeoff between GCC's ability to fit the
10479 code into available registers, and the performance penalty of using
10480 memory instead of registers.  Note that all modules in a program must
10481 be compiled with the same value for this option.  Because of that, you
10482 must not use this option with the default runtime libraries gcc
10483 builds.
10484
10485 @end table
10486
10487 @node M32R/D Options
10488 @subsection M32R/D Options
10489 @cindex M32R/D options
10490
10491 These @option{-m} options are defined for Renesas M32R/D architectures:
10492
10493 @table @gcctabopt
10494 @item -m32r2
10495 @opindex m32r2
10496 Generate code for the M32R/2@.
10497
10498 @item -m32rx
10499 @opindex m32rx
10500 Generate code for the M32R/X@.
10501
10502 @item -m32r
10503 @opindex m32r
10504 Generate code for the M32R@.  This is the default.
10505
10506 @item -mmodel=small
10507 @opindex mmodel=small
10508 Assume all objects live in the lower 16MB of memory (so that their addresses
10509 can be loaded with the @code{ld24} instruction), and assume all subroutines
10510 are reachable with the @code{bl} instruction.
10511 This is the default.
10512
10513 The addressability of a particular object can be set with the
10514 @code{model} attribute.
10515
10516 @item -mmodel=medium
10517 @opindex mmodel=medium
10518 Assume objects may be anywhere in the 32-bit address space (the compiler
10519 will generate @code{seth/add3} instructions to load their addresses), and
10520 assume all subroutines are reachable with the @code{bl} instruction.
10521
10522 @item -mmodel=large
10523 @opindex mmodel=large
10524 Assume objects may be anywhere in the 32-bit address space (the compiler
10525 will generate @code{seth/add3} instructions to load their addresses), and
10526 assume subroutines may not be reachable with the @code{bl} instruction
10527 (the compiler will generate the much slower @code{seth/add3/jl}
10528 instruction sequence).
10529
10530 @item -msdata=none
10531 @opindex msdata=none
10532 Disable use of the small data area.  Variables will be put into
10533 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10534 @code{section} attribute has been specified).
10535 This is the default.
10536
10537 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10538 Objects may be explicitly put in the small data area with the
10539 @code{section} attribute using one of these sections.
10540
10541 @item -msdata=sdata
10542 @opindex msdata=sdata
10543 Put small global and static data in the small data area, but do not
10544 generate special code to reference them.
10545
10546 @item -msdata=use
10547 @opindex msdata=use
10548 Put small global and static data in the small data area, and generate
10549 special instructions to reference them.
10550
10551 @item -G @var{num}
10552 @opindex G
10553 @cindex smaller data references
10554 Put global and static objects less than or equal to @var{num} bytes
10555 into the small data or bss sections instead of the normal data or bss
10556 sections.  The default value of @var{num} is 8.
10557 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10558 for this option to have any effect.
10559
10560 All modules should be compiled with the same @option{-G @var{num}} value.
10561 Compiling with different values of @var{num} may or may not work; if it
10562 doesn't the linker will give an error message---incorrect code will not be
10563 generated.
10564
10565 @item -mdebug
10566 @opindex mdebug
10567 Makes the M32R specific code in the compiler display some statistics
10568 that might help in debugging programs.
10569
10570 @item -malign-loops
10571 @opindex malign-loops
10572 Align all loops to a 32-byte boundary.
10573
10574 @item -mno-align-loops
10575 @opindex mno-align-loops
10576 Do not enforce a 32-byte alignment for loops.  This is the default.
10577
10578 @item -missue-rate=@var{number}
10579 @opindex missue-rate=@var{number}
10580 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10581 or 2.
10582
10583 @item -mbranch-cost=@var{number}
10584 @opindex mbranch-cost=@var{number}
10585 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10586 preferred over conditional code, if it is 2, then the opposite will
10587 apply.
10588
10589 @item -mflush-trap=@var{number}
10590 @opindex mflush-trap=@var{number}
10591 Specifies the trap number to use to flush the cache.  The default is
10592 12.  Valid numbers are between 0 and 15 inclusive.
10593
10594 @item -mno-flush-trap
10595 @opindex mno-flush-trap
10596 Specifies that the cache cannot be flushed by using a trap.
10597
10598 @item -mflush-func=@var{name}
10599 @opindex mflush-func=@var{name}
10600 Specifies the name of the operating system function to call to flush
10601 the cache.  The default is @emph{_flush_cache}, but a function call
10602 will only be used if a trap is not available.
10603
10604 @item -mno-flush-func
10605 @opindex mno-flush-func
10606 Indicates that there is no OS function for flushing the cache.
10607
10608 @end table
10609
10610 @node M680x0 Options
10611 @subsection M680x0 Options
10612 @cindex M680x0 options
10613
10614 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
10615 The default settings depend on which architecture was selected when
10616 the compiler was configured; the defaults for the most common choices
10617 are given below.
10618
10619 @table @gcctabopt
10620 @item -march=@var{arch}
10621 @opindex march
10622 Generate code for a specific M680x0 or ColdFire instruction set
10623 architecture.  Permissible values of @var{arch} for M680x0
10624 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
10625 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
10626 architectures are selected according to Freescale's ISA classification
10627 and the permissible values are: @samp{isaa}, @samp{isaaplus},
10628 @samp{isab} and @samp{isac}.
10629
10630 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
10631 code for a ColdFire target.  The @var{arch} in this macro is one of the
10632 @option{-march} arguments given above.
10633
10634 When used together, @option{-march} and @option{-mtune} select code
10635 that runs on a family of similar processors but that is optimized
10636 for a particular microarchitecture.
10637
10638 @item -mcpu=@var{cpu}
10639 @opindex mcpu
10640 Generate code for a specific M680x0 or ColdFire processor.
10641 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
10642 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
10643 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
10644 below, which also classifies the CPUs into families:
10645
10646 @multitable @columnfractions 0.20 0.80
10647 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
10648 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
10649 @item @samp{5206e} @tab @samp{5206e}
10650 @item @samp{5208} @tab @samp{5207} @samp{5208}
10651 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
10652 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
10653 @item @samp{5216} @tab @samp{5214} @samp{5216}
10654 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
10655 @item @samp{5225} @tab @samp{5224} @samp{5225}
10656 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
10657 @item @samp{5249} @tab @samp{5249}
10658 @item @samp{5250} @tab @samp{5250}
10659 @item @samp{5271} @tab @samp{5270} @samp{5271}
10660 @item @samp{5272} @tab @samp{5272}
10661 @item @samp{5275} @tab @samp{5274} @samp{5275}
10662 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
10663 @item @samp{5307} @tab @samp{5307}
10664 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
10665 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
10666 @item @samp{5407} @tab @samp{5407}
10667 @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}
10668 @end multitable
10669
10670 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
10671 @var{arch} is compatible with @var{cpu}.  Other combinations of
10672 @option{-mcpu} and @option{-march} are rejected.
10673
10674 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
10675 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
10676 where the value of @var{family} is given by the table above.
10677
10678 @item -mtune=@var{tune}
10679 @opindex mtune
10680 Tune the code for a particular microarchitecture, within the
10681 constraints set by @option{-march} and @option{-mcpu}.
10682 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
10683 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
10684 and @samp{cpu32}.  The ColdFire microarchitectures
10685 are: @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
10686
10687 You can also use @option{-mtune=68020-40} for code that needs
10688 to run relatively well on 68020, 68030 and 68040 targets.
10689 @option{-mtune=68020-60} is similar but includes 68060 targets
10690 as well.  These two options select the same tuning decisions as
10691 @option{-m68020-40} and @option{-m68020-60} respectively.
10692
10693 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
10694 when tuning for 680x0 architecture @var{arch}.  It also defines
10695 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
10696 option is used.  If gcc is tuning for a range of architectures,
10697 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
10698 it defines the macros for every architecture in the range.
10699
10700 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
10701 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
10702 of the arguments given above.
10703
10704 @item -m68000
10705 @itemx -mc68000
10706 @opindex m68000
10707 @opindex mc68000
10708 Generate output for a 68000.  This is the default
10709 when the compiler is configured for 68000-based systems.
10710 It is equivalent to @option{-march=68000}.
10711
10712 Use this option for microcontrollers with a 68000 or EC000 core,
10713 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10714
10715 @item -m68010
10716 @opindex m68010
10717 Generate output for a 68010.  This is the default
10718 when the compiler is configured for 68010-based systems.
10719 It is equivalent to @option{-march=68010}.
10720
10721 @item -m68020
10722 @itemx -mc68020
10723 @opindex m68020
10724 @opindex mc68020
10725 Generate output for a 68020.  This is the default
10726 when the compiler is configured for 68020-based systems.
10727 It is equivalent to @option{-march=68020}.
10728
10729 @item -m68030
10730 @opindex m68030
10731 Generate output for a 68030.  This is the default when the compiler is
10732 configured for 68030-based systems.  It is equivalent to
10733 @option{-march=68030}.
10734
10735 @item -m68040
10736 @opindex m68040
10737 Generate output for a 68040.  This is the default when the compiler is
10738 configured for 68040-based systems.  It is equivalent to
10739 @option{-march=68040}.
10740
10741 This option inhibits the use of 68881/68882 instructions that have to be
10742 emulated by software on the 68040.  Use this option if your 68040 does not
10743 have code to emulate those instructions.
10744
10745 @item -m68060
10746 @opindex m68060
10747 Generate output for a 68060.  This is the default when the compiler is
10748 configured for 68060-based systems.  It is equivalent to
10749 @option{-march=68060}.
10750
10751 This option inhibits the use of 68020 and 68881/68882 instructions that
10752 have to be emulated by software on the 68060.  Use this option if your 68060
10753 does not have code to emulate those instructions.
10754
10755 @item -mcpu32
10756 @opindex mcpu32
10757 Generate output for a CPU32.  This is the default
10758 when the compiler is configured for CPU32-based systems.
10759 It is equivalent to @option{-march=cpu32}.
10760
10761 Use this option for microcontrollers with a
10762 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
10763 68336, 68340, 68341, 68349 and 68360.
10764
10765 @item -m5200
10766 @opindex m5200
10767 Generate output for a 520X ColdFire CPU.  This is the default
10768 when the compiler is configured for 520X-based systems.
10769 It is equivalent to @option{-mcpu=5206}, and is now deprecated
10770 in favor of that option.
10771
10772 Use this option for microcontroller with a 5200 core, including
10773 the MCF5202, MCF5203, MCF5204 and MCF5206.
10774
10775 @item -m5206e
10776 @opindex m5206e
10777 Generate output for a 5206e ColdFire CPU.  The option is now
10778 deprecated in favor of the equivalent @option{-mcpu=5206e}.
10779
10780 @item -m528x
10781 @opindex m528x
10782 Generate output for a member of the ColdFire 528X family.
10783 The option is now deprecated in favor of the equivalent
10784 @option{-mcpu=528x}.
10785
10786 @item -m5307
10787 @opindex m5307
10788 Generate output for a ColdFire 5307 CPU.  The option is now deprecated
10789 in favor of the equivalent @option{-mcpu=5307}.
10790
10791 @item -m5407
10792 @opindex m5407
10793 Generate output for a ColdFire 5407 CPU.  The option is now deprecated
10794 in favor of the equivalent @option{-mcpu=5407}.
10795
10796 @item -mcfv4e
10797 @opindex mcfv4e
10798 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
10799 This includes use of hardware floating point instructions.
10800 The option is equivalent to @option{-mcpu=547x}, and is now
10801 deprecated in favor of that option.
10802
10803 @item -m68020-40
10804 @opindex m68020-40
10805 Generate output for a 68040, without using any of the new instructions.
10806 This results in code which can run relatively efficiently on either a
10807 68020/68881 or a 68030 or a 68040.  The generated code does use the
10808 68881 instructions that are emulated on the 68040.
10809
10810 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
10811
10812 @item -m68020-60
10813 @opindex m68020-60
10814 Generate output for a 68060, without using any of the new instructions.
10815 This results in code which can run relatively efficiently on either a
10816 68020/68881 or a 68030 or a 68040.  The generated code does use the
10817 68881 instructions that are emulated on the 68060.
10818
10819 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
10820
10821 @item -mhard-float
10822 @itemx -m68881
10823 @opindex mhard-float
10824 @opindex m68881
10825 Generate floating-point instructions.  This is the default for 68020
10826 and above, and for ColdFire devices that have an FPU.  It defines the
10827 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
10828 on ColdFire targets.
10829
10830 @item -msoft-float
10831 @opindex msoft-float
10832 Do not generate floating-point instructions; use library calls instead.
10833 This is the default for 68000, 68010, and 68832 targets.  It is also
10834 the default for ColdFire devices that have no FPU.
10835
10836 @item -mdiv
10837 @itemx -mno-div
10838 @opindex mdiv
10839 @opindex mno-div
10840 Generate (do not generate) ColdFire hardware divide and remainder
10841 instructions.  If @option{-march} is used without @option{-mcpu},
10842 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
10843 architectures.  Otherwise, the default is taken from the target CPU
10844 (either the default CPU, or the one specified by @option{-mcpu}).  For
10845 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
10846 @option{-mcpu=5206e}.
10847
10848 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
10849
10850 @item -mshort
10851 @opindex mshort
10852 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10853 Additionally, parameters passed on the stack are also aligned to a
10854 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10855
10856 @item -mno-short
10857 @opindex -mno-short
10858 Do not consider type @code{int} to be 16 bits wide.  This is the default.
10859
10860 @item -mnobitfield
10861 @itemx -mno-bitfield
10862 @opindex mnobitfield
10863 @opindex mno-bitfield
10864 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10865 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10866
10867 @item -mbitfield
10868 @opindex mbitfield
10869 Do use the bit-field instructions.  The @option{-m68020} option implies
10870 @option{-mbitfield}.  This is the default if you use a configuration
10871 designed for a 68020.
10872
10873 @item -mrtd
10874 @opindex mrtd
10875 Use a different function-calling convention, in which functions
10876 that take a fixed number of arguments return with the @code{rtd}
10877 instruction, which pops their arguments while returning.  This
10878 saves one instruction in the caller since there is no need to pop
10879 the arguments there.
10880
10881 This calling convention is incompatible with the one normally
10882 used on Unix, so you cannot use it if you need to call libraries
10883 compiled with the Unix compiler.
10884
10885 Also, you must provide function prototypes for all functions that
10886 take variable numbers of arguments (including @code{printf});
10887 otherwise incorrect code will be generated for calls to those
10888 functions.
10889
10890 In addition, seriously incorrect code will result if you call a
10891 function with too many arguments.  (Normally, extra arguments are
10892 harmlessly ignored.)
10893
10894 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10895 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10896
10897 @item -mno-rtd
10898 @opindex mno-rtd
10899 Do not use the calling conventions selected by @option{-mrtd}.
10900 This is the default.
10901
10902 @item -malign-int
10903 @itemx -mno-align-int
10904 @opindex malign-int
10905 @opindex mno-align-int
10906 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10907 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10908 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10909 Aligning variables on 32-bit boundaries produces code that runs somewhat
10910 faster on processors with 32-bit busses at the expense of more memory.
10911
10912 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
10913 align structures containing the above types  differently than
10914 most published application binary interface specifications for the m68k.
10915
10916 @item -mpcrel
10917 @opindex mpcrel
10918 Use the pc-relative addressing mode of the 68000 directly, instead of
10919 using a global offset table.  At present, this option implies @option{-fpic},
10920 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
10921 not presently supported with @option{-mpcrel}, though this could be supported for
10922 68020 and higher processors.
10923
10924 @item -mno-strict-align
10925 @itemx -mstrict-align
10926 @opindex mno-strict-align
10927 @opindex mstrict-align
10928 Do not (do) assume that unaligned memory references will be handled by
10929 the system.
10930
10931 @item -msep-data
10932 Generate code that allows the data segment to be located in a different
10933 area of memory from the text segment.  This allows for execute in place in
10934 an environment without virtual memory management.  This option implies
10935 @option{-fPIC}.
10936
10937 @item -mno-sep-data
10938 Generate code that assumes that the data segment follows the text segment.
10939 This is the default.
10940
10941 @item -mid-shared-library
10942 Generate code that supports shared libraries via the library ID method.
10943 This allows for execute in place and shared libraries in an environment
10944 without virtual memory management.  This option implies @option{-fPIC}.
10945
10946 @item -mno-id-shared-library
10947 Generate code that doesn't assume ID based shared libraries are being used.
10948 This is the default.
10949
10950 @item -mshared-library-id=n
10951 Specified the identification number of the ID based shared library being
10952 compiled.  Specifying a value of 0 will generate more compact code, specifying
10953 other values will force the allocation of that number to the current
10954 library but is no more space or time efficient than omitting this option.
10955
10956 @end table
10957
10958 @node M68hc1x Options
10959 @subsection M68hc1x Options
10960 @cindex M68hc1x options
10961
10962 These are the @samp{-m} options defined for the 68hc11 and 68hc12
10963 microcontrollers.  The default values for these options depends on
10964 which style of microcontroller was selected when the compiler was configured;
10965 the defaults for the most common choices are given below.
10966
10967 @table @gcctabopt
10968 @item -m6811
10969 @itemx -m68hc11
10970 @opindex m6811
10971 @opindex m68hc11
10972 Generate output for a 68HC11.  This is the default
10973 when the compiler is configured for 68HC11-based systems.
10974
10975 @item -m6812
10976 @itemx -m68hc12
10977 @opindex m6812
10978 @opindex m68hc12
10979 Generate output for a 68HC12.  This is the default
10980 when the compiler is configured for 68HC12-based systems.
10981
10982 @item -m68S12
10983 @itemx -m68hcs12
10984 @opindex m68S12
10985 @opindex m68hcs12
10986 Generate output for a 68HCS12.
10987
10988 @item -mauto-incdec
10989 @opindex mauto-incdec
10990 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
10991 addressing modes.
10992
10993 @item -minmax
10994 @itemx -nominmax
10995 @opindex minmax
10996 @opindex mnominmax
10997 Enable the use of 68HC12 min and max instructions.
10998
10999 @item -mlong-calls
11000 @itemx -mno-long-calls
11001 @opindex mlong-calls
11002 @opindex mno-long-calls
11003 Treat all calls as being far away (near).  If calls are assumed to be
11004 far away, the compiler will use the @code{call} instruction to
11005 call a function and the @code{rtc} instruction for returning.
11006
11007 @item -mshort
11008 @opindex mshort
11009 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11010
11011 @item -msoft-reg-count=@var{count}
11012 @opindex msoft-reg-count
11013 Specify the number of pseudo-soft registers which are used for the
11014 code generation.  The maximum number is 32.  Using more pseudo-soft
11015 register may or may not result in better code depending on the program.
11016 The default is 4 for 68HC11 and 2 for 68HC12.
11017
11018 @end table
11019
11020 @node MCore Options
11021 @subsection MCore Options
11022 @cindex MCore options
11023
11024 These are the @samp{-m} options defined for the Motorola M*Core
11025 processors.
11026
11027 @table @gcctabopt
11028
11029 @item -mhardlit
11030 @itemx -mno-hardlit
11031 @opindex mhardlit
11032 @opindex mno-hardlit
11033 Inline constants into the code stream if it can be done in two
11034 instructions or less.
11035
11036 @item -mdiv
11037 @itemx -mno-div
11038 @opindex mdiv
11039 @opindex mno-div
11040 Use the divide instruction.  (Enabled by default).
11041
11042 @item -mrelax-immediate
11043 @itemx -mno-relax-immediate
11044 @opindex mrelax-immediate
11045 @opindex mno-relax-immediate
11046 Allow arbitrary sized immediates in bit operations.
11047
11048 @item -mwide-bitfields
11049 @itemx -mno-wide-bitfields
11050 @opindex mwide-bitfields
11051 @opindex mno-wide-bitfields
11052 Always treat bit-fields as int-sized.
11053
11054 @item -m4byte-functions
11055 @itemx -mno-4byte-functions
11056 @opindex m4byte-functions
11057 @opindex mno-4byte-functions
11058 Force all functions to be aligned to a four byte boundary.
11059
11060 @item -mcallgraph-data
11061 @itemx -mno-callgraph-data
11062 @opindex mcallgraph-data
11063 @opindex mno-callgraph-data
11064 Emit callgraph information.
11065
11066 @item -mslow-bytes
11067 @itemx -mno-slow-bytes
11068 @opindex mslow-bytes
11069 @opindex mno-slow-bytes
11070 Prefer word access when reading byte quantities.
11071
11072 @item -mlittle-endian
11073 @itemx -mbig-endian
11074 @opindex mlittle-endian
11075 @opindex mbig-endian
11076 Generate code for a little endian target.
11077
11078 @item -m210
11079 @itemx -m340
11080 @opindex m210
11081 @opindex m340
11082 Generate code for the 210 processor.
11083 @end table
11084
11085 @node MIPS Options
11086 @subsection MIPS Options
11087 @cindex MIPS options
11088
11089 @table @gcctabopt
11090
11091 @item -EB
11092 @opindex EB
11093 Generate big-endian code.
11094
11095 @item -EL
11096 @opindex EL
11097 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
11098 configurations.
11099
11100 @item -march=@var{arch}
11101 @opindex march
11102 Generate code that will run on @var{arch}, which can be the name of a
11103 generic MIPS ISA, or the name of a particular processor.
11104 The ISA names are:
11105 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
11106 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
11107 The processor names are:
11108 @samp{4kc}, @samp{4km}, @samp{4kp},
11109 @samp{4kec}, @samp{4kem}, @samp{4kep},
11110 @samp{5kc}, @samp{5kf},
11111 @samp{20kc},
11112 @samp{24kc}, @samp{24kf}, @samp{24kx},
11113 @samp{24kec}, @samp{24kef}, @samp{24kex},
11114 @samp{34kc}, @samp{34kf}, @samp{34kx},
11115 @samp{m4k},
11116 @samp{orion},
11117 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
11118 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
11119 @samp{rm7000}, @samp{rm9000},
11120 @samp{sb1},
11121 @samp{sr71000},
11122 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
11123 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
11124 The special value @samp{from-abi} selects the
11125 most compatible architecture for the selected ABI (that is,
11126 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
11127
11128 In processor names, a final @samp{000} can be abbreviated as @samp{k}
11129 (for example, @samp{-march=r2k}).  Prefixes are optional, and
11130 @samp{vr} may be written @samp{r}.
11131
11132 GCC defines two macros based on the value of this option.  The first
11133 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
11134 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
11135 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
11136 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
11137 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
11138
11139 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
11140 above.  In other words, it will have the full prefix and will not
11141 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
11142 the macro names the resolved architecture (either @samp{"mips1"} or
11143 @samp{"mips3"}).  It names the default architecture when no
11144 @option{-march} option is given.
11145
11146 @item -mtune=@var{arch}
11147 @opindex mtune
11148 Optimize for @var{arch}.  Among other things, this option controls
11149 the way instructions are scheduled, and the perceived cost of arithmetic
11150 operations.  The list of @var{arch} values is the same as for
11151 @option{-march}.
11152
11153 When this option is not used, GCC will optimize for the processor
11154 specified by @option{-march}.  By using @option{-march} and
11155 @option{-mtune} together, it is possible to generate code that will
11156 run on a family of processors, but optimize the code for one
11157 particular member of that family.
11158
11159 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
11160 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
11161 @samp{-march} ones described above.
11162
11163 @item -mips1
11164 @opindex mips1
11165 Equivalent to @samp{-march=mips1}.
11166
11167 @item -mips2
11168 @opindex mips2
11169 Equivalent to @samp{-march=mips2}.
11170
11171 @item -mips3
11172 @opindex mips3
11173 Equivalent to @samp{-march=mips3}.
11174
11175 @item -mips4
11176 @opindex mips4
11177 Equivalent to @samp{-march=mips4}.
11178
11179 @item -mips32
11180 @opindex mips32
11181 Equivalent to @samp{-march=mips32}.
11182
11183 @item -mips32r2
11184 @opindex mips32r2
11185 Equivalent to @samp{-march=mips32r2}.
11186
11187 @item -mips64
11188 @opindex mips64
11189 Equivalent to @samp{-march=mips64}.
11190
11191 @item -mips16
11192 @itemx -mno-mips16
11193 @opindex mips16
11194 @opindex mno-mips16
11195 Generate (do not generate) MIPS16 code.  If GCC is targetting a
11196 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
11197
11198 @item -mabi=32
11199 @itemx -mabi=o64
11200 @itemx -mabi=n32
11201 @itemx -mabi=64
11202 @itemx -mabi=eabi
11203 @opindex mabi=32
11204 @opindex mabi=o64
11205 @opindex mabi=n32
11206 @opindex mabi=64
11207 @opindex mabi=eabi
11208 Generate code for the given ABI@.
11209
11210 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
11211 generates 64-bit code when you select a 64-bit architecture, but you
11212 can use @option{-mgp32} to get 32-bit code instead.
11213
11214 For information about the O64 ABI, see
11215 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
11216
11217 GCC supports a variant of the o32 ABI in which floating-point registers
11218 are 64 rather than 32 bits wide.  You can select this combination with
11219 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
11220 and @samp{mfhc1} instructions and is therefore only supported for
11221 MIPS32R2 processors.
11222
11223 The register assignments for arguments and return values remain the
11224 same, but each scalar value is passed in a single 64-bit register
11225 rather than a pair of 32-bit registers.  For example, scalar
11226 floating-point values are returned in @samp{$f0} only, not a
11227 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
11228 remains the same, but all 64 bits are saved.
11229
11230 @item -mabicalls
11231 @itemx -mno-abicalls
11232 @opindex mabicalls
11233 @opindex mno-abicalls
11234 Generate (do not generate) code that is suitable for SVR4-style
11235 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
11236 systems.
11237
11238 @item -mshared
11239 @itemx -mno-shared
11240 Generate (do not generate) code that is fully position-independent,
11241 and that can therefore be linked into shared libraries.  This option
11242 only affects @option{-mabicalls}.
11243
11244 All @option{-mabicalls} code has traditionally been position-independent,
11245 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
11246 as an extension, the GNU toolchain allows executables to use absolute
11247 accesses for locally-binding symbols.  It can also use shorter GP
11248 initialization sequences and generate direct calls to locally-defined
11249 functions.  This mode is selected by @option{-mno-shared}.
11250
11251 @option{-mno-shared} depends on binutils 2.16 or higher and generates
11252 objects that can only be linked by the GNU linker.  However, the option
11253 does not affect the ABI of the final executable; it only affects the ABI
11254 of relocatable objects.  Using @option{-mno-shared} will generally make
11255 executables both smaller and quicker.
11256
11257 @option{-mshared} is the default.
11258
11259 @item -mxgot
11260 @itemx -mno-xgot
11261 @opindex mxgot
11262 @opindex mno-xgot
11263 Lift (do not lift) the usual restrictions on the size of the global
11264 offset table.
11265
11266 GCC normally uses a single instruction to load values from the GOT@.
11267 While this is relatively efficient, it will only work if the GOT
11268 is smaller than about 64k.  Anything larger will cause the linker
11269 to report an error such as:
11270
11271 @cindex relocation truncated to fit (MIPS)
11272 @smallexample
11273 relocation truncated to fit: R_MIPS_GOT16 foobar
11274 @end smallexample
11275
11276 If this happens, you should recompile your code with @option{-mxgot}.
11277 It should then work with very large GOTs, although it will also be
11278 less efficient, since it will take three instructions to fetch the
11279 value of a global symbol.
11280
11281 Note that some linkers can create multiple GOTs.  If you have such a
11282 linker, you should only need to use @option{-mxgot} when a single object
11283 file accesses more than 64k's worth of GOT entries.  Very few do.
11284
11285 These options have no effect unless GCC is generating position
11286 independent code.
11287
11288 @item -mgp32
11289 @opindex mgp32
11290 Assume that general-purpose registers are 32 bits wide.
11291
11292 @item -mgp64
11293 @opindex mgp64
11294 Assume that general-purpose registers are 64 bits wide.
11295
11296 @item -mfp32
11297 @opindex mfp32
11298 Assume that floating-point registers are 32 bits wide.
11299
11300 @item -mfp64
11301 @opindex mfp64
11302 Assume that floating-point registers are 64 bits wide.
11303
11304 @item -mhard-float
11305 @opindex mhard-float
11306 Use floating-point coprocessor instructions.
11307
11308 @item -msoft-float
11309 @opindex msoft-float
11310 Do not use floating-point coprocessor instructions.  Implement
11311 floating-point calculations using library calls instead.
11312
11313 @item -msingle-float
11314 @opindex msingle-float
11315 Assume that the floating-point coprocessor only supports single-precision
11316 operations.
11317
11318 @itemx -mdouble-float
11319 @opindex mdouble-float
11320 Assume that the floating-point coprocessor supports double-precision
11321 operations.  This is the default.
11322
11323 @itemx -mdsp
11324 @itemx -mno-dsp
11325 @opindex mdsp
11326 @opindex mno-dsp
11327 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
11328
11329 @itemx -mdspr2
11330 @itemx -mno-dspr2
11331 @opindex mdspr2
11332 @opindex mno-dspr2
11333 Use (do not use) the MIPS DSP ASE REV 2.  @xref{MIPS DSP Built-in Functions}.
11334 The option @option{-mdspr2} implies @option{-mdsp}.
11335
11336 @itemx -mpaired-single
11337 @itemx -mno-paired-single
11338 @opindex mpaired-single
11339 @opindex mno-paired-single
11340 Use (do not use) paired-single floating-point instructions.
11341 @xref{MIPS Paired-Single Support}.  This option can only be used
11342 when generating 64-bit code and requires hardware floating-point
11343 support to be enabled.
11344
11345 @itemx -mips3d
11346 @itemx -mno-mips3d
11347 @opindex mips3d
11348 @opindex mno-mips3d
11349 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
11350 The option @option{-mips3d} implies @option{-mpaired-single}.
11351
11352 @item -mlong64
11353 @opindex mlong64
11354 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
11355 an explanation of the default and the way that the pointer size is
11356 determined.
11357
11358 @item -mlong32
11359 @opindex mlong32
11360 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
11361
11362 The default size of @code{int}s, @code{long}s and pointers depends on
11363 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
11364 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
11365 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
11366 or the same size as integer registers, whichever is smaller.
11367
11368 @item -msym32
11369 @itemx -mno-sym32
11370 @opindex msym32
11371 @opindex mno-sym32
11372 Assume (do not assume) that all symbols have 32-bit values, regardless
11373 of the selected ABI@.  This option is useful in combination with
11374 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11375 to generate shorter and faster references to symbolic addresses.
11376
11377 @item -G @var{num}
11378 @opindex G
11379 @cindex smaller data references (MIPS)
11380 @cindex gp-relative references (MIPS)
11381 Put global and static items less than or equal to @var{num} bytes into
11382 the small data or bss section instead of the normal data or bss section.
11383 This allows the data to be accessed using a single instruction.
11384
11385 All modules should be compiled with the same @option{-G @var{num}}
11386 value.
11387
11388 @item -membedded-data
11389 @itemx -mno-embedded-data
11390 @opindex membedded-data
11391 @opindex mno-embedded-data
11392 Allocate variables to the read-only data section first if possible, then
11393 next in the small data section if possible, otherwise in data.  This gives
11394 slightly slower code than the default, but reduces the amount of RAM required
11395 when executing, and thus may be preferred for some embedded systems.
11396
11397 @item -muninit-const-in-rodata
11398 @itemx -mno-uninit-const-in-rodata
11399 @opindex muninit-const-in-rodata
11400 @opindex mno-uninit-const-in-rodata
11401 Put uninitialized @code{const} variables in the read-only data section.
11402 This option is only meaningful in conjunction with @option{-membedded-data}.
11403
11404 @item -msplit-addresses
11405 @itemx -mno-split-addresses
11406 @opindex msplit-addresses
11407 @opindex mno-split-addresses
11408 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
11409 relocation operators.  This option has been superseded by
11410 @option{-mexplicit-relocs} but is retained for backwards compatibility.
11411
11412 @item -mexplicit-relocs
11413 @itemx -mno-explicit-relocs
11414 @opindex mexplicit-relocs
11415 @opindex mno-explicit-relocs
11416 Use (do not use) assembler relocation operators when dealing with symbolic
11417 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
11418 is to use assembler macros instead.
11419
11420 @option{-mexplicit-relocs} is the default if GCC was configured
11421 to use an assembler that supports relocation operators.
11422
11423 @item -mcheck-zero-division
11424 @itemx -mno-check-zero-division
11425 @opindex mcheck-zero-division
11426 @opindex mno-check-zero-division
11427 Trap (do not trap) on integer division by zero.
11428
11429 The default is @option{-mcheck-zero-division}.
11430
11431 @item -mdivide-traps
11432 @itemx -mdivide-breaks
11433 @opindex mdivide-traps
11434 @opindex mdivide-breaks
11435 MIPS systems check for division by zero by generating either a
11436 conditional trap or a break instruction.  Using traps results in
11437 smaller code, but is only supported on MIPS II and later.  Also, some
11438 versions of the Linux kernel have a bug that prevents trap from
11439 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
11440 allow conditional traps on architectures that support them and
11441 @option{-mdivide-breaks} to force the use of breaks.
11442
11443 The default is usually @option{-mdivide-traps}, but this can be
11444 overridden at configure time using @option{--with-divide=breaks}.
11445 Divide-by-zero checks can be completely disabled using
11446 @option{-mno-check-zero-division}.
11447
11448 @item -mmemcpy
11449 @itemx -mno-memcpy
11450 @opindex mmemcpy
11451 @opindex mno-memcpy
11452 Force (do not force) the use of @code{memcpy()} for non-trivial block
11453 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
11454 most constant-sized copies.
11455
11456 @item -mlong-calls
11457 @itemx -mno-long-calls
11458 @opindex mlong-calls
11459 @opindex mno-long-calls
11460 Disable (do not disable) use of the @code{jal} instruction.  Calling
11461 functions using @code{jal} is more efficient but requires the caller
11462 and callee to be in the same 256 megabyte segment.
11463
11464 This option has no effect on abicalls code.  The default is
11465 @option{-mno-long-calls}.
11466
11467 @item -mmad
11468 @itemx -mno-mad
11469 @opindex mmad
11470 @opindex mno-mad
11471 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
11472 instructions, as provided by the R4650 ISA@.
11473
11474 @item -mfused-madd
11475 @itemx -mno-fused-madd
11476 @opindex mfused-madd
11477 @opindex mno-fused-madd
11478 Enable (disable) use of the floating point multiply-accumulate
11479 instructions, when they are available.  The default is
11480 @option{-mfused-madd}.
11481
11482 When multiply-accumulate instructions are used, the intermediate
11483 product is calculated to infinite precision and is not subject to
11484 the FCSR Flush to Zero bit.  This may be undesirable in some
11485 circumstances.
11486
11487 @item -nocpp
11488 @opindex nocpp
11489 Tell the MIPS assembler to not run its preprocessor over user
11490 assembler files (with a @samp{.s} suffix) when assembling them.
11491
11492 @item -mfix-r4000
11493 @itemx -mno-fix-r4000
11494 @opindex mfix-r4000
11495 @opindex mno-fix-r4000
11496 Work around certain R4000 CPU errata:
11497 @itemize @minus
11498 @item
11499 A double-word or a variable shift may give an incorrect result if executed
11500 immediately after starting an integer division.
11501 @item
11502 A double-word or a variable shift may give an incorrect result if executed
11503 while an integer multiplication is in progress.
11504 @item
11505 An integer division may give an incorrect result if started in a delay slot
11506 of a taken branch or a jump.
11507 @end itemize
11508
11509 @item -mfix-r4400
11510 @itemx -mno-fix-r4400
11511 @opindex mfix-r4400
11512 @opindex mno-fix-r4400
11513 Work around certain R4400 CPU errata:
11514 @itemize @minus
11515 @item
11516 A double-word or a variable shift may give an incorrect result if executed
11517 immediately after starting an integer division.
11518 @end itemize
11519
11520 @item -mfix-vr4120
11521 @itemx -mno-fix-vr4120
11522 @opindex mfix-vr4120
11523 Work around certain VR4120 errata:
11524 @itemize @minus
11525 @item
11526 @code{dmultu} does not always produce the correct result.
11527 @item
11528 @code{div} and @code{ddiv} do not always produce the correct result if one
11529 of the operands is negative.
11530 @end itemize
11531 The workarounds for the division errata rely on special functions in
11532 @file{libgcc.a}.  At present, these functions are only provided by
11533 the @code{mips64vr*-elf} configurations.
11534
11535 Other VR4120 errata require a nop to be inserted between certain pairs of
11536 instructions.  These errata are handled by the assembler, not by GCC itself.
11537
11538 @item -mfix-vr4130
11539 @opindex mfix-vr4130
11540 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11541 workarounds are implemented by the assembler rather than by GCC,
11542 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11543 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11544 instructions are available instead.
11545
11546 @item -mfix-sb1
11547 @itemx -mno-fix-sb1
11548 @opindex mfix-sb1
11549 Work around certain SB-1 CPU core errata.
11550 (This flag currently works around the SB-1 revision 2
11551 ``F1'' and ``F2'' floating point errata.)
11552
11553 @item -mflush-func=@var{func}
11554 @itemx -mno-flush-func
11555 @opindex mflush-func
11556 Specifies the function to call to flush the I and D caches, or to not
11557 call any such function.  If called, the function must take the same
11558 arguments as the common @code{_flush_func()}, that is, the address of the
11559 memory range for which the cache is being flushed, the size of the
11560 memory range, and the number 3 (to flush both caches).  The default
11561 depends on the target GCC was configured for, but commonly is either
11562 @samp{_flush_func} or @samp{__cpu_flush}.
11563
11564 @item -mbranch-likely
11565 @itemx -mno-branch-likely
11566 @opindex mbranch-likely
11567 @opindex mno-branch-likely
11568 Enable or disable use of Branch Likely instructions, regardless of the
11569 default for the selected architecture.  By default, Branch Likely
11570 instructions may be generated if they are supported by the selected
11571 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11572 and processors which implement those architectures; for those, Branch
11573 Likely instructions will not be generated by default because the MIPS32
11574 and MIPS64 architectures specifically deprecate their use.
11575
11576 @item -mfp-exceptions
11577 @itemx -mno-fp-exceptions
11578 @opindex mfp-exceptions
11579 Specifies whether FP exceptions are enabled.  This affects how we schedule
11580 FP instructions for some processors.  The default is that FP exceptions are
11581 enabled.
11582
11583 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11584 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11585 FP pipe.
11586
11587 @item -mvr4130-align
11588 @itemx -mno-vr4130-align
11589 @opindex mvr4130-align
11590 The VR4130 pipeline is two-way superscalar, but can only issue two
11591 instructions together if the first one is 8-byte aligned.  When this
11592 option is enabled, GCC will align pairs of instructions that it
11593 thinks should execute in parallel.
11594
11595 This option only has an effect when optimizing for the VR4130.
11596 It normally makes code faster, but at the expense of making it bigger.
11597 It is enabled by default at optimization level @option{-O3}.
11598 @end table
11599
11600 @node MMIX Options
11601 @subsection MMIX Options
11602 @cindex MMIX Options
11603
11604 These options are defined for the MMIX:
11605
11606 @table @gcctabopt
11607 @item -mlibfuncs
11608 @itemx -mno-libfuncs
11609 @opindex mlibfuncs
11610 @opindex mno-libfuncs
11611 Specify that intrinsic library functions are being compiled, passing all
11612 values in registers, no matter the size.
11613
11614 @item -mepsilon
11615 @itemx -mno-epsilon
11616 @opindex mepsilon
11617 @opindex mno-epsilon
11618 Generate floating-point comparison instructions that compare with respect
11619 to the @code{rE} epsilon register.
11620
11621 @item -mabi=mmixware
11622 @itemx -mabi=gnu
11623 @opindex mabi-mmixware
11624 @opindex mabi=gnu
11625 Generate code that passes function parameters and return values that (in
11626 the called function) are seen as registers @code{$0} and up, as opposed to
11627 the GNU ABI which uses global registers @code{$231} and up.
11628
11629 @item -mzero-extend
11630 @itemx -mno-zero-extend
11631 @opindex mzero-extend
11632 @opindex mno-zero-extend
11633 When reading data from memory in sizes shorter than 64 bits, use (do not
11634 use) zero-extending load instructions by default, rather than
11635 sign-extending ones.
11636
11637 @item -mknuthdiv
11638 @itemx -mno-knuthdiv
11639 @opindex mknuthdiv
11640 @opindex mno-knuthdiv
11641 Make the result of a division yielding a remainder have the same sign as
11642 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11643 remainder follows the sign of the dividend.  Both methods are
11644 arithmetically valid, the latter being almost exclusively used.
11645
11646 @item -mtoplevel-symbols
11647 @itemx -mno-toplevel-symbols
11648 @opindex mtoplevel-symbols
11649 @opindex mno-toplevel-symbols
11650 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11651 code can be used with the @code{PREFIX} assembly directive.
11652
11653 @item -melf
11654 @opindex melf
11655 Generate an executable in the ELF format, rather than the default
11656 @samp{mmo} format used by the @command{mmix} simulator.
11657
11658 @item -mbranch-predict
11659 @itemx -mno-branch-predict
11660 @opindex mbranch-predict
11661 @opindex mno-branch-predict
11662 Use (do not use) the probable-branch instructions, when static branch
11663 prediction indicates a probable branch.
11664
11665 @item -mbase-addresses
11666 @itemx -mno-base-addresses
11667 @opindex mbase-addresses
11668 @opindex mno-base-addresses
11669 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11670 base address automatically generates a request (handled by the assembler
11671 and the linker) for a constant to be set up in a global register.  The
11672 register is used for one or more base address requests within the range 0
11673 to 255 from the value held in the register.  The generally leads to short
11674 and fast code, but the number of different data items that can be
11675 addressed is limited.  This means that a program that uses lots of static
11676 data may require @option{-mno-base-addresses}.
11677
11678 @item -msingle-exit
11679 @itemx -mno-single-exit
11680 @opindex msingle-exit
11681 @opindex mno-single-exit
11682 Force (do not force) generated code to have a single exit point in each
11683 function.
11684 @end table
11685
11686 @node MN10300 Options
11687 @subsection MN10300 Options
11688 @cindex MN10300 options
11689
11690 These @option{-m} options are defined for Matsushita MN10300 architectures:
11691
11692 @table @gcctabopt
11693 @item -mmult-bug
11694 @opindex mmult-bug
11695 Generate code to avoid bugs in the multiply instructions for the MN10300
11696 processors.  This is the default.
11697
11698 @item -mno-mult-bug
11699 @opindex mno-mult-bug
11700 Do not generate code to avoid bugs in the multiply instructions for the
11701 MN10300 processors.
11702
11703 @item -mam33
11704 @opindex mam33
11705 Generate code which uses features specific to the AM33 processor.
11706
11707 @item -mno-am33
11708 @opindex mno-am33
11709 Do not generate code which uses features specific to the AM33 processor.  This
11710 is the default.
11711
11712 @item -mreturn-pointer-on-d0
11713 @opindex mreturn-pointer-on-d0
11714 When generating a function which returns a pointer, return the pointer
11715 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11716 only in a0, and attempts to call such functions without a prototype
11717 would result in errors.  Note that this option is on by default; use
11718 @option{-mno-return-pointer-on-d0} to disable it.
11719
11720 @item -mno-crt0
11721 @opindex mno-crt0
11722 Do not link in the C run-time initialization object file.
11723
11724 @item -mrelax
11725 @opindex mrelax
11726 Indicate to the linker that it should perform a relaxation optimization pass
11727 to shorten branches, calls and absolute memory addresses.  This option only
11728 has an effect when used on the command line for the final link step.
11729
11730 This option makes symbolic debugging impossible.
11731 @end table
11732
11733 @node MT Options
11734 @subsection MT Options
11735 @cindex MT options
11736
11737 These @option{-m} options are defined for Morpho MT architectures:
11738
11739 @table @gcctabopt
11740
11741 @item -march=@var{cpu-type}
11742 @opindex march
11743 Generate code that will run on @var{cpu-type}, which is the name of a system
11744 representing a certain processor type.  Possible values for
11745 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
11746 @samp{ms1-16-003} and @samp{ms2}.
11747
11748 When this option is not used, the default is @option{-march=ms1-16-002}.
11749
11750 @item -mbacc
11751 @opindex mbacc
11752 Use byte loads and stores when generating code.
11753
11754 @item -mno-bacc
11755 @opindex mno-bacc
11756 Do not use byte loads and stores when generating code.
11757
11758 @item -msim
11759 @opindex msim
11760 Use simulator runtime
11761
11762 @item -mno-crt0
11763 @opindex mno-crt0
11764 Do not link in the C run-time initialization object file
11765 @file{crti.o}.  Other run-time initialization and termination files
11766 such as @file{startup.o} and @file{exit.o} are still included on the
11767 linker command line.
11768
11769 @end table
11770
11771 @node PDP-11 Options
11772 @subsection PDP-11 Options
11773 @cindex PDP-11 Options
11774
11775 These options are defined for the PDP-11:
11776
11777 @table @gcctabopt
11778 @item -mfpu
11779 @opindex mfpu
11780 Use hardware FPP floating point.  This is the default.  (FIS floating
11781 point on the PDP-11/40 is not supported.)
11782
11783 @item -msoft-float
11784 @opindex msoft-float
11785 Do not use hardware floating point.
11786
11787 @item -mac0
11788 @opindex mac0
11789 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
11790
11791 @item -mno-ac0
11792 @opindex mno-ac0
11793 Return floating-point results in memory.  This is the default.
11794
11795 @item -m40
11796 @opindex m40
11797 Generate code for a PDP-11/40.
11798
11799 @item -m45
11800 @opindex m45
11801 Generate code for a PDP-11/45.  This is the default.
11802
11803 @item -m10
11804 @opindex m10
11805 Generate code for a PDP-11/10.
11806
11807 @item -mbcopy-builtin
11808 @opindex bcopy-builtin
11809 Use inline @code{movmemhi} patterns for copying memory.  This is the
11810 default.
11811
11812 @item -mbcopy
11813 @opindex mbcopy
11814 Do not use inline @code{movmemhi} patterns for copying memory.
11815
11816 @item -mint16
11817 @itemx -mno-int32
11818 @opindex mint16
11819 @opindex mno-int32
11820 Use 16-bit @code{int}.  This is the default.
11821
11822 @item -mint32
11823 @itemx -mno-int16
11824 @opindex mint32
11825 @opindex mno-int16
11826 Use 32-bit @code{int}.
11827
11828 @item -mfloat64
11829 @itemx -mno-float32
11830 @opindex mfloat64
11831 @opindex mno-float32
11832 Use 64-bit @code{float}.  This is the default.
11833
11834 @item -mfloat32
11835 @itemx -mno-float64
11836 @opindex mfloat32
11837 @opindex mno-float64
11838 Use 32-bit @code{float}.
11839
11840 @item -mabshi
11841 @opindex mabshi
11842 Use @code{abshi2} pattern.  This is the default.
11843
11844 @item -mno-abshi
11845 @opindex mno-abshi
11846 Do not use @code{abshi2} pattern.
11847
11848 @item -mbranch-expensive
11849 @opindex mbranch-expensive
11850 Pretend that branches are expensive.  This is for experimenting with
11851 code generation only.
11852
11853 @item -mbranch-cheap
11854 @opindex mbranch-cheap
11855 Do not pretend that branches are expensive.  This is the default.
11856
11857 @item -msplit
11858 @opindex msplit
11859 Generate code for a system with split I&D@.
11860
11861 @item -mno-split
11862 @opindex mno-split
11863 Generate code for a system without split I&D@.  This is the default.
11864
11865 @item -munix-asm
11866 @opindex munix-asm
11867 Use Unix assembler syntax.  This is the default when configured for
11868 @samp{pdp11-*-bsd}.
11869
11870 @item -mdec-asm
11871 @opindex mdec-asm
11872 Use DEC assembler syntax.  This is the default when configured for any
11873 PDP-11 target other than @samp{pdp11-*-bsd}.
11874 @end table
11875
11876 @node PowerPC Options
11877 @subsection PowerPC Options
11878 @cindex PowerPC options
11879
11880 These are listed under @xref{RS/6000 and PowerPC Options}.
11881
11882 @node RS/6000 and PowerPC Options
11883 @subsection IBM RS/6000 and PowerPC Options
11884 @cindex RS/6000 and PowerPC Options
11885 @cindex IBM RS/6000 and PowerPC Options
11886
11887 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11888 @table @gcctabopt
11889 @item -mpower
11890 @itemx -mno-power
11891 @itemx -mpower2
11892 @itemx -mno-power2
11893 @itemx -mpowerpc
11894 @itemx -mno-powerpc
11895 @itemx -mpowerpc-gpopt
11896 @itemx -mno-powerpc-gpopt
11897 @itemx -mpowerpc-gfxopt
11898 @itemx -mno-powerpc-gfxopt
11899 @itemx -mpowerpc64
11900 @itemx -mno-powerpc64
11901 @itemx -mmfcrf
11902 @itemx -mno-mfcrf
11903 @itemx -mpopcntb
11904 @itemx -mno-popcntb
11905 @itemx -mfprnd
11906 @itemx -mno-fprnd
11907 @itemx -mcmpb
11908 @itemx -mno-cmpb
11909 @itemx -mmfpgpr
11910 @itemx -mno-mfpgpr
11911 @itemx -mdfp
11912 @itemx -mno-dfp
11913 @opindex mpower
11914 @opindex mno-power
11915 @opindex mpower2
11916 @opindex mno-power2
11917 @opindex mpowerpc
11918 @opindex mno-powerpc
11919 @opindex mpowerpc-gpopt
11920 @opindex mno-powerpc-gpopt
11921 @opindex mpowerpc-gfxopt
11922 @opindex mno-powerpc-gfxopt
11923 @opindex mpowerpc64
11924 @opindex mno-powerpc64
11925 @opindex mmfcrf
11926 @opindex mno-mfcrf
11927 @opindex mpopcntb
11928 @opindex mno-popcntb
11929 @opindex mfprnd
11930 @opindex mno-fprnd
11931 @opindex mcmpb
11932 @opindex mno-cmpb
11933 @opindex mmfpgpr
11934 @opindex mno-mfpgpr
11935 @opindex mdfp
11936 @opindex mno-dfp
11937 GCC supports two related instruction set architectures for the
11938 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
11939 instructions supported by the @samp{rios} chip set used in the original
11940 RS/6000 systems and the @dfn{PowerPC} instruction set is the
11941 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
11942 the IBM 4xx, 6xx, and follow-on microprocessors.
11943
11944 Neither architecture is a subset of the other.  However there is a
11945 large common subset of instructions supported by both.  An MQ
11946 register is included in processors supporting the POWER architecture.
11947
11948 You use these options to specify which instructions are available on the
11949 processor you are using.  The default value of these options is
11950 determined when configuring GCC@.  Specifying the
11951 @option{-mcpu=@var{cpu_type}} overrides the specification of these
11952 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
11953 rather than the options listed above.
11954
11955 The @option{-mpower} option allows GCC to generate instructions that
11956 are found only in the POWER architecture and to use the MQ register.
11957 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
11958 to generate instructions that are present in the POWER2 architecture but
11959 not the original POWER architecture.
11960
11961 The @option{-mpowerpc} option allows GCC to generate instructions that
11962 are found only in the 32-bit subset of the PowerPC architecture.
11963 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
11964 GCC to use the optional PowerPC architecture instructions in the
11965 General Purpose group, including floating-point square root.  Specifying
11966 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
11967 use the optional PowerPC architecture instructions in the Graphics
11968 group, including floating-point select.
11969
11970 The @option{-mmfcrf} option allows GCC to generate the move from
11971 condition register field instruction implemented on the POWER4
11972 processor and other processors that support the PowerPC V2.01
11973 architecture.
11974 The @option{-mpopcntb} option allows GCC to generate the popcount and
11975 double precision FP reciprocal estimate instruction implemented on the
11976 POWER5 processor and other processors that support the PowerPC V2.02
11977 architecture.
11978 The @option{-mfprnd} option allows GCC to generate the FP round to
11979 integer instructions implemented on the POWER5+ processor and other
11980 processors that support the PowerPC V2.03 architecture.
11981 The @option{-mcmpb} option allows GCC to generate the compare bytes
11982 instruction implemented on the POWER6 processor and other processors
11983 that support the PowerPC V2.05 architecture.
11984 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
11985 general purpose register instructions implemented on the POWER6X
11986 processor and other processors that support the extended PowerPC V2.05
11987 architecture.
11988 The @option{-mdfp} option allows GCC to generate the decimal floating
11989 point instructions implemented on some POWER processors.
11990
11991 The @option{-mpowerpc64} option allows GCC to generate the additional
11992 64-bit instructions that are found in the full PowerPC64 architecture
11993 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
11994 @option{-mno-powerpc64}.
11995
11996 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
11997 will use only the instructions in the common subset of both
11998 architectures plus some special AIX common-mode calls, and will not use
11999 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
12000 permits GCC to use any instruction from either architecture and to
12001 allow use of the MQ register; specify this for the Motorola MPC601.
12002
12003 @item -mnew-mnemonics
12004 @itemx -mold-mnemonics
12005 @opindex mnew-mnemonics
12006 @opindex mold-mnemonics
12007 Select which mnemonics to use in the generated assembler code.  With
12008 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
12009 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
12010 assembler mnemonics defined for the POWER architecture.  Instructions
12011 defined in only one architecture have only one mnemonic; GCC uses that
12012 mnemonic irrespective of which of these options is specified.
12013
12014 GCC defaults to the mnemonics appropriate for the architecture in
12015 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
12016 value of these option.  Unless you are building a cross-compiler, you
12017 should normally not specify either @option{-mnew-mnemonics} or
12018 @option{-mold-mnemonics}, but should instead accept the default.
12019
12020 @item -mcpu=@var{cpu_type}
12021 @opindex mcpu
12022 Set architecture type, register usage, choice of mnemonics, and
12023 instruction scheduling parameters for machine type @var{cpu_type}.
12024 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
12025 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
12026 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
12027 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
12028 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
12029 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
12030 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
12031 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
12032 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
12033 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
12034
12035 @option{-mcpu=common} selects a completely generic processor.  Code
12036 generated under this option will run on any POWER or PowerPC processor.
12037 GCC will use only the instructions in the common subset of both
12038 architectures, and will not use the MQ register.  GCC assumes a generic
12039 processor model for scheduling purposes.
12040
12041 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
12042 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
12043 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
12044 types, with an appropriate, generic processor model assumed for
12045 scheduling purposes.
12046
12047 The other options specify a specific processor.  Code generated under
12048 those options will run best on that processor, and may not run at all on
12049 others.
12050
12051 The @option{-mcpu} options automatically enable or disable the
12052 following options:
12053
12054 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
12055 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
12056 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
12057
12058 The particular options set for any particular CPU will vary between
12059 compiler versions, depending on what setting seems to produce optimal
12060 code for that CPU; it doesn't necessarily reflect the actual hardware's
12061 capabilities.  If you wish to set an individual option to a particular
12062 value, you may specify it after the @option{-mcpu} option, like
12063 @samp{-mcpu=970 -mno-altivec}.
12064
12065 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
12066 not enabled or disabled by the @option{-mcpu} option at present because
12067 AIX does not have full support for these options.  You may still
12068 enable or disable them individually if you're sure it'll work in your
12069 environment.
12070
12071 @item -mtune=@var{cpu_type}
12072 @opindex mtune
12073 Set the instruction scheduling parameters for machine type
12074 @var{cpu_type}, but do not set the architecture type, register usage, or
12075 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
12076 values for @var{cpu_type} are used for @option{-mtune} as for
12077 @option{-mcpu}.  If both are specified, the code generated will use the
12078 architecture, registers, and mnemonics set by @option{-mcpu}, but the
12079 scheduling parameters set by @option{-mtune}.
12080
12081 @item -mswdiv
12082 @itemx -mno-swdiv
12083 @opindex mswdiv
12084 @opindex mno-swdiv
12085 Generate code to compute division as reciprocal estimate and iterative
12086 refinement, creating opportunities for increased throughput.  This
12087 feature requires: optional PowerPC Graphics instruction set for single
12088 precision and FRE instruction for double precision, assuming divides
12089 cannot generate user-visible traps, and the domain values not include
12090 Infinities, denormals or zero denominator.
12091
12092 @item -maltivec
12093 @itemx -mno-altivec
12094 @opindex maltivec
12095 @opindex mno-altivec
12096 Generate code that uses (does not use) AltiVec instructions, and also
12097 enable the use of built-in functions that allow more direct access to
12098 the AltiVec instruction set.  You may also need to set
12099 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
12100 enhancements.
12101
12102 @item -mvrsave
12103 @item -mno-vrsave
12104 @opindex mvrsave
12105 @opindex mno-vrsave
12106 Generate VRSAVE instructions when generating AltiVec code.
12107
12108 @item -msecure-plt
12109 @opindex msecure-plt
12110 Generate code that allows ld and ld.so to build executables and shared
12111 libraries with non-exec .plt and .got sections.  This is a PowerPC
12112 32-bit SYSV ABI option.
12113
12114 @item -mbss-plt
12115 @opindex mbss-plt
12116 Generate code that uses a BSS .plt section that ld.so fills in, and
12117 requires .plt and .got sections that are both writable and executable.
12118 This is a PowerPC 32-bit SYSV ABI option.
12119
12120 @item -misel
12121 @itemx -mno-isel
12122 @opindex misel
12123 @opindex mno-isel
12124 This switch enables or disables the generation of ISEL instructions.
12125
12126 @item -misel=@var{yes/no}
12127 This switch has been deprecated.  Use @option{-misel} and
12128 @option{-mno-isel} instead.
12129
12130 @item -mspe
12131 @itemx -mno-spe
12132 @opindex mspe
12133 @opindex mno-spe
12134 This switch enables or disables the generation of SPE simd
12135 instructions.
12136
12137 @item -mspe=@var{yes/no}
12138 This option has been deprecated.  Use @option{-mspe} and
12139 @option{-mno-spe} instead.
12140
12141 @item -mfloat-gprs=@var{yes/single/double/no}
12142 @itemx -mfloat-gprs
12143 @opindex mfloat-gprs
12144 This switch enables or disables the generation of floating point
12145 operations on the general purpose registers for architectures that
12146 support it.
12147
12148 The argument @var{yes} or @var{single} enables the use of
12149 single-precision floating point operations.
12150
12151 The argument @var{double} enables the use of single and
12152 double-precision floating point operations.
12153
12154 The argument @var{no} disables floating point operations on the
12155 general purpose registers.
12156
12157 This option is currently only available on the MPC854x.
12158
12159 @item -m32
12160 @itemx -m64
12161 @opindex m32
12162 @opindex m64
12163 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12164 targets (including GNU/Linux).  The 32-bit environment sets int, long
12165 and pointer to 32 bits and generates code that runs on any PowerPC
12166 variant.  The 64-bit environment sets int to 32 bits and long and
12167 pointer to 64 bits, and generates code for PowerPC64, as for
12168 @option{-mpowerpc64}.
12169
12170 @item -mfull-toc
12171 @itemx -mno-fp-in-toc
12172 @itemx -mno-sum-in-toc
12173 @itemx -mminimal-toc
12174 @opindex mfull-toc
12175 @opindex mno-fp-in-toc
12176 @opindex mno-sum-in-toc
12177 @opindex mminimal-toc
12178 Modify generation of the TOC (Table Of Contents), which is created for
12179 every executable file.  The @option{-mfull-toc} option is selected by
12180 default.  In that case, GCC will allocate at least one TOC entry for
12181 each unique non-automatic variable reference in your program.  GCC
12182 will also place floating-point constants in the TOC@.  However, only
12183 16,384 entries are available in the TOC@.
12184
12185 If you receive a linker error message that saying you have overflowed
12186 the available TOC space, you can reduce the amount of TOC space used
12187 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
12188 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
12189 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
12190 generate code to calculate the sum of an address and a constant at
12191 run-time instead of putting that sum into the TOC@.  You may specify one
12192 or both of these options.  Each causes GCC to produce very slightly
12193 slower and larger code at the expense of conserving TOC space.
12194
12195 If you still run out of space in the TOC even when you specify both of
12196 these options, specify @option{-mminimal-toc} instead.  This option causes
12197 GCC to make only one TOC entry for every file.  When you specify this
12198 option, GCC will produce code that is slower and larger but which
12199 uses extremely little TOC space.  You may wish to use this option
12200 only on files that contain less frequently executed code.
12201
12202 @item -maix64
12203 @itemx -maix32
12204 @opindex maix64
12205 @opindex maix32
12206 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
12207 @code{long} type, and the infrastructure needed to support them.
12208 Specifying @option{-maix64} implies @option{-mpowerpc64} and
12209 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
12210 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
12211
12212 @item -mxl-compat
12213 @itemx -mno-xl-compat
12214 @opindex mxl-compat
12215 @opindex mno-xl-compat
12216 Produce code that conforms more closely to IBM XL compiler semantics
12217 when using AIX-compatible ABI.  Pass floating-point arguments to
12218 prototyped functions beyond the register save area (RSA) on the stack
12219 in addition to argument FPRs.  Do not assume that most significant
12220 double in 128-bit long double value is properly rounded when comparing
12221 values and converting to double.  Use XL symbol names for long double
12222 support routines.
12223
12224 The AIX calling convention was extended but not initially documented to
12225 handle an obscure K&R C case of calling a function that takes the
12226 address of its arguments with fewer arguments than declared.  IBM XL
12227 compilers access floating point arguments which do not fit in the
12228 RSA from the stack when a subroutine is compiled without
12229 optimization.  Because always storing floating-point arguments on the
12230 stack is inefficient and rarely needed, this option is not enabled by
12231 default and only is necessary when calling subroutines compiled by IBM
12232 XL compilers without optimization.
12233
12234 @item -mpe
12235 @opindex mpe
12236 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
12237 application written to use message passing with special startup code to
12238 enable the application to run.  The system must have PE installed in the
12239 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
12240 must be overridden with the @option{-specs=} option to specify the
12241 appropriate directory location.  The Parallel Environment does not
12242 support threads, so the @option{-mpe} option and the @option{-pthread}
12243 option are incompatible.
12244
12245 @item -malign-natural
12246 @itemx -malign-power
12247 @opindex malign-natural
12248 @opindex malign-power
12249 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12250 @option{-malign-natural} overrides the ABI-defined alignment of larger
12251 types, such as floating-point doubles, on their natural size-based boundary.
12252 The option @option{-malign-power} instructs GCC to follow the ABI-specified
12253 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
12254
12255 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
12256 is not supported.
12257
12258 @item -msoft-float
12259 @itemx -mhard-float
12260 @opindex msoft-float
12261 @opindex mhard-float
12262 Generate code that does not use (uses) the floating-point register set.
12263 Software floating point emulation is provided if you use the
12264 @option{-msoft-float} option, and pass the option to GCC when linking.
12265
12266 @item -mmultiple
12267 @itemx -mno-multiple
12268 @opindex mmultiple
12269 @opindex mno-multiple
12270 Generate code that uses (does not use) the load multiple word
12271 instructions and the store multiple word instructions.  These
12272 instructions are generated by default on POWER systems, and not
12273 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
12274 endian PowerPC systems, since those instructions do not work when the
12275 processor is in little endian mode.  The exceptions are PPC740 and
12276 PPC750 which permit the instructions usage in little endian mode.
12277
12278 @item -mstring
12279 @itemx -mno-string
12280 @opindex mstring
12281 @opindex mno-string
12282 Generate code that uses (does not use) the load string instructions
12283 and the store string word instructions to save multiple registers and
12284 do small block moves.  These instructions are generated by default on
12285 POWER systems, and not generated on PowerPC systems.  Do not use
12286 @option{-mstring} on little endian PowerPC systems, since those
12287 instructions do not work when the processor is in little endian mode.
12288 The exceptions are PPC740 and PPC750 which permit the instructions
12289 usage in little endian mode.
12290
12291 @item -mupdate
12292 @itemx -mno-update
12293 @opindex mupdate
12294 @opindex mno-update
12295 Generate code that uses (does not use) the load or store instructions
12296 that update the base register to the address of the calculated memory
12297 location.  These instructions are generated by default.  If you use
12298 @option{-mno-update}, there is a small window between the time that the
12299 stack pointer is updated and the address of the previous frame is
12300 stored, which means code that walks the stack frame across interrupts or
12301 signals may get corrupted data.
12302
12303 @item -mfused-madd
12304 @itemx -mno-fused-madd
12305 @opindex mfused-madd
12306 @opindex mno-fused-madd
12307 Generate code that uses (does not use) the floating point multiply and
12308 accumulate instructions.  These instructions are generated by default if
12309 hardware floating is used.
12310
12311 @item -mmulhw
12312 @itemx -mno-mulhw
12313 @opindex mmulhw
12314 @opindex mno-mulhw
12315 Generate code that uses (does not use) the half-word multiply and
12316 multiply-accumulate instructions on the IBM 405 and 440 processors.
12317 These instructions are generated by default when targetting those
12318 processors.
12319
12320 @item -mdlmzb
12321 @itemx -mno-dlmzb
12322 @opindex mdlmzb
12323 @opindex mno-dlmzb
12324 Generate code that uses (does not use) the string-search @samp{dlmzb}
12325 instruction on the IBM 405 and 440 processors.  This instruction is
12326 generated by default when targetting those processors.
12327
12328 @item -mno-bit-align
12329 @itemx -mbit-align
12330 @opindex mno-bit-align
12331 @opindex mbit-align
12332 On System V.4 and embedded PowerPC systems do not (do) force structures
12333 and unions that contain bit-fields to be aligned to the base type of the
12334 bit-field.
12335
12336 For example, by default a structure containing nothing but 8
12337 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
12338 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
12339 the structure would be aligned to a 1 byte boundary and be one byte in
12340 size.
12341
12342 @item -mno-strict-align
12343 @itemx -mstrict-align
12344 @opindex mno-strict-align
12345 @opindex mstrict-align
12346 On System V.4 and embedded PowerPC systems do not (do) assume that
12347 unaligned memory references will be handled by the system.
12348
12349 @item -mrelocatable
12350 @itemx -mno-relocatable
12351 @opindex mrelocatable
12352 @opindex mno-relocatable
12353 On embedded PowerPC systems generate code that allows (does not allow)
12354 the program to be relocated to a different address at runtime.  If you
12355 use @option{-mrelocatable} on any module, all objects linked together must
12356 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
12357
12358 @item -mrelocatable-lib
12359 @itemx -mno-relocatable-lib
12360 @opindex mrelocatable-lib
12361 @opindex mno-relocatable-lib
12362 On embedded PowerPC systems generate code that allows (does not allow)
12363 the program to be relocated to a different address at runtime.  Modules
12364 compiled with @option{-mrelocatable-lib} can be linked with either modules
12365 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
12366 with modules compiled with the @option{-mrelocatable} options.
12367
12368 @item -mno-toc
12369 @itemx -mtoc
12370 @opindex mno-toc
12371 @opindex mtoc
12372 On System V.4 and embedded PowerPC systems do not (do) assume that
12373 register 2 contains a pointer to a global area pointing to the addresses
12374 used in the program.
12375
12376 @item -mlittle
12377 @itemx -mlittle-endian
12378 @opindex mlittle
12379 @opindex mlittle-endian
12380 On System V.4 and embedded PowerPC systems compile code for the
12381 processor in little endian mode.  The @option{-mlittle-endian} option is
12382 the same as @option{-mlittle}.
12383
12384 @item -mbig
12385 @itemx -mbig-endian
12386 @opindex mbig
12387 @opindex mbig-endian
12388 On System V.4 and embedded PowerPC systems compile code for the
12389 processor in big endian mode.  The @option{-mbig-endian} option is
12390 the same as @option{-mbig}.
12391
12392 @item -mdynamic-no-pic
12393 @opindex mdynamic-no-pic
12394 On Darwin and Mac OS X systems, compile code so that it is not
12395 relocatable, but that its external references are relocatable.  The
12396 resulting code is suitable for applications, but not shared
12397 libraries.
12398
12399 @item -mprioritize-restricted-insns=@var{priority}
12400 @opindex mprioritize-restricted-insns
12401 This option controls the priority that is assigned to
12402 dispatch-slot restricted instructions during the second scheduling
12403 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
12404 @var{no/highest/second-highest} priority to dispatch slot restricted
12405 instructions.
12406
12407 @item -msched-costly-dep=@var{dependence_type}
12408 @opindex msched-costly-dep
12409 This option controls which dependences are considered costly
12410 by the target during instruction scheduling.  The argument
12411 @var{dependence_type} takes one of the following values:
12412 @var{no}: no dependence is costly,
12413 @var{all}: all dependences are costly,
12414 @var{true_store_to_load}: a true dependence from store to load is costly,
12415 @var{store_to_load}: any dependence from store to load is costly,
12416 @var{number}: any dependence which latency >= @var{number} is costly.
12417
12418 @item -minsert-sched-nops=@var{scheme}
12419 @opindex minsert-sched-nops
12420 This option controls which nop insertion scheme will be used during
12421 the second scheduling pass.  The argument @var{scheme} takes one of the
12422 following values:
12423 @var{no}: Don't insert nops.
12424 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
12425 according to the scheduler's grouping.
12426 @var{regroup_exact}: Insert nops to force costly dependent insns into
12427 separate groups.  Insert exactly as many nops as needed to force an insn
12428 to a new group, according to the estimated processor grouping.
12429 @var{number}: Insert nops to force costly dependent insns into
12430 separate groups.  Insert @var{number} nops to force an insn to a new group.
12431
12432 @item -mcall-sysv
12433 @opindex mcall-sysv
12434 On System V.4 and embedded PowerPC systems compile code using calling
12435 conventions that adheres to the March 1995 draft of the System V
12436 Application Binary Interface, PowerPC processor supplement.  This is the
12437 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
12438
12439 @item -mcall-sysv-eabi
12440 @opindex mcall-sysv-eabi
12441 Specify both @option{-mcall-sysv} and @option{-meabi} options.
12442
12443 @item -mcall-sysv-noeabi
12444 @opindex mcall-sysv-noeabi
12445 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
12446
12447 @item -mcall-solaris
12448 @opindex mcall-solaris
12449 On System V.4 and embedded PowerPC systems compile code for the Solaris
12450 operating system.
12451
12452 @item -mcall-linux
12453 @opindex mcall-linux
12454 On System V.4 and embedded PowerPC systems compile code for the
12455 Linux-based GNU system.
12456
12457 @item -mcall-gnu
12458 @opindex mcall-gnu
12459 On System V.4 and embedded PowerPC systems compile code for the
12460 Hurd-based GNU system.
12461
12462 @item -mcall-netbsd
12463 @opindex mcall-netbsd
12464 On System V.4 and embedded PowerPC systems compile code for the
12465 NetBSD operating system.
12466
12467 @item -maix-struct-return
12468 @opindex maix-struct-return
12469 Return all structures in memory (as specified by the AIX ABI)@.
12470
12471 @item -msvr4-struct-return
12472 @opindex msvr4-struct-return
12473 Return structures smaller than 8 bytes in registers (as specified by the
12474 SVR4 ABI)@.
12475
12476 @item -mabi=@var{abi-type}
12477 @opindex mabi
12478 Extend the current ABI with a particular extension, or remove such extension.
12479 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
12480 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
12481
12482 @item -mabi=spe
12483 @opindex mabi=spe
12484 Extend the current ABI with SPE ABI extensions.  This does not change
12485 the default ABI, instead it adds the SPE ABI extensions to the current
12486 ABI@.
12487
12488 @item -mabi=no-spe
12489 @opindex mabi=no-spe
12490 Disable Booke SPE ABI extensions for the current ABI@.
12491
12492 @item -mabi=ibmlongdouble
12493 @opindex mabi=ibmlongdouble
12494 Change the current ABI to use IBM extended precision long double.
12495 This is a PowerPC 32-bit SYSV ABI option.
12496
12497 @item -mabi=ieeelongdouble
12498 @opindex mabi=ieeelongdouble
12499 Change the current ABI to use IEEE extended precision long double.
12500 This is a PowerPC 32-bit Linux ABI option.
12501
12502 @item -mprototype
12503 @itemx -mno-prototype
12504 @opindex mprototype
12505 @opindex mno-prototype
12506 On System V.4 and embedded PowerPC systems assume that all calls to
12507 variable argument functions are properly prototyped.  Otherwise, the
12508 compiler must insert an instruction before every non prototyped call to
12509 set or clear bit 6 of the condition code register (@var{CR}) to
12510 indicate whether floating point values were passed in the floating point
12511 registers in case the function takes a variable arguments.  With
12512 @option{-mprototype}, only calls to prototyped variable argument functions
12513 will set or clear the bit.
12514
12515 @item -msim
12516 @opindex msim
12517 On embedded PowerPC systems, assume that the startup module is called
12518 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12519 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12520 configurations.
12521
12522 @item -mmvme
12523 @opindex mmvme
12524 On embedded PowerPC systems, assume that the startup module is called
12525 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12526 @file{libc.a}.
12527
12528 @item -mads
12529 @opindex mads
12530 On embedded PowerPC systems, assume that the startup module is called
12531 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12532 @file{libc.a}.
12533
12534 @item -myellowknife
12535 @opindex myellowknife
12536 On embedded PowerPC systems, assume that the startup module is called
12537 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12538 @file{libc.a}.
12539
12540 @item -mvxworks
12541 @opindex mvxworks
12542 On System V.4 and embedded PowerPC systems, specify that you are
12543 compiling for a VxWorks system.
12544
12545 @item -mwindiss
12546 @opindex mwindiss
12547 Specify that you are compiling for the WindISS simulation environment.
12548
12549 @item -memb
12550 @opindex memb
12551 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12552 header to indicate that @samp{eabi} extended relocations are used.
12553
12554 @item -meabi
12555 @itemx -mno-eabi
12556 @opindex meabi
12557 @opindex mno-eabi
12558 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12559 Embedded Applications Binary Interface (eabi) which is a set of
12560 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12561 means that the stack is aligned to an 8 byte boundary, a function
12562 @code{__eabi} is called to from @code{main} to set up the eabi
12563 environment, and the @option{-msdata} option can use both @code{r2} and
12564 @code{r13} to point to two separate small data areas.  Selecting
12565 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12566 do not call an initialization function from @code{main}, and the
12567 @option{-msdata} option will only use @code{r13} to point to a single
12568 small data area.  The @option{-meabi} option is on by default if you
12569 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12570
12571 @item -msdata=eabi
12572 @opindex msdata=eabi
12573 On System V.4 and embedded PowerPC systems, put small initialized
12574 @code{const} global and static data in the @samp{.sdata2} section, which
12575 is pointed to by register @code{r2}.  Put small initialized
12576 non-@code{const} global and static data in the @samp{.sdata} section,
12577 which is pointed to by register @code{r13}.  Put small uninitialized
12578 global and static data in the @samp{.sbss} section, which is adjacent to
12579 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12580 incompatible with the @option{-mrelocatable} option.  The
12581 @option{-msdata=eabi} option also sets the @option{-memb} option.
12582
12583 @item -msdata=sysv
12584 @opindex msdata=sysv
12585 On System V.4 and embedded PowerPC systems, put small global and static
12586 data in the @samp{.sdata} section, which is pointed to by register
12587 @code{r13}.  Put small uninitialized global and static data in the
12588 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12589 The @option{-msdata=sysv} option is incompatible with the
12590 @option{-mrelocatable} option.
12591
12592 @item -msdata=default
12593 @itemx -msdata
12594 @opindex msdata=default
12595 @opindex msdata
12596 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12597 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12598 same as @option{-msdata=sysv}.
12599
12600 @item -msdata-data
12601 @opindex msdata-data
12602 On System V.4 and embedded PowerPC systems, put small global
12603 data in the @samp{.sdata} section.  Put small uninitialized global
12604 data in the @samp{.sbss} section.  Do not use register @code{r13}
12605 to address small data however.  This is the default behavior unless
12606 other @option{-msdata} options are used.
12607
12608 @item -msdata=none
12609 @itemx -mno-sdata
12610 @opindex msdata=none
12611 @opindex mno-sdata
12612 On embedded PowerPC systems, put all initialized global and static data
12613 in the @samp{.data} section, and all uninitialized data in the
12614 @samp{.bss} section.
12615
12616 @item -G @var{num}
12617 @opindex G
12618 @cindex smaller data references (PowerPC)
12619 @cindex .sdata/.sdata2 references (PowerPC)
12620 On embedded PowerPC systems, put global and static items less than or
12621 equal to @var{num} bytes into the small data or bss sections instead of
12622 the normal data or bss section.  By default, @var{num} is 8.  The
12623 @option{-G @var{num}} switch is also passed to the linker.
12624 All modules should be compiled with the same @option{-G @var{num}} value.
12625
12626 @item -mregnames
12627 @itemx -mno-regnames
12628 @opindex mregnames
12629 @opindex mno-regnames
12630 On System V.4 and embedded PowerPC systems do (do not) emit register
12631 names in the assembly language output using symbolic forms.
12632
12633 @item -mlongcall
12634 @itemx -mno-longcall
12635 @opindex mlongcall
12636 @opindex mno-longcall
12637 By default assume that all calls are far away so that a longer more
12638 expensive calling sequence is required.  This is required for calls
12639 further than 32 megabytes (33,554,432 bytes) from the current location.
12640 A short call will be generated if the compiler knows
12641 the call cannot be that far away.  This setting can be overridden by
12642 the @code{shortcall} function attribute, or by @code{#pragma
12643 longcall(0)}.
12644
12645 Some linkers are capable of detecting out-of-range calls and generating
12646 glue code on the fly.  On these systems, long calls are unnecessary and
12647 generate slower code.  As of this writing, the AIX linker can do this,
12648 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12649 to the GNU linker for 32-bit PowerPC systems as well.
12650
12651 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12652 callee, L42'', plus a ``branch island'' (glue code).  The two target
12653 addresses represent the callee and the ``branch island''.  The
12654 Darwin/PPC linker will prefer the first address and generate a ``bl
12655 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12656 otherwise, the linker will generate ``bl L42'' to call the ``branch
12657 island''.  The ``branch island'' is appended to the body of the
12658 calling function; it computes the full 32-bit address of the callee
12659 and jumps to it.
12660
12661 On Mach-O (Darwin) systems, this option directs the compiler emit to
12662 the glue for every direct call, and the Darwin linker decides whether
12663 to use or discard it.
12664
12665 In the future, we may cause GCC to ignore all longcall specifications
12666 when the linker is known to generate glue.
12667
12668 @item -pthread
12669 @opindex pthread
12670 Adds support for multithreading with the @dfn{pthreads} library.
12671 This option sets flags for both the preprocessor and linker.
12672
12673 @end table
12674
12675 @node S/390 and zSeries Options
12676 @subsection S/390 and zSeries Options
12677 @cindex S/390 and zSeries Options
12678
12679 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12680
12681 @table @gcctabopt
12682 @item -mhard-float
12683 @itemx -msoft-float
12684 @opindex mhard-float
12685 @opindex msoft-float
12686 Use (do not use) the hardware floating-point instructions and registers
12687 for floating-point operations.  When @option{-msoft-float} is specified,
12688 functions in @file{libgcc.a} will be used to perform floating-point
12689 operations.  When @option{-mhard-float} is specified, the compiler
12690 generates IEEE floating-point instructions.  This is the default.
12691
12692 @item -mlong-double-64
12693 @itemx -mlong-double-128
12694 @opindex mlong-double-64
12695 @opindex mlong-double-128
12696 These switches control the size of @code{long double} type. A size
12697 of 64bit makes the @code{long double} type equivalent to the @code{double}
12698 type. This is the default.
12699
12700 @item -mbackchain
12701 @itemx -mno-backchain
12702 @opindex mbackchain
12703 @opindex mno-backchain
12704 Store (do not store) the address of the caller's frame as backchain pointer
12705 into the callee's stack frame.
12706 A backchain may be needed to allow debugging using tools that do not understand
12707 DWARF-2 call frame information.
12708 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12709 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12710 the backchain is placed into the topmost word of the 96/160 byte register
12711 save area.
12712
12713 In general, code compiled with @option{-mbackchain} is call-compatible with
12714 code compiled with @option{-mmo-backchain}; however, use of the backchain
12715 for debugging purposes usually requires that the whole binary is built with
12716 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12717 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12718 to build a linux kernel use @option{-msoft-float}.
12719
12720 The default is to not maintain the backchain.
12721
12722 @item -mpacked-stack
12723 @item -mno-packed-stack
12724 @opindex mpacked-stack
12725 @opindex mno-packed-stack
12726 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12727 specified, the compiler uses the all fields of the 96/160 byte register save
12728 area only for their default purpose; unused fields still take up stack space.
12729 When @option{-mpacked-stack} is specified, register save slots are densely
12730 packed at the top of the register save area; unused space is reused for other
12731 purposes, allowing for more efficient use of the available stack space.
12732 However, when @option{-mbackchain} is also in effect, the topmost word of
12733 the save area is always used to store the backchain, and the return address
12734 register is always saved two words below the backchain.
12735
12736 As long as the stack frame backchain is not used, code generated with
12737 @option{-mpacked-stack} is call-compatible with code generated with
12738 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
12739 S/390 or zSeries generated code that uses the stack frame backchain at run
12740 time, not just for debugging purposes.  Such code is not call-compatible
12741 with code compiled with @option{-mpacked-stack}.  Also, note that the
12742 combination of @option{-mbackchain},
12743 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12744 to build a linux kernel use @option{-msoft-float}.
12745
12746 The default is to not use the packed stack layout.
12747
12748 @item -msmall-exec
12749 @itemx -mno-small-exec
12750 @opindex msmall-exec
12751 @opindex mno-small-exec
12752 Generate (or do not generate) code using the @code{bras} instruction
12753 to do subroutine calls.
12754 This only works reliably if the total executable size does not
12755 exceed 64k.  The default is to use the @code{basr} instruction instead,
12756 which does not have this limitation.
12757
12758 @item -m64
12759 @itemx -m31
12760 @opindex m64
12761 @opindex m31
12762 When @option{-m31} is specified, generate code compliant to the
12763 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
12764 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
12765 particular to generate 64-bit instructions.  For the @samp{s390}
12766 targets, the default is @option{-m31}, while the @samp{s390x}
12767 targets default to @option{-m64}.
12768
12769 @item -mzarch
12770 @itemx -mesa
12771 @opindex mzarch
12772 @opindex mesa
12773 When @option{-mzarch} is specified, generate code using the
12774 instructions available on z/Architecture.
12775 When @option{-mesa} is specified, generate code using the
12776 instructions available on ESA/390.  Note that @option{-mesa} is
12777 not possible with @option{-m64}.
12778 When generating code compliant to the GNU/Linux for S/390 ABI,
12779 the default is @option{-mesa}.  When generating code compliant
12780 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
12781
12782 @item -mmvcle
12783 @itemx -mno-mvcle
12784 @opindex mmvcle
12785 @opindex mno-mvcle
12786 Generate (or do not generate) code using the @code{mvcle} instruction
12787 to perform block moves.  When @option{-mno-mvcle} is specified,
12788 use a @code{mvc} loop instead.  This is the default unless optimizing for
12789 size.
12790
12791 @item -mdebug
12792 @itemx -mno-debug
12793 @opindex mdebug
12794 @opindex mno-debug
12795 Print (or do not print) additional debug information when compiling.
12796 The default is to not print debug information.
12797
12798 @item -march=@var{cpu-type}
12799 @opindex march
12800 Generate code that will run on @var{cpu-type}, which is the name of a system
12801 representing a certain processor type.  Possible values for
12802 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
12803 When generating code using the instructions available on z/Architecture,
12804 the default is @option{-march=z900}.  Otherwise, the default is
12805 @option{-march=g5}.
12806
12807 @item -mtune=@var{cpu-type}
12808 @opindex mtune
12809 Tune to @var{cpu-type} everything applicable about the generated code,
12810 except for the ABI and the set of available instructions.
12811 The list of @var{cpu-type} values is the same as for @option{-march}.
12812 The default is the value used for @option{-march}.
12813
12814 @item -mtpf-trace
12815 @itemx -mno-tpf-trace
12816 @opindex mtpf-trace
12817 @opindex mno-tpf-trace
12818 Generate code that adds (does not add) in TPF OS specific branches to trace
12819 routines in the operating system.  This option is off by default, even
12820 when compiling for the TPF OS@.
12821
12822 @item -mfused-madd
12823 @itemx -mno-fused-madd
12824 @opindex mfused-madd
12825 @opindex mno-fused-madd
12826 Generate code that uses (does not use) the floating point multiply and
12827 accumulate instructions.  These instructions are generated by default if
12828 hardware floating point is used.
12829
12830 @item -mwarn-framesize=@var{framesize}
12831 @opindex mwarn-framesize
12832 Emit a warning if the current function exceeds the given frame size.  Because
12833 this is a compile time check it doesn't need to be a real problem when the program
12834 runs.  It is intended to identify functions which most probably cause
12835 a stack overflow.  It is useful to be used in an environment with limited stack
12836 size e.g.@: the linux kernel.
12837
12838 @item -mwarn-dynamicstack
12839 @opindex mwarn-dynamicstack
12840 Emit a warning if the function calls alloca or uses dynamically
12841 sized arrays.  This is generally a bad idea with a limited stack size.
12842
12843 @item -mstack-guard=@var{stack-guard}
12844 @item -mstack-size=@var{stack-size}
12845 @opindex mstack-guard
12846 @opindex mstack-size
12847 If these options are provided the s390 back end emits additional instructions in
12848 the function prologue which trigger a trap if the stack size is @var{stack-guard}
12849 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
12850 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
12851 the frame size of the compiled function is chosen.
12852 These options are intended to be used to help debugging stack overflow problems.
12853 The additionally emitted code causes only little overhead and hence can also be
12854 used in production like systems without greater performance degradation.  The given
12855 values have to be exact powers of 2 and @var{stack-size} has to be greater than
12856 @var{stack-guard} without exceeding 64k.
12857 In order to be efficient the extra code makes the assumption that the stack starts
12858 at an address aligned to the value given by @var{stack-size}.
12859 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
12860 @end table
12861
12862 @node Score Options
12863 @subsection Score Options
12864 @cindex Score Options
12865
12866 These options are defined for Score implementations:
12867
12868 @table @gcctabopt
12869 @item -mel
12870 @opindex -mel
12871 Compile code for little endian mode. 
12872
12873 @item -meb
12874 @opindex meb
12875 Compile code for big endian mode.  This is the default.
12876
12877 @item -mmac
12878 @opindex mmac
12879 Enable the use of multiply-accumulate instructions. Disabled by default. 
12880
12881 @item -mscore5u
12882 @opindex mscore5u
12883 Specify the SCORE5U of the target architecture.
12884
12885 @item -mscore7
12886 @opindex mscore7
12887 Specify the SCORE7 of the target architecture. This is the default.
12888 @end table
12889
12890 @node SH Options
12891 @subsection SH Options
12892
12893 These @samp{-m} options are defined for the SH implementations:
12894
12895 @table @gcctabopt
12896 @item -m1
12897 @opindex m1
12898 Generate code for the SH1.
12899
12900 @item -m2
12901 @opindex m2
12902 Generate code for the SH2.
12903
12904 @item -m2e
12905 Generate code for the SH2e.
12906
12907 @item -m3
12908 @opindex m3
12909 Generate code for the SH3.
12910
12911 @item -m3e
12912 @opindex m3e
12913 Generate code for the SH3e.
12914
12915 @item -m4-nofpu
12916 @opindex m4-nofpu
12917 Generate code for the SH4 without a floating-point unit.
12918
12919 @item -m4-single-only
12920 @opindex m4-single-only
12921 Generate code for the SH4 with a floating-point unit that only
12922 supports single-precision arithmetic.
12923
12924 @item -m4-single
12925 @opindex m4-single
12926 Generate code for the SH4 assuming the floating-point unit is in
12927 single-precision mode by default.
12928
12929 @item -m4
12930 @opindex m4
12931 Generate code for the SH4.
12932
12933 @item -m4a-nofpu
12934 @opindex m4a-nofpu
12935 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
12936 floating-point unit is not used.
12937
12938 @item -m4a-single-only
12939 @opindex m4a-single-only
12940 Generate code for the SH4a, in such a way that no double-precision
12941 floating point operations are used.
12942
12943 @item -m4a-single
12944 @opindex m4a-single
12945 Generate code for the SH4a assuming the floating-point unit is in
12946 single-precision mode by default.
12947
12948 @item -m4a
12949 @opindex m4a
12950 Generate code for the SH4a.
12951
12952 @item -m4al
12953 @opindex m4al
12954 Same as @option{-m4a-nofpu}, except that it implicitly passes
12955 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
12956 instructions at the moment.
12957
12958 @item -mb
12959 @opindex mb
12960 Compile code for the processor in big endian mode.
12961
12962 @item -ml
12963 @opindex ml
12964 Compile code for the processor in little endian mode.
12965
12966 @item -mdalign
12967 @opindex mdalign
12968 Align doubles at 64-bit boundaries.  Note that this changes the calling
12969 conventions, and thus some functions from the standard C library will
12970 not work unless you recompile it first with @option{-mdalign}.
12971
12972 @item -mrelax
12973 @opindex mrelax
12974 Shorten some address references at link time, when possible; uses the
12975 linker option @option{-relax}.
12976
12977 @item -mbigtable
12978 @opindex mbigtable
12979 Use 32-bit offsets in @code{switch} tables.  The default is to use
12980 16-bit offsets.
12981
12982 @item -mfmovd
12983 @opindex mfmovd
12984 Enable the use of the instruction @code{fmovd}.
12985
12986 @item -mhitachi
12987 @opindex mhitachi
12988 Comply with the calling conventions defined by Renesas.
12989
12990 @item -mrenesas
12991 @opindex mhitachi
12992 Comply with the calling conventions defined by Renesas.
12993
12994 @item -mno-renesas
12995 @opindex mhitachi
12996 Comply with the calling conventions defined for GCC before the Renesas
12997 conventions were available.  This option is the default for all
12998 targets of the SH toolchain except for @samp{sh-symbianelf}.
12999
13000 @item -mnomacsave
13001 @opindex mnomacsave
13002 Mark the @code{MAC} register as call-clobbered, even if
13003 @option{-mhitachi} is given.
13004
13005 @item -mieee
13006 @opindex mieee
13007 Increase IEEE-compliance of floating-point code.
13008 At the moment, this is equivalent to @option{-fno-finite-math-only}.
13009 When generating 16 bit SH opcodes, getting IEEE-conforming results for
13010 comparisons of NANs / infinities incurs extra overhead in every
13011 floating point comparison, therefore the default is set to
13012 @option{-ffinite-math-only}.
13013
13014 @item -minline-ic_invalidate
13015 @opindex minline-ic_invalidate
13016 Inline code to invalidate instruction cache entries after setting up
13017 nested function trampolines.
13018 This option has no effect if -musermode is in effect and the selected
13019 code generation option (e.g. -m4) does not allow the use of the icbi
13020 instruction.
13021 If the selected code generation option does not allow the use of the icbi
13022 instruction, and -musermode is not in effect, the inlined code will
13023 manipulate the instruction cache address array directly with an associative
13024 write.  This not only requires privileged mode, but it will also
13025 fail if the cache line had been mapped via the TLB and has become unmapped.
13026
13027 @item -misize
13028 @opindex misize
13029 Dump instruction size and location in the assembly code.
13030
13031 @item -mpadstruct
13032 @opindex mpadstruct
13033 This option is deprecated.  It pads structures to multiple of 4 bytes,
13034 which is incompatible with the SH ABI@.
13035
13036 @item -mspace
13037 @opindex mspace
13038 Optimize for space instead of speed.  Implied by @option{-Os}.
13039
13040 @item -mprefergot
13041 @opindex mprefergot
13042 When generating position-independent code, emit function calls using
13043 the Global Offset Table instead of the Procedure Linkage Table.
13044
13045 @item -musermode
13046 @opindex musermode
13047 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
13048 if the inlined code would not work in user mode.
13049 This is the default when the target is @code{sh-*-linux*}.
13050
13051 @item -multcost=@var{number}
13052 @opindex multcost=@var{number}
13053 Set the cost to assume for a multiply insn.
13054
13055 @item -mdiv=@var{strategy}
13056 @opindex mdiv=@var{strategy}
13057 Set the division strategy to use for SHmedia code.  @var{strategy} must be
13058 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
13059 inv:call2, inv:fp .
13060 "fp" performs the operation in floating point.  This has a very high latency,
13061 but needs only a few instructions, so it might be a good choice if
13062 your code has enough easily exploitable ILP to allow the compiler to
13063 schedule the floating point instructions together with other instructions.
13064 Division by zero causes a floating point exception.
13065 "inv" uses integer operations to calculate the inverse of the divisor,
13066 and then multiplies the dividend with the inverse.  This strategy allows
13067 cse and hoisting of the inverse calculation.  Division by zero calculates
13068 an unspecified result, but does not trap.
13069 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
13070 have been found, or if the entire operation has been hoisted to the same
13071 place, the last stages of the inverse calculation are intertwined with the
13072 final multiply to reduce the overall latency, at the expense of using a few
13073 more instructions, and thus offering fewer scheduling opportunities with
13074 other code.
13075 "call" calls a library function that usually implements the inv:minlat
13076 strategy.
13077 This gives high code density for m5-*media-nofpu compilations.
13078 "call2" uses a different entry point of the same library function, where it
13079 assumes that a pointer to a lookup table has already been set up, which
13080 exposes the pointer load to cse / code hoisting optimizations.
13081 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
13082 code generation, but if the code stays unoptimized, revert to the "call",
13083 "call2", or "fp" strategies, respectively.  Note that the
13084 potentially-trapping side effect of division by zero is carried by a
13085 separate instruction, so it is possible that all the integer instructions
13086 are hoisted out, but the marker for the side effect stays where it is.
13087 A recombination to fp operations or a call is not possible in that case.
13088 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
13089 that the inverse calculation was nor separated from the multiply, they speed
13090 up division where the dividend fits into 20 bits (plus sign where applicable),
13091 by inserting a test to skip a number of operations in this case; this test
13092 slows down the case of larger dividends.  inv20u assumes the case of a such
13093 a small dividend to be unlikely, and inv20l assumes it to be likely.
13094
13095 @item -mdivsi3_libfunc=@var{name}
13096 @opindex mdivsi3_libfunc=@var{name}
13097 Set the name of the library function used for 32 bit signed division to
13098 @var{name}.  This only affect the name used in the call and inv:call
13099 division strategies, and the compiler will still expect the same
13100 sets of input/output/clobbered registers as if this option was not present.
13101
13102 @item -madjust-unroll
13103 @opindex madjust-unroll
13104 Throttle unrolling to avoid thrashing target registers.
13105 This option only has an effect if the gcc code base supports the
13106 TARGET_ADJUST_UNROLL_MAX target hook.
13107
13108 @item -mindexed-addressing
13109 @opindex mindexed-addressing
13110 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
13111 This is only safe if the hardware and/or OS implement 32 bit wrap-around
13112 semantics for the indexed addressing mode.  The architecture allows the
13113 implementation of processors with 64 bit MMU, which the OS could use to
13114 get 32 bit addressing, but since no current hardware implementation supports
13115 this or any other way to make the indexed addressing mode safe to use in
13116 the 32 bit ABI, the default is -mno-indexed-addressing.
13117
13118 @item -mgettrcost=@var{number}
13119 @opindex mgettrcost=@var{number}
13120 Set the cost assumed for the gettr instruction to @var{number}.
13121 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
13122
13123 @item -mpt-fixed
13124 @opindex mpt-fixed
13125 Assume pt* instructions won't trap.  This will generally generate better
13126 scheduled code, but is unsafe on current hardware.  The current architecture
13127 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
13128 This has the unintentional effect of making it unsafe to schedule ptabs /
13129 ptrel before a branch, or hoist it out of a loop.  For example,
13130 __do_global_ctors, a part of libgcc that runs constructors at program
13131 startup, calls functions in a list which is delimited by @minus{}1.  With the
13132 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
13133 That means that all the constructors will be run a bit quicker, but when
13134 the loop comes to the end of the list, the program crashes because ptabs
13135 loads @minus{}1 into a target register.  Since this option is unsafe for any
13136 hardware implementing the current architecture specification, the default
13137 is -mno-pt-fixed.  Unless the user specifies a specific cost with
13138 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
13139 this deters register allocation using target registers for storing
13140 ordinary integers.
13141
13142 @item -minvalid-symbols
13143 @opindex minvalid-symbols
13144 Assume symbols might be invalid.  Ordinary function symbols generated by
13145 the compiler will always be valid to load with movi/shori/ptabs or
13146 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
13147 to generate symbols that will cause ptabs / ptrel to trap.
13148 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
13149 It will then prevent cross-basic-block cse, hoisting and most scheduling
13150 of symbol loads.  The default is @option{-mno-invalid-symbols}.
13151 @end table
13152
13153 @node SPARC Options
13154 @subsection SPARC Options
13155 @cindex SPARC options
13156
13157 These @samp{-m} options are supported on the SPARC:
13158
13159 @table @gcctabopt
13160 @item -mno-app-regs
13161 @itemx -mapp-regs
13162 @opindex mno-app-regs
13163 @opindex mapp-regs
13164 Specify @option{-mapp-regs} to generate output using the global registers
13165 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
13166 is the default.
13167
13168 To be fully SVR4 ABI compliant at the cost of some performance loss,
13169 specify @option{-mno-app-regs}.  You should compile libraries and system
13170 software with this option.
13171
13172 @item -mfpu
13173 @itemx -mhard-float
13174 @opindex mfpu
13175 @opindex mhard-float
13176 Generate output containing floating point instructions.  This is the
13177 default.
13178
13179 @item -mno-fpu
13180 @itemx -msoft-float
13181 @opindex mno-fpu
13182 @opindex msoft-float
13183 Generate output containing library calls for floating point.
13184 @strong{Warning:} the requisite libraries are not available for all SPARC
13185 targets.  Normally the facilities of the machine's usual C compiler are
13186 used, but this cannot be done directly in cross-compilation.  You must make
13187 your own arrangements to provide suitable library functions for
13188 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
13189 @samp{sparclite-*-*} do provide software floating point support.
13190
13191 @option{-msoft-float} changes the calling convention in the output file;
13192 therefore, it is only useful if you compile @emph{all} of a program with
13193 this option.  In particular, you need to compile @file{libgcc.a}, the
13194 library that comes with GCC, with @option{-msoft-float} in order for
13195 this to work.
13196
13197 @item -mhard-quad-float
13198 @opindex mhard-quad-float
13199 Generate output containing quad-word (long double) floating point
13200 instructions.
13201
13202 @item -msoft-quad-float
13203 @opindex msoft-quad-float
13204 Generate output containing library calls for quad-word (long double)
13205 floating point instructions.  The functions called are those specified
13206 in the SPARC ABI@.  This is the default.
13207
13208 As of this writing, there are no SPARC implementations that have hardware
13209 support for the quad-word floating point instructions.  They all invoke
13210 a trap handler for one of these instructions, and then the trap handler
13211 emulates the effect of the instruction.  Because of the trap handler overhead,
13212 this is much slower than calling the ABI library routines.  Thus the
13213 @option{-msoft-quad-float} option is the default.
13214
13215 @item -mno-unaligned-doubles
13216 @itemx -munaligned-doubles
13217 @opindex mno-unaligned-doubles
13218 @opindex munaligned-doubles
13219 Assume that doubles have 8 byte alignment.  This is the default.
13220
13221 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
13222 alignment only if they are contained in another type, or if they have an
13223 absolute address.  Otherwise, it assumes they have 4 byte alignment.
13224 Specifying this option avoids some rare compatibility problems with code
13225 generated by other compilers.  It is not the default because it results
13226 in a performance loss, especially for floating point code.
13227
13228 @item -mno-faster-structs
13229 @itemx -mfaster-structs
13230 @opindex mno-faster-structs
13231 @opindex mfaster-structs
13232 With @option{-mfaster-structs}, the compiler assumes that structures
13233 should have 8 byte alignment.  This enables the use of pairs of
13234 @code{ldd} and @code{std} instructions for copies in structure
13235 assignment, in place of twice as many @code{ld} and @code{st} pairs.
13236 However, the use of this changed alignment directly violates the SPARC
13237 ABI@.  Thus, it's intended only for use on targets where the developer
13238 acknowledges that their resulting code will not be directly in line with
13239 the rules of the ABI@.
13240
13241 @item -mimpure-text
13242 @opindex mimpure-text
13243 @option{-mimpure-text}, used in addition to @option{-shared}, tells
13244 the compiler to not pass @option{-z text} to the linker when linking a
13245 shared object.  Using this option, you can link position-dependent
13246 code into a shared object.
13247
13248 @option{-mimpure-text} suppresses the ``relocations remain against
13249 allocatable but non-writable sections'' linker error message.
13250 However, the necessary relocations will trigger copy-on-write, and the
13251 shared object is not actually shared across processes.  Instead of
13252 using @option{-mimpure-text}, you should compile all source code with
13253 @option{-fpic} or @option{-fPIC}.
13254
13255 This option is only available on SunOS and Solaris.
13256
13257 @item -mcpu=@var{cpu_type}
13258 @opindex mcpu
13259 Set the instruction set, register set, and instruction scheduling parameters
13260 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
13261 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
13262 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
13263 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
13264 @samp{ultrasparc3}, and @samp{niagara}.
13265
13266 Default instruction scheduling parameters are used for values that select
13267 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
13268 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
13269
13270 Here is a list of each supported architecture and their supported
13271 implementations.
13272
13273 @smallexample
13274     v7:             cypress
13275     v8:             supersparc, hypersparc
13276     sparclite:      f930, f934, sparclite86x
13277     sparclet:       tsc701
13278     v9:             ultrasparc, ultrasparc3, niagara
13279 @end smallexample
13280
13281 By default (unless configured otherwise), GCC generates code for the V7
13282 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
13283 additionally optimizes it for the Cypress CY7C602 chip, as used in the
13284 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
13285 SPARCStation 1, 2, IPX etc.
13286
13287 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
13288 architecture.  The only difference from V7 code is that the compiler emits
13289 the integer multiply and integer divide instructions which exist in SPARC-V8
13290 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
13291 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
13292 2000 series.
13293
13294 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
13295 the SPARC architecture.  This adds the integer multiply, integer divide step
13296 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
13297 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
13298 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
13299 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
13300 MB86934 chip, which is the more recent SPARClite with FPU@.
13301
13302 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
13303 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
13304 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
13305 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
13306 optimizes it for the TEMIC SPARClet chip.
13307
13308 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
13309 architecture.  This adds 64-bit integer and floating-point move instructions,
13310 3 additional floating-point condition code registers and conditional move
13311 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
13312 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
13313 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
13314 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
13315 @option{-mcpu=niagara}, the compiler additionally optimizes it for
13316 Sun UltraSPARC T1 chips.
13317
13318 @item -mtune=@var{cpu_type}
13319 @opindex mtune
13320 Set the instruction scheduling parameters for machine type
13321 @var{cpu_type}, but do not set the instruction set or register set that the
13322 option @option{-mcpu=@var{cpu_type}} would.
13323
13324 The same values for @option{-mcpu=@var{cpu_type}} can be used for
13325 @option{-mtune=@var{cpu_type}}, but the only useful values are those
13326 that select a particular cpu implementation.  Those are @samp{cypress},
13327 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
13328 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
13329 @samp{ultrasparc3}, and @samp{niagara}.
13330
13331 @item -mv8plus
13332 @itemx -mno-v8plus
13333 @opindex mv8plus
13334 @opindex mno-v8plus
13335 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
13336 difference from the V8 ABI is that the global and out registers are
13337 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
13338 mode for all SPARC-V9 processors.
13339
13340 @item -mvis
13341 @itemx -mno-vis
13342 @opindex mvis
13343 @opindex mno-vis
13344 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
13345 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
13346 @end table
13347
13348 These @samp{-m} options are supported in addition to the above
13349 on SPARC-V9 processors in 64-bit environments:
13350
13351 @table @gcctabopt
13352 @item -mlittle-endian
13353 @opindex mlittle-endian
13354 Generate code for a processor running in little-endian mode.  It is only
13355 available for a few configurations and most notably not on Solaris and Linux.
13356
13357 @item -m32
13358 @itemx -m64
13359 @opindex m32
13360 @opindex m64
13361 Generate code for a 32-bit or 64-bit environment.
13362 The 32-bit environment sets int, long and pointer to 32 bits.
13363 The 64-bit environment sets int to 32 bits and long and pointer
13364 to 64 bits.
13365
13366 @item -mcmodel=medlow
13367 @opindex mcmodel=medlow
13368 Generate code for the Medium/Low code model: 64-bit addresses, programs
13369 must be linked in the low 32 bits of memory.  Programs can be statically
13370 or dynamically linked.
13371
13372 @item -mcmodel=medmid
13373 @opindex mcmodel=medmid
13374 Generate code for the Medium/Middle code model: 64-bit addresses, programs
13375 must be linked in the low 44 bits of memory, the text and data segments must
13376 be less than 2GB in size and the data segment must be located within 2GB of
13377 the text segment.
13378
13379 @item -mcmodel=medany
13380 @opindex mcmodel=medany
13381 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
13382 may be linked anywhere in memory, the text and data segments must be less
13383 than 2GB in size and the data segment must be located within 2GB of the
13384 text segment.
13385
13386 @item -mcmodel=embmedany
13387 @opindex mcmodel=embmedany
13388 Generate code for the Medium/Anywhere code model for embedded systems:
13389 64-bit addresses, the text and data segments must be less than 2GB in
13390 size, both starting anywhere in memory (determined at link time).  The
13391 global register %g4 points to the base of the data segment.  Programs
13392 are statically linked and PIC is not supported.
13393
13394 @item -mstack-bias
13395 @itemx -mno-stack-bias
13396 @opindex mstack-bias
13397 @opindex mno-stack-bias
13398 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
13399 frame pointer if present, are offset by @minus{}2047 which must be added back
13400 when making stack frame references.  This is the default in 64-bit mode.
13401 Otherwise, assume no such offset is present.
13402 @end table
13403
13404 These switches are supported in addition to the above on Solaris:
13405
13406 @table @gcctabopt
13407 @item -threads
13408 @opindex threads
13409 Add support for multithreading using the Solaris threads library.  This
13410 option sets flags for both the preprocessor and linker.  This option does
13411 not affect the thread safety of object code produced by the compiler or
13412 that of libraries supplied with it.
13413
13414 @item -pthreads
13415 @opindex pthreads
13416 Add support for multithreading using the POSIX threads library.  This
13417 option sets flags for both the preprocessor and linker.  This option does
13418 not affect the thread safety of object code produced  by the compiler or
13419 that of libraries supplied with it.
13420
13421 @item -pthread
13422 @opindex pthread
13423 This is a synonym for @option{-pthreads}.
13424 @end table
13425
13426 @node SPU Options
13427 @subsection SPU Options
13428 @cindex SPU options
13429
13430 These @samp{-m} options are supported on the SPU:
13431
13432 @table @gcctabopt
13433 @item -mwarn-reloc
13434 @itemx -merror-reloc
13435 @opindex mwarn-reloc
13436 @opindex merror-reloc
13437
13438 The loader for SPU does not handle dynamic relocations.  By default, GCC
13439 will give an error when it generates code that requires a dynamic
13440 relocation.  @option{-mno-error-reloc} disables the error,
13441 @option{-mwarn-reloc} will generate a warning instead.
13442
13443 @item -msafe-dma
13444 @itemx -munsafe-dma
13445 @opindex msafe-dma
13446 @opindex munsafe-dma
13447
13448 Instructions which initiate or test completion of DMA must not be
13449 reordered with respect to loads and stores of the memory which is being
13450 accessed.  Users typically address this problem using the volatile
13451 keyword, but that can lead to inefficient code in places where the
13452 memory is known to not change.  Rather than mark the memory as volatile
13453 we treat the DMA instructions as potentially effecting all memory.  With
13454 @option{-munsafe-dma} users must use the volatile keyword to protect
13455 memory accesses.
13456
13457 @item -mbranch-hints
13458 @opindex mbranch-hints
13459
13460 By default, GCC will generate a branch hint instruction to avoid
13461 pipeline stalls for always taken or probably taken branches.  A hint
13462 will not be generated closer than 8 instructions away from its branch.
13463 There is little reason to disable them, except for debugging purposes,
13464 or to make an object a little bit smaller.
13465
13466 @item -msmall-mem
13467 @itemx -mlarge-mem
13468 @opindex msmall-mem
13469 @opindex mlarge-mem
13470
13471 By default, GCC generates code assuming that addresses are never larger
13472 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
13473 a full 32 bit address.
13474
13475 @item -mstdmain
13476 @opindex mstdmain
13477
13478 By default, GCC links against startup code that assumes the SPU-style
13479 main function interface (which has an unconventional parameter list).
13480 With @option{-mstdmain}, GCC will link your program against startup
13481 code that assumes a C99-style interface to @code{main}, including a
13482 local copy of @code{argv} strings.
13483
13484 @item -mfixed-range=@var{register-range}
13485 @opindex mfixed-range
13486 Generate code treating the given register range as fixed registers.
13487 A fixed register is one that the register allocator can not use.  This is
13488 useful when compiling kernel code.  A register range is specified as
13489 two registers separated by a dash.  Multiple register ranges can be
13490 specified separated by a comma.
13491
13492 @end table
13493
13494 @node System V Options
13495 @subsection Options for System V
13496
13497 These additional options are available on System V Release 4 for
13498 compatibility with other compilers on those systems:
13499
13500 @table @gcctabopt
13501 @item -G
13502 @opindex G
13503 Create a shared object.
13504 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13505
13506 @item -Qy
13507 @opindex Qy
13508 Identify the versions of each tool used by the compiler, in a
13509 @code{.ident} assembler directive in the output.
13510
13511 @item -Qn
13512 @opindex Qn
13513 Refrain from adding @code{.ident} directives to the output file (this is
13514 the default).
13515
13516 @item -YP,@var{dirs}
13517 @opindex YP
13518 Search the directories @var{dirs}, and no others, for libraries
13519 specified with @option{-l}.
13520
13521 @item -Ym,@var{dir}
13522 @opindex Ym
13523 Look in the directory @var{dir} to find the M4 preprocessor.
13524 The assembler uses this option.
13525 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13526 @c the generic assembler that comes with Solaris takes just -Ym.
13527 @end table
13528
13529 @node TMS320C3x/C4x Options
13530 @subsection TMS320C3x/C4x Options
13531 @cindex TMS320C3x/C4x Options
13532
13533 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
13534
13535 @table @gcctabopt
13536
13537 @item -mcpu=@var{cpu_type}
13538 @opindex mcpu
13539 Set the instruction set, register set, and instruction scheduling
13540 parameters for machine type @var{cpu_type}.  Supported values for
13541 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
13542 @samp{c44}.  The default is @samp{c40} to generate code for the
13543 TMS320C40.
13544
13545 @item -mbig-memory
13546 @itemx -mbig
13547 @itemx -msmall-memory
13548 @itemx -msmall
13549 @opindex mbig-memory
13550 @opindex mbig
13551 @opindex msmall-memory
13552 @opindex msmall
13553 Generates code for the big or small memory model.  The small memory
13554 model assumed that all data fits into one 64K word page.  At run-time
13555 the data page (DP) register must be set to point to the 64K page
13556 containing the .bss and .data program sections.  The big memory model is
13557 the default and requires reloading of the DP register for every direct
13558 memory access.
13559
13560 @item -mbk
13561 @itemx -mno-bk
13562 @opindex mbk
13563 @opindex mno-bk
13564 Allow (disallow) allocation of general integer operands into the block
13565 count register BK@.
13566
13567 @item -mdb
13568 @itemx -mno-db
13569 @opindex mdb
13570 @opindex mno-db
13571 Enable (disable) generation of code using decrement and branch,
13572 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13573 on the safe side, this is disabled for the C3x, since the maximum
13574 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13575 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13576 that it can utilize the decrement and branch instruction, but will give
13577 up if there is more than one memory reference in the loop.  Thus a loop
13578 where the loop counter is decremented can generate slightly more
13579 efficient code, in cases where the RPTB instruction cannot be utilized.
13580
13581 @item -mdp-isr-reload
13582 @itemx -mparanoid
13583 @opindex mdp-isr-reload
13584 @opindex mparanoid
13585 Force the DP register to be saved on entry to an interrupt service
13586 routine (ISR), reloaded to point to the data section, and restored on
13587 exit from the ISR@.  This should not be required unless someone has
13588 violated the small memory model by modifying the DP register, say within
13589 an object library.
13590
13591 @item -mmpyi
13592 @itemx -mno-mpyi
13593 @opindex mmpyi
13594 @opindex mno-mpyi
13595 For the C3x use the 24-bit MPYI instruction for integer multiplies
13596 instead of a library call to guarantee 32-bit results.  Note that if one
13597 of the operands is a constant, then the multiplication will be performed
13598 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13599 then squaring operations are performed inline instead of a library call.
13600
13601 @item -mfast-fix
13602 @itemx -mno-fast-fix
13603 @opindex mfast-fix
13604 @opindex mno-fast-fix
13605 The C3x/C4x FIX instruction to convert a floating point value to an
13606 integer value chooses the nearest integer less than or equal to the
13607 floating point value rather than to the nearest integer.  Thus if the
13608 floating point number is negative, the result will be incorrectly
13609 truncated an additional code is necessary to detect and correct this
13610 case.  This option can be used to disable generation of the additional
13611 code required to correct the result.
13612
13613 @item -mrptb
13614 @itemx -mno-rptb
13615 @opindex mrptb
13616 @opindex mno-rptb
13617 Enable (disable) generation of repeat block sequences using the RPTB
13618 instruction for zero overhead looping.  The RPTB construct is only used
13619 for innermost loops that do not call functions or jump across the loop
13620 boundaries.  There is no advantage having nested RPTB loops due to the
13621 overhead required to save and restore the RC, RS, and RE registers.
13622 This is enabled by default with @option{-O2}.
13623
13624 @item -mrpts=@var{count}
13625 @itemx -mno-rpts
13626 @opindex mrpts
13627 @opindex mno-rpts
13628 Enable (disable) the use of the single instruction repeat instruction
13629 RPTS@.  If a repeat block contains a single instruction, and the loop
13630 count can be guaranteed to be less than the value @var{count}, GCC will
13631 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13632 then a RPTS will be emitted even if the loop count cannot be determined
13633 at compile time.  Note that the repeated instruction following RPTS does
13634 not have to be reloaded from memory each iteration, thus freeing up the
13635 CPU buses for operands.  However, since interrupts are blocked by this
13636 instruction, it is disabled by default.
13637
13638 @item -mloop-unsigned
13639 @itemx -mno-loop-unsigned
13640 @opindex mloop-unsigned
13641 @opindex mno-loop-unsigned
13642 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13643 is @math{2^{31} + 1} since these instructions test if the iteration count is
13644 negative to terminate the loop.  If the iteration count is unsigned
13645 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13646 exceeded.  This switch allows an unsigned iteration count.
13647
13648 @item -mti
13649 @opindex mti
13650 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13651 with.  This also enforces compatibility with the API employed by the TI
13652 C3x C compiler.  For example, long doubles are passed as structures
13653 rather than in floating point registers.
13654
13655 @item -mregparm
13656 @itemx -mmemparm
13657 @opindex mregparm
13658 @opindex mmemparm
13659 Generate code that uses registers (stack) for passing arguments to functions.
13660 By default, arguments are passed in registers where possible rather
13661 than by pushing arguments on to the stack.
13662
13663 @item -mparallel-insns
13664 @itemx -mno-parallel-insns
13665 @opindex mparallel-insns
13666 @opindex mno-parallel-insns
13667 Allow the generation of parallel instructions.  This is enabled by
13668 default with @option{-O2}.
13669
13670 @item -mparallel-mpy
13671 @itemx -mno-parallel-mpy
13672 @opindex mparallel-mpy
13673 @opindex mno-parallel-mpy
13674 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13675 provided @option{-mparallel-insns} is also specified.  These instructions have
13676 tight register constraints which can pessimize the code generation
13677 of large functions.
13678
13679 @end table
13680
13681 @node V850 Options
13682 @subsection V850 Options
13683 @cindex V850 Options
13684
13685 These @samp{-m} options are defined for V850 implementations:
13686
13687 @table @gcctabopt
13688 @item -mlong-calls
13689 @itemx -mno-long-calls
13690 @opindex mlong-calls
13691 @opindex mno-long-calls
13692 Treat all calls as being far away (near).  If calls are assumed to be
13693 far away, the compiler will always load the functions address up into a
13694 register, and call indirect through the pointer.
13695
13696 @item -mno-ep
13697 @itemx -mep
13698 @opindex mno-ep
13699 @opindex mep
13700 Do not optimize (do optimize) basic blocks that use the same index
13701 pointer 4 or more times to copy pointer into the @code{ep} register, and
13702 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13703 option is on by default if you optimize.
13704
13705 @item -mno-prolog-function
13706 @itemx -mprolog-function
13707 @opindex mno-prolog-function
13708 @opindex mprolog-function
13709 Do not use (do use) external functions to save and restore registers
13710 at the prologue and epilogue of a function.  The external functions
13711 are slower, but use less code space if more than one function saves
13712 the same number of registers.  The @option{-mprolog-function} option
13713 is on by default if you optimize.
13714
13715 @item -mspace
13716 @opindex mspace
13717 Try to make the code as small as possible.  At present, this just turns
13718 on the @option{-mep} and @option{-mprolog-function} options.
13719
13720 @item -mtda=@var{n}
13721 @opindex mtda
13722 Put static or global variables whose size is @var{n} bytes or less into
13723 the tiny data area that register @code{ep} points to.  The tiny data
13724 area can hold up to 256 bytes in total (128 bytes for byte references).
13725
13726 @item -msda=@var{n}
13727 @opindex msda
13728 Put static or global variables whose size is @var{n} bytes or less into
13729 the small data area that register @code{gp} points to.  The small data
13730 area can hold up to 64 kilobytes.
13731
13732 @item -mzda=@var{n}
13733 @opindex mzda
13734 Put static or global variables whose size is @var{n} bytes or less into
13735 the first 32 kilobytes of memory.
13736
13737 @item -mv850
13738 @opindex mv850
13739 Specify that the target processor is the V850.
13740
13741 @item -mbig-switch
13742 @opindex mbig-switch
13743 Generate code suitable for big switch tables.  Use this option only if
13744 the assembler/linker complain about out of range branches within a switch
13745 table.
13746
13747 @item -mapp-regs
13748 @opindex mapp-regs
13749 This option will cause r2 and r5 to be used in the code generated by
13750 the compiler.  This setting is the default.
13751
13752 @item -mno-app-regs
13753 @opindex mno-app-regs
13754 This option will cause r2 and r5 to be treated as fixed registers.
13755
13756 @item -mv850e1
13757 @opindex mv850e1
13758 Specify that the target processor is the V850E1.  The preprocessor
13759 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
13760 this option is used.
13761
13762 @item -mv850e
13763 @opindex mv850e
13764 Specify that the target processor is the V850E@.  The preprocessor
13765 constant @samp{__v850e__} will be defined if this option is used.
13766
13767 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
13768 are defined then a default target processor will be chosen and the
13769 relevant @samp{__v850*__} preprocessor constant will be defined.
13770
13771 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
13772 defined, regardless of which processor variant is the target.
13773
13774 @item -mdisable-callt
13775 @opindex mdisable-callt
13776 This option will suppress generation of the CALLT instruction for the
13777 v850e and v850e1 flavors of the v850 architecture.  The default is
13778 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
13779
13780 @end table
13781
13782 @node VAX Options
13783 @subsection VAX Options
13784 @cindex VAX options
13785
13786 These @samp{-m} options are defined for the VAX:
13787
13788 @table @gcctabopt
13789 @item -munix
13790 @opindex munix
13791 Do not output certain jump instructions (@code{aobleq} and so on)
13792 that the Unix assembler for the VAX cannot handle across long
13793 ranges.
13794
13795 @item -mgnu
13796 @opindex mgnu
13797 Do output those jump instructions, on the assumption that you
13798 will assemble with the GNU assembler.
13799
13800 @item -mg
13801 @opindex mg
13802 Output code for g-format floating point numbers instead of d-format.
13803 @end table
13804
13805 @node x86-64 Options
13806 @subsection x86-64 Options
13807 @cindex x86-64 options
13808
13809 These are listed under @xref{i386 and x86-64 Options}.
13810
13811 @node Xstormy16 Options
13812 @subsection Xstormy16 Options
13813 @cindex Xstormy16 Options
13814
13815 These options are defined for Xstormy16:
13816
13817 @table @gcctabopt
13818 @item -msim
13819 @opindex msim
13820 Choose startup files and linker script suitable for the simulator.
13821 @end table
13822
13823 @node Xtensa Options
13824 @subsection Xtensa Options
13825 @cindex Xtensa Options
13826
13827 These options are supported for Xtensa targets:
13828
13829 @table @gcctabopt
13830 @item -mconst16
13831 @itemx -mno-const16
13832 @opindex mconst16
13833 @opindex mno-const16
13834 Enable or disable use of @code{CONST16} instructions for loading
13835 constant values.  The @code{CONST16} instruction is currently not a
13836 standard option from Tensilica.  When enabled, @code{CONST16}
13837 instructions are always used in place of the standard @code{L32R}
13838 instructions.  The use of @code{CONST16} is enabled by default only if
13839 the @code{L32R} instruction is not available.
13840
13841 @item -mfused-madd
13842 @itemx -mno-fused-madd
13843 @opindex mfused-madd
13844 @opindex mno-fused-madd
13845 Enable or disable use of fused multiply/add and multiply/subtract
13846 instructions in the floating-point option.  This has no effect if the
13847 floating-point option is not also enabled.  Disabling fused multiply/add
13848 and multiply/subtract instructions forces the compiler to use separate
13849 instructions for the multiply and add/subtract operations.  This may be
13850 desirable in some cases where strict IEEE 754-compliant results are
13851 required: the fused multiply add/subtract instructions do not round the
13852 intermediate result, thereby producing results with @emph{more} bits of
13853 precision than specified by the IEEE standard.  Disabling fused multiply
13854 add/subtract instructions also ensures that the program output is not
13855 sensitive to the compiler's ability to combine multiply and add/subtract
13856 operations.
13857
13858 @item -mtext-section-literals
13859 @itemx -mno-text-section-literals
13860 @opindex mtext-section-literals
13861 @opindex mno-text-section-literals
13862 Control the treatment of literal pools.  The default is
13863 @option{-mno-text-section-literals}, which places literals in a separate
13864 section in the output file.  This allows the literal pool to be placed
13865 in a data RAM/ROM, and it also allows the linker to combine literal
13866 pools from separate object files to remove redundant literals and
13867 improve code size.  With @option{-mtext-section-literals}, the literals
13868 are interspersed in the text section in order to keep them as close as
13869 possible to their references.  This may be necessary for large assembly
13870 files.
13871
13872 @item -mtarget-align
13873 @itemx -mno-target-align
13874 @opindex mtarget-align
13875 @opindex mno-target-align
13876 When this option is enabled, GCC instructs the assembler to
13877 automatically align instructions to reduce branch penalties at the
13878 expense of some code density.  The assembler attempts to widen density
13879 instructions to align branch targets and the instructions following call
13880 instructions.  If there are not enough preceding safe density
13881 instructions to align a target, no widening will be performed.  The
13882 default is @option{-mtarget-align}.  These options do not affect the
13883 treatment of auto-aligned instructions like @code{LOOP}, which the
13884 assembler will always align, either by widening density instructions or
13885 by inserting no-op instructions.
13886
13887 @item -mlongcalls
13888 @itemx -mno-longcalls
13889 @opindex mlongcalls
13890 @opindex mno-longcalls
13891 When this option is enabled, GCC instructs the assembler to translate
13892 direct calls to indirect calls unless it can determine that the target
13893 of a direct call is in the range allowed by the call instruction.  This
13894 translation typically occurs for calls to functions in other source
13895 files.  Specifically, the assembler translates a direct @code{CALL}
13896 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
13897 The default is @option{-mno-longcalls}.  This option should be used in
13898 programs where the call target can potentially be out of range.  This
13899 option is implemented in the assembler, not the compiler, so the
13900 assembly code generated by GCC will still show direct call
13901 instructions---look at the disassembled object code to see the actual
13902 instructions.  Note that the assembler will use an indirect call for
13903 every cross-file call, not just those that really will be out of range.
13904 @end table
13905
13906 @node zSeries Options
13907 @subsection zSeries Options
13908 @cindex zSeries options
13909
13910 These are listed under @xref{S/390 and zSeries Options}.
13911
13912 @node Code Gen Options
13913 @section Options for Code Generation Conventions
13914 @cindex code generation conventions
13915 @cindex options, code generation
13916 @cindex run-time options
13917
13918 These machine-independent options control the interface conventions
13919 used in code generation.
13920
13921 Most of them have both positive and negative forms; the negative form
13922 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
13923 one of the forms is listed---the one which is not the default.  You
13924 can figure out the other form by either removing @samp{no-} or adding
13925 it.
13926
13927 @table @gcctabopt
13928 @item -fbounds-check
13929 @opindex fbounds-check
13930 For front-ends that support it, generate additional code to check that
13931 indices used to access arrays are within the declared range.  This is
13932 currently only supported by the Java and Fortran front-ends, where
13933 this option defaults to true and false respectively.
13934
13935 @item -ftrapv
13936 @opindex ftrapv
13937 This option generates traps for signed overflow on addition, subtraction,
13938 multiplication operations.
13939
13940 @item -fwrapv
13941 @opindex fwrapv
13942 This option instructs the compiler to assume that signed arithmetic
13943 overflow of addition, subtraction and multiplication wraps around
13944 using twos-complement representation.  This flag enables some optimizations
13945 and disables others.  This option is enabled by default for the Java
13946 front-end, as required by the Java language specification.
13947
13948 @item -fexceptions
13949 @opindex fexceptions
13950 Enable exception handling.  Generates extra code needed to propagate
13951 exceptions.  For some targets, this implies GCC will generate frame
13952 unwind information for all functions, which can produce significant data
13953 size overhead, although it does not affect execution.  If you do not
13954 specify this option, GCC will enable it by default for languages like
13955 C++ which normally require exception handling, and disable it for
13956 languages like C that do not normally require it.  However, you may need
13957 to enable this option when compiling C code that needs to interoperate
13958 properly with exception handlers written in C++.  You may also wish to
13959 disable this option if you are compiling older C++ programs that don't
13960 use exception handling.
13961
13962 @item -fnon-call-exceptions
13963 @opindex fnon-call-exceptions
13964 Generate code that allows trapping instructions to throw exceptions.
13965 Note that this requires platform-specific runtime support that does
13966 not exist everywhere.  Moreover, it only allows @emph{trapping}
13967 instructions to throw exceptions, i.e.@: memory references or floating
13968 point instructions.  It does not allow exceptions to be thrown from
13969 arbitrary signal handlers such as @code{SIGALRM}.
13970
13971 @item -funwind-tables
13972 @opindex funwind-tables
13973 Similar to @option{-fexceptions}, except that it will just generate any needed
13974 static data, but will not affect the generated code in any other way.
13975 You will normally not enable this option; instead, a language processor
13976 that needs this handling would enable it on your behalf.
13977
13978 @item -fasynchronous-unwind-tables
13979 @opindex fasynchronous-unwind-tables
13980 Generate unwind table in dwarf2 format, if supported by target machine.  The
13981 table is exact at each instruction boundary, so it can be used for stack
13982 unwinding from asynchronous events (such as debugger or garbage collector).
13983
13984 @item -fpcc-struct-return
13985 @opindex fpcc-struct-return
13986 Return ``short'' @code{struct} and @code{union} values in memory like
13987 longer ones, rather than in registers.  This convention is less
13988 efficient, but it has the advantage of allowing intercallability between
13989 GCC-compiled files and files compiled with other compilers, particularly
13990 the Portable C Compiler (pcc).
13991
13992 The precise convention for returning structures in memory depends
13993 on the target configuration macros.
13994
13995 Short structures and unions are those whose size and alignment match
13996 that of some integer type.
13997
13998 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13999 switch is not binary compatible with code compiled with the
14000 @option{-freg-struct-return} switch.
14001 Use it to conform to a non-default application binary interface.
14002
14003 @item -freg-struct-return
14004 @opindex freg-struct-return
14005 Return @code{struct} and @code{union} values in registers when possible.
14006 This is more efficient for small structures than
14007 @option{-fpcc-struct-return}.
14008
14009 If you specify neither @option{-fpcc-struct-return} nor
14010 @option{-freg-struct-return}, GCC defaults to whichever convention is
14011 standard for the target.  If there is no standard convention, GCC
14012 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14013 the principal compiler.  In those cases, we can choose the standard, and
14014 we chose the more efficient register return alternative.
14015
14016 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14017 switch is not binary compatible with code compiled with the
14018 @option{-fpcc-struct-return} switch.
14019 Use it to conform to a non-default application binary interface.
14020
14021 @item -fshort-enums
14022 @opindex fshort-enums
14023 Allocate to an @code{enum} type only as many bytes as it needs for the
14024 declared range of possible values.  Specifically, the @code{enum} type
14025 will be equivalent to the smallest integer type which has enough room.
14026
14027 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14028 code that is not binary compatible with code generated without that switch.
14029 Use it to conform to a non-default application binary interface.
14030
14031 @item -fshort-double
14032 @opindex fshort-double
14033 Use the same size for @code{double} as for @code{float}.
14034
14035 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
14036 code that is not binary compatible with code generated without that switch.
14037 Use it to conform to a non-default application binary interface.
14038
14039 @item -fshort-wchar
14040 @opindex fshort-wchar
14041 Override the underlying type for @samp{wchar_t} to be @samp{short
14042 unsigned int} instead of the default for the target.  This option is
14043 useful for building programs to run under WINE@.
14044
14045 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14046 code that is not binary compatible with code generated without that switch.
14047 Use it to conform to a non-default application binary interface.
14048
14049 @item -fno-common
14050 @opindex fno-common
14051 In C, allocate even uninitialized global variables in the data section of the
14052 object file, rather than generating them as common blocks.  This has the
14053 effect that if the same variable is declared (without @code{extern}) in
14054 two different compilations, you will get an error when you link them.
14055 The only reason this might be useful is if you wish to verify that the
14056 program will work on other systems which always work this way.
14057
14058 @item -fno-ident
14059 @opindex fno-ident
14060 Ignore the @samp{#ident} directive.
14061
14062 @item -finhibit-size-directive
14063 @opindex finhibit-size-directive
14064 Don't output a @code{.size} assembler directive, or anything else that
14065 would cause trouble if the function is split in the middle, and the
14066 two halves are placed at locations far apart in memory.  This option is
14067 used when compiling @file{crtstuff.c}; you should not need to use it
14068 for anything else.
14069
14070 @item -fverbose-asm
14071 @opindex fverbose-asm
14072 Put extra commentary information in the generated assembly code to
14073 make it more readable.  This option is generally only of use to those
14074 who actually need to read the generated assembly code (perhaps while
14075 debugging the compiler itself).
14076
14077 @option{-fno-verbose-asm}, the default, causes the
14078 extra information to be omitted and is useful when comparing two assembler
14079 files.
14080
14081 @item -frecord-gcc-switches
14082 @opindex frecord-gcc-switches
14083 This switch causes the command line that was used to invoke the
14084 compiler to be recorded into the object file that is being created.
14085 This switch is only implemented on some targets and the exact format
14086 of the recording is target and binary file format dependent, but it
14087 usually takes the form of a section containing ASCII text.  This
14088 switch is related to the @option{-fverbose-asm} switch, but that
14089 switch only records information in the assembler output file as
14090 comments, so it never reaches the object file.
14091
14092 @item -fpic
14093 @opindex fpic
14094 @cindex global offset table
14095 @cindex PIC
14096 Generate position-independent code (PIC) suitable for use in a shared
14097 library, if supported for the target machine.  Such code accesses all
14098 constant addresses through a global offset table (GOT)@.  The dynamic
14099 loader resolves the GOT entries when the program starts (the dynamic
14100 loader is not part of GCC; it is part of the operating system).  If
14101 the GOT size for the linked executable exceeds a machine-specific
14102 maximum size, you get an error message from the linker indicating that
14103 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14104 instead.  (These maximums are 8k on the SPARC and 32k
14105 on the m68k and RS/6000.  The 386 has no such limit.)
14106
14107 Position-independent code requires special support, and therefore works
14108 only on certain machines.  For the 386, GCC supports PIC for System V
14109 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14110 position-independent.
14111
14112 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14113 are defined to 1.
14114
14115 @item -fPIC
14116 @opindex fPIC
14117 If supported for the target machine, emit position-independent code,
14118 suitable for dynamic linking and avoiding any limit on the size of the
14119 global offset table.  This option makes a difference on the m68k,
14120 PowerPC and SPARC@.
14121
14122 Position-independent code requires special support, and therefore works
14123 only on certain machines.
14124
14125 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14126 are defined to 2.
14127
14128 @item -fpie
14129 @itemx -fPIE
14130 @opindex fpie
14131 @opindex fPIE
14132 These options are similar to @option{-fpic} and @option{-fPIC}, but
14133 generated position independent code can be only linked into executables.
14134 Usually these options are used when @option{-pie} GCC option will be
14135 used during linking.
14136
14137 @item -fno-jump-tables
14138 @opindex fno-jump-tables
14139 Do not use jump tables for switch statements even where it would be
14140 more efficient than other code generation strategies.  This option is
14141 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14142 building code which forms part of a dynamic linker and cannot
14143 reference the address of a jump table.  On some targets, jump tables
14144 do not require a GOT and this option is not needed.
14145
14146 @item -ffixed-@var{reg}
14147 @opindex ffixed
14148 Treat the register named @var{reg} as a fixed register; generated code
14149 should never refer to it (except perhaps as a stack pointer, frame
14150 pointer or in some other fixed role).
14151
14152 @var{reg} must be the name of a register.  The register names accepted
14153 are machine-specific and are defined in the @code{REGISTER_NAMES}
14154 macro in the machine description macro file.
14155
14156 This flag does not have a negative form, because it specifies a
14157 three-way choice.
14158
14159 @item -fcall-used-@var{reg}
14160 @opindex fcall-used
14161 Treat the register named @var{reg} as an allocable register that is
14162 clobbered by function calls.  It may be allocated for temporaries or
14163 variables that do not live across a call.  Functions compiled this way
14164 will not save and restore the register @var{reg}.
14165
14166 It is an error to used this flag with the frame pointer or stack pointer.
14167 Use of this flag for other registers that have fixed pervasive roles in
14168 the machine's execution model will produce disastrous results.
14169
14170 This flag does not have a negative form, because it specifies a
14171 three-way choice.
14172
14173 @item -fcall-saved-@var{reg}
14174 @opindex fcall-saved
14175 Treat the register named @var{reg} as an allocable register saved by
14176 functions.  It may be allocated even for temporaries or variables that
14177 live across a call.  Functions compiled this way will save and restore
14178 the register @var{reg} if they use it.
14179
14180 It is an error to used this flag with the frame pointer or stack pointer.
14181 Use of this flag for other registers that have fixed pervasive roles in
14182 the machine's execution model will produce disastrous results.
14183
14184 A different sort of disaster will result from the use of this flag for
14185 a register in which function values may be returned.
14186
14187 This flag does not have a negative form, because it specifies a
14188 three-way choice.
14189
14190 @item -fpack-struct[=@var{n}]
14191 @opindex fpack-struct
14192 Without a value specified, pack all structure members together without
14193 holes.  When a value is specified (which must be a small power of two), pack
14194 structure members according to this value, representing the maximum
14195 alignment (that is, objects with default alignment requirements larger than
14196 this will be output potentially unaligned at the next fitting location.
14197
14198 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14199 code that is not binary compatible with code generated without that switch.
14200 Additionally, it makes the code suboptimal.
14201 Use it to conform to a non-default application binary interface.
14202
14203 @item -finstrument-functions
14204 @opindex finstrument-functions
14205 Generate instrumentation calls for entry and exit to functions.  Just
14206 after function entry and just before function exit, the following
14207 profiling functions will be called with the address of the current
14208 function and its call site.  (On some platforms,
14209 @code{__builtin_return_address} does not work beyond the current
14210 function, so the call site information may not be available to the
14211 profiling functions otherwise.)
14212
14213 @smallexample
14214 void __cyg_profile_func_enter (void *this_fn,
14215                                void *call_site);
14216 void __cyg_profile_func_exit  (void *this_fn,
14217                                void *call_site);
14218 @end smallexample
14219
14220 The first argument is the address of the start of the current function,
14221 which may be looked up exactly in the symbol table.
14222
14223 This instrumentation is also done for functions expanded inline in other
14224 functions.  The profiling calls will indicate where, conceptually, the
14225 inline function is entered and exited.  This means that addressable
14226 versions of such functions must be available.  If all your uses of a
14227 function are expanded inline, this may mean an additional expansion of
14228 code size.  If you use @samp{extern inline} in your C code, an
14229 addressable version of such functions must be provided.  (This is
14230 normally the case anyways, but if you get lucky and the optimizer always
14231 expands the functions inline, you might have gotten away without
14232 providing static copies.)
14233
14234 A function may be given the attribute @code{no_instrument_function}, in
14235 which case this instrumentation will not be done.  This can be used, for
14236 example, for the profiling functions listed above, high-priority
14237 interrupt routines, and any functions from which the profiling functions
14238 cannot safely be called (perhaps signal handlers, if the profiling
14239 routines generate output or allocate memory).
14240
14241 @item -fstack-check
14242 @opindex fstack-check
14243 Generate code to verify that you do not go beyond the boundary of the
14244 stack.  You should specify this flag if you are running in an
14245 environment with multiple threads, but only rarely need to specify it in
14246 a single-threaded environment since stack overflow is automatically
14247 detected on nearly all systems if there is only one stack.
14248
14249 Note that this switch does not actually cause checking to be done; the
14250 operating system must do that.  The switch causes generation of code
14251 to ensure that the operating system sees the stack being extended.
14252
14253 @item -fstack-limit-register=@var{reg}
14254 @itemx -fstack-limit-symbol=@var{sym}
14255 @itemx -fno-stack-limit
14256 @opindex fstack-limit-register
14257 @opindex fstack-limit-symbol
14258 @opindex fno-stack-limit
14259 Generate code to ensure that the stack does not grow beyond a certain value,
14260 either the value of a register or the address of a symbol.  If the stack
14261 would grow beyond the value, a signal is raised.  For most targets,
14262 the signal is raised before the stack overruns the boundary, so
14263 it is possible to catch the signal without taking special precautions.
14264
14265 For instance, if the stack starts at absolute address @samp{0x80000000}
14266 and grows downwards, you can use the flags
14267 @option{-fstack-limit-symbol=__stack_limit} and
14268 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
14269 of 128KB@.  Note that this may only work with the GNU linker.
14270
14271 @cindex aliasing of parameters
14272 @cindex parameters, aliased
14273 @item -fargument-alias
14274 @itemx -fargument-noalias
14275 @itemx -fargument-noalias-global
14276 @itemx -fargument-noalias-anything
14277 @opindex fargument-alias
14278 @opindex fargument-noalias
14279 @opindex fargument-noalias-global
14280 @opindex fargument-noalias-anything
14281 Specify the possible relationships among parameters and between
14282 parameters and global data.
14283
14284 @option{-fargument-alias} specifies that arguments (parameters) may
14285 alias each other and may alias global storage.@*
14286 @option{-fargument-noalias} specifies that arguments do not alias
14287 each other, but may alias global storage.@*
14288 @option{-fargument-noalias-global} specifies that arguments do not
14289 alias each other and do not alias global storage.
14290 @option{-fargument-noalias-anything} specifies that arguments do not
14291 alias any other storage.
14292
14293 Each language will automatically use whatever option is required by
14294 the language standard.  You should not need to use these options yourself.
14295
14296 @item -fleading-underscore
14297 @opindex fleading-underscore
14298 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
14299 change the way C symbols are represented in the object file.  One use
14300 is to help link with legacy assembly code.
14301
14302 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
14303 generate code that is not binary compatible with code generated without that
14304 switch.  Use it to conform to a non-default application binary interface.
14305 Not all targets provide complete support for this switch.
14306
14307 @item -ftls-model=@var{model}
14308 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
14309 The @var{model} argument should be one of @code{global-dynamic},
14310 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
14311
14312 The default without @option{-fpic} is @code{initial-exec}; with
14313 @option{-fpic} the default is @code{global-dynamic}.
14314
14315 @item -fvisibility=@var{default|internal|hidden|protected}
14316 @opindex fvisibility
14317 Set the default ELF image symbol visibility to the specified option---all
14318 symbols will be marked with this unless overridden within the code.
14319 Using this feature can very substantially improve linking and
14320 load times of shared object libraries, produce more optimized
14321 code, provide near-perfect API export and prevent symbol clashes.
14322 It is @strong{strongly} recommended that you use this in any shared objects
14323 you distribute.
14324
14325 Despite the nomenclature, @code{default} always means public ie;
14326 available to be linked against from outside the shared object.
14327 @code{protected} and @code{internal} are pretty useless in real-world
14328 usage so the only other commonly used option will be @code{hidden}.
14329 The default if @option{-fvisibility} isn't specified is
14330 @code{default}, i.e., make every
14331 symbol public---this causes the same behavior as previous versions of
14332 GCC@.
14333
14334 A good explanation of the benefits offered by ensuring ELF
14335 symbols have the correct visibility is given by ``How To Write
14336 Shared Libraries'' by Ulrich Drepper (which can be found at
14337 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
14338 solution made possible by this option to marking things hidden when
14339 the default is public is to make the default hidden and mark things
14340 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
14341 and @code{__attribute__ ((visibility("default")))} instead of
14342 @code{__declspec(dllexport)} you get almost identical semantics with
14343 identical syntax.  This is a great boon to those working with
14344 cross-platform projects.
14345
14346 For those adding visibility support to existing code, you may find
14347 @samp{#pragma GCC visibility} of use.  This works by you enclosing
14348 the declarations you wish to set visibility for with (for example)
14349 @samp{#pragma GCC visibility push(hidden)} and
14350 @samp{#pragma GCC visibility pop}.
14351 Bear in mind that symbol visibility should be viewed @strong{as
14352 part of the API interface contract} and thus all new code should
14353 always specify visibility when it is not the default ie; declarations
14354 only for use within the local DSO should @strong{always} be marked explicitly
14355 as hidden as so to avoid PLT indirection overheads---making this
14356 abundantly clear also aids readability and self-documentation of the code.
14357 Note that due to ISO C++ specification requirements, operator new and
14358 operator delete must always be of default visibility.
14359
14360 Be aware that headers from outside your project, in particular system
14361 headers and headers from any other library you use, may not be
14362 expecting to be compiled with visibility other than the default.  You
14363 may need to explicitly say @samp{#pragma GCC visibility push(default)}
14364 before including any such headers.
14365
14366 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
14367 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
14368 no modifications.  However, this means that calls to @samp{extern}
14369 functions with no explicit visibility will use the PLT, so it is more
14370 effective to use @samp{__attribute ((visibility))} and/or
14371 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
14372 declarations should be treated as hidden.
14373
14374 Note that @samp{-fvisibility} does affect C++ vague linkage
14375 entities. This means that, for instance, an exception class that will
14376 be thrown between DSOs must be explicitly marked with default
14377 visibility so that the @samp{type_info} nodes will be unified between
14378 the DSOs.
14379
14380 An overview of these techniques, their benefits and how to use them
14381 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
14382
14383 @end table
14384
14385 @c man end
14386
14387 @node Environment Variables
14388 @section Environment Variables Affecting GCC
14389 @cindex environment variables
14390
14391 @c man begin ENVIRONMENT
14392 This section describes several environment variables that affect how GCC
14393 operates.  Some of them work by specifying directories or prefixes to use
14394 when searching for various kinds of files.  Some are used to specify other
14395 aspects of the compilation environment.
14396
14397 Note that you can also specify places to search using options such as
14398 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
14399 take precedence over places specified using environment variables, which
14400 in turn take precedence over those specified by the configuration of GCC@.
14401 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
14402 GNU Compiler Collection (GCC) Internals}.
14403
14404 @table @env
14405 @item LANG
14406 @itemx LC_CTYPE
14407 @c @itemx LC_COLLATE
14408 @itemx LC_MESSAGES
14409 @c @itemx LC_MONETARY
14410 @c @itemx LC_NUMERIC
14411 @c @itemx LC_TIME
14412 @itemx LC_ALL
14413 @findex LANG
14414 @findex LC_CTYPE
14415 @c @findex LC_COLLATE
14416 @findex LC_MESSAGES
14417 @c @findex LC_MONETARY
14418 @c @findex LC_NUMERIC
14419 @c @findex LC_TIME
14420 @findex LC_ALL
14421 @cindex locale
14422 These environment variables control the way that GCC uses
14423 localization information that allow GCC to work with different
14424 national conventions.  GCC inspects the locale categories
14425 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
14426 so.  These locale categories can be set to any value supported by your
14427 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
14428 Kingdom encoded in UTF-8.
14429
14430 The @env{LC_CTYPE} environment variable specifies character
14431 classification.  GCC uses it to determine the character boundaries in
14432 a string; this is needed for some multibyte encodings that contain quote
14433 and escape characters that would otherwise be interpreted as a string
14434 end or escape.
14435
14436 The @env{LC_MESSAGES} environment variable specifies the language to
14437 use in diagnostic messages.
14438
14439 If the @env{LC_ALL} environment variable is set, it overrides the value
14440 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
14441 and @env{LC_MESSAGES} default to the value of the @env{LANG}
14442 environment variable.  If none of these variables are set, GCC
14443 defaults to traditional C English behavior.
14444
14445 @item TMPDIR
14446 @findex TMPDIR
14447 If @env{TMPDIR} is set, it specifies the directory to use for temporary
14448 files.  GCC uses temporary files to hold the output of one stage of
14449 compilation which is to be used as input to the next stage: for example,
14450 the output of the preprocessor, which is the input to the compiler
14451 proper.
14452
14453 @item GCC_EXEC_PREFIX
14454 @findex GCC_EXEC_PREFIX
14455 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
14456 names of the subprograms executed by the compiler.  No slash is added
14457 when this prefix is combined with the name of a subprogram, but you can
14458 specify a prefix that ends with a slash if you wish.
14459
14460 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
14461 an appropriate prefix to use based on the pathname it was invoked with.
14462
14463 If GCC cannot find the subprogram using the specified prefix, it
14464 tries looking in the usual places for the subprogram.
14465
14466 The default value of @env{GCC_EXEC_PREFIX} is
14467 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
14468 the installed compiler. In many cases @var{prefix} is the value
14469 of @code{prefix} when you ran the @file{configure} script.
14470
14471 Other prefixes specified with @option{-B} take precedence over this prefix.
14472
14473 This prefix is also used for finding files such as @file{crt0.o} that are
14474 used for linking.
14475
14476 In addition, the prefix is used in an unusual way in finding the
14477 directories to search for header files.  For each of the standard
14478 directories whose name normally begins with @samp{/usr/local/lib/gcc}
14479 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
14480 replacing that beginning with the specified prefix to produce an
14481 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
14482 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
14483 These alternate directories are searched first; the standard directories
14484 come next. If a standard directory begins with the configured 
14485 @var{prefix} then the value of @var{prefix} is replaced by 
14486 @env{GCC_EXEC_PREFIX} when looking for header files.
14487
14488 @item COMPILER_PATH
14489 @findex COMPILER_PATH
14490 The value of @env{COMPILER_PATH} is a colon-separated list of
14491 directories, much like @env{PATH}.  GCC tries the directories thus
14492 specified when searching for subprograms, if it can't find the
14493 subprograms using @env{GCC_EXEC_PREFIX}.
14494
14495 @item LIBRARY_PATH
14496 @findex LIBRARY_PATH
14497 The value of @env{LIBRARY_PATH} is a colon-separated list of
14498 directories, much like @env{PATH}.  When configured as a native compiler,
14499 GCC tries the directories thus specified when searching for special
14500 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
14501 using GCC also uses these directories when searching for ordinary
14502 libraries for the @option{-l} option (but directories specified with
14503 @option{-L} come first).
14504
14505 @item LANG
14506 @findex LANG
14507 @cindex locale definition
14508 This variable is used to pass locale information to the compiler.  One way in
14509 which this information is used is to determine the character set to be used
14510 when character literals, string literals and comments are parsed in C and C++.
14511 When the compiler is configured to allow multibyte characters,
14512 the following values for @env{LANG} are recognized:
14513
14514 @table @samp
14515 @item C-JIS
14516 Recognize JIS characters.
14517 @item C-SJIS
14518 Recognize SJIS characters.
14519 @item C-EUCJP
14520 Recognize EUCJP characters.
14521 @end table
14522
14523 If @env{LANG} is not defined, or if it has some other value, then the
14524 compiler will use mblen and mbtowc as defined by the default locale to
14525 recognize and translate multibyte characters.
14526 @end table
14527
14528 @noindent
14529 Some additional environments variables affect the behavior of the
14530 preprocessor.
14531
14532 @include cppenv.texi
14533
14534 @c man end
14535
14536 @node Precompiled Headers
14537 @section Using Precompiled Headers
14538 @cindex precompiled headers
14539 @cindex speed of compilation
14540
14541 Often large projects have many header files that are included in every
14542 source file.  The time the compiler takes to process these header files
14543 over and over again can account for nearly all of the time required to
14544 build the project.  To make builds faster, GCC allows users to
14545 `precompile' a header file; then, if builds can use the precompiled
14546 header file they will be much faster.
14547
14548 To create a precompiled header file, simply compile it as you would any
14549 other file, if necessary using the @option{-x} option to make the driver
14550 treat it as a C or C++ header file.  You will probably want to use a
14551 tool like @command{make} to keep the precompiled header up-to-date when
14552 the headers it contains change.
14553
14554 A precompiled header file will be searched for when @code{#include} is
14555 seen in the compilation.  As it searches for the included file
14556 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
14557 compiler looks for a precompiled header in each directory just before it
14558 looks for the include file in that directory.  The name searched for is
14559 the name specified in the @code{#include} with @samp{.gch} appended.  If
14560 the precompiled header file can't be used, it is ignored.
14561
14562 For instance, if you have @code{#include "all.h"}, and you have
14563 @file{all.h.gch} in the same directory as @file{all.h}, then the
14564 precompiled header file will be used if possible, and the original
14565 header will be used otherwise.
14566
14567 Alternatively, you might decide to put the precompiled header file in a
14568 directory and use @option{-I} to ensure that directory is searched
14569 before (or instead of) the directory containing the original header.
14570 Then, if you want to check that the precompiled header file is always
14571 used, you can put a file of the same name as the original header in this
14572 directory containing an @code{#error} command.
14573
14574 This also works with @option{-include}.  So yet another way to use
14575 precompiled headers, good for projects not designed with precompiled
14576 header files in mind, is to simply take most of the header files used by
14577 a project, include them from another header file, precompile that header
14578 file, and @option{-include} the precompiled header.  If the header files
14579 have guards against multiple inclusion, they will be skipped because
14580 they've already been included (in the precompiled header).
14581
14582 If you need to precompile the same header file for different
14583 languages, targets, or compiler options, you can instead make a
14584 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14585 header in the directory, perhaps using @option{-o}.  It doesn't matter
14586 what you call the files in the directory, every precompiled header in
14587 the directory will be considered.  The first precompiled header
14588 encountered in the directory that is valid for this compilation will
14589 be used; they're searched in no particular order.
14590
14591 There are many other possibilities, limited only by your imagination,
14592 good sense, and the constraints of your build system.
14593
14594 A precompiled header file can be used only when these conditions apply:
14595
14596 @itemize
14597 @item
14598 Only one precompiled header can be used in a particular compilation.
14599
14600 @item
14601 A precompiled header can't be used once the first C token is seen.  You
14602 can have preprocessor directives before a precompiled header; you can
14603 even include a precompiled header from inside another header, so long as
14604 there are no C tokens before the @code{#include}.
14605
14606 @item
14607 The precompiled header file must be produced for the same language as
14608 the current compilation.  You can't use a C precompiled header for a C++
14609 compilation.
14610
14611 @item
14612 The precompiled header file must have been produced by the same compiler
14613 binary as the current compilation is using.
14614
14615 @item
14616 Any macros defined before the precompiled header is included must
14617 either be defined in the same way as when the precompiled header was
14618 generated, or must not affect the precompiled header, which usually
14619 means that they don't appear in the precompiled header at all.
14620
14621 The @option{-D} option is one way to define a macro before a
14622 precompiled header is included; using a @code{#define} can also do it.
14623 There are also some options that define macros implicitly, like
14624 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14625 defined this way.
14626
14627 @item If debugging information is output when using the precompiled
14628 header, using @option{-g} or similar, the same kind of debugging information
14629 must have been output when building the precompiled header.  However,
14630 a precompiled header built using @option{-g} can be used in a compilation
14631 when no debugging information is being output.
14632
14633 @item The same @option{-m} options must generally be used when building
14634 and using the precompiled header.  @xref{Submodel Options},
14635 for any cases where this rule is relaxed.
14636
14637 @item Each of the following options must be the same when building and using
14638 the precompiled header:
14639
14640 @gccoptlist{-fexceptions -funit-at-a-time}
14641
14642 @item
14643 Some other command-line options starting with @option{-f},
14644 @option{-p}, or @option{-O} must be defined in the same way as when
14645 the precompiled header was generated.  At present, it's not clear
14646 which options are safe to change and which are not; the safest choice
14647 is to use exactly the same options when generating and using the
14648 precompiled header.  The following are known to be safe:
14649
14650 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
14651 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
14652 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
14653 -pedantic-errors}
14654
14655 @end itemize
14656
14657 For all of these except the last, the compiler will automatically
14658 ignore the precompiled header if the conditions aren't met.  If you
14659 find an option combination that doesn't work and doesn't cause the
14660 precompiled header to be ignored, please consider filing a bug report,
14661 see @ref{Bugs}.
14662
14663 If you do use differing options when generating and using the
14664 precompiled header, the actual behavior will be a mixture of the
14665 behavior for the options.  For instance, if you use @option{-g} to
14666 generate the precompiled header but not when using it, you may or may
14667 not get debugging information for routines in the precompiled header.
14668
14669 @node Running Protoize
14670 @section Running Protoize
14671
14672 The program @code{protoize} is an optional part of GCC@.  You can use
14673 it to add prototypes to a program, thus converting the program to ISO
14674 C in one respect.  The companion program @code{unprotoize} does the
14675 reverse: it removes argument types from any prototypes that are found.
14676
14677 When you run these programs, you must specify a set of source files as
14678 command line arguments.  The conversion programs start out by compiling
14679 these files to see what functions they define.  The information gathered
14680 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
14681
14682 After scanning comes actual conversion.  The specified files are all
14683 eligible to be converted; any files they include (whether sources or
14684 just headers) are eligible as well.
14685
14686 But not all the eligible files are converted.  By default,
14687 @code{protoize} and @code{unprotoize} convert only source and header
14688 files in the current directory.  You can specify additional directories
14689 whose files should be converted with the @option{-d @var{directory}}
14690 option.  You can also specify particular files to exclude with the
14691 @option{-x @var{file}} option.  A file is converted if it is eligible, its
14692 directory name matches one of the specified directory names, and its
14693 name within the directory has not been excluded.
14694
14695 Basic conversion with @code{protoize} consists of rewriting most
14696 function definitions and function declarations to specify the types of
14697 the arguments.  The only ones not rewritten are those for varargs
14698 functions.
14699
14700 @code{protoize} optionally inserts prototype declarations at the
14701 beginning of the source file, to make them available for any calls that
14702 precede the function's definition.  Or it can insert prototype
14703 declarations with block scope in the blocks where undeclared functions
14704 are called.
14705
14706 Basic conversion with @code{unprotoize} consists of rewriting most
14707 function declarations to remove any argument types, and rewriting
14708 function definitions to the old-style pre-ISO form.
14709
14710 Both conversion programs print a warning for any function declaration or
14711 definition that they can't convert.  You can suppress these warnings
14712 with @option{-q}.
14713
14714 The output from @code{protoize} or @code{unprotoize} replaces the
14715 original source file.  The original file is renamed to a name ending
14716 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
14717 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
14718 for DOS) file already exists, then the source file is simply discarded.
14719
14720 @code{protoize} and @code{unprotoize} both depend on GCC itself to
14721 scan the program and collect information about the functions it uses.
14722 So neither of these programs will work until GCC is installed.
14723
14724 Here is a table of the options you can use with @code{protoize} and
14725 @code{unprotoize}.  Each option works with both programs unless
14726 otherwise stated.
14727
14728 @table @code
14729 @item -B @var{directory}
14730 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
14731 usual directory (normally @file{/usr/local/lib}).  This file contains
14732 prototype information about standard system functions.  This option
14733 applies only to @code{protoize}.
14734
14735 @item -c @var{compilation-options}
14736 Use @var{compilation-options} as the options when running @command{gcc} to
14737 produce the @samp{.X} files.  The special option @option{-aux-info} is
14738 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
14739
14740 Note that the compilation options must be given as a single argument to
14741 @code{protoize} or @code{unprotoize}.  If you want to specify several
14742 @command{gcc} options, you must quote the entire set of compilation options
14743 to make them a single word in the shell.
14744
14745 There are certain @command{gcc} arguments that you cannot use, because they
14746 would produce the wrong kind of output.  These include @option{-g},
14747 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
14748 the @var{compilation-options}, they are ignored.
14749
14750 @item -C
14751 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
14752 systems) instead of @samp{.c}.  This is convenient if you are converting
14753 a C program to C++.  This option applies only to @code{protoize}.
14754
14755 @item -g
14756 Add explicit global declarations.  This means inserting explicit
14757 declarations at the beginning of each source file for each function
14758 that is called in the file and was not declared.  These declarations
14759 precede the first function definition that contains a call to an
14760 undeclared function.  This option applies only to @code{protoize}.
14761
14762 @item -i @var{string}
14763 Indent old-style parameter declarations with the string @var{string}.
14764 This option applies only to @code{protoize}.
14765
14766 @code{unprotoize} converts prototyped function definitions to old-style
14767 function definitions, where the arguments are declared between the
14768 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
14769 uses five spaces as the indentation.  If you want to indent with just
14770 one space instead, use @option{-i " "}.
14771
14772 @item -k
14773 Keep the @samp{.X} files.  Normally, they are deleted after conversion
14774 is finished.
14775
14776 @item -l
14777 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
14778 a prototype declaration for each function in each block which calls the
14779 function without any declaration.  This option applies only to
14780 @code{protoize}.
14781
14782 @item -n
14783 Make no real changes.  This mode just prints information about the conversions
14784 that would have been done without @option{-n}.
14785
14786 @item -N
14787 Make no @samp{.save} files.  The original files are simply deleted.
14788 Use this option with caution.
14789
14790 @item -p @var{program}
14791 Use the program @var{program} as the compiler.  Normally, the name
14792 @file{gcc} is used.
14793
14794 @item -q
14795 Work quietly.  Most warnings are suppressed.
14796
14797 @item -v
14798 Print the version number, just like @option{-v} for @command{gcc}.
14799 @end table
14800
14801 If you need special compiler options to compile one of your program's
14802 source files, then you should generate that file's @samp{.X} file
14803 specially, by running @command{gcc} on that source file with the
14804 appropriate options and the option @option{-aux-info}.  Then run
14805 @code{protoize} on the entire set of files.  @code{protoize} will use
14806 the existing @samp{.X} file because it is newer than the source file.
14807 For example:
14808
14809 @smallexample
14810 gcc -Dfoo=bar file1.c -aux-info file1.X
14811 protoize *.c
14812 @end smallexample
14813
14814 @noindent
14815 You need to include the special files along with the rest in the
14816 @code{protoize} command, even though their @samp{.X} files already
14817 exist, because otherwise they won't get converted.
14818
14819 @xref{Protoize Caveats}, for more information on how to use
14820 @code{protoize} successfully.