OSDN Git Service

* doc/invoke.texi (Optimize Options): Typo fix.
[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 Free Software Foundation, Inc.
3 @c This is part of the GCC manual.
4 @c For copying conditions, see the file gcc.texi.
5
6 @ignore
7 @c man begin INCLUDE
8 @include gcc-vers.texi
9 @c man end
10
11 @c man begin COPYRIGHT
12 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
13 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
14
15 Permission is granted to copy, distribute and/or modify this document
16 under the terms of the GNU Free Documentation License, Version 1.2 or
17 any later version published by the Free Software Foundation; with the
18 Invariant Sections being ``GNU General Public License'' and ``Funding
19 Free Software'', the Front-Cover texts being (a) (see below), and with
20 the Back-Cover Texts being (b) (see below).  A copy of the license is
21 included in the gfdl(7) man page.
22
23 (a) The FSF's Front-Cover Text is:
24
25      A GNU Manual
26
27 (b) The FSF's Back-Cover Text is:
28
29      You have freedom to copy and modify this GNU Manual, like GNU
30      software.  Copies published by the Free Software Foundation raise
31      funds for GNU development.
32 @c man end
33 @c Set file name and title for the man page.
34 @setfilename gcc
35 @settitle GNU project C and C++ compiler
36 @c man begin SYNOPSIS
37 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
38     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
39     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
40     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
41     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
42     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
43     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
44
45 Only the most useful options are listed here; see below for the
46 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
47 @c man end
48 @c man begin SEEALSO
49 gpl(7), gfdl(7), fsf-funding(7),
50 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
51 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
52 @file{ld}, @file{binutils} and @file{gdb}.
53 @c man end
54 @c man begin BUGS
55 For instructions on reporting bugs, see
56 @w{@uref{http://gcc.gnu.org/bugs.html}}.
57 @c man end
58 @c man begin AUTHOR
59 See the Info entry for @command{gcc}, or
60 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
61 for contributors to GCC@.
62 @c man end
63 @end ignore
64
65 @node Invoking GCC
66 @chapter GCC Command Options
67 @cindex GCC command options
68 @cindex command options
69 @cindex options, GCC command
70
71 @c man begin DESCRIPTION
72 When you invoke GCC, it normally does preprocessing, compilation,
73 assembly and linking.  The ``overall options'' allow you to stop this
74 process at an intermediate stage.  For example, the @option{-c} option
75 says not to run the linker.  Then the output consists of object files
76 output by the assembler.
77
78 Other options are passed on to one stage of processing.  Some options
79 control the preprocessor and others the compiler itself.  Yet other
80 options control the assembler and linker; most of these are not
81 documented here, since you rarely need to use any of them.
82
83 @cindex C compilation options
84 Most of the command line options that you can use with GCC are useful
85 for C programs; when an option is only useful with another language
86 (usually C++), the explanation says so explicitly.  If the description
87 for a particular option does not mention a source language, you can use
88 that option with all supported languages.
89
90 @cindex C++ compilation options
91 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
92 options for compiling C++ programs.
93
94 @cindex grouping options
95 @cindex options, grouping
96 The @command{gcc} program accepts options and file names as operands.  Many
97 options have multi-letter names; therefore multiple single-letter options
98 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
99 -r}}.
100
101 @cindex order of options
102 @cindex options, order
103 You can mix options and other arguments.  For the most part, the order
104 you use doesn't matter.  Order does matter when you use several options
105 of the same kind; for example, if you specify @option{-L} more than once,
106 the directories are searched in the order specified.
107
108 Many options have long names starting with @samp{-f} or with
109 @samp{-W}---for example, 
110 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
111 these have both positive and negative forms; the negative form of
112 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
113 only one of these two forms, whichever one is not the default.
114
115 @c man end
116
117 @xref{Option Index}, for an index to GCC's options.
118
119 @menu
120 * Option Summary::      Brief list of all options, without explanations.
121 * Overall Options::     Controlling the kind of output:
122                         an executable, object files, assembler files,
123                         or preprocessed source.
124 * Invoking G++::        Compiling C++ programs.
125 * C Dialect Options::   Controlling the variant of C language compiled.
126 * C++ Dialect Options:: Variations on C++.
127 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
128                         and Objective-C++.
129 * Language Independent Options:: Controlling how diagnostics should be
130                         formatted.
131 * Warning Options::     How picky should the compiler be?
132 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
133 * Optimize Options::    How much optimization?
134 * Preprocessor Options:: Controlling header files and macro definitions.
135                          Also, getting dependency information for Make.
136 * Assembler Options::   Passing options to the assembler.
137 * Link Options::        Specifying libraries and so on.
138 * Directory Options::   Where to find header files and libraries.
139                         Where to find the compiler executable files.
140 * Spec Files::          How to pass switches to sub-processes.
141 * Target Options::      Running a cross-compiler, or an old version of GCC.
142 * Submodel Options::    Specifying minor hardware or convention variations,
143                         such as 68010 vs 68020.
144 * Code Gen Options::    Specifying conventions for function calls, data layout
145                         and register usage.
146 * Environment Variables:: Env vars that affect GCC.
147 * Precompiled Headers:: Compiling a header once, and using it many times.
148 * Running Protoize::    Automatically adding or removing function prototypes.
149 @end menu
150
151 @c man begin OPTIONS
152
153 @node Option Summary
154 @section Option Summary
155
156 Here is a summary of all the options, grouped by type.  Explanations are
157 in the following sections.
158
159 @table @emph
160 @item Overall Options
161 @xref{Overall Options,,Options Controlling the Kind of Output}.
162 @gccoptlist{-c  -S  -E  -o @var{file}  -combine -pipe  -pass-exit-codes  @gol
163 -x @var{language}  -v  -###  --help  --target-help  --version @@@var{file}}
164
165 @item C Language Options
166 @xref{C Dialect Options,,Options Controlling C Dialect}.
167 @gccoptlist{-ansi  -std=@var{standard}  -aux-info @var{filename} @gol
168 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
169 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
170 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
171 -fallow-single-precision  -fcond-mismatch @gol
172 -fsigned-bitfields  -fsigned-char @gol
173 -funsigned-bitfields  -funsigned-char}
174
175 @item C++ Language Options
176 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
177 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
178 -fconserve-space  -ffriend-injection @gol
179 -fno-elide-constructors @gol
180 -fno-enforce-eh-specs @gol
181 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
182 -fno-implicit-templates @gol
183 -fno-implicit-inline-templates @gol
184 -fno-implement-inlines  -fms-extensions @gol
185 -fno-nonansi-builtins  -fno-operator-names @gol
186 -fno-optional-diags  -fpermissive @gol
187 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
188 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
189 -fno-default-inline  -fvisibility-inlines-hidden @gol
190 -Wabi  -Wctor-dtor-privacy @gol
191 -Wnon-virtual-dtor  -Wreorder @gol
192 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
193 -Wno-non-template-friend  -Wold-style-cast @gol
194 -Woverloaded-virtual  -Wno-pmf-conversions @gol
195 -Wsign-promo}
196
197 @item Objective-C and Objective-C++ Language Options
198 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
199 Objective-C and Objective-C++ Dialects}.
200 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
201 -fgnu-runtime  -fnext-runtime @gol
202 -fno-nil-receivers @gol
203 -fobjc-call-cxx-cdtors @gol
204 -fobjc-direct-dispatch @gol
205 -fobjc-exceptions @gol
206 -fobjc-gc @gol
207 -freplace-objc-classes @gol
208 -fzero-link @gol
209 -gen-decls @gol
210 -Wassign-intercept @gol
211 -Wno-protocol  -Wselector @gol
212 -Wstrict-selector-match @gol
213 -Wundeclared-selector}
214
215 @item Language Independent Options
216 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
217 @gccoptlist{-fmessage-length=@var{n}  @gol
218 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
219 -fdiagnostics-show-option}
220
221 @item Warning Options
222 @xref{Warning Options,,Options to Request or Suppress Warnings}.
223 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
224 -w  -Wextra  -Wall  -Waggregate-return -Walways-true -Wno-attributes @gol
225 -Wc++-compat -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment @gol
226 -Wconversion  -Wno-deprecated-declarations @gol
227 -Wdisabled-optimization  -Wno-div-by-zero  @gol
228 -Wempty-body  -Wno-endif-labels @gol
229 -Werror  -Werror-* -Werror-implicit-function-declaration @gol
230 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
231 -Wno-format-extra-args -Wformat-nonliteral @gol
232 -Wformat-security  -Wformat-y2k @gol
233 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
234 -Wimport  -Wno-import  -Winit-self  -Winline @gol
235 -Wno-int-to-pointer-cast @gol
236 -Wno-invalid-offsetof  -Winvalid-pch @gol
237 -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations  -Wlong-long @gol
238 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
239 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
240 -Wmissing-noreturn @gol
241 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
242 -Woverlength-strings  -Wpacked  -Wpadded @gol
243 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
244 -Wredundant-decls @gol
245 -Wreturn-type  -Wsequence-point  -Wshadow @gol
246 -Wsign-compare  -Wstack-protector @gol
247 -Wstrict-aliasing -Wstrict-aliasing=2 @gol
248 -Wstring-literal-comparison @gol
249 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
250 -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
251 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
252 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
253 -Wunused-value  -Wunused-variable  -Wvariadic-macros @gol
254 -Wvolatile-register-var  -Wwrite-strings}
255
256 @item C-only Warning Options
257 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
258 -Wmissing-prototypes  -Wnested-externs  -Wold-style-definition @gol
259 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
260 -Wdeclaration-after-statement -Wpointer-sign}
261
262 @item Debugging Options
263 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
264 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
265 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
266 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
267 -fdump-ipa-all -fdump-ipa-cgraph @gol
268 -fdump-tree-all @gol
269 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
270 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
271 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
272 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
273 -fdump-tree-ch @gol
274 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
275 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
276 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
277 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
278 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
279 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
280 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
281 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
282 -fdump-tree-nrv -fdump-tree-vect @gol
283 -fdump-tree-sink @gol
284 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
285 -fdump-tree-salias @gol
286 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
288 -ftree-vectorizer-verbose=@var{n} @gol
289 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
290 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
291 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
292 -fmem-report -fprofile-arcs @gol
293 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
294 -ftest-coverage  -ftime-report -fvar-tracking @gol
295 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
296 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
297 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
298 -print-multi-directory  -print-multi-lib @gol
299 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
300 -save-temps  -time}
301
302 @item Optimization Options
303 @xref{Optimize Options,,Options that Control Optimization}.
304 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
305 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
306 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
307 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
308 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
309 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
310 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
311 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
312 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
313 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
314 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
315 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
316 -finline-functions  -finline-functions-called-once @gol
317 -finline-limit=@var{n}  -fkeep-inline-functions @gol
318 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
319 -fmodulo-sched -fno-branch-count-reg @gol
320 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
321 -fno-function-cse  -fno-guess-branch-probability @gol
322 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
323 -funsafe-math-optimizations  -funsafe-loop-optimizations  -ffinite-math-only @gol
324 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
325 -fomit-frame-pointer  -foptimize-register-move @gol
326 -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
327 -fprofile-generate -fprofile-use @gol
328 -fregmove  -frename-registers @gol
329 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
330 -frerun-cse-after-loop @gol
331 -frounding-math -frtl-abstract-sequences @gol
332 -fschedule-insns  -fschedule-insns2 @gol
333 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
334 -fsched-spec-load-dangerous  @gol
335 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
336 -fsched2-use-superblocks @gol
337 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
338 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
339 -fstack-protector  -fstack-protector-all @gol
340 -fstrict-aliasing  -ftracer  -fthread-jumps @gol
341 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
342 -fsplit-ivs-in-unroller -funswitch-loops @gol
343 -fvariable-expansion-in-unroller @gol
344 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
345 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
346 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
347 -ftree-ch -ftree-sra -ftree-ter -ftree-lrs -ftree-fre -ftree-vectorize @gol
348 -ftree-vect-loop-version -ftree-salias -fipa-pta -fweb @gol
349 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
350 --param @var{name}=@var{value}
351 -O  -O0  -O1  -O2  -O3  -Os}
352
353 @item Preprocessor Options
354 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
355 @gccoptlist{-A@var{question}=@var{answer} @gol
356 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
357 -C  -dD  -dI  -dM  -dN @gol
358 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
359 -idirafter @var{dir} @gol
360 -include @var{file}  -imacros @var{file} @gol
361 -iprefix @var{file}  -iwithprefix @var{dir} @gol
362 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
363 -imultilib @var{dir} -isysroot @var{dir} @gol
364 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
365 -P  -fworking-directory  -remap @gol
366 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
367 -Xpreprocessor @var{option}}
368
369 @item Assembler Option
370 @xref{Assembler Options,,Passing Options to the Assembler}.
371 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
372
373 @item Linker Options
374 @xref{Link Options,,Options for Linking}.
375 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
376 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
377 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
378 -Wl,@var{option}  -Xlinker @var{option} @gol
379 -u @var{symbol}}
380
381 @item Directory Options
382 @xref{Directory Options,,Options for Directory Search}.
383 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
384 -specs=@var{file}  -I- --sysroot=@var{dir}}
385
386 @item Target Options
387 @c I wrote this xref this way to avoid overfull hbox. -- rms
388 @xref{Target Options}.
389 @gccoptlist{-V @var{version}  -b @var{machine}}
390
391 @item Machine Dependent Options
392 @xref{Submodel Options,,Hardware Models and Configurations}.
393 @c This list is ordered alphanumerically by subsection name.
394 @c Try and put the significant identifier (CPU or system) first,
395 @c so users have a clue at guessing where the ones they want will be.
396
397 @emph{ARC Options}
398 @gccoptlist{-EB  -EL @gol
399 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
400 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
401
402 @emph{ARM Options}
403 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
404 -mabi=@var{name} @gol
405 -mapcs-stack-check  -mno-apcs-stack-check @gol
406 -mapcs-float  -mno-apcs-float @gol
407 -mapcs-reentrant  -mno-apcs-reentrant @gol
408 -msched-prolog  -mno-sched-prolog @gol
409 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
410 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
411 -mthumb-interwork  -mno-thumb-interwork @gol
412 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
413 -mstructure-size-boundary=@var{n} @gol
414 -mabort-on-noreturn @gol
415 -mlong-calls  -mno-long-calls @gol
416 -msingle-pic-base  -mno-single-pic-base @gol
417 -mpic-register=@var{reg} @gol
418 -mnop-fun-dllimport @gol
419 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
420 -mpoke-function-name @gol
421 -mthumb  -marm @gol
422 -mtpcs-frame  -mtpcs-leaf-frame @gol
423 -mcaller-super-interworking  -mcallee-super-interworking @gol
424 -mtp=@var{name}}
425
426 @emph{AVR Options}
427 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
428 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
429
430 @emph{Blackfin Options}
431 @gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol
432 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly @gol
433 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
434 -mno-id-shared-library -mshared-library-id=@var{n} @gol
435 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
436 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls}
437
438 @emph{CRIS Options}
439 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
440 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
441 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
442 -mstack-align  -mdata-align  -mconst-align @gol
443 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
444 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
445 -mmul-bug-workaround  -mno-mul-bug-workaround}
446
447 @emph{CRX Options}
448 @gccoptlist{-mmac -mpush-args}
449
450 @emph{Darwin Options}
451 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
452 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
453 -client_name  -compatibility_version  -current_version @gol
454 -dead_strip @gol
455 -dependency-file  -dylib_file  -dylinker_install_name @gol
456 -dynamic  -dynamiclib  -exported_symbols_list @gol
457 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
458 -force_flat_namespace  -headerpad_max_install_names @gol
459 -image_base  -init  -install_name  -keep_private_externs @gol
460 -multi_module  -multiply_defined  -multiply_defined_unused @gol
461 -noall_load   -no_dead_strip_inits_and_terms @gol
462 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
463 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
464 -private_bundle  -read_only_relocs  -sectalign @gol
465 -sectobjectsymbols  -whyload  -seg1addr @gol
466 -sectcreate  -sectobjectsymbols  -sectorder @gol
467 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
468 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
469 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
470 -single_module  -static  -sub_library  -sub_umbrella @gol
471 -twolevel_namespace  -umbrella  -undefined @gol
472 -unexported_symbols_list  -weak_reference_mismatches @gol
473 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
474 -mkernel -mone-byte-bool}
475
476 @emph{DEC Alpha Options}
477 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
478 -mieee  -mieee-with-inexact  -mieee-conformant @gol
479 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
480 -mtrap-precision=@var{mode}  -mbuild-constants @gol
481 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
482 -mbwx  -mmax  -mfix  -mcix @gol
483 -mfloat-vax  -mfloat-ieee @gol
484 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
485 -msmall-text  -mlarge-text @gol
486 -mmemory-latency=@var{time}}
487
488 @emph{DEC Alpha/VMS Options}
489 @gccoptlist{-mvms-return-codes}
490
491 @emph{FRV Options}
492 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
493 -mhard-float  -msoft-float @gol
494 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
495 -mdouble  -mno-double @gol
496 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
497 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
498 -mlinked-fp  -mlong-calls  -malign-labels @gol
499 -mlibrary-pic  -macc-4  -macc-8 @gol
500 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
501 -moptimize-membar -mno-optimize-membar @gol
502 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
503 -mvliw-branch  -mno-vliw-branch @gol
504 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
505 -mno-nested-cond-exec  -mtomcat-stats @gol
506 -mTLS -mtls @gol
507 -mcpu=@var{cpu}}
508
509 @emph{GNU/Linux Options}
510 @gccoptlist{-muclibc}
511
512 @emph{H8/300 Options}
513 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
514
515 @emph{HPPA Options}
516 @gccoptlist{-march=@var{architecture-type} @gol
517 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
518 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
519 -mfixed-range=@var{register-range} @gol
520 -mjump-in-delay -mlinker-opt -mlong-calls @gol
521 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
522 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
523 -mno-jump-in-delay  -mno-long-load-store @gol
524 -mno-portable-runtime  -mno-soft-float @gol
525 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
526 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
527 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
528 -munix=@var{unix-std}  -nolibdld  -static  -threads}
529
530 @emph{i386 and x86-64 Options}
531 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
532 -mfpmath=@var{unit} @gol
533 -masm=@var{dialect}  -mno-fancy-math-387 @gol
534 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
535 -mno-wide-multiply  -mrtd  -malign-double @gol
536 -mpreferred-stack-boundary=@var{num} @gol
537 -mmmx  -msse  -msse2 -msse3 -mssse3 -m3dnow @gol
538 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
539 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
540 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
541 -mstackrealign @gol
542 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
543 -mcmodel=@var{code-model} @gol
544 -m32  -m64 -mlarge-data-threshold=@var{num}}
545
546 @emph{IA-64 Options}
547 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
548 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
549 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
550 -minline-float-divide-max-throughput @gol
551 -minline-int-divide-min-latency @gol
552 -minline-int-divide-max-throughput  @gol
553 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
554 -mno-dwarf2-asm -mearly-stop-bits @gol
555 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
556 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
557 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
558 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
559 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
560 -mno-sched-prefer-non-data-spec-insns @gol
561 -mno-sched-prefer-non-control-spec-insns @gol
562 -mno-sched-count-spec-in-critical-path}
563
564 @emph{M32R/D Options}
565 @gccoptlist{-m32r2 -m32rx -m32r @gol
566 -mdebug @gol
567 -malign-loops -mno-align-loops @gol
568 -missue-rate=@var{number} @gol
569 -mbranch-cost=@var{number} @gol
570 -mmodel=@var{code-size-model-type} @gol
571 -msdata=@var{sdata-type} @gol
572 -mno-flush-func -mflush-func=@var{name} @gol
573 -mno-flush-trap -mflush-trap=@var{number} @gol
574 -G @var{num}}
575
576 @emph{M32C Options}
577 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
578
579 @emph{M680x0 Options}
580 @gccoptlist{-m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
581 -m68060  -mcpu32  -m5200  -mcfv4e -m68881  -mbitfield  @gol
582 -mc68000  -mc68020   @gol
583 -mnobitfield  -mrtd  -mshort  -msoft-float  -mpcrel @gol
584 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
585 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
586
587 @emph{M68hc1x Options}
588 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
589 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
590 -msoft-reg-count=@var{count}}
591
592 @emph{MCore Options}
593 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
594 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
595 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
596 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
597 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
598
599 @emph{MIPS Options}
600 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
601 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
602 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
603 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64  @gol
604 -mfp32  -mfp64  -mhard-float  -msoft-float  @gol
605 -msingle-float  -mdouble-float  -mdsp  -mpaired-single  -mips3d @gol
606 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
607 -G@var{num}  -membedded-data  -mno-embedded-data @gol
608 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
609 -msplit-addresses  -mno-split-addresses  @gol
610 -mexplicit-relocs  -mno-explicit-relocs  @gol
611 -mcheck-zero-division  -mno-check-zero-division @gol
612 -mdivide-traps  -mdivide-breaks @gol
613 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
614 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
615 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
616 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130 @gol
617 -mfix-sb1  -mno-fix-sb1 @gol
618 -mflush-func=@var{func}  -mno-flush-func @gol
619 -mbranch-likely  -mno-branch-likely @gol
620 -mfp-exceptions -mno-fp-exceptions @gol
621 -mvr4130-align -mno-vr4130-align}
622
623 @emph{MMIX Options}
624 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
625 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
626 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
627 -mno-base-addresses  -msingle-exit  -mno-single-exit}
628
629 @emph{MN10300 Options}
630 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
631 -mam33  -mno-am33 @gol
632 -mam33-2  -mno-am33-2 @gol
633 -mreturn-pointer-on-d0 @gol
634 -mno-crt0  -mrelax}
635
636 @emph{MT Options}
637 @gccoptlist{-mno-crt0 -mbacc -msim @gol
638 -march=@var{cpu-type} }
639
640 @emph{PDP-11 Options}
641 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
642 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
643 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
644 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
645 -mbranch-expensive  -mbranch-cheap @gol
646 -msplit  -mno-split  -munix-asm  -mdec-asm}
647
648 @emph{PowerPC Options}
649 See RS/6000 and PowerPC Options.
650
651 @emph{RS/6000 and PowerPC Options}
652 @gccoptlist{-mcpu=@var{cpu-type} @gol
653 -mtune=@var{cpu-type} @gol
654 -mpower  -mno-power  -mpower2  -mno-power2 @gol
655 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
656 -maltivec  -mno-altivec @gol
657 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
658 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
659 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
660 -mmfpgpr -mno-mfpgpr @gol
661 -mnew-mnemonics  -mold-mnemonics @gol
662 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
663 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
664 -malign-power  -malign-natural @gol
665 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
666 -mstring  -mno-string  -mupdate  -mno-update @gol
667 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
668 -mstrict-align  -mno-strict-align  -mrelocatable @gol
669 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
670 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
671 -mdynamic-no-pic  -maltivec  -mswdiv @gol
672 -mprioritize-restricted-insns=@var{priority} @gol
673 -msched-costly-dep=@var{dependence_type} @gol
674 -minsert-sched-nops=@var{scheme} @gol
675 -mcall-sysv  -mcall-netbsd @gol
676 -maix-struct-return  -msvr4-struct-return @gol
677 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
678 -misel -mno-isel @gol
679 -misel=yes  -misel=no @gol
680 -mspe -mno-spe @gol
681 -mspe=yes  -mspe=no @gol
682 -mvrsave -mno-vrsave @gol
683 -mmulhw -mno-mulhw @gol
684 -mdlmzb -mno-dlmzb @gol
685 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
686 -mprototype  -mno-prototype @gol
687 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
688 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
689
690 @emph{S/390 and zSeries Options}
691 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
692 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
693 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
694 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
695 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
696 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
697 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
698
699 @emph{Score Options}
700 @gccoptlist{-mel -mel @gol
701 -mmac @gol
702 -mscore5u -mscore7}
703  
704 @emph{SH Options}
705 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
706 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
707 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
708 -m5-64media  -m5-64media-nofpu @gol
709 -m5-32media  -m5-32media-nofpu @gol
710 -m5-compact  -m5-compact-nofpu @gol
711 -mb  -ml  -mdalign  -mrelax @gol
712 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
713 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
714 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
715 -mdivsi3_libfunc=@var{name}  @gol
716 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
717  -minvalid-symbols}
718
719 @emph{SPARC Options}
720 @gccoptlist{-mcpu=@var{cpu-type} @gol
721 -mtune=@var{cpu-type} @gol
722 -mcmodel=@var{code-model} @gol
723 -m32  -m64  -mapp-regs  -mno-app-regs @gol
724 -mfaster-structs  -mno-faster-structs @gol
725 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
726 -mhard-quad-float  -msoft-quad-float @gol
727 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
728 -mstack-bias  -mno-stack-bias @gol
729 -munaligned-doubles  -mno-unaligned-doubles @gol
730 -mv8plus  -mno-v8plus  -mvis  -mno-vis
731 -threads -pthreads -pthread}
732
733 @emph{SPU Options}
734 @gccoptlist{-mwarn-reloc -merror-reloc @gol
735 -msafe-dma -munsafe-dma @gol
736 -mbranch-hints @gol
737 -msmall-mem -mlarge-mem -mstdmain @gol
738 -mfixed-range=@var{register-range}}
739
740 @emph{System V Options}
741 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
742
743 @emph{TMS320C3x/C4x Options}
744 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
745 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
746 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
747 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
748
749 @emph{V850 Options}
750 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
751 -mprolog-function  -mno-prolog-function  -mspace @gol
752 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
753 -mapp-regs  -mno-app-regs @gol
754 -mdisable-callt  -mno-disable-callt @gol
755 -mv850e1 @gol
756 -mv850e @gol
757 -mv850  -mbig-switch}
758
759 @emph{VAX Options}
760 @gccoptlist{-mg  -mgnu  -munix}
761
762 @emph{x86-64 Options}
763 See i386 and x86-64 Options.
764
765 @emph{Xstormy16 Options}
766 @gccoptlist{-msim}
767
768 @emph{Xtensa Options}
769 @gccoptlist{-mconst16 -mno-const16 @gol
770 -mfused-madd  -mno-fused-madd @gol
771 -mtext-section-literals  -mno-text-section-literals @gol
772 -mtarget-align  -mno-target-align @gol
773 -mlongcalls  -mno-longcalls}
774
775 @emph{zSeries Options}
776 See S/390 and zSeries Options.
777
778 @item Code Generation Options
779 @xref{Code Gen Options,,Options for Code Generation Conventions}.
780 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
781 -ffixed-@var{reg}  -fexceptions @gol
782 -fnon-call-exceptions  -funwind-tables @gol
783 -fasynchronous-unwind-tables @gol
784 -finhibit-size-directive  -finstrument-functions @gol
785 -fno-common  -fno-ident @gol
786 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
787 -fno-jump-tables @gol
788 -frecord-gcc-switches @gol
789 -freg-struct-return  -fshort-enums @gol
790 -fshort-double  -fshort-wchar @gol
791 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
792 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
793 -fargument-alias  -fargument-noalias @gol
794 -fargument-noalias-global  -fargument-noalias-anything
795 -fleading-underscore  -ftls-model=@var{model} @gol
796 -ftrapv  -fwrapv  -fbounds-check @gol
797 -fvisibility}
798 @end table
799
800 @menu
801 * Overall Options::     Controlling the kind of output:
802                         an executable, object files, assembler files,
803                         or preprocessed source.
804 * C Dialect Options::   Controlling the variant of C language compiled.
805 * C++ Dialect Options:: Variations on C++.
806 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
807                         and Objective-C++.
808 * Language Independent Options:: Controlling how diagnostics should be
809                         formatted.
810 * Warning Options::     How picky should the compiler be?
811 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
812 * Optimize Options::    How much optimization?
813 * Preprocessor Options:: Controlling header files and macro definitions.
814                          Also, getting dependency information for Make.
815 * Assembler Options::   Passing options to the assembler.
816 * Link Options::        Specifying libraries and so on.
817 * Directory Options::   Where to find header files and libraries.
818                         Where to find the compiler executable files.
819 * Spec Files::          How to pass switches to sub-processes.
820 * Target Options::      Running a cross-compiler, or an old version of GCC.
821 @end menu
822
823 @node Overall Options
824 @section Options Controlling the Kind of Output
825
826 Compilation can involve up to four stages: preprocessing, compilation
827 proper, assembly and linking, always in that order.  GCC is capable of
828 preprocessing and compiling several files either into several
829 assembler input files, or into one assembler input file; then each
830 assembler input file produces an object file, and linking combines all
831 the object files (those newly compiled, and those specified as input)
832 into an executable file.
833
834 @cindex file name suffix
835 For any given input file, the file name suffix determines what kind of
836 compilation is done:
837
838 @table @gcctabopt
839 @item @var{file}.c
840 C source code which must be preprocessed.
841
842 @item @var{file}.i
843 C source code which should not be preprocessed.
844
845 @item @var{file}.ii
846 C++ source code which should not be preprocessed.
847
848 @item @var{file}.m
849 Objective-C source code.  Note that you must link with the @file{libobjc}
850 library to make an Objective-C program work.
851
852 @item @var{file}.mi
853 Objective-C source code which should not be preprocessed.
854
855 @item @var{file}.mm
856 @itemx @var{file}.M
857 Objective-C++ source code.  Note that you must link with the @file{libobjc}
858 library to make an Objective-C++ program work.  Note that @samp{.M} refers
859 to a literal capital M@.
860
861 @item @var{file}.mii
862 Objective-C++ source code which should not be preprocessed.
863
864 @item @var{file}.h
865 C, C++, Objective-C or Objective-C++ header file to be turned into a
866 precompiled header.
867
868 @item @var{file}.cc
869 @itemx @var{file}.cp
870 @itemx @var{file}.cxx
871 @itemx @var{file}.cpp
872 @itemx @var{file}.CPP
873 @itemx @var{file}.c++
874 @itemx @var{file}.C
875 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
876 the last two letters must both be literally @samp{x}.  Likewise,
877 @samp{.C} refers to a literal capital C@.
878
879 @item @var{file}.mm
880 @itemx @var{file}.M
881 Objective-C++ source code which must be preprocessed.
882
883 @item @var{file}.mii
884 Objective-C++ source code which should not be preprocessed.
885
886 @item @var{file}.hh
887 @itemx @var{file}.H
888 C++ header file to be turned into a precompiled header.
889
890 @item @var{file}.f
891 @itemx @var{file}.for
892 @itemx @var{file}.FOR
893 Fixed form Fortran source code which should not be preprocessed.
894
895 @item @var{file}.F
896 @itemx @var{file}.fpp
897 @itemx @var{file}.FPP
898 Fixed form Fortran source code which must be preprocessed (with the traditional
899 preprocessor).
900
901 @item @var{file}.f90
902 @itemx @var{file}.f95
903 Free form Fortran source code which should not be preprocessed.
904
905 @item @var{file}.F90
906 @itemx @var{file}.F95
907 Free form Fortran source code which must be preprocessed (with the
908 traditional preprocessor).
909
910 @c FIXME: Descriptions of Java file types.
911 @c @var{file}.java
912 @c @var{file}.class
913 @c @var{file}.zip
914 @c @var{file}.jar
915
916 @item @var{file}.ads
917 Ada source code file which contains a library unit declaration (a
918 declaration of a package, subprogram, or generic, or a generic
919 instantiation), or a library unit renaming declaration (a package,
920 generic, or subprogram renaming declaration).  Such files are also
921 called @dfn{specs}.
922
923 @itemx @var{file}.adb
924 Ada source code file containing a library unit body (a subprogram or
925 package body).  Such files are also called @dfn{bodies}.
926
927 @c GCC also knows about some suffixes for languages not yet included:
928 @c Pascal:
929 @c @var{file}.p
930 @c @var{file}.pas
931 @c Ratfor:
932 @c @var{file}.r
933
934 @item @var{file}.s
935 Assembler code.
936
937 @item @var{file}.S
938 Assembler code which must be preprocessed.
939
940 @item @var{other}
941 An object file to be fed straight into linking.
942 Any file name with no recognized suffix is treated this way.
943 @end table
944
945 @opindex x
946 You can specify the input language explicitly with the @option{-x} option:
947
948 @table @gcctabopt
949 @item -x @var{language}
950 Specify explicitly the @var{language} for the following input files
951 (rather than letting the compiler choose a default based on the file
952 name suffix).  This option applies to all following input files until
953 the next @option{-x} option.  Possible values for @var{language} are:
954 @smallexample
955 c  c-header  c-cpp-output
956 c++  c++-header  c++-cpp-output
957 objective-c  objective-c-header  objective-c-cpp-output
958 objective-c++ objective-c++-header objective-c++-cpp-output
959 assembler  assembler-with-cpp
960 ada
961 f95  f95-cpp-input
962 java
963 treelang
964 @end smallexample
965
966 @item -x none
967 Turn off any specification of a language, so that subsequent files are
968 handled according to their file name suffixes (as they are if @option{-x}
969 has not been used at all).
970
971 @item -pass-exit-codes
972 @opindex pass-exit-codes
973 Normally the @command{gcc} program will exit with the code of 1 if any
974 phase of the compiler returns a non-success return code.  If you specify
975 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
976 numerically highest error produced by any phase that returned an error
977 indication.  The C, C++, and Fortran frontends return 4, if an internal
978 compiler error is encountered.
979 @end table
980
981 If you only want some of the stages of compilation, you can use
982 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
983 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
984 @command{gcc} is to stop.  Note that some combinations (for example,
985 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
986
987 @table @gcctabopt
988 @item -c
989 @opindex c
990 Compile or assemble the source files, but do not link.  The linking
991 stage simply is not done.  The ultimate output is in the form of an
992 object file for each source file.
993
994 By default, the object file name for a source file is made by replacing
995 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
996
997 Unrecognized input files, not requiring compilation or assembly, are
998 ignored.
999
1000 @item -S
1001 @opindex S
1002 Stop after the stage of compilation proper; do not assemble.  The output
1003 is in the form of an assembler code file for each non-assembler input
1004 file specified.
1005
1006 By default, the assembler file name for a source file is made by
1007 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1008
1009 Input files that don't require compilation are ignored.
1010
1011 @item -E
1012 @opindex E
1013 Stop after the preprocessing stage; do not run the compiler proper.  The
1014 output is in the form of preprocessed source code, which is sent to the
1015 standard output.
1016
1017 Input files which don't require preprocessing are ignored.
1018
1019 @cindex output file option
1020 @item -o @var{file}
1021 @opindex o
1022 Place output in file @var{file}.  This applies regardless to whatever
1023 sort of output is being produced, whether it be an executable file,
1024 an object file, an assembler file or preprocessed C code.
1025
1026 If @option{-o} is not specified, the default is to put an executable
1027 file in @file{a.out}, the object file for
1028 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1029 assembler file in @file{@var{source}.s}, a precompiled header file in
1030 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1031 standard output.
1032
1033 @item -v
1034 @opindex v
1035 Print (on standard error output) the commands executed to run the stages
1036 of compilation.  Also print the version number of the compiler driver
1037 program and of the preprocessor and the compiler proper.
1038
1039 @item -###
1040 @opindex ###
1041 Like @option{-v} except the commands are not executed and all command
1042 arguments are quoted.  This is useful for shell scripts to capture the
1043 driver-generated command lines.
1044
1045 @item -pipe
1046 @opindex pipe
1047 Use pipes rather than temporary files for communication between the
1048 various stages of compilation.  This fails to work on some systems where
1049 the assembler is unable to read from a pipe; but the GNU assembler has
1050 no trouble.
1051
1052 @item -combine
1053 @opindex combine
1054 If you are compiling multiple source files, this option tells the driver
1055 to pass all the source files to the compiler at once (for those
1056 languages for which the compiler can handle this).  This will allow
1057 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1058 language for which this is supported is C@.  If you pass source files for
1059 multiple languages to the driver, using this option, the driver will invoke
1060 the compiler(s) that support IMA once each, passing each compiler all the
1061 source files appropriate for it.  For those languages that do not support
1062 IMA this option will be ignored, and the compiler will be invoked once for
1063 each source file in that language.  If you use this option in conjunction
1064 with @option{-save-temps}, the compiler will generate multiple
1065 pre-processed files
1066 (one for each source file), but only one (combined) @file{.o} or
1067 @file{.s} file.
1068
1069 @item --help
1070 @opindex help
1071 Print (on the standard output) a description of the command line options
1072 understood by @command{gcc}.  If the @option{-v} option is also specified
1073 then @option{--help} will also be passed on to the various processes
1074 invoked by @command{gcc}, so that they can display the command line options
1075 they accept.  If the @option{-Wextra} option is also specified then command
1076 line options which have no documentation associated with them will also
1077 be displayed.
1078
1079 @item --target-help
1080 @opindex target-help
1081 Print (on the standard output) a description of target specific command
1082 line options for each tool.
1083
1084 @item --version
1085 @opindex version
1086 Display the version number and copyrights of the invoked GCC@.
1087
1088 @include @value{srcdir}/../libiberty/at-file.texi
1089 @end table
1090
1091 @node Invoking G++
1092 @section Compiling C++ Programs
1093
1094 @cindex suffixes for C++ source
1095 @cindex C++ source file suffixes
1096 C++ source files conventionally use one of the suffixes @samp{.C},
1097 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1098 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1099 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1100 files with these names and compiles them as C++ programs even if you
1101 call the compiler the same way as for compiling C programs (usually
1102 with the name @command{gcc}).
1103
1104 @findex g++
1105 @findex c++
1106 However, the use of @command{gcc} does not add the C++ library.
1107 @command{g++} is a program that calls GCC and treats @samp{.c},
1108 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1109 files unless @option{-x} is used, and automatically specifies linking
1110 against the C++ library.  This program is also useful when
1111 precompiling a C header file with a @samp{.h} extension for use in C++
1112 compilations.  On many systems, @command{g++} is also installed with
1113 the name @command{c++}.
1114
1115 @cindex invoking @command{g++}
1116 When you compile C++ programs, you may specify many of the same
1117 command-line options that you use for compiling programs in any
1118 language; or command-line options meaningful for C and related
1119 languages; or options that are meaningful only for C++ programs.
1120 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1121 explanations of options for languages related to C@.
1122 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1123 explanations of options that are meaningful only for C++ programs.
1124
1125 @node C Dialect Options
1126 @section Options Controlling C Dialect
1127 @cindex dialect options
1128 @cindex language dialect options
1129 @cindex options, dialect
1130
1131 The following options control the dialect of C (or languages derived
1132 from C, such as C++, Objective-C and Objective-C++) that the compiler
1133 accepts:
1134
1135 @table @gcctabopt
1136 @cindex ANSI support
1137 @cindex ISO support
1138 @item -ansi
1139 @opindex ansi
1140 In C mode, support all ISO C90 programs.  In C++ mode,
1141 remove GNU extensions that conflict with ISO C++.
1142
1143 This turns off certain features of GCC that are incompatible with ISO
1144 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1145 such as the @code{asm} and @code{typeof} keywords, and
1146 predefined macros such as @code{unix} and @code{vax} that identify the
1147 type of system you are using.  It also enables the undesirable and
1148 rarely used ISO trigraph feature.  For the C compiler,
1149 it disables recognition of C++ style @samp{//} comments as well as
1150 the @code{inline} keyword.
1151
1152 The alternate keywords @code{__asm__}, @code{__extension__},
1153 @code{__inline__} and @code{__typeof__} continue to work despite
1154 @option{-ansi}.  You would not want to use them in an ISO C program, of
1155 course, but it is useful to put them in header files that might be included
1156 in compilations done with @option{-ansi}.  Alternate predefined macros
1157 such as @code{__unix__} and @code{__vax__} are also available, with or
1158 without @option{-ansi}.
1159
1160 The @option{-ansi} option does not cause non-ISO programs to be
1161 rejected gratuitously.  For that, @option{-pedantic} is required in
1162 addition to @option{-ansi}.  @xref{Warning Options}.
1163
1164 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1165 option is used.  Some header files may notice this macro and refrain
1166 from declaring certain functions or defining certain macros that the
1167 ISO standard doesn't call for; this is to avoid interfering with any
1168 programs that might use these names for other things.
1169
1170 Functions which would normally be built in but do not have semantics
1171 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1172 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1173 built-in functions provided by GCC}, for details of the functions
1174 affected.
1175
1176 @item -std=
1177 @opindex std
1178 Determine the language standard.  This option is currently only
1179 supported when compiling C or C++.  A value for this option must be
1180 provided; possible values are
1181
1182 @table @samp
1183 @item c89
1184 @itemx iso9899:1990
1185 ISO C90 (same as @option{-ansi}).
1186
1187 @item iso9899:199409
1188 ISO C90 as modified in amendment 1.
1189
1190 @item c99
1191 @itemx c9x
1192 @itemx iso9899:1999
1193 @itemx iso9899:199x
1194 ISO C99.  Note that this standard is not yet fully supported; see
1195 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1196 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1197
1198 @item gnu89
1199 Default, ISO C90 plus GNU extensions (including some C99 features).
1200
1201 @item gnu99
1202 @itemx gnu9x
1203 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1204 this will become the default.  The name @samp{gnu9x} is deprecated.
1205
1206 @item c++98
1207 The 1998 ISO C++ standard plus amendments.
1208
1209 @item gnu++98
1210 The same as @option{-std=c++98} plus GNU extensions.  This is the
1211 default for C++ code.
1212
1213 @item c++0x
1214 The working draft of the upcoming ISO C++0x standard. This option
1215 enables experimental features that are likely to be included in
1216 C++0x. The working draft is constantly changing, and any feature that is
1217 enabled by this flag may be removed from future versions of GCC if it is
1218 not part of the C++0x standard.
1219
1220 @item gnu++0x
1221 The same as @option{-std=c++0x} plus GNU extensions. As with
1222 @option{-std=c++0x}, this option enables experimental features that may
1223 be removed in future versions of GCC.
1224 @end table
1225
1226 Even when this option is not specified, you can still use some of the
1227 features of newer standards in so far as they do not conflict with
1228 previous C standards.  For example, you may use @code{__restrict__} even
1229 when @option{-std=c99} is not specified.
1230
1231 The @option{-std} options specifying some version of ISO C have the same
1232 effects as @option{-ansi}, except that features that were not in ISO C90
1233 but are in the specified version (for example, @samp{//} comments and
1234 the @code{inline} keyword in ISO C99) are not disabled.
1235
1236 @xref{Standards,,Language Standards Supported by GCC}, for details of
1237 these standard versions.
1238
1239 @item -aux-info @var{filename}
1240 @opindex aux-info
1241 Output to the given filename prototyped declarations for all functions
1242 declared and/or defined in a translation unit, including those in header
1243 files.  This option is silently ignored in any language other than C@.
1244
1245 Besides declarations, the file indicates, in comments, the origin of
1246 each declaration (source file and line), whether the declaration was
1247 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1248 @samp{O} for old, respectively, in the first character after the line
1249 number and the colon), and whether it came from a declaration or a
1250 definition (@samp{C} or @samp{F}, respectively, in the following
1251 character).  In the case of function definitions, a K&R-style list of
1252 arguments followed by their declarations is also provided, inside
1253 comments, after the declaration.
1254
1255 @item -fno-asm
1256 @opindex fno-asm
1257 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1258 keyword, so that code can use these words as identifiers.  You can use
1259 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1260 instead.  @option{-ansi} implies @option{-fno-asm}.
1261
1262 In C++, this switch only affects the @code{typeof} keyword, since
1263 @code{asm} and @code{inline} are standard keywords.  You may want to
1264 use the @option{-fno-gnu-keywords} flag instead, which has the same
1265 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1266 switch only affects the @code{asm} and @code{typeof} keywords, since
1267 @code{inline} is a standard keyword in ISO C99.
1268
1269 @item -fno-builtin
1270 @itemx -fno-builtin-@var{function}
1271 @opindex fno-builtin
1272 @cindex built-in functions
1273 Don't recognize built-in functions that do not begin with
1274 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1275 functions provided by GCC}, for details of the functions affected,
1276 including those which are not built-in functions when @option{-ansi} or
1277 @option{-std} options for strict ISO C conformance are used because they
1278 do not have an ISO standard meaning.
1279
1280 GCC normally generates special code to handle certain built-in functions
1281 more efficiently; for instance, calls to @code{alloca} may become single
1282 instructions that adjust the stack directly, and calls to @code{memcpy}
1283 may become inline copy loops.  The resulting code is often both smaller
1284 and faster, but since the function calls no longer appear as such, you
1285 cannot set a breakpoint on those calls, nor can you change the behavior
1286 of the functions by linking with a different library.  In addition,
1287 when a function is recognized as a built-in function, GCC may use
1288 information about that function to warn about problems with calls to
1289 that function, or to generate more efficient code, even if the
1290 resulting code still contains calls to that function.  For example,
1291 warnings are given with @option{-Wformat} for bad calls to
1292 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1293 known not to modify global memory.
1294
1295 With the @option{-fno-builtin-@var{function}} option
1296 only the built-in function @var{function} is
1297 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1298 function is named this is not built-in in this version of GCC, this
1299 option is ignored.  There is no corresponding
1300 @option{-fbuiltin-@var{function}} option; if you wish to enable
1301 built-in functions selectively when using @option{-fno-builtin} or
1302 @option{-ffreestanding}, you may define macros such as:
1303
1304 @smallexample
1305 #define abs(n)          __builtin_abs ((n))
1306 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1307 @end smallexample
1308
1309 @item -fhosted
1310 @opindex fhosted
1311 @cindex hosted environment
1312
1313 Assert that compilation takes place in a hosted environment.  This implies
1314 @option{-fbuiltin}.  A hosted environment is one in which the
1315 entire standard library is available, and in which @code{main} has a return
1316 type of @code{int}.  Examples are nearly everything except a kernel.
1317 This is equivalent to @option{-fno-freestanding}.
1318
1319 @item -ffreestanding
1320 @opindex ffreestanding
1321 @cindex hosted environment
1322
1323 Assert that compilation takes place in a freestanding environment.  This
1324 implies @option{-fno-builtin}.  A freestanding environment
1325 is one in which the standard library may not exist, and program startup may
1326 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1327 This is equivalent to @option{-fno-hosted}.
1328
1329 @xref{Standards,,Language Standards Supported by GCC}, for details of
1330 freestanding and hosted environments.
1331
1332 @item -fopenmp
1333 @opindex fopenmp
1334 @cindex openmp parallel
1335 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1336 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1337 compiler generates parallel code according to the OpenMP Application
1338 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1339
1340 @item -fms-extensions
1341 @opindex fms-extensions
1342 Accept some non-standard constructs used in Microsoft header files.
1343
1344 Some cases of unnamed fields in structures and unions are only
1345 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1346 fields within structs/unions}, for details.
1347
1348 @item -trigraphs
1349 @opindex trigraphs
1350 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1351 options for strict ISO C conformance) implies @option{-trigraphs}.
1352
1353 @item -no-integrated-cpp
1354 @opindex no-integrated-cpp
1355 Performs a compilation in two passes: preprocessing and compiling.  This
1356 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1357 @option{-B} option.  The user supplied compilation step can then add in
1358 an additional preprocessing step after normal preprocessing but before
1359 compiling.  The default is to use the integrated cpp (internal cpp)
1360
1361 The semantics of this option will change if "cc1", "cc1plus", and
1362 "cc1obj" are merged.
1363
1364 @cindex traditional C language
1365 @cindex C language, traditional
1366 @item -traditional
1367 @itemx -traditional-cpp
1368 @opindex traditional-cpp
1369 @opindex traditional
1370 Formerly, these options caused GCC to attempt to emulate a pre-standard
1371 C compiler.  They are now only supported with the @option{-E} switch.
1372 The preprocessor continues to support a pre-standard mode.  See the GNU
1373 CPP manual for details.
1374
1375 @item -fcond-mismatch
1376 @opindex fcond-mismatch
1377 Allow conditional expressions with mismatched types in the second and
1378 third arguments.  The value of such an expression is void.  This option
1379 is not supported for C++.
1380
1381 @item -funsigned-char
1382 @opindex funsigned-char
1383 Let the type @code{char} be unsigned, like @code{unsigned char}.
1384
1385 Each kind of machine has a default for what @code{char} should
1386 be.  It is either like @code{unsigned char} by default or like
1387 @code{signed char} by default.
1388
1389 Ideally, a portable program should always use @code{signed char} or
1390 @code{unsigned char} when it depends on the signedness of an object.
1391 But many programs have been written to use plain @code{char} and
1392 expect it to be signed, or expect it to be unsigned, depending on the
1393 machines they were written for.  This option, and its inverse, let you
1394 make such a program work with the opposite default.
1395
1396 The type @code{char} is always a distinct type from each of
1397 @code{signed char} or @code{unsigned char}, even though its behavior
1398 is always just like one of those two.
1399
1400 @item -fsigned-char
1401 @opindex fsigned-char
1402 Let the type @code{char} be signed, like @code{signed char}.
1403
1404 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1405 the negative form of @option{-funsigned-char}.  Likewise, the option
1406 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1407
1408 @item -fsigned-bitfields
1409 @itemx -funsigned-bitfields
1410 @itemx -fno-signed-bitfields
1411 @itemx -fno-unsigned-bitfields
1412 @opindex fsigned-bitfields
1413 @opindex funsigned-bitfields
1414 @opindex fno-signed-bitfields
1415 @opindex fno-unsigned-bitfields
1416 These options control whether a bit-field is signed or unsigned, when the
1417 declaration does not use either @code{signed} or @code{unsigned}.  By
1418 default, such a bit-field is signed, because this is consistent: the
1419 basic integer types such as @code{int} are signed types.
1420 @end table
1421
1422 @node C++ Dialect Options
1423 @section Options Controlling C++ Dialect
1424
1425 @cindex compiler options, C++
1426 @cindex C++ options, command line
1427 @cindex options, C++
1428 This section describes the command-line options that are only meaningful
1429 for C++ programs; but you can also use most of the GNU compiler options
1430 regardless of what language your program is in.  For example, you
1431 might compile a file @code{firstClass.C} like this:
1432
1433 @smallexample
1434 g++ -g -frepo -O -c firstClass.C
1435 @end smallexample
1436
1437 @noindent
1438 In this example, only @option{-frepo} is an option meant
1439 only for C++ programs; you can use the other options with any
1440 language supported by GCC@.
1441
1442 Here is a list of options that are @emph{only} for compiling C++ programs:
1443
1444 @table @gcctabopt
1445
1446 @item -fabi-version=@var{n}
1447 @opindex fabi-version
1448 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1449 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1450 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1451 the version that conforms most closely to the C++ ABI specification.
1452 Therefore, the ABI obtained using version 0 will change as ABI bugs
1453 are fixed.
1454
1455 The default is version 2.
1456
1457 @item -fno-access-control
1458 @opindex fno-access-control
1459 Turn off all access checking.  This switch is mainly useful for working
1460 around bugs in the access control code.
1461
1462 @item -fcheck-new
1463 @opindex fcheck-new
1464 Check that the pointer returned by @code{operator new} is non-null
1465 before attempting to modify the storage allocated.  This check is
1466 normally unnecessary because the C++ standard specifies that
1467 @code{operator new} will only return @code{0} if it is declared
1468 @samp{throw()}, in which case the compiler will always check the
1469 return value even without this option.  In all other cases, when
1470 @code{operator new} has a non-empty exception specification, memory
1471 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1472 @samp{new (nothrow)}.
1473
1474 @item -fconserve-space
1475 @opindex fconserve-space
1476 Put uninitialized or runtime-initialized global variables into the
1477 common segment, as C does.  This saves space in the executable at the
1478 cost of not diagnosing duplicate definitions.  If you compile with this
1479 flag and your program mysteriously crashes after @code{main()} has
1480 completed, you may have an object that is being destroyed twice because
1481 two definitions were merged.
1482
1483 This option is no longer useful on most targets, now that support has
1484 been added for putting variables into BSS without making them common.
1485
1486 @item -ffriend-injection
1487 @opindex ffriend-injection
1488 Inject friend functions into the enclosing namespace, so that they are
1489 visible outside the scope of the class in which they are declared.
1490 Friend functions were documented to work this way in the old Annotated
1491 C++ Reference Manual, and versions of G++ before 4.1 always worked
1492 that way.  However, in ISO C++ a friend function which is not declared
1493 in an enclosing scope can only be found using argument dependent
1494 lookup.  This option causes friends to be injected as they were in
1495 earlier releases.
1496
1497 This option is for compatibility, and may be removed in a future
1498 release of G++.
1499
1500 @item -fno-elide-constructors
1501 @opindex fno-elide-constructors
1502 The C++ standard allows an implementation to omit creating a temporary
1503 which is only used to initialize another object of the same type.
1504 Specifying this option disables that optimization, and forces G++ to
1505 call the copy constructor in all cases.
1506
1507 @item -fno-enforce-eh-specs
1508 @opindex fno-enforce-eh-specs
1509 Don't generate code to check for violation of exception specifications
1510 at runtime.  This option violates the C++ standard, but may be useful
1511 for reducing code size in production builds, much like defining
1512 @samp{NDEBUG}.  This does not give user code permission to throw
1513 exceptions in violation of the exception specifications; the compiler
1514 will still optimize based on the specifications, so throwing an
1515 unexpected exception will result in undefined behavior.
1516
1517 @item -ffor-scope
1518 @itemx -fno-for-scope
1519 @opindex ffor-scope
1520 @opindex fno-for-scope
1521 If @option{-ffor-scope} is specified, the scope of variables declared in
1522 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1523 as specified by the C++ standard.
1524 If @option{-fno-for-scope} is specified, the scope of variables declared in
1525 a @i{for-init-statement} extends to the end of the enclosing scope,
1526 as was the case in old versions of G++, and other (traditional)
1527 implementations of C++.
1528
1529 The default if neither flag is given to follow the standard,
1530 but to allow and give a warning for old-style code that would
1531 otherwise be invalid, or have different behavior.
1532
1533 @item -fno-gnu-keywords
1534 @opindex fno-gnu-keywords
1535 Do not recognize @code{typeof} as a keyword, so that code can use this
1536 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1537 @option{-ansi} implies @option{-fno-gnu-keywords}.
1538
1539 @item -fno-implicit-templates
1540 @opindex fno-implicit-templates
1541 Never emit code for non-inline templates which are instantiated
1542 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1543 @xref{Template Instantiation}, for more information.
1544
1545 @item -fno-implicit-inline-templates
1546 @opindex fno-implicit-inline-templates
1547 Don't emit code for implicit instantiations of inline templates, either.
1548 The default is to handle inlines differently so that compiles with and
1549 without optimization will need the same set of explicit instantiations.
1550
1551 @item -fno-implement-inlines
1552 @opindex fno-implement-inlines
1553 To save space, do not emit out-of-line copies of inline functions
1554 controlled by @samp{#pragma implementation}.  This will cause linker
1555 errors if these functions are not inlined everywhere they are called.
1556
1557 @item -fms-extensions
1558 @opindex fms-extensions
1559 Disable pedantic warnings about constructs used in MFC, such as implicit
1560 int and getting a pointer to member function via non-standard syntax.
1561
1562 @item -fno-nonansi-builtins
1563 @opindex fno-nonansi-builtins
1564 Disable built-in declarations of functions that are not mandated by
1565 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1566 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1567
1568 @item -fno-operator-names
1569 @opindex fno-operator-names
1570 Do not treat the operator name keywords @code{and}, @code{bitand},
1571 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1572 synonyms as keywords.
1573
1574 @item -fno-optional-diags
1575 @opindex fno-optional-diags
1576 Disable diagnostics that the standard says a compiler does not need to
1577 issue.  Currently, the only such diagnostic issued by G++ is the one for
1578 a name having multiple meanings within a class.
1579
1580 @item -fpermissive
1581 @opindex fpermissive
1582 Downgrade some diagnostics about nonconformant code from errors to
1583 warnings.  Thus, using @option{-fpermissive} will allow some
1584 nonconforming code to compile.
1585
1586 @item -frepo
1587 @opindex frepo
1588 Enable automatic template instantiation at link time.  This option also
1589 implies @option{-fno-implicit-templates}.  @xref{Template
1590 Instantiation}, for more information.
1591
1592 @item -fno-rtti
1593 @opindex fno-rtti
1594 Disable generation of information about every class with virtual
1595 functions for use by the C++ runtime type identification features
1596 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1597 of the language, you can save some space by using this flag.  Note that
1598 exception handling uses the same information, but it will generate it as
1599 needed. The @samp{dynamic_cast} operator can still be used for casts that
1600 do not require runtime type information, i.e. casts to @code{void *} or to
1601 unambiguous base classes.
1602
1603 @item -fstats
1604 @opindex fstats
1605 Emit statistics about front-end processing at the end of the compilation.
1606 This information is generally only useful to the G++ development team.
1607
1608 @item -ftemplate-depth-@var{n}
1609 @opindex ftemplate-depth
1610 Set the maximum instantiation depth for template classes to @var{n}.
1611 A limit on the template instantiation depth is needed to detect
1612 endless recursions during template class instantiation.  ANSI/ISO C++
1613 conforming programs must not rely on a maximum depth greater than 17.
1614
1615 @item -fno-threadsafe-statics
1616 @opindex fno-threadsafe-statics
1617 Do not emit the extra code to use the routines specified in the C++
1618 ABI for thread-safe initialization of local statics.  You can use this
1619 option to reduce code size slightly in code that doesn't need to be
1620 thread-safe.
1621
1622 @item -fuse-cxa-atexit
1623 @opindex fuse-cxa-atexit
1624 Register destructors for objects with static storage duration with the
1625 @code{__cxa_atexit} function rather than the @code{atexit} function.
1626 This option is required for fully standards-compliant handling of static
1627 destructors, but will only work if your C library supports
1628 @code{__cxa_atexit}.
1629
1630 @item -fno-use-cxa-get-exception-ptr
1631 @opindex fno-use-cxa-get-exception-ptr
1632 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1633 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1634 if the runtime routine is not available.
1635
1636 @item -fvisibility-inlines-hidden
1637 @opindex fvisibility-inlines-hidden
1638 This switch declares that the user does not attempt to compare
1639 pointers to inline methods where the addresses of the two functions
1640 were taken in different shared objects.
1641
1642 The effect of this is that GCC may, effectively, mark inline methods with
1643 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1644 appear in the export table of a DSO and do not require a PLT indirection
1645 when used within the DSO@.  Enabling this option can have a dramatic effect
1646 on load and link times of a DSO as it massively reduces the size of the
1647 dynamic export table when the library makes heavy use of templates.
1648
1649 The behaviour of this switch is not quite the same as marking the
1650 methods as hidden directly, because it does not affect static variables
1651 local to the function or cause the compiler to deduce that
1652 the function is defined in only one shared object.
1653
1654 You may mark a method as having a visibility explicitly to negate the
1655 effect of the switch for that method.  For example, if you do want to
1656 compare pointers to a particular inline method, you might mark it as
1657 having default visibility.  Marking the enclosing class with explicit
1658 visibility will have no effect.
1659
1660 Explicitly instantiated inline methods are unaffected by this option
1661 as their linkage might otherwise cross a shared library boundary.
1662 @xref{Template Instantiation}.
1663
1664 @item -fno-weak
1665 @opindex fno-weak
1666 Do not use weak symbol support, even if it is provided by the linker.
1667 By default, G++ will use weak symbols if they are available.  This
1668 option exists only for testing, and should not be used by end-users;
1669 it will result in inferior code and has no benefits.  This option may
1670 be removed in a future release of G++.
1671
1672 @item -nostdinc++
1673 @opindex nostdinc++
1674 Do not search for header files in the standard directories specific to
1675 C++, but do still search the other standard directories.  (This option
1676 is used when building the C++ library.)
1677 @end table
1678
1679 In addition, these optimization, warning, and code generation options
1680 have meanings only for C++ programs:
1681
1682 @table @gcctabopt
1683 @item -fno-default-inline
1684 @opindex fno-default-inline
1685 Do not assume @samp{inline} for functions defined inside a class scope.
1686 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1687 functions will have linkage like inline functions; they just won't be
1688 inlined by default.
1689
1690 @item -Wabi @r{(C++ only)}
1691 @opindex Wabi
1692 Warn when G++ generates code that is probably not compatible with the
1693 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1694 all such cases, there are probably some cases that are not warned about,
1695 even though G++ is generating incompatible code.  There may also be
1696 cases where warnings are emitted even though the code that is generated
1697 will be compatible.
1698
1699 You should rewrite your code to avoid these warnings if you are
1700 concerned about the fact that code generated by G++ may not be binary
1701 compatible with code generated by other compilers.
1702
1703 The known incompatibilities at this point include:
1704
1705 @itemize @bullet
1706
1707 @item
1708 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1709 pack data into the same byte as a base class.  For example:
1710
1711 @smallexample
1712 struct A @{ virtual void f(); int f1 : 1; @};
1713 struct B : public A @{ int f2 : 1; @};
1714 @end smallexample
1715
1716 @noindent
1717 In this case, G++ will place @code{B::f2} into the same byte
1718 as@code{A::f1}; other compilers will not.  You can avoid this problem
1719 by explicitly padding @code{A} so that its size is a multiple of the
1720 byte size on your platform; that will cause G++ and other compilers to
1721 layout @code{B} identically.
1722
1723 @item
1724 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1725 tail padding when laying out virtual bases.  For example:
1726
1727 @smallexample
1728 struct A @{ virtual void f(); char c1; @};
1729 struct B @{ B(); char c2; @};
1730 struct C : public A, public virtual B @{@};
1731 @end smallexample
1732
1733 @noindent
1734 In this case, G++ will not place @code{B} into the tail-padding for
1735 @code{A}; other compilers will.  You can avoid this problem by
1736 explicitly padding @code{A} so that its size is a multiple of its
1737 alignment (ignoring virtual base classes); that will cause G++ and other
1738 compilers to layout @code{C} identically.
1739
1740 @item
1741 Incorrect handling of bit-fields with declared widths greater than that
1742 of their underlying types, when the bit-fields appear in a union.  For
1743 example:
1744
1745 @smallexample
1746 union U @{ int i : 4096; @};
1747 @end smallexample
1748
1749 @noindent
1750 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1751 union too small by the number of bits in an @code{int}.
1752
1753 @item
1754 Empty classes can be placed at incorrect offsets.  For example:
1755
1756 @smallexample
1757 struct A @{@};
1758
1759 struct B @{
1760   A a;
1761   virtual void f ();
1762 @};
1763
1764 struct C : public B, public A @{@};
1765 @end smallexample
1766
1767 @noindent
1768 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1769 it should be placed at offset zero.  G++ mistakenly believes that the
1770 @code{A} data member of @code{B} is already at offset zero.
1771
1772 @item
1773 Names of template functions whose types involve @code{typename} or
1774 template template parameters can be mangled incorrectly.
1775
1776 @smallexample
1777 template <typename Q>
1778 void f(typename Q::X) @{@}
1779
1780 template <template <typename> class Q>
1781 void f(typename Q<int>::X) @{@}
1782 @end smallexample
1783
1784 @noindent
1785 Instantiations of these templates may be mangled incorrectly.
1786
1787 @end itemize
1788
1789 @item -Wctor-dtor-privacy @r{(C++ only)}
1790 @opindex Wctor-dtor-privacy
1791 Warn when a class seems unusable because all the constructors or
1792 destructors in that class are private, and it has neither friends nor
1793 public static member functions.
1794
1795 @item -Wnon-virtual-dtor @r{(C++ only)}
1796 @opindex Wnon-virtual-dtor
1797 Warn when a class appears to be polymorphic, thereby requiring a virtual
1798 destructor, yet it declares a non-virtual one.  This warning is also
1799 enabled if -Weffc++ is specified.
1800
1801 @item -Wreorder @r{(C++ only)}
1802 @opindex Wreorder
1803 @cindex reordering, warning
1804 @cindex warning for reordering of member initializers
1805 Warn when the order of member initializers given in the code does not
1806 match the order in which they must be executed.  For instance:
1807
1808 @smallexample
1809 struct A @{
1810   int i;
1811   int j;
1812   A(): j (0), i (1) @{ @}
1813 @};
1814 @end smallexample
1815
1816 The compiler will rearrange the member initializers for @samp{i}
1817 and @samp{j} to match the declaration order of the members, emitting
1818 a warning to that effect.  This warning is enabled by @option{-Wall}.
1819 @end table
1820
1821 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1822
1823 @table @gcctabopt
1824 @item -Weffc++ @r{(C++ only)}
1825 @opindex Weffc++
1826 Warn about violations of the following style guidelines from Scott Meyers'
1827 @cite{Effective C++} book:
1828
1829 @itemize @bullet
1830 @item
1831 Item 11:  Define a copy constructor and an assignment operator for classes
1832 with dynamically allocated memory.
1833
1834 @item
1835 Item 12:  Prefer initialization to assignment in constructors.
1836
1837 @item
1838 Item 14:  Make destructors virtual in base classes.
1839
1840 @item
1841 Item 15:  Have @code{operator=} return a reference to @code{*this}.
1842
1843 @item
1844 Item 23:  Don't try to return a reference when you must return an object.
1845
1846 @end itemize
1847
1848 Also warn about violations of the following style guidelines from
1849 Scott Meyers' @cite{More Effective C++} book:
1850
1851 @itemize @bullet
1852 @item
1853 Item 6:  Distinguish between prefix and postfix forms of increment and
1854 decrement operators.
1855
1856 @item
1857 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
1858
1859 @end itemize
1860
1861 When selecting this option, be aware that the standard library
1862 headers do not obey all of these guidelines; use @samp{grep -v}
1863 to filter out those warnings.
1864
1865 @item -Wno-deprecated @r{(C++ only)}
1866 @opindex Wno-deprecated
1867 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
1868
1869 @item -Wstrict-null-sentinel @r{(C++ only)}
1870 @opindex Wstrict-null-sentinel
1871 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
1872 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
1873 to @code{__null}.  Although it is a null pointer constant not a null pointer,
1874 it is guaranteed to of the same size as a pointer.  But this use is
1875 not portable across different compilers.
1876
1877 @item -Wno-non-template-friend @r{(C++ only)}
1878 @opindex Wno-non-template-friend
1879 Disable warnings when non-templatized friend functions are declared
1880 within a template.  Since the advent of explicit template specification
1881 support in G++, if the name of the friend is an unqualified-id (i.e.,
1882 @samp{friend foo(int)}), the C++ language specification demands that the
1883 friend declare or define an ordinary, nontemplate function.  (Section
1884 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
1885 could be interpreted as a particular specialization of a templatized
1886 function.  Because this non-conforming behavior is no longer the default
1887 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
1888 check existing code for potential trouble spots and is on by default.
1889 This new compiler behavior can be turned off with
1890 @option{-Wno-non-template-friend} which keeps the conformant compiler code
1891 but disables the helpful warning.
1892
1893 @item -Wold-style-cast @r{(C++ only)}
1894 @opindex Wold-style-cast
1895 Warn if an old-style (C-style) cast to a non-void type is used within
1896 a C++ program.  The new-style casts (@samp{dynamic_cast},
1897 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
1898 less vulnerable to unintended effects and much easier to search for.
1899
1900 @item -Woverloaded-virtual @r{(C++ only)}
1901 @opindex Woverloaded-virtual
1902 @cindex overloaded virtual fn, warning
1903 @cindex warning for overloaded virtual fn
1904 Warn when a function declaration hides virtual functions from a
1905 base class.  For example, in:
1906
1907 @smallexample
1908 struct A @{
1909   virtual void f();
1910 @};
1911
1912 struct B: public A @{
1913   void f(int);
1914 @};
1915 @end smallexample
1916
1917 the @code{A} class version of @code{f} is hidden in @code{B}, and code
1918 like:
1919
1920 @smallexample
1921 B* b;
1922 b->f();
1923 @end smallexample
1924
1925 will fail to compile.
1926
1927 @item -Wno-pmf-conversions @r{(C++ only)}
1928 @opindex Wno-pmf-conversions
1929 Disable the diagnostic for converting a bound pointer to member function
1930 to a plain pointer.
1931
1932 @item -Wsign-promo @r{(C++ only)}
1933 @opindex Wsign-promo
1934 Warn when overload resolution chooses a promotion from unsigned or
1935 enumerated type to a signed type, over a conversion to an unsigned type of
1936 the same size.  Previous versions of G++ would try to preserve
1937 unsignedness, but the standard mandates the current behavior.
1938
1939 @smallexample
1940 struct A @{
1941   operator int ();
1942   A& operator = (int);
1943 @};
1944
1945 main ()
1946 @{
1947   A a,b;
1948   a = b;
1949 @}
1950 @end smallexample
1951
1952 In this example, G++ will synthesize a default @samp{A& operator =
1953 (const A&);}, while cfront will use the user-defined @samp{operator =}.
1954 @end table
1955
1956 @node Objective-C and Objective-C++ Dialect Options
1957 @section Options Controlling Objective-C and Objective-C++ Dialects
1958
1959 @cindex compiler options, Objective-C and Objective-C++
1960 @cindex Objective-C and Objective-C++ options, command line
1961 @cindex options, Objective-C and Objective-C++
1962 (NOTE: This manual does not describe the Objective-C and Objective-C++
1963 languages themselves.  See @xref{Standards,,Language Standards
1964 Supported by GCC}, for references.)
1965
1966 This section describes the command-line options that are only meaningful
1967 for Objective-C and Objective-C++ programs, but you can also use most of
1968 the language-independent GNU compiler options.
1969 For example, you might compile a file @code{some_class.m} like this:
1970
1971 @smallexample
1972 gcc -g -fgnu-runtime -O -c some_class.m
1973 @end smallexample
1974
1975 @noindent
1976 In this example, @option{-fgnu-runtime} is an option meant only for
1977 Objective-C and Objective-C++ programs; you can use the other options with
1978 any language supported by GCC@.
1979
1980 Note that since Objective-C is an extension of the C language, Objective-C
1981 compilations may also use options specific to the C front-end (e.g.,
1982 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
1983 C++-specific options (e.g., @option{-Wabi}).
1984
1985 Here is a list of options that are @emph{only} for compiling Objective-C
1986 and Objective-C++ programs:
1987
1988 @table @gcctabopt
1989 @item -fconstant-string-class=@var{class-name}
1990 @opindex fconstant-string-class
1991 Use @var{class-name} as the name of the class to instantiate for each
1992 literal string specified with the syntax @code{@@"@dots{}"}.  The default
1993 class name is @code{NXConstantString} if the GNU runtime is being used, and
1994 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
1995 @option{-fconstant-cfstrings} option, if also present, will override the
1996 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
1997 to be laid out as constant CoreFoundation strings.
1998
1999 @item -fgnu-runtime
2000 @opindex fgnu-runtime
2001 Generate object code compatible with the standard GNU Objective-C
2002 runtime.  This is the default for most types of systems.
2003
2004 @item -fnext-runtime
2005 @opindex fnext-runtime
2006 Generate output compatible with the NeXT runtime.  This is the default
2007 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2008 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2009 used.
2010
2011 @item -fno-nil-receivers
2012 @opindex fno-nil-receivers
2013 Assume that all Objective-C message dispatches (e.g.,
2014 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2015 is not @code{nil}.  This allows for more efficient entry points in the runtime
2016 to be used.  Currently, this option is only available in conjunction with
2017 the NeXT runtime on Mac OS X 10.3 and later.
2018
2019 @item -fobjc-call-cxx-cdtors
2020 @opindex fobjc-call-cxx-cdtors
2021 For each Objective-C class, check if any of its instance variables is a
2022 C++ object with a non-trivial default constructor.  If so, synthesize a
2023 special @code{- (id) .cxx_construct} instance method that will run
2024 non-trivial default constructors on any such instance variables, in order,
2025 and then return @code{self}.  Similarly, check if any instance variable
2026 is a C++ object with a non-trivial destructor, and if so, synthesize a
2027 special @code{- (void) .cxx_destruct} method that will run
2028 all such default destructors, in reverse order.
2029
2030 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2031 thusly generated will only operate on instance variables declared in the
2032 current Objective-C class, and not those inherited from superclasses.  It
2033 is the responsibility of the Objective-C runtime to invoke all such methods
2034 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2035 will be invoked by the runtime immediately after a new object
2036 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2037 be invoked immediately before the runtime deallocates an object instance.
2038
2039 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2040 support for invoking the @code{- (id) .cxx_construct} and
2041 @code{- (void) .cxx_destruct} methods.
2042
2043 @item -fobjc-direct-dispatch
2044 @opindex fobjc-direct-dispatch
2045 Allow fast jumps to the message dispatcher.  On Darwin this is
2046 accomplished via the comm page.
2047
2048 @item -fobjc-exceptions
2049 @opindex fobjc-exceptions
2050 Enable syntactic support for structured exception handling in Objective-C,
2051 similar to what is offered by C++ and Java.  This option is
2052 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2053 earlier.
2054
2055 @smallexample
2056   @@try @{
2057     @dots{}
2058        @@throw expr;
2059     @dots{}
2060   @}
2061   @@catch (AnObjCClass *exc) @{
2062     @dots{}
2063       @@throw expr;
2064     @dots{}
2065       @@throw;
2066     @dots{}
2067   @}
2068   @@catch (AnotherClass *exc) @{
2069     @dots{}
2070   @}
2071   @@catch (id allOthers) @{
2072     @dots{}
2073   @}
2074   @@finally @{
2075     @dots{}
2076       @@throw expr;
2077     @dots{}
2078   @}
2079 @end smallexample
2080
2081 The @code{@@throw} statement may appear anywhere in an Objective-C or
2082 Objective-C++ program; when used inside of a @code{@@catch} block, the
2083 @code{@@throw} may appear without an argument (as shown above), in which case
2084 the object caught by the @code{@@catch} will be rethrown.
2085
2086 Note that only (pointers to) Objective-C objects may be thrown and
2087 caught using this scheme.  When an object is thrown, it will be caught
2088 by the nearest @code{@@catch} clause capable of handling objects of that type,
2089 analogously to how @code{catch} blocks work in C++ and Java.  A
2090 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2091 any and all Objective-C exceptions not caught by previous @code{@@catch}
2092 clauses (if any).
2093
2094 The @code{@@finally} clause, if present, will be executed upon exit from the
2095 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2096 regardless of whether any exceptions are thrown, caught or rethrown
2097 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2098 of the @code{finally} clause in Java.
2099
2100 There are several caveats to using the new exception mechanism:
2101
2102 @itemize @bullet
2103 @item
2104 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2105 idioms provided by the @code{NSException} class, the new
2106 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2107 systems, due to additional functionality needed in the (NeXT) Objective-C
2108 runtime.
2109
2110 @item
2111 As mentioned above, the new exceptions do not support handling
2112 types other than Objective-C objects.   Furthermore, when used from
2113 Objective-C++, the Objective-C exception model does not interoperate with C++
2114 exceptions at this time.  This means you cannot @code{@@throw} an exception
2115 from Objective-C and @code{catch} it in C++, or vice versa
2116 (i.e., @code{throw @dots{} @@catch}).
2117 @end itemize
2118
2119 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2120 blocks for thread-safe execution:
2121
2122 @smallexample
2123   @@synchronized (ObjCClass *guard) @{
2124     @dots{}
2125   @}
2126 @end smallexample
2127
2128 Upon entering the @code{@@synchronized} block, a thread of execution shall
2129 first check whether a lock has been placed on the corresponding @code{guard}
2130 object by another thread.  If it has, the current thread shall wait until
2131 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2132 the current thread will place its own lock on it, execute the code contained in
2133 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2134 making @code{guard} available to other threads).
2135
2136 Unlike Java, Objective-C does not allow for entire methods to be marked
2137 @code{@@synchronized}.  Note that throwing exceptions out of
2138 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2139 to be unlocked properly.
2140
2141 @item -fobjc-gc
2142 @opindex fobjc-gc
2143 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2144
2145 @item -freplace-objc-classes
2146 @opindex freplace-objc-classes
2147 Emit a special marker instructing @command{ld(1)} not to statically link in
2148 the resulting object file, and allow @command{dyld(1)} to load it in at
2149 run time instead.  This is used in conjunction with the Fix-and-Continue
2150 debugging mode, where the object file in question may be recompiled and
2151 dynamically reloaded in the course of program execution, without the need
2152 to restart the program itself.  Currently, Fix-and-Continue functionality
2153 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2154 and later.
2155
2156 @item -fzero-link
2157 @opindex fzero-link
2158 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2159 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2160 compile time) with static class references that get initialized at load time,
2161 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2162 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2163 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2164 for individual class implementations to be modified during program execution.
2165
2166 @item -gen-decls
2167 @opindex gen-decls
2168 Dump interface declarations for all classes seen in the source file to a
2169 file named @file{@var{sourcename}.decl}.
2170
2171 @item -Wassign-intercept
2172 @opindex Wassign-intercept
2173 Warn whenever an Objective-C assignment is being intercepted by the
2174 garbage collector.
2175
2176 @item -Wno-protocol
2177 @opindex Wno-protocol
2178 If a class is declared to implement a protocol, a warning is issued for
2179 every method in the protocol that is not implemented by the class.  The
2180 default behavior is to issue a warning for every method not explicitly
2181 implemented in the class, even if a method implementation is inherited
2182 from the superclass.  If you use the @option{-Wno-protocol} option, then
2183 methods inherited from the superclass are considered to be implemented,
2184 and no warning is issued for them.
2185
2186 @item -Wselector
2187 @opindex Wselector
2188 Warn if multiple methods of different types for the same selector are
2189 found during compilation.  The check is performed on the list of methods
2190 in the final stage of compilation.  Additionally, a check is performed
2191 for each selector appearing in a @code{@@selector(@dots{})}
2192 expression, and a corresponding method for that selector has been found
2193 during compilation.  Because these checks scan the method table only at
2194 the end of compilation, these warnings are not produced if the final
2195 stage of compilation is not reached, for example because an error is
2196 found during compilation, or because the @option{-fsyntax-only} option is
2197 being used.
2198
2199 @item -Wstrict-selector-match
2200 @opindex Wstrict-selector-match
2201 Warn if multiple methods with differing argument and/or return types are
2202 found for a given selector when attempting to send a message using this
2203 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2204 is off (which is the default behavior), the compiler will omit such warnings
2205 if any differences found are confined to types which share the same size
2206 and alignment.
2207
2208 @item -Wundeclared-selector
2209 @opindex Wundeclared-selector
2210 Warn if a @code{@@selector(@dots{})} expression referring to an
2211 undeclared selector is found.  A selector is considered undeclared if no
2212 method with that name has been declared before the
2213 @code{@@selector(@dots{})} expression, either explicitly in an
2214 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2215 an @code{@@implementation} section.  This option always performs its
2216 checks as soon as a @code{@@selector(@dots{})} expression is found,
2217 while @option{-Wselector} only performs its checks in the final stage of
2218 compilation.  This also enforces the coding style convention
2219 that methods and selectors must be declared before being used.
2220
2221 @item -print-objc-runtime-info
2222 @opindex print-objc-runtime-info
2223 Generate C header describing the largest structure that is passed by
2224 value, if any.
2225
2226 @end table
2227
2228 @node Language Independent Options
2229 @section Options to Control Diagnostic Messages Formatting
2230 @cindex options to control diagnostics formatting
2231 @cindex diagnostic messages
2232 @cindex message formatting
2233
2234 Traditionally, diagnostic messages have been formatted irrespective of
2235 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2236 below can be used to control the diagnostic messages formatting
2237 algorithm, e.g.@: how many characters per line, how often source location
2238 information should be reported.  Right now, only the C++ front end can
2239 honor these options.  However it is expected, in the near future, that
2240 the remaining front ends would be able to digest them correctly.
2241
2242 @table @gcctabopt
2243 @item -fmessage-length=@var{n}
2244 @opindex fmessage-length
2245 Try to format error messages so that they fit on lines of about @var{n}
2246 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2247 the front ends supported by GCC@.  If @var{n} is zero, then no
2248 line-wrapping will be done; each error message will appear on a single
2249 line.
2250
2251 @opindex fdiagnostics-show-location
2252 @item -fdiagnostics-show-location=once
2253 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2254 reporter to emit @emph{once} source location information; that is, in
2255 case the message is too long to fit on a single physical line and has to
2256 be wrapped, the source location won't be emitted (as prefix) again,
2257 over and over, in subsequent continuation lines.  This is the default
2258 behavior.
2259
2260 @item -fdiagnostics-show-location=every-line
2261 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2262 messages reporter to emit the same source location information (as
2263 prefix) for physical lines that result from the process of breaking
2264 a message which is too long to fit on a single line.
2265
2266 @item -fdiagnostics-show-option
2267 @opindex fdiagnostics-show-option
2268 This option instructs the diagnostic machinery to add text to each
2269 diagnostic emitted, which indicates which command line option directly
2270 controls that diagnostic, when such an option is known to the
2271 diagnostic machinery.
2272
2273 @end table
2274
2275 @node Warning Options
2276 @section Options to Request or Suppress Warnings
2277 @cindex options to control warnings
2278 @cindex warning messages
2279 @cindex messages, warning
2280 @cindex suppressing warnings
2281
2282 Warnings are diagnostic messages that report constructions which
2283 are not inherently erroneous but which are risky or suggest there
2284 may have been an error.
2285
2286 You can request many specific warnings with options beginning @samp{-W},
2287 for example @option{-Wimplicit} to request warnings on implicit
2288 declarations.  Each of these specific warning options also has a
2289 negative form beginning @samp{-Wno-} to turn off warnings;
2290 for example, @option{-Wno-implicit}.  This manual lists only one of the
2291 two forms, whichever is not the default.
2292
2293 The following options control the amount and kinds of warnings produced
2294 by GCC; for further, language-specific options also refer to
2295 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2296 Options}.
2297
2298 @table @gcctabopt
2299 @cindex syntax checking
2300 @item -fsyntax-only
2301 @opindex fsyntax-only
2302 Check the code for syntax errors, but don't do anything beyond that.
2303
2304 @item -pedantic
2305 @opindex pedantic
2306 Issue all the warnings demanded by strict ISO C and ISO C++;
2307 reject all programs that use forbidden extensions, and some other
2308 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2309 version of the ISO C standard specified by any @option{-std} option used.
2310
2311 Valid ISO C and ISO C++ programs should compile properly with or without
2312 this option (though a rare few will require @option{-ansi} or a
2313 @option{-std} option specifying the required version of ISO C)@.  However,
2314 without this option, certain GNU extensions and traditional C and C++
2315 features are supported as well.  With this option, they are rejected.
2316
2317 @option{-pedantic} does not cause warning messages for use of the
2318 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2319 warnings are also disabled in the expression that follows
2320 @code{__extension__}.  However, only system header files should use
2321 these escape routes; application programs should avoid them.
2322 @xref{Alternate Keywords}.
2323
2324 Some users try to use @option{-pedantic} to check programs for strict ISO
2325 C conformance.  They soon find that it does not do quite what they want:
2326 it finds some non-ISO practices, but not all---only those for which
2327 ISO C @emph{requires} a diagnostic, and some others for which
2328 diagnostics have been added.
2329
2330 A feature to report any failure to conform to ISO C might be useful in
2331 some instances, but would require considerable additional work and would
2332 be quite different from @option{-pedantic}.  We don't have plans to
2333 support such a feature in the near future.
2334
2335 Where the standard specified with @option{-std} represents a GNU
2336 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2337 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2338 extended dialect is based.  Warnings from @option{-pedantic} are given
2339 where they are required by the base standard.  (It would not make sense
2340 for such warnings to be given only for features not in the specified GNU
2341 C dialect, since by definition the GNU dialects of C include all
2342 features the compiler supports with the given option, and there would be
2343 nothing to warn about.)
2344
2345 @item -pedantic-errors
2346 @opindex pedantic-errors
2347 Like @option{-pedantic}, except that errors are produced rather than
2348 warnings.
2349
2350 @item -w
2351 @opindex w
2352 Inhibit all warning messages.
2353
2354 @item -Wno-import
2355 @opindex Wno-import
2356 Inhibit warning messages about the use of @samp{#import}.
2357
2358 @item -Wchar-subscripts
2359 @opindex Wchar-subscripts
2360 Warn if an array subscript has type @code{char}.  This is a common cause
2361 of error, as programmers often forget that this type is signed on some
2362 machines.
2363 This warning is enabled by @option{-Wall}.
2364
2365 @item -Wcomment
2366 @opindex Wcomment
2367 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2368 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2369 This warning is enabled by @option{-Wall}.
2370
2371 @item -Wfatal-errors
2372 @opindex Wfatal-errors
2373 This option causes the compiler to abort compilation on the first error
2374 occurred rather than trying to keep going and printing further error
2375 messages.
2376
2377 @item -Wformat
2378 @opindex Wformat
2379 @opindex ffreestanding
2380 @opindex fno-builtin
2381 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2382 the arguments supplied have types appropriate to the format string
2383 specified, and that the conversions specified in the format string make
2384 sense.  This includes standard functions, and others specified by format
2385 attributes (@pxref{Function Attributes}), in the @code{printf},
2386 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2387 not in the C standard) families (or other target-specific families).
2388 Which functions are checked without format attributes having been
2389 specified depends on the standard version selected, and such checks of
2390 functions without the attribute specified are disabled by
2391 @option{-ffreestanding} or @option{-fno-builtin}.
2392
2393 The formats are checked against the format features supported by GNU
2394 libc version 2.2.  These include all ISO C90 and C99 features, as well
2395 as features from the Single Unix Specification and some BSD and GNU
2396 extensions.  Other library implementations may not support all these
2397 features; GCC does not support warning about features that go beyond a
2398 particular library's limitations.  However, if @option{-pedantic} is used
2399 with @option{-Wformat}, warnings will be given about format features not
2400 in the selected standard version (but not for @code{strfmon} formats,
2401 since those are not in any version of the C standard).  @xref{C Dialect
2402 Options,,Options Controlling C Dialect}.
2403
2404 Since @option{-Wformat} also checks for null format arguments for
2405 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2406
2407 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2408 aspects of format checking, the options @option{-Wformat-y2k},
2409 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2410 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2411 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2412
2413 @item -Wformat-y2k
2414 @opindex Wformat-y2k
2415 If @option{-Wformat} is specified, also warn about @code{strftime}
2416 formats which may yield only a two-digit year.
2417
2418 @item -Wno-format-extra-args
2419 @opindex Wno-format-extra-args
2420 If @option{-Wformat} is specified, do not warn about excess arguments to a
2421 @code{printf} or @code{scanf} format function.  The C standard specifies
2422 that such arguments are ignored.
2423
2424 Where the unused arguments lie between used arguments that are
2425 specified with @samp{$} operand number specifications, normally
2426 warnings are still given, since the implementation could not know what
2427 type to pass to @code{va_arg} to skip the unused arguments.  However,
2428 in the case of @code{scanf} formats, this option will suppress the
2429 warning if the unused arguments are all pointers, since the Single
2430 Unix Specification says that such unused arguments are allowed.
2431
2432 @item -Wno-format-zero-length
2433 @opindex Wno-format-zero-length
2434 If @option{-Wformat} is specified, do not warn about zero-length formats.
2435 The C standard specifies that zero-length formats are allowed.
2436
2437 @item -Wformat-nonliteral
2438 @opindex Wformat-nonliteral
2439 If @option{-Wformat} is specified, also warn if the format string is not a
2440 string literal and so cannot be checked, unless the format function
2441 takes its format arguments as a @code{va_list}.
2442
2443 @item -Wformat-security
2444 @opindex Wformat-security
2445 If @option{-Wformat} is specified, also warn about uses of format
2446 functions that represent possible security problems.  At present, this
2447 warns about calls to @code{printf} and @code{scanf} functions where the
2448 format string is not a string literal and there are no format arguments,
2449 as in @code{printf (foo);}.  This may be a security hole if the format
2450 string came from untrusted input and contains @samp{%n}.  (This is
2451 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2452 in future warnings may be added to @option{-Wformat-security} that are not
2453 included in @option{-Wformat-nonliteral}.)
2454
2455 @item -Wformat=2
2456 @opindex Wformat=2
2457 Enable @option{-Wformat} plus format checks not included in
2458 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2459 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2460
2461 @item -Wnonnull
2462 @opindex Wnonnull
2463 Warn about passing a null pointer for arguments marked as
2464 requiring a non-null value by the @code{nonnull} function attribute.
2465
2466 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2467 can be disabled with the @option{-Wno-nonnull} option.
2468
2469 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2470 @opindex Winit-self
2471 Warn about uninitialized variables which are initialized with themselves.
2472 Note this option can only be used with the @option{-Wuninitialized} option,
2473 which in turn only works with @option{-O1} and above.
2474
2475 For example, GCC will warn about @code{i} being uninitialized in the
2476 following snippet only when @option{-Winit-self} has been specified:
2477 @smallexample
2478 @group
2479 int f()
2480 @{
2481   int i = i;
2482   return i;
2483 @}
2484 @end group
2485 @end smallexample
2486
2487 @item -Wimplicit-int
2488 @opindex Wimplicit-int
2489 Warn when a declaration does not specify a type.
2490 This warning is enabled by @option{-Wall}.
2491
2492 @item -Wimplicit-function-declaration
2493 @itemx -Werror-implicit-function-declaration
2494 @opindex Wimplicit-function-declaration
2495 @opindex Werror-implicit-function-declaration
2496 Give a warning (or error) whenever a function is used before being
2497 declared.  The form @option{-Wno-error-implicit-function-declaration}
2498 is not supported.
2499 This warning is enabled by @option{-Wall} (as a warning, not an error).
2500
2501 @item -Wimplicit
2502 @opindex Wimplicit
2503 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2504 This warning is enabled by @option{-Wall}.
2505
2506 @item -Wmain
2507 @opindex Wmain
2508 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2509 function with external linkage, returning int, taking either zero
2510 arguments, two, or three arguments of appropriate types.
2511 This warning is enabled by @option{-Wall}.
2512
2513 @item -Wmissing-braces
2514 @opindex Wmissing-braces
2515 Warn if an aggregate or union initializer is not fully bracketed.  In
2516 the following example, the initializer for @samp{a} is not fully
2517 bracketed, but that for @samp{b} is fully bracketed.
2518
2519 @smallexample
2520 int a[2][2] = @{ 0, 1, 2, 3 @};
2521 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2522 @end smallexample
2523
2524 This warning is enabled by @option{-Wall}.
2525
2526 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2527 @opindex Wmissing-include-dirs
2528 Warn if a user-supplied include directory does not exist.
2529
2530 @item -Wparentheses
2531 @opindex Wparentheses
2532 Warn if parentheses are omitted in certain contexts, such
2533 as when there is an assignment in a context where a truth value
2534 is expected, or when operators are nested whose precedence people
2535 often get confused about.
2536
2537 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2538 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2539 interpretation from that of ordinary mathematical notation.
2540
2541 Also warn about constructions where there may be confusion to which
2542 @code{if} statement an @code{else} branch belongs.  Here is an example of
2543 such a case:
2544
2545 @smallexample
2546 @group
2547 @{
2548   if (a)
2549     if (b)
2550       foo ();
2551   else
2552     bar ();
2553 @}
2554 @end group
2555 @end smallexample
2556
2557 In C/C++, every @code{else} branch belongs to the innermost possible
2558 @code{if} statement, which in this example is @code{if (b)}.  This is
2559 often not what the programmer expected, as illustrated in the above
2560 example by indentation the programmer chose.  When there is the
2561 potential for this confusion, GCC will issue a warning when this flag
2562 is specified.  To eliminate the warning, add explicit braces around
2563 the innermost @code{if} statement so there is no way the @code{else}
2564 could belong to the enclosing @code{if}.  The resulting code would
2565 look like this:
2566
2567 @smallexample
2568 @group
2569 @{
2570   if (a)
2571     @{
2572       if (b)
2573         foo ();
2574       else
2575         bar ();
2576     @}
2577 @}
2578 @end group
2579 @end smallexample
2580
2581 This warning is enabled by @option{-Wall}.
2582
2583 @item -Wsequence-point
2584 @opindex Wsequence-point
2585 Warn about code that may have undefined semantics because of violations
2586 of sequence point rules in the C and C++ standards.
2587
2588 The C and C++ standards defines the order in which expressions in a C/C++
2589 program are evaluated in terms of @dfn{sequence points}, which represent
2590 a partial ordering between the execution of parts of the program: those
2591 executed before the sequence point, and those executed after it.  These
2592 occur after the evaluation of a full expression (one which is not part
2593 of a larger expression), after the evaluation of the first operand of a
2594 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2595 function is called (but after the evaluation of its arguments and the
2596 expression denoting the called function), and in certain other places.
2597 Other than as expressed by the sequence point rules, the order of
2598 evaluation of subexpressions of an expression is not specified.  All
2599 these rules describe only a partial order rather than a total order,
2600 since, for example, if two functions are called within one expression
2601 with no sequence point between them, the order in which the functions
2602 are called is not specified.  However, the standards committee have
2603 ruled that function calls do not overlap.
2604
2605 It is not specified when between sequence points modifications to the
2606 values of objects take effect.  Programs whose behavior depends on this
2607 have undefined behavior; the C and C++ standards specify that ``Between
2608 the previous and next sequence point an object shall have its stored
2609 value modified at most once by the evaluation of an expression.  
2610 Furthermore, the prior value shall be read only to determine the value
2611 to be stored.''.  If a program breaks these rules, the results on any
2612 particular implementation are entirely unpredictable.
2613
2614 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2615 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2616 diagnosed by this option, and it may give an occasional false positive
2617 result, but in general it has been found fairly effective at detecting
2618 this sort of problem in programs.
2619
2620 The standard is worded confusingly, therefore there is some debate
2621 over the precise meaning of the sequence point rules in subtle cases.
2622 Links to discussions of the problem, including proposed formal
2623 definitions, may be found on the GCC readings page, at
2624 @w{@uref{http://gcc.gnu.org/readings.html}}.
2625
2626 This warning is enabled by @option{-Wall} for C and C++.
2627
2628 @item -Wreturn-type
2629 @opindex Wreturn-type
2630 Warn whenever a function is defined with a return-type that defaults to
2631 @code{int}.  Also warn about any @code{return} statement with no
2632 return-value in a function whose return-type is not @code{void}.
2633
2634 For C, also warn if the return type of a function has a type qualifier
2635 such as @code{const}.  Such a type qualifier has no effect, since the
2636 value returned by a function is not an lvalue.  ISO C prohibits
2637 qualified @code{void} return types on function definitions, so such
2638 return types always receive a warning even without this option.
2639
2640 For C++, a function without return type always produces a diagnostic
2641 message, even when @option{-Wno-return-type} is specified.  The only
2642 exceptions are @samp{main} and functions defined in system headers.
2643
2644 This warning is enabled by @option{-Wall}.
2645
2646 @item -Wswitch
2647 @opindex Wswitch
2648 Warn whenever a @code{switch} statement has an index of enumerated type
2649 and lacks a @code{case} for one or more of the named codes of that
2650 enumeration.  (The presence of a @code{default} label prevents this
2651 warning.)  @code{case} labels outside the enumeration range also
2652 provoke warnings when this option is used.
2653 This warning is enabled by @option{-Wall}.
2654
2655 @item -Wswitch-default
2656 @opindex Wswitch-switch
2657 Warn whenever a @code{switch} statement does not have a @code{default}
2658 case.
2659
2660 @item -Wswitch-enum
2661 @opindex Wswitch-enum
2662 Warn whenever a @code{switch} statement has an index of enumerated type
2663 and lacks a @code{case} for one or more of the named codes of that
2664 enumeration.  @code{case} labels outside the enumeration range also
2665 provoke warnings when this option is used.
2666
2667 @item -Wtrigraphs
2668 @opindex Wtrigraphs
2669 Warn if any trigraphs are encountered that might change the meaning of
2670 the program (trigraphs within comments are not warned about).
2671 This warning is enabled by @option{-Wall}.
2672
2673 @item -Wunused-function
2674 @opindex Wunused-function
2675 Warn whenever a static function is declared but not defined or a
2676 non-inline static function is unused.
2677 This warning is enabled by @option{-Wall}.
2678
2679 @item -Wunused-label
2680 @opindex Wunused-label
2681 Warn whenever a label is declared but not used.
2682 This warning is enabled by @option{-Wall}.
2683
2684 To suppress this warning use the @samp{unused} attribute
2685 (@pxref{Variable Attributes}).
2686
2687 @item -Wunused-parameter
2688 @opindex Wunused-parameter
2689 Warn whenever a function parameter is unused aside from its declaration.
2690
2691 To suppress this warning use the @samp{unused} attribute
2692 (@pxref{Variable Attributes}).
2693
2694 @item -Wunused-variable
2695 @opindex Wunused-variable
2696 Warn whenever a local variable or non-constant static variable is unused
2697 aside from its declaration.
2698 This warning is enabled by @option{-Wall}.
2699
2700 To suppress this warning use the @samp{unused} attribute
2701 (@pxref{Variable Attributes}).
2702
2703 @item -Wunused-value
2704 @opindex Wunused-value
2705 Warn whenever a statement computes a result that is explicitly not used.
2706 This warning is enabled by @option{-Wall}.
2707
2708 To suppress this warning cast the expression to @samp{void}.
2709
2710 @item -Wunused
2711 @opindex Wunused
2712 All the above @option{-Wunused} options combined.
2713
2714 In order to get a warning about an unused function parameter, you must
2715 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2716 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2717
2718 @item -Wuninitialized
2719 @opindex Wuninitialized
2720 Warn if an automatic variable is used without first being initialized or
2721 if a variable may be clobbered by a @code{setjmp} call.
2722
2723 These warnings are possible only in optimizing compilation,
2724 because they require data flow information that is computed only
2725 when optimizing.  If you do not specify @option{-O}, you will not get 
2726 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2727 requiring @option{-O}.
2728
2729 If you want to warn about code which uses the uninitialized value of the
2730 variable in its own initializer, use the @option{-Winit-self} option.
2731
2732 These warnings occur for individual uninitialized or clobbered
2733 elements of structure, union or array variables as well as for
2734 variables which are uninitialized or clobbered as a whole.  They do
2735 not occur for variables or elements declared @code{volatile}.  Because
2736 these warnings depend on optimization, the exact variables or elements
2737 for which there are warnings will depend on the precise optimization
2738 options and version of GCC used.
2739
2740 Note that there may be no warning about a variable that is used only
2741 to compute a value that itself is never used, because such
2742 computations may be deleted by data flow analysis before the warnings
2743 are printed.
2744
2745 These warnings are made optional because GCC is not smart
2746 enough to see all the reasons why the code might be correct
2747 despite appearing to have an error.  Here is one example of how
2748 this can happen:
2749
2750 @smallexample
2751 @group
2752 @{
2753   int x;
2754   switch (y)
2755     @{
2756     case 1: x = 1;
2757       break;
2758     case 2: x = 4;
2759       break;
2760     case 3: x = 5;
2761     @}
2762   foo (x);
2763 @}
2764 @end group
2765 @end smallexample
2766
2767 @noindent
2768 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2769 always initialized, but GCC doesn't know this.  Here is
2770 another common case:
2771
2772 @smallexample
2773 @{
2774   int save_y;
2775   if (change_y) save_y = y, y = new_y;
2776   @dots{}
2777   if (change_y) y = save_y;
2778 @}
2779 @end smallexample
2780
2781 @noindent
2782 This has no bug because @code{save_y} is used only if it is set.
2783
2784 @cindex @code{longjmp} warnings
2785 This option also warns when a non-volatile automatic variable might be
2786 changed by a call to @code{longjmp}.  These warnings as well are possible
2787 only in optimizing compilation.
2788
2789 The compiler sees only the calls to @code{setjmp}.  It cannot know
2790 where @code{longjmp} will be called; in fact, a signal handler could
2791 call it at any point in the code.  As a result, you may get a warning
2792 even when there is in fact no problem because @code{longjmp} cannot
2793 in fact be called at the place which would cause a problem.
2794
2795 Some spurious warnings can be avoided if you declare all the functions
2796 you use that never return as @code{noreturn}.  @xref{Function
2797 Attributes}.
2798
2799 This warning is enabled by @option{-Wall}.
2800
2801 @item -Wunknown-pragmas
2802 @opindex Wunknown-pragmas
2803 @cindex warning for unknown pragmas
2804 @cindex unknown pragmas, warning
2805 @cindex pragmas, warning of unknown
2806 Warn when a #pragma directive is encountered which is not understood by
2807 GCC@.  If this command line option is used, warnings will even be issued
2808 for unknown pragmas in system header files.  This is not the case if
2809 the warnings were only enabled by the @option{-Wall} command line option.
2810
2811 @item -Wno-pragmas
2812 @opindex Wno-pragmas
2813 @opindex Wpragmas
2814 Do not warn about misuses of pragmas, such as incorrect parameters,
2815 invalid syntax, or conflicts between pragmas.  See also
2816 @samp{-Wunknown-pragmas}.
2817
2818 @item -Wstrict-aliasing
2819 @opindex Wstrict-aliasing
2820 This option is only active when @option{-fstrict-aliasing} is active.
2821 It warns about code which might break the strict aliasing rules that the
2822 compiler is using for optimization.  The warning does not catch all
2823 cases, but does attempt to catch the more common pitfalls.  It is
2824 included in @option{-Wall}.
2825
2826 @item -Wstrict-aliasing=2
2827 @opindex Wstrict-aliasing=2
2828 This option is only active when @option{-fstrict-aliasing} is active.
2829 It warns about code which might break the strict aliasing rules that the
2830 compiler is using for optimization.  This warning catches more cases than
2831 @option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
2832 cases that are safe.
2833
2834 @item -Wall
2835 @opindex Wall
2836 All of the above @samp{-W} options combined.  This enables all the
2837 warnings about constructions that some users consider questionable, and
2838 that are easy to avoid (or modify to prevent the warning), even in
2839 conjunction with macros.  This also enables some language-specific
2840 warnings described in @ref{C++ Dialect Options} and
2841 @ref{Objective-C and Objective-C++ Dialect Options}.
2842 @end table
2843
2844 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
2845 Some of them warn about constructions that users generally do not
2846 consider questionable, but which occasionally you might wish to check
2847 for; others warn about constructions that are necessary or hard to avoid
2848 in some cases, and there is no simple way to modify the code to suppress
2849 the warning.
2850
2851 @table @gcctabopt
2852 @item -Wextra
2853 @opindex W
2854 @opindex Wextra
2855 (This option used to be called @option{-W}.  The older name is still
2856 supported, but the newer name is more descriptive.)  Print extra warning
2857 messages for these events:
2858
2859 @itemize @bullet
2860 @item
2861 A function can return either with or without a value.  (Falling
2862 off the end of the function body is considered returning without
2863 a value.)  For example, this function would evoke such a
2864 warning:
2865
2866 @smallexample
2867 @group
2868 foo (a)
2869 @{
2870   if (a > 0)
2871     return a;
2872 @}
2873 @end group
2874 @end smallexample
2875
2876 @item
2877 An expression-statement or the left-hand side of a comma expression
2878 contains no side effects.
2879 To suppress the warning, cast the unused expression to void.
2880 For example, an expression such as @samp{x[i,j]} will cause a warning,
2881 but @samp{x[(void)i,j]} will not.
2882
2883 @item
2884 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
2885
2886 @item
2887 Storage-class specifiers like @code{static} are not the first things in
2888 a declaration.  According to the C Standard, this usage is obsolescent.
2889
2890 @item
2891 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
2892 arguments.
2893
2894 @item
2895 A comparison between signed and unsigned values could produce an
2896 incorrect result when the signed value is converted to unsigned.
2897 (But don't warn if @option{-Wno-sign-compare} is also specified.)
2898
2899 @item
2900 An aggregate has an initializer which does not initialize all members.
2901 This warning can be independently controlled by
2902 @option{-Wmissing-field-initializers}.
2903
2904 @item
2905 An initialized field without side effects is overridden when using
2906 designated initializers (@pxref{Designated Inits, , Designated
2907 Initializers}).  This warning can be independently controlled by
2908 @option{-Woverride-init}.
2909
2910 @item
2911 A function parameter is declared without a type specifier in K&R-style
2912 functions:
2913
2914 @smallexample
2915 void foo(bar) @{ @}
2916 @end smallexample
2917
2918 @item
2919 An empty body occurs in an @samp{if} or @samp{else} statement. This
2920 warning can be independently controlled by @option{-Wempty-body}.
2921
2922 @item
2923 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2924 @samp{>}, or @samp{>=}.
2925
2926 @item
2927 A variable might be changed by @samp{longjmp} or @samp{vfork}.
2928
2929 @item
2930 Any of several floating-point events that often indicate errors, such as
2931 overflow, underflow, loss of precision, etc.
2932
2933 @item @r{(C++ only)}
2934 An enumerator and a non-enumerator both appear in a conditional expression.
2935
2936 @item @r{(C++ only)}
2937 A non-static reference or non-static @samp{const} member appears in a
2938 class without constructors.
2939
2940 @item @r{(C++ only)}
2941 Ambiguous virtual bases.
2942
2943 @item @r{(C++ only)}
2944 Subscripting an array which has been declared @samp{register}.
2945
2946 @item @r{(C++ only)}
2947 Taking the address of a variable which has been declared @samp{register}.
2948
2949 @item @r{(C++ only)}
2950 A base class is not initialized in a derived class' copy constructor.
2951 @end itemize
2952
2953 @item -Wno-div-by-zero
2954 @opindex Wno-div-by-zero
2955 @opindex Wdiv-by-zero
2956 Do not warn about compile-time integer division by zero.  Floating point
2957 division by zero is not warned about, as it can be a legitimate way of
2958 obtaining infinities and NaNs.
2959
2960 @item -Wsystem-headers
2961 @opindex Wsystem-headers
2962 @cindex warnings from system headers
2963 @cindex system headers, warnings from
2964 Print warning messages for constructs found in system header files.
2965 Warnings from system headers are normally suppressed, on the assumption
2966 that they usually do not indicate real problems and would only make the
2967 compiler output harder to read.  Using this command line option tells
2968 GCC to emit warnings from system headers as if they occurred in user
2969 code.  However, note that using @option{-Wall} in conjunction with this
2970 option will @emph{not} warn about unknown pragmas in system
2971 headers---for that, @option{-Wunknown-pragmas} must also be used.
2972
2973 @item -Wfloat-equal
2974 @opindex Wfloat-equal
2975 Warn if floating point values are used in equality comparisons.
2976
2977 The idea behind this is that sometimes it is convenient (for the
2978 programmer) to consider floating-point values as approximations to
2979 infinitely precise real numbers.  If you are doing this, then you need
2980 to compute (by analyzing the code, or in some other way) the maximum or
2981 likely maximum error that the computation introduces, and allow for it
2982 when performing comparisons (and when producing output, but that's a
2983 different problem).  In particular, instead of testing for equality, you
2984 would check to see whether the two values have ranges that overlap; and
2985 this is done with the relational operators, so equality comparisons are
2986 probably mistaken.
2987
2988 @item -Wtraditional @r{(C only)}
2989 @opindex Wtraditional
2990 Warn about certain constructs that behave differently in traditional and
2991 ISO C@.  Also warn about ISO C constructs that have no traditional C
2992 equivalent, and/or problematic constructs which should be avoided.
2993
2994 @itemize @bullet
2995 @item
2996 Macro parameters that appear within string literals in the macro body.
2997 In traditional C macro replacement takes place within string literals,
2998 but does not in ISO C@.
2999
3000 @item
3001 In traditional C, some preprocessor directives did not exist.
3002 Traditional preprocessors would only consider a line to be a directive
3003 if the @samp{#} appeared in column 1 on the line.  Therefore
3004 @option{-Wtraditional} warns about directives that traditional C
3005 understands but would ignore because the @samp{#} does not appear as the
3006 first character on the line.  It also suggests you hide directives like
3007 @samp{#pragma} not understood by traditional C by indenting them.  Some
3008 traditional implementations would not recognize @samp{#elif}, so it
3009 suggests avoiding it altogether.
3010
3011 @item
3012 A function-like macro that appears without arguments.
3013
3014 @item
3015 The unary plus operator.
3016
3017 @item
3018 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3019 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3020 constants.)  Note, these suffixes appear in macros defined in the system
3021 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3022 Use of these macros in user code might normally lead to spurious
3023 warnings, however GCC's integrated preprocessor has enough context to
3024 avoid warning in these cases.
3025
3026 @item
3027 A function declared external in one block and then used after the end of
3028 the block.
3029
3030 @item
3031 A @code{switch} statement has an operand of type @code{long}.
3032
3033 @item
3034 A non-@code{static} function declaration follows a @code{static} one.
3035 This construct is not accepted by some traditional C compilers.
3036
3037 @item
3038 The ISO type of an integer constant has a different width or
3039 signedness from its traditional type.  This warning is only issued if
3040 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3041 typically represent bit patterns, are not warned about.
3042
3043 @item
3044 Usage of ISO string concatenation is detected.
3045
3046 @item
3047 Initialization of automatic aggregates.
3048
3049 @item
3050 Identifier conflicts with labels.  Traditional C lacks a separate
3051 namespace for labels.
3052
3053 @item
3054 Initialization of unions.  If the initializer is zero, the warning is
3055 omitted.  This is done under the assumption that the zero initializer in
3056 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3057 initializer warnings and relies on default initialization to zero in the
3058 traditional C case.
3059
3060 @item
3061 Conversions by prototypes between fixed/floating point values and vice
3062 versa.  The absence of these prototypes when compiling with traditional
3063 C would cause serious problems.  This is a subset of the possible
3064 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3065
3066 @item
3067 Use of ISO C style function definitions.  This warning intentionally is
3068 @emph{not} issued for prototype declarations or variadic functions
3069 because these ISO C features will appear in your code when using
3070 libiberty's traditional C compatibility macros, @code{PARAMS} and
3071 @code{VPARAMS}.  This warning is also bypassed for nested functions
3072 because that feature is already a GCC extension and thus not relevant to
3073 traditional C compatibility.
3074 @end itemize
3075
3076 @item -Wtraditional-conversion @r{(C only)}
3077 @opindex Wtraditional-conversion
3078 Warn if a prototype causes a type conversion that is different from what
3079 would happen to the same argument in the absence of a prototype.  This
3080 includes conversions of fixed point to floating and vice versa, and
3081 conversions changing the width or signedness of a fixed point argument
3082 except when the same as the default promotion.
3083
3084 @item -Wdeclaration-after-statement @r{(C only)}
3085 @opindex Wdeclaration-after-statement
3086 Warn when a declaration is found after a statement in a block.  This
3087 construct, known from C++, was introduced with ISO C99 and is by default
3088 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3089 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3090
3091 @item -Wundef
3092 @opindex Wundef
3093 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3094
3095 @item -Wno-endif-labels
3096 @opindex Wno-endif-labels
3097 @opindex Wendif-labels
3098 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3099
3100 @item -Wshadow
3101 @opindex Wshadow
3102 Warn whenever a local variable shadows another local variable, parameter or
3103 global variable or whenever a built-in function is shadowed.
3104
3105 @item -Wlarger-than-@var{len}
3106 @opindex Wlarger-than
3107 Warn whenever an object of larger than @var{len} bytes is defined.
3108
3109 @item -Wunsafe-loop-optimizations
3110 @opindex Wunsafe-loop-optimizations
3111 Warn if the loop cannot be optimized because the compiler could not
3112 assume anything on the bounds of the loop indices.  With
3113 @option{-funsafe-loop-optimizations} warn if the compiler made
3114 such assumptions.
3115
3116 @item -Wpointer-arith
3117 @opindex Wpointer-arith
3118 Warn about anything that depends on the ``size of'' a function type or
3119 of @code{void}.  GNU C assigns these types a size of 1, for
3120 convenience in calculations with @code{void *} pointers and pointers
3121 to functions.
3122
3123 @item -Wbad-function-cast @r{(C only)}
3124 @opindex Wbad-function-cast
3125 Warn whenever a function call is cast to a non-matching type.
3126 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3127
3128 @item -Wc++-compat
3129 Warn about ISO C constructs that are outside of the common subset of
3130 ISO C and ISO C++, e.g.@: request for implicit conversion from
3131 @code{void *} to a pointer to non-@code{void} type.
3132
3133 @item -Wcast-qual
3134 @opindex Wcast-qual
3135 Warn whenever a pointer is cast so as to remove a type qualifier from
3136 the target type.  For example, warn if a @code{const char *} is cast
3137 to an ordinary @code{char *}.
3138
3139 @item -Wcast-align
3140 @opindex Wcast-align
3141 Warn whenever a pointer is cast such that the required alignment of the
3142 target is increased.  For example, warn if a @code{char *} is cast to
3143 an @code{int *} on machines where integers can only be accessed at
3144 two- or four-byte boundaries.
3145
3146 @item -Wwrite-strings
3147 @opindex Wwrite-strings
3148 When compiling C, give string constants the type @code{const
3149 char[@var{length}]} so that
3150 copying the address of one into a non-@code{const} @code{char *}
3151 pointer will get a warning; when compiling C++, warn about the
3152 deprecated conversion from string literals to @code{char *}.  This
3153 warning, by default, is enabled for C++ programs.
3154 These warnings will help you find at
3155 compile time code that can try to write into a string constant, but
3156 only if you have been very careful about using @code{const} in
3157 declarations and prototypes.  Otherwise, it will just be a nuisance;
3158 this is why we did not make @option{-Wall} request these warnings.
3159
3160 @item -Wconversion
3161 @opindex Wconversion
3162 Warn for implicit conversions that may alter a value. This includes
3163 conversions between real and integer, like @code{abs (x)} when
3164 @code{x} is @code{double}; conversions between signed and unsigned,
3165 like @code{unsigned ui = -1}; and conversions to smaller types, like
3166 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3167 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3168 changed by the conversion like in @code{abs (2.0)}.
3169
3170 @item -Wempty-body
3171 @opindex Wempty-body
3172 An empty body occurs in an @samp{if} or @samp{else} statement. 
3173 This warning is also enabled by @option{-Wextra}.
3174
3175 @item -Wsign-compare
3176 @opindex Wsign-compare
3177 @cindex warning for comparison of signed and unsigned values
3178 @cindex comparison of signed and unsigned values, warning
3179 @cindex signed and unsigned values, comparison warning
3180 Warn when a comparison between signed and unsigned values could produce
3181 an incorrect result when the signed value is converted to unsigned.
3182 This warning is also enabled by @option{-Wextra}; to get the other warnings
3183 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3184
3185 @item -Waggregate-return
3186 @opindex Waggregate-return
3187 Warn if any functions that return structures or unions are defined or
3188 called.  (In languages where you can return an array, this also elicits
3189 a warning.)
3190
3191 @item -Walways-true
3192 @opindex Walways-true
3193 Warn about comparisons which are always true such as testing if
3194 unsigned values are greater than or equal to zero.  This warning is
3195 enabled by @option{-Wall}.
3196
3197 @item -Wno-attributes
3198 @opindex Wno-attributes
3199 @opindex Wattributes
3200 Do not warn if an unexpected @code{__attribute__} is used, such as
3201 unrecognized attributes, function attributes applied to variables,
3202 etc.  This will not stop errors for incorrect use of supported
3203 attributes.
3204
3205 @item -Wstrict-prototypes @r{(C only)}
3206 @opindex Wstrict-prototypes
3207 Warn if a function is declared or defined without specifying the
3208 argument types.  (An old-style function definition is permitted without
3209 a warning if preceded by a declaration which specifies the argument
3210 types.)
3211
3212 @item -Wold-style-definition @r{(C only)}
3213 @opindex Wold-style-definition
3214 Warn if an old-style function definition is used.  A warning is given
3215 even if there is a previous prototype.
3216
3217 @item -Wmissing-prototypes @r{(C only)}
3218 @opindex Wmissing-prototypes
3219 Warn if a global function is defined without a previous prototype
3220 declaration.  This warning is issued even if the definition itself
3221 provides a prototype.  The aim is to detect global functions that fail
3222 to be declared in header files.
3223
3224 @item -Wmissing-declarations @r{(C and C++ only)}
3225 @opindex Wmissing-declarations
3226 Warn if a global function is defined without a previous declaration.
3227 Do so even if the definition itself provides a prototype.
3228 Use this option to detect global functions that are not declared in
3229 header files.  In C++, no warnings are issued for function templates,
3230 or for inline functions, or for functions in anonymous namespaces.
3231
3232 @item -Wmissing-field-initializers
3233 @opindex Wmissing-field-initializers
3234 @opindex W
3235 @opindex Wextra
3236 Warn if a structure's initializer has some fields missing.  For
3237 example, the following code would cause such a warning, because
3238 @code{x.h} is implicitly zero:
3239
3240 @smallexample
3241 struct s @{ int f, g, h; @};
3242 struct s x = @{ 3, 4 @};
3243 @end smallexample
3244
3245 This option does not warn about designated initializers, so the following
3246 modification would not trigger a warning:
3247
3248 @smallexample
3249 struct s @{ int f, g, h; @};
3250 struct s x = @{ .f = 3, .g = 4 @};
3251 @end smallexample
3252
3253 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3254 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3255
3256 @item -Wmissing-noreturn
3257 @opindex Wmissing-noreturn
3258 Warn about functions which might be candidates for attribute @code{noreturn}.
3259 Note these are only possible candidates, not absolute ones.  Care should
3260 be taken to manually verify functions actually do not ever return before
3261 adding the @code{noreturn} attribute, otherwise subtle code generation
3262 bugs could be introduced.  You will not get a warning for @code{main} in
3263 hosted C environments.
3264
3265 @item -Wmissing-format-attribute
3266 @opindex Wmissing-format-attribute
3267 @opindex Wformat
3268 Warn about function pointers which might be candidates for @code{format}
3269 attributes.  Note these are only possible candidates, not absolute ones.
3270 GCC will guess that function pointers with @code{format} attributes that
3271 are used in assignment, initialization, parameter passing or return
3272 statements should have a corresponding @code{format} attribute in the
3273 resulting type.  I.e.@: the left-hand side of the assignment or
3274 initialization, the type of the parameter variable, or the return type
3275 of the containing function respectively should also have a @code{format}
3276 attribute to avoid the warning.
3277
3278 GCC will also warn about function definitions which might be
3279 candidates for @code{format} attributes.  Again, these are only
3280 possible candidates.  GCC will guess that @code{format} attributes
3281 might be appropriate for any function that calls a function like
3282 @code{vprintf} or @code{vscanf}, but this might not always be the
3283 case, and some functions for which @code{format} attributes are
3284 appropriate may not be detected.
3285
3286 @item -Wno-multichar
3287 @opindex Wno-multichar
3288 @opindex Wmultichar
3289 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3290 Usually they indicate a typo in the user's code, as they have
3291 implementation-defined values, and should not be used in portable code.
3292
3293 @item -Wnormalized=<none|id|nfc|nfkc>
3294 @opindex Wnormalized
3295 @cindex NFC
3296 @cindex NFKC
3297 @cindex character set, input normalization
3298 In ISO C and ISO C++, two identifiers are different if they are
3299 different sequences of characters.  However, sometimes when characters
3300 outside the basic ASCII character set are used, you can have two
3301 different character sequences that look the same.  To avoid confusion,
3302 the ISO 10646 standard sets out some @dfn{normalization rules} which
3303 when applied ensure that two sequences that look the same are turned into
3304 the same sequence.  GCC can warn you if you are using identifiers which
3305 have not been normalized; this option controls that warning.
3306
3307 There are four levels of warning that GCC supports.  The default is
3308 @option{-Wnormalized=nfc}, which warns about any identifier which is
3309 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3310 recommended form for most uses.
3311
3312 Unfortunately, there are some characters which ISO C and ISO C++ allow
3313 in identifiers that when turned into NFC aren't allowable as
3314 identifiers.  That is, there's no way to use these symbols in portable
3315 ISO C or C++ and have all your identifiers in NFC.
3316 @option{-Wnormalized=id} suppresses the warning for these characters.
3317 It is hoped that future versions of the standards involved will correct
3318 this, which is why this option is not the default.
3319
3320 You can switch the warning off for all characters by writing
3321 @option{-Wnormalized=none}.  You would only want to do this if you
3322 were using some other normalization scheme (like ``D''), because
3323 otherwise you can easily create bugs that are literally impossible to see.
3324
3325 Some characters in ISO 10646 have distinct meanings but look identical
3326 in some fonts or display methodologies, especially once formatting has
3327 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3328 LETTER N'', will display just like a regular @code{n} which has been
3329 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3330 normalization scheme to convert all these into a standard form as
3331 well, and GCC will warn if your code is not in NFKC if you use
3332 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3333 about every identifier that contains the letter O because it might be
3334 confused with the digit 0, and so is not the default, but may be
3335 useful as a local coding convention if the programming environment is
3336 unable to be fixed to display these characters distinctly.
3337
3338 @item -Wno-deprecated-declarations
3339 @opindex Wno-deprecated-declarations
3340 Do not warn about uses of functions (@pxref{Function Attributes}),
3341 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3342 Attributes}) marked as deprecated by using the @code{deprecated}
3343 attribute.
3344
3345 @item -Wno-overflow
3346 @opindex Wno-overflow
3347 Do not warn about compile-time overflow in constant expressions.
3348
3349 @item -Woverride-init
3350 @opindex Woverride-init
3351 @opindex W
3352 @opindex Wextra
3353 Warn if an initialized field without side effects is overridden when
3354 using designated initializers (@pxref{Designated Inits, , Designated
3355 Initializers}).
3356
3357 This warning is included in @option{-Wextra}.  To get other
3358 @option{-Wextra} warnings without this one, use @samp{-Wextra
3359 -Wno-override-init}.
3360
3361 @item -Wpacked
3362 @opindex Wpacked
3363 Warn if a structure is given the packed attribute, but the packed
3364 attribute has no effect on the layout or size of the structure.
3365 Such structures may be mis-aligned for little benefit.  For
3366 instance, in this code, the variable @code{f.x} in @code{struct bar}
3367 will be misaligned even though @code{struct bar} does not itself
3368 have the packed attribute:
3369
3370 @smallexample
3371 @group
3372 struct foo @{
3373   int x;
3374   char a, b, c, d;
3375 @} __attribute__((packed));
3376 struct bar @{
3377   char z;
3378   struct foo f;
3379 @};
3380 @end group
3381 @end smallexample
3382
3383 @item -Wpadded
3384 @opindex Wpadded
3385 Warn if padding is included in a structure, either to align an element
3386 of the structure or to align the whole structure.  Sometimes when this
3387 happens it is possible to rearrange the fields of the structure to
3388 reduce the padding and so make the structure smaller.
3389
3390 @item -Wredundant-decls
3391 @opindex Wredundant-decls
3392 Warn if anything is declared more than once in the same scope, even in
3393 cases where multiple declaration is valid and changes nothing.
3394
3395 @item -Wnested-externs @r{(C only)}
3396 @opindex Wnested-externs
3397 Warn if an @code{extern} declaration is encountered within a function.
3398
3399 @item -Wunreachable-code
3400 @opindex Wunreachable-code
3401 Warn if the compiler detects that code will never be executed.
3402
3403 This option is intended to warn when the compiler detects that at
3404 least a whole line of source code will never be executed, because
3405 some condition is never satisfied or because it is after a
3406 procedure that never returns.
3407
3408 It is possible for this option to produce a warning even though there
3409 are circumstances under which part of the affected line can be executed,
3410 so care should be taken when removing apparently-unreachable code.
3411
3412 For instance, when a function is inlined, a warning may mean that the
3413 line is unreachable in only one inlined copy of the function.
3414
3415 This option is not made part of @option{-Wall} because in a debugging
3416 version of a program there is often substantial code which checks
3417 correct functioning of the program and is, hopefully, unreachable
3418 because the program does work.  Another common use of unreachable
3419 code is to provide behavior which is selectable at compile-time.
3420
3421 @item -Winline
3422 @opindex Winline
3423 Warn if a function can not be inlined and it was declared as inline.
3424 Even with this option, the compiler will not warn about failures to
3425 inline functions declared in system headers.
3426
3427 The compiler uses a variety of heuristics to determine whether or not
3428 to inline a function.  For example, the compiler takes into account
3429 the size of the function being inlined and the amount of inlining
3430 that has already been done in the current function.  Therefore,
3431 seemingly insignificant changes in the source program can cause the
3432 warnings produced by @option{-Winline} to appear or disappear.
3433
3434 @item -Wno-invalid-offsetof @r{(C++ only)}
3435 @opindex Wno-invalid-offsetof
3436 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3437 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3438 to a non-POD type is undefined.  In existing C++ implementations,
3439 however, @samp{offsetof} typically gives meaningful results even when
3440 applied to certain kinds of non-POD types. (Such as a simple
3441 @samp{struct} that fails to be a POD type only by virtue of having a
3442 constructor.)  This flag is for users who are aware that they are
3443 writing nonportable code and who have deliberately chosen to ignore the
3444 warning about it.
3445
3446 The restrictions on @samp{offsetof} may be relaxed in a future version
3447 of the C++ standard.
3448
3449 @item -Wno-int-to-pointer-cast @r{(C only)}
3450 @opindex Wno-int-to-pointer-cast
3451 Suppress warnings from casts to pointer type of an integer of a
3452 different size.
3453
3454 @item -Wno-pointer-to-int-cast @r{(C only)}
3455 @opindex Wno-pointer-to-int-cast
3456 Suppress warnings from casts from a pointer to an integer type of a
3457 different size.
3458
3459 @item -Winvalid-pch
3460 @opindex Winvalid-pch
3461 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3462 the search path but can't be used.
3463
3464 @item -Wlong-long
3465 @opindex Wlong-long
3466 @opindex Wno-long-long
3467 Warn if @samp{long long} type is used.  This is default.  To inhibit
3468 the warning messages, use @option{-Wno-long-long}.  Flags
3469 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3470 only when @option{-pedantic} flag is used.
3471
3472 @item -Wvariadic-macros
3473 @opindex Wvariadic-macros
3474 @opindex Wno-variadic-macros
3475 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3476 alternate syntax when in pedantic ISO C99 mode.  This is default.
3477 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3478
3479 @item -Wvolatile-register-var
3480 @opindex Wvolatile-register-var
3481 @opindex Wno-volatile-register-var
3482 Warn if a register variable is declared volatile.  The volatile
3483 modifier does not inhibit all optimizations that may eliminate reads
3484 and/or writes to register variables.
3485
3486 @item -Wdisabled-optimization
3487 @opindex Wdisabled-optimization
3488 Warn if a requested optimization pass is disabled.  This warning does
3489 not generally indicate that there is anything wrong with your code; it
3490 merely indicates that GCC's optimizers were unable to handle the code
3491 effectively.  Often, the problem is that your code is too big or too
3492 complex; GCC will refuse to optimize programs when the optimization
3493 itself is likely to take inordinate amounts of time.
3494
3495 @item -Wpointer-sign
3496 @opindex Wpointer-sign
3497 @opindex Wno-pointer-sign
3498 Warn for pointer argument passing or assignment with different signedness.
3499 This option is only supported for C and Objective-C@.  It is implied by
3500 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3501 @option{-Wno-pointer-sign}.
3502
3503 @item -Werror
3504 @opindex Werror
3505 Make all warnings into errors.
3506
3507 @item -Werror=
3508 @opindex Werror=
3509 Make the specified warning into an errors.  The specifier for a
3510 warning is appended, for example @option{-Werror=switch} turns the
3511 warnings controlled by @option{-Wswitch} into errors.  This switch
3512 takes a negative form, to be used to negate @option{-Werror} for
3513 specific warnings, for example @option{-Wno-error=switch} makes
3514 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3515 is in effect.  You can use the @option{-fdiagnostics-show-option}
3516 option to have each controllable warning amended with the option which
3517 controls it, to determine what to use with this option.
3518
3519 Note that specifying @option{-Werror=}@var{foo} automatically implies
3520 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3521 imply anything.
3522
3523 @item -Wstack-protector
3524 @opindex Wstack-protector
3525 This option is only active when @option{-fstack-protector} is active.  It
3526 warns about functions that will not be protected against stack smashing.
3527
3528 @item -Wstring-literal-comparison
3529 @opindex Wstring-literal-comparison
3530 Warn about suspicious comparisons to string literal constants.  In C,
3531 direct comparisons against the memory address of a string literal, such
3532 as @code{if (x == "abc")}, typically indicate a programmer error, and
3533 even when intentional, result in unspecified behavior and are not portable.
3534 Usually these warnings alert that the programmer intended to use
3535 @code{strcmp}.  This warning is enabled by @option{-Wall}.
3536
3537 @item -Woverlength-strings
3538 @opindex Woverlength-strings
3539 Warn about string constants which are longer than the ``minimum
3540 maximum'' length specified in the C standard.  Modern compilers
3541 generally allow string constants which are much longer than the
3542 standard's minimum limit, but very portable programs should avoid
3543 using longer strings.
3544
3545 The limit applies @emph{after} string constant concatenation, and does
3546 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3547 C99, it was raised to 4095.  C++98 does not specify a normative
3548 minimum maximum, so we do not diagnose overlength strings in C++@.
3549
3550 This option is implied by @option{-pedantic}, and can be disabled with
3551 @option{-Wno-overlength-strings}.
3552 @end table
3553
3554 @node Debugging Options
3555 @section Options for Debugging Your Program or GCC
3556 @cindex options, debugging
3557 @cindex debugging information options
3558
3559 GCC has various special options that are used for debugging
3560 either your program or GCC:
3561
3562 @table @gcctabopt
3563 @item -g
3564 @opindex g
3565 Produce debugging information in the operating system's native format
3566 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3567 information.
3568
3569 On most systems that use stabs format, @option{-g} enables use of extra
3570 debugging information that only GDB can use; this extra information
3571 makes debugging work better in GDB but will probably make other debuggers
3572 crash or
3573 refuse to read the program.  If you want to control for certain whether
3574 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3575 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3576
3577 GCC allows you to use @option{-g} with
3578 @option{-O}.  The shortcuts taken by optimized code may occasionally
3579 produce surprising results: some variables you declared may not exist
3580 at all; flow of control may briefly move where you did not expect it;
3581 some statements may not be executed because they compute constant
3582 results or their values were already at hand; some statements may
3583 execute in different places because they were moved out of loops.
3584
3585 Nevertheless it proves possible to debug optimized output.  This makes
3586 it reasonable to use the optimizer for programs that might have bugs.
3587
3588 The following options are useful when GCC is generated with the
3589 capability for more than one debugging format.
3590
3591 @item -ggdb
3592 @opindex ggdb
3593 Produce debugging information for use by GDB@.  This means to use the
3594 most expressive format available (DWARF 2, stabs, or the native format
3595 if neither of those are supported), including GDB extensions if at all
3596 possible.
3597
3598 @item -gstabs
3599 @opindex gstabs
3600 Produce debugging information in stabs format (if that is supported),
3601 without GDB extensions.  This is the format used by DBX on most BSD
3602 systems.  On MIPS, Alpha and System V Release 4 systems this option
3603 produces stabs debugging output which is not understood by DBX or SDB@.
3604 On System V Release 4 systems this option requires the GNU assembler.
3605
3606 @item -feliminate-unused-debug-symbols
3607 @opindex feliminate-unused-debug-symbols
3608 Produce debugging information in stabs format (if that is supported),
3609 for only symbols that are actually used.
3610
3611 @item -femit-class-debug-always
3612 Instead of emitting debugging information for a C++ class in only one
3613 object file, emit it in all object files using the class.  This option
3614 should be used only with debuggers that are unable to handle the way GCC
3615 normally emits debugging information for classes because using this
3616 option will increase the size of debugging information by as much as a
3617 factor of two.
3618
3619 @item -gstabs+
3620 @opindex gstabs+
3621 Produce debugging information in stabs format (if that is supported),
3622 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3623 use of these extensions is likely to make other debuggers crash or
3624 refuse to read the program.
3625
3626 @item -gcoff
3627 @opindex gcoff
3628 Produce debugging information in COFF format (if that is supported).
3629 This is the format used by SDB on most System V systems prior to
3630 System V Release 4.
3631
3632 @item -gxcoff
3633 @opindex gxcoff
3634 Produce debugging information in XCOFF format (if that is supported).
3635 This is the format used by the DBX debugger on IBM RS/6000 systems.
3636
3637 @item -gxcoff+
3638 @opindex gxcoff+
3639 Produce debugging information in XCOFF format (if that is supported),
3640 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3641 use of these extensions is likely to make other debuggers crash or
3642 refuse to read the program, and may cause assemblers other than the GNU
3643 assembler (GAS) to fail with an error.
3644
3645 @item -gdwarf-2
3646 @opindex gdwarf-2
3647 Produce debugging information in DWARF version 2 format (if that is
3648 supported).  This is the format used by DBX on IRIX 6.  With this
3649 option, GCC uses features of DWARF version 3 when they are useful;
3650 version 3 is upward compatible with version 2, but may still cause
3651 problems for older debuggers.
3652
3653 @item -gvms
3654 @opindex gvms
3655 Produce debugging information in VMS debug format (if that is
3656 supported).  This is the format used by DEBUG on VMS systems.
3657
3658 @item -g@var{level}
3659 @itemx -ggdb@var{level}
3660 @itemx -gstabs@var{level}
3661 @itemx -gcoff@var{level}
3662 @itemx -gxcoff@var{level}
3663 @itemx -gvms@var{level}
3664 Request debugging information and also use @var{level} to specify how
3665 much information.  The default level is 2.
3666
3667 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
3668 @option{-g}.
3669
3670 Level 1 produces minimal information, enough for making backtraces in
3671 parts of the program that you don't plan to debug.  This includes
3672 descriptions of functions and external variables, but no information
3673 about local variables and no line numbers.
3674
3675 Level 3 includes extra information, such as all the macro definitions
3676 present in the program.  Some debuggers support macro expansion when
3677 you use @option{-g3}.
3678
3679 @option{-gdwarf-2} does not accept a concatenated debug level, because
3680 GCC used to support an option @option{-gdwarf} that meant to generate
3681 debug information in version 1 of the DWARF format (which is very
3682 different from version 2), and it would have been too confusing.  That
3683 debug format is long obsolete, but the option cannot be changed now.
3684 Instead use an additional @option{-g@var{level}} option to change the
3685 debug level for DWARF2.
3686
3687 @item -feliminate-dwarf2-dups
3688 @opindex feliminate-dwarf2-dups
3689 Compress DWARF2 debugging information by eliminating duplicated
3690 information about each symbol.  This option only makes sense when
3691 generating DWARF2 debugging information with @option{-gdwarf-2}.
3692
3693 @cindex @command{prof}
3694 @item -p
3695 @opindex p
3696 Generate extra code to write profile information suitable for the
3697 analysis program @command{prof}.  You must use this option when compiling
3698 the source files you want data about, and you must also use it when
3699 linking.
3700
3701 @cindex @command{gprof}
3702 @item -pg
3703 @opindex pg
3704 Generate extra code to write profile information suitable for the
3705 analysis program @command{gprof}.  You must use this option when compiling
3706 the source files you want data about, and you must also use it when
3707 linking.
3708
3709 @item -Q
3710 @opindex Q
3711 Makes the compiler print out each function name as it is compiled, and
3712 print some statistics about each pass when it finishes.
3713
3714 @item -ftime-report
3715 @opindex ftime-report
3716 Makes the compiler print some statistics about the time consumed by each
3717 pass when it finishes.
3718
3719 @item -fmem-report
3720 @opindex fmem-report
3721 Makes the compiler print some statistics about permanent memory
3722 allocation when it finishes.
3723
3724 @item -fprofile-arcs
3725 @opindex fprofile-arcs
3726 Add code so that program flow @dfn{arcs} are instrumented.  During
3727 execution the program records how many times each branch and call is
3728 executed and how many times it is taken or returns.  When the compiled
3729 program exits it saves this data to a file called
3730 @file{@var{auxname}.gcda} for each source file.  The data may be used for
3731 profile-directed optimizations (@option{-fbranch-probabilities}), or for
3732 test coverage analysis (@option{-ftest-coverage}).  Each object file's
3733 @var{auxname} is generated from the name of the output file, if
3734 explicitly specified and it is not the final executable, otherwise it is
3735 the basename of the source file.  In both cases any suffix is removed
3736 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
3737 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
3738 @xref{Cross-profiling}.
3739
3740 @cindex @command{gcov}
3741 @item --coverage
3742 @opindex coverage
3743
3744 This option is used to compile and link code instrumented for coverage
3745 analysis.  The option is a synonym for @option{-fprofile-arcs}
3746 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
3747 linking).  See the documentation for those options for more details.
3748
3749 @itemize
3750
3751 @item
3752 Compile the source files with @option{-fprofile-arcs} plus optimization
3753 and code generation options.  For test coverage analysis, use the
3754 additional @option{-ftest-coverage} option.  You do not need to profile
3755 every source file in a program.
3756
3757 @item
3758 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
3759 (the latter implies the former).
3760
3761 @item
3762 Run the program on a representative workload to generate the arc profile
3763 information.  This may be repeated any number of times.  You can run
3764 concurrent instances of your program, and provided that the file system
3765 supports locking, the data files will be correctly updated.  Also
3766 @code{fork} calls are detected and correctly handled (double counting
3767 will not happen).
3768
3769 @item
3770 For profile-directed optimizations, compile the source files again with
3771 the same optimization and code generation options plus
3772 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
3773 Control Optimization}).
3774
3775 @item
3776 For test coverage analysis, use @command{gcov} to produce human readable
3777 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
3778 @command{gcov} documentation for further information.
3779
3780 @end itemize
3781
3782 With @option{-fprofile-arcs}, for each function of your program GCC
3783 creates a program flow graph, then finds a spanning tree for the graph.
3784 Only arcs that are not on the spanning tree have to be instrumented: the
3785 compiler adds code to count the number of times that these arcs are
3786 executed.  When an arc is the only exit or only entrance to a block, the
3787 instrumentation code can be added to the block; otherwise, a new basic
3788 block must be created to hold the instrumentation code.
3789
3790 @need 2000
3791 @item -ftest-coverage
3792 @opindex ftest-coverage
3793 Produce a notes file that the @command{gcov} code-coverage utility
3794 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
3795 show program coverage.  Each source file's note file is called
3796 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
3797 above for a description of @var{auxname} and instructions on how to
3798 generate test coverage data.  Coverage data will match the source files
3799 more closely, if you do not optimize.
3800
3801 @item -d@var{letters}
3802 @item -fdump-rtl-@var{pass}
3803 @opindex d
3804 Says to make debugging dumps during compilation at times specified by
3805 @var{letters}.    This is used for debugging the RTL-based passes of the
3806 compiler.  The file names for most of the dumps are made by appending a
3807 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
3808 from the name of the output file, if explicitly specified and it is not
3809 an executable, otherwise it is the basename of the source file.
3810
3811 Most debug dumps can be enabled either passing a letter to the @option{-d}
3812 option, or with a long @option{-fdump-rtl} switch; here are the possible
3813 letters for use in @var{letters} and @var{pass}, and their meanings:
3814
3815 @table @gcctabopt
3816 @item -dA
3817 @opindex dA
3818 Annotate the assembler output with miscellaneous debugging information.
3819
3820 @item -dB
3821 @itemx -fdump-rtl-bbro
3822 @opindex dB
3823 @opindex fdump-rtl-bbro
3824 Dump after block reordering, to @file{@var{file}.148r.bbro}.
3825
3826 @item -dc
3827 @itemx -fdump-rtl-combine
3828 @opindex dc
3829 @opindex fdump-rtl-combine
3830 Dump after instruction combination, to the file @file{@var{file}.129r.combine}.
3831
3832 @item -dC
3833 @itemx -fdump-rtl-ce1
3834 @itemx -fdump-rtl-ce2
3835 @opindex dC
3836 @opindex fdump-rtl-ce1
3837 @opindex fdump-rtl-ce2
3838 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
3839 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
3840 and @option{-fdump-rtl-ce2} enable dumping after the second if
3841 conversion, to the file @file{@var{file}.130r.ce2}.
3842
3843 @item -dd
3844 @itemx -fdump-rtl-btl
3845 @itemx -fdump-rtl-dbr
3846 @opindex dd
3847 @opindex fdump-rtl-btl
3848 @opindex fdump-rtl-dbr
3849 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
3850 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
3851 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
3852 scheduling, to @file{@var{file}.36.dbr}.
3853
3854 @item -dD
3855 @opindex dD
3856 Dump all macro definitions, at the end of preprocessing, in addition to
3857 normal output.
3858
3859 @item -dE
3860 @itemx -fdump-rtl-ce3
3861 @opindex dE
3862 @opindex fdump-rtl-ce3
3863 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
3864
3865 @item -df
3866 @itemx -fdump-rtl-cfg
3867 @itemx -fdump-rtl-life
3868 @opindex df
3869 @opindex fdump-rtl-cfg
3870 @opindex fdump-rtl-life
3871 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
3872 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
3873 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
3874 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
3875
3876 @item -dg
3877 @itemx -fdump-rtl-greg
3878 @opindex dg
3879 @opindex fdump-rtl-greg
3880 Dump after global register allocation, to @file{@var{file}.139r.greg}.
3881
3882 @item -dG
3883 @itemx -fdump-rtl-gcse
3884 @itemx -fdump-rtl-bypass
3885 @opindex dG
3886 @opindex fdump-rtl-gcse
3887 @opindex fdump-rtl-bypass
3888 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
3889 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
3890 enable dumping after jump bypassing and control flow optimizations, to
3891 @file{@var{file}.115r.bypass}.
3892
3893 @item -dh
3894 @itemx -fdump-rtl-eh
3895 @opindex dh
3896 @opindex fdump-rtl-eh
3897 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
3898
3899 @item -di
3900 @itemx -fdump-rtl-sibling
3901 @opindex di
3902 @opindex fdump-rtl-sibling
3903 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
3904
3905 @item -dj
3906 @itemx -fdump-rtl-jump
3907 @opindex dj
3908 @opindex fdump-rtl-jump
3909 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
3910
3911 @item -dk
3912 @itemx -fdump-rtl-stack
3913 @opindex dk
3914 @opindex fdump-rtl-stack
3915 Dump after conversion from registers to stack, to @file{@var{file}.152r.stack}.
3916
3917 @item -dl
3918 @itemx -fdump-rtl-lreg
3919 @opindex dl
3920 @opindex fdump-rtl-lreg
3921 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
3922
3923 @item -dL
3924 @itemx -fdump-rtl-loop2
3925 @opindex dL
3926 @opindex fdump-rtl-loop2
3927 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
3928 loop optimization pass, to @file{@var{file}.119r.loop2},
3929 @file{@var{file}.120r.loop2_init},
3930 @file{@var{file}.121r.loop2_invariant}, and
3931 @file{@var{file}.125r.loop2_done}.
3932
3933 @item -dm
3934 @itemx -fdump-rtl-sms
3935 @opindex dm
3936 @opindex fdump-rtl-sms
3937 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
3938
3939 @item -dM
3940 @itemx -fdump-rtl-mach
3941 @opindex dM
3942 @opindex fdump-rtl-mach
3943 Dump after performing the machine dependent reorganization pass, to
3944 @file{@var{file}.155r.mach}.
3945
3946 @item -dn
3947 @itemx -fdump-rtl-rnreg
3948 @opindex dn
3949 @opindex fdump-rtl-rnreg
3950 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
3951
3952 @item -dN
3953 @itemx -fdump-rtl-regmove
3954 @opindex dN
3955 @opindex fdump-rtl-regmove
3956 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
3957
3958 @item -do
3959 @itemx -fdump-rtl-postreload
3960 @opindex do
3961 @opindex fdump-rtl-postreload
3962 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
3963
3964 @item -dr
3965 @itemx -fdump-rtl-expand
3966 @opindex dr
3967 @opindex fdump-rtl-expand
3968 Dump after RTL generation, to @file{@var{file}.104r.expand}.
3969
3970 @item -dR
3971 @itemx -fdump-rtl-sched2
3972 @opindex dR
3973 @opindex fdump-rtl-sched2
3974 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
3975
3976 @item -ds
3977 @itemx -fdump-rtl-cse
3978 @opindex ds
3979 @opindex fdump-rtl-cse
3980 Dump after CSE (including the jump optimization that sometimes follows
3981 CSE), to @file{@var{file}.113r.cse}.
3982
3983 @item -dS
3984 @itemx -fdump-rtl-sched1
3985 @opindex dS
3986 @opindex fdump-rtl-sched1
3987 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
3988
3989 @item -dt
3990 @itemx -fdump-rtl-cse2
3991 @opindex dt
3992 @opindex fdump-rtl-cse2
3993 Dump after the second CSE pass (including the jump optimization that
3994 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
3995
3996 @item -dT
3997 @itemx -fdump-rtl-tracer
3998 @opindex dT
3999 @opindex fdump-rtl-tracer
4000 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4001
4002 @item -dV
4003 @itemx -fdump-rtl-vpt
4004 @itemx -fdump-rtl-vartrack
4005 @opindex dV
4006 @opindex fdump-rtl-vpt
4007 @opindex fdump-rtl-vartrack
4008 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4009 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4010 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4011 to @file{@var{file}.154r.vartrack}.
4012
4013 @item -dw
4014 @itemx -fdump-rtl-flow2
4015 @opindex dw
4016 @opindex fdump-rtl-flow2
4017 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4018
4019 @item -dz
4020 @itemx -fdump-rtl-peephole2
4021 @opindex dz
4022 @opindex fdump-rtl-peephole2
4023 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4024
4025 @item -dZ
4026 @itemx -fdump-rtl-web
4027 @opindex dZ
4028 @opindex fdump-rtl-web
4029 Dump after live range splitting, to @file{@var{file}.126r.web}.
4030
4031 @item -da
4032 @itemx -fdump-rtl-all
4033 @opindex da
4034 @opindex fdump-rtl-all
4035 Produce all the dumps listed above.
4036
4037 @item -dH
4038 @opindex dH
4039 Produce a core dump whenever an error occurs.
4040
4041 @item -dm
4042 @opindex dm
4043 Print statistics on memory usage, at the end of the run, to
4044 standard error.
4045
4046 @item -dp
4047 @opindex dp
4048 Annotate the assembler output with a comment indicating which
4049 pattern and alternative was used.  The length of each instruction is
4050 also printed.
4051
4052 @item -dP
4053 @opindex dP
4054 Dump the RTL in the assembler output as a comment before each instruction.
4055 Also turns on @option{-dp} annotation.
4056
4057 @item -dv
4058 @opindex dv
4059 For each of the other indicated dump files (either with @option{-d} or
4060 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4061 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4062
4063 @item -dx
4064 @opindex dx
4065 Just generate RTL for a function instead of compiling it.  Usually used
4066 with @samp{r} (@option{-fdump-rtl-expand}).
4067
4068 @item -dy
4069 @opindex dy
4070 Dump debugging information during parsing, to standard error.
4071 @end table
4072
4073 @item -fdump-noaddr
4074 @opindex fdump-noaddr
4075 When doing debugging dumps (see @option{-d} option above), suppress
4076 address output.  This makes it more feasible to use diff on debugging
4077 dumps for compiler invocations with different compiler binaries and/or
4078 different text / bss / data / heap / stack / dso start locations.
4079
4080 @item -fdump-unnumbered
4081 @opindex fdump-unnumbered
4082 When doing debugging dumps (see @option{-d} option above), suppress instruction
4083 numbers, line number note and address output.  This makes it more feasible to
4084 use diff on debugging dumps for compiler invocations with different
4085 options, in particular with and without @option{-g}.
4086
4087 @item -fdump-translation-unit @r{(C++ only)}
4088 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4089 @opindex fdump-translation-unit
4090 Dump a representation of the tree structure for the entire translation
4091 unit to a file.  The file name is made by appending @file{.tu} to the
4092 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4093 controls the details of the dump as described for the
4094 @option{-fdump-tree} options.
4095
4096 @item -fdump-class-hierarchy @r{(C++ only)}
4097 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4098 @opindex fdump-class-hierarchy
4099 Dump a representation of each class's hierarchy and virtual function
4100 table layout to a file.  The file name is made by appending @file{.class}
4101 to the source file name.  If the @samp{-@var{options}} form is used,
4102 @var{options} controls the details of the dump as described for the
4103 @option{-fdump-tree} options.
4104
4105 @item -fdump-ipa-@var{switch}
4106 @opindex fdump-ipa
4107 Control the dumping at various stages of inter-procedural analysis
4108 language tree to a file.  The file name is generated by appending a switch
4109 specific suffix to the source file name.  The following dumps are possible:
4110
4111 @table @samp
4112 @item all
4113 Enables all inter-procedural analysis dumps; currently the only produced
4114 dump is the @samp{cgraph} dump.
4115
4116 @item cgraph
4117 Dumps information about call-graph optimization, unused function removal,
4118 and inlining decisions.
4119 @end table
4120
4121 @item -fdump-tree-@var{switch}
4122 @itemx -fdump-tree-@var{switch}-@var{options}
4123 @opindex fdump-tree
4124 Control the dumping at various stages of processing the intermediate
4125 language tree to a file.  The file name is generated by appending a switch
4126 specific suffix to the source file name.  If the @samp{-@var{options}}
4127 form is used, @var{options} is a list of @samp{-} separated options that
4128 control the details of the dump.  Not all options are applicable to all
4129 dumps, those which are not meaningful will be ignored.  The following
4130 options are available
4131
4132 @table @samp
4133 @item address
4134 Print the address of each node.  Usually this is not meaningful as it
4135 changes according to the environment and source file.  Its primary use
4136 is for tying up a dump file with a debug environment.
4137 @item slim
4138 Inhibit dumping of members of a scope or body of a function merely
4139 because that scope has been reached.  Only dump such items when they
4140 are directly reachable by some other path.  When dumping pretty-printed
4141 trees, this option inhibits dumping the bodies of control structures.
4142 @item raw
4143 Print a raw representation of the tree.  By default, trees are
4144 pretty-printed into a C-like representation.
4145 @item details
4146 Enable more detailed dumps (not honored by every dump option).
4147 @item stats
4148 Enable dumping various statistics about the pass (not honored by every dump
4149 option).
4150 @item blocks
4151 Enable showing basic block boundaries (disabled in raw dumps).
4152 @item vops
4153 Enable showing virtual operands for every statement.
4154 @item lineno
4155 Enable showing line numbers for statements.
4156 @item uid
4157 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4158 @item all
4159 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4160 @end table
4161
4162 The following tree dumps are possible:
4163 @table @samp
4164
4165 @item original
4166 Dump before any tree based optimization, to @file{@var{file}.original}.
4167
4168 @item optimized
4169 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4170
4171 @item inlined
4172 Dump after function inlining, to @file{@var{file}.inlined}.
4173
4174 @item gimple
4175 @opindex fdump-tree-gimple
4176 Dump each function before and after the gimplification pass to a file.  The
4177 file name is made by appending @file{.gimple} to the source file name.
4178
4179 @item cfg
4180 @opindex fdump-tree-cfg
4181 Dump the control flow graph of each function to a file.  The file name is
4182 made by appending @file{.cfg} to the source file name.
4183
4184 @item vcg
4185 @opindex fdump-tree-vcg
4186 Dump the control flow graph of each function to a file in VCG format.  The
4187 file name is made by appending @file{.vcg} to the source file name.  Note
4188 that if the file contains more than one function, the generated file cannot
4189 be used directly by VCG@.  You will need to cut and paste each function's
4190 graph into its own separate file first.
4191
4192 @item ch
4193 @opindex fdump-tree-ch
4194 Dump each function after copying loop headers.  The file name is made by
4195 appending @file{.ch} to the source file name.
4196
4197 @item ssa
4198 @opindex fdump-tree-ssa
4199 Dump SSA related information to a file.  The file name is made by appending
4200 @file{.ssa} to the source file name.
4201
4202 @item salias
4203 @opindex fdump-tree-salias
4204 Dump structure aliasing variable information to a file.  This file name
4205 is made by appending @file{.salias} to the source file name.
4206
4207 @item alias
4208 @opindex fdump-tree-alias
4209 Dump aliasing information for each function.  The file name is made by
4210 appending @file{.alias} to the source file name.
4211
4212 @item ccp
4213 @opindex fdump-tree-ccp
4214 Dump each function after CCP@.  The file name is made by appending
4215 @file{.ccp} to the source file name.
4216
4217 @item storeccp
4218 @opindex fdump-tree-storeccp
4219 Dump each function after STORE-CCP.  The file name is made by appending
4220 @file{.storeccp} to the source file name.
4221
4222 @item pre
4223 @opindex fdump-tree-pre
4224 Dump trees after partial redundancy elimination.  The file name is made
4225 by appending @file{.pre} to the source file name.
4226
4227 @item fre
4228 @opindex fdump-tree-fre
4229 Dump trees after full redundancy elimination.  The file name is made
4230 by appending @file{.fre} to the source file name.
4231
4232 @item copyprop
4233 @opindex fdump-tree-copyprop
4234 Dump trees after copy propagation.  The file name is made
4235 by appending @file{.copyprop} to the source file name.
4236
4237 @item store_copyprop
4238 @opindex fdump-tree-store_copyprop
4239 Dump trees after store copy-propagation.  The file name is made
4240 by appending @file{.store_copyprop} to the source file name.
4241
4242 @item dce
4243 @opindex fdump-tree-dce
4244 Dump each function after dead code elimination.  The file name is made by
4245 appending @file{.dce} to the source file name.
4246
4247 @item mudflap
4248 @opindex fdump-tree-mudflap
4249 Dump each function after adding mudflap instrumentation.  The file name is
4250 made by appending @file{.mudflap} to the source file name.
4251
4252 @item sra
4253 @opindex fdump-tree-sra
4254 Dump each function after performing scalar replacement of aggregates.  The
4255 file name is made by appending @file{.sra} to the source file name.
4256
4257 @item sink
4258 @opindex fdump-tree-sink
4259 Dump each function after performing code sinking.  The file name is made
4260 by appending @file{.sink} to the source file name. 
4261
4262 @item dom
4263 @opindex fdump-tree-dom
4264 Dump each function after applying dominator tree optimizations.  The file
4265 name is made by appending @file{.dom} to the source file name.
4266
4267 @item dse
4268 @opindex fdump-tree-dse
4269 Dump each function after applying dead store elimination.  The file
4270 name is made by appending @file{.dse} to the source file name.
4271
4272 @item phiopt
4273 @opindex fdump-tree-phiopt
4274 Dump each function after optimizing PHI nodes into straightline code.  The file
4275 name is made by appending @file{.phiopt} to the source file name.
4276
4277 @item forwprop
4278 @opindex fdump-tree-forwprop
4279 Dump each function after forward propagating single use variables.  The file
4280 name is made by appending @file{.forwprop} to the source file name.
4281
4282 @item copyrename
4283 @opindex fdump-tree-copyrename
4284 Dump each function after applying the copy rename optimization.  The file
4285 name is made by appending @file{.copyrename} to the source file name.
4286
4287 @item nrv
4288 @opindex fdump-tree-nrv
4289 Dump each function after applying the named return value optimization on
4290 generic trees.  The file name is made by appending @file{.nrv} to the source
4291 file name.
4292
4293 @item vect
4294 @opindex fdump-tree-vect
4295 Dump each function after applying vectorization of loops.  The file name is
4296 made by appending @file{.vect} to the source file name.
4297
4298 @item vrp
4299 @opindex fdump-tree-vrp
4300 Dump each function after Value Range Propagation (VRP).  The file name
4301 is made by appending @file{.vrp} to the source file name.
4302
4303 @item all
4304 @opindex fdump-tree-all
4305 Enable all the available tree dumps with the flags provided in this option.
4306 @end table
4307
4308 @item -ftree-vectorizer-verbose=@var{n}
4309 @opindex ftree-vectorizer-verbose
4310 This option controls the amount of debugging output the vectorizer prints.
4311 This information is written to standard error, unless 
4312 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified, 
4313 in which case it is output to the usual dump listing file, @file{.vect}.
4314 For @var{n}=0 no diagnostic information is reported.
4315 If @var{n}=1 the vectorizer reports each loop that got vectorized, 
4316 and the total number of loops that got vectorized.
4317 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed 
4318 the first analysis phase (vect_analyze_loop_form) - i.e. countable, 
4319 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity 
4320 level that @option{-fdump-tree-vect-stats} uses.
4321 Higher verbosity levels mean either more information dumped for each 
4322 reported loop, or same amount of information reported for more loops:
4323 If @var{n}=3, alignment related information is added to the reports.
4324 If @var{n}=4, data-references related information (e.g. memory dependences, 
4325 memory access-patterns) is added to the reports.
4326 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops 
4327 that did not pass the first analysis phase (i.e. may not be countable, or 
4328 may have complicated control-flow).
4329 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4330 For @var{n}=7, all the information the vectorizer generates during its 
4331 analysis and transformation is reported.  This is the same verbosity level
4332 that @option{-fdump-tree-vect-details} uses.
4333
4334 @item -frandom-seed=@var{string}
4335 @opindex frandom-string
4336 This option provides a seed that GCC uses when it would otherwise use
4337 random numbers.  It is used to generate certain symbol names
4338 that have to be different in every compiled file.  It is also used to
4339 place unique stamps in coverage data files and the object files that
4340 produce them.  You can use the @option{-frandom-seed} option to produce
4341 reproducibly identical object files.
4342
4343 The @var{string} should be different for every file you compile.
4344
4345 @item -fsched-verbose=@var{n}
4346 @opindex fsched-verbose
4347 On targets that use instruction scheduling, this option controls the
4348 amount of debugging output the scheduler prints.  This information is
4349 written to standard error, unless @option{-dS} or @option{-dR} is
4350 specified, in which case it is output to the usual dump
4351 listing file, @file{.sched} or @file{.sched2} respectively.  However
4352 for @var{n} greater than nine, the output is always printed to standard
4353 error.
4354
4355 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4356 same information as @option{-dRS}.  For @var{n} greater than one, it
4357 also output basic block probabilities, detailed ready list information
4358 and unit/insn info.  For @var{n} greater than two, it includes RTL
4359 at abort point, control-flow and regions info.  And for @var{n} over
4360 four, @option{-fsched-verbose} also includes dependence info.
4361
4362 @item -save-temps
4363 @opindex save-temps
4364 Store the usual ``temporary'' intermediate files permanently; place them
4365 in the current directory and name them based on the source file.  Thus,
4366 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4367 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4368 preprocessed @file{foo.i} output file even though the compiler now
4369 normally uses an integrated preprocessor.
4370
4371 When used in combination with the @option{-x} command line option,
4372 @option{-save-temps} is sensible enough to avoid over writing an
4373 input source file with the same extension as an intermediate file.
4374 The corresponding intermediate file may be obtained by renaming the
4375 source file before using @option{-save-temps}.
4376
4377 @item -time
4378 @opindex time
4379 Report the CPU time taken by each subprocess in the compilation
4380 sequence.  For C source files, this is the compiler proper and assembler
4381 (plus the linker if linking is done).  The output looks like this:
4382
4383 @smallexample
4384 # cc1 0.12 0.01
4385 # as 0.00 0.01
4386 @end smallexample
4387
4388 The first number on each line is the ``user time'', that is time spent
4389 executing the program itself.  The second number is ``system time'',
4390 time spent executing operating system routines on behalf of the program.
4391 Both numbers are in seconds.
4392
4393 @item -fvar-tracking
4394 @opindex fvar-tracking
4395 Run variable tracking pass.  It computes where variables are stored at each
4396 position in code.  Better debugging information is then generated
4397 (if the debugging information format supports this information).
4398
4399 It is enabled by default when compiling with optimization (@option{-Os},
4400 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4401 the debug info format supports it.
4402
4403 @item -print-file-name=@var{library}
4404 @opindex print-file-name
4405 Print the full absolute name of the library file @var{library} that
4406 would be used when linking---and don't do anything else.  With this
4407 option, GCC does not compile or link anything; it just prints the
4408 file name.
4409
4410 @item -print-multi-directory
4411 @opindex print-multi-directory
4412 Print the directory name corresponding to the multilib selected by any
4413 other switches present in the command line.  This directory is supposed
4414 to exist in @env{GCC_EXEC_PREFIX}.
4415
4416 @item -print-multi-lib
4417 @opindex print-multi-lib
4418 Print the mapping from multilib directory names to compiler switches
4419 that enable them.  The directory name is separated from the switches by
4420 @samp{;}, and each switch starts with an @samp{@@} instead of the
4421 @samp{-}, without spaces between multiple switches.  This is supposed to
4422 ease shell-processing.
4423
4424 @item -print-prog-name=@var{program}
4425 @opindex print-prog-name
4426 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4427
4428 @item -print-libgcc-file-name
4429 @opindex print-libgcc-file-name
4430 Same as @option{-print-file-name=libgcc.a}.
4431
4432 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4433 but you do want to link with @file{libgcc.a}.  You can do
4434
4435 @smallexample
4436 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4437 @end smallexample
4438
4439 @item -print-search-dirs
4440 @opindex print-search-dirs
4441 Print the name of the configured installation directory and a list of
4442 program and library directories @command{gcc} will search---and don't do anything else.
4443
4444 This is useful when @command{gcc} prints the error message
4445 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4446 To resolve this you either need to put @file{cpp0} and the other compiler
4447 components where @command{gcc} expects to find them, or you can set the environment
4448 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4449 Don't forget the trailing @samp{/}.
4450 @xref{Environment Variables}.
4451
4452 @item -dumpmachine
4453 @opindex dumpmachine
4454 Print the compiler's target machine (for example,
4455 @samp{i686-pc-linux-gnu})---and don't do anything else.
4456
4457 @item -dumpversion
4458 @opindex dumpversion
4459 Print the compiler version (for example, @samp{3.0})---and don't do
4460 anything else.
4461
4462 @item -dumpspecs
4463 @opindex dumpspecs
4464 Print the compiler's built-in specs---and don't do anything else.  (This
4465 is used when GCC itself is being built.)  @xref{Spec Files}.
4466
4467 @item -feliminate-unused-debug-types
4468 @opindex feliminate-unused-debug-types
4469 Normally, when producing DWARF2 output, GCC will emit debugging
4470 information for all types declared in a compilation
4471 unit, regardless of whether or not they are actually used
4472 in that compilation unit.  Sometimes this is useful, such as
4473 if, in the debugger, you want to cast a value to a type that is
4474 not actually used in your program (but is declared).  More often,
4475 however, this results in a significant amount of wasted space.
4476 With this option, GCC will avoid producing debug symbol output
4477 for types that are nowhere used in the source file being compiled.
4478 @end table
4479
4480 @node Optimize Options
4481 @section Options That Control Optimization
4482 @cindex optimize options
4483 @cindex options, optimization
4484
4485 These options control various sorts of optimizations.
4486
4487 Without any optimization option, the compiler's goal is to reduce the
4488 cost of compilation and to make debugging produce the expected
4489 results.  Statements are independent: if you stop the program with a
4490 breakpoint between statements, you can then assign a new value to any
4491 variable or change the program counter to any other statement in the
4492 function and get exactly the results you would expect from the source
4493 code.
4494
4495 Turning on optimization flags makes the compiler attempt to improve
4496 the performance and/or code size at the expense of compilation time
4497 and possibly the ability to debug the program.
4498
4499 The compiler performs optimization based on the knowledge it has of
4500 the program.  Optimization levels @option{-O} and above, in
4501 particular, enable @emph{unit-at-a-time} mode, which allows the
4502 compiler to consider information gained from later functions in
4503 the file when compiling a function.  Compiling multiple files at
4504 once to a single output file in @emph{unit-at-a-time} mode allows
4505 the compiler to use information gained from all of the files when
4506 compiling each of them.
4507
4508 Not all optimizations are controlled directly by a flag.  Only
4509 optimizations that have a flag are listed.
4510
4511 @table @gcctabopt
4512 @item -O
4513 @itemx -O1
4514 @opindex O
4515 @opindex O1
4516 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4517 more memory for a large function.
4518
4519 With @option{-O}, the compiler tries to reduce code size and execution
4520 time, without performing any optimizations that take a great deal of
4521 compilation time.
4522
4523 @option{-O} turns on the following optimization flags:
4524 @gccoptlist{-fdefer-pop @gol
4525 -fdelayed-branch @gol
4526 -fguess-branch-probability @gol
4527 -fcprop-registers @gol
4528 -fif-conversion @gol
4529 -fif-conversion2 @gol
4530 -ftree-ccp @gol
4531 -ftree-dce @gol
4532 -ftree-dominator-opts @gol
4533 -ftree-dse @gol
4534 -ftree-ter @gol
4535 -ftree-lrs @gol
4536 -ftree-sra @gol
4537 -ftree-copyrename @gol
4538 -ftree-fre @gol
4539 -ftree-ch @gol
4540 -funit-at-a-time @gol
4541 -fmerge-constants}
4542
4543 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4544 where doing so does not interfere with debugging.
4545
4546 @item -O2
4547 @opindex O2
4548 Optimize even more.  GCC performs nearly all supported optimizations
4549 that do not involve a space-speed tradeoff.  The compiler does not
4550 perform loop unrolling or function inlining when you specify @option{-O2}.
4551 As compared to @option{-O}, this option increases both compilation time
4552 and the performance of the generated code.
4553
4554 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4555 also turns on the following optimization flags:
4556 @gccoptlist{-fthread-jumps @gol
4557 -fcrossjumping @gol
4558 -foptimize-sibling-calls @gol
4559 -fcse-follow-jumps  -fcse-skip-blocks @gol
4560 -fgcse  -fgcse-lm  @gol
4561 -fexpensive-optimizations @gol
4562 -frerun-cse-after-loop  @gol
4563 -fcaller-saves @gol
4564 -fpeephole2 @gol
4565 -fschedule-insns  -fschedule-insns2 @gol
4566 -fsched-interblock  -fsched-spec @gol
4567 -fregmove @gol
4568 -fstrict-aliasing @gol
4569 -fdelete-null-pointer-checks @gol
4570 -freorder-blocks  -freorder-functions @gol
4571 -falign-functions  -falign-jumps @gol
4572 -falign-loops  -falign-labels @gol
4573 -ftree-vrp @gol
4574 -ftree-pre}
4575
4576 Please note the warning under @option{-fgcse} about
4577 invoking @option{-O2} on programs that use computed gotos.
4578
4579 @item -O3
4580 @opindex O3
4581 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4582 @option{-O2} and also turns on the @option{-finline-functions},
4583 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4584
4585 @item -O0
4586 @opindex O0
4587 Do not optimize.  This is the default.
4588
4589 @item -Os
4590 @opindex Os
4591 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4592 do not typically increase code size.  It also performs further
4593 optimizations designed to reduce code size.
4594
4595 @option{-Os} disables the following optimization flags:
4596 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4597 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
4598 -fprefetch-loop-arrays  -ftree-vect-loop-version}
4599
4600 If you use multiple @option{-O} options, with or without level numbers,
4601 the last such option is the one that is effective.
4602 @end table
4603
4604 Options of the form @option{-f@var{flag}} specify machine-independent
4605 flags.  Most flags have both positive and negative forms; the negative
4606 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4607 below, only one of the forms is listed---the one you typically will
4608 use.  You can figure out the other form by either removing @samp{no-}
4609 or adding it.
4610
4611 The following options control specific optimizations.  They are either
4612 activated by @option{-O} options or are related to ones that are.  You
4613 can use the following flags in the rare cases when ``fine-tuning'' of
4614 optimizations to be performed is desired.
4615
4616 @table @gcctabopt
4617 @item -fno-default-inline
4618 @opindex fno-default-inline
4619 Do not make member functions inline by default merely because they are
4620 defined inside the class scope (C++ only).  Otherwise, when you specify
4621 @w{@option{-O}}, member functions defined inside class scope are compiled
4622 inline by default; i.e., you don't need to add @samp{inline} in front of
4623 the member function name.
4624
4625 @item -fno-defer-pop
4626 @opindex fno-defer-pop
4627 Always pop the arguments to each function call as soon as that function
4628 returns.  For machines which must pop arguments after a function call,
4629 the compiler normally lets arguments accumulate on the stack for several
4630 function calls and pops them all at once.
4631
4632 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4633
4634 @item -fforce-mem
4635 @opindex fforce-mem
4636 Force memory operands to be copied into registers before doing
4637 arithmetic on them.  This produces better code by making all memory
4638 references potential common subexpressions.  When they are not common
4639 subexpressions, instruction combination should eliminate the separate
4640 register-load. This option is now a nop and will be removed in 4.2.
4641
4642 @item -fforce-addr
4643 @opindex fforce-addr
4644 Force memory address constants to be copied into registers before
4645 doing arithmetic on them.
4646
4647 @item -fforward-propagate
4648 @opindex fforward-propagate
4649 Perform a forward propagation pass on RTL.  The pass tries to combine two
4650 instructions and checks if the result can be simplified.  If loop unrolling
4651 is active, two passes are performed and the second is scheduled after
4652 loop unrolling.
4653
4654 This option is enabled by default at optimization levels @option{-O2},
4655 @option{-O3}, @option{-Os}.
4656
4657 @item -fomit-frame-pointer
4658 @opindex fomit-frame-pointer
4659 Don't keep the frame pointer in a register for functions that
4660 don't need one.  This avoids the instructions to save, set up and
4661 restore frame pointers; it also makes an extra register available
4662 in many functions.  @strong{It also makes debugging impossible on
4663 some machines.}
4664
4665 On some machines, such as the VAX, this flag has no effect, because
4666 the standard calling sequence automatically handles the frame pointer
4667 and nothing is saved by pretending it doesn't exist.  The
4668 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4669 whether a target machine supports this flag.  @xref{Registers,,Register
4670 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4671
4672 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4673
4674 @item -foptimize-sibling-calls
4675 @opindex foptimize-sibling-calls
4676 Optimize sibling and tail recursive calls.
4677
4678 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4679
4680 @item -fno-inline
4681 @opindex fno-inline
4682 Don't pay attention to the @code{inline} keyword.  Normally this option
4683 is used to keep the compiler from expanding any functions inline.
4684 Note that if you are not optimizing, no functions can be expanded inline.
4685
4686 @item -finline-functions
4687 @opindex finline-functions
4688 Integrate all simple functions into their callers.  The compiler
4689 heuristically decides which functions are simple enough to be worth
4690 integrating in this way.
4691
4692 If all calls to a given function are integrated, and the function is
4693 declared @code{static}, then the function is normally not output as
4694 assembler code in its own right.
4695
4696 Enabled at level @option{-O3}.
4697
4698 @item -finline-functions-called-once
4699 @opindex finline-functions-called-once
4700 Consider all @code{static} functions called once for inlining into their
4701 caller even if they are not marked @code{inline}.  If a call to a given
4702 function is integrated, then the function is not output as assembler code
4703 in its own right.
4704
4705 Enabled if @option{-funit-at-a-time} is enabled.
4706
4707 @item -fearly-inlining
4708 @opindex fearly-inlining
4709 Inline functions marked by @code{always_inline} and functions whose body seems
4710 smaller than the function call overhead early before doing
4711 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4712 makes profiling significantly cheaper and usually inlining faster on programs
4713 having large chains of nested wrapper functions.
4714
4715 Enabled by default.
4716
4717 @item -finline-limit=@var{n}
4718 @opindex finline-limit
4719 By default, GCC limits the size of functions that can be inlined.  This flag
4720 allows the control of this limit for functions that are explicitly marked as
4721 inline (i.e., marked with the inline keyword or defined within the class
4722 definition in c++).  @var{n} is the size of functions that can be inlined in
4723 number of pseudo instructions (not counting parameter handling).  The default
4724 value of @var{n} is 600.
4725 Increasing this value can result in more inlined code at
4726 the cost of compilation time and memory consumption.  Decreasing usually makes
4727 the compilation faster and less code will be inlined (which presumably
4728 means slower programs).  This option is particularly useful for programs that
4729 use inlining heavily such as those based on recursive templates with C++.
4730
4731 Inlining is actually controlled by a number of parameters, which may be
4732 specified individually by using @option{--param @var{name}=@var{value}}.
4733 The @option{-finline-limit=@var{n}} option sets some of these parameters
4734 as follows:
4735
4736 @table @gcctabopt
4737 @item max-inline-insns-single
4738  is set to @var{n}/2.
4739 @item max-inline-insns-auto
4740  is set to @var{n}/2.
4741 @item min-inline-insns
4742  is set to 130 or @var{n}/4, whichever is smaller.
4743 @item max-inline-insns-rtl
4744  is set to @var{n}.
4745 @end table
4746
4747 See below for a documentation of the individual
4748 parameters controlling inlining.
4749
4750 @emph{Note:} pseudo instruction represents, in this particular context, an
4751 abstract measurement of function's size.  In no way does it represent a count
4752 of assembly instructions and as such its exact meaning might change from one
4753 release to an another.
4754
4755 @item -fkeep-inline-functions
4756 @opindex fkeep-inline-functions
4757 In C, emit @code{static} functions that are declared @code{inline}
4758 into the object file, even if the function has been inlined into all
4759 of its callers.  This switch does not affect functions using the
4760 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
4761 inline functions into the object file.
4762
4763 @item -fkeep-static-consts
4764 @opindex fkeep-static-consts
4765 Emit variables declared @code{static const} when optimization isn't turned
4766 on, even if the variables aren't referenced.
4767
4768 GCC enables this option by default.  If you want to force the compiler to
4769 check if the variable was referenced, regardless of whether or not
4770 optimization is turned on, use the @option{-fno-keep-static-consts} option.
4771
4772 @item -fmerge-constants
4773 Attempt to merge identical constants (string constants and floating point
4774 constants) across compilation units.
4775
4776 This option is the default for optimized compilation if the assembler and
4777 linker support it.  Use @option{-fno-merge-constants} to inhibit this
4778 behavior.
4779
4780 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4781
4782 @item -fmerge-all-constants
4783 Attempt to merge identical constants and identical variables.
4784
4785 This option implies @option{-fmerge-constants}.  In addition to
4786 @option{-fmerge-constants} this considers e.g.@: even constant initialized
4787 arrays or initialized constant variables with integral or floating point
4788 types.  Languages like C or C++ require each non-automatic variable to
4789 have distinct location, so using this option will result in non-conforming
4790 behavior.
4791
4792 @item -fmodulo-sched
4793 @opindex fmodulo-sched
4794 Perform swing modulo scheduling immediately before the first scheduling
4795 pass.  This pass looks at innermost loops and reorders their
4796 instructions by overlapping different iterations.
4797
4798 @item -fno-branch-count-reg
4799 @opindex fno-branch-count-reg
4800 Do not use ``decrement and branch'' instructions on a count register,
4801 but instead generate a sequence of instructions that decrement a
4802 register, compare it against zero, then branch based upon the result.
4803 This option is only meaningful on architectures that support such
4804 instructions, which include x86, PowerPC, IA-64 and S/390.
4805
4806 The default is @option{-fbranch-count-reg}.
4807
4808 @item -fno-function-cse
4809 @opindex fno-function-cse
4810 Do not put function addresses in registers; make each instruction that
4811 calls a constant function contain the function's address explicitly.
4812
4813 This option results in less efficient code, but some strange hacks
4814 that alter the assembler output may be confused by the optimizations
4815 performed when this option is not used.
4816
4817 The default is @option{-ffunction-cse}
4818
4819 @item -fno-zero-initialized-in-bss
4820 @opindex fno-zero-initialized-in-bss
4821 If the target supports a BSS section, GCC by default puts variables that
4822 are initialized to zero into BSS@.  This can save space in the resulting
4823 code.
4824
4825 This option turns off this behavior because some programs explicitly
4826 rely on variables going to the data section.  E.g., so that the
4827 resulting executable can find the beginning of that section and/or make
4828 assumptions based on that.
4829
4830 The default is @option{-fzero-initialized-in-bss}.
4831
4832 @item -fbounds-check
4833 @opindex fbounds-check
4834 For front-ends that support it, generate additional code to check that
4835 indices used to access arrays are within the declared range.  This is
4836 currently only supported by the Java and Fortran front-ends, where
4837 this option defaults to true and false respectively.
4838
4839 @item -fmudflap -fmudflapth -fmudflapir
4840 @opindex fmudflap
4841 @opindex fmudflapth
4842 @opindex fmudflapir
4843 @cindex bounds checking
4844 @cindex mudflap
4845 For front-ends that support it (C and C++), instrument all risky
4846 pointer/array dereferencing operations, some standard library
4847 string/heap functions, and some other associated constructs with
4848 range/validity tests.  Modules so instrumented should be immune to
4849 buffer overflows, invalid heap use, and some other classes of C/C++
4850 programming errors.  The instrumentation relies on a separate runtime
4851 library (@file{libmudflap}), which will be linked into a program if
4852 @option{-fmudflap} is given at link time.  Run-time behavior of the
4853 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
4854 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
4855 for its options.
4856
4857 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
4858 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
4859 addition to @option{-fmudflap} or @option{-fmudflapth}, if
4860 instrumentation should ignore pointer reads.  This produces less
4861 instrumentation (and therefore faster execution) and still provides
4862 some protection against outright memory corrupting writes, but allows
4863 erroneously read data to propagate within a program.
4864
4865 @item -fthread-jumps
4866 @opindex fthread-jumps
4867 Perform optimizations where we check to see if a jump branches to a
4868 location where another comparison subsumed by the first is found.  If
4869 so, the first branch is redirected to either the destination of the
4870 second branch or a point immediately following it, depending on whether
4871 the condition is known to be true or false.
4872
4873 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4874
4875 @item -fcse-follow-jumps
4876 @opindex fcse-follow-jumps
4877 In common subexpression elimination, scan through jump instructions
4878 when the target of the jump is not reached by any other path.  For
4879 example, when CSE encounters an @code{if} statement with an
4880 @code{else} clause, CSE will follow the jump when the condition
4881 tested is false.
4882
4883 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4884
4885 @item -fcse-skip-blocks
4886 @opindex fcse-skip-blocks
4887 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
4888 follow jumps which conditionally skip over blocks.  When CSE
4889 encounters a simple @code{if} statement with no else clause,
4890 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
4891 body of the @code{if}.
4892
4893 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4894
4895 @item -frerun-cse-after-loop
4896 @opindex frerun-cse-after-loop
4897 Re-run common subexpression elimination after loop optimizations has been
4898 performed.
4899
4900 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4901
4902 @item -fgcse
4903 @opindex fgcse
4904 Perform a global common subexpression elimination pass.
4905 This pass also performs global constant and copy propagation.
4906
4907 @emph{Note:} When compiling a program using computed gotos, a GCC
4908 extension, you may get better runtime performance if you disable
4909 the global common subexpression elimination pass by adding
4910 @option{-fno-gcse} to the command line.
4911
4912 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4913
4914 @item -fgcse-lm
4915 @opindex fgcse-lm
4916 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
4917 attempt to move loads which are only killed by stores into themselves.  This
4918 allows a loop containing a load/store sequence to be changed to a load outside
4919 the loop, and a copy/store within the loop.
4920
4921 Enabled by default when gcse is enabled.
4922
4923 @item -fgcse-sm
4924 @opindex fgcse-sm
4925 When @option{-fgcse-sm} is enabled, a store motion pass is run after
4926 global common subexpression elimination.  This pass will attempt to move
4927 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
4928 loops containing a load/store sequence can be changed to a load before
4929 the loop and a store after the loop.
4930
4931 Not enabled at any optimization level.
4932
4933 @item -fgcse-las
4934 @opindex fgcse-las
4935 When @option{-fgcse-las} is enabled, the global common subexpression
4936 elimination pass eliminates redundant loads that come after stores to the
4937 same memory location (both partial and full redundancies).
4938
4939 Not enabled at any optimization level.
4940
4941 @item -fgcse-after-reload
4942 @opindex fgcse-after-reload
4943 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
4944 pass is performed after reload.  The purpose of this pass is to cleanup
4945 redundant spilling.
4946
4947 @item -funsafe-loop-optimizations
4948 @opindex funsafe-loop-optimizations
4949 If given, the loop optimizer will assume that loop indices do not
4950 overflow, and that the loops with nontrivial exit condition are not
4951 infinite.  This enables a wider range of loop optimizations even if
4952 the loop optimizer itself cannot prove that these assumptions are valid.
4953 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
4954 if it finds this kind of loop.
4955
4956 @item -fcrossjumping
4957 @opindex crossjumping
4958 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
4959 resulting code may or may not perform better than without cross-jumping.
4960
4961 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4962
4963 @item -fif-conversion
4964 @opindex if-conversion
4965 Attempt to transform conditional jumps into branch-less equivalents.  This
4966 include use of conditional moves, min, max, set flags and abs instructions, and
4967 some tricks doable by standard arithmetics.  The use of conditional execution
4968 on chips where it is available is controlled by @code{if-conversion2}.
4969
4970 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4971
4972 @item -fif-conversion2
4973 @opindex if-conversion2
4974 Use conditional execution (where available) to transform conditional jumps into
4975 branch-less equivalents.
4976
4977 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4978
4979 @item -fdelete-null-pointer-checks
4980 @opindex fdelete-null-pointer-checks
4981 Use global dataflow analysis to identify and eliminate useless checks
4982 for null pointers.  The compiler assumes that dereferencing a null
4983 pointer would have halted the program.  If a pointer is checked after
4984 it has already been dereferenced, it cannot be null.
4985
4986 In some environments, this assumption is not true, and programs can
4987 safely dereference null pointers.  Use
4988 @option{-fno-delete-null-pointer-checks} to disable this optimization
4989 for programs which depend on that behavior.
4990
4991 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4992
4993 @item -fexpensive-optimizations
4994 @opindex fexpensive-optimizations
4995 Perform a number of minor optimizations that are relatively expensive.
4996
4997 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4998
4999 @item -foptimize-register-move
5000 @itemx -fregmove
5001 @opindex foptimize-register-move
5002 @opindex fregmove
5003 Attempt to reassign register numbers in move instructions and as
5004 operands of other simple instructions in order to maximize the amount of
5005 register tying.  This is especially helpful on machines with two-operand
5006 instructions.
5007
5008 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5009 optimization.
5010
5011 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5012
5013 @item -fdelayed-branch
5014 @opindex fdelayed-branch
5015 If supported for the target machine, attempt to reorder instructions
5016 to exploit instruction slots available after delayed branch
5017 instructions.
5018
5019 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5020
5021 @item -fschedule-insns
5022 @opindex fschedule-insns
5023 If supported for the target machine, attempt to reorder instructions to
5024 eliminate execution stalls due to required data being unavailable.  This
5025 helps machines that have slow floating point or memory load instructions
5026 by allowing other instructions to be issued until the result of the load
5027 or floating point instruction is required.
5028
5029 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5030
5031 @item -fschedule-insns2
5032 @opindex fschedule-insns2
5033 Similar to @option{-fschedule-insns}, but requests an additional pass of
5034 instruction scheduling after register allocation has been done.  This is
5035 especially useful on machines with a relatively small number of
5036 registers and where memory load instructions take more than one cycle.
5037
5038 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5039
5040 @item -fno-sched-interblock
5041 @opindex fno-sched-interblock
5042 Don't schedule instructions across basic blocks.  This is normally
5043 enabled by default when scheduling before register allocation, i.e.@:
5044 with @option{-fschedule-insns} or at @option{-O2} or higher.
5045
5046 @item -fno-sched-spec
5047 @opindex fno-sched-spec
5048 Don't allow speculative motion of non-load instructions.  This is normally
5049 enabled by default when scheduling before register allocation, i.e.@:
5050 with @option{-fschedule-insns} or at @option{-O2} or higher.
5051
5052 @item -fsched-spec-load
5053 @opindex fsched-spec-load
5054 Allow speculative motion of some load instructions.  This only makes
5055 sense when scheduling before register allocation, i.e.@: with
5056 @option{-fschedule-insns} or at @option{-O2} or higher.
5057
5058 @item -fsched-spec-load-dangerous
5059 @opindex fsched-spec-load-dangerous
5060 Allow speculative motion of more load instructions.  This only makes
5061 sense when scheduling before register allocation, i.e.@: with
5062 @option{-fschedule-insns} or at @option{-O2} or higher.
5063
5064 @item -fsched-stalled-insns=@var{n}
5065 @opindex fsched-stalled-insns
5066 Define how many insns (if any) can be moved prematurely from the queue
5067 of stalled insns into the ready list, during the second scheduling pass.
5068
5069 @item -fsched-stalled-insns-dep=@var{n}
5070 @opindex fsched-stalled-insns-dep
5071 Define how many insn groups (cycles) will be examined for a dependency
5072 on a stalled insn that is candidate for premature removal from the queue
5073 of stalled insns.  Has an effect only during the second scheduling pass,
5074 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5075
5076 @item -fsched2-use-superblocks
5077 @opindex fsched2-use-superblocks
5078 When scheduling after register allocation, do use superblock scheduling
5079 algorithm.  Superblock scheduling allows motion across basic block boundaries
5080 resulting on faster schedules.  This option is experimental, as not all machine
5081 descriptions used by GCC model the CPU closely enough to avoid unreliable
5082 results from the algorithm.
5083
5084 This only makes sense when scheduling after register allocation, i.e.@: with
5085 @option{-fschedule-insns2} or at @option{-O2} or higher.
5086
5087 @item -fsched2-use-traces
5088 @opindex fsched2-use-traces
5089 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5090 allocation and additionally perform code duplication in order to increase the
5091 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5092 trace formation.
5093
5094 This mode should produce faster but significantly longer programs.  Also
5095 without @option{-fbranch-probabilities} the traces constructed may not
5096 match the reality and hurt the performance.  This only makes
5097 sense when scheduling after register allocation, i.e.@: with
5098 @option{-fschedule-insns2} or at @option{-O2} or higher.
5099
5100 @item -fsee
5101 @opindex fsee
5102 Eliminates redundant extension instructions and move the non redundant
5103 ones to optimal placement using LCM.
5104
5105 @item -freschedule-modulo-scheduled-loops
5106 @opindex fscheduling-in-modulo-scheduled-loops
5107 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5108 we may want to prevent the later scheduling passes from changing its schedule, we use this
5109 option to control that.
5110
5111 @item -fcaller-saves
5112 @opindex fcaller-saves
5113 Enable values to be allocated in registers that will be clobbered by
5114 function calls, by emitting extra instructions to save and restore the
5115 registers around such calls.  Such allocation is done only when it
5116 seems to result in better code than would otherwise be produced.
5117
5118 This option is always enabled by default on certain machines, usually
5119 those which have no call-preserved registers to use instead.
5120
5121 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5122
5123 @item -ftree-pre
5124 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5125 enabled by default at @option{-O2} and @option{-O3}.
5126
5127 @item -ftree-fre
5128 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5129 between FRE and PRE is that FRE only considers expressions
5130 that are computed on all paths leading to the redundant computation.
5131 This analysis faster than PRE, though it exposes fewer redundancies.
5132 This flag is enabled by default at @option{-O} and higher.
5133
5134 @item -ftree-copy-prop
5135 Perform copy propagation on trees.  This pass eliminates unnecessary
5136 copy operations.  This flag is enabled by default at @option{-O} and
5137 higher.
5138
5139 @item -ftree-store-copy-prop
5140 Perform copy propagation of memory loads and stores.  This pass
5141 eliminates unnecessary copy operations in memory references
5142 (structures, global variables, arrays, etc).  This flag is enabled by
5143 default at @option{-O2} and higher.
5144
5145 @item -ftree-salias
5146 Perform structural alias analysis on trees.  This flag
5147 is enabled by default at @option{-O} and higher.
5148
5149 @item -fipa-pta
5150 Perform interprocedural pointer analysis.
5151
5152 @item -ftree-sink
5153 Perform forward store motion  on trees.  This flag is
5154 enabled by default at @option{-O} and higher.
5155
5156 @item -ftree-ccp
5157 Perform sparse conditional constant propagation (CCP) on trees.  This
5158 pass only operates on local scalar variables and is enabled by default
5159 at @option{-O} and higher.
5160
5161 @item -ftree-store-ccp
5162 Perform sparse conditional constant propagation (CCP) on trees.  This
5163 pass operates on both local scalar variables and memory stores and
5164 loads (global variables, structures, arrays, etc).  This flag is
5165 enabled by default at @option{-O2} and higher.
5166
5167 @item -ftree-dce
5168 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5169 default at @option{-O} and higher.
5170
5171 @item -ftree-dominator-opts
5172 Perform a variety of simple scalar cleanups (constant/copy
5173 propagation, redundancy elimination, range propagation and expression
5174 simplification) based on a dominator tree traversal.  This also
5175 performs jump threading (to reduce jumps to jumps). This flag is
5176 enabled by default at @option{-O} and higher.
5177
5178 @item -ftree-ch
5179 Perform loop header copying on trees.  This is beneficial since it increases
5180 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5181 is enabled by default at @option{-O} and higher.  It is not enabled
5182 for @option{-Os}, since it usually increases code size.
5183
5184 @item -ftree-loop-optimize
5185 Perform loop optimizations on trees.  This flag is enabled by default
5186 at @option{-O} and higher.
5187
5188 @item -ftree-loop-linear
5189 Perform linear loop transformations on tree.  This flag can improve cache
5190 performance and allow further loop optimizations to take place.
5191
5192 @item -ftree-loop-im
5193 Perform loop invariant motion on trees.  This pass moves only invariants that
5194 would be hard to handle at RTL level (function calls, operations that expand to
5195 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5196 operands of conditions that are invariant out of the loop, so that we can use
5197 just trivial invariantness analysis in loop unswitching.  The pass also includes
5198 store motion.
5199
5200 @item -ftree-loop-ivcanon
5201 Create a canonical counter for number of iterations in the loop for that
5202 determining number of iterations requires complicated analysis.  Later
5203 optimizations then may determine the number easily.  Useful especially
5204 in connection with unrolling.
5205
5206 @item -fivopts
5207 Perform induction variable optimizations (strength reduction, induction
5208 variable merging and induction variable elimination) on trees.
5209
5210 @item -ftree-sra
5211 Perform scalar replacement of aggregates.  This pass replaces structure
5212 references with scalars to prevent committing structures to memory too
5213 early.  This flag is enabled by default at @option{-O} and higher.
5214
5215 @item -ftree-copyrename
5216 Perform copy renaming on trees.  This pass attempts to rename compiler
5217 temporaries to other variables at copy locations, usually resulting in
5218 variable names which more closely resemble the original variables.  This flag
5219 is enabled by default at @option{-O} and higher.
5220
5221 @item -ftree-ter
5222 Perform temporary expression replacement during the SSA->normal phase.  Single
5223 use/single def temporaries are replaced at their use location with their
5224 defining expression.  This results in non-GIMPLE code, but gives the expanders
5225 much more complex trees to work on resulting in better RTL generation.  This is
5226 enabled by default at @option{-O} and higher.
5227
5228 @item -ftree-lrs
5229 Perform live range splitting during the SSA->normal phase.  Distinct live
5230 ranges of a variable are split into unique variables, allowing for better
5231 optimization later.  This is enabled by default at @option{-O} and higher.
5232
5233 @item -ftree-vectorize
5234 Perform loop vectorization on trees.
5235
5236 @item -ftree-vect-loop-version
5237 @opindex ftree-vect-loop-version
5238 Perform loop versioning when doing loop vectorization on trees.  When a loop
5239 appears to be vectorizable except that data alignment or data dependence cannot
5240 be determined at compile time then vectorized and non-vectorized versions of
5241 the loop are generated along with runtime checks for alignment or dependence
5242 to control which version is executed.  This option is enabled by default
5243 except at level @option{-Os} where it is disabled.
5244
5245 @item -ftree-vrp
5246 Perform Value Range Propagation on trees.  This is similar to the
5247 constant propagation pass, but instead of values, ranges of values are
5248 propagated.  This allows the optimizers to remove unnecessary range
5249 checks like array bound checks and null pointer checks.  This is
5250 enabled by default at @option{-O2} and higher.  Null pointer check
5251 elimination is only done if @option{-fdelete-null-pointer-checks} is
5252 enabled.
5253
5254 @item -ftracer
5255 @opindex ftracer
5256 Perform tail duplication to enlarge superblock size.  This transformation
5257 simplifies the control flow of the function allowing other optimizations to do
5258 better job.
5259
5260 @item -funroll-loops
5261 @opindex funroll-loops
5262 Unroll loops whose number of iterations can be determined at compile
5263 time or upon entry to the loop.  @option{-funroll-loops} implies
5264 @option{-frerun-cse-after-loop}.  This option makes code larger,
5265 and may or may not make it run faster.
5266
5267 @item -funroll-all-loops
5268 @opindex funroll-all-loops
5269 Unroll all loops, even if their number of iterations is uncertain when
5270 the loop is entered.  This usually makes programs run more slowly.
5271 @option{-funroll-all-loops} implies the same options as
5272 @option{-funroll-loops},
5273
5274 @item -fsplit-ivs-in-unroller
5275 @opindex -fsplit-ivs-in-unroller
5276 Enables expressing of values of induction variables in later iterations
5277 of the unrolled loop using the value in the first iteration.  This breaks
5278 long dependency chains, thus improving efficiency of the scheduling passes.
5279
5280 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5281 same effect.  However in cases the loop body is more complicated than
5282 a single basic block, this is not reliable.  It also does not work at all
5283 on some of the architectures due to restrictions in the CSE pass.
5284
5285 This optimization is enabled by default.
5286
5287 @item -fvariable-expansion-in-unroller
5288 @opindex -fvariable-expansion-in-unroller
5289 With this option, the compiler will create multiple copies of some
5290 local variables when unrolling a loop which can result in superior code.
5291
5292 @item -fprefetch-loop-arrays
5293 @opindex fprefetch-loop-arrays
5294 If supported by the target machine, generate instructions to prefetch
5295 memory to improve the performance of loops that access large arrays.
5296
5297 This option may generate better or worse code; results are highly
5298 dependent on the structure of loops within the source code.
5299
5300 Disabled at level @option{-Os}.
5301
5302 @item -fno-peephole
5303 @itemx -fno-peephole2
5304 @opindex fno-peephole
5305 @opindex fno-peephole2
5306 Disable any machine-specific peephole optimizations.  The difference
5307 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5308 are implemented in the compiler; some targets use one, some use the
5309 other, a few use both.
5310
5311 @option{-fpeephole} is enabled by default.
5312 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5313
5314 @item -fno-guess-branch-probability
5315 @opindex fno-guess-branch-probability
5316 Do not guess branch probabilities using heuristics.
5317
5318 GCC will use heuristics to guess branch probabilities if they are
5319 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5320 heuristics are based on the control flow graph.  If some branch probabilities
5321 are specified by @samp{__builtin_expect}, then the heuristics will be
5322 used to guess branch probabilities for the rest of the control flow graph,
5323 taking the @samp{__builtin_expect} info into account.  The interactions
5324 between the heuristics and @samp{__builtin_expect} can be complex, and in
5325 some cases, it may be useful to disable the heuristics so that the effects
5326 of @samp{__builtin_expect} are easier to understand.
5327
5328 The default is @option{-fguess-branch-probability} at levels
5329 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5330
5331 @item -freorder-blocks
5332 @opindex freorder-blocks
5333 Reorder basic blocks in the compiled function in order to reduce number of
5334 taken branches and improve code locality.
5335
5336 Enabled at levels @option{-O2}, @option{-O3}.
5337
5338 @item -freorder-blocks-and-partition
5339 @opindex freorder-blocks-and-partition
5340 In addition to reordering basic blocks in the compiled function, in order
5341 to reduce number of taken branches, partitions hot and cold basic blocks
5342 into separate sections of the assembly and .o files, to improve
5343 paging and cache locality performance.
5344
5345 This optimization is automatically turned off in the presence of
5346 exception handling, for linkonce sections, for functions with a user-defined
5347 section attribute and on any architecture that does not support named
5348 sections.
5349
5350 @item -freorder-functions
5351 @opindex freorder-functions
5352 Reorder functions in the object file in order to
5353 improve code locality.  This is implemented by using special
5354 subsections @code{.text.hot} for most frequently executed functions and
5355 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5356 the linker so object file format must support named sections and linker must
5357 place them in a reasonable way.
5358
5359 Also profile feedback must be available in to make this option effective.  See
5360 @option{-fprofile-arcs} for details.
5361
5362 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5363
5364 @item -fstrict-aliasing
5365 @opindex fstrict-aliasing
5366 Allows the compiler to assume the strictest aliasing rules applicable to
5367 the language being compiled.  For C (and C++), this activates
5368 optimizations based on the type of expressions.  In particular, an
5369 object of one type is assumed never to reside at the same address as an
5370 object of a different type, unless the types are almost the same.  For
5371 example, an @code{unsigned int} can alias an @code{int}, but not a
5372 @code{void*} or a @code{double}.  A character type may alias any other
5373 type.
5374
5375 Pay special attention to code like this:
5376 @smallexample
5377 union a_union @{
5378   int i;
5379   double d;
5380 @};
5381
5382 int f() @{
5383   a_union t;
5384   t.d = 3.0;
5385   return t.i;
5386 @}
5387 @end smallexample
5388 The practice of reading from a different union member than the one most
5389 recently written to (called ``type-punning'') is common.  Even with
5390 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5391 is accessed through the union type.  So, the code above will work as
5392 expected.  However, this code might not:
5393 @smallexample
5394 int f() @{
5395   a_union t;
5396   int* ip;
5397   t.d = 3.0;
5398   ip = &t.i;
5399   return *ip;
5400 @}
5401 @end smallexample
5402
5403 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5404
5405 @item -falign-functions
5406 @itemx -falign-functions=@var{n}
5407 @opindex falign-functions
5408 Align the start of functions to the next power-of-two greater than
5409 @var{n}, skipping up to @var{n} bytes.  For instance,
5410 @option{-falign-functions=32} aligns functions to the next 32-byte
5411 boundary, but @option{-falign-functions=24} would align to the next
5412 32-byte boundary only if this can be done by skipping 23 bytes or less.
5413
5414 @option{-fno-align-functions} and @option{-falign-functions=1} are
5415 equivalent and mean that functions will not be aligned.
5416
5417 Some assemblers only support this flag when @var{n} is a power of two;
5418 in that case, it is rounded up.
5419
5420 If @var{n} is not specified or is zero, use a machine-dependent default.
5421
5422 Enabled at levels @option{-O2}, @option{-O3}.
5423
5424 @item -falign-labels
5425 @itemx -falign-labels=@var{n}
5426 @opindex falign-labels
5427 Align all branch targets to a power-of-two boundary, skipping up to
5428 @var{n} bytes like @option{-falign-functions}.  This option can easily
5429 make code slower, because it must insert dummy operations for when the
5430 branch target is reached in the usual flow of the code.
5431
5432 @option{-fno-align-labels} and @option{-falign-labels=1} are
5433 equivalent and mean that labels will not be aligned.
5434
5435 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5436 are greater than this value, then their values are used instead.
5437
5438 If @var{n} is not specified or is zero, use a machine-dependent default
5439 which is very likely to be @samp{1}, meaning no alignment.
5440
5441 Enabled at levels @option{-O2}, @option{-O3}.
5442
5443 @item -falign-loops
5444 @itemx -falign-loops=@var{n}
5445 @opindex falign-loops
5446 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5447 like @option{-falign-functions}.  The hope is that the loop will be
5448 executed many times, which will make up for any execution of the dummy
5449 operations.
5450
5451 @option{-fno-align-loops} and @option{-falign-loops=1} are
5452 equivalent and mean that loops will not be aligned.
5453
5454 If @var{n} is not specified or is zero, use a machine-dependent default.
5455
5456 Enabled at levels @option{-O2}, @option{-O3}.
5457
5458 @item -falign-jumps
5459 @itemx -falign-jumps=@var{n}
5460 @opindex falign-jumps
5461 Align branch targets to a power-of-two boundary, for branch targets
5462 where the targets can only be reached by jumping, skipping up to @var{n}
5463 bytes like @option{-falign-functions}.  In this case, no dummy operations
5464 need be executed.
5465
5466 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5467 equivalent and mean that loops will not be aligned.
5468
5469 If @var{n} is not specified or is zero, use a machine-dependent default.
5470
5471 Enabled at levels @option{-O2}, @option{-O3}.
5472
5473 @item -funit-at-a-time
5474 @opindex funit-at-a-time
5475 Parse the whole compilation unit before starting to produce code.
5476 This allows some extra optimizations to take place but consumes
5477 more memory (in general).  There are some compatibility issues
5478 with @emph{unit-at-a-time} mode:
5479 @itemize @bullet
5480 @item
5481 enabling @emph{unit-at-a-time} mode may change the order
5482 in which functions, variables, and top-level @code{asm} statements
5483 are emitted, and will likely break code relying on some particular
5484 ordering.  The majority of such top-level @code{asm} statements,
5485 though, can be replaced by @code{section} attributes.  The
5486 @option{fno-toplevel-reorder} option may be used to keep the ordering
5487 used in the input file, at the cost of some optimizations.
5488
5489 @item
5490 @emph{unit-at-a-time} mode removes unreferenced static variables
5491 and functions.  This may result in undefined references
5492 when an @code{asm} statement refers directly to variables or functions
5493 that are otherwise unused.  In that case either the variable/function
5494 shall be listed as an operand of the @code{asm} statement operand or,
5495 in the case of top-level @code{asm} statements the attribute @code{used}
5496 shall be used on the declaration.
5497
5498 @item
5499 Static functions now can use non-standard passing conventions that
5500 may break @code{asm} statements calling functions directly.  Again,
5501 attribute @code{used} will prevent this behavior.
5502 @end itemize
5503
5504 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5505 but this scheme may not be supported by future releases of GCC@.
5506
5507 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5508
5509 @item -fno-toplevel-reorder
5510 Do not reorder top-level functions, variables, and @code{asm}
5511 statements.  Output them in the same order that they appear in the
5512 input file.  When this option is used, unreferenced static variables
5513 will not be removed.  This option is intended to support existing code
5514 which relies on a particular ordering.  For new code, it is better to
5515 use attributes.
5516
5517 @item -fweb
5518 @opindex fweb
5519 Constructs webs as commonly used for register allocation purposes and assign
5520 each web individual pseudo register.  This allows the register allocation pass
5521 to operate on pseudos directly, but also strengthens several other optimization
5522 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5523 however, make debugging impossible, since variables will no longer stay in a
5524 ``home register''.
5525
5526 Enabled by default with @option{-funroll-loops}.
5527
5528 @item -fwhole-program
5529 @opindex fwhole-program
5530 Assume that the current compilation unit represents whole program being
5531 compiled.  All public functions and variables with the exception of @code{main}
5532 and those merged by attribute @code{externally_visible} become static functions
5533 and in a affect gets more aggressively optimized by interprocedural optimizers.
5534 While this option is equivalent to proper use of @code{static} keyword for
5535 programs consisting of single file, in combination with option
5536 @option{--combine} this flag can be used to compile most of smaller scale C
5537 programs since the functions and variables become local for the whole combined
5538 compilation unit, not for the single source file itself.
5539
5540
5541 @item -fno-cprop-registers
5542 @opindex fno-cprop-registers
5543 After register allocation and post-register allocation instruction splitting,
5544 we perform a copy-propagation pass to try to reduce scheduling dependencies
5545 and occasionally eliminate the copy.
5546
5547 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5548
5549 @item -fprofile-generate
5550 @opindex fprofile-generate
5551
5552 Enable options usually used for instrumenting application to produce
5553 profile useful for later recompilation with profile feedback based
5554 optimization.  You must use @option{-fprofile-generate} both when
5555 compiling and when linking your program.
5556
5557 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5558
5559 @item -fprofile-use
5560 @opindex fprofile-use
5561 Enable profile feedback directed optimizations, and optimizations
5562 generally profitable only with profile feedback available.
5563
5564 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5565 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
5566
5567 @end table
5568
5569 The following options control compiler behavior regarding floating
5570 point arithmetic.  These options trade off between speed and
5571 correctness.  All must be specifically enabled.
5572
5573 @table @gcctabopt
5574 @item -ffloat-store
5575 @opindex ffloat-store
5576 Do not store floating point variables in registers, and inhibit other
5577 options that might change whether a floating point value is taken from a
5578 register or memory.
5579
5580 @cindex floating point precision
5581 This option prevents undesirable excess precision on machines such as
5582 the 68000 where the floating registers (of the 68881) keep more
5583 precision than a @code{double} is supposed to have.  Similarly for the
5584 x86 architecture.  For most programs, the excess precision does only
5585 good, but a few programs rely on the precise definition of IEEE floating
5586 point.  Use @option{-ffloat-store} for such programs, after modifying
5587 them to store all pertinent intermediate computations into variables.
5588
5589 @item -ffast-math
5590 @opindex ffast-math
5591 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5592 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5593 @option{-fno-rounding-math}, @option{-fno-signaling-nans}
5594 and @option{fcx-limited-range}.
5595
5596 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5597
5598 This option should never be turned on by any @option{-O} option since
5599 it can result in incorrect output for programs which depend on
5600 an exact implementation of IEEE or ISO rules/specifications for
5601 math functions.
5602
5603 @item -fno-math-errno
5604 @opindex fno-math-errno
5605 Do not set ERRNO after calling math functions that are executed
5606 with a single instruction, e.g., sqrt.  A program that relies on
5607 IEEE exceptions for math error handling may want to use this flag
5608 for speed while maintaining IEEE arithmetic compatibility.
5609
5610 This option should never be turned on by any @option{-O} option since
5611 it can result in incorrect output for programs which depend on
5612 an exact implementation of IEEE or ISO rules/specifications for
5613 math functions.
5614
5615 The default is @option{-fmath-errno}.
5616
5617 On Darwin systems, the math library never sets @code{errno}.  There is therefore
5618 no reason for the compiler to consider the possibility that it might,
5619 and @option{-fno-math-errno} is the default.
5620
5621 @item -funsafe-math-optimizations
5622 @opindex funsafe-math-optimizations
5623 Allow optimizations for floating-point arithmetic that (a) assume
5624 that arguments and results are valid and (b) may violate IEEE or
5625 ANSI standards.  When used at link-time, it may include libraries
5626 or startup files that change the default FPU control word or other
5627 similar optimizations.
5628
5629 This option should never be turned on by any @option{-O} option since
5630 it can result in incorrect output for programs which depend on
5631 an exact implementation of IEEE or ISO rules/specifications for
5632 math functions.
5633
5634 The default is @option{-fno-unsafe-math-optimizations}.
5635
5636 @item -ffinite-math-only
5637 @opindex ffinite-math-only
5638 Allow optimizations for floating-point arithmetic that assume
5639 that arguments and results are not NaNs or +-Infs.
5640
5641 This option should never be turned on by any @option{-O} option since
5642 it can result in incorrect output for programs which depend on
5643 an exact implementation of IEEE or ISO rules/specifications.
5644
5645 The default is @option{-fno-finite-math-only}.
5646
5647 @item -fno-trapping-math
5648 @opindex fno-trapping-math
5649 Compile code assuming that floating-point operations cannot generate
5650 user-visible traps.  These traps include division by zero, overflow,
5651 underflow, inexact result and invalid operation.  This option implies
5652 @option{-fno-signaling-nans}.  Setting this option may allow faster
5653 code if one relies on ``non-stop'' IEEE arithmetic, for example.
5654
5655 This option should never be turned on by any @option{-O} option since
5656 it can result in incorrect output for programs which depend on
5657 an exact implementation of IEEE or ISO rules/specifications for
5658 math functions.
5659
5660 The default is @option{-ftrapping-math}.
5661
5662 @item -frounding-math
5663 @opindex frounding-math
5664 Disable transformations and optimizations that assume default floating
5665 point rounding behavior.  This is round-to-zero for all floating point
5666 to integer conversions, and round-to-nearest for all other arithmetic
5667 truncations.  This option should be specified for programs that change
5668 the FP rounding mode dynamically, or that may be executed with a
5669 non-default rounding mode.  This option disables constant folding of
5670 floating point expressions at compile-time (which may be affected by
5671 rounding mode) and arithmetic transformations that are unsafe in the
5672 presence of sign-dependent rounding modes.
5673
5674 The default is @option{-fno-rounding-math}.
5675
5676 This option is experimental and does not currently guarantee to
5677 disable all GCC optimizations that are affected by rounding mode.
5678 Future versions of GCC may provide finer control of this setting
5679 using C99's @code{FENV_ACCESS} pragma.  This command line option
5680 will be used to specify the default state for @code{FENV_ACCESS}.
5681
5682 @item -frtl-abstract-sequences
5683 @opindex frtl-abstract-sequences
5684 It is a size optimization method. This option is to find identical
5685 sequences of code, which can be turned into pseudo-procedures  and
5686 then  replace  all  occurrences with  calls to  the  newly created
5687 subroutine. It is kind of an opposite of @option{-finline-functions}.
5688 This optimization runs at RTL level.
5689
5690 @item -fsignaling-nans
5691 @opindex fsignaling-nans
5692 Compile code assuming that IEEE signaling NaNs may generate user-visible
5693 traps during floating-point operations.  Setting this option disables
5694 optimizations that may change the number of exceptions visible with
5695 signaling NaNs.  This option implies @option{-ftrapping-math}.
5696
5697 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
5698 be defined.
5699
5700 The default is @option{-fno-signaling-nans}.
5701
5702 This option is experimental and does not currently guarantee to
5703 disable all GCC optimizations that affect signaling NaN behavior.
5704
5705 @item -fsingle-precision-constant
5706 @opindex fsingle-precision-constant
5707 Treat floating point constant as single precision constant instead of
5708 implicitly converting it to double precision constant.
5709
5710 @item -fcx-limited-range
5711 @itemx -fno-cx-limited-range
5712 @opindex fcx-limited-range
5713 @opindex fno-cx-limited-range
5714 When enabled, this option states that a range reduction step is not
5715 needed when performing complex division.  The default is
5716 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
5717
5718 This option controls the default setting of the ISO C99 
5719 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
5720 all languages.
5721
5722 @end table
5723
5724 The following options control optimizations that may improve
5725 performance, but are not enabled by any @option{-O} options.  This
5726 section includes experimental options that may produce broken code.
5727
5728 @table @gcctabopt
5729 @item -fbranch-probabilities
5730 @opindex fbranch-probabilities
5731 After running a program compiled with @option{-fprofile-arcs}
5732 (@pxref{Debugging Options,, Options for Debugging Your Program or
5733 @command{gcc}}), you can compile it a second time using
5734 @option{-fbranch-probabilities}, to improve optimizations based on
5735 the number of times each branch was taken.  When the program
5736 compiled with @option{-fprofile-arcs} exits it saves arc execution
5737 counts to a file called @file{@var{sourcename}.gcda} for each source
5738 file.  The information in this data file is very dependent on the
5739 structure of the generated code, so you must use the same source code
5740 and the same optimization options for both compilations.
5741
5742 With @option{-fbranch-probabilities}, GCC puts a
5743 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
5744 These can be used to improve optimization.  Currently, they are only
5745 used in one place: in @file{reorg.c}, instead of guessing which path a
5746 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
5747 exactly determine which path is taken more often.
5748
5749 @item -fprofile-values
5750 @opindex fprofile-values
5751 If combined with @option{-fprofile-arcs}, it adds code so that some
5752 data about values of expressions in the program is gathered.
5753
5754 With @option{-fbranch-probabilities}, it reads back the data gathered
5755 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
5756 notes to instructions for their later usage in optimizations.
5757
5758 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
5759
5760 @item -fvpt
5761 @opindex fvpt
5762 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
5763 a code to gather information about values of expressions.
5764
5765 With @option{-fbranch-probabilities}, it reads back the data gathered
5766 and actually performs the optimizations based on them.
5767 Currently the optimizations include specialization of division operation
5768 using the knowledge about the value of the denominator.
5769
5770 @item -frename-registers
5771 @opindex frename-registers
5772 Attempt to avoid false dependencies in scheduled code by making use
5773 of registers left over after register allocation.  This optimization
5774 will most benefit processors with lots of registers.  Depending on the
5775 debug information format adopted by the target, however, it can
5776 make debugging impossible, since variables will no longer stay in
5777 a ``home register''.
5778
5779 Enabled by default with @option{-funroll-loops}.
5780
5781 @item -ftracer
5782 @opindex ftracer
5783 Perform tail duplication to enlarge superblock size.  This transformation
5784 simplifies the control flow of the function allowing other optimizations to do
5785 better job.
5786
5787 Enabled with @option{-fprofile-use}.
5788
5789 @item -funroll-loops
5790 @opindex funroll-loops
5791 Unroll loops whose number of iterations can be determined at compile time or
5792 upon entry to the loop.  @option{-funroll-loops} implies
5793 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}. 
5794 It also turns on complete loop peeling (i.e.@: complete removal of loops with
5795 small constant number of iterations).  This option makes code larger, and may
5796 or may not make it run faster.
5797
5798 Enabled with @option{-fprofile-use}.
5799
5800 @item -funroll-all-loops
5801 @opindex funroll-all-loops
5802 Unroll all loops, even if their number of iterations is uncertain when
5803 the loop is entered.  This usually makes programs run more slowly.
5804 @option{-funroll-all-loops} implies the same options as
5805 @option{-funroll-loops}.
5806
5807 @item -fpeel-loops
5808 @opindex fpeel-loops
5809 Peels the loops for that there is enough information that they do not
5810 roll much (from profile feedback).  It also turns on complete loop peeling
5811 (i.e.@: complete removal of loops with small constant number of iterations).
5812
5813 Enabled with @option{-fprofile-use}.
5814
5815 @item -fmove-loop-invariants
5816 @opindex fmove-loop-invariants
5817 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
5818 at level @option{-O1}
5819
5820 @item -funswitch-loops
5821 @opindex funswitch-loops
5822 Move branches with loop invariant conditions out of the loop, with duplicates
5823 of the loop on both branches (modified according to result of the condition).
5824
5825 @item -ffunction-sections
5826 @itemx -fdata-sections
5827 @opindex ffunction-sections
5828 @opindex fdata-sections
5829 Place each function or data item into its own section in the output
5830 file if the target supports arbitrary sections.  The name of the
5831 function or the name of the data item determines the section's name
5832 in the output file.
5833
5834 Use these options on systems where the linker can perform optimizations
5835 to improve locality of reference in the instruction space.  Most systems
5836 using the ELF object format and SPARC processors running Solaris 2 have
5837 linkers with such optimizations.  AIX may have these optimizations in
5838 the future.
5839
5840 Only use these options when there are significant benefits from doing
5841 so.  When you specify these options, the assembler and linker will
5842 create larger object and executable files and will also be slower.
5843 You will not be able to use @code{gprof} on all systems if you
5844 specify this option and you may have problems with debugging if
5845 you specify both this option and @option{-g}.
5846
5847 @item -fbranch-target-load-optimize
5848 @opindex fbranch-target-load-optimize
5849 Perform branch target register load optimization before prologue / epilogue
5850 threading.
5851 The use of target registers can typically be exposed only during reload,
5852 thus hoisting loads out of loops and doing inter-block scheduling needs
5853 a separate optimization pass.
5854
5855 @item -fbranch-target-load-optimize2
5856 @opindex fbranch-target-load-optimize2
5857 Perform branch target register load optimization after prologue / epilogue
5858 threading.
5859
5860 @item -fbtr-bb-exclusive
5861 @opindex fbtr-bb-exclusive
5862 When performing branch target register load optimization, don't reuse
5863 branch target registers in within any basic block.
5864
5865 @item -fstack-protector
5866 Emit extra code to check for buffer overflows, such as stack smashing
5867 attacks.  This is done by adding a guard variable to functions with
5868 vulnerable objects.  This includes functions that call alloca, and
5869 functions with buffers larger than 8 bytes.  The guards are initialized
5870 when a function is entered and then checked when the function exits.
5871 If a guard check fails, an error message is printed and the program exits.
5872
5873 @item -fstack-protector-all
5874 Like @option{-fstack-protector} except that all functions are protected.
5875
5876 @item -fsection-anchors
5877 @opindex fsection-anchors
5878 Try to reduce the number of symbolic address calculations by using
5879 shared ``anchor'' symbols to address nearby objects.  This transformation
5880 can help to reduce the number of GOT entries and GOT accesses on some
5881 targets.
5882
5883 For example, the implementation of the following function @code{foo}:
5884
5885 @smallexample
5886 static int a, b, c;
5887 int foo (void) @{ return a + b + c; @}
5888 @end smallexample
5889
5890 would usually calculate the addresses of all three variables, but if you
5891 compile it with @option{-fsection-anchors}, it will access the variables
5892 from a common anchor point instead.  The effect is similar to the
5893 following pseudocode (which isn't valid C):
5894
5895 @smallexample
5896 int foo (void)
5897 @{
5898   register int *xr = &x;
5899   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
5900 @}
5901 @end smallexample
5902
5903 Not all targets support this option.
5904
5905 @item --param @var{name}=@var{value}
5906 @opindex param
5907 In some places, GCC uses various constants to control the amount of
5908 optimization that is done.  For example, GCC will not inline functions
5909 that contain more that a certain number of instructions.  You can
5910 control some of these constants on the command-line using the
5911 @option{--param} option.
5912
5913 The names of specific parameters, and the meaning of the values, are
5914 tied to the internals of the compiler, and are subject to change
5915 without notice in future releases.
5916
5917 In each case, the @var{value} is an integer.  The allowable choices for
5918 @var{name} are given in the following table:
5919
5920 @table @gcctabopt
5921 @item salias-max-implicit-fields
5922 The maximum number of fields in a variable without direct
5923 structure accesses for which structure aliasing will consider trying 
5924 to track each field.  The default is 5
5925
5926 @item salias-max-array-elements
5927 The maximum number of elements an array can have and its elements
5928 still be tracked individually by structure aliasing. The default is 4
5929
5930 @item sra-max-structure-size
5931 The maximum structure size, in bytes, at which the scalar replacement
5932 of aggregates (SRA) optimization will perform block copies.  The
5933 default value, 0, implies that GCC will select the most appropriate
5934 size itself.
5935
5936 @item sra-field-structure-ratio
5937 The threshold ratio (as a percentage) between instantiated fields and
5938 the complete structure size.  We say that if the ratio of the number
5939 of bytes in instantiated fields to the number of bytes in the complete
5940 structure exceeds this parameter, then block copies are not used.  The
5941 default is 75.
5942
5943 @item max-crossjump-edges
5944 The maximum number of incoming edges to consider for crossjumping.
5945 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
5946 the number of edges incoming to each block.  Increasing values mean
5947 more aggressive optimization, making the compile time increase with
5948 probably small improvement in executable size.
5949
5950 @item min-crossjump-insns
5951 The minimum number of instructions which must be matched at the end
5952 of two blocks before crossjumping will be performed on them.  This
5953 value is ignored in the case where all instructions in the block being
5954 crossjumped from are matched.  The default value is 5.
5955
5956 @item max-grow-copy-bb-insns
5957 The maximum code size expansion factor when copying basic blocks
5958 instead of jumping.  The expansion is relative to a jump instruction.
5959 The default value is 8.
5960
5961 @item max-goto-duplication-insns
5962 The maximum number of instructions to duplicate to a block that jumps
5963 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
5964 passes, GCC factors computed gotos early in the compilation process,
5965 and unfactors them as late as possible.  Only computed jumps at the
5966 end of a basic blocks with no more than max-goto-duplication-insns are
5967 unfactored.  The default value is 8.
5968
5969 @item max-delay-slot-insn-search
5970 The maximum number of instructions to consider when looking for an
5971 instruction to fill a delay slot.  If more than this arbitrary number of
5972 instructions is searched, the time savings from filling the delay slot
5973 will be minimal so stop searching.  Increasing values mean more
5974 aggressive optimization, making the compile time increase with probably
5975 small improvement in executable run time.
5976
5977 @item max-delay-slot-live-search
5978 When trying to fill delay slots, the maximum number of instructions to
5979 consider when searching for a block with valid live register
5980 information.  Increasing this arbitrarily chosen value means more
5981 aggressive optimization, increasing the compile time.  This parameter
5982 should be removed when the delay slot code is rewritten to maintain the
5983 control-flow graph.
5984
5985 @item max-gcse-memory
5986 The approximate maximum amount of memory that will be allocated in
5987 order to perform the global common subexpression elimination
5988 optimization.  If more memory than specified is required, the
5989 optimization will not be done.
5990
5991 @item max-gcse-passes
5992 The maximum number of passes of GCSE to run.  The default is 1.
5993
5994 @item max-pending-list-length
5995 The maximum number of pending dependencies scheduling will allow
5996 before flushing the current state and starting over.  Large functions
5997 with few branches or calls can create excessively large lists which
5998 needlessly consume memory and resources.
5999
6000 @item max-inline-insns-single
6001 Several parameters control the tree inliner used in gcc.
6002 This number sets the maximum number of instructions (counted in GCC's
6003 internal representation) in a single function that the tree inliner
6004 will consider for inlining.  This only affects functions declared
6005 inline and methods implemented in a class declaration (C++).
6006 The default value is 450.
6007
6008 @item max-inline-insns-auto
6009 When you use @option{-finline-functions} (included in @option{-O3}),
6010 a lot of functions that would otherwise not be considered for inlining
6011 by the compiler will be investigated.  To those functions, a different
6012 (more restrictive) limit compared to functions declared inline can
6013 be applied.
6014 The default value is 90.
6015
6016 @item large-function-insns
6017 The limit specifying really large functions.  For functions larger than this
6018 limit after inlining inlining is constrained by
6019 @option{--param large-function-growth}.  This parameter is useful primarily
6020 to avoid extreme compilation time caused by non-linear algorithms used by the
6021 backend.
6022 This parameter is ignored when @option{-funit-at-a-time} is not used.
6023 The default value is 2700.
6024
6025 @item large-function-growth
6026 Specifies maximal growth of large function caused by inlining in percents.
6027 This parameter is ignored when @option{-funit-at-a-time} is not used.
6028 The default value is 100 which limits large function growth to 2.0 times
6029 the original size.
6030
6031 @item large-unit-insns
6032 The limit specifying large translation unit.  Growth caused by inlining of
6033 units larger than this limit is limited by @option{--param inline-unit-growth}.
6034 For small units this might be too tight (consider unit consisting of function A
6035 that is inline and B that just calls A three time.  If B is small relative to
6036 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6037 large units consisting of small inlininable functions however the overall unit
6038 growth limit is needed to avoid exponential explosion of code size.  Thus for
6039 smaller units, the size is increased to @option{--param large-unit-insns}
6040 before applying @option{--param inline-unit-growth}.  The default is 10000
6041
6042 @item inline-unit-growth
6043 Specifies maximal overall growth of the compilation unit caused by inlining.
6044 This parameter is ignored when @option{-funit-at-a-time} is not used.
6045 The default value is 50 which limits unit growth to 1.5 times the original
6046 size.
6047
6048 @item large-stack-frame
6049 The limit specifying large stack frames.  While inlining the algorithm is trying
6050 to not grow past this limit too much.  Default value is 256 bytes.
6051
6052 @item large-stack-frame-growth
6053 Specifies maximal growth of large stack frames caused by inlining in percents.
6054 The default value is 1000 which limits large stack frame growth to 11 times
6055 the original size.
6056
6057 @item max-inline-insns-recursive
6058 @itemx max-inline-insns-recursive-auto
6059 Specifies maximum number of instructions out-of-line copy of self recursive inline
6060 function can grow into by performing recursive inlining.
6061
6062 For functions declared inline @option{--param max-inline-insns-recursive} is
6063 taken into account.  For function not declared inline, recursive inlining
6064 happens only when @option{-finline-functions} (included in @option{-O3}) is
6065 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6066 default value is 450.
6067
6068 @item max-inline-recursive-depth
6069 @itemx max-inline-recursive-depth-auto
6070 Specifies maximum recursion depth used by the recursive inlining.
6071
6072 For functions declared inline @option{--param max-inline-recursive-depth} is
6073 taken into account.  For function not declared inline, recursive inlining
6074 happens only when @option{-finline-functions} (included in @option{-O3}) is
6075 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6076 default value is 450.
6077
6078 @item min-inline-recursive-probability
6079 Recursive inlining is profitable only for function having deep recursion
6080 in average and can hurt for function having little recursion depth by
6081 increasing the prologue size or complexity of function body to other
6082 optimizers.
6083
6084 When profile feedback is available (see @option{-fprofile-generate}) the actual
6085 recursion depth can be guessed from probability that function will recurse via
6086 given call expression.  This parameter limits inlining only to call expression
6087 whose probability exceeds given threshold (in percents).  The default value is
6088 10.
6089
6090 @item inline-call-cost
6091 Specify cost of call instruction relative to simple arithmetics operations
6092 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6093 functions and at the same time increases size of leaf function that is believed to
6094 reduce function size by being inlined.  In effect it increases amount of
6095 inlining for code having large abstraction penalty (many functions that just
6096 pass the arguments to other functions) and decrease inlining for code with low
6097 abstraction penalty.  The default value is 16.
6098
6099 @item max-unrolled-insns
6100 The maximum number of instructions that a loop should have if that loop
6101 is unrolled, and if the loop is unrolled, it determines how many times
6102 the loop code is unrolled.
6103
6104 @item max-average-unrolled-insns
6105 The maximum number of instructions biased by probabilities of their execution
6106 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6107 it determines how many times the loop code is unrolled.
6108
6109 @item max-unroll-times
6110 The maximum number of unrollings of a single loop.
6111
6112 @item max-peeled-insns
6113 The maximum number of instructions that a loop should have if that loop
6114 is peeled, and if the loop is peeled, it determines how many times
6115 the loop code is peeled.
6116
6117 @item max-peel-times
6118 The maximum number of peelings of a single loop.
6119
6120 @item max-completely-peeled-insns
6121 The maximum number of insns of a completely peeled loop.
6122
6123 @item max-completely-peel-times
6124 The maximum number of iterations of a loop to be suitable for complete peeling.
6125
6126 @item max-unswitch-insns
6127 The maximum number of insns of an unswitched loop.
6128
6129 @item max-unswitch-level
6130 The maximum number of branches unswitched in a single loop.
6131
6132 @item lim-expensive
6133 The minimum cost of an expensive expression in the loop invariant motion.
6134
6135 @item iv-consider-all-candidates-bound
6136 Bound on number of candidates for induction variables below that
6137 all candidates are considered for each use in induction variable
6138 optimizations.  Only the most relevant candidates are considered
6139 if there are more candidates, to avoid quadratic time complexity.
6140
6141 @item iv-max-considered-uses
6142 The induction variable optimizations give up on loops that contain more
6143 induction variable uses.
6144
6145 @item iv-always-prune-cand-set-bound
6146 If number of candidates in the set is smaller than this value,
6147 we always try to remove unnecessary ivs from the set during its
6148 optimization when a new iv is added to the set.
6149
6150 @item scev-max-expr-size
6151 Bound on size of expressions used in the scalar evolutions analyzer.
6152 Large expressions slow the analyzer.
6153
6154 @item vect-max-version-checks
6155 The maximum number of runtime checks that can be performed when doing
6156 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6157 for more information.
6158
6159 @item max-iterations-to-track
6160
6161 The maximum number of iterations of a loop the brute force algorithm
6162 for analysis of # of iterations of the loop tries to evaluate.
6163
6164 @item hot-bb-count-fraction
6165 Select fraction of the maximal count of repetitions of basic block in program
6166 given basic block needs to have to be considered hot.
6167
6168 @item hot-bb-frequency-fraction
6169 Select fraction of the maximal frequency of executions of basic block in
6170 function given basic block needs to have to be considered hot
6171
6172 @item max-predicted-iterations
6173 The maximum number of loop iterations we predict statically.  This is useful
6174 in cases where function contain single loop with known bound and other loop
6175 with unknown.  We predict the known number of iterations correctly, while
6176 the unknown number of iterations average to roughly 10.  This means that the
6177 loop without bounds would appear artificially cold relative to the other one.
6178
6179 @item tracer-dynamic-coverage
6180 @itemx tracer-dynamic-coverage-feedback
6181
6182 This value is used to limit superblock formation once the given percentage of
6183 executed instructions is covered.  This limits unnecessary code size
6184 expansion.
6185
6186 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6187 feedback is available.  The real profiles (as opposed to statically estimated
6188 ones) are much less balanced allowing the threshold to be larger value.
6189
6190 @item tracer-max-code-growth
6191 Stop tail duplication once code growth has reached given percentage.  This is
6192 rather hokey argument, as most of the duplicates will be eliminated later in
6193 cross jumping, so it may be set to much higher values than is the desired code
6194 growth.
6195
6196 @item tracer-min-branch-ratio
6197
6198 Stop reverse growth when the reverse probability of best edge is less than this
6199 threshold (in percent).
6200
6201 @item tracer-min-branch-ratio
6202 @itemx tracer-min-branch-ratio-feedback
6203
6204 Stop forward growth if the best edge do have probability lower than this
6205 threshold.
6206
6207 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6208 compilation for profile feedback and one for compilation without.  The value
6209 for compilation with profile feedback needs to be more conservative (higher) in
6210 order to make tracer effective.
6211
6212 @item max-cse-path-length
6213
6214 Maximum number of basic blocks on path that cse considers.  The default is 10.
6215
6216 @item max-cse-insns
6217 The maximum instructions CSE process before flushing. The default is 1000.
6218
6219 @item max-aliased-vops
6220
6221 Maximum number of virtual operands per statement allowed to represent
6222 aliases before triggering the alias grouping heuristic.  Alias
6223 grouping reduces compile times and memory consumption needed for
6224 aliasing at the expense of precision loss in alias information.
6225
6226 @item ggc-min-expand
6227
6228 GCC uses a garbage collector to manage its own memory allocation.  This
6229 parameter specifies the minimum percentage by which the garbage
6230 collector's heap should be allowed to expand between collections.
6231 Tuning this may improve compilation speed; it has no effect on code
6232 generation.
6233
6234 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6235 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6236 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6237 GCC is not able to calculate RAM on a particular platform, the lower
6238 bound of 30% is used.  Setting this parameter and
6239 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6240 every opportunity.  This is extremely slow, but can be useful for
6241 debugging.
6242
6243 @item ggc-min-heapsize
6244
6245 Minimum size of the garbage collector's heap before it begins bothering
6246 to collect garbage.  The first collection occurs after the heap expands
6247 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6248 tuning this may improve compilation speed, and has no effect on code
6249 generation.
6250
6251 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6252 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6253 with a lower bound of 4096 (four megabytes) and an upper bound of
6254 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6255 particular platform, the lower bound is used.  Setting this parameter
6256 very large effectively disables garbage collection.  Setting this
6257 parameter and @option{ggc-min-expand} to zero causes a full collection
6258 to occur at every opportunity.
6259
6260 @item max-reload-search-insns
6261 The maximum number of instruction reload should look backward for equivalent
6262 register.  Increasing values mean more aggressive optimization, making the
6263 compile time increase with probably slightly better performance.  The default
6264 value is 100.
6265
6266 @item max-cselib-memory-locations
6267 The maximum number of memory locations cselib should take into account.
6268 Increasing values mean more aggressive optimization, making the compile time
6269 increase with probably slightly better performance.  The default value is 500.
6270
6271 @item max-flow-memory-locations
6272 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6273 The default value is 100.
6274
6275 @item reorder-blocks-duplicate
6276 @itemx reorder-blocks-duplicate-feedback
6277
6278 Used by basic block reordering pass to decide whether to use unconditional
6279 branch or duplicate the code on its destination.  Code is duplicated when its
6280 estimated size is smaller than this value multiplied by the estimated size of
6281 unconditional jump in the hot spots of the program.
6282
6283 The @option{reorder-block-duplicate-feedback} is used only when profile
6284 feedback is available and may be set to higher values than
6285 @option{reorder-block-duplicate} since information about the hot spots is more
6286 accurate.
6287
6288 @item max-sched-ready-insns
6289 The maximum number of instructions ready to be issued the scheduler should
6290 consider at any given time during the first scheduling pass.  Increasing
6291 values mean more thorough searches, making the compilation time increase
6292 with probably little benefit.  The default value is 100.
6293
6294 @item max-sched-region-blocks
6295 The maximum number of blocks in a region to be considered for
6296 interblock scheduling.  The default value is 10.
6297
6298 @item max-sched-region-insns
6299 The maximum number of insns in a region to be considered for
6300 interblock scheduling.  The default value is 100.
6301
6302 @item min-spec-prob
6303 The minimum probability (in percents) of reaching a source block
6304 for interblock speculative scheduling.  The default value is 40.
6305
6306 @item max-sched-extend-regions-iters
6307 The maximum number of iterations through CFG to extend regions.
6308 0 - disable region extension,
6309 N - do at most N iterations.
6310 The default value is 0.
6311
6312 @item max-sched-insn-conflict-delay
6313 The maximum conflict delay for an insn to be considered for speculative motion.
6314 The default value is 3.
6315
6316 @item sched-spec-prob-cutoff
6317 The minimal probability of speculation success (in percents), so that
6318 speculative insn will be scheduled.
6319 The default value is 40.
6320
6321 @item max-last-value-rtl
6322
6323 The maximum size measured as number of RTLs that can be recorded in an expression
6324 in combiner for a pseudo register as last known value of that register.  The default
6325 is 10000.
6326
6327 @item integer-share-limit
6328 Small integer constants can use a shared data structure, reducing the
6329 compiler's memory usage and increasing its speed.  This sets the maximum
6330 value of a shared integer constant's.  The default value is 256.
6331
6332 @item min-virtual-mappings
6333 Specifies the minimum number of virtual mappings in the incremental
6334 SSA updater that should be registered to trigger the virtual mappings
6335 heuristic defined by virtual-mappings-ratio.  The default value is
6336 100.
6337
6338 @item virtual-mappings-ratio
6339 If the number of virtual mappings is virtual-mappings-ratio bigger
6340 than the number of virtual symbols to be updated, then the incremental
6341 SSA updater switches to a full update for those symbols.  The default
6342 ratio is 3.
6343
6344 @item ssp-buffer-size
6345 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6346 protection when @option{-fstack-protection} is used.
6347
6348 @item max-jump-thread-duplication-stmts
6349 Maximum number of statements allowed in a block that needs to be
6350 duplicated when threading jumps.
6351
6352 @item max-fields-for-field-sensitive
6353 Maximum number of fields in a structure we will treat in
6354 a field sensitive manner during pointer analysis.
6355
6356 @item prefetch-latency
6357 Estimate on average number of instructions that are executed before
6358 prefetch finishes.  The distance we prefetch ahead is proportional
6359 to this constant.  Increasing this number may also lead to less
6360 streams being prefetched (see @option{simultaneous-prefetches}).
6361
6362 @item simultaneous-prefetches
6363 Maximum number of prefetches that can run at the same time.
6364
6365 @item l1-cache-line-size
6366 The size of cache line in L1 cache, in bytes.
6367
6368 @item l1-cache-size
6369 The number of cache lines in L1 cache.
6370
6371 @end table
6372 @end table
6373
6374 @node Preprocessor Options
6375 @section Options Controlling the Preprocessor
6376 @cindex preprocessor options
6377 @cindex options, preprocessor
6378
6379 These options control the C preprocessor, which is run on each C source
6380 file before actual compilation.
6381
6382 If you use the @option{-E} option, nothing is done except preprocessing.
6383 Some of these options make sense only together with @option{-E} because
6384 they cause the preprocessor output to be unsuitable for actual
6385 compilation.
6386
6387 @table @gcctabopt
6388 @opindex Wp
6389 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6390 and pass @var{option} directly through to the preprocessor.  If
6391 @var{option} contains commas, it is split into multiple options at the
6392 commas.  However, many options are modified, translated or interpreted
6393 by the compiler driver before being passed to the preprocessor, and
6394 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6395 interface is undocumented and subject to change, so whenever possible
6396 you should avoid using @option{-Wp} and let the driver handle the
6397 options instead.
6398
6399 @item -Xpreprocessor @var{option}
6400 @opindex preprocessor
6401 Pass @var{option} as an option to the preprocessor.  You can use this to
6402 supply system-specific preprocessor options which GCC does not know how to
6403 recognize.
6404
6405 If you want to pass an option that takes an argument, you must use
6406 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6407 @end table
6408
6409 @include cppopts.texi
6410
6411 @node Assembler Options
6412 @section Passing Options to the Assembler
6413
6414 @c prevent bad page break with this line
6415 You can pass options to the assembler.
6416
6417 @table @gcctabopt
6418 @item -Wa,@var{option}
6419 @opindex Wa
6420 Pass @var{option} as an option to the assembler.  If @var{option}
6421 contains commas, it is split into multiple options at the commas.
6422
6423 @item -Xassembler @var{option}
6424 @opindex Xassembler
6425 Pass @var{option} as an option to the assembler.  You can use this to
6426 supply system-specific assembler options which GCC does not know how to
6427 recognize.
6428
6429 If you want to pass an option that takes an argument, you must use
6430 @option{-Xassembler} twice, once for the option and once for the argument.
6431
6432 @end table
6433
6434 @node Link Options
6435 @section Options for Linking
6436 @cindex link options
6437 @cindex options, linking
6438
6439 These options come into play when the compiler links object files into
6440 an executable output file.  They are meaningless if the compiler is
6441 not doing a link step.
6442
6443 @table @gcctabopt
6444 @cindex file names
6445 @item @var{object-file-name}
6446 A file name that does not end in a special recognized suffix is
6447 considered to name an object file or library.  (Object files are
6448 distinguished from libraries by the linker according to the file
6449 contents.)  If linking is done, these object files are used as input
6450 to the linker.
6451
6452 @item -c
6453 @itemx -S
6454 @itemx -E
6455 @opindex c
6456 @opindex S
6457 @opindex E
6458 If any of these options is used, then the linker is not run, and
6459 object file names should not be used as arguments.  @xref{Overall
6460 Options}.
6461
6462 @cindex Libraries
6463 @item -l@var{library}
6464 @itemx -l @var{library}
6465 @opindex l
6466 Search the library named @var{library} when linking.  (The second
6467 alternative with the library as a separate argument is only for
6468 POSIX compliance and is not recommended.)
6469
6470 It makes a difference where in the command you write this option; the
6471 linker searches and processes libraries and object files in the order they
6472 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6473 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6474 to functions in @samp{z}, those functions may not be loaded.
6475
6476 The linker searches a standard list of directories for the library,
6477 which is actually a file named @file{lib@var{library}.a}.  The linker
6478 then uses this file as if it had been specified precisely by name.
6479
6480 The directories searched include several standard system directories
6481 plus any that you specify with @option{-L}.
6482
6483 Normally the files found this way are library files---archive files
6484 whose members are object files.  The linker handles an archive file by
6485 scanning through it for members which define symbols that have so far
6486 been referenced but not defined.  But if the file that is found is an
6487 ordinary object file, it is linked in the usual fashion.  The only
6488 difference between using an @option{-l} option and specifying a file name
6489 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6490 and searches several directories.
6491
6492 @item -lobjc
6493 @opindex lobjc
6494 You need this special case of the @option{-l} option in order to
6495 link an Objective-C or Objective-C++ program.
6496
6497 @item -nostartfiles
6498 @opindex nostartfiles
6499 Do not use the standard system startup files when linking.
6500 The standard system libraries are used normally, unless @option{-nostdlib}
6501 or @option{-nodefaultlibs} is used.
6502
6503 @item -nodefaultlibs
6504 @opindex nodefaultlibs
6505 Do not use the standard system libraries when linking.
6506 Only the libraries you specify will be passed to the linker.
6507 The standard startup files are used normally, unless @option{-nostartfiles}
6508 is used.  The compiler may generate calls to @code{memcmp},
6509 @code{memset}, @code{memcpy} and @code{memmove}.
6510 These entries are usually resolved by entries in
6511 libc.  These entry points should be supplied through some other
6512 mechanism when this option is specified.
6513
6514 @item -nostdlib
6515 @opindex nostdlib
6516 Do not use the standard system startup files or libraries when linking.
6517 No startup files and only the libraries you specify will be passed to
6518 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6519 @code{memcpy} and @code{memmove}.
6520 These entries are usually resolved by entries in
6521 libc.  These entry points should be supplied through some other
6522 mechanism when this option is specified.
6523
6524 @cindex @option{-lgcc}, use with @option{-nostdlib}
6525 @cindex @option{-nostdlib} and unresolved references
6526 @cindex unresolved references and @option{-nostdlib}
6527 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6528 @cindex @option{-nodefaultlibs} and unresolved references
6529 @cindex unresolved references and @option{-nodefaultlibs}
6530 One of the standard libraries bypassed by @option{-nostdlib} and
6531 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6532 that GCC uses to overcome shortcomings of particular machines, or special
6533 needs for some languages.
6534 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6535 Collection (GCC) Internals},
6536 for more discussion of @file{libgcc.a}.)
6537 In most cases, you need @file{libgcc.a} even when you want to avoid
6538 other standard libraries.  In other words, when you specify @option{-nostdlib}
6539 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6540 This ensures that you have no unresolved references to internal GCC
6541 library subroutines.  (For example, @samp{__main}, used to ensure C++
6542 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6543 GNU Compiler Collection (GCC) Internals}.)
6544
6545 @item -pie
6546 @opindex pie
6547 Produce a position independent executable on targets which support it.
6548 For predictable results, you must also specify the same set of options
6549 that were used to generate code (@option{-fpie}, @option{-fPIE},
6550 or model suboptions) when you specify this option.
6551
6552 @item -rdynamic
6553 @opindex rdynamic
6554 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6555 that support it. This instructs the linker to add all symbols, not
6556 only used ones, to the dynamic symbol table. This option is needed
6557 for some uses of @code{dlopen} or to allow obtaining backtraces
6558 from within a program.
6559
6560 @item -s
6561 @opindex s
6562 Remove all symbol table and relocation information from the executable.
6563
6564 @item -static
6565 @opindex static
6566 On systems that support dynamic linking, this prevents linking with the shared
6567 libraries.  On other systems, this option has no effect.
6568
6569 @item -shared
6570 @opindex shared
6571 Produce a shared object which can then be linked with other objects to
6572 form an executable.  Not all systems support this option.  For predictable
6573 results, you must also specify the same set of options that were used to
6574 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6575 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6576 needs to build supplementary stub code for constructors to work.  On
6577 multi-libbed systems, @samp{gcc -shared} must select the correct support
6578 libraries to link against.  Failing to supply the correct flags may lead
6579 to subtle defects.  Supplying them in cases where they are not necessary
6580 is innocuous.}
6581
6582 @item -shared-libgcc
6583 @itemx -static-libgcc
6584 @opindex shared-libgcc
6585 @opindex static-libgcc
6586 On systems that provide @file{libgcc} as a shared library, these options
6587 force the use of either the shared or static version respectively.
6588 If no shared version of @file{libgcc} was built when the compiler was
6589 configured, these options have no effect.
6590
6591 There are several situations in which an application should use the
6592 shared @file{libgcc} instead of the static version.  The most common
6593 of these is when the application wishes to throw and catch exceptions
6594 across different shared libraries.  In that case, each of the libraries
6595 as well as the application itself should use the shared @file{libgcc}.
6596
6597 Therefore, the G++ and GCJ drivers automatically add
6598 @option{-shared-libgcc} whenever you build a shared library or a main
6599 executable, because C++ and Java programs typically use exceptions, so
6600 this is the right thing to do.
6601
6602 If, instead, you use the GCC driver to create shared libraries, you may
6603 find that they will not always be linked with the shared @file{libgcc}.
6604 If GCC finds, at its configuration time, that you have a non-GNU linker
6605 or a GNU linker that does not support option @option{--eh-frame-hdr},
6606 it will link the shared version of @file{libgcc} into shared libraries
6607 by default.  Otherwise, it will take advantage of the linker and optimize
6608 away the linking with the shared version of @file{libgcc}, linking with
6609 the static version of libgcc by default.  This allows exceptions to
6610 propagate through such shared libraries, without incurring relocation
6611 costs at library load time.
6612
6613 However, if a library or main executable is supposed to throw or catch
6614 exceptions, you must link it using the G++ or GCJ driver, as appropriate
6615 for the languages used in the program, or using the option
6616 @option{-shared-libgcc}, such that it is linked with the shared
6617 @file{libgcc}.
6618
6619 @item -symbolic
6620 @opindex symbolic
6621 Bind references to global symbols when building a shared object.  Warn
6622 about any unresolved references (unless overridden by the link editor
6623 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
6624 this option.
6625
6626 @item -Xlinker @var{option}
6627 @opindex Xlinker
6628 Pass @var{option} as an option to the linker.  You can use this to
6629 supply system-specific linker options which GCC does not know how to
6630 recognize.
6631
6632 If you want to pass an option that takes an argument, you must use
6633 @option{-Xlinker} twice, once for the option and once for the argument.
6634 For example, to pass @option{-assert definitions}, you must write
6635 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
6636 @option{-Xlinker "-assert definitions"}, because this passes the entire
6637 string as a single argument, which is not what the linker expects.
6638
6639 @item -Wl,@var{option}
6640 @opindex Wl
6641 Pass @var{option} as an option to the linker.  If @var{option} contains
6642 commas, it is split into multiple options at the commas.
6643
6644 @item -u @var{symbol}
6645 @opindex u
6646 Pretend the symbol @var{symbol} is undefined, to force linking of
6647 library modules to define it.  You can use @option{-u} multiple times with
6648 different symbols to force loading of additional library modules.
6649 @end table
6650
6651 @node Directory Options
6652 @section Options for Directory Search
6653 @cindex directory options
6654 @cindex options, directory search
6655 @cindex search path
6656
6657 These options specify directories to search for header files, for
6658 libraries and for parts of the compiler:
6659
6660 @table @gcctabopt
6661 @item -I@var{dir}
6662 @opindex I
6663 Add the directory @var{dir} to the head of the list of directories to be
6664 searched for header files.  This can be used to override a system header
6665 file, substituting your own version, since these directories are
6666 searched before the system header file directories.  However, you should
6667 not use this option to add directories that contain vendor-supplied
6668 system header files (use @option{-isystem} for that).  If you use more than
6669 one @option{-I} option, the directories are scanned in left-to-right
6670 order; the standard system directories come after.
6671
6672 If a standard system include directory, or a directory specified with
6673 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
6674 option will be ignored.  The directory will still be searched but as a
6675 system directory at its normal position in the system include chain.
6676 This is to ensure that GCC's procedure to fix buggy system headers and
6677 the ordering for the include_next directive are not inadvertently changed.
6678 If you really need to change the search order for system directories,
6679 use the @option{-nostdinc} and/or @option{-isystem} options.
6680
6681 @item -iquote@var{dir}
6682 @opindex iquote
6683 Add the directory @var{dir} to the head of the list of directories to
6684 be searched for header files only for the case of @samp{#include
6685 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
6686 otherwise just like @option{-I}.
6687
6688 @item -L@var{dir}
6689 @opindex L
6690 Add directory @var{dir} to the list of directories to be searched
6691 for @option{-l}.
6692
6693 @item -B@var{prefix}
6694 @opindex B
6695 This option specifies where to find the executables, libraries,
6696 include files, and data files of the compiler itself.
6697
6698 The compiler driver program runs one or more of the subprograms
6699 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
6700 @var{prefix} as a prefix for each program it tries to run, both with and
6701 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
6702
6703 For each subprogram to be run, the compiler driver first tries the
6704 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
6705 was not specified, the driver tries two standard prefixes, which are
6706 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
6707 those results in a file name that is found, the unmodified program
6708 name is searched for using the directories specified in your
6709 @env{PATH} environment variable.
6710
6711 The compiler will check to see if the path provided by the @option{-B}
6712 refers to a directory, and if necessary it will add a directory
6713 separator character at the end of the path.
6714
6715 @option{-B} prefixes that effectively specify directory names also apply
6716 to libraries in the linker, because the compiler translates these
6717 options into @option{-L} options for the linker.  They also apply to
6718 includes files in the preprocessor, because the compiler translates these
6719 options into @option{-isystem} options for the preprocessor.  In this case,
6720 the compiler appends @samp{include} to the prefix.
6721
6722 The run-time support file @file{libgcc.a} can also be searched for using
6723 the @option{-B} prefix, if needed.  If it is not found there, the two
6724 standard prefixes above are tried, and that is all.  The file is left
6725 out of the link if it is not found by those means.
6726
6727 Another way to specify a prefix much like the @option{-B} prefix is to use
6728 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
6729 Variables}.
6730
6731 As a special kludge, if the path provided by @option{-B} is
6732 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
6733 9, then it will be replaced by @file{[dir/]include}.  This is to help
6734 with boot-strapping the compiler.
6735
6736 @item -specs=@var{file}
6737 @opindex specs
6738 Process @var{file} after the compiler reads in the standard @file{specs}
6739 file, in order to override the defaults that the @file{gcc} driver
6740 program uses when determining what switches to pass to @file{cc1},
6741 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
6742 @option{-specs=@var{file}} can be specified on the command line, and they
6743 are processed in order, from left to right.
6744
6745 @item --sysroot=@var{dir}
6746 @opindex sysroot
6747 Use @var{dir} as the logical root directory for headers and libraries.
6748 For example, if the compiler would normally search for headers in
6749 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
6750 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.  
6751
6752 If you use both this option and the @option{-isysroot} option, then
6753 the @option{--sysroot} option will apply to libraries, but the
6754 @option{-isysroot} option will apply to header files.
6755
6756 The GNU linker (beginning with version 2.16) has the necessary support
6757 for this option.  If your linker does not support this option, the
6758 header file aspect of @option{--sysroot} will still work, but the
6759 library aspect will not.
6760
6761 @item -I-
6762 @opindex I-
6763 This option has been deprecated.  Please use @option{-iquote} instead for
6764 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
6765 Any directories you specify with @option{-I} options before the @option{-I-}
6766 option are searched only for the case of @samp{#include "@var{file}"};
6767 they are not searched for @samp{#include <@var{file}>}.
6768
6769 If additional directories are specified with @option{-I} options after
6770 the @option{-I-}, these directories are searched for all @samp{#include}
6771 directives.  (Ordinarily @emph{all} @option{-I} directories are used
6772 this way.)
6773
6774 In addition, the @option{-I-} option inhibits the use of the current
6775 directory (where the current input file came from) as the first search
6776 directory for @samp{#include "@var{file}"}.  There is no way to
6777 override this effect of @option{-I-}.  With @option{-I.} you can specify
6778 searching the directory which was current when the compiler was
6779 invoked.  That is not exactly the same as what the preprocessor does
6780 by default, but it is often satisfactory.
6781
6782 @option{-I-} does not inhibit the use of the standard system directories
6783 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
6784 independent.
6785 @end table
6786
6787 @c man end
6788
6789 @node Spec Files
6790 @section Specifying subprocesses and the switches to pass to them
6791 @cindex Spec Files
6792
6793 @command{gcc} is a driver program.  It performs its job by invoking a
6794 sequence of other programs to do the work of compiling, assembling and
6795 linking.  GCC interprets its command-line parameters and uses these to
6796 deduce which programs it should invoke, and which command-line options
6797 it ought to place on their command lines.  This behavior is controlled
6798 by @dfn{spec strings}.  In most cases there is one spec string for each
6799 program that GCC can invoke, but a few programs have multiple spec
6800 strings to control their behavior.  The spec strings built into GCC can
6801 be overridden by using the @option{-specs=} command-line switch to specify
6802 a spec file.
6803
6804 @dfn{Spec files} are plaintext files that are used to construct spec
6805 strings.  They consist of a sequence of directives separated by blank
6806 lines.  The type of directive is determined by the first non-whitespace
6807 character on the line and it can be one of the following:
6808
6809 @table @code
6810 @item %@var{command}
6811 Issues a @var{command} to the spec file processor.  The commands that can
6812 appear here are:
6813
6814 @table @code
6815 @item %include <@var{file}>
6816 @cindex %include
6817 Search for @var{file} and insert its text at the current point in the
6818 specs file.
6819
6820 @item %include_noerr <@var{file}>
6821 @cindex %include_noerr
6822 Just like @samp{%include}, but do not generate an error message if the include
6823 file cannot be found.
6824
6825 @item %rename @var{old_name} @var{new_name}
6826 @cindex %rename
6827 Rename the spec string @var{old_name} to @var{new_name}.
6828
6829 @end table
6830
6831 @item *[@var{spec_name}]:
6832 This tells the compiler to create, override or delete the named spec
6833 string.  All lines after this directive up to the next directive or
6834 blank line are considered to be the text for the spec string.  If this
6835 results in an empty string then the spec will be deleted.  (Or, if the
6836 spec did not exist, then nothing will happened.)  Otherwise, if the spec
6837 does not currently exist a new spec will be created.  If the spec does
6838 exist then its contents will be overridden by the text of this
6839 directive, unless the first character of that text is the @samp{+}
6840 character, in which case the text will be appended to the spec.
6841
6842 @item [@var{suffix}]:
6843 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
6844 and up to the next directive or blank line are considered to make up the
6845 spec string for the indicated suffix.  When the compiler encounters an
6846 input file with the named suffix, it will processes the spec string in
6847 order to work out how to compile that file.  For example:
6848
6849 @smallexample
6850 .ZZ:
6851 z-compile -input %i
6852 @end smallexample
6853
6854 This says that any input file whose name ends in @samp{.ZZ} should be
6855 passed to the program @samp{z-compile}, which should be invoked with the
6856 command-line switch @option{-input} and with the result of performing the
6857 @samp{%i} substitution.  (See below.)
6858
6859 As an alternative to providing a spec string, the text that follows a
6860 suffix directive can be one of the following:
6861
6862 @table @code
6863 @item @@@var{language}
6864 This says that the suffix is an alias for a known @var{language}.  This is
6865 similar to using the @option{-x} command-line switch to GCC to specify a
6866 language explicitly.  For example:
6867
6868 @smallexample
6869 .ZZ:
6870 @@c++
6871 @end smallexample
6872
6873 Says that .ZZ files are, in fact, C++ source files.
6874
6875 @item #@var{name}
6876 This causes an error messages saying:
6877
6878 @smallexample
6879 @var{name} compiler not installed on this system.
6880 @end smallexample
6881 @end table
6882
6883 GCC already has an extensive list of suffixes built into it.
6884 This directive will add an entry to the end of the list of suffixes, but
6885 since the list is searched from the end backwards, it is effectively
6886 possible to override earlier entries using this technique.
6887
6888 @end table
6889
6890 GCC has the following spec strings built into it.  Spec files can
6891 override these strings or create their own.  Note that individual
6892 targets can also add their own spec strings to this list.
6893
6894 @smallexample
6895 asm          Options to pass to the assembler
6896 asm_final    Options to pass to the assembler post-processor
6897 cpp          Options to pass to the C preprocessor
6898 cc1          Options to pass to the C compiler
6899 cc1plus      Options to pass to the C++ compiler
6900 endfile      Object files to include at the end of the link
6901 link         Options to pass to the linker
6902 lib          Libraries to include on the command line to the linker
6903 libgcc       Decides which GCC support library to pass to the linker
6904 linker       Sets the name of the linker
6905 predefines   Defines to be passed to the C preprocessor
6906 signed_char  Defines to pass to CPP to say whether @code{char} is signed
6907              by default
6908 startfile    Object files to include at the start of the link
6909 @end smallexample
6910
6911 Here is a small example of a spec file:
6912
6913 @smallexample
6914 %rename lib                 old_lib
6915
6916 *lib:
6917 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
6918 @end smallexample
6919
6920 This example renames the spec called @samp{lib} to @samp{old_lib} and
6921 then overrides the previous definition of @samp{lib} with a new one.
6922 The new definition adds in some extra command-line options before
6923 including the text of the old definition.
6924
6925 @dfn{Spec strings} are a list of command-line options to be passed to their
6926 corresponding program.  In addition, the spec strings can contain
6927 @samp{%}-prefixed sequences to substitute variable text or to
6928 conditionally insert text into the command line.  Using these constructs
6929 it is possible to generate quite complex command lines.
6930
6931 Here is a table of all defined @samp{%}-sequences for spec
6932 strings.  Note that spaces are not generated automatically around the
6933 results of expanding these sequences.  Therefore you can concatenate them
6934 together or combine them with constant text in a single argument.
6935
6936 @table @code
6937 @item %%
6938 Substitute one @samp{%} into the program name or argument.
6939
6940 @item %i
6941 Substitute the name of the input file being processed.
6942
6943 @item %b
6944 Substitute the basename of the input file being processed.
6945 This is the substring up to (and not including) the last period
6946 and not including the directory.
6947
6948 @item %B
6949 This is the same as @samp{%b}, but include the file suffix (text after
6950 the last period).
6951
6952 @item %d
6953 Marks the argument containing or following the @samp{%d} as a
6954 temporary file name, so that that file will be deleted if GCC exits
6955 successfully.  Unlike @samp{%g}, this contributes no text to the
6956 argument.
6957
6958 @item %g@var{suffix}
6959 Substitute a file name that has suffix @var{suffix} and is chosen
6960 once per compilation, and mark the argument in the same way as
6961 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
6962 name is now chosen in a way that is hard to predict even when previously
6963 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
6964 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
6965 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
6966 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
6967 was simply substituted with a file name chosen once per compilation,
6968 without regard to any appended suffix (which was therefore treated
6969 just like ordinary text), making such attacks more likely to succeed.
6970
6971 @item %u@var{suffix}
6972 Like @samp{%g}, but generates a new temporary file name even if
6973 @samp{%u@var{suffix}} was already seen.
6974
6975 @item %U@var{suffix}
6976 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
6977 new one if there is no such last file name.  In the absence of any
6978 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
6979 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
6980 would involve the generation of two distinct file names, one
6981 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
6982 simply substituted with a file name chosen for the previous @samp{%u},
6983 without regard to any appended suffix.
6984
6985 @item %j@var{suffix}
6986 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
6987 writable, and if save-temps is off; otherwise, substitute the name
6988 of a temporary file, just like @samp{%u}.  This temporary file is not
6989 meant for communication between processes, but rather as a junk
6990 disposal mechanism.
6991
6992 @item %|@var{suffix}
6993 @itemx %m@var{suffix}
6994 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
6995 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
6996 all.  These are the two most common ways to instruct a program that it
6997 should read from standard input or write to standard output.  If you
6998 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
6999 construct: see for example @file{f/lang-specs.h}.
7000
7001 @item %.@var{SUFFIX}
7002 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7003 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7004 terminated by the next space or %.
7005
7006 @item %w
7007 Marks the argument containing or following the @samp{%w} as the
7008 designated output file of this compilation.  This puts the argument
7009 into the sequence of arguments that @samp{%o} will substitute later.
7010
7011 @item %o
7012 Substitutes the names of all the output files, with spaces
7013 automatically placed around them.  You should write spaces
7014 around the @samp{%o} as well or the results are undefined.
7015 @samp{%o} is for use in the specs for running the linker.
7016 Input files whose names have no recognized suffix are not compiled
7017 at all, but they are included among the output files, so they will
7018 be linked.
7019
7020 @item %O
7021 Substitutes the suffix for object files.  Note that this is
7022 handled specially when it immediately follows @samp{%g, %u, or %U},
7023 because of the need for those to form complete file names.  The
7024 handling is such that @samp{%O} is treated exactly as if it had already
7025 been substituted, except that @samp{%g, %u, and %U} do not currently
7026 support additional @var{suffix} characters following @samp{%O} as they would
7027 following, for example, @samp{.o}.
7028
7029 @item %p
7030 Substitutes the standard macro predefinitions for the
7031 current target machine.  Use this when running @code{cpp}.
7032
7033 @item %P
7034 Like @samp{%p}, but puts @samp{__} before and after the name of each
7035 predefined macro, except for macros that start with @samp{__} or with
7036 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7037 C@.
7038
7039 @item %I
7040 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7041 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7042 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7043 and @option{-imultilib} as necessary.
7044
7045 @item %s
7046 Current argument is the name of a library or startup file of some sort.
7047 Search for that file in a standard list of directories and substitute
7048 the full name found.
7049
7050 @item %e@var{str}
7051 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7052 Use this when inconsistent options are detected.
7053
7054 @item %(@var{name})
7055 Substitute the contents of spec string @var{name} at this point.
7056
7057 @item %[@var{name}]
7058 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7059
7060 @item %x@{@var{option}@}
7061 Accumulate an option for @samp{%X}.
7062
7063 @item %X
7064 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7065 spec string.
7066
7067 @item %Y
7068 Output the accumulated assembler options specified by @option{-Wa}.
7069
7070 @item %Z
7071 Output the accumulated preprocessor options specified by @option{-Wp}.
7072
7073 @item %a
7074 Process the @code{asm} spec.  This is used to compute the
7075 switches to be passed to the assembler.
7076
7077 @item %A
7078 Process the @code{asm_final} spec.  This is a spec string for
7079 passing switches to an assembler post-processor, if such a program is
7080 needed.
7081
7082 @item %l
7083 Process the @code{link} spec.  This is the spec for computing the
7084 command line passed to the linker.  Typically it will make use of the
7085 @samp{%L %G %S %D and %E} sequences.
7086
7087 @item %D
7088 Dump out a @option{-L} option for each directory that GCC believes might
7089 contain startup files.  If the target supports multilibs then the
7090 current multilib directory will be prepended to each of these paths.
7091
7092 @item %L
7093 Process the @code{lib} spec.  This is a spec string for deciding which
7094 libraries should be included on the command line to the linker.
7095
7096 @item %G
7097 Process the @code{libgcc} spec.  This is a spec string for deciding
7098 which GCC support library should be included on the command line to the linker.
7099
7100 @item %S
7101 Process the @code{startfile} spec.  This is a spec for deciding which
7102 object files should be the first ones passed to the linker.  Typically
7103 this might be a file named @file{crt0.o}.
7104
7105 @item %E
7106 Process the @code{endfile} spec.  This is a spec string that specifies
7107 the last object files that will be passed to the linker.
7108
7109 @item %C
7110 Process the @code{cpp} spec.  This is used to construct the arguments
7111 to be passed to the C preprocessor.
7112
7113 @item %1
7114 Process the @code{cc1} spec.  This is used to construct the options to be
7115 passed to the actual C compiler (@samp{cc1}).
7116
7117 @item %2
7118 Process the @code{cc1plus} spec.  This is used to construct the options to be
7119 passed to the actual C++ compiler (@samp{cc1plus}).
7120
7121 @item %*
7122 Substitute the variable part of a matched option.  See below.
7123 Note that each comma in the substituted string is replaced by
7124 a single space.
7125
7126 @item %<@code{S}
7127 Remove all occurrences of @code{-S} from the command line.  Note---this
7128 command is position dependent.  @samp{%} commands in the spec string
7129 before this one will see @code{-S}, @samp{%} commands in the spec string
7130 after this one will not.
7131
7132 @item %:@var{function}(@var{args})
7133 Call the named function @var{function}, passing it @var{args}.
7134 @var{args} is first processed as a nested spec string, then split
7135 into an argument vector in the usual fashion.  The function returns
7136 a string which is processed as if it had appeared literally as part
7137 of the current spec.
7138
7139 The following built-in spec functions are provided:
7140
7141 @table @code
7142 @item @code{if-exists}
7143 The @code{if-exists} spec function takes one argument, an absolute
7144 pathname to a file.  If the file exists, @code{if-exists} returns the
7145 pathname.  Here is a small example of its usage:
7146
7147 @smallexample
7148 *startfile:
7149 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7150 @end smallexample
7151
7152 @item @code{if-exists-else}
7153 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7154 spec function, except that it takes two arguments.  The first argument is
7155 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7156 returns the pathname.  If it does not exist, it returns the second argument.
7157 This way, @code{if-exists-else} can be used to select one file or another,
7158 based on the existence of the first.  Here is a small example of its usage:
7159
7160 @smallexample
7161 *startfile:
7162 crt0%O%s %:if-exists(crti%O%s) \
7163 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7164 @end smallexample
7165
7166 @item @code{replace-outfile}
7167 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7168 first argument in the outfiles array and replaces it with the second argument.  Here
7169 is a small example of its usage:
7170
7171 @smallexample
7172 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7173 @end smallexample
7174
7175 @end table
7176
7177 @item %@{@code{S}@}
7178 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7179 If that switch was not specified, this substitutes nothing.  Note that
7180 the leading dash is omitted when specifying this option, and it is
7181 automatically inserted if the substitution is performed.  Thus the spec
7182 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7183 and would output the command line option @option{-foo}.
7184
7185 @item %W@{@code{S}@}
7186 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7187 deleted on failure.
7188
7189 @item %@{@code{S}*@}
7190 Substitutes all the switches specified to GCC whose names start
7191 with @code{-S}, but which also take an argument.  This is used for
7192 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7193 GCC considers @option{-o foo} as being
7194 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7195 text, including the space.  Thus two arguments would be generated.
7196
7197 @item %@{@code{S}*&@code{T}*@}
7198 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7199 (the order of @code{S} and @code{T} in the spec is not significant).
7200 There can be any number of ampersand-separated variables; for each the
7201 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7202
7203 @item %@{@code{S}:@code{X}@}
7204 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7205
7206 @item %@{!@code{S}:@code{X}@}
7207 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7208
7209 @item %@{@code{S}*:@code{X}@}
7210 Substitutes @code{X} if one or more switches whose names start with
7211 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7212 once, no matter how many such switches appeared.  However, if @code{%*}
7213 appears somewhere in @code{X}, then @code{X} will be substituted once
7214 for each matching switch, with the @code{%*} replaced by the part of
7215 that switch that matched the @code{*}.
7216
7217 @item %@{.@code{S}:@code{X}@}
7218 Substitutes @code{X}, if processing a file with suffix @code{S}.
7219
7220 @item %@{!.@code{S}:@code{X}@}
7221 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7222
7223 @item %@{@code{S}|@code{P}:@code{X}@}
7224 Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@.
7225 This may be combined with @samp{!}, @samp{.}, and @code{*} sequences as well,
7226 although they have a stronger binding than the @samp{|}.  If @code{%*}
7227 appears in @code{X}, all of the alternatives must be starred, and only
7228 the first matching alternative is substituted.
7229
7230 For example, a spec string like this:
7231
7232 @smallexample
7233 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7234 @end smallexample
7235
7236 will output the following command-line options from the following input
7237 command-line options:
7238
7239 @smallexample
7240 fred.c        -foo -baz
7241 jim.d         -bar -boggle
7242 -d fred.c     -foo -baz -boggle
7243 -d jim.d      -bar -baz -boggle
7244 @end smallexample
7245
7246 @item %@{S:X; T:Y; :D@}
7247
7248 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7249 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7250 be as many clauses as you need.  This may be combined with @code{.},
7251 @code{!}, @code{|}, and @code{*} as needed.
7252
7253
7254 @end table
7255
7256 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7257 construct may contain other nested @samp{%} constructs or spaces, or
7258 even newlines.  They are processed as usual, as described above.
7259 Trailing white space in @code{X} is ignored.  White space may also
7260 appear anywhere on the left side of the colon in these constructs,
7261 except between @code{.} or @code{*} and the corresponding word.
7262
7263 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7264 handled specifically in these constructs.  If another value of
7265 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7266 @option{-W} switch is found later in the command line, the earlier
7267 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7268 just one letter, which passes all matching options.
7269
7270 The character @samp{|} at the beginning of the predicate text is used to
7271 indicate that a command should be piped to the following command, but
7272 only if @option{-pipe} is specified.
7273
7274 It is built into GCC which switches take arguments and which do not.
7275 (You might think it would be useful to generalize this to allow each
7276 compiler's spec to say which switches take arguments.  But this cannot
7277 be done in a consistent fashion.  GCC cannot even decide which input
7278 files have been specified without knowing which switches take arguments,
7279 and it must know which input files to compile in order to tell which
7280 compilers to run).
7281
7282 GCC also knows implicitly that arguments starting in @option{-l} are to be
7283 treated as compiler output files, and passed to the linker in their
7284 proper position among the other output files.
7285
7286 @c man begin OPTIONS
7287
7288 @node Target Options
7289 @section Specifying Target Machine and Compiler Version
7290 @cindex target options
7291 @cindex cross compiling
7292 @cindex specifying machine version
7293 @cindex specifying compiler version and target machine
7294 @cindex compiler version, specifying
7295 @cindex target machine, specifying
7296
7297 The usual way to run GCC is to run the executable called @file{gcc}, or
7298 @file{<machine>-gcc} when cross-compiling, or
7299 @file{<machine>-gcc-<version>} to run a version other than the one that
7300 was installed last.  Sometimes this is inconvenient, so GCC provides
7301 options that will switch to another cross-compiler or version.
7302
7303 @table @gcctabopt
7304 @item -b @var{machine}
7305 @opindex b
7306 The argument @var{machine} specifies the target machine for compilation.
7307
7308 The value to use for @var{machine} is the same as was specified as the
7309 machine type when configuring GCC as a cross-compiler.  For
7310 example, if a cross-compiler was configured with @samp{configure
7311 arm-elf}, meaning to compile for an arm processor with elf binaries,
7312 then you would specify @option{-b arm-elf} to run that cross compiler.
7313 Because there are other options beginning with @option{-b}, the
7314 configuration must contain a hyphen. 
7315
7316 @item -V @var{version}
7317 @opindex V
7318 The argument @var{version} specifies which version of GCC to run.
7319 This is useful when multiple versions are installed.  For example,
7320 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7321 @end table
7322
7323 The @option{-V} and @option{-b} options work by running the
7324 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7325 use them if you can just run that directly.
7326
7327 @node Submodel Options
7328 @section Hardware Models and Configurations
7329 @cindex submodel options
7330 @cindex specifying hardware config
7331 @cindex hardware models and configurations, specifying
7332 @cindex machine dependent options
7333
7334 Earlier we discussed the standard option @option{-b} which chooses among
7335 different installed compilers for completely different target
7336 machines, such as VAX vs.@: 68000 vs.@: 80386.
7337
7338 In addition, each of these target machine types can have its own
7339 special options, starting with @samp{-m}, to choose among various
7340 hardware models or configurations---for example, 68010 vs 68020,
7341 floating coprocessor or none.  A single installed version of the
7342 compiler can compile for any model or configuration, according to the
7343 options specified.
7344
7345 Some configurations of the compiler also support additional special
7346 options, usually for compatibility with other compilers on the same
7347 platform.
7348
7349 @c This list is ordered alphanumerically by subsection name.
7350 @c It should be the same order and spelling as these options are listed
7351 @c in Machine Dependent Options
7352
7353 @menu
7354 * ARC Options::
7355 * ARM Options::
7356 * AVR Options::
7357 * Blackfin Options::
7358 * CRIS Options::
7359 * CRX Options::
7360 * Darwin Options::
7361 * DEC Alpha Options::
7362 * DEC Alpha/VMS Options::
7363 * FRV Options::
7364 * GNU/Linux Options::
7365 * H8/300 Options::
7366 * HPPA Options::
7367 * i386 and x86-64 Options::
7368 * IA-64 Options::
7369 * M32C Options::
7370 * M32R/D Options::
7371 * M680x0 Options::
7372 * M68hc1x Options::
7373 * MCore Options::
7374 * MIPS Options::
7375 * MMIX Options::
7376 * MN10300 Options::
7377 * MT Options::
7378 * PDP-11 Options::
7379 * PowerPC Options::
7380 * RS/6000 and PowerPC Options::
7381 * S/390 and zSeries Options::
7382 * Score Options::
7383 * SH Options::
7384 * SPARC Options::
7385 * SPU Options::
7386 * System V Options::
7387 * TMS320C3x/C4x Options::
7388 * V850 Options::
7389 * VAX Options::
7390 * x86-64 Options::
7391 * Xstormy16 Options::
7392 * Xtensa Options::
7393 * zSeries Options::
7394 @end menu
7395
7396 @node ARC Options
7397 @subsection ARC Options
7398 @cindex ARC Options
7399
7400 These options are defined for ARC implementations:
7401
7402 @table @gcctabopt
7403 @item -EL
7404 @opindex EL
7405 Compile code for little endian mode.  This is the default.
7406
7407 @item -EB
7408 @opindex EB
7409 Compile code for big endian mode.
7410
7411 @item -mmangle-cpu
7412 @opindex mmangle-cpu
7413 Prepend the name of the cpu to all public symbol names.
7414 In multiple-processor systems, there are many ARC variants with different
7415 instruction and register set characteristics.  This flag prevents code
7416 compiled for one cpu to be linked with code compiled for another.
7417 No facility exists for handling variants that are ``almost identical''.
7418 This is an all or nothing option.
7419
7420 @item -mcpu=@var{cpu}
7421 @opindex mcpu
7422 Compile code for ARC variant @var{cpu}.
7423 Which variants are supported depend on the configuration.
7424 All variants support @option{-mcpu=base}, this is the default.
7425
7426 @item -mtext=@var{text-section}
7427 @itemx -mdata=@var{data-section}
7428 @itemx -mrodata=@var{readonly-data-section}
7429 @opindex mtext
7430 @opindex mdata
7431 @opindex mrodata
7432 Put functions, data, and readonly data in @var{text-section},
7433 @var{data-section}, and @var{readonly-data-section} respectively
7434 by default.  This can be overridden with the @code{section} attribute.
7435 @xref{Variable Attributes}.
7436
7437 @end table
7438
7439 @node ARM Options
7440 @subsection ARM Options
7441 @cindex ARM options
7442
7443 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7444 architectures:
7445
7446 @table @gcctabopt
7447 @item -mabi=@var{name}
7448 @opindex mabi
7449 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7450 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
7451
7452 @item -mapcs-frame
7453 @opindex mapcs-frame
7454 Generate a stack frame that is compliant with the ARM Procedure Call
7455 Standard for all functions, even if this is not strictly necessary for
7456 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7457 with this option will cause the stack frames not to be generated for
7458 leaf functions.  The default is @option{-mno-apcs-frame}.
7459
7460 @item -mapcs
7461 @opindex mapcs
7462 This is a synonym for @option{-mapcs-frame}.
7463
7464 @ignore
7465 @c not currently implemented
7466 @item -mapcs-stack-check
7467 @opindex mapcs-stack-check
7468 Generate code to check the amount of stack space available upon entry to
7469 every function (that actually uses some stack space).  If there is
7470 insufficient space available then either the function
7471 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7472 called, depending upon the amount of stack space required.  The run time
7473 system is required to provide these functions.  The default is
7474 @option{-mno-apcs-stack-check}, since this produces smaller code.
7475
7476 @c not currently implemented
7477 @item -mapcs-float
7478 @opindex mapcs-float
7479 Pass floating point arguments using the float point registers.  This is
7480 one of the variants of the APCS@.  This option is recommended if the
7481 target hardware has a floating point unit or if a lot of floating point
7482 arithmetic is going to be performed by the code.  The default is
7483 @option{-mno-apcs-float}, since integer only code is slightly increased in
7484 size if @option{-mapcs-float} is used.
7485
7486 @c not currently implemented
7487 @item -mapcs-reentrant
7488 @opindex mapcs-reentrant
7489 Generate reentrant, position independent code.  The default is
7490 @option{-mno-apcs-reentrant}.
7491 @end ignore
7492
7493 @item -mthumb-interwork
7494 @opindex mthumb-interwork
7495 Generate code which supports calling between the ARM and Thumb
7496 instruction sets.  Without this option the two instruction sets cannot
7497 be reliably used inside one program.  The default is
7498 @option{-mno-thumb-interwork}, since slightly larger code is generated
7499 when @option{-mthumb-interwork} is specified.
7500
7501 @item -mno-sched-prolog
7502 @opindex mno-sched-prolog
7503 Prevent the reordering of instructions in the function prolog, or the
7504 merging of those instruction with the instructions in the function's
7505 body.  This means that all functions will start with a recognizable set
7506 of instructions (or in fact one of a choice from a small set of
7507 different function prologues), and this information can be used to
7508 locate the start if functions inside an executable piece of code.  The
7509 default is @option{-msched-prolog}.
7510
7511 @item -mhard-float
7512 @opindex mhard-float
7513 Generate output containing floating point instructions.  This is the
7514 default.
7515
7516 @item -msoft-float
7517 @opindex msoft-float
7518 Generate output containing library calls for floating point.
7519 @strong{Warning:} the requisite libraries are not available for all ARM
7520 targets.  Normally the facilities of the machine's usual C compiler are
7521 used, but this cannot be done directly in cross-compilation.  You must make
7522 your own arrangements to provide suitable library functions for
7523 cross-compilation.
7524
7525 @option{-msoft-float} changes the calling convention in the output file;
7526 therefore, it is only useful if you compile @emph{all} of a program with
7527 this option.  In particular, you need to compile @file{libgcc.a}, the
7528 library that comes with GCC, with @option{-msoft-float} in order for
7529 this to work.
7530
7531 @item -mfloat-abi=@var{name}
7532 @opindex mfloat-abi
7533 Specifies which ABI to use for floating point values.  Permissible values
7534 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7535
7536 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7537 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7538 of floating point instructions, but still uses the soft-float calling
7539 conventions.
7540
7541 @item -mlittle-endian
7542 @opindex mlittle-endian
7543 Generate code for a processor running in little-endian mode.  This is
7544 the default for all standard configurations.
7545
7546 @item -mbig-endian
7547 @opindex mbig-endian
7548 Generate code for a processor running in big-endian mode; the default is
7549 to compile code for a little-endian processor.
7550
7551 @item -mwords-little-endian
7552 @opindex mwords-little-endian
7553 This option only applies when generating code for big-endian processors.
7554 Generate code for a little-endian word order but a big-endian byte
7555 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7556 option should only be used if you require compatibility with code for
7557 big-endian ARM processors generated by versions of the compiler prior to
7558 2.8.
7559
7560 @item -mcpu=@var{name}
7561 @opindex mcpu
7562 This specifies the name of the target ARM processor.  GCC uses this name
7563 to determine what kind of instructions it can emit when generating
7564 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7565 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7566 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7567 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7568 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7569 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7570 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7571 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7572 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7573 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7574 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7575 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7576 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7577 @samp{arm1176jz-s}, @samp{arm1176jzf-s}, @samp{xscale}, @samp{iwmmxt},
7578 @samp{ep9312}.
7579
7580 @itemx -mtune=@var{name}
7581 @opindex mtune
7582 This option is very similar to the @option{-mcpu=} option, except that
7583 instead of specifying the actual target processor type, and hence
7584 restricting which instructions can be used, it specifies that GCC should
7585 tune the performance of the code as if the target were of the type
7586 specified in this option, but still choosing the instructions that it
7587 will generate based on the cpu specified by a @option{-mcpu=} option.
7588 For some ARM implementations better performance can be obtained by using
7589 this option.
7590
7591 @item -march=@var{name}
7592 @opindex march
7593 This specifies the name of the target ARM architecture.  GCC uses this
7594 name to determine what kind of instructions it can emit when generating
7595 assembly code.  This option can be used in conjunction with or instead
7596 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
7597 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
7598 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
7599 @samp{iwmmxt}, @samp{ep9312}.
7600
7601 @item -mfpu=@var{name}
7602 @itemx -mfpe=@var{number}
7603 @itemx -mfp=@var{number}
7604 @opindex mfpu
7605 @opindex mfpe
7606 @opindex mfp
7607 This specifies what floating point hardware (or hardware emulation) is
7608 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
7609 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
7610 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
7611 with older versions of GCC@.
7612
7613 If @option{-msoft-float} is specified this specifies the format of
7614 floating point values.
7615
7616 @item -mstructure-size-boundary=@var{n}
7617 @opindex mstructure-size-boundary
7618 The size of all structures and unions will be rounded up to a multiple
7619 of the number of bits set by this option.  Permissible values are 8, 32
7620 and 64.  The default value varies for different toolchains.  For the COFF
7621 targeted toolchain the default value is 8.  A value of 64 is only allowed
7622 if the underlying ABI supports it.
7623
7624 Specifying the larger number can produce faster, more efficient code, but
7625 can also increase the size of the program.  Different values are potentially
7626 incompatible.  Code compiled with one value cannot necessarily expect to
7627 work with code or libraries compiled with another value, if they exchange
7628 information using structures or unions.
7629
7630 @item -mabort-on-noreturn
7631 @opindex mabort-on-noreturn
7632 Generate a call to the function @code{abort} at the end of a
7633 @code{noreturn} function.  It will be executed if the function tries to
7634 return.
7635
7636 @item -mlong-calls
7637 @itemx -mno-long-calls
7638 @opindex mlong-calls
7639 @opindex mno-long-calls
7640 Tells the compiler to perform function calls by first loading the
7641 address of the function into a register and then performing a subroutine
7642 call on this register.  This switch is needed if the target function
7643 will lie outside of the 64 megabyte addressing range of the offset based
7644 version of subroutine call instruction.
7645
7646 Even if this switch is enabled, not all function calls will be turned
7647 into long calls.  The heuristic is that static functions, functions
7648 which have the @samp{short-call} attribute, functions that are inside
7649 the scope of a @samp{#pragma no_long_calls} directive and functions whose
7650 definitions have already been compiled within the current compilation
7651 unit, will not be turned into long calls.  The exception to this rule is
7652 that weak function definitions, functions with the @samp{long-call}
7653 attribute or the @samp{section} attribute, and functions that are within
7654 the scope of a @samp{#pragma long_calls} directive, will always be
7655 turned into long calls.
7656
7657 This feature is not enabled by default.  Specifying
7658 @option{-mno-long-calls} will restore the default behavior, as will
7659 placing the function calls within the scope of a @samp{#pragma
7660 long_calls_off} directive.  Note these switches have no effect on how
7661 the compiler generates code to handle function calls via function
7662 pointers.
7663
7664 @item -mnop-fun-dllimport
7665 @opindex mnop-fun-dllimport
7666 Disable support for the @code{dllimport} attribute.
7667
7668 @item -msingle-pic-base
7669 @opindex msingle-pic-base
7670 Treat the register used for PIC addressing as read-only, rather than
7671 loading it in the prologue for each function.  The run-time system is
7672 responsible for initializing this register with an appropriate value
7673 before execution begins.
7674
7675 @item -mpic-register=@var{reg}
7676 @opindex mpic-register
7677 Specify the register to be used for PIC addressing.  The default is R10
7678 unless stack-checking is enabled, when R9 is used.
7679
7680 @item -mcirrus-fix-invalid-insns
7681 @opindex mcirrus-fix-invalid-insns
7682 @opindex mno-cirrus-fix-invalid-insns
7683 Insert NOPs into the instruction stream to in order to work around
7684 problems with invalid Maverick instruction combinations.  This option
7685 is only valid if the @option{-mcpu=ep9312} option has been used to
7686 enable generation of instructions for the Cirrus Maverick floating
7687 point co-processor.  This option is not enabled by default, since the
7688 problem is only present in older Maverick implementations.  The default
7689 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
7690 switch.
7691
7692 @item -mpoke-function-name
7693 @opindex mpoke-function-name
7694 Write the name of each function into the text section, directly
7695 preceding the function prologue.  The generated code is similar to this:
7696
7697 @smallexample
7698      t0
7699          .ascii "arm_poke_function_name", 0
7700          .align
7701      t1
7702          .word 0xff000000 + (t1 - t0)
7703      arm_poke_function_name
7704          mov     ip, sp
7705          stmfd   sp!, @{fp, ip, lr, pc@}
7706          sub     fp, ip, #4
7707 @end smallexample
7708
7709 When performing a stack backtrace, code can inspect the value of
7710 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
7711 location @code{pc - 12} and the top 8 bits are set, then we know that
7712 there is a function name embedded immediately preceding this location
7713 and has length @code{((pc[-3]) & 0xff000000)}.
7714
7715 @item -mthumb
7716 @opindex mthumb
7717 Generate code for the 16-bit Thumb instruction set.  The default is to
7718 use the 32-bit ARM instruction set.
7719
7720 @item -mtpcs-frame
7721 @opindex mtpcs-frame
7722 Generate a stack frame that is compliant with the Thumb Procedure Call
7723 Standard for all non-leaf functions.  (A leaf function is one that does
7724 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
7725
7726 @item -mtpcs-leaf-frame
7727 @opindex mtpcs-leaf-frame
7728 Generate a stack frame that is compliant with the Thumb Procedure Call
7729 Standard for all leaf functions.  (A leaf function is one that does
7730 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
7731
7732 @item -mcallee-super-interworking
7733 @opindex mcallee-super-interworking
7734 Gives all externally visible functions in the file being compiled an ARM
7735 instruction set header which switches to Thumb mode before executing the
7736 rest of the function.  This allows these functions to be called from
7737 non-interworking code.
7738
7739 @item -mcaller-super-interworking
7740 @opindex mcaller-super-interworking
7741 Allows calls via function pointers (including virtual functions) to
7742 execute correctly regardless of whether the target code has been
7743 compiled for interworking or not.  There is a small overhead in the cost
7744 of executing a function pointer if this option is enabled.
7745
7746 @item -mtp=@var{name}
7747 @opindex mtp
7748 Specify the access model for the thread local storage pointer.  The valid
7749 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
7750 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
7751 (supported in the arm6k architecture), and @option{auto}, which uses the
7752 best available method for the selected processor.  The default setting is
7753 @option{auto}.
7754
7755 @end table
7756
7757 @node AVR Options
7758 @subsection AVR Options
7759 @cindex AVR Options
7760
7761 These options are defined for AVR implementations:
7762
7763 @table @gcctabopt
7764 @item -mmcu=@var{mcu}
7765 @opindex mmcu
7766 Specify ATMEL AVR instruction set or MCU type.
7767
7768 Instruction set avr1 is for the minimal AVR core, not supported by the C
7769 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
7770 attiny11, attiny12, attiny15, attiny28).
7771
7772 Instruction set avr2 (default) is for the classic AVR core with up to
7773 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
7774 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
7775 at90c8534, at90s8535).
7776
7777 Instruction set avr3 is for the classic AVR core with up to 128K program
7778 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
7779
7780 Instruction set avr4 is for the enhanced AVR core with up to 8K program
7781 memory space (MCU types: atmega8, atmega83, atmega85).
7782
7783 Instruction set avr5 is for the enhanced AVR core with up to 128K program
7784 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
7785 atmega64, atmega128, at43usb355, at94k).
7786
7787 @item -msize
7788 @opindex msize
7789 Output instruction sizes to the asm file.
7790
7791 @item -minit-stack=@var{N}
7792 @opindex minit-stack
7793 Specify the initial stack address, which may be a symbol or numeric value,
7794 @samp{__stack} is the default.
7795
7796 @item -mno-interrupts
7797 @opindex mno-interrupts
7798 Generated code is not compatible with hardware interrupts.
7799 Code size will be smaller.
7800
7801 @item -mcall-prologues
7802 @opindex mcall-prologues
7803 Functions prologues/epilogues expanded as call to appropriate
7804 subroutines.  Code size will be smaller.
7805
7806 @item -mno-tablejump
7807 @opindex mno-tablejump
7808 Do not generate tablejump insns which sometimes increase code size.
7809
7810 @item -mtiny-stack
7811 @opindex mtiny-stack
7812 Change only the low 8 bits of the stack pointer.
7813
7814 @item -mint8
7815 @opindex mint8
7816 Assume int to be 8 bit integer.  This affects the sizes of all types: A
7817 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
7818 and long long will be 4 bytes.  Please note that this option does not
7819 comply to the C standards, but it will provide you with smaller code
7820 size.
7821 @end table
7822
7823 @node Blackfin Options
7824 @subsection Blackfin Options
7825 @cindex Blackfin Options
7826
7827 @table @gcctabopt
7828 @item -momit-leaf-frame-pointer
7829 @opindex momit-leaf-frame-pointer
7830 Don't keep the frame pointer in a register for leaf functions.  This
7831 avoids the instructions to save, set up and restore frame pointers and
7832 makes an extra register available in leaf functions.  The option
7833 @option{-fomit-frame-pointer} removes the frame pointer for all functions
7834 which might make debugging harder.
7835
7836 @item -mspecld-anomaly
7837 @opindex mspecld-anomaly
7838 When enabled, the compiler will ensure that the generated code does not
7839 contain speculative loads after jump instructions.  This option is enabled
7840 by default.
7841
7842 @item -mno-specld-anomaly
7843 @opindex mno-specld-anomaly
7844 Don't generate extra code to prevent speculative loads from occurring.
7845
7846 @item -mcsync-anomaly
7847 @opindex mcsync-anomaly
7848 When enabled, the compiler will ensure that the generated code does not
7849 contain CSYNC or SSYNC instructions too soon after conditional branches.
7850 This option is enabled by default.
7851
7852 @item -mno-csync-anomaly
7853 @opindex mno-csync-anomaly
7854 Don't generate extra code to prevent CSYNC or SSYNC instructions from
7855 occurring too soon after a conditional branch.
7856
7857 @item -mlow-64k
7858 @opindex mlow-64k
7859 When enabled, the compiler is free to take advantage of the knowledge that
7860 the entire program fits into the low 64k of memory.
7861
7862 @item -mno-low-64k
7863 @opindex mno-low-64k
7864 Assume that the program is arbitrarily large.  This is the default.
7865
7866 @item -mstack-check-l1
7867 @opindex mstack-check-l1
7868 Do stack checking using information placed into L1 scratchpad memory by the
7869 uClinux kernel.
7870
7871 @item -mid-shared-library
7872 @opindex mid-shared-library
7873 Generate code that supports shared libraries via the library ID method.
7874 This allows for execute in place and shared libraries in an environment
7875 without virtual memory management.  This option implies @option{-fPIC}.
7876
7877 @item -mno-id-shared-library
7878 @opindex mno-id-shared-library
7879 Generate code that doesn't assume ID based shared libraries are being used.
7880 This is the default.
7881
7882 @item -mleaf-id-shared-library
7883 @opindex mleaf-id-shared-library
7884 Generate code that supports shared libraries via the library ID method,
7885 but assumes that this library or executable won't link against any other
7886 ID shared libraries.  That allows the compiler to use faster code for jumps
7887 and calls.
7888
7889 @item -mno-leaf-id-shared-library
7890 @opindex mno-leaf-id-shared-library
7891 Do not assume that the code being compiled won't link against any ID shared
7892 libraries.  Slower code will be generated for jump and call insns.
7893
7894 @item -mshared-library-id=n
7895 @opindex mshared-library-id
7896 Specified the identification number of the ID based shared library being
7897 compiled.  Specifying a value of 0 will generate more compact code, specifying
7898 other values will force the allocation of that number to the current
7899 library but is no more space or time efficient than omitting this option.
7900
7901 @item -msep-data
7902 @opindex msep-data
7903 Generate code that allows the data segment to be located in a different
7904 area of memory from the text segment.  This allows for execute in place in
7905 an environment without virtual memory management by eliminating relocations
7906 against the text section.
7907
7908 @item -mno-sep-data
7909 @opindex mno-sep-data
7910 Generate code that assumes that the data segment follows the text segment.
7911 This is the default.
7912
7913 @item -mlong-calls
7914 @itemx -mno-long-calls
7915 @opindex mlong-calls
7916 @opindex mno-long-calls
7917 Tells the compiler to perform function calls by first loading the
7918 address of the function into a register and then performing a subroutine
7919 call on this register.  This switch is needed if the target function
7920 will lie outside of the 24 bit addressing range of the offset based
7921 version of subroutine call instruction.
7922
7923 This feature is not enabled by default.  Specifying
7924 @option{-mno-long-calls} will restore the default behavior.  Note these
7925 switches have no effect on how the compiler generates code to handle
7926 function calls via function pointers.
7927 @end table
7928
7929 @node CRIS Options
7930 @subsection CRIS Options
7931 @cindex CRIS Options
7932
7933 These options are defined specifically for the CRIS ports.
7934
7935 @table @gcctabopt
7936 @item -march=@var{architecture-type}
7937 @itemx -mcpu=@var{architecture-type}
7938 @opindex march
7939 @opindex mcpu
7940 Generate code for the specified architecture.  The choices for
7941 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
7942 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
7943 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
7944 @samp{v10}.
7945
7946 @item -mtune=@var{architecture-type}
7947 @opindex mtune
7948 Tune to @var{architecture-type} everything applicable about the generated
7949 code, except for the ABI and the set of available instructions.  The
7950 choices for @var{architecture-type} are the same as for
7951 @option{-march=@var{architecture-type}}.
7952
7953 @item -mmax-stack-frame=@var{n}
7954 @opindex mmax-stack-frame
7955 Warn when the stack frame of a function exceeds @var{n} bytes.
7956
7957 @item -melinux-stacksize=@var{n}
7958 @opindex melinux-stacksize
7959 Only available with the @samp{cris-axis-aout} target.  Arranges for
7960 indications in the program to the kernel loader that the stack of the
7961 program should be set to @var{n} bytes.
7962
7963 @item -metrax4
7964 @itemx -metrax100
7965 @opindex metrax4
7966 @opindex metrax100
7967 The options @option{-metrax4} and @option{-metrax100} are synonyms for
7968 @option{-march=v3} and @option{-march=v8} respectively.
7969
7970 @item -mmul-bug-workaround
7971 @itemx -mno-mul-bug-workaround
7972 @opindex mmul-bug-workaround
7973 @opindex mno-mul-bug-workaround
7974 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
7975 models where it applies.  This option is active by default.
7976
7977 @item -mpdebug
7978 @opindex mpdebug
7979 Enable CRIS-specific verbose debug-related information in the assembly
7980 code.  This option also has the effect to turn off the @samp{#NO_APP}
7981 formatted-code indicator to the assembler at the beginning of the
7982 assembly file.
7983
7984 @item -mcc-init
7985 @opindex mcc-init
7986 Do not use condition-code results from previous instruction; always emit
7987 compare and test instructions before use of condition codes.
7988
7989 @item -mno-side-effects
7990 @opindex mno-side-effects
7991 Do not emit instructions with side-effects in addressing modes other than
7992 post-increment.
7993
7994 @item -mstack-align
7995 @itemx -mno-stack-align
7996 @itemx -mdata-align
7997 @itemx -mno-data-align
7998 @itemx -mconst-align
7999 @itemx -mno-const-align
8000 @opindex mstack-align
8001 @opindex mno-stack-align
8002 @opindex mdata-align
8003 @opindex mno-data-align
8004 @opindex mconst-align
8005 @opindex mno-const-align
8006 These options (no-options) arranges (eliminate arrangements) for the
8007 stack-frame, individual data and constants to be aligned for the maximum
8008 single data access size for the chosen CPU model.  The default is to
8009 arrange for 32-bit alignment.  ABI details such as structure layout are
8010 not affected by these options.
8011
8012 @item -m32-bit
8013 @itemx -m16-bit
8014 @itemx -m8-bit
8015 @opindex m32-bit
8016 @opindex m16-bit
8017 @opindex m8-bit
8018 Similar to the stack- data- and const-align options above, these options
8019 arrange for stack-frame, writable data and constants to all be 32-bit,
8020 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8021
8022 @item -mno-prologue-epilogue
8023 @itemx -mprologue-epilogue
8024 @opindex mno-prologue-epilogue
8025 @opindex mprologue-epilogue
8026 With @option{-mno-prologue-epilogue}, the normal function prologue and
8027 epilogue that sets up the stack-frame are omitted and no return
8028 instructions or return sequences are generated in the code.  Use this
8029 option only together with visual inspection of the compiled code: no
8030 warnings or errors are generated when call-saved registers must be saved,
8031 or storage for local variable needs to be allocated.
8032
8033 @item -mno-gotplt
8034 @itemx -mgotplt
8035 @opindex mno-gotplt
8036 @opindex mgotplt
8037 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8038 instruction sequences that load addresses for functions from the PLT part
8039 of the GOT rather than (traditional on other architectures) calls to the
8040 PLT@.  The default is @option{-mgotplt}.
8041
8042 @item -maout
8043 @opindex maout
8044 Legacy no-op option only recognized with the cris-axis-aout target.
8045
8046 @item -melf
8047 @opindex melf
8048 Legacy no-op option only recognized with the cris-axis-elf and
8049 cris-axis-linux-gnu targets.
8050
8051 @item -melinux
8052 @opindex melinux
8053 Only recognized with the cris-axis-aout target, where it selects a
8054 GNU/linux-like multilib, include files and instruction set for
8055 @option{-march=v8}.
8056
8057 @item -mlinux
8058 @opindex mlinux
8059 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8060
8061 @item -sim
8062 @opindex sim
8063 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8064 to link with input-output functions from a simulator library.  Code,
8065 initialized data and zero-initialized data are allocated consecutively.
8066
8067 @item -sim2
8068 @opindex sim2
8069 Like @option{-sim}, but pass linker options to locate initialized data at
8070 0x40000000 and zero-initialized data at 0x80000000.
8071 @end table
8072
8073 @node CRX Options
8074 @subsection CRX Options
8075 @cindex CRX Options
8076
8077 These options are defined specifically for the CRX ports.
8078
8079 @table @gcctabopt
8080
8081 @item -mmac
8082 @opindex mmac
8083 Enable the use of multiply-accumulate instructions. Disabled by default.
8084
8085 @item -mpush-args
8086 @opindex mpush-args
8087 Push instructions will be used to pass outgoing arguments when functions
8088 are called. Enabled by default.
8089 @end table
8090
8091 @node Darwin Options
8092 @subsection Darwin Options
8093 @cindex Darwin options
8094
8095 These options are defined for all architectures running the Darwin operating
8096 system.
8097
8098 FSF GCC on Darwin does not create ``fat'' object files; it will create
8099 an object file for the single architecture that it was built to
8100 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8101 @option{-arch} options are used; it does so by running the compiler or
8102 linker multiple times and joining the results together with
8103 @file{lipo}.
8104
8105 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8106 @samp{i686}) is determined by the flags that specify the ISA
8107 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8108 @option{-force_cpusubtype_ALL} option can be used to override this.
8109
8110 The Darwin tools vary in their behavior when presented with an ISA
8111 mismatch.  The assembler, @file{as}, will only permit instructions to
8112 be used that are valid for the subtype of the file it is generating,
8113 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8114 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8115 and print an error if asked to create a shared library with a less
8116 restrictive subtype than its input files (for instance, trying to put
8117 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8118 for executables, @file{ld}, will quietly give the executable the most
8119 restrictive subtype of any of its input files.
8120
8121 @table @gcctabopt
8122 @item -F@var{dir}
8123 @opindex F
8124 Add the framework directory @var{dir} to the head of the list of
8125 directories to be searched for header files.  These directories are
8126 interleaved with those specified by @option{-I} options and are
8127 scanned in a left-to-right order.
8128
8129 A framework directory is a directory with frameworks in it.  A
8130 framework is a directory with a @samp{"Headers"} and/or
8131 @samp{"PrivateHeaders"} directory contained directly in it that ends
8132 in @samp{".framework"}.  The name of a framework is the name of this
8133 directory excluding the @samp{".framework"}.  Headers associated with
8134 the framework are found in one of those two directories, with
8135 @samp{"Headers"} being searched first.  A subframework is a framework
8136 directory that is in a framework's @samp{"Frameworks"} directory.
8137 Includes of subframework headers can only appear in a header of a
8138 framework that contains the subframework, or in a sibling subframework
8139 header.  Two subframeworks are siblings if they occur in the same
8140 framework.  A subframework should not have the same name as a
8141 framework, a warning will be issued if this is violated.  Currently a
8142 subframework cannot have subframeworks, in the future, the mechanism
8143 may be extended to support this.  The standard frameworks can be found
8144 in @samp{"/System/Library/Frameworks"} and
8145 @samp{"/Library/Frameworks"}.  An example include looks like
8146 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8147 the name of the framework and header.h is found in the
8148 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8149
8150 @item -gused
8151 @opindex -gused
8152 Emit debugging information for symbols that are used.  For STABS
8153 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8154 This is by default ON@.
8155
8156 @item -gfull
8157 @opindex -gfull
8158 Emit debugging information for all symbols and types.
8159
8160 @item -mmacosx-version-min=@var{version}
8161 The earliest version of MacOS X that this executable will run on
8162 is @var{version}.  Typical values of @var{version} include @code{10.1},
8163 @code{10.2}, and @code{10.3.9}.
8164
8165 The default for this option is to make choices that seem to be most
8166 useful.  
8167
8168 @item -mkernel
8169 @opindex mkernel
8170 Enable kernel development mode.  The @option{-mkernel} option sets
8171 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8172 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8173 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8174 applicable.  This mode also sets @option{-mno-altivec},
8175 @option{-msoft-float}, @option{-fno-builtin} and
8176 @option{-mlong-branch} for PowerPC targets.
8177
8178 @item -mone-byte-bool
8179 @opindex -mone-byte-bool
8180 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8181 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8182 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8183 option has no effect on x86.
8184
8185 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8186 to generate code that is not binary compatible with code generated
8187 without that switch.  Using this switch may require recompiling all
8188 other modules in a program, including system libraries.  Use this
8189 switch to conform to a non-default data model.
8190
8191 @item -mfix-and-continue
8192 @itemx -ffix-and-continue
8193 @itemx -findirect-data
8194 @opindex mfix-and-continue
8195 @opindex ffix-and-continue
8196 @opindex findirect-data
8197 Generate code suitable for fast turn around development.  Needed to
8198 enable gdb to dynamically load @code{.o} files into already running
8199 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8200 are provided for backwards compatibility.
8201
8202 @item -all_load
8203 @opindex all_load
8204 Loads all members of static archive libraries.
8205 See man ld(1) for more information.
8206
8207 @item -arch_errors_fatal
8208 @opindex arch_errors_fatal
8209 Cause the errors having to do with files that have the wrong architecture
8210 to be fatal.
8211
8212 @item -bind_at_load
8213 @opindex bind_at_load
8214 Causes the output file to be marked such that the dynamic linker will
8215 bind all undefined references when the file is loaded or launched.
8216
8217 @item -bundle
8218 @opindex bundle
8219 Produce a Mach-o bundle format file.
8220 See man ld(1) for more information.
8221
8222 @item -bundle_loader @var{executable}
8223 @opindex bundle_loader
8224 This option specifies the @var{executable} that will be loading the build
8225 output file being linked.  See man ld(1) for more information.
8226
8227 @item -dynamiclib
8228 @opindex -dynamiclib
8229 When passed this option, GCC will produce a dynamic library instead of
8230 an executable when linking, using the Darwin @file{libtool} command.
8231
8232 @item -force_cpusubtype_ALL
8233 @opindex -force_cpusubtype_ALL
8234 This causes GCC's output file to have the @var{ALL} subtype, instead of
8235 one controlled by the @option{-mcpu} or @option{-march} option.
8236
8237 @item -allowable_client  @var{client_name}
8238 @itemx -client_name
8239 @itemx -compatibility_version
8240 @itemx -current_version
8241 @itemx -dead_strip
8242 @itemx -dependency-file
8243 @itemx -dylib_file
8244 @itemx -dylinker_install_name
8245 @itemx -dynamic
8246 @itemx -exported_symbols_list
8247 @itemx -filelist
8248 @itemx -flat_namespace
8249 @itemx -force_flat_namespace
8250 @itemx -headerpad_max_install_names
8251 @itemx -image_base
8252 @itemx -init
8253 @itemx -install_name
8254 @itemx -keep_private_externs
8255 @itemx -multi_module
8256 @itemx -multiply_defined
8257 @itemx -multiply_defined_unused
8258 @itemx -noall_load
8259 @itemx -no_dead_strip_inits_and_terms
8260 @itemx -nofixprebinding
8261 @itemx -nomultidefs
8262 @itemx -noprebind
8263 @itemx -noseglinkedit
8264 @itemx -pagezero_size
8265 @itemx -prebind
8266 @itemx -prebind_all_twolevel_modules
8267 @itemx -private_bundle
8268 @itemx -read_only_relocs
8269 @itemx -sectalign
8270 @itemx -sectobjectsymbols
8271 @itemx -whyload
8272 @itemx -seg1addr
8273 @itemx -sectcreate
8274 @itemx -sectobjectsymbols
8275 @itemx -sectorder
8276 @itemx -segaddr
8277 @itemx -segs_read_only_addr
8278 @itemx -segs_read_write_addr
8279 @itemx -seg_addr_table
8280 @itemx -seg_addr_table_filename
8281 @itemx -seglinkedit
8282 @itemx -segprot
8283 @itemx -segs_read_only_addr
8284 @itemx -segs_read_write_addr
8285 @itemx -single_module
8286 @itemx -static
8287 @itemx -sub_library
8288 @itemx -sub_umbrella
8289 @itemx -twolevel_namespace
8290 @itemx -umbrella
8291 @itemx -undefined
8292 @itemx -unexported_symbols_list
8293 @itemx -weak_reference_mismatches
8294 @itemx -whatsloaded
8295
8296 @opindex allowable_client
8297 @opindex client_name
8298 @opindex compatibility_version
8299 @opindex current_version
8300 @opindex dead_strip
8301 @opindex dependency-file
8302 @opindex dylib_file
8303 @opindex dylinker_install_name
8304 @opindex dynamic
8305 @opindex exported_symbols_list
8306 @opindex filelist
8307 @opindex flat_namespace
8308 @opindex force_flat_namespace
8309 @opindex headerpad_max_install_names
8310 @opindex image_base
8311 @opindex init
8312 @opindex install_name
8313 @opindex keep_private_externs
8314 @opindex multi_module
8315 @opindex multiply_defined
8316 @opindex multiply_defined_unused
8317 @opindex noall_load
8318 @opindex no_dead_strip_inits_and_terms
8319 @opindex nofixprebinding
8320 @opindex nomultidefs
8321 @opindex noprebind
8322 @opindex noseglinkedit
8323 @opindex pagezero_size
8324 @opindex prebind
8325 @opindex prebind_all_twolevel_modules
8326 @opindex private_bundle
8327 @opindex read_only_relocs
8328 @opindex sectalign
8329 @opindex sectobjectsymbols
8330 @opindex whyload
8331 @opindex seg1addr
8332 @opindex sectcreate
8333 @opindex sectobjectsymbols
8334 @opindex sectorder
8335 @opindex segaddr
8336 @opindex segs_read_only_addr
8337 @opindex segs_read_write_addr
8338 @opindex seg_addr_table
8339 @opindex seg_addr_table_filename
8340 @opindex seglinkedit
8341 @opindex segprot
8342 @opindex segs_read_only_addr
8343 @opindex segs_read_write_addr
8344 @opindex single_module
8345 @opindex static
8346 @opindex sub_library
8347 @opindex sub_umbrella
8348 @opindex twolevel_namespace
8349 @opindex umbrella
8350 @opindex undefined
8351 @opindex unexported_symbols_list
8352 @opindex weak_reference_mismatches
8353 @opindex whatsloaded
8354
8355 These options are passed to the Darwin linker.  The Darwin linker man page
8356 describes them in detail.
8357 @end table
8358
8359 @node DEC Alpha Options
8360 @subsection DEC Alpha Options
8361
8362 These @samp{-m} options are defined for the DEC Alpha implementations:
8363
8364 @table @gcctabopt
8365 @item -mno-soft-float
8366 @itemx -msoft-float
8367 @opindex mno-soft-float
8368 @opindex msoft-float
8369 Use (do not use) the hardware floating-point instructions for
8370 floating-point operations.  When @option{-msoft-float} is specified,
8371 functions in @file{libgcc.a} will be used to perform floating-point
8372 operations.  Unless they are replaced by routines that emulate the
8373 floating-point operations, or compiled in such a way as to call such
8374 emulations routines, these routines will issue floating-point
8375 operations.   If you are compiling for an Alpha without floating-point
8376 operations, you must ensure that the library is built so as not to call
8377 them.
8378
8379 Note that Alpha implementations without floating-point operations are
8380 required to have floating-point registers.
8381
8382 @item -mfp-reg
8383 @itemx -mno-fp-regs
8384 @opindex mfp-reg
8385 @opindex mno-fp-regs
8386 Generate code that uses (does not use) the floating-point register set.
8387 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8388 register set is not used, floating point operands are passed in integer
8389 registers as if they were integers and floating-point results are passed
8390 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8391 so any function with a floating-point argument or return value called by code
8392 compiled with @option{-mno-fp-regs} must also be compiled with that
8393 option.
8394
8395 A typical use of this option is building a kernel that does not use,
8396 and hence need not save and restore, any floating-point registers.
8397
8398 @item -mieee
8399 @opindex mieee
8400 The Alpha architecture implements floating-point hardware optimized for
8401 maximum performance.  It is mostly compliant with the IEEE floating
8402 point standard.  However, for full compliance, software assistance is
8403 required.  This option generates code fully IEEE compliant code
8404 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8405 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8406 defined during compilation.  The resulting code is less efficient but is
8407 able to correctly support denormalized numbers and exceptional IEEE
8408 values such as not-a-number and plus/minus infinity.  Other Alpha
8409 compilers call this option @option{-ieee_with_no_inexact}.
8410
8411 @item -mieee-with-inexact
8412 @opindex mieee-with-inexact
8413 This is like @option{-mieee} except the generated code also maintains
8414 the IEEE @var{inexact-flag}.  Turning on this option causes the
8415 generated code to implement fully-compliant IEEE math.  In addition to
8416 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8417 macro.  On some Alpha implementations the resulting code may execute
8418 significantly slower than the code generated by default.  Since there is
8419 very little code that depends on the @var{inexact-flag}, you should
8420 normally not specify this option.  Other Alpha compilers call this
8421 option @option{-ieee_with_inexact}.
8422
8423 @item -mfp-trap-mode=@var{trap-mode}
8424 @opindex mfp-trap-mode
8425 This option controls what floating-point related traps are enabled.
8426 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8427 The trap mode can be set to one of four values:
8428
8429 @table @samp
8430 @item n
8431 This is the default (normal) setting.  The only traps that are enabled
8432 are the ones that cannot be disabled in software (e.g., division by zero
8433 trap).
8434
8435 @item u
8436 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8437 as well.
8438
8439 @item su
8440 Like @samp{u}, but the instructions are marked to be safe for software
8441 completion (see Alpha architecture manual for details).
8442
8443 @item sui
8444 Like @samp{su}, but inexact traps are enabled as well.
8445 @end table
8446
8447 @item -mfp-rounding-mode=@var{rounding-mode}
8448 @opindex mfp-rounding-mode
8449 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8450 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8451 of:
8452
8453 @table @samp
8454 @item n
8455 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8456 the nearest machine number or towards the even machine number in case
8457 of a tie.
8458
8459 @item m
8460 Round towards minus infinity.
8461
8462 @item c
8463 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8464
8465 @item d
8466 Dynamic rounding mode.  A field in the floating point control register
8467 (@var{fpcr}, see Alpha architecture reference manual) controls the
8468 rounding mode in effect.  The C library initializes this register for
8469 rounding towards plus infinity.  Thus, unless your program modifies the
8470 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8471 @end table
8472
8473 @item -mtrap-precision=@var{trap-precision}
8474 @opindex mtrap-precision
8475 In the Alpha architecture, floating point traps are imprecise.  This
8476 means without software assistance it is impossible to recover from a
8477 floating trap and program execution normally needs to be terminated.
8478 GCC can generate code that can assist operating system trap handlers
8479 in determining the exact location that caused a floating point trap.
8480 Depending on the requirements of an application, different levels of
8481 precisions can be selected:
8482
8483 @table @samp
8484 @item p
8485 Program precision.  This option is the default and means a trap handler
8486 can only identify which program caused a floating point exception.
8487
8488 @item f
8489 Function precision.  The trap handler can determine the function that
8490 caused a floating point exception.
8491
8492 @item i
8493 Instruction precision.  The trap handler can determine the exact
8494 instruction that caused a floating point exception.
8495 @end table
8496
8497 Other Alpha compilers provide the equivalent options called
8498 @option{-scope_safe} and @option{-resumption_safe}.
8499
8500 @item -mieee-conformant
8501 @opindex mieee-conformant
8502 This option marks the generated code as IEEE conformant.  You must not
8503 use this option unless you also specify @option{-mtrap-precision=i} and either
8504 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8505 is to emit the line @samp{.eflag 48} in the function prologue of the
8506 generated assembly file.  Under DEC Unix, this has the effect that
8507 IEEE-conformant math library routines will be linked in.
8508
8509 @item -mbuild-constants
8510 @opindex mbuild-constants
8511 Normally GCC examines a 32- or 64-bit integer constant to
8512 see if it can construct it from smaller constants in two or three
8513 instructions.  If it cannot, it will output the constant as a literal and
8514 generate code to load it from the data segment at runtime.
8515
8516 Use this option to require GCC to construct @emph{all} integer constants
8517 using code, even if it takes more instructions (the maximum is six).
8518
8519 You would typically use this option to build a shared library dynamic
8520 loader.  Itself a shared library, it must relocate itself in memory
8521 before it can find the variables and constants in its own data segment.
8522
8523 @item -malpha-as
8524 @itemx -mgas
8525 @opindex malpha-as
8526 @opindex mgas
8527 Select whether to generate code to be assembled by the vendor-supplied
8528 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8529
8530 @item -mbwx
8531 @itemx -mno-bwx
8532 @itemx -mcix
8533 @itemx -mno-cix
8534 @itemx -mfix
8535 @itemx -mno-fix
8536 @itemx -mmax
8537 @itemx -mno-max
8538 @opindex mbwx
8539 @opindex mno-bwx
8540 @opindex mcix
8541 @opindex mno-cix
8542 @opindex mfix
8543 @opindex mno-fix
8544 @opindex mmax
8545 @opindex mno-max
8546 Indicate whether GCC should generate code to use the optional BWX,
8547 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8548 sets supported by the CPU type specified via @option{-mcpu=} option or that
8549 of the CPU on which GCC was built if none was specified.
8550
8551 @item -mfloat-vax
8552 @itemx -mfloat-ieee
8553 @opindex mfloat-vax
8554 @opindex mfloat-ieee
8555 Generate code that uses (does not use) VAX F and G floating point
8556 arithmetic instead of IEEE single and double precision.
8557
8558 @item -mexplicit-relocs
8559 @itemx -mno-explicit-relocs
8560 @opindex mexplicit-relocs
8561 @opindex mno-explicit-relocs
8562 Older Alpha assemblers provided no way to generate symbol relocations
8563 except via assembler macros.  Use of these macros does not allow
8564 optimal instruction scheduling.  GNU binutils as of version 2.12
8565 supports a new syntax that allows the compiler to explicitly mark
8566 which relocations should apply to which instructions.  This option
8567 is mostly useful for debugging, as GCC detects the capabilities of
8568 the assembler when it is built and sets the default accordingly.
8569
8570 @item -msmall-data
8571 @itemx -mlarge-data
8572 @opindex msmall-data
8573 @opindex mlarge-data
8574 When @option{-mexplicit-relocs} is in effect, static data is
8575 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
8576 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
8577 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
8578 16-bit relocations off of the @code{$gp} register.  This limits the
8579 size of the small data area to 64KB, but allows the variables to be
8580 directly accessed via a single instruction.
8581
8582 The default is @option{-mlarge-data}.  With this option the data area
8583 is limited to just below 2GB@.  Programs that require more than 2GB of
8584 data must use @code{malloc} or @code{mmap} to allocate the data in the
8585 heap instead of in the program's data segment.
8586
8587 When generating code for shared libraries, @option{-fpic} implies
8588 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
8589
8590 @item -msmall-text
8591 @itemx -mlarge-text
8592 @opindex msmall-text
8593 @opindex mlarge-text
8594 When @option{-msmall-text} is used, the compiler assumes that the
8595 code of the entire program (or shared library) fits in 4MB, and is
8596 thus reachable with a branch instruction.  When @option{-msmall-data}
8597 is used, the compiler can assume that all local symbols share the
8598 same @code{$gp} value, and thus reduce the number of instructions
8599 required for a function call from 4 to 1.
8600
8601 The default is @option{-mlarge-text}.
8602
8603 @item -mcpu=@var{cpu_type}
8604 @opindex mcpu
8605 Set the instruction set and instruction scheduling parameters for
8606 machine type @var{cpu_type}.  You can specify either the @samp{EV}
8607 style name or the corresponding chip number.  GCC supports scheduling
8608 parameters for the EV4, EV5 and EV6 family of processors and will
8609 choose the default values for the instruction set from the processor
8610 you specify.  If you do not specify a processor type, GCC will default
8611 to the processor on which the compiler was built.
8612
8613 Supported values for @var{cpu_type} are
8614
8615 @table @samp
8616 @item ev4
8617 @itemx ev45
8618 @itemx 21064
8619 Schedules as an EV4 and has no instruction set extensions.
8620
8621 @item ev5
8622 @itemx 21164
8623 Schedules as an EV5 and has no instruction set extensions.
8624
8625 @item ev56
8626 @itemx 21164a
8627 Schedules as an EV5 and supports the BWX extension.
8628
8629 @item pca56
8630 @itemx 21164pc
8631 @itemx 21164PC
8632 Schedules as an EV5 and supports the BWX and MAX extensions.
8633
8634 @item ev6
8635 @itemx 21264
8636 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
8637
8638 @item ev67
8639 @itemx 21264a
8640 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
8641 @end table
8642
8643 @item -mtune=@var{cpu_type}
8644 @opindex mtune
8645 Set only the instruction scheduling parameters for machine type
8646 @var{cpu_type}.  The instruction set is not changed.
8647
8648 @item -mmemory-latency=@var{time}
8649 @opindex mmemory-latency
8650 Sets the latency the scheduler should assume for typical memory
8651 references as seen by the application.  This number is highly
8652 dependent on the memory access patterns used by the application
8653 and the size of the external cache on the machine.
8654
8655 Valid options for @var{time} are
8656
8657 @table @samp
8658 @item @var{number}
8659 A decimal number representing clock cycles.
8660
8661 @item L1
8662 @itemx L2
8663 @itemx L3
8664 @itemx main
8665 The compiler contains estimates of the number of clock cycles for
8666 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
8667 (also called Dcache, Scache, and Bcache), as well as to main memory.
8668 Note that L3 is only valid for EV5.
8669
8670 @end table
8671 @end table
8672
8673 @node DEC Alpha/VMS Options
8674 @subsection DEC Alpha/VMS Options
8675
8676 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
8677
8678 @table @gcctabopt
8679 @item -mvms-return-codes
8680 @opindex mvms-return-codes
8681 Return VMS condition codes from main.  The default is to return POSIX
8682 style condition (e.g.@ error) codes.
8683 @end table
8684
8685 @node FRV Options
8686 @subsection FRV Options
8687 @cindex FRV Options
8688
8689 @table @gcctabopt
8690 @item -mgpr-32
8691 @opindex mgpr-32
8692
8693 Only use the first 32 general purpose registers.
8694
8695 @item -mgpr-64
8696 @opindex mgpr-64
8697
8698 Use all 64 general purpose registers.
8699
8700 @item -mfpr-32
8701 @opindex mfpr-32
8702
8703 Use only the first 32 floating point registers.
8704
8705 @item -mfpr-64
8706 @opindex mfpr-64
8707
8708 Use all 64 floating point registers
8709
8710 @item -mhard-float
8711 @opindex mhard-float
8712
8713 Use hardware instructions for floating point operations.
8714
8715 @item -msoft-float
8716 @opindex msoft-float
8717
8718 Use library routines for floating point operations.
8719
8720 @item -malloc-cc
8721 @opindex malloc-cc
8722
8723 Dynamically allocate condition code registers.
8724
8725 @item -mfixed-cc
8726 @opindex mfixed-cc
8727
8728 Do not try to dynamically allocate condition code registers, only
8729 use @code{icc0} and @code{fcc0}.
8730
8731 @item -mdword
8732 @opindex mdword
8733
8734 Change ABI to use double word insns.
8735
8736 @item -mno-dword
8737 @opindex mno-dword
8738
8739 Do not use double word instructions.
8740
8741 @item -mdouble
8742 @opindex mdouble
8743
8744 Use floating point double instructions.
8745
8746 @item -mno-double
8747 @opindex mno-double
8748
8749 Do not use floating point double instructions.
8750
8751 @item -mmedia
8752 @opindex mmedia
8753
8754 Use media instructions.
8755
8756 @item -mno-media
8757 @opindex mno-media
8758
8759 Do not use media instructions.
8760
8761 @item -mmuladd
8762 @opindex mmuladd
8763
8764 Use multiply and add/subtract instructions.
8765
8766 @item -mno-muladd
8767 @opindex mno-muladd
8768
8769 Do not use multiply and add/subtract instructions.
8770
8771 @item -mfdpic
8772 @opindex mfdpic
8773
8774 Select the FDPIC ABI, that uses function descriptors to represent
8775 pointers to functions.  Without any PIC/PIE-related options, it
8776 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
8777 assumes GOT entries and small data are within a 12-bit range from the
8778 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
8779 are computed with 32 bits.
8780
8781 @item -minline-plt
8782 @opindex minline-plt
8783
8784 Enable inlining of PLT entries in function calls to functions that are
8785 not known to bind locally.  It has no effect without @option{-mfdpic}.
8786 It's enabled by default if optimizing for speed and compiling for
8787 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
8788 optimization option such as @option{-O3} or above is present in the
8789 command line.
8790
8791 @item -mTLS
8792 @opindex TLS
8793
8794 Assume a large TLS segment when generating thread-local code.
8795
8796 @item -mtls
8797 @opindex tls
8798
8799 Do not assume a large TLS segment when generating thread-local code.
8800
8801 @item -mgprel-ro
8802 @opindex mgprel-ro
8803
8804 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
8805 that is known to be in read-only sections.  It's enabled by default,
8806 except for @option{-fpic} or @option{-fpie}: even though it may help
8807 make the global offset table smaller, it trades 1 instruction for 4.
8808 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
8809 one of which may be shared by multiple symbols, and it avoids the need
8810 for a GOT entry for the referenced symbol, so it's more likely to be a
8811 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
8812
8813 @item -multilib-library-pic
8814 @opindex multilib-library-pic
8815
8816 Link with the (library, not FD) pic libraries.  It's implied by
8817 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
8818 @option{-fpic} without @option{-mfdpic}.  You should never have to use
8819 it explicitly.
8820
8821 @item -mlinked-fp
8822 @opindex mlinked-fp
8823
8824 Follow the EABI requirement of always creating a frame pointer whenever
8825 a stack frame is allocated.  This option is enabled by default and can
8826 be disabled with @option{-mno-linked-fp}.
8827
8828 @item -mlong-calls
8829 @opindex mlong-calls
8830
8831 Use indirect addressing to call functions outside the current
8832 compilation unit.  This allows the functions to be placed anywhere
8833 within the 32-bit address space.
8834
8835 @item -malign-labels
8836 @opindex malign-labels
8837
8838 Try to align labels to an 8-byte boundary by inserting nops into the
8839 previous packet.  This option only has an effect when VLIW packing
8840 is enabled.  It doesn't create new packets; it merely adds nops to
8841 existing ones.
8842
8843 @item -mlibrary-pic
8844 @opindex mlibrary-pic
8845
8846 Generate position-independent EABI code.
8847
8848 @item -macc-4
8849 @opindex macc-4
8850
8851 Use only the first four media accumulator registers.
8852
8853 @item -macc-8
8854 @opindex macc-8
8855
8856 Use all eight media accumulator registers.
8857
8858 @item -mpack
8859 @opindex mpack
8860
8861 Pack VLIW instructions.
8862
8863 @item -mno-pack
8864 @opindex mno-pack
8865
8866 Do not pack VLIW instructions.
8867
8868 @item -mno-eflags
8869 @opindex mno-eflags
8870
8871 Do not mark ABI switches in e_flags.
8872
8873 @item -mcond-move
8874 @opindex mcond-move
8875
8876 Enable the use of conditional-move instructions (default).
8877
8878 This switch is mainly for debugging the compiler and will likely be removed
8879 in a future version.
8880
8881 @item -mno-cond-move
8882 @opindex mno-cond-move
8883
8884 Disable the use of conditional-move instructions.
8885
8886 This switch is mainly for debugging the compiler and will likely be removed
8887 in a future version.
8888
8889 @item -mscc
8890 @opindex mscc
8891
8892 Enable the use of conditional set instructions (default).
8893
8894 This switch is mainly for debugging the compiler and will likely be removed
8895 in a future version.
8896
8897 @item -mno-scc
8898 @opindex mno-scc
8899
8900 Disable the use of conditional set instructions.
8901
8902 This switch is mainly for debugging the compiler and will likely be removed
8903 in a future version.
8904
8905 @item -mcond-exec
8906 @opindex mcond-exec
8907
8908 Enable the use of conditional execution (default).
8909
8910 This switch is mainly for debugging the compiler and will likely be removed
8911 in a future version.
8912
8913 @item -mno-cond-exec
8914 @opindex mno-cond-exec
8915
8916 Disable the use of conditional execution.
8917
8918 This switch is mainly for debugging the compiler and will likely be removed
8919 in a future version.
8920
8921 @item -mvliw-branch
8922 @opindex mvliw-branch
8923
8924 Run a pass to pack branches into VLIW instructions (default).
8925
8926 This switch is mainly for debugging the compiler and will likely be removed
8927 in a future version.
8928
8929 @item -mno-vliw-branch
8930 @opindex mno-vliw-branch
8931
8932 Do not run a pass to pack branches into VLIW instructions.
8933
8934 This switch is mainly for debugging the compiler and will likely be removed
8935 in a future version.
8936
8937 @item -mmulti-cond-exec
8938 @opindex mmulti-cond-exec
8939
8940 Enable optimization of @code{&&} and @code{||} in conditional execution
8941 (default).
8942
8943 This switch is mainly for debugging the compiler and will likely be removed
8944 in a future version.
8945
8946 @item -mno-multi-cond-exec
8947 @opindex mno-multi-cond-exec
8948
8949 Disable optimization of @code{&&} and @code{||} in conditional execution.
8950
8951 This switch is mainly for debugging the compiler and will likely be removed
8952 in a future version.
8953
8954 @item -mnested-cond-exec
8955 @opindex mnested-cond-exec
8956
8957 Enable nested conditional execution optimizations (default).
8958
8959 This switch is mainly for debugging the compiler and will likely be removed
8960 in a future version.
8961
8962 @item -mno-nested-cond-exec
8963 @opindex mno-nested-cond-exec
8964
8965 Disable nested conditional execution optimizations.
8966
8967 This switch is mainly for debugging the compiler and will likely be removed
8968 in a future version.
8969
8970 @item -moptimize-membar
8971 @opindex moptimize-membar
8972
8973 This switch removes redundant @code{membar} instructions from the
8974 compiler generated code.  It is enabled by default.
8975
8976 @item -mno-optimize-membar
8977 @opindex mno-optimize-membar
8978
8979 This switch disables the automatic removal of redundant @code{membar}
8980 instructions from the generated code.
8981
8982 @item -mtomcat-stats
8983 @opindex mtomcat-stats
8984
8985 Cause gas to print out tomcat statistics.
8986
8987 @item -mcpu=@var{cpu}
8988 @opindex mcpu
8989
8990 Select the processor type for which to generate code.  Possible values are
8991 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
8992 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
8993
8994 @end table
8995
8996 @node GNU/Linux Options
8997 @subsection GNU/Linux Options
8998
8999 These @samp{-m} options are defined for GNU/Linux targets:
9000
9001 @table @gcctabopt
9002 @item -mglibc
9003 @opindex mglibc
9004 Use the GNU C library instead of uClibc.  This is the default except
9005 on @samp{*-*-linux-*uclibc*} targets.
9006
9007 @item -muclibc
9008 @opindex muclibc
9009 Use uClibc instead of the GNU C library.  This is the default on
9010 @samp{*-*-linux-*uclibc*} targets.
9011 @end table
9012
9013 @node H8/300 Options
9014 @subsection H8/300 Options
9015
9016 These @samp{-m} options are defined for the H8/300 implementations:
9017
9018 @table @gcctabopt
9019 @item -mrelax
9020 @opindex mrelax
9021 Shorten some address references at link time, when possible; uses the
9022 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9023 ld, Using ld}, for a fuller description.
9024
9025 @item -mh
9026 @opindex mh
9027 Generate code for the H8/300H@.
9028
9029 @item -ms
9030 @opindex ms
9031 Generate code for the H8S@.
9032
9033 @item -mn
9034 @opindex mn
9035 Generate code for the H8S and H8/300H in the normal mode.  This switch
9036 must be used either with @option{-mh} or @option{-ms}.
9037
9038 @item -ms2600
9039 @opindex ms2600
9040 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9041
9042 @item -mint32
9043 @opindex mint32
9044 Make @code{int} data 32 bits by default.
9045
9046 @item -malign-300
9047 @opindex malign-300
9048 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9049 The default for the H8/300H and H8S is to align longs and floats on 4
9050 byte boundaries.
9051 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9052 This option has no effect on the H8/300.
9053 @end table
9054
9055 @node HPPA Options
9056 @subsection HPPA Options
9057 @cindex HPPA Options
9058
9059 These @samp{-m} options are defined for the HPPA family of computers:
9060
9061 @table @gcctabopt
9062 @item -march=@var{architecture-type}
9063 @opindex march
9064 Generate code for the specified architecture.  The choices for
9065 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9066 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9067 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9068 architecture option for your machine.  Code compiled for lower numbered
9069 architectures will run on higher numbered architectures, but not the
9070 other way around.
9071
9072 @item -mpa-risc-1-0
9073 @itemx -mpa-risc-1-1
9074 @itemx -mpa-risc-2-0
9075 @opindex mpa-risc-1-0
9076 @opindex mpa-risc-1-1
9077 @opindex mpa-risc-2-0
9078 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9079
9080 @item -mbig-switch
9081 @opindex mbig-switch
9082 Generate code suitable for big switch tables.  Use this option only if
9083 the assembler/linker complain about out of range branches within a switch
9084 table.
9085
9086 @item -mjump-in-delay
9087 @opindex mjump-in-delay
9088 Fill delay slots of function calls with unconditional jump instructions
9089 by modifying the return pointer for the function call to be the target
9090 of the conditional jump.
9091
9092 @item -mdisable-fpregs
9093 @opindex mdisable-fpregs
9094 Prevent floating point registers from being used in any manner.  This is
9095 necessary for compiling kernels which perform lazy context switching of
9096 floating point registers.  If you use this option and attempt to perform
9097 floating point operations, the compiler will abort.
9098
9099 @item -mdisable-indexing
9100 @opindex mdisable-indexing
9101 Prevent the compiler from using indexing address modes.  This avoids some
9102 rather obscure problems when compiling MIG generated code under MACH@.
9103
9104 @item -mno-space-regs
9105 @opindex mno-space-regs
9106 Generate code that assumes the target has no space registers.  This allows
9107 GCC to generate faster indirect calls and use unscaled index address modes.
9108
9109 Such code is suitable for level 0 PA systems and kernels.
9110
9111 @item -mfast-indirect-calls
9112 @opindex mfast-indirect-calls
9113 Generate code that assumes calls never cross space boundaries.  This
9114 allows GCC to emit code which performs faster indirect calls.
9115
9116 This option will not work in the presence of shared libraries or nested
9117 functions.
9118
9119 @item -mfixed-range=@var{register-range}
9120 @opindex mfixed-range
9121 Generate code treating the given register range as fixed registers.
9122 A fixed register is one that the register allocator can not use.  This is
9123 useful when compiling kernel code.  A register range is specified as
9124 two registers separated by a dash.  Multiple register ranges can be
9125 specified separated by a comma.
9126
9127 @item -mlong-load-store
9128 @opindex mlong-load-store
9129 Generate 3-instruction load and store sequences as sometimes required by
9130 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9131 the HP compilers.
9132
9133 @item -mportable-runtime
9134 @opindex mportable-runtime
9135 Use the portable calling conventions proposed by HP for ELF systems.
9136
9137 @item -mgas
9138 @opindex mgas
9139 Enable the use of assembler directives only GAS understands.
9140
9141 @item -mschedule=@var{cpu-type}
9142 @opindex mschedule
9143 Schedule code according to the constraints for the machine type
9144 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9145 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9146 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9147 proper scheduling option for your machine.  The default scheduling is
9148 @samp{8000}.
9149
9150 @item -mlinker-opt
9151 @opindex mlinker-opt
9152 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9153 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9154 linkers in which they give bogus error messages when linking some programs.
9155
9156 @item -msoft-float
9157 @opindex msoft-float
9158 Generate output containing library calls for floating point.
9159 @strong{Warning:} the requisite libraries are not available for all HPPA
9160 targets.  Normally the facilities of the machine's usual C compiler are
9161 used, but this cannot be done directly in cross-compilation.  You must make
9162 your own arrangements to provide suitable library functions for
9163 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9164 does provide software floating point support.
9165
9166 @option{-msoft-float} changes the calling convention in the output file;
9167 therefore, it is only useful if you compile @emph{all} of a program with
9168 this option.  In particular, you need to compile @file{libgcc.a}, the
9169 library that comes with GCC, with @option{-msoft-float} in order for
9170 this to work.
9171
9172 @item -msio
9173 @opindex msio
9174 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9175 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9176 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9177 options are available under HP-UX and HI-UX@.
9178
9179 @item -mgnu-ld
9180 @opindex gnu-ld
9181 Use GNU ld specific options.  This passes @option{-shared} to ld when
9182 building a shared library.  It is the default when GCC is configured,
9183 explicitly or implicitly, with the GNU linker.  This option does not
9184 have any affect on which ld is called, it only changes what parameters
9185 are passed to that ld.  The ld that is called is determined by the
9186 @option{--with-ld} configure option, GCC's program search path, and
9187 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9188 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9189 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9190
9191 @item -mhp-ld
9192 @opindex hp-ld
9193 Use HP ld specific options.  This passes @option{-b} to ld when building
9194 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9195 links.  It is the default when GCC is configured, explicitly or
9196 implicitly, with the HP linker.  This option does not have any affect on
9197 which ld is called, it only changes what parameters are passed to that
9198 ld.  The ld that is called is determined by the @option{--with-ld}
9199 configure option, GCC's program search path, and finally by the user's
9200 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9201 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9202 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9203
9204 @item -mlong-calls
9205 @opindex mno-long-calls
9206 Generate code that uses long call sequences.  This ensures that a call
9207 is always able to reach linker generated stubs.  The default is to generate
9208 long calls only when the distance from the call site to the beginning
9209 of the function or translation unit, as the case may be, exceeds a
9210 predefined limit set by the branch type being used.  The limits for
9211 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9212 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9213 240,000 bytes.
9214
9215 Distances are measured from the beginning of functions when using the
9216 @option{-ffunction-sections} option, or when using the @option{-mgas}
9217 and @option{-mno-portable-runtime} options together under HP-UX with
9218 the SOM linker.
9219
9220 It is normally not desirable to use this option as it will degrade
9221 performance.  However, it may be useful in large applications,
9222 particularly when partial linking is used to build the application.
9223
9224 The types of long calls used depends on the capabilities of the
9225 assembler and linker, and the type of code being generated.  The
9226 impact on systems that support long absolute calls, and long pic
9227 symbol-difference or pc-relative calls should be relatively small.
9228 However, an indirect call is used on 32-bit ELF systems in pic code
9229 and it is quite long.
9230
9231 @item -munix=@var{unix-std}
9232 @opindex march
9233 Generate compiler predefines and select a startfile for the specified
9234 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9235 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9236 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9237 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9238 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9239 and later.
9240
9241 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9242 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9243 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9244 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9245 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9246 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9247
9248 It is @emph{important} to note that this option changes the interfaces
9249 for various library routines.  It also affects the operational behavior
9250 of the C library.  Thus, @emph{extreme} care is needed in using this
9251 option.
9252
9253 Library code that is intended to operate with more than one UNIX
9254 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9255 as appropriate.  Most GNU software doesn't provide this capability.
9256
9257 @item -nolibdld
9258 @opindex nolibdld
9259 Suppress the generation of link options to search libdld.sl when the
9260 @option{-static} option is specified on HP-UX 10 and later.
9261
9262 @item -static
9263 @opindex static
9264 The HP-UX implementation of setlocale in libc has a dependency on
9265 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9266 when the @option{-static} option is specified, special link options
9267 are needed to resolve this dependency.
9268
9269 On HP-UX 10 and later, the GCC driver adds the necessary options to
9270 link with libdld.sl when the @option{-static} option is specified.
9271 This causes the resulting binary to be dynamic.  On the 64-bit port,
9272 the linkers generate dynamic binaries by default in any case.  The
9273 @option{-nolibdld} option can be used to prevent the GCC driver from
9274 adding these link options.
9275
9276 @item -threads
9277 @opindex threads
9278 Add support for multithreading with the @dfn{dce thread} library
9279 under HP-UX@.  This option sets flags for both the preprocessor and
9280 linker.
9281 @end table
9282
9283 @node i386 and x86-64 Options
9284 @subsection Intel 386 and AMD x86-64 Options
9285 @cindex i386 Options
9286 @cindex x86-64 Options
9287 @cindex Intel 386 Options
9288 @cindex AMD x86-64 Options
9289
9290 These @samp{-m} options are defined for the i386 and x86-64 family of
9291 computers:
9292
9293 @table @gcctabopt
9294 @item -mtune=@var{cpu-type}
9295 @opindex mtune
9296 Tune to @var{cpu-type} everything applicable about the generated code, except
9297 for the ABI and the set of available instructions.  The choices for
9298 @var{cpu-type} are:
9299 @table @emph
9300 @item generic
9301 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9302 If you know the CPU on which your code will run, then you should use
9303 the corresponding @option{-mtune} option instead of
9304 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9305 of your application will have, then you should use this option.
9306
9307 As new processors are deployed in the marketplace, the behavior of this
9308 option will change.  Therefore, if you upgrade to a newer version of
9309 GCC, the code generated option will change to reflect the processors
9310 that were most common when that version of GCC was released.
9311
9312 There is no @option{-march=generic} option because @option{-march}
9313 indicates the instruction set the compiler can use, and there is no
9314 generic instruction set applicable to all processors.  In contrast,
9315 @option{-mtune} indicates the processor (or, in this case, collection of
9316 processors) for which the code is optimized.
9317 @item native
9318 This selects the CPU to tune for at compilation time by determining
9319 the processor type of the compiling machine.  Using @option{-mtune=native}
9320 will produce code optimized for the local machine under the constraints
9321 of the selected instruction set.  Using @option{-march=native} will
9322 enable all instruction subsets supported by the local machine (hence
9323 the result might not run on different machines).
9324 @item i386
9325 Original Intel's i386 CPU@.
9326 @item i486
9327 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9328 @item i586, pentium
9329 Intel Pentium CPU with no MMX support.
9330 @item pentium-mmx
9331 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9332 @item pentiumpro
9333 Intel PentiumPro CPU@.
9334 @item i686
9335 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9336 instruction set will be used, so the code will run on all i686 family chips.
9337 @item pentium2
9338 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9339 @item pentium3, pentium3m
9340 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9341 support.
9342 @item pentium-m
9343 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9344 support.  Used by Centrino notebooks.
9345 @item pentium4, pentium4m
9346 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9347 @item prescott
9348 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9349 set support.
9350 @item nocona
9351 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9352 SSE2 and SSE3 instruction set support.
9353 @item core2
9354 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9355 instruction set support.
9356 @item k6
9357 AMD K6 CPU with MMX instruction set support.
9358 @item k6-2, k6-3
9359 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9360 @item athlon, athlon-tbird
9361 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9362 support.
9363 @item athlon-4, athlon-xp, athlon-mp
9364 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9365 instruction set support.
9366 @item k8, opteron, athlon64, athlon-fx
9367 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9368 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9369 @item winchip-c6
9370 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9371 set support.
9372 @item winchip2
9373 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9374 instruction set support.
9375 @item c3
9376 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9377 implemented for this chip.)
9378 @item c3-2
9379 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9380 implemented for this chip.)
9381 @item geode
9382 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9383 @end table
9384
9385 While picking a specific @var{cpu-type} will schedule things appropriately
9386 for that particular chip, the compiler will not generate any code that
9387 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9388 being used.
9389
9390 @item -march=@var{cpu-type}
9391 @opindex march
9392 Generate instructions for the machine type @var{cpu-type}.  The choices
9393 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9394 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9395
9396 @item -mcpu=@var{cpu-type}
9397 @opindex mcpu
9398 A deprecated synonym for @option{-mtune}.
9399
9400 @item -m386
9401 @itemx -m486
9402 @itemx -mpentium
9403 @itemx -mpentiumpro
9404 @opindex m386
9405 @opindex m486
9406 @opindex mpentium
9407 @opindex mpentiumpro
9408 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9409 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9410 These synonyms are deprecated.
9411
9412 @item -mfpmath=@var{unit}
9413 @opindex march
9414 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9415 for @var{unit} are:
9416
9417 @table @samp
9418 @item 387
9419 Use the standard 387 floating point coprocessor present majority of chips and
9420 emulated otherwise.  Code compiled with this option will run almost everywhere.
9421 The temporary results are computed in 80bit precision instead of precision
9422 specified by the type resulting in slightly different results compared to most
9423 of other chips.  See @option{-ffloat-store} for more detailed description.
9424
9425 This is the default choice for i386 compiler.
9426
9427 @item sse
9428 Use scalar floating point instructions present in the SSE instruction set.
9429 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9430 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9431 instruction set supports only single precision arithmetics, thus the double and
9432 extended precision arithmetics is still done using 387.  Later version, present
9433 only in Pentium4 and the future AMD x86-64 chips supports double precision
9434 arithmetics too.
9435
9436 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9437 or @option{-msse2} switches to enable SSE extensions and make this option
9438 effective.  For the x86-64 compiler, these extensions are enabled by default.
9439
9440 The resulting code should be considerably faster in the majority of cases and avoid
9441 the numerical instability problems of 387 code, but may break some existing
9442 code that expects temporaries to be 80bit.
9443
9444 This is the default choice for the x86-64 compiler.
9445
9446 @item sse,387
9447 Attempt to utilize both instruction sets at once.  This effectively double the
9448 amount of available registers and on chips with separate execution units for
9449 387 and SSE the execution resources too.  Use this option with care, as it is
9450 still experimental, because the GCC register allocator does not model separate
9451 functional units well resulting in instable performance.
9452 @end table
9453
9454 @item -masm=@var{dialect}
9455 @opindex masm=@var{dialect}
9456 Output asm instructions using selected @var{dialect}.  Supported
9457 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9458 not support @samp{intel}.
9459
9460 @item -mieee-fp
9461 @itemx -mno-ieee-fp
9462 @opindex mieee-fp
9463 @opindex mno-ieee-fp
9464 Control whether or not the compiler uses IEEE floating point
9465 comparisons.  These handle correctly the case where the result of a
9466 comparison is unordered.
9467
9468 @item -msoft-float
9469 @opindex msoft-float
9470 Generate output containing library calls for floating point.
9471 @strong{Warning:} the requisite libraries are not part of GCC@.
9472 Normally the facilities of the machine's usual C compiler are used, but
9473 this can't be done directly in cross-compilation.  You must make your
9474 own arrangements to provide suitable library functions for
9475 cross-compilation.
9476
9477 On machines where a function returns floating point results in the 80387
9478 register stack, some floating point opcodes may be emitted even if
9479 @option{-msoft-float} is used.
9480
9481 @item -mno-fp-ret-in-387
9482 @opindex mno-fp-ret-in-387
9483 Do not use the FPU registers for return values of functions.
9484
9485 The usual calling convention has functions return values of types
9486 @code{float} and @code{double} in an FPU register, even if there
9487 is no FPU@.  The idea is that the operating system should emulate
9488 an FPU@.
9489
9490 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9491 in ordinary CPU registers instead.
9492
9493 @item -mno-fancy-math-387
9494 @opindex mno-fancy-math-387
9495 Some 387 emulators do not support the @code{sin}, @code{cos} and
9496 @code{sqrt} instructions for the 387.  Specify this option to avoid
9497 generating those instructions.  This option is the default on FreeBSD,
9498 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9499 indicates that the target cpu will always have an FPU and so the
9500 instruction will not need emulation.  As of revision 2.6.1, these
9501 instructions are not generated unless you also use the
9502 @option{-funsafe-math-optimizations} switch.
9503
9504 @item -malign-double
9505 @itemx -mno-align-double
9506 @opindex malign-double
9507 @opindex mno-align-double
9508 Control whether GCC aligns @code{double}, @code{long double}, and
9509 @code{long long} variables on a two word boundary or a one word
9510 boundary.  Aligning @code{double} variables on a two word boundary will
9511 produce code that runs somewhat faster on a @samp{Pentium} at the
9512 expense of more memory.
9513
9514 On x86-64, @option{-malign-double} is enabled by default.
9515
9516 @strong{Warning:} if you use the @option{-malign-double} switch,
9517 structures containing the above types will be aligned differently than
9518 the published application binary interface specifications for the 386
9519 and will not be binary compatible with structures in code compiled
9520 without that switch.
9521
9522 @item -m96bit-long-double
9523 @itemx -m128bit-long-double
9524 @opindex m96bit-long-double
9525 @opindex m128bit-long-double
9526 These switches control the size of @code{long double} type.  The i386
9527 application binary interface specifies the size to be 96 bits,
9528 so @option{-m96bit-long-double} is the default in 32 bit mode.
9529
9530 Modern architectures (Pentium and newer) would prefer @code{long double}
9531 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9532 conforming to the ABI, this would not be possible.  So specifying a
9533 @option{-m128bit-long-double} will align @code{long double}
9534 to a 16 byte boundary by padding the @code{long double} with an additional
9535 32 bit zero.
9536
9537 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9538 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9539
9540 Notice that neither of these options enable any extra precision over the x87
9541 standard of 80 bits for a @code{long double}.
9542
9543 @strong{Warning:} if you override the default value for your target ABI, the
9544 structures and arrays containing @code{long double} variables will change
9545 their size as well as function calling convention for function taking
9546 @code{long double} will be modified.  Hence they will not be binary
9547 compatible with arrays or structures in code compiled without that switch.
9548
9549 @item -mmlarge-data-threshold=@var{number}
9550 @opindex mlarge-data-threshold=@var{number}
9551 When @option{-mcmodel=medium} is specified, the data greater than
9552 @var{threshold} are placed in large data section.  This value must be the
9553 same across all object linked into the binary and defaults to 65535.
9554
9555 @item -msvr3-shlib
9556 @itemx -mno-svr3-shlib
9557 @opindex msvr3-shlib
9558 @opindex mno-svr3-shlib
9559 Control whether GCC places uninitialized local variables into the
9560 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9561 into @code{bss}.  These options are meaningful only on System V Release 3.
9562
9563 @item -mrtd
9564 @opindex mrtd
9565 Use a different function-calling convention, in which functions that
9566 take a fixed number of arguments return with the @code{ret} @var{num}
9567 instruction, which pops their arguments while returning.  This saves one
9568 instruction in the caller since there is no need to pop the arguments
9569 there.
9570
9571 You can specify that an individual function is called with this calling
9572 sequence with the function attribute @samp{stdcall}.  You can also
9573 override the @option{-mrtd} option by using the function attribute
9574 @samp{cdecl}.  @xref{Function Attributes}.
9575
9576 @strong{Warning:} this calling convention is incompatible with the one
9577 normally used on Unix, so you cannot use it if you need to call
9578 libraries compiled with the Unix compiler.
9579
9580 Also, you must provide function prototypes for all functions that
9581 take variable numbers of arguments (including @code{printf});
9582 otherwise incorrect code will be generated for calls to those
9583 functions.
9584
9585 In addition, seriously incorrect code will result if you call a
9586 function with too many arguments.  (Normally, extra arguments are
9587 harmlessly ignored.)
9588
9589 @item -mregparm=@var{num}
9590 @opindex mregparm
9591 Control how many registers are used to pass integer arguments.  By
9592 default, no registers are used to pass arguments, and at most 3
9593 registers can be used.  You can control this behavior for a specific
9594 function by using the function attribute @samp{regparm}.
9595 @xref{Function Attributes}.
9596
9597 @strong{Warning:} if you use this switch, and
9598 @var{num} is nonzero, then you must build all modules with the same
9599 value, including any libraries.  This includes the system libraries and
9600 startup modules.
9601
9602 @item -msseregparm
9603 @opindex msseregparm
9604 Use SSE register passing conventions for float and double arguments
9605 and return values.  You can control this behavior for a specific
9606 function by using the function attribute @samp{sseregparm}.
9607 @xref{Function Attributes}.
9608
9609 @strong{Warning:} if you use this switch then you must build all
9610 modules with the same value, including any libraries.  This includes
9611 the system libraries and startup modules.
9612
9613 @item -mstackrealign
9614 @opindex mstackrealign
9615 Realign the stack at entry.  On the Intel x86, the
9616 @option{-mstackrealign} option will generate an alternate prologue and
9617 epilogue that realigns the runtime stack.  This supports mixing legacy
9618 codes that keep a 4-byte aligned stack with modern codes that keep a
9619 16-byte stack for SSE compatibility.  The alternate prologue and
9620 epilogue are slower and bigger than the regular ones, and the
9621 alternate prologue requires an extra scratch register; this lowers the
9622 number of registers available if used in conjunction with the
9623 @code{regparm} attribute.  The @option{-mstackrealign} option is
9624 incompatible with the nested function prologue; this is considered a
9625 hard error.  See also the attribute @code{force_align_arg_pointer},
9626 applicable to individual functions.
9627
9628 @item -mpreferred-stack-boundary=@var{num}
9629 @opindex mpreferred-stack-boundary
9630 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
9631 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
9632 the default is 4 (16 bytes or 128 bits).
9633
9634 On Pentium and PentiumPro, @code{double} and @code{long double} values
9635 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
9636 suffer significant run time performance penalties.  On Pentium III, the
9637 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
9638 properly if it is not 16 byte aligned.
9639
9640 To ensure proper alignment of this values on the stack, the stack boundary
9641 must be as aligned as that required by any value stored on the stack.
9642 Further, every function must be generated such that it keeps the stack
9643 aligned.  Thus calling a function compiled with a higher preferred
9644 stack boundary from a function compiled with a lower preferred stack
9645 boundary will most likely misalign the stack.  It is recommended that
9646 libraries that use callbacks always use the default setting.
9647
9648 This extra alignment does consume extra stack space, and generally
9649 increases code size.  Code that is sensitive to stack space usage, such
9650 as embedded systems and operating system kernels, may want to reduce the
9651 preferred alignment to @option{-mpreferred-stack-boundary=2}.
9652
9653 @item -mmmx
9654 @itemx -mno-mmx
9655 @item -msse
9656 @itemx -mno-sse
9657 @item -msse2
9658 @itemx -mno-sse2
9659 @item -msse3
9660 @itemx -mno-sse3
9661 @item -mssse3
9662 @itemx -mno-ssse3
9663 @item -m3dnow
9664 @itemx -mno-3dnow
9665 @opindex mmmx
9666 @opindex mno-mmx
9667 @opindex msse
9668 @opindex mno-sse
9669 @opindex m3dnow
9670 @opindex mno-3dnow
9671 These switches enable or disable the use of instructions in the MMX,
9672 SSE, SSE2, SSE3, SSSE3 or 3DNow! extended instruction sets.
9673 These extensions are also available as built-in functions: see
9674 @ref{X86 Built-in Functions}, for details of the functions enabled and
9675 disabled by these switches.
9676
9677 To have SSE/SSE2 instructions generated automatically from floating-point
9678 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
9679
9680 These options will enable GCC to use these extended instructions in
9681 generated code, even without @option{-mfpmath=sse}.  Applications which
9682 perform runtime CPU detection must compile separate files for each
9683 supported architecture, using the appropriate flags.  In particular,
9684 the file containing the CPU detection code should be compiled without
9685 these options.
9686
9687 @item -mpush-args
9688 @itemx -mno-push-args
9689 @opindex mpush-args
9690 @opindex mno-push-args
9691 Use PUSH operations to store outgoing parameters.  This method is shorter
9692 and usually equally fast as method using SUB/MOV operations and is enabled
9693 by default.  In some cases disabling it may improve performance because of
9694 improved scheduling and reduced dependencies.
9695
9696 @item -maccumulate-outgoing-args
9697 @opindex maccumulate-outgoing-args
9698 If enabled, the maximum amount of space required for outgoing arguments will be
9699 computed in the function prologue.  This is faster on most modern CPUs
9700 because of reduced dependencies, improved scheduling and reduced stack usage
9701 when preferred stack boundary is not equal to 2.  The drawback is a notable
9702 increase in code size.  This switch implies @option{-mno-push-args}.
9703
9704 @item -mthreads
9705 @opindex mthreads
9706 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
9707 on thread-safe exception handling must compile and link all code with the
9708 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
9709 @option{-D_MT}; when linking, it links in a special thread helper library
9710 @option{-lmingwthrd} which cleans up per thread exception handling data.
9711
9712 @item -mno-align-stringops
9713 @opindex mno-align-stringops
9714 Do not align destination of inlined string operations.  This switch reduces
9715 code size and improves performance in case the destination is already aligned,
9716 but GCC doesn't know about it.
9717
9718 @item -minline-all-stringops
9719 @opindex minline-all-stringops
9720 By default GCC inlines string operations only when destination is known to be
9721 aligned at least to 4 byte boundary.  This enables more inlining, increase code
9722 size, but may improve performance of code that depends on fast memcpy, strlen
9723 and memset for short lengths.
9724
9725 @item -minline-stringops-dynamically
9726 @opindex minline-stringops-dynamically
9727 For string operation of unknown size, inline runtime checks so for small
9728 blocks inline code is used, while for large blocks library call is used.
9729
9730 @item -mstringop-strategy=@var{alg}
9731 @opindex mstringop-strategy=@var{alg}
9732 Overwrite internal decision heuristic about particular algorithm to inline
9733 string operation with.  The allowed values are @code{rep_byte},
9734 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
9735 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
9736 expanding inline loop, @code{libcall} for always expanding library call.
9737
9738 @item -momit-leaf-frame-pointer
9739 @opindex momit-leaf-frame-pointer
9740 Don't keep the frame pointer in a register for leaf functions.  This
9741 avoids the instructions to save, set up and restore frame pointers and
9742 makes an extra register available in leaf functions.  The option
9743 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9744 which might make debugging harder.
9745
9746 @item -mtls-direct-seg-refs
9747 @itemx -mno-tls-direct-seg-refs
9748 @opindex mtls-direct-seg-refs
9749 Controls whether TLS variables may be accessed with offsets from the
9750 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
9751 or whether the thread base pointer must be added.  Whether or not this
9752 is legal depends on the operating system, and whether it maps the
9753 segment to cover the entire TLS area.
9754
9755 For systems that use GNU libc, the default is on.
9756 @end table
9757
9758 These @samp{-m} switches are supported in addition to the above
9759 on AMD x86-64 processors in 64-bit environments.
9760
9761 @table @gcctabopt
9762 @item -m32
9763 @itemx -m64
9764 @opindex m32
9765 @opindex m64
9766 Generate code for a 32-bit or 64-bit environment.
9767 The 32-bit environment sets int, long and pointer to 32 bits and
9768 generates code that runs on any i386 system.
9769 The 64-bit environment sets int to 32 bits and long and pointer
9770 to 64 bits and generates code for AMD's x86-64 architecture.
9771
9772 @item -mno-red-zone
9773 @opindex no-red-zone
9774 Do not use a so called red zone for x86-64 code.  The red zone is mandated
9775 by the x86-64 ABI, it is a 128-byte area beyond the location of the
9776 stack pointer that will not be modified by signal or interrupt handlers
9777 and therefore can be used for temporary data without adjusting the stack
9778 pointer.  The flag @option{-mno-red-zone} disables this red zone.
9779
9780 @item -mcmodel=small
9781 @opindex mcmodel=small
9782 Generate code for the small code model: the program and its symbols must
9783 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
9784 Programs can be statically or dynamically linked.  This is the default
9785 code model.
9786
9787 @item -mcmodel=kernel
9788 @opindex mcmodel=kernel
9789 Generate code for the kernel code model.  The kernel runs in the
9790 negative 2 GB of the address space.
9791 This model has to be used for Linux kernel code.
9792
9793 @item -mcmodel=medium
9794 @opindex mcmodel=medium
9795 Generate code for the medium model: The program is linked in the lower 2
9796 GB of the address space but symbols can be located anywhere in the
9797 address space.  Programs can be statically or dynamically linked, but
9798 building of shared libraries are not supported with the medium model.
9799
9800 @item -mcmodel=large
9801 @opindex mcmodel=large
9802 Generate code for the large model: This model makes no assumptions
9803 about addresses and sizes of sections.  Currently GCC does not implement
9804 this model.
9805 @end table
9806
9807 @node IA-64 Options
9808 @subsection IA-64 Options
9809 @cindex IA-64 Options
9810
9811 These are the @samp{-m} options defined for the Intel IA-64 architecture.
9812
9813 @table @gcctabopt
9814 @item -mbig-endian
9815 @opindex mbig-endian
9816 Generate code for a big endian target.  This is the default for HP-UX@.
9817
9818 @item -mlittle-endian
9819 @opindex mlittle-endian
9820 Generate code for a little endian target.  This is the default for AIX5
9821 and GNU/Linux.
9822
9823 @item -mgnu-as
9824 @itemx -mno-gnu-as
9825 @opindex mgnu-as
9826 @opindex mno-gnu-as
9827 Generate (or don't) code for the GNU assembler.  This is the default.
9828 @c Also, this is the default if the configure option @option{--with-gnu-as}
9829 @c is used.
9830
9831 @item -mgnu-ld
9832 @itemx -mno-gnu-ld
9833 @opindex mgnu-ld
9834 @opindex mno-gnu-ld
9835 Generate (or don't) code for the GNU linker.  This is the default.
9836 @c Also, this is the default if the configure option @option{--with-gnu-ld}
9837 @c is used.
9838
9839 @item -mno-pic
9840 @opindex mno-pic
9841 Generate code that does not use a global pointer register.  The result
9842 is not position independent code, and violates the IA-64 ABI@.
9843
9844 @item -mvolatile-asm-stop
9845 @itemx -mno-volatile-asm-stop
9846 @opindex mvolatile-asm-stop
9847 @opindex mno-volatile-asm-stop
9848 Generate (or don't) a stop bit immediately before and after volatile asm
9849 statements.
9850
9851 @item -mregister-names
9852 @itemx -mno-register-names
9853 @opindex mregister-names
9854 @opindex mno-register-names
9855 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
9856 the stacked registers.  This may make assembler output more readable.
9857
9858 @item -mno-sdata
9859 @itemx -msdata
9860 @opindex mno-sdata
9861 @opindex msdata
9862 Disable (or enable) optimizations that use the small data section.  This may
9863 be useful for working around optimizer bugs.
9864
9865 @item -mconstant-gp
9866 @opindex mconstant-gp
9867 Generate code that uses a single constant global pointer value.  This is
9868 useful when compiling kernel code.
9869
9870 @item -mauto-pic
9871 @opindex mauto-pic
9872 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
9873 This is useful when compiling firmware code.
9874
9875 @item -minline-float-divide-min-latency
9876 @opindex minline-float-divide-min-latency
9877 Generate code for inline divides of floating point values
9878 using the minimum latency algorithm.
9879
9880 @item -minline-float-divide-max-throughput
9881 @opindex minline-float-divide-max-throughput
9882 Generate code for inline divides of floating point values
9883 using the maximum throughput algorithm.
9884
9885 @item -minline-int-divide-min-latency
9886 @opindex minline-int-divide-min-latency
9887 Generate code for inline divides of integer values
9888 using the minimum latency algorithm.
9889
9890 @item -minline-int-divide-max-throughput
9891 @opindex minline-int-divide-max-throughput
9892 Generate code for inline divides of integer values
9893 using the maximum throughput algorithm.
9894
9895 @item -minline-sqrt-min-latency
9896 @opindex minline-sqrt-min-latency
9897 Generate code for inline square roots
9898 using the minimum latency algorithm.
9899
9900 @item -minline-sqrt-max-throughput
9901 @opindex minline-sqrt-max-throughput
9902 Generate code for inline square roots
9903 using the maximum throughput algorithm.
9904
9905 @item -mno-dwarf2-asm
9906 @itemx -mdwarf2-asm
9907 @opindex mno-dwarf2-asm
9908 @opindex mdwarf2-asm
9909 Don't (or do) generate assembler code for the DWARF2 line number debugging
9910 info.  This may be useful when not using the GNU assembler.
9911
9912 @item -mearly-stop-bits
9913 @itemx -mno-early-stop-bits
9914 @opindex mearly-stop-bits
9915 @opindex mno-early-stop-bits
9916 Allow stop bits to be placed earlier than immediately preceding the
9917 instruction that triggered the stop bit.  This can improve instruction
9918 scheduling, but does not always do so.
9919
9920 @item -mfixed-range=@var{register-range}
9921 @opindex mfixed-range
9922 Generate code treating the given register range as fixed registers.
9923 A fixed register is one that the register allocator can not use.  This is
9924 useful when compiling kernel code.  A register range is specified as
9925 two registers separated by a dash.  Multiple register ranges can be
9926 specified separated by a comma.
9927
9928 @item -mtls-size=@var{tls-size}
9929 @opindex mtls-size
9930 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
9931 64.
9932
9933 @item -mtune=@var{cpu-type}
9934 @opindex mtune
9935 Tune the instruction scheduling for a particular CPU, Valid values are
9936 itanium, itanium1, merced, itanium2, and mckinley.
9937
9938 @item -mt
9939 @itemx -pthread
9940 @opindex mt
9941 @opindex pthread
9942 Add support for multithreading using the POSIX threads library.  This
9943 option sets flags for both the preprocessor and linker.  It does
9944 not affect the thread safety of object code produced by the compiler or
9945 that of libraries supplied with it.  These are HP-UX specific flags.
9946
9947 @item -milp32
9948 @itemx -mlp64
9949 @opindex milp32
9950 @opindex mlp64
9951 Generate code for a 32-bit or 64-bit environment.
9952 The 32-bit environment sets int, long and pointer to 32 bits.
9953 The 64-bit environment sets int to 32 bits and long and pointer
9954 to 64 bits.  These are HP-UX specific flags.
9955
9956 @item -mno-sched-br-data-spec
9957 @itemx -msched-br-data-spec
9958 @opindex -mno-sched-br-data-spec
9959 @opindex -msched-br-data-spec
9960 (Dis/En)able data speculative scheduling before reload.
9961 This will result in generation of the ld.a instructions and
9962 the corresponding check instructions (ld.c / chk.a).
9963 The default is 'disable'.
9964
9965 @item -msched-ar-data-spec
9966 @itemx -mno-sched-ar-data-spec
9967 @opindex -msched-ar-data-spec
9968 @opindex -mno-sched-ar-data-spec
9969 (En/Dis)able data speculative scheduling after reload.
9970 This will result in generation of the ld.a instructions and
9971 the corresponding check instructions (ld.c / chk.a).
9972 The default is 'enable'.
9973
9974 @item -mno-sched-control-spec
9975 @itemx -msched-control-spec
9976 @opindex -mno-sched-control-spec
9977 @opindex -msched-control-spec
9978 (Dis/En)able control speculative scheduling.  This feature is
9979 available only during region scheduling (i.e. before reload).
9980 This will result in generation of the ld.s instructions and
9981 the corresponding check instructions chk.s .
9982 The default is 'disable'.
9983
9984 @item -msched-br-in-data-spec
9985 @itemx -mno-sched-br-in-data-spec
9986 @opindex -msched-br-in-data-spec
9987 @opindex -mno-sched-br-in-data-spec
9988 (En/Dis)able speculative scheduling of the instructions that
9989 are dependent on the data speculative loads before reload.
9990 This is effective only with @option{-msched-br-data-spec} enabled.
9991 The default is 'enable'.
9992
9993 @item -msched-ar-in-data-spec
9994 @itemx -mno-sched-ar-in-data-spec
9995 @opindex -msched-ar-in-data-spec
9996 @opindex -mno-sched-ar-in-data-spec
9997 (En/Dis)able speculative scheduling of the instructions that
9998 are dependent on the data speculative loads after reload.
9999 This is effective only with @option{-msched-ar-data-spec} enabled.
10000 The default is 'enable'.
10001
10002 @item -msched-in-control-spec
10003 @itemx -mno-sched-in-control-spec
10004 @opindex -msched-in-control-spec
10005 @opindex -mno-sched-in-control-spec
10006 (En/Dis)able speculative scheduling of the instructions that
10007 are dependent on the control speculative loads.
10008 This is effective only with @option{-msched-control-spec} enabled.
10009 The default is 'enable'.
10010
10011 @item -msched-ldc
10012 @itemx -mno-sched-ldc
10013 @opindex -msched-ldc
10014 @opindex -mno-sched-ldc
10015 (En/Dis)able use of simple data speculation checks ld.c .
10016 If disabled, only chk.a instructions will be emitted to check
10017 data speculative loads.
10018 The default is 'enable'.
10019
10020 @item -mno-sched-control-ldc
10021 @itemx -msched-control-ldc
10022 @opindex -mno-sched-control-ldc
10023 @opindex -msched-control-ldc 
10024 (Dis/En)able use of ld.c instructions to check control speculative loads.
10025 If enabled, in case of control speculative load with no speculatively
10026 scheduled dependent instructions this load will be emitted as ld.sa and
10027 ld.c will be used to check it.
10028 The default is 'disable'.
10029
10030 @item -mno-sched-spec-verbose
10031 @itemx -msched-spec-verbose
10032 @opindex -mno-sched-spec-verbose
10033 @opindex -msched-spec-verbose
10034 (Dis/En)able printing of the information about speculative motions.
10035
10036 @item -mno-sched-prefer-non-data-spec-insns
10037 @itemx -msched-prefer-non-data-spec-insns
10038 @opindex -mno-sched-prefer-non-data-spec-insns
10039 @opindex -msched-prefer-non-data-spec-insns
10040 If enabled, data speculative instructions will be chosen for schedule
10041 only if there are no other choices at the moment.  This will make
10042 the use of the data speculation much more conservative.
10043 The default is 'disable'.
10044
10045 @item -mno-sched-prefer-non-control-spec-insns
10046 @itemx -msched-prefer-non-control-spec-insns
10047 @opindex -mno-sched-prefer-non-control-spec-insns
10048 @opindex -msched-prefer-non-control-spec-insns
10049 If enabled, control speculative instructions will be chosen for schedule
10050 only if there are no other choices at the moment.  This will make
10051 the use of the control speculation much more conservative.
10052 The default is 'disable'.
10053
10054 @item -mno-sched-count-spec-in-critical-path
10055 @itemx -msched-count-spec-in-critical-path
10056 @opindex -mno-sched-count-spec-in-critical-path
10057 @opindex -msched-count-spec-in-critical-path
10058 If enabled, speculative dependencies will be considered during
10059 computation of the instructions priorities.  This will make the use of the
10060 speculation a bit more conservative.
10061 The default is 'disable'.
10062
10063 @end table
10064
10065 @node M32C Options
10066 @subsection M32C Options
10067 @cindex M32C options
10068
10069 @table @gcctabopt
10070 @item -mcpu=@var{name}
10071 @opindex mcpu=
10072 Select the CPU for which code is generated.  @var{name} may be one of
10073 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10074 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10075 the M32C/80 series.
10076
10077 @item -msim
10078 @opindex msim
10079 Specifies that the program will be run on the simulator.  This causes
10080 an alternate runtime library to be linked in which supports, for
10081 example, file I/O.  You must not use this option when generating
10082 programs that will run on real hardware; you must provide your own
10083 runtime library for whatever I/O functions are needed.
10084
10085 @item -memregs=@var{number}
10086 @opindex memregs=
10087 Specifies the number of memory-based pseudo-registers GCC will use
10088 during code generation.  These pseudo-registers will be used like real
10089 registers, so there is a tradeoff between GCC's ability to fit the
10090 code into available registers, and the performance penalty of using
10091 memory instead of registers.  Note that all modules in a program must
10092 be compiled with the same value for this option.  Because of that, you
10093 must not use this option with the default runtime libraries gcc
10094 builds.
10095
10096 @end table
10097
10098 @node M32R/D Options
10099 @subsection M32R/D Options
10100 @cindex M32R/D options
10101
10102 These @option{-m} options are defined for Renesas M32R/D architectures:
10103
10104 @table @gcctabopt
10105 @item -m32r2
10106 @opindex m32r2
10107 Generate code for the M32R/2@.
10108
10109 @item -m32rx
10110 @opindex m32rx
10111 Generate code for the M32R/X@.
10112
10113 @item -m32r
10114 @opindex m32r
10115 Generate code for the M32R@.  This is the default.
10116
10117 @item -mmodel=small
10118 @opindex mmodel=small
10119 Assume all objects live in the lower 16MB of memory (so that their addresses
10120 can be loaded with the @code{ld24} instruction), and assume all subroutines
10121 are reachable with the @code{bl} instruction.
10122 This is the default.
10123
10124 The addressability of a particular object can be set with the
10125 @code{model} attribute.
10126
10127 @item -mmodel=medium
10128 @opindex mmodel=medium
10129 Assume objects may be anywhere in the 32-bit address space (the compiler
10130 will generate @code{seth/add3} instructions to load their addresses), and
10131 assume all subroutines are reachable with the @code{bl} instruction.
10132
10133 @item -mmodel=large
10134 @opindex mmodel=large
10135 Assume objects may be anywhere in the 32-bit address space (the compiler
10136 will generate @code{seth/add3} instructions to load their addresses), and
10137 assume subroutines may not be reachable with the @code{bl} instruction
10138 (the compiler will generate the much slower @code{seth/add3/jl}
10139 instruction sequence).
10140
10141 @item -msdata=none
10142 @opindex msdata=none
10143 Disable use of the small data area.  Variables will be put into
10144 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10145 @code{section} attribute has been specified).
10146 This is the default.
10147
10148 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10149 Objects may be explicitly put in the small data area with the
10150 @code{section} attribute using one of these sections.
10151
10152 @item -msdata=sdata
10153 @opindex msdata=sdata
10154 Put small global and static data in the small data area, but do not
10155 generate special code to reference them.
10156
10157 @item -msdata=use
10158 @opindex msdata=use
10159 Put small global and static data in the small data area, and generate
10160 special instructions to reference them.
10161
10162 @item -G @var{num}
10163 @opindex G
10164 @cindex smaller data references
10165 Put global and static objects less than or equal to @var{num} bytes
10166 into the small data or bss sections instead of the normal data or bss
10167 sections.  The default value of @var{num} is 8.
10168 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10169 for this option to have any effect.
10170
10171 All modules should be compiled with the same @option{-G @var{num}} value.
10172 Compiling with different values of @var{num} may or may not work; if it
10173 doesn't the linker will give an error message---incorrect code will not be
10174 generated.
10175
10176 @item -mdebug
10177 @opindex mdebug
10178 Makes the M32R specific code in the compiler display some statistics
10179 that might help in debugging programs.
10180
10181 @item -malign-loops
10182 @opindex malign-loops
10183 Align all loops to a 32-byte boundary.
10184
10185 @item -mno-align-loops
10186 @opindex mno-align-loops
10187 Do not enforce a 32-byte alignment for loops.  This is the default.
10188
10189 @item -missue-rate=@var{number}
10190 @opindex missue-rate=@var{number}
10191 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10192 or 2.
10193
10194 @item -mbranch-cost=@var{number}
10195 @opindex mbranch-cost=@var{number}
10196 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10197 preferred over conditional code, if it is 2, then the opposite will
10198 apply.
10199
10200 @item -mflush-trap=@var{number}
10201 @opindex mflush-trap=@var{number}
10202 Specifies the trap number to use to flush the cache.  The default is
10203 12.  Valid numbers are between 0 and 15 inclusive.
10204
10205 @item -mno-flush-trap
10206 @opindex mno-flush-trap
10207 Specifies that the cache cannot be flushed by using a trap.
10208
10209 @item -mflush-func=@var{name}
10210 @opindex mflush-func=@var{name}
10211 Specifies the name of the operating system function to call to flush
10212 the cache.  The default is @emph{_flush_cache}, but a function call
10213 will only be used if a trap is not available.
10214
10215 @item -mno-flush-func
10216 @opindex mno-flush-func
10217 Indicates that there is no OS function for flushing the cache.
10218
10219 @end table
10220
10221 @node M680x0 Options
10222 @subsection M680x0 Options
10223 @cindex M680x0 options
10224
10225 These are the @samp{-m} options defined for the 68000 series.  The default
10226 values for these options depends on which style of 68000 was selected when
10227 the compiler was configured; the defaults for the most common choices are
10228 given below.
10229
10230 @table @gcctabopt
10231 @item -m68000
10232 @itemx -mc68000
10233 @opindex m68000
10234 @opindex mc68000
10235 Generate output for a 68000.  This is the default
10236 when the compiler is configured for 68000-based systems.
10237
10238 Use this option for microcontrollers with a 68000 or EC000 core,
10239 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10240
10241 @item -m68020
10242 @itemx -mc68020
10243 @opindex m68020
10244 @opindex mc68020
10245 Generate output for a 68020.  This is the default
10246 when the compiler is configured for 68020-based systems.
10247
10248 @item -m68881
10249 @opindex m68881
10250 Generate output containing 68881 instructions for floating point.
10251 This is the default for most 68020 systems unless @option{--nfp} was
10252 specified when the compiler was configured.
10253
10254 @item -m68030
10255 @opindex m68030
10256 Generate output for a 68030.  This is the default when the compiler is
10257 configured for 68030-based systems.
10258
10259 @item -m68040
10260 @opindex m68040
10261 Generate output for a 68040.  This is the default when the compiler is
10262 configured for 68040-based systems.
10263
10264 This option inhibits the use of 68881/68882 instructions that have to be
10265 emulated by software on the 68040.  Use this option if your 68040 does not
10266 have code to emulate those instructions.
10267
10268 @item -m68060
10269 @opindex m68060
10270 Generate output for a 68060.  This is the default when the compiler is
10271 configured for 68060-based systems.
10272
10273 This option inhibits the use of 68020 and 68881/68882 instructions that
10274 have to be emulated by software on the 68060.  Use this option if your 68060
10275 does not have code to emulate those instructions.
10276
10277 @item -mcpu32
10278 @opindex mcpu32
10279 Generate output for a CPU32.  This is the default
10280 when the compiler is configured for CPU32-based systems.
10281
10282 Use this option for microcontrollers with a
10283 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
10284 68336, 68340, 68341, 68349 and 68360.
10285
10286 @item -m5200
10287 @opindex m5200
10288 Generate output for a 520X ``coldfire'' family cpu.  This is the default
10289 when the compiler is configured for 520X-based systems.
10290
10291 Use this option for microcontroller with a 5200 core, including
10292 the MCF5202, MCF5203, MCF5204 and MCF5202.
10293
10294 @item -mcfv4e
10295 @opindex mcfv4e
10296 Generate output for a ColdFire V4e family cpu (e.g.@: 547x/548x).
10297 This includes use of hardware floating point instructions.
10298
10299 @item -m68020-40
10300 @opindex m68020-40
10301 Generate output for a 68040, without using any of the new instructions.
10302 This results in code which can run relatively efficiently on either a
10303 68020/68881 or a 68030 or a 68040.  The generated code does use the
10304 68881 instructions that are emulated on the 68040.
10305
10306 @item -m68020-60
10307 @opindex m68020-60
10308 Generate output for a 68060, without using any of the new instructions.
10309 This results in code which can run relatively efficiently on either a
10310 68020/68881 or a 68030 or a 68040.  The generated code does use the
10311 68881 instructions that are emulated on the 68060.
10312
10313 @item -msoft-float
10314 @opindex msoft-float
10315 Generate output containing library calls for floating point.
10316 @strong{Warning:} the requisite libraries are not available for all m68k
10317 targets.  Normally the facilities of the machine's usual C compiler are
10318 used, but this can't be done directly in cross-compilation.  You must
10319 make your own arrangements to provide suitable library functions for
10320 cross-compilation.  The embedded targets @samp{m68k-*-aout} and
10321 @samp{m68k-*-coff} do provide software floating point support.
10322
10323 @item -mshort
10324 @opindex mshort
10325 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10326 Additionally, parameters passed on the stack are also aligned to a
10327 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10328
10329 @item -mnobitfield
10330 @opindex mnobitfield
10331 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10332 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10333
10334 @item -mbitfield
10335 @opindex mbitfield
10336 Do use the bit-field instructions.  The @option{-m68020} option implies
10337 @option{-mbitfield}.  This is the default if you use a configuration
10338 designed for a 68020.
10339
10340 @item -mrtd
10341 @opindex mrtd
10342 Use a different function-calling convention, in which functions
10343 that take a fixed number of arguments return with the @code{rtd}
10344 instruction, which pops their arguments while returning.  This
10345 saves one instruction in the caller since there is no need to pop
10346 the arguments there.
10347
10348 This calling convention is incompatible with the one normally
10349 used on Unix, so you cannot use it if you need to call libraries
10350 compiled with the Unix compiler.
10351
10352 Also, you must provide function prototypes for all functions that
10353 take variable numbers of arguments (including @code{printf});
10354 otherwise incorrect code will be generated for calls to those
10355 functions.
10356
10357 In addition, seriously incorrect code will result if you call a
10358 function with too many arguments.  (Normally, extra arguments are
10359 harmlessly ignored.)
10360
10361 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10362 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10363
10364 @item -malign-int
10365 @itemx -mno-align-int
10366 @opindex malign-int
10367 @opindex mno-align-int
10368 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10369 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10370 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10371 Aligning variables on 32-bit boundaries produces code that runs somewhat
10372 faster on processors with 32-bit busses at the expense of more memory.
10373
10374 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
10375 align structures containing the above types  differently than
10376 most published application binary interface specifications for the m68k.
10377
10378 @item -mpcrel
10379 @opindex mpcrel
10380 Use the pc-relative addressing mode of the 68000 directly, instead of
10381 using a global offset table.  At present, this option implies @option{-fpic},
10382 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
10383 not presently supported with @option{-mpcrel}, though this could be supported for
10384 68020 and higher processors.
10385
10386 @item -mno-strict-align
10387 @itemx -mstrict-align
10388 @opindex mno-strict-align
10389 @opindex mstrict-align
10390 Do not (do) assume that unaligned memory references will be handled by
10391 the system.
10392
10393 @item -msep-data
10394 Generate code that allows the data segment to be located in a different
10395 area of memory from the text segment.  This allows for execute in place in
10396 an environment without virtual memory management.  This option implies
10397 @option{-fPIC}.
10398
10399 @item -mno-sep-data
10400 Generate code that assumes that the data segment follows the text segment.
10401 This is the default.
10402
10403 @item -mid-shared-library
10404 Generate code that supports shared libraries via the library ID method.
10405 This allows for execute in place and shared libraries in an environment
10406 without virtual memory management.  This option implies @option{-fPIC}.
10407
10408 @item -mno-id-shared-library
10409 Generate code that doesn't assume ID based shared libraries are being used.
10410 This is the default.
10411
10412 @item -mshared-library-id=n
10413 Specified the identification number of the ID based shared library being
10414 compiled.  Specifying a value of 0 will generate more compact code, specifying
10415 other values will force the allocation of that number to the current
10416 library but is no more space or time efficient than omitting this option.
10417
10418 @end table
10419
10420 @node M68hc1x Options
10421 @subsection M68hc1x Options
10422 @cindex M68hc1x options
10423
10424 These are the @samp{-m} options defined for the 68hc11 and 68hc12
10425 microcontrollers.  The default values for these options depends on
10426 which style of microcontroller was selected when the compiler was configured;
10427 the defaults for the most common choices are given below.
10428
10429 @table @gcctabopt
10430 @item -m6811
10431 @itemx -m68hc11
10432 @opindex m6811
10433 @opindex m68hc11
10434 Generate output for a 68HC11.  This is the default
10435 when the compiler is configured for 68HC11-based systems.
10436
10437 @item -m6812
10438 @itemx -m68hc12
10439 @opindex m6812
10440 @opindex m68hc12
10441 Generate output for a 68HC12.  This is the default
10442 when the compiler is configured for 68HC12-based systems.
10443
10444 @item -m68S12
10445 @itemx -m68hcs12
10446 @opindex m68S12
10447 @opindex m68hcs12
10448 Generate output for a 68HCS12.
10449
10450 @item -mauto-incdec
10451 @opindex mauto-incdec
10452 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
10453 addressing modes.
10454
10455 @item -minmax
10456 @itemx -nominmax
10457 @opindex minmax
10458 @opindex mnominmax
10459 Enable the use of 68HC12 min and max instructions.
10460
10461 @item -mlong-calls
10462 @itemx -mno-long-calls
10463 @opindex mlong-calls
10464 @opindex mno-long-calls
10465 Treat all calls as being far away (near).  If calls are assumed to be
10466 far away, the compiler will use the @code{call} instruction to
10467 call a function and the @code{rtc} instruction for returning.
10468
10469 @item -mshort
10470 @opindex mshort
10471 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10472
10473 @item -msoft-reg-count=@var{count}
10474 @opindex msoft-reg-count
10475 Specify the number of pseudo-soft registers which are used for the
10476 code generation.  The maximum number is 32.  Using more pseudo-soft
10477 register may or may not result in better code depending on the program.
10478 The default is 4 for 68HC11 and 2 for 68HC12.
10479
10480 @end table
10481
10482 @node MCore Options
10483 @subsection MCore Options
10484 @cindex MCore options
10485
10486 These are the @samp{-m} options defined for the Motorola M*Core
10487 processors.
10488
10489 @table @gcctabopt
10490
10491 @item -mhardlit
10492 @itemx -mno-hardlit
10493 @opindex mhardlit
10494 @opindex mno-hardlit
10495 Inline constants into the code stream if it can be done in two
10496 instructions or less.
10497
10498 @item -mdiv
10499 @itemx -mno-div
10500 @opindex mdiv
10501 @opindex mno-div
10502 Use the divide instruction.  (Enabled by default).
10503
10504 @item -mrelax-immediate
10505 @itemx -mno-relax-immediate
10506 @opindex mrelax-immediate
10507 @opindex mno-relax-immediate
10508 Allow arbitrary sized immediates in bit operations.
10509
10510 @item -mwide-bitfields
10511 @itemx -mno-wide-bitfields
10512 @opindex mwide-bitfields
10513 @opindex mno-wide-bitfields
10514 Always treat bit-fields as int-sized.
10515
10516 @item -m4byte-functions
10517 @itemx -mno-4byte-functions
10518 @opindex m4byte-functions
10519 @opindex mno-4byte-functions
10520 Force all functions to be aligned to a four byte boundary.
10521
10522 @item -mcallgraph-data
10523 @itemx -mno-callgraph-data
10524 @opindex mcallgraph-data
10525 @opindex mno-callgraph-data
10526 Emit callgraph information.
10527
10528 @item -mslow-bytes
10529 @itemx -mno-slow-bytes
10530 @opindex mslow-bytes
10531 @opindex mno-slow-bytes
10532 Prefer word access when reading byte quantities.
10533
10534 @item -mlittle-endian
10535 @itemx -mbig-endian
10536 @opindex mlittle-endian
10537 @opindex mbig-endian
10538 Generate code for a little endian target.
10539
10540 @item -m210
10541 @itemx -m340
10542 @opindex m210
10543 @opindex m340
10544 Generate code for the 210 processor.
10545 @end table
10546
10547 @node MIPS Options
10548 @subsection MIPS Options
10549 @cindex MIPS options
10550
10551 @table @gcctabopt
10552
10553 @item -EB
10554 @opindex EB
10555 Generate big-endian code.
10556
10557 @item -EL
10558 @opindex EL
10559 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
10560 configurations.
10561
10562 @item -march=@var{arch}
10563 @opindex march
10564 Generate code that will run on @var{arch}, which can be the name of a
10565 generic MIPS ISA, or the name of a particular processor.
10566 The ISA names are:
10567 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
10568 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
10569 The processor names are:
10570 @samp{4kc}, @samp{4km}, @samp{4kp},
10571 @samp{4kec}, @samp{4kem}, @samp{4kep},
10572 @samp{5kc}, @samp{5kf},
10573 @samp{20kc},
10574 @samp{24kc}, @samp{24kf}, @samp{24kx},
10575 @samp{24kec}, @samp{24kef}, @samp{24kex},
10576 @samp{34kc}, @samp{34kf}, @samp{34kx},
10577 @samp{m4k},
10578 @samp{orion},
10579 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
10580 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
10581 @samp{rm7000}, @samp{rm9000},
10582 @samp{sb1},
10583 @samp{sr71000},
10584 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
10585 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
10586 The special value @samp{from-abi} selects the
10587 most compatible architecture for the selected ABI (that is,
10588 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
10589
10590 In processor names, a final @samp{000} can be abbreviated as @samp{k}
10591 (for example, @samp{-march=r2k}).  Prefixes are optional, and
10592 @samp{vr} may be written @samp{r}.
10593
10594 GCC defines two macros based on the value of this option.  The first
10595 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
10596 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
10597 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
10598 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
10599 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
10600
10601 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
10602 above.  In other words, it will have the full prefix and will not
10603 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
10604 the macro names the resolved architecture (either @samp{"mips1"} or
10605 @samp{"mips3"}).  It names the default architecture when no
10606 @option{-march} option is given.
10607
10608 @item -mtune=@var{arch}
10609 @opindex mtune
10610 Optimize for @var{arch}.  Among other things, this option controls
10611 the way instructions are scheduled, and the perceived cost of arithmetic
10612 operations.  The list of @var{arch} values is the same as for
10613 @option{-march}.
10614
10615 When this option is not used, GCC will optimize for the processor
10616 specified by @option{-march}.  By using @option{-march} and
10617 @option{-mtune} together, it is possible to generate code that will
10618 run on a family of processors, but optimize the code for one
10619 particular member of that family.
10620
10621 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
10622 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
10623 @samp{-march} ones described above.
10624
10625 @item -mips1
10626 @opindex mips1
10627 Equivalent to @samp{-march=mips1}.
10628
10629 @item -mips2
10630 @opindex mips2
10631 Equivalent to @samp{-march=mips2}.
10632
10633 @item -mips3
10634 @opindex mips3
10635 Equivalent to @samp{-march=mips3}.
10636
10637 @item -mips4
10638 @opindex mips4
10639 Equivalent to @samp{-march=mips4}.
10640
10641 @item -mips32
10642 @opindex mips32
10643 Equivalent to @samp{-march=mips32}.
10644
10645 @item -mips32r2
10646 @opindex mips32r2
10647 Equivalent to @samp{-march=mips32r2}.
10648
10649 @item -mips64
10650 @opindex mips64
10651 Equivalent to @samp{-march=mips64}.
10652
10653 @item -mips16
10654 @itemx -mno-mips16
10655 @opindex mips16
10656 @opindex mno-mips16
10657 Generate (do not generate) MIPS16 code.  If GCC is targetting a
10658 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
10659
10660 @item -mabi=32
10661 @itemx -mabi=o64
10662 @itemx -mabi=n32
10663 @itemx -mabi=64
10664 @itemx -mabi=eabi
10665 @opindex mabi=32
10666 @opindex mabi=o64
10667 @opindex mabi=n32
10668 @opindex mabi=64
10669 @opindex mabi=eabi
10670 Generate code for the given ABI@.
10671
10672 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
10673 generates 64-bit code when you select a 64-bit architecture, but you
10674 can use @option{-mgp32} to get 32-bit code instead.
10675
10676 For information about the O64 ABI, see
10677 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
10678
10679 GCC supports a variant of the o32 ABI in which floating-point registers
10680 are 64 rather than 32 bits wide.  You can select this combination with
10681 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
10682 and @samp{mfhc1} instructions and is therefore only supported for
10683 MIPS32R2 processors.
10684
10685 The register assignments for arguments and return values remain the
10686 same, but each scalar value is passed in a single 64-bit register
10687 rather than a pair of 32-bit registers.  For example, scalar
10688 floating-point values are returned in @samp{$f0} only, not a
10689 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
10690 remains the same, but all 64 bits are saved.
10691
10692 @item -mabicalls
10693 @itemx -mno-abicalls
10694 @opindex mabicalls
10695 @opindex mno-abicalls
10696 Generate (do not generate) code that is suitable for SVR4-style
10697 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
10698 systems.
10699
10700 @item -mshared
10701 @itemx -mno-shared
10702 Generate (do not generate) code that is fully position-independent,
10703 and that can therefore be linked into shared libraries.  This option
10704 only affects @option{-mabicalls}.
10705
10706 All @option{-mabicalls} code has traditionally been position-independent,
10707 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
10708 as an extension, the GNU toolchain allows executables to use absolute
10709 accesses for locally-binding symbols.  It can also use shorter GP
10710 initialization sequences and generate direct calls to locally-defined
10711 functions.  This mode is selected by @option{-mno-shared}.
10712
10713 @option{-mno-shared} depends on binutils 2.16 or higher and generates
10714 objects that can only be linked by the GNU linker.  However, the option
10715 does not affect the ABI of the final executable; it only affects the ABI
10716 of relocatable objects.  Using @option{-mno-shared} will generally make
10717 executables both smaller and quicker.
10718
10719 @option{-mshared} is the default.
10720
10721 @item -mxgot
10722 @itemx -mno-xgot
10723 @opindex mxgot
10724 @opindex mno-xgot
10725 Lift (do not lift) the usual restrictions on the size of the global
10726 offset table.
10727
10728 GCC normally uses a single instruction to load values from the GOT@.
10729 While this is relatively efficient, it will only work if the GOT
10730 is smaller than about 64k.  Anything larger will cause the linker
10731 to report an error such as:
10732
10733 @cindex relocation truncated to fit (MIPS)
10734 @smallexample
10735 relocation truncated to fit: R_MIPS_GOT16 foobar
10736 @end smallexample
10737
10738 If this happens, you should recompile your code with @option{-mxgot}.
10739 It should then work with very large GOTs, although it will also be
10740 less efficient, since it will take three instructions to fetch the
10741 value of a global symbol.
10742
10743 Note that some linkers can create multiple GOTs.  If you have such a
10744 linker, you should only need to use @option{-mxgot} when a single object
10745 file accesses more than 64k's worth of GOT entries.  Very few do.
10746
10747 These options have no effect unless GCC is generating position
10748 independent code.
10749
10750 @item -mgp32
10751 @opindex mgp32
10752 Assume that general-purpose registers are 32 bits wide.
10753
10754 @item -mgp64
10755 @opindex mgp64
10756 Assume that general-purpose registers are 64 bits wide.
10757
10758 @item -mfp32
10759 @opindex mfp32
10760 Assume that floating-point registers are 32 bits wide.
10761
10762 @item -mfp64
10763 @opindex mfp64
10764 Assume that floating-point registers are 64 bits wide.
10765
10766 @item -mhard-float
10767 @opindex mhard-float
10768 Use floating-point coprocessor instructions.
10769
10770 @item -msoft-float
10771 @opindex msoft-float
10772 Do not use floating-point coprocessor instructions.  Implement
10773 floating-point calculations using library calls instead.
10774
10775 @item -msingle-float
10776 @opindex msingle-float
10777 Assume that the floating-point coprocessor only supports single-precision
10778 operations.
10779
10780 @itemx -mdouble-float
10781 @opindex mdouble-float
10782 Assume that the floating-point coprocessor supports double-precision
10783 operations.  This is the default.
10784
10785 @itemx -mdsp
10786 @itemx -mno-dsp
10787 @opindex mdsp
10788 @opindex mno-dsp
10789 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
10790
10791 @itemx -mpaired-single
10792 @itemx -mno-paired-single
10793 @opindex mpaired-single
10794 @opindex mno-paired-single
10795 Use (do not use) paired-single floating-point instructions.
10796 @xref{MIPS Paired-Single Support}.  This option can only be used
10797 when generating 64-bit code and requires hardware floating-point
10798 support to be enabled.
10799
10800 @itemx -mips3d
10801 @itemx -mno-mips3d
10802 @opindex mips3d
10803 @opindex mno-mips3d
10804 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
10805 The option @option{-mips3d} implies @option{-mpaired-single}.
10806
10807 @item -mlong64
10808 @opindex mlong64
10809 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
10810 an explanation of the default and the way that the pointer size is
10811 determined.
10812
10813 @item -mlong32
10814 @opindex mlong32
10815 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
10816
10817 The default size of @code{int}s, @code{long}s and pointers depends on
10818 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
10819 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
10820 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
10821 or the same size as integer registers, whichever is smaller.
10822
10823 @item -msym32
10824 @itemx -mno-sym32
10825 @opindex msym32
10826 @opindex mno-sym32
10827 Assume (do not assume) that all symbols have 32-bit values, regardless
10828 of the selected ABI@.  This option is useful in combination with
10829 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
10830 to generate shorter and faster references to symbolic addresses.
10831
10832 @item -G @var{num}
10833 @opindex G
10834 @cindex smaller data references (MIPS)
10835 @cindex gp-relative references (MIPS)
10836 Put global and static items less than or equal to @var{num} bytes into
10837 the small data or bss section instead of the normal data or bss section.
10838 This allows the data to be accessed using a single instruction.
10839
10840 All modules should be compiled with the same @option{-G @var{num}}
10841 value.
10842
10843 @item -membedded-data
10844 @itemx -mno-embedded-data
10845 @opindex membedded-data
10846 @opindex mno-embedded-data
10847 Allocate variables to the read-only data section first if possible, then
10848 next in the small data section if possible, otherwise in data.  This gives
10849 slightly slower code than the default, but reduces the amount of RAM required
10850 when executing, and thus may be preferred for some embedded systems.
10851
10852 @item -muninit-const-in-rodata
10853 @itemx -mno-uninit-const-in-rodata
10854 @opindex muninit-const-in-rodata
10855 @opindex mno-uninit-const-in-rodata
10856 Put uninitialized @code{const} variables in the read-only data section.
10857 This option is only meaningful in conjunction with @option{-membedded-data}.
10858
10859 @item -msplit-addresses
10860 @itemx -mno-split-addresses
10861 @opindex msplit-addresses
10862 @opindex mno-split-addresses
10863 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
10864 relocation operators.  This option has been superseded by
10865 @option{-mexplicit-relocs} but is retained for backwards compatibility.
10866
10867 @item -mexplicit-relocs
10868 @itemx -mno-explicit-relocs
10869 @opindex mexplicit-relocs
10870 @opindex mno-explicit-relocs
10871 Use (do not use) assembler relocation operators when dealing with symbolic
10872 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
10873 is to use assembler macros instead.
10874
10875 @option{-mexplicit-relocs} is the default if GCC was configured
10876 to use an assembler that supports relocation operators.
10877
10878 @item -mcheck-zero-division
10879 @itemx -mno-check-zero-division
10880 @opindex mcheck-zero-division
10881 @opindex mno-check-zero-division
10882 Trap (do not trap) on integer division by zero.  The default is
10883 @option{-mcheck-zero-division}.
10884
10885 @item -mdivide-traps
10886 @itemx -mdivide-breaks
10887 @opindex mdivide-traps
10888 @opindex mdivide-breaks
10889 MIPS systems check for division by zero by generating either a
10890 conditional trap or a break instruction.  Using traps results in
10891 smaller code, but is only supported on MIPS II and later.  Also, some
10892 versions of the Linux kernel have a bug that prevents trap from
10893 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
10894 allow conditional traps on architectures that support them and
10895 @option{-mdivide-breaks} to force the use of breaks.
10896
10897 The default is usually @option{-mdivide-traps}, but this can be
10898 overridden at configure time using @option{--with-divide=breaks}.
10899 Divide-by-zero checks can be completely disabled using
10900 @option{-mno-check-zero-division}.
10901
10902 @item -mmemcpy
10903 @itemx -mno-memcpy
10904 @opindex mmemcpy
10905 @opindex mno-memcpy
10906 Force (do not force) the use of @code{memcpy()} for non-trivial block
10907 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
10908 most constant-sized copies.
10909
10910 @item -mlong-calls
10911 @itemx -mno-long-calls
10912 @opindex mlong-calls
10913 @opindex mno-long-calls
10914 Disable (do not disable) use of the @code{jal} instruction.  Calling
10915 functions using @code{jal} is more efficient but requires the caller
10916 and callee to be in the same 256 megabyte segment.
10917
10918 This option has no effect on abicalls code.  The default is
10919 @option{-mno-long-calls}.
10920
10921 @item -mmad
10922 @itemx -mno-mad
10923 @opindex mmad
10924 @opindex mno-mad
10925 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
10926 instructions, as provided by the R4650 ISA@.
10927
10928 @item -mfused-madd
10929 @itemx -mno-fused-madd
10930 @opindex mfused-madd
10931 @opindex mno-fused-madd
10932 Enable (disable) use of the floating point multiply-accumulate
10933 instructions, when they are available.  The default is
10934 @option{-mfused-madd}.
10935
10936 When multiply-accumulate instructions are used, the intermediate
10937 product is calculated to infinite precision and is not subject to
10938 the FCSR Flush to Zero bit.  This may be undesirable in some
10939 circumstances.
10940
10941 @item -nocpp
10942 @opindex nocpp
10943 Tell the MIPS assembler to not run its preprocessor over user
10944 assembler files (with a @samp{.s} suffix) when assembling them.
10945
10946 @item -mfix-r4000
10947 @itemx -mno-fix-r4000
10948 @opindex mfix-r4000
10949 @opindex mno-fix-r4000
10950 Work around certain R4000 CPU errata:
10951 @itemize @minus
10952 @item
10953 A double-word or a variable shift may give an incorrect result if executed
10954 immediately after starting an integer division.
10955 @item
10956 A double-word or a variable shift may give an incorrect result if executed
10957 while an integer multiplication is in progress.
10958 @item
10959 An integer division may give an incorrect result if started in a delay slot
10960 of a taken branch or a jump.
10961 @end itemize
10962
10963 @item -mfix-r4400
10964 @itemx -mno-fix-r4400
10965 @opindex mfix-r4400
10966 @opindex mno-fix-r4400
10967 Work around certain R4400 CPU errata:
10968 @itemize @minus
10969 @item
10970 A double-word or a variable shift may give an incorrect result if executed
10971 immediately after starting an integer division.
10972 @end itemize
10973
10974 @item -mfix-vr4120
10975 @itemx -mno-fix-vr4120
10976 @opindex mfix-vr4120
10977 Work around certain VR4120 errata:
10978 @itemize @minus
10979 @item
10980 @code{dmultu} does not always produce the correct result.
10981 @item
10982 @code{div} and @code{ddiv} do not always produce the correct result if one
10983 of the operands is negative.
10984 @end itemize
10985 The workarounds for the division errata rely on special functions in
10986 @file{libgcc.a}.  At present, these functions are only provided by
10987 the @code{mips64vr*-elf} configurations.
10988
10989 Other VR4120 errata require a nop to be inserted between certain pairs of
10990 instructions.  These errata are handled by the assembler, not by GCC itself.
10991
10992 @item -mfix-vr4130
10993 @opindex mfix-vr4130
10994 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
10995 workarounds are implemented by the assembler rather than by GCC,
10996 although GCC will avoid using @code{mflo} and @code{mfhi} if the
10997 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
10998 instructions are available instead.
10999
11000 @item -mfix-sb1
11001 @itemx -mno-fix-sb1
11002 @opindex mfix-sb1
11003 Work around certain SB-1 CPU core errata.
11004 (This flag currently works around the SB-1 revision 2
11005 ``F1'' and ``F2'' floating point errata.)
11006
11007 @item -mflush-func=@var{func}
11008 @itemx -mno-flush-func
11009 @opindex mflush-func
11010 Specifies the function to call to flush the I and D caches, or to not
11011 call any such function.  If called, the function must take the same
11012 arguments as the common @code{_flush_func()}, that is, the address of the
11013 memory range for which the cache is being flushed, the size of the
11014 memory range, and the number 3 (to flush both caches).  The default
11015 depends on the target GCC was configured for, but commonly is either
11016 @samp{_flush_func} or @samp{__cpu_flush}.
11017
11018 @item -mbranch-likely
11019 @itemx -mno-branch-likely
11020 @opindex mbranch-likely
11021 @opindex mno-branch-likely
11022 Enable or disable use of Branch Likely instructions, regardless of the
11023 default for the selected architecture.  By default, Branch Likely
11024 instructions may be generated if they are supported by the selected
11025 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11026 and processors which implement those architectures; for those, Branch
11027 Likely instructions will not be generated by default because the MIPS32
11028 and MIPS64 architectures specifically deprecate their use.
11029
11030 @item -mfp-exceptions
11031 @itemx -mno-fp-exceptions
11032 @opindex mfp-exceptions
11033 Specifies whether FP exceptions are enabled.  This affects how we schedule
11034 FP instructions for some processors.  The default is that FP exceptions are
11035 enabled.
11036
11037 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11038 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11039 FP pipe.
11040
11041 @item -mvr4130-align
11042 @itemx -mno-vr4130-align
11043 @opindex mvr4130-align
11044 The VR4130 pipeline is two-way superscalar, but can only issue two
11045 instructions together if the first one is 8-byte aligned.  When this
11046 option is enabled, GCC will align pairs of instructions that it
11047 thinks should execute in parallel.
11048
11049 This option only has an effect when optimizing for the VR4130.
11050 It normally makes code faster, but at the expense of making it bigger.
11051 It is enabled by default at optimization level @option{-O3}.
11052 @end table
11053
11054 @node MMIX Options
11055 @subsection MMIX Options
11056 @cindex MMIX Options
11057
11058 These options are defined for the MMIX:
11059
11060 @table @gcctabopt
11061 @item -mlibfuncs
11062 @itemx -mno-libfuncs
11063 @opindex mlibfuncs
11064 @opindex mno-libfuncs
11065 Specify that intrinsic library functions are being compiled, passing all
11066 values in registers, no matter the size.
11067
11068 @item -mepsilon
11069 @itemx -mno-epsilon
11070 @opindex mepsilon
11071 @opindex mno-epsilon
11072 Generate floating-point comparison instructions that compare with respect
11073 to the @code{rE} epsilon register.
11074
11075 @item -mabi=mmixware
11076 @itemx -mabi=gnu
11077 @opindex mabi-mmixware
11078 @opindex mabi=gnu
11079 Generate code that passes function parameters and return values that (in
11080 the called function) are seen as registers @code{$0} and up, as opposed to
11081 the GNU ABI which uses global registers @code{$231} and up.
11082
11083 @item -mzero-extend
11084 @itemx -mno-zero-extend
11085 @opindex mzero-extend
11086 @opindex mno-zero-extend
11087 When reading data from memory in sizes shorter than 64 bits, use (do not
11088 use) zero-extending load instructions by default, rather than
11089 sign-extending ones.
11090
11091 @item -mknuthdiv
11092 @itemx -mno-knuthdiv
11093 @opindex mknuthdiv
11094 @opindex mno-knuthdiv
11095 Make the result of a division yielding a remainder have the same sign as
11096 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11097 remainder follows the sign of the dividend.  Both methods are
11098 arithmetically valid, the latter being almost exclusively used.
11099
11100 @item -mtoplevel-symbols
11101 @itemx -mno-toplevel-symbols
11102 @opindex mtoplevel-symbols
11103 @opindex mno-toplevel-symbols
11104 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11105 code can be used with the @code{PREFIX} assembly directive.
11106
11107 @item -melf
11108 @opindex melf
11109 Generate an executable in the ELF format, rather than the default
11110 @samp{mmo} format used by the @command{mmix} simulator.
11111
11112 @item -mbranch-predict
11113 @itemx -mno-branch-predict
11114 @opindex mbranch-predict
11115 @opindex mno-branch-predict
11116 Use (do not use) the probable-branch instructions, when static branch
11117 prediction indicates a probable branch.
11118
11119 @item -mbase-addresses
11120 @itemx -mno-base-addresses
11121 @opindex mbase-addresses
11122 @opindex mno-base-addresses
11123 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11124 base address automatically generates a request (handled by the assembler
11125 and the linker) for a constant to be set up in a global register.  The
11126 register is used for one or more base address requests within the range 0
11127 to 255 from the value held in the register.  The generally leads to short
11128 and fast code, but the number of different data items that can be
11129 addressed is limited.  This means that a program that uses lots of static
11130 data may require @option{-mno-base-addresses}.
11131
11132 @item -msingle-exit
11133 @itemx -mno-single-exit
11134 @opindex msingle-exit
11135 @opindex mno-single-exit
11136 Force (do not force) generated code to have a single exit point in each
11137 function.
11138 @end table
11139
11140 @node MN10300 Options
11141 @subsection MN10300 Options
11142 @cindex MN10300 options
11143
11144 These @option{-m} options are defined for Matsushita MN10300 architectures:
11145
11146 @table @gcctabopt
11147 @item -mmult-bug
11148 @opindex mmult-bug
11149 Generate code to avoid bugs in the multiply instructions for the MN10300
11150 processors.  This is the default.
11151
11152 @item -mno-mult-bug
11153 @opindex mno-mult-bug
11154 Do not generate code to avoid bugs in the multiply instructions for the
11155 MN10300 processors.
11156
11157 @item -mam33
11158 @opindex mam33
11159 Generate code which uses features specific to the AM33 processor.
11160
11161 @item -mno-am33
11162 @opindex mno-am33
11163 Do not generate code which uses features specific to the AM33 processor.  This
11164 is the default.
11165
11166 @item -mreturn-pointer-on-d0
11167 @opindex mreturn-pointer-on-d0
11168 When generating a function which returns a pointer, return the pointer
11169 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11170 only in a0, and attempts to call such functions without a prototype
11171 would result in errors.  Note that this option is on by default; use
11172 @option{-mno-return-pointer-on-d0} to disable it.
11173
11174 @item -mno-crt0
11175 @opindex mno-crt0
11176 Do not link in the C run-time initialization object file.
11177
11178 @item -mrelax
11179 @opindex mrelax
11180 Indicate to the linker that it should perform a relaxation optimization pass
11181 to shorten branches, calls and absolute memory addresses.  This option only
11182 has an effect when used on the command line for the final link step.
11183
11184 This option makes symbolic debugging impossible.
11185 @end table
11186
11187 @node MT Options
11188 @subsection MT Options
11189 @cindex MT options
11190
11191 These @option{-m} options are defined for Morpho MT architectures:
11192
11193 @table @gcctabopt
11194
11195 @item -march=@var{cpu-type}
11196 @opindex march
11197 Generate code that will run on @var{cpu-type}, which is the name of a system
11198 representing a certain processor type.  Possible values for
11199 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
11200 @samp{ms1-16-003} and @samp{ms2}.
11201
11202 When this option is not used, the default is @option{-march=ms1-16-002}.
11203
11204 @item -mbacc
11205 @opindex mbacc
11206 Use byte loads and stores when generating code.
11207
11208 @item -mno-bacc
11209 @opindex mno-bacc
11210 Do not use byte loads and stores when generating code.
11211
11212 @item -msim
11213 @opindex msim
11214 Use simulator runtime
11215
11216 @item -mno-crt0
11217 @opindex mno-crt0
11218 Do not link in the C run-time initialization object file
11219 @file{crti.o}.  Other run-time initialization and termination files
11220 such as @file{startup.o} and @file{exit.o} are still included on the
11221 linker command line.
11222
11223 @end table
11224
11225 @node PDP-11 Options
11226 @subsection PDP-11 Options
11227 @cindex PDP-11 Options
11228
11229 These options are defined for the PDP-11:
11230
11231 @table @gcctabopt
11232 @item -mfpu
11233 @opindex mfpu
11234 Use hardware FPP floating point.  This is the default.  (FIS floating
11235 point on the PDP-11/40 is not supported.)
11236
11237 @item -msoft-float
11238 @opindex msoft-float
11239 Do not use hardware floating point.
11240
11241 @item -mac0
11242 @opindex mac0
11243 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
11244
11245 @item -mno-ac0
11246 @opindex mno-ac0
11247 Return floating-point results in memory.  This is the default.
11248
11249 @item -m40
11250 @opindex m40
11251 Generate code for a PDP-11/40.
11252
11253 @item -m45
11254 @opindex m45
11255 Generate code for a PDP-11/45.  This is the default.
11256
11257 @item -m10
11258 @opindex m10
11259 Generate code for a PDP-11/10.
11260
11261 @item -mbcopy-builtin
11262 @opindex bcopy-builtin
11263 Use inline @code{movmemhi} patterns for copying memory.  This is the
11264 default.
11265
11266 @item -mbcopy
11267 @opindex mbcopy
11268 Do not use inline @code{movmemhi} patterns for copying memory.
11269
11270 @item -mint16
11271 @itemx -mno-int32
11272 @opindex mint16
11273 @opindex mno-int32
11274 Use 16-bit @code{int}.  This is the default.
11275
11276 @item -mint32
11277 @itemx -mno-int16
11278 @opindex mint32
11279 @opindex mno-int16
11280 Use 32-bit @code{int}.
11281
11282 @item -mfloat64
11283 @itemx -mno-float32
11284 @opindex mfloat64
11285 @opindex mno-float32
11286 Use 64-bit @code{float}.  This is the default.
11287
11288 @item -mfloat32
11289 @itemx -mno-float64
11290 @opindex mfloat32
11291 @opindex mno-float64
11292 Use 32-bit @code{float}.
11293
11294 @item -mabshi
11295 @opindex mabshi
11296 Use @code{abshi2} pattern.  This is the default.
11297
11298 @item -mno-abshi
11299 @opindex mno-abshi
11300 Do not use @code{abshi2} pattern.
11301
11302 @item -mbranch-expensive
11303 @opindex mbranch-expensive
11304 Pretend that branches are expensive.  This is for experimenting with
11305 code generation only.
11306
11307 @item -mbranch-cheap
11308 @opindex mbranch-cheap
11309 Do not pretend that branches are expensive.  This is the default.
11310
11311 @item -msplit
11312 @opindex msplit
11313 Generate code for a system with split I&D@.
11314
11315 @item -mno-split
11316 @opindex mno-split
11317 Generate code for a system without split I&D@.  This is the default.
11318
11319 @item -munix-asm
11320 @opindex munix-asm
11321 Use Unix assembler syntax.  This is the default when configured for
11322 @samp{pdp11-*-bsd}.
11323
11324 @item -mdec-asm
11325 @opindex mdec-asm
11326 Use DEC assembler syntax.  This is the default when configured for any
11327 PDP-11 target other than @samp{pdp11-*-bsd}.
11328 @end table
11329
11330 @node PowerPC Options
11331 @subsection PowerPC Options
11332 @cindex PowerPC options
11333
11334 These are listed under @xref{RS/6000 and PowerPC Options}.
11335
11336 @node RS/6000 and PowerPC Options
11337 @subsection IBM RS/6000 and PowerPC Options
11338 @cindex RS/6000 and PowerPC Options
11339 @cindex IBM RS/6000 and PowerPC Options
11340
11341 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11342 @table @gcctabopt
11343 @item -mpower
11344 @itemx -mno-power
11345 @itemx -mpower2
11346 @itemx -mno-power2
11347 @itemx -mpowerpc
11348 @itemx -mno-powerpc
11349 @itemx -mpowerpc-gpopt
11350 @itemx -mno-powerpc-gpopt
11351 @itemx -mpowerpc-gfxopt
11352 @itemx -mno-powerpc-gfxopt
11353 @itemx -mpowerpc64
11354 @itemx -mno-powerpc64
11355 @itemx -mmfcrf
11356 @itemx -mno-mfcrf
11357 @itemx -mpopcntb
11358 @itemx -mno-popcntb
11359 @itemx -mfprnd
11360 @itemx -mno-fprnd
11361 @itemx -mmfpgpr
11362 @itemx -mno-mfpgpr
11363 @opindex mpower
11364 @opindex mno-power
11365 @opindex mpower2
11366 @opindex mno-power2
11367 @opindex mpowerpc
11368 @opindex mno-powerpc
11369 @opindex mpowerpc-gpopt
11370 @opindex mno-powerpc-gpopt
11371 @opindex mpowerpc-gfxopt
11372 @opindex mno-powerpc-gfxopt
11373 @opindex mpowerpc64
11374 @opindex mno-powerpc64
11375 @opindex mmfcrf
11376 @opindex mno-mfcrf
11377 @opindex mpopcntb
11378 @opindex mno-popcntb
11379 @opindex mfprnd
11380 @opindex mno-fprnd
11381 @opindex mmfpgpr
11382 @opindex mno-mfpgpr
11383 GCC supports two related instruction set architectures for the
11384 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
11385 instructions supported by the @samp{rios} chip set used in the original
11386 RS/6000 systems and the @dfn{PowerPC} instruction set is the
11387 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
11388 the IBM 4xx, 6xx, and follow-on microprocessors.
11389
11390 Neither architecture is a subset of the other.  However there is a
11391 large common subset of instructions supported by both.  An MQ
11392 register is included in processors supporting the POWER architecture.
11393
11394 You use these options to specify which instructions are available on the
11395 processor you are using.  The default value of these options is
11396 determined when configuring GCC@.  Specifying the
11397 @option{-mcpu=@var{cpu_type}} overrides the specification of these
11398 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
11399 rather than the options listed above.
11400
11401 The @option{-mpower} option allows GCC to generate instructions that
11402 are found only in the POWER architecture and to use the MQ register.
11403 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
11404 to generate instructions that are present in the POWER2 architecture but
11405 not the original POWER architecture.
11406
11407 The @option{-mpowerpc} option allows GCC to generate instructions that
11408 are found only in the 32-bit subset of the PowerPC architecture.
11409 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
11410 GCC to use the optional PowerPC architecture instructions in the
11411 General Purpose group, including floating-point square root.  Specifying
11412 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
11413 use the optional PowerPC architecture instructions in the Graphics
11414 group, including floating-point select.
11415
11416 The @option{-mmfcrf} option allows GCC to generate the move from
11417 condition register field instruction implemented on the POWER4
11418 processor and other processors that support the PowerPC V2.01
11419 architecture.
11420 The @option{-mpopcntb} option allows GCC to generate the popcount and
11421 double precision FP reciprocal estimate instruction implemented on the
11422 POWER5 processor and other processors that support the PowerPC V2.02
11423 architecture.
11424 The @option{-mfprnd} option allows GCC to generate the FP round to
11425 integer instructions implemented on the POWER5+ processor and other
11426 processors that support the PowerPC V2.03 architecture.
11427 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
11428 general purpose register instructions implemented on the POWER6X
11429 processor and other processors that support the extended PowerPC V2.05
11430 architecture.
11431
11432 The @option{-mpowerpc64} option allows GCC to generate the additional
11433 64-bit instructions that are found in the full PowerPC64 architecture
11434 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
11435 @option{-mno-powerpc64}.
11436
11437 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
11438 will use only the instructions in the common subset of both
11439 architectures plus some special AIX common-mode calls, and will not use
11440 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
11441 permits GCC to use any instruction from either architecture and to
11442 allow use of the MQ register; specify this for the Motorola MPC601.
11443
11444 @item -mnew-mnemonics
11445 @itemx -mold-mnemonics
11446 @opindex mnew-mnemonics
11447 @opindex mold-mnemonics
11448 Select which mnemonics to use in the generated assembler code.  With
11449 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
11450 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
11451 assembler mnemonics defined for the POWER architecture.  Instructions
11452 defined in only one architecture have only one mnemonic; GCC uses that
11453 mnemonic irrespective of which of these options is specified.
11454
11455 GCC defaults to the mnemonics appropriate for the architecture in
11456 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
11457 value of these option.  Unless you are building a cross-compiler, you
11458 should normally not specify either @option{-mnew-mnemonics} or
11459 @option{-mold-mnemonics}, but should instead accept the default.
11460
11461 @item -mcpu=@var{cpu_type}
11462 @opindex mcpu
11463 Set architecture type, register usage, choice of mnemonics, and
11464 instruction scheduling parameters for machine type @var{cpu_type}.
11465 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
11466 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
11467 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
11468 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
11469 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
11470 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
11471 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
11472 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
11473 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
11474 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
11475
11476 @option{-mcpu=common} selects a completely generic processor.  Code
11477 generated under this option will run on any POWER or PowerPC processor.
11478 GCC will use only the instructions in the common subset of both
11479 architectures, and will not use the MQ register.  GCC assumes a generic
11480 processor model for scheduling purposes.
11481
11482 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
11483 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
11484 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
11485 types, with an appropriate, generic processor model assumed for
11486 scheduling purposes.
11487
11488 The other options specify a specific processor.  Code generated under
11489 those options will run best on that processor, and may not run at all on
11490 others.
11491
11492 The @option{-mcpu} options automatically enable or disable the
11493 following options: @option{-maltivec}, @option{-mfprnd},
11494 @option{-mhard-float}, @option{-mmfcrf}, @option{-mmultiple},
11495 @option{-mnew-mnemonics}, @option{-mpopcntb}, @option{-mpower},
11496 @option{-mpower2}, @option{-mpowerpc64}, @option{-mpowerpc-gpopt},
11497 @option{-mpowerpc-gfxopt}, @option{-mstring}, @option{-mmulhw},
11498 @option{-mdlmzb}, @option{-mmfpgpr}.
11499 The particular options set for any particular CPU will vary between
11500 compiler versions, depending on what setting seems to produce optimal
11501 code for that CPU; it doesn't necessarily reflect the actual hardware's
11502 capabilities.  If you wish to set an individual option to a particular
11503 value, you may specify it after the @option{-mcpu} option, like
11504 @samp{-mcpu=970 -mno-altivec}.
11505
11506 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
11507 not enabled or disabled by the @option{-mcpu} option at present because
11508 AIX does not have full support for these options.  You may still
11509 enable or disable them individually if you're sure it'll work in your
11510 environment.
11511
11512 @item -mtune=@var{cpu_type}
11513 @opindex mtune
11514 Set the instruction scheduling parameters for machine type
11515 @var{cpu_type}, but do not set the architecture type, register usage, or
11516 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
11517 values for @var{cpu_type} are used for @option{-mtune} as for
11518 @option{-mcpu}.  If both are specified, the code generated will use the
11519 architecture, registers, and mnemonics set by @option{-mcpu}, but the
11520 scheduling parameters set by @option{-mtune}.
11521
11522 @item -mswdiv
11523 @itemx -mno-swdiv
11524 @opindex mswdiv
11525 @opindex mno-swdiv
11526 Generate code to compute division as reciprocal estimate and iterative
11527 refinement, creating opportunities for increased throughput.  This
11528 feature requires: optional PowerPC Graphics instruction set for single
11529 precision and FRE instruction for double precision, assuming divides
11530 cannot generate user-visible traps, and the domain values not include
11531 Infinities, denormals or zero denominator.
11532
11533 @item -maltivec
11534 @itemx -mno-altivec
11535 @opindex maltivec
11536 @opindex mno-altivec
11537 Generate code that uses (does not use) AltiVec instructions, and also
11538 enable the use of built-in functions that allow more direct access to
11539 the AltiVec instruction set.  You may also need to set
11540 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
11541 enhancements.
11542
11543 @item -mvrsave
11544 @item -mno-vrsave
11545 @opindex mvrsave
11546 @opindex mno-vrsave
11547 Generate VRSAVE instructions when generating AltiVec code.
11548
11549 @item -msecure-plt
11550 @opindex msecure-plt
11551 Generate code that allows ld and ld.so to build executables and shared
11552 libraries with non-exec .plt and .got sections.  This is a PowerPC
11553 32-bit SYSV ABI option.
11554
11555 @item -mbss-plt
11556 @opindex mbss-plt
11557 Generate code that uses a BSS .plt section that ld.so fills in, and
11558 requires .plt and .got sections that are both writable and executable.
11559 This is a PowerPC 32-bit SYSV ABI option.
11560
11561 @item -misel
11562 @itemx -mno-isel
11563 @opindex misel
11564 @opindex mno-isel
11565 This switch enables or disables the generation of ISEL instructions.
11566
11567 @item -misel=@var{yes/no}
11568 This switch has been deprecated.  Use @option{-misel} and
11569 @option{-mno-isel} instead.
11570
11571 @item -mspe
11572 @itemx -mno-spe
11573 @opindex mspe
11574 @opindex mno-spe
11575 This switch enables or disables the generation of SPE simd
11576 instructions.
11577
11578 @item -mspe=@var{yes/no}
11579 This option has been deprecated.  Use @option{-mspe} and
11580 @option{-mno-spe} instead.
11581
11582 @item -mfloat-gprs=@var{yes/single/double/no}
11583 @itemx -mfloat-gprs
11584 @opindex mfloat-gprs
11585 This switch enables or disables the generation of floating point
11586 operations on the general purpose registers for architectures that
11587 support it.
11588
11589 The argument @var{yes} or @var{single} enables the use of
11590 single-precision floating point operations.
11591
11592 The argument @var{double} enables the use of single and
11593 double-precision floating point operations.
11594
11595 The argument @var{no} disables floating point operations on the
11596 general purpose registers.
11597
11598 This option is currently only available on the MPC854x.
11599
11600 @item -m32
11601 @itemx -m64
11602 @opindex m32
11603 @opindex m64
11604 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
11605 targets (including GNU/Linux).  The 32-bit environment sets int, long
11606 and pointer to 32 bits and generates code that runs on any PowerPC
11607 variant.  The 64-bit environment sets int to 32 bits and long and
11608 pointer to 64 bits, and generates code for PowerPC64, as for
11609 @option{-mpowerpc64}.
11610
11611 @item -mfull-toc
11612 @itemx -mno-fp-in-toc
11613 @itemx -mno-sum-in-toc
11614 @itemx -mminimal-toc
11615 @opindex mfull-toc
11616 @opindex mno-fp-in-toc
11617 @opindex mno-sum-in-toc
11618 @opindex mminimal-toc
11619 Modify generation of the TOC (Table Of Contents), which is created for
11620 every executable file.  The @option{-mfull-toc} option is selected by
11621 default.  In that case, GCC will allocate at least one TOC entry for
11622 each unique non-automatic variable reference in your program.  GCC
11623 will also place floating-point constants in the TOC@.  However, only
11624 16,384 entries are available in the TOC@.
11625
11626 If you receive a linker error message that saying you have overflowed
11627 the available TOC space, you can reduce the amount of TOC space used
11628 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
11629 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
11630 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
11631 generate code to calculate the sum of an address and a constant at
11632 run-time instead of putting that sum into the TOC@.  You may specify one
11633 or both of these options.  Each causes GCC to produce very slightly
11634 slower and larger code at the expense of conserving TOC space.
11635
11636 If you still run out of space in the TOC even when you specify both of
11637 these options, specify @option{-mminimal-toc} instead.  This option causes
11638 GCC to make only one TOC entry for every file.  When you specify this
11639 option, GCC will produce code that is slower and larger but which
11640 uses extremely little TOC space.  You may wish to use this option
11641 only on files that contain less frequently executed code.
11642
11643 @item -maix64
11644 @itemx -maix32
11645 @opindex maix64
11646 @opindex maix32
11647 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
11648 @code{long} type, and the infrastructure needed to support them.
11649 Specifying @option{-maix64} implies @option{-mpowerpc64} and
11650 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
11651 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
11652
11653 @item -mxl-compat
11654 @itemx -mno-xl-compat
11655 @opindex mxl-compat
11656 @opindex mno-xl-compat
11657 Produce code that conforms more closely to IBM XL compiler semantics
11658 when using AIX-compatible ABI.  Pass floating-point arguments to
11659 prototyped functions beyond the register save area (RSA) on the stack
11660 in addition to argument FPRs.  Do not assume that most significant
11661 double in 128-bit long double value is properly rounded when comparing
11662 values and converting to double.  Use XL symbol names for long double
11663 support routines.
11664
11665 The AIX calling convention was extended but not initially documented to
11666 handle an obscure K&R C case of calling a function that takes the
11667 address of its arguments with fewer arguments than declared.  IBM XL
11668 compilers access floating point arguments which do not fit in the
11669 RSA from the stack when a subroutine is compiled without
11670 optimization.  Because always storing floating-point arguments on the
11671 stack is inefficient and rarely needed, this option is not enabled by
11672 default and only is necessary when calling subroutines compiled by IBM
11673 XL compilers without optimization.
11674
11675 @item -mpe
11676 @opindex mpe
11677 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
11678 application written to use message passing with special startup code to
11679 enable the application to run.  The system must have PE installed in the
11680 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
11681 must be overridden with the @option{-specs=} option to specify the
11682 appropriate directory location.  The Parallel Environment does not
11683 support threads, so the @option{-mpe} option and the @option{-pthread}
11684 option are incompatible.
11685
11686 @item -malign-natural
11687 @itemx -malign-power
11688 @opindex malign-natural
11689 @opindex malign-power
11690 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
11691 @option{-malign-natural} overrides the ABI-defined alignment of larger
11692 types, such as floating-point doubles, on their natural size-based boundary.
11693 The option @option{-malign-power} instructs GCC to follow the ABI-specified
11694 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
11695
11696 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
11697 is not supported.
11698
11699 @item -msoft-float
11700 @itemx -mhard-float
11701 @opindex msoft-float
11702 @opindex mhard-float
11703 Generate code that does not use (uses) the floating-point register set.
11704 Software floating point emulation is provided if you use the
11705 @option{-msoft-float} option, and pass the option to GCC when linking.
11706
11707 @item -mmultiple
11708 @itemx -mno-multiple
11709 @opindex mmultiple
11710 @opindex mno-multiple
11711 Generate code that uses (does not use) the load multiple word
11712 instructions and the store multiple word instructions.  These
11713 instructions are generated by default on POWER systems, and not
11714 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
11715 endian PowerPC systems, since those instructions do not work when the
11716 processor is in little endian mode.  The exceptions are PPC740 and
11717 PPC750 which permit the instructions usage in little endian mode.
11718
11719 @item -mstring
11720 @itemx -mno-string
11721 @opindex mstring
11722 @opindex mno-string
11723 Generate code that uses (does not use) the load string instructions
11724 and the store string word instructions to save multiple registers and
11725 do small block moves.  These instructions are generated by default on
11726 POWER systems, and not generated on PowerPC systems.  Do not use
11727 @option{-mstring} on little endian PowerPC systems, since those
11728 instructions do not work when the processor is in little endian mode.
11729 The exceptions are PPC740 and PPC750 which permit the instructions
11730 usage in little endian mode.
11731
11732 @item -mupdate
11733 @itemx -mno-update
11734 @opindex mupdate
11735 @opindex mno-update
11736 Generate code that uses (does not use) the load or store instructions
11737 that update the base register to the address of the calculated memory
11738 location.  These instructions are generated by default.  If you use
11739 @option{-mno-update}, there is a small window between the time that the
11740 stack pointer is updated and the address of the previous frame is
11741 stored, which means code that walks the stack frame across interrupts or
11742 signals may get corrupted data.
11743
11744 @item -mfused-madd
11745 @itemx -mno-fused-madd
11746 @opindex mfused-madd
11747 @opindex mno-fused-madd
11748 Generate code that uses (does not use) the floating point multiply and
11749 accumulate instructions.  These instructions are generated by default if
11750 hardware floating is used.
11751
11752 @item -mmulhw
11753 @itemx -mno-mulhw
11754 @opindex mmulhw
11755 @opindex mno-mulhw
11756 Generate code that uses (does not use) the half-word multiply and
11757 multiply-accumulate instructions on the IBM 405 and 440 processors.
11758 These instructions are generated by default when targetting those
11759 processors.
11760
11761 @item -mdlmzb
11762 @itemx -mno-dlmzb
11763 @opindex mdlmzb
11764 @opindex mno-dlmzb
11765 Generate code that uses (does not use) the string-search @samp{dlmzb}
11766 instruction on the IBM 405 and 440 processors.  This instruction is
11767 generated by default when targetting those processors.
11768
11769 @item -mno-bit-align
11770 @itemx -mbit-align
11771 @opindex mno-bit-align
11772 @opindex mbit-align
11773 On System V.4 and embedded PowerPC systems do not (do) force structures
11774 and unions that contain bit-fields to be aligned to the base type of the
11775 bit-field.
11776
11777 For example, by default a structure containing nothing but 8
11778 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
11779 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
11780 the structure would be aligned to a 1 byte boundary and be one byte in
11781 size.
11782
11783 @item -mno-strict-align
11784 @itemx -mstrict-align
11785 @opindex mno-strict-align
11786 @opindex mstrict-align
11787 On System V.4 and embedded PowerPC systems do not (do) assume that
11788 unaligned memory references will be handled by the system.
11789
11790 @item -mrelocatable
11791 @itemx -mno-relocatable
11792 @opindex mrelocatable
11793 @opindex mno-relocatable
11794 On embedded PowerPC systems generate code that allows (does not allow)
11795 the program to be relocated to a different address at runtime.  If you
11796 use @option{-mrelocatable} on any module, all objects linked together must
11797 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
11798
11799 @item -mrelocatable-lib
11800 @itemx -mno-relocatable-lib
11801 @opindex mrelocatable-lib
11802 @opindex mno-relocatable-lib
11803 On embedded PowerPC systems generate code that allows (does not allow)
11804 the program to be relocated to a different address at runtime.  Modules
11805 compiled with @option{-mrelocatable-lib} can be linked with either modules
11806 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
11807 with modules compiled with the @option{-mrelocatable} options.
11808
11809 @item -mno-toc
11810 @itemx -mtoc
11811 @opindex mno-toc
11812 @opindex mtoc
11813 On System V.4 and embedded PowerPC systems do not (do) assume that
11814 register 2 contains a pointer to a global area pointing to the addresses
11815 used in the program.
11816
11817 @item -mlittle
11818 @itemx -mlittle-endian
11819 @opindex mlittle
11820 @opindex mlittle-endian
11821 On System V.4 and embedded PowerPC systems compile code for the
11822 processor in little endian mode.  The @option{-mlittle-endian} option is
11823 the same as @option{-mlittle}.
11824
11825 @item -mbig
11826 @itemx -mbig-endian
11827 @opindex mbig
11828 @opindex mbig-endian
11829 On System V.4 and embedded PowerPC systems compile code for the
11830 processor in big endian mode.  The @option{-mbig-endian} option is
11831 the same as @option{-mbig}.
11832
11833 @item -mdynamic-no-pic
11834 @opindex mdynamic-no-pic
11835 On Darwin and Mac OS X systems, compile code so that it is not
11836 relocatable, but that its external references are relocatable.  The
11837 resulting code is suitable for applications, but not shared
11838 libraries.
11839
11840 @item -mprioritize-restricted-insns=@var{priority}
11841 @opindex mprioritize-restricted-insns
11842 This option controls the priority that is assigned to
11843 dispatch-slot restricted instructions during the second scheduling
11844 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
11845 @var{no/highest/second-highest} priority to dispatch slot restricted
11846 instructions.
11847
11848 @item -msched-costly-dep=@var{dependence_type}
11849 @opindex msched-costly-dep
11850 This option controls which dependences are considered costly
11851 by the target during instruction scheduling.  The argument
11852 @var{dependence_type} takes one of the following values:
11853 @var{no}: no dependence is costly,
11854 @var{all}: all dependences are costly,
11855 @var{true_store_to_load}: a true dependence from store to load is costly,
11856 @var{store_to_load}: any dependence from store to load is costly,
11857 @var{number}: any dependence which latency >= @var{number} is costly.
11858
11859 @item -minsert-sched-nops=@var{scheme}
11860 @opindex minsert-sched-nops
11861 This option controls which nop insertion scheme will be used during
11862 the second scheduling pass.  The argument @var{scheme} takes one of the
11863 following values:
11864 @var{no}: Don't insert nops.
11865 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
11866 according to the scheduler's grouping.
11867 @var{regroup_exact}: Insert nops to force costly dependent insns into
11868 separate groups.  Insert exactly as many nops as needed to force an insn
11869 to a new group, according to the estimated processor grouping.
11870 @var{number}: Insert nops to force costly dependent insns into
11871 separate groups.  Insert @var{number} nops to force an insn to a new group.
11872
11873 @item -mcall-sysv
11874 @opindex mcall-sysv
11875 On System V.4 and embedded PowerPC systems compile code using calling
11876 conventions that adheres to the March 1995 draft of the System V
11877 Application Binary Interface, PowerPC processor supplement.  This is the
11878 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
11879
11880 @item -mcall-sysv-eabi
11881 @opindex mcall-sysv-eabi
11882 Specify both @option{-mcall-sysv} and @option{-meabi} options.
11883
11884 @item -mcall-sysv-noeabi
11885 @opindex mcall-sysv-noeabi
11886 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
11887
11888 @item -mcall-solaris
11889 @opindex mcall-solaris
11890 On System V.4 and embedded PowerPC systems compile code for the Solaris
11891 operating system.
11892
11893 @item -mcall-linux
11894 @opindex mcall-linux
11895 On System V.4 and embedded PowerPC systems compile code for the
11896 Linux-based GNU system.
11897
11898 @item -mcall-gnu
11899 @opindex mcall-gnu
11900 On System V.4 and embedded PowerPC systems compile code for the
11901 Hurd-based GNU system.
11902
11903 @item -mcall-netbsd
11904 @opindex mcall-netbsd
11905 On System V.4 and embedded PowerPC systems compile code for the
11906 NetBSD operating system.
11907
11908 @item -maix-struct-return
11909 @opindex maix-struct-return
11910 Return all structures in memory (as specified by the AIX ABI)@.
11911
11912 @item -msvr4-struct-return
11913 @opindex msvr4-struct-return
11914 Return structures smaller than 8 bytes in registers (as specified by the
11915 SVR4 ABI)@.
11916
11917 @item -mabi=@var{abi-type}
11918 @opindex mabi
11919 Extend the current ABI with a particular extension, or remove such extension.
11920 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
11921 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
11922
11923 @item -mabi=spe
11924 @opindex mabi=spe
11925 Extend the current ABI with SPE ABI extensions.  This does not change
11926 the default ABI, instead it adds the SPE ABI extensions to the current
11927 ABI@.
11928
11929 @item -mabi=no-spe
11930 @opindex mabi=no-spe
11931 Disable Booke SPE ABI extensions for the current ABI@.
11932
11933 @item -mabi=ibmlongdouble
11934 @opindex mabi=ibmlongdouble
11935 Change the current ABI to use IBM extended precision long double.
11936 This is a PowerPC 32-bit SYSV ABI option.
11937
11938 @item -mabi=ieeelongdouble
11939 @opindex mabi=ieeelongdouble
11940 Change the current ABI to use IEEE extended precision long double.
11941 This is a PowerPC 32-bit Linux ABI option.
11942
11943 @item -mprototype
11944 @itemx -mno-prototype
11945 @opindex mprototype
11946 @opindex mno-prototype
11947 On System V.4 and embedded PowerPC systems assume that all calls to
11948 variable argument functions are properly prototyped.  Otherwise, the
11949 compiler must insert an instruction before every non prototyped call to
11950 set or clear bit 6 of the condition code register (@var{CR}) to
11951 indicate whether floating point values were passed in the floating point
11952 registers in case the function takes a variable arguments.  With
11953 @option{-mprototype}, only calls to prototyped variable argument functions
11954 will set or clear the bit.
11955
11956 @item -msim
11957 @opindex msim
11958 On embedded PowerPC systems, assume that the startup module is called
11959 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
11960 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
11961 configurations.
11962
11963 @item -mmvme
11964 @opindex mmvme
11965 On embedded PowerPC systems, assume that the startup module is called
11966 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
11967 @file{libc.a}.
11968
11969 @item -mads
11970 @opindex mads
11971 On embedded PowerPC systems, assume that the startup module is called
11972 @file{crt0.o} and the standard C libraries are @file{libads.a} and
11973 @file{libc.a}.
11974
11975 @item -myellowknife
11976 @opindex myellowknife
11977 On embedded PowerPC systems, assume that the startup module is called
11978 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
11979 @file{libc.a}.
11980
11981 @item -mvxworks
11982 @opindex mvxworks
11983 On System V.4 and embedded PowerPC systems, specify that you are
11984 compiling for a VxWorks system.
11985
11986 @item -mwindiss
11987 @opindex mwindiss
11988 Specify that you are compiling for the WindISS simulation environment.
11989
11990 @item -memb
11991 @opindex memb
11992 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
11993 header to indicate that @samp{eabi} extended relocations are used.
11994
11995 @item -meabi
11996 @itemx -mno-eabi
11997 @opindex meabi
11998 @opindex mno-eabi
11999 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12000 Embedded Applications Binary Interface (eabi) which is a set of
12001 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12002 means that the stack is aligned to an 8 byte boundary, a function
12003 @code{__eabi} is called to from @code{main} to set up the eabi
12004 environment, and the @option{-msdata} option can use both @code{r2} and
12005 @code{r13} to point to two separate small data areas.  Selecting
12006 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12007 do not call an initialization function from @code{main}, and the
12008 @option{-msdata} option will only use @code{r13} to point to a single
12009 small data area.  The @option{-meabi} option is on by default if you
12010 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12011
12012 @item -msdata=eabi
12013 @opindex msdata=eabi
12014 On System V.4 and embedded PowerPC systems, put small initialized
12015 @code{const} global and static data in the @samp{.sdata2} section, which
12016 is pointed to by register @code{r2}.  Put small initialized
12017 non-@code{const} global and static data in the @samp{.sdata} section,
12018 which is pointed to by register @code{r13}.  Put small uninitialized
12019 global and static data in the @samp{.sbss} section, which is adjacent to
12020 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12021 incompatible with the @option{-mrelocatable} option.  The
12022 @option{-msdata=eabi} option also sets the @option{-memb} option.
12023
12024 @item -msdata=sysv
12025 @opindex msdata=sysv
12026 On System V.4 and embedded PowerPC systems, put small global and static
12027 data in the @samp{.sdata} section, which is pointed to by register
12028 @code{r13}.  Put small uninitialized global and static data in the
12029 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12030 The @option{-msdata=sysv} option is incompatible with the
12031 @option{-mrelocatable} option.
12032
12033 @item -msdata=default
12034 @itemx -msdata
12035 @opindex msdata=default
12036 @opindex msdata
12037 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12038 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12039 same as @option{-msdata=sysv}.
12040
12041 @item -msdata-data
12042 @opindex msdata-data
12043 On System V.4 and embedded PowerPC systems, put small global
12044 data in the @samp{.sdata} section.  Put small uninitialized global
12045 data in the @samp{.sbss} section.  Do not use register @code{r13}
12046 to address small data however.  This is the default behavior unless
12047 other @option{-msdata} options are used.
12048
12049 @item -msdata=none
12050 @itemx -mno-sdata
12051 @opindex msdata=none
12052 @opindex mno-sdata
12053 On embedded PowerPC systems, put all initialized global and static data
12054 in the @samp{.data} section, and all uninitialized data in the
12055 @samp{.bss} section.
12056
12057 @item -G @var{num}
12058 @opindex G
12059 @cindex smaller data references (PowerPC)
12060 @cindex .sdata/.sdata2 references (PowerPC)
12061 On embedded PowerPC systems, put global and static items less than or
12062 equal to @var{num} bytes into the small data or bss sections instead of
12063 the normal data or bss section.  By default, @var{num} is 8.  The
12064 @option{-G @var{num}} switch is also passed to the linker.
12065 All modules should be compiled with the same @option{-G @var{num}} value.
12066
12067 @item -mregnames
12068 @itemx -mno-regnames
12069 @opindex mregnames
12070 @opindex mno-regnames
12071 On System V.4 and embedded PowerPC systems do (do not) emit register
12072 names in the assembly language output using symbolic forms.
12073
12074 @item -mlongcall
12075 @itemx -mno-longcall
12076 @opindex mlongcall
12077 @opindex mno-longcall
12078 By default assume that all calls are far away so that a longer more
12079 expensive calling sequence is required.  This is required for calls
12080 further than 32 megabytes (33,554,432 bytes) from the current location.
12081 A short call will be generated if the compiler knows
12082 the call cannot be that far away.  This setting can be overridden by
12083 the @code{shortcall} function attribute, or by @code{#pragma
12084 longcall(0)}.
12085
12086 Some linkers are capable of detecting out-of-range calls and generating
12087 glue code on the fly.  On these systems, long calls are unnecessary and
12088 generate slower code.  As of this writing, the AIX linker can do this,
12089 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12090 to the GNU linker for 32-bit PowerPC systems as well.
12091
12092 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12093 callee, L42'', plus a ``branch island'' (glue code).  The two target
12094 addresses represent the callee and the ``branch island''.  The
12095 Darwin/PPC linker will prefer the first address and generate a ``bl
12096 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12097 otherwise, the linker will generate ``bl L42'' to call the ``branch
12098 island''.  The ``branch island'' is appended to the body of the
12099 calling function; it computes the full 32-bit address of the callee
12100 and jumps to it.
12101
12102 On Mach-O (Darwin) systems, this option directs the compiler emit to
12103 the glue for every direct call, and the Darwin linker decides whether
12104 to use or discard it.
12105
12106 In the future, we may cause GCC to ignore all longcall specifications
12107 when the linker is known to generate glue.
12108
12109 @item -pthread
12110 @opindex pthread
12111 Adds support for multithreading with the @dfn{pthreads} library.
12112 This option sets flags for both the preprocessor and linker.
12113
12114 @end table
12115
12116 @node S/390 and zSeries Options
12117 @subsection S/390 and zSeries Options
12118 @cindex S/390 and zSeries Options
12119
12120 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12121
12122 @table @gcctabopt
12123 @item -mhard-float
12124 @itemx -msoft-float
12125 @opindex mhard-float
12126 @opindex msoft-float
12127 Use (do not use) the hardware floating-point instructions and registers
12128 for floating-point operations.  When @option{-msoft-float} is specified,
12129 functions in @file{libgcc.a} will be used to perform floating-point
12130 operations.  When @option{-mhard-float} is specified, the compiler
12131 generates IEEE floating-point instructions.  This is the default.
12132
12133 @item -mlong-double-64
12134 @itemx -mlong-double-128
12135 @opindex mlong-double-64
12136 @opindex mlong-double-128
12137 These switches control the size of @code{long double} type. A size
12138 of 64bit makes the @code{long double} type equivalent to the @code{double}
12139 type. This is the default.
12140
12141 @item -mbackchain
12142 @itemx -mno-backchain
12143 @opindex mbackchain
12144 @opindex mno-backchain
12145 Store (do not store) the address of the caller's frame as backchain pointer
12146 into the callee's stack frame.
12147 A backchain may be needed to allow debugging using tools that do not understand
12148 DWARF-2 call frame information.
12149 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12150 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12151 the backchain is placed into the topmost word of the 96/160 byte register
12152 save area.
12153
12154 In general, code compiled with @option{-mbackchain} is call-compatible with
12155 code compiled with @option{-mmo-backchain}; however, use of the backchain
12156 for debugging purposes usually requires that the whole binary is built with
12157 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12158 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12159 to build a linux kernel use @option{-msoft-float}.
12160
12161 The default is to not maintain the backchain.
12162
12163 @item -mpacked-stack
12164 @item -mno-packed-stack
12165 @opindex mpacked-stack
12166 @opindex mno-packed-stack
12167 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12168 specified, the compiler uses the all fields of the 96/160 byte register save
12169 area only for their default purpose; unused fields still take up stack space.
12170 When @option{-mpacked-stack} is specified, register save slots are densely
12171 packed at the top of the register save area; unused space is reused for other
12172 purposes, allowing for more efficient use of the available stack space.
12173 However, when @option{-mbackchain} is also in effect, the topmost word of
12174 the save area is always used to store the backchain, and the return address
12175 register is always saved two words below the backchain.
12176
12177 As long as the stack frame backchain is not used, code generated with
12178 @option{-mpacked-stack} is call-compatible with code generated with
12179 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
12180 S/390 or zSeries generated code that uses the stack frame backchain at run
12181 time, not just for debugging purposes.  Such code is not call-compatible
12182 with code compiled with @option{-mpacked-stack}.  Also, note that the
12183 combination of @option{-mbackchain},
12184 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12185 to build a linux kernel use @option{-msoft-float}.
12186
12187 The default is to not use the packed stack layout.
12188
12189 @item -msmall-exec
12190 @itemx -mno-small-exec
12191 @opindex msmall-exec
12192 @opindex mno-small-exec
12193 Generate (or do not generate) code using the @code{bras} instruction
12194 to do subroutine calls.
12195 This only works reliably if the total executable size does not
12196 exceed 64k.  The default is to use the @code{basr} instruction instead,
12197 which does not have this limitation.
12198
12199 @item -m64
12200 @itemx -m31
12201 @opindex m64
12202 @opindex m31
12203 When @option{-m31} is specified, generate code compliant to the
12204 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
12205 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
12206 particular to generate 64-bit instructions.  For the @samp{s390}
12207 targets, the default is @option{-m31}, while the @samp{s390x}
12208 targets default to @option{-m64}.
12209
12210 @item -mzarch
12211 @itemx -mesa
12212 @opindex mzarch
12213 @opindex mesa
12214 When @option{-mzarch} is specified, generate code using the
12215 instructions available on z/Architecture.
12216 When @option{-mesa} is specified, generate code using the
12217 instructions available on ESA/390.  Note that @option{-mesa} is
12218 not possible with @option{-m64}.
12219 When generating code compliant to the GNU/Linux for S/390 ABI,
12220 the default is @option{-mesa}.  When generating code compliant
12221 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
12222
12223 @item -mmvcle
12224 @itemx -mno-mvcle
12225 @opindex mmvcle
12226 @opindex mno-mvcle
12227 Generate (or do not generate) code using the @code{mvcle} instruction
12228 to perform block moves.  When @option{-mno-mvcle} is specified,
12229 use a @code{mvc} loop instead.  This is the default unless optimizing for
12230 size.
12231
12232 @item -mdebug
12233 @itemx -mno-debug
12234 @opindex mdebug
12235 @opindex mno-debug
12236 Print (or do not print) additional debug information when compiling.
12237 The default is to not print debug information.
12238
12239 @item -march=@var{cpu-type}
12240 @opindex march
12241 Generate code that will run on @var{cpu-type}, which is the name of a system
12242 representing a certain processor type.  Possible values for
12243 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
12244 When generating code using the instructions available on z/Architecture,
12245 the default is @option{-march=z900}.  Otherwise, the default is
12246 @option{-march=g5}.
12247
12248 @item -mtune=@var{cpu-type}
12249 @opindex mtune
12250 Tune to @var{cpu-type} everything applicable about the generated code,
12251 except for the ABI and the set of available instructions.
12252 The list of @var{cpu-type} values is the same as for @option{-march}.
12253 The default is the value used for @option{-march}.
12254
12255 @item -mtpf-trace
12256 @itemx -mno-tpf-trace
12257 @opindex mtpf-trace
12258 @opindex mno-tpf-trace
12259 Generate code that adds (does not add) in TPF OS specific branches to trace
12260 routines in the operating system.  This option is off by default, even
12261 when compiling for the TPF OS@.
12262
12263 @item -mfused-madd
12264 @itemx -mno-fused-madd
12265 @opindex mfused-madd
12266 @opindex mno-fused-madd
12267 Generate code that uses (does not use) the floating point multiply and
12268 accumulate instructions.  These instructions are generated by default if
12269 hardware floating point is used.
12270
12271 @item -mwarn-framesize=@var{framesize}
12272 @opindex mwarn-framesize
12273 Emit a warning if the current function exceeds the given frame size.  Because
12274 this is a compile time check it doesn't need to be a real problem when the program
12275 runs.  It is intended to identify functions which most probably cause
12276 a stack overflow.  It is useful to be used in an environment with limited stack
12277 size e.g.@: the linux kernel.
12278
12279 @item -mwarn-dynamicstack
12280 @opindex mwarn-dynamicstack
12281 Emit a warning if the function calls alloca or uses dynamically
12282 sized arrays.  This is generally a bad idea with a limited stack size.
12283
12284 @item -mstack-guard=@var{stack-guard}
12285 @item -mstack-size=@var{stack-size}
12286 @opindex mstack-guard
12287 @opindex mstack-size
12288 These arguments always have to be used in conjunction.  If they are present the s390
12289 back end emits additional instructions in the function prologue which trigger a trap
12290 if the stack size is @var{stack-guard} bytes above the @var{stack-size}
12291 (remember that the stack on s390 grows downward).  These options are intended to
12292 be used to help debugging stack overflow problems.  The additionally emitted code
12293 causes only little overhead and hence can also be used in production like systems
12294 without greater performance degradation.  The given values have to be exact
12295 powers of 2 and @var{stack-size} has to be greater than @var{stack-guard} without
12296 exceeding 64k.
12297 In order to be efficient the extra code makes the assumption that the stack starts
12298 at an address aligned to the value given by @var{stack-size}.
12299 @end table
12300
12301 @node Score Options
12302 @subsection Score Options
12303 @cindex Score Options
12304
12305 These options are defined for Score implementations:
12306
12307 @table @gcctabopt
12308 @item -mel
12309 @opindex -mel
12310 Compile code for little endian mode. 
12311
12312 @item -meb
12313 @opindex meb
12314 Compile code for big endian mode.  This is the default.
12315
12316 @item -mmac
12317 @opindex mmac
12318 Enable the use of multiply-accumulate instructions. Disabled by default. 
12319
12320 @item -mscore5u
12321 @opindex mscore5u
12322 Specify the SCORE5U of the target architecture.
12323
12324 @item -mscore7
12325 @opindex mscore7
12326 Specify the SCORE7 of the target architecture. This is the default.
12327 @end table
12328
12329 @node SH Options
12330 @subsection SH Options
12331
12332 These @samp{-m} options are defined for the SH implementations:
12333
12334 @table @gcctabopt
12335 @item -m1
12336 @opindex m1
12337 Generate code for the SH1.
12338
12339 @item -m2
12340 @opindex m2
12341 Generate code for the SH2.
12342
12343 @item -m2e
12344 Generate code for the SH2e.
12345
12346 @item -m3
12347 @opindex m3
12348 Generate code for the SH3.
12349
12350 @item -m3e
12351 @opindex m3e
12352 Generate code for the SH3e.
12353
12354 @item -m4-nofpu
12355 @opindex m4-nofpu
12356 Generate code for the SH4 without a floating-point unit.
12357
12358 @item -m4-single-only
12359 @opindex m4-single-only
12360 Generate code for the SH4 with a floating-point unit that only
12361 supports single-precision arithmetic.
12362
12363 @item -m4-single
12364 @opindex m4-single
12365 Generate code for the SH4 assuming the floating-point unit is in
12366 single-precision mode by default.
12367
12368 @item -m4
12369 @opindex m4
12370 Generate code for the SH4.
12371
12372 @item -m4a-nofpu
12373 @opindex m4a-nofpu
12374 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
12375 floating-point unit is not used.
12376
12377 @item -m4a-single-only
12378 @opindex m4a-single-only
12379 Generate code for the SH4a, in such a way that no double-precision
12380 floating point operations are used.
12381
12382 @item -m4a-single
12383 @opindex m4a-single
12384 Generate code for the SH4a assuming the floating-point unit is in
12385 single-precision mode by default.
12386
12387 @item -m4a
12388 @opindex m4a
12389 Generate code for the SH4a.
12390
12391 @item -m4al
12392 @opindex m4al
12393 Same as @option{-m4a-nofpu}, except that it implicitly passes
12394 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
12395 instructions at the moment.
12396
12397 @item -mb
12398 @opindex mb
12399 Compile code for the processor in big endian mode.
12400
12401 @item -ml
12402 @opindex ml
12403 Compile code for the processor in little endian mode.
12404
12405 @item -mdalign
12406 @opindex mdalign
12407 Align doubles at 64-bit boundaries.  Note that this changes the calling
12408 conventions, and thus some functions from the standard C library will
12409 not work unless you recompile it first with @option{-mdalign}.
12410
12411 @item -mrelax
12412 @opindex mrelax
12413 Shorten some address references at link time, when possible; uses the
12414 linker option @option{-relax}.
12415
12416 @item -mbigtable
12417 @opindex mbigtable
12418 Use 32-bit offsets in @code{switch} tables.  The default is to use
12419 16-bit offsets.
12420
12421 @item -mfmovd
12422 @opindex mfmovd
12423 Enable the use of the instruction @code{fmovd}.
12424
12425 @item -mhitachi
12426 @opindex mhitachi
12427 Comply with the calling conventions defined by Renesas.
12428
12429 @item -mrenesas
12430 @opindex mhitachi
12431 Comply with the calling conventions defined by Renesas.
12432
12433 @item -mno-renesas
12434 @opindex mhitachi
12435 Comply with the calling conventions defined for GCC before the Renesas
12436 conventions were available.  This option is the default for all
12437 targets of the SH toolchain except for @samp{sh-symbianelf}.
12438
12439 @item -mnomacsave
12440 @opindex mnomacsave
12441 Mark the @code{MAC} register as call-clobbered, even if
12442 @option{-mhitachi} is given.
12443
12444 @item -mieee
12445 @opindex mieee
12446 Increase IEEE-compliance of floating-point code.
12447 At the moment, this is equivalent to @option{-fno-finite-math-only}.
12448 When generating 16 bit SH opcodes, getting IEEE-conforming results for
12449 comparisons of NANs / infinities incurs extra overhead in every
12450 floating point comparison, therefore the default is set to
12451 @option{-ffinite-math-only}.
12452
12453 @item -minline-ic_invalidate
12454 @opindex minline-ic_invalidate
12455 Inline code to invalidate instruction cache entries after setting up
12456 nested function trampolines.
12457 This option has no effect if -musermode is in effect and the selected
12458 code generation option (e.g. -m4) does not allow the use of the icbi
12459 instruction.
12460 If the selected code generation option does not allow the use of the icbi
12461 instruction, and -musermode is not in effect, the inlined code will
12462 manipulate the instruction cache address array directly with an associative
12463 write.  This not only requires privileged mode, but it will also
12464 fail if the cache line had been mapped via the TLB and has become unmapped.
12465
12466 @item -misize
12467 @opindex misize
12468 Dump instruction size and location in the assembly code.
12469
12470 @item -mpadstruct
12471 @opindex mpadstruct
12472 This option is deprecated.  It pads structures to multiple of 4 bytes,
12473 which is incompatible with the SH ABI@.
12474
12475 @item -mspace
12476 @opindex mspace
12477 Optimize for space instead of speed.  Implied by @option{-Os}.
12478
12479 @item -mprefergot
12480 @opindex mprefergot
12481 When generating position-independent code, emit function calls using
12482 the Global Offset Table instead of the Procedure Linkage Table.
12483
12484 @item -musermode
12485 @opindex musermode
12486 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
12487 if the inlined code would not work in user mode.
12488 This is the default when the target is @code{sh-*-linux*}.
12489
12490 @item -multcost=@var{number}
12491 @opindex multcost=@var{number}
12492 Set the cost to assume for a multiply insn.
12493
12494 @item -mdiv=@var{strategy}
12495 @opindex mdiv=@var{strategy}
12496 Set the division strategy to use for SHmedia code.  @var{strategy} must be
12497 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
12498 inv:call2, inv:fp .
12499 "fp" performs the operation in floating point.  This has a very high latency,
12500 but needs only a few instructions, so it might be a good choice if
12501 your code has enough easily exploitable ILP to allow the compiler to
12502 schedule the floating point instructions together with other instructions.
12503 Division by zero causes a floating point exception.
12504 "inv" uses integer operations to calculate the inverse of the divisor,
12505 and then multiplies the dividend with the inverse.  This strategy allows
12506 cse and hoisting of the inverse calculation.  Division by zero calculates
12507 an unspecified result, but does not trap.
12508 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
12509 have been found, or if the entire operation has been hoisted to the same
12510 place, the last stages of the inverse calculation are intertwined with the
12511 final multiply to reduce the overall latency, at the expense of using a few
12512 more instructions, and thus offering fewer scheduling opportunities with
12513 other code.
12514 "call" calls a library function that usually implements the inv:minlat
12515 strategy.
12516 This gives high code density for m5-*media-nofpu compilations.
12517 "call2" uses a different entry point of the same library function, where it
12518 assumes that a pointer to a lookup table has already been set up, which
12519 exposes the pointer load to cse / code hoisting optimizations.
12520 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
12521 code generation, but if the code stays unoptimized, revert to the "call",
12522 "call2", or "fp" strategies, respectively.  Note that the
12523 potentially-trapping side effect of division by zero is carried by a
12524 separate instruction, so it is possible that all the integer instructions
12525 are hoisted out, but the marker for the side effect stays where it is.
12526 A recombination to fp operations or a call is not possible in that case.
12527 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
12528 that the inverse calculation was nor separated from the multiply, they speed
12529 up division where the dividend fits into 20 bits (plus sign where applicable),
12530 by inserting a test to skip a number of operations in this case; this test
12531 slows down the case of larger dividends.  inv20u assumes the case of a such
12532 a small dividend to be unlikely, and inv20l assumes it to be likely.
12533
12534 @item -mdivsi3_libfunc=@var{name}
12535 @opindex mdivsi3_libfunc=@var{name}
12536 Set the name of the library function used for 32 bit signed division to
12537 @var{name}.  This only affect the name used in the call and inv:call
12538 division strategies, and the compiler will still expect the same
12539 sets of input/output/clobbered registers as if this option was not present.
12540
12541 @item -madjust-unroll
12542 @opindex madjust-unroll
12543 Throttle unrolling to avoid thrashing target registers.
12544 This option only has an effect if the gcc code base supports the
12545 TARGET_ADJUST_UNROLL_MAX target hook.
12546
12547 @item -mindexed-addressing
12548 @opindex mindexed-addressing
12549 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
12550 This is only safe if the hardware and/or OS implement 32 bit wrap-around
12551 semantics for the indexed addressing mode.  The architecture allows the
12552 implementation of processors with 64 bit MMU, which the OS could use to
12553 get 32 bit addressing, but since no current hardware implementation supports
12554 this or any other way to make the indexed addressing mode safe to use in
12555 the 32 bit ABI, the default is -mno-indexed-addressing.
12556
12557 @item -mgettrcost=@var{number}
12558 @opindex mgettrcost=@var{number}
12559 Set the cost assumed for the gettr instruction to @var{number}.
12560 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
12561
12562 @item -mpt-fixed
12563 @opindex mpt-fixed
12564 Assume pt* instructions won't trap.  This will generally generate better
12565 scheduled code, but is unsafe on current hardware.  The current architecture
12566 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
12567 This has the unintentional effect of making it unsafe to schedule ptabs /
12568 ptrel before a branch, or hoist it out of a loop.  For example,
12569 __do_global_ctors, a part of libgcc that runs constructors at program
12570 startup, calls functions in a list which is delimited by -1.  With the
12571 -mpt-fixed option, the ptabs will be done before testing against -1.
12572 That means that all the constructors will be run a bit quicker, but when
12573 the loop comes to the end of the list, the program crashes because ptabs
12574 loads -1 into a target register.  Since this option is unsafe for any
12575 hardware implementing the current architecture specification, the default
12576 is -mno-pt-fixed.  Unless the user specifies a specific cost with
12577 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
12578 this deters register allocation using target registers for storing
12579 ordinary integers.
12580
12581 @item -minvalid-symbols
12582 @opindex minvalid-symbols
12583 Assume symbols might be invalid.  Ordinary function symbols generated by
12584 the compiler will always be valid to load with movi/shori/ptabs or
12585 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
12586 to generate symbols that will cause ptabs / ptrel to trap.
12587 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
12588 It will then prevent cross-basic-block cse, hoisting and most scheduling
12589 of symbol loads.  The default is @option{-mno-invalid-symbols}.
12590 @end table
12591
12592 @node SPARC Options
12593 @subsection SPARC Options
12594 @cindex SPARC options
12595
12596 These @samp{-m} options are supported on the SPARC:
12597
12598 @table @gcctabopt
12599 @item -mno-app-regs
12600 @itemx -mapp-regs
12601 @opindex mno-app-regs
12602 @opindex mapp-regs
12603 Specify @option{-mapp-regs} to generate output using the global registers
12604 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
12605 is the default.
12606
12607 To be fully SVR4 ABI compliant at the cost of some performance loss,
12608 specify @option{-mno-app-regs}.  You should compile libraries and system
12609 software with this option.
12610
12611 @item -mfpu
12612 @itemx -mhard-float
12613 @opindex mfpu
12614 @opindex mhard-float
12615 Generate output containing floating point instructions.  This is the
12616 default.
12617
12618 @item -mno-fpu
12619 @itemx -msoft-float
12620 @opindex mno-fpu
12621 @opindex msoft-float
12622 Generate output containing library calls for floating point.
12623 @strong{Warning:} the requisite libraries are not available for all SPARC
12624 targets.  Normally the facilities of the machine's usual C compiler are
12625 used, but this cannot be done directly in cross-compilation.  You must make
12626 your own arrangements to provide suitable library functions for
12627 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
12628 @samp{sparclite-*-*} do provide software floating point support.
12629
12630 @option{-msoft-float} changes the calling convention in the output file;
12631 therefore, it is only useful if you compile @emph{all} of a program with
12632 this option.  In particular, you need to compile @file{libgcc.a}, the
12633 library that comes with GCC, with @option{-msoft-float} in order for
12634 this to work.
12635
12636 @item -mhard-quad-float
12637 @opindex mhard-quad-float
12638 Generate output containing quad-word (long double) floating point
12639 instructions.
12640
12641 @item -msoft-quad-float
12642 @opindex msoft-quad-float
12643 Generate output containing library calls for quad-word (long double)
12644 floating point instructions.  The functions called are those specified
12645 in the SPARC ABI@.  This is the default.
12646
12647 As of this writing, there are no SPARC implementations that have hardware
12648 support for the quad-word floating point instructions.  They all invoke
12649 a trap handler for one of these instructions, and then the trap handler
12650 emulates the effect of the instruction.  Because of the trap handler overhead,
12651 this is much slower than calling the ABI library routines.  Thus the
12652 @option{-msoft-quad-float} option is the default.
12653
12654 @item -mno-unaligned-doubles
12655 @itemx -munaligned-doubles
12656 @opindex mno-unaligned-doubles
12657 @opindex munaligned-doubles
12658 Assume that doubles have 8 byte alignment.  This is the default.
12659
12660 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
12661 alignment only if they are contained in another type, or if they have an
12662 absolute address.  Otherwise, it assumes they have 4 byte alignment.
12663 Specifying this option avoids some rare compatibility problems with code
12664 generated by other compilers.  It is not the default because it results
12665 in a performance loss, especially for floating point code.
12666
12667 @item -mno-faster-structs
12668 @itemx -mfaster-structs
12669 @opindex mno-faster-structs
12670 @opindex mfaster-structs
12671 With @option{-mfaster-structs}, the compiler assumes that structures
12672 should have 8 byte alignment.  This enables the use of pairs of
12673 @code{ldd} and @code{std} instructions for copies in structure
12674 assignment, in place of twice as many @code{ld} and @code{st} pairs.
12675 However, the use of this changed alignment directly violates the SPARC
12676 ABI@.  Thus, it's intended only for use on targets where the developer
12677 acknowledges that their resulting code will not be directly in line with
12678 the rules of the ABI@.
12679
12680 @item -mimpure-text
12681 @opindex mimpure-text
12682 @option{-mimpure-text}, used in addition to @option{-shared}, tells
12683 the compiler to not pass @option{-z text} to the linker when linking a
12684 shared object.  Using this option, you can link position-dependent
12685 code into a shared object.
12686
12687 @option{-mimpure-text} suppresses the ``relocations remain against
12688 allocatable but non-writable sections'' linker error message.
12689 However, the necessary relocations will trigger copy-on-write, and the
12690 shared object is not actually shared across processes.  Instead of
12691 using @option{-mimpure-text}, you should compile all source code with
12692 @option{-fpic} or @option{-fPIC}.
12693
12694 This option is only available on SunOS and Solaris.
12695
12696 @item -mcpu=@var{cpu_type}
12697 @opindex mcpu
12698 Set the instruction set, register set, and instruction scheduling parameters
12699 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
12700 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
12701 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
12702 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
12703 @samp{ultrasparc3}, and @samp{niagara}.
12704
12705 Default instruction scheduling parameters are used for values that select
12706 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
12707 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
12708
12709 Here is a list of each supported architecture and their supported
12710 implementations.
12711
12712 @smallexample
12713     v7:             cypress
12714     v8:             supersparc, hypersparc
12715     sparclite:      f930, f934, sparclite86x
12716     sparclet:       tsc701
12717     v9:             ultrasparc, ultrasparc3, niagara
12718 @end smallexample
12719
12720 By default (unless configured otherwise), GCC generates code for the V7
12721 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
12722 additionally optimizes it for the Cypress CY7C602 chip, as used in the
12723 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
12724 SPARCStation 1, 2, IPX etc.
12725
12726 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
12727 architecture.  The only difference from V7 code is that the compiler emits
12728 the integer multiply and integer divide instructions which exist in SPARC-V8
12729 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
12730 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
12731 2000 series.
12732
12733 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
12734 the SPARC architecture.  This adds the integer multiply, integer divide step
12735 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
12736 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
12737 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
12738 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
12739 MB86934 chip, which is the more recent SPARClite with FPU@.
12740
12741 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
12742 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
12743 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
12744 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
12745 optimizes it for the TEMIC SPARClet chip.
12746
12747 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
12748 architecture.  This adds 64-bit integer and floating-point move instructions,
12749 3 additional floating-point condition code registers and conditional move
12750 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
12751 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
12752 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
12753 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
12754 @option{-mcpu=niagara}, the compiler additionally optimizes it for
12755 Sun UltraSPARC T1 chips.
12756
12757 @item -mtune=@var{cpu_type}
12758 @opindex mtune
12759 Set the instruction scheduling parameters for machine type
12760 @var{cpu_type}, but do not set the instruction set or register set that the
12761 option @option{-mcpu=@var{cpu_type}} would.
12762
12763 The same values for @option{-mcpu=@var{cpu_type}} can be used for
12764 @option{-mtune=@var{cpu_type}}, but the only useful values are those
12765 that select a particular cpu implementation.  Those are @samp{cypress},
12766 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
12767 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
12768 @samp{ultrasparc3}, and @samp{niagara}.
12769
12770 @item -mv8plus
12771 @itemx -mno-v8plus
12772 @opindex mv8plus
12773 @opindex mno-v8plus
12774 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
12775 difference from the V8 ABI is that the global and out registers are
12776 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
12777 mode for all SPARC-V9 processors.
12778
12779 @item -mvis
12780 @itemx -mno-vis
12781 @opindex mvis
12782 @opindex mno-vis
12783 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
12784 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
12785 @end table
12786
12787 These @samp{-m} options are supported in addition to the above
12788 on SPARC-V9 processors in 64-bit environments:
12789
12790 @table @gcctabopt
12791 @item -mlittle-endian
12792 @opindex mlittle-endian
12793 Generate code for a processor running in little-endian mode.  It is only
12794 available for a few configurations and most notably not on Solaris and Linux.
12795
12796 @item -m32
12797 @itemx -m64
12798 @opindex m32
12799 @opindex m64
12800 Generate code for a 32-bit or 64-bit environment.
12801 The 32-bit environment sets int, long and pointer to 32 bits.
12802 The 64-bit environment sets int to 32 bits and long and pointer
12803 to 64 bits.
12804
12805 @item -mcmodel=medlow
12806 @opindex mcmodel=medlow
12807 Generate code for the Medium/Low code model: 64-bit addresses, programs
12808 must be linked in the low 32 bits of memory.  Programs can be statically
12809 or dynamically linked.
12810
12811 @item -mcmodel=medmid
12812 @opindex mcmodel=medmid
12813 Generate code for the Medium/Middle code model: 64-bit addresses, programs
12814 must be linked in the low 44 bits of memory, the text and data segments must
12815 be less than 2GB in size and the data segment must be located within 2GB of
12816 the text segment.
12817
12818 @item -mcmodel=medany
12819 @opindex mcmodel=medany
12820 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
12821 may be linked anywhere in memory, the text and data segments must be less
12822 than 2GB in size and the data segment must be located within 2GB of the
12823 text segment.
12824
12825 @item -mcmodel=embmedany
12826 @opindex mcmodel=embmedany
12827 Generate code for the Medium/Anywhere code model for embedded systems:
12828 64-bit addresses, the text and data segments must be less than 2GB in
12829 size, both starting anywhere in memory (determined at link time).  The
12830 global register %g4 points to the base of the data segment.  Programs
12831 are statically linked and PIC is not supported.
12832
12833 @item -mstack-bias
12834 @itemx -mno-stack-bias
12835 @opindex mstack-bias
12836 @opindex mno-stack-bias
12837 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
12838 frame pointer if present, are offset by @minus{}2047 which must be added back
12839 when making stack frame references.  This is the default in 64-bit mode.
12840 Otherwise, assume no such offset is present.
12841 @end table
12842
12843 These switches are supported in addition to the above on Solaris:
12844
12845 @table @gcctabopt
12846 @item -threads
12847 @opindex threads
12848 Add support for multithreading using the Solaris threads library.  This
12849 option sets flags for both the preprocessor and linker.  This option does
12850 not affect the thread safety of object code produced by the compiler or
12851 that of libraries supplied with it.
12852
12853 @item -pthreads
12854 @opindex pthreads
12855 Add support for multithreading using the POSIX threads library.  This
12856 option sets flags for both the preprocessor and linker.  This option does
12857 not affect the thread safety of object code produced  by the compiler or
12858 that of libraries supplied with it.
12859
12860 @item -pthread
12861 @opindex pthread
12862 This is a synonym for @option{-pthreads}.
12863 @end table
12864
12865 @node SPU Options
12866 @subsection SPU Options
12867 @cindex SPU options
12868
12869 These @samp{-m} options are supported on the SPU:
12870
12871 @table @gcctabopt
12872 @item -mwarn-reloc
12873 @itemx -merror-reloc
12874 @opindex mwarn-reloc
12875 @opindex merror-reloc
12876
12877 The loader for SPU does not handle dynamic relocations.  By default, GCC
12878 will give an error when it generates code that requires a dynamic
12879 relocation.  @option{-mno-error-reloc} disables the error,
12880 @option{-mwarn-reloc} will generate a warning instead.
12881
12882 @item -msafe-dma
12883 @itemx -munsafe-dma
12884 @opindex msafe-dma
12885 @opindex munsafe-dma
12886
12887 Instructions which initiate or test completion of DMA must not be
12888 reordered with respect to loads and stores of the memory which is being
12889 accessed.  Users typically address this problem using the volatile
12890 keyword, but that can lead to inefficient code in places where the
12891 memory is known to not change.  Rather than mark the memory as volatile
12892 we treat the DMA instructions as potentially effecting all memory.  With
12893 @option{-munsafe-dma} users must use the volatile keyword to protect
12894 memory accesses.
12895
12896 @item -mbranch-hints
12897 @opindex mbranch-hints
12898
12899 By default, GCC will generate a branch hint instruction to avoid
12900 pipeline stalls for always taken or probably taken branches.  A hint
12901 will not be generated closer than 8 instructions away from its branch.
12902 There is little reason to disable them, except for debugging purposes,
12903 or to make an object a little bit smaller.
12904
12905 @item -msmall-mem
12906 @itemx -mlarge-mem
12907 @opindex msmall-mem
12908 @opindex mlarge-mem
12909
12910 By default, GCC generates code assuming that addresses are never larger
12911 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
12912 a full 32 bit address.
12913
12914 @item -mstdmain
12915 @opindex mstdmain
12916
12917 By default, GCC links against startup code that assumes the SPU-style
12918 main function interface (which has an unconventional parameter list).
12919 With @option{-mstdmain}, GCC will link your program against startup
12920 code that assumes a C99-style interface to @code{main}, including a
12921 local copy of @code{argv} strings.
12922
12923 @item -mfixed-range=@var{register-range}
12924 @opindex mfixed-range
12925 Generate code treating the given register range as fixed registers.
12926 A fixed register is one that the register allocator can not use.  This is
12927 useful when compiling kernel code.  A register range is specified as
12928 two registers separated by a dash.  Multiple register ranges can be
12929 specified separated by a comma.
12930
12931 @end table
12932
12933 @node System V Options
12934 @subsection Options for System V
12935
12936 These additional options are available on System V Release 4 for
12937 compatibility with other compilers on those systems:
12938
12939 @table @gcctabopt
12940 @item -G
12941 @opindex G
12942 Create a shared object.
12943 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
12944
12945 @item -Qy
12946 @opindex Qy
12947 Identify the versions of each tool used by the compiler, in a
12948 @code{.ident} assembler directive in the output.
12949
12950 @item -Qn
12951 @opindex Qn
12952 Refrain from adding @code{.ident} directives to the output file (this is
12953 the default).
12954
12955 @item -YP,@var{dirs}
12956 @opindex YP
12957 Search the directories @var{dirs}, and no others, for libraries
12958 specified with @option{-l}.
12959
12960 @item -Ym,@var{dir}
12961 @opindex Ym
12962 Look in the directory @var{dir} to find the M4 preprocessor.
12963 The assembler uses this option.
12964 @c This is supposed to go with a -Yd for predefined M4 macro files, but
12965 @c the generic assembler that comes with Solaris takes just -Ym.
12966 @end table
12967
12968 @node TMS320C3x/C4x Options
12969 @subsection TMS320C3x/C4x Options
12970 @cindex TMS320C3x/C4x Options
12971
12972 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
12973
12974 @table @gcctabopt
12975
12976 @item -mcpu=@var{cpu_type}
12977 @opindex mcpu
12978 Set the instruction set, register set, and instruction scheduling
12979 parameters for machine type @var{cpu_type}.  Supported values for
12980 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
12981 @samp{c44}.  The default is @samp{c40} to generate code for the
12982 TMS320C40.
12983
12984 @item -mbig-memory
12985 @itemx -mbig
12986 @itemx -msmall-memory
12987 @itemx -msmall
12988 @opindex mbig-memory
12989 @opindex mbig
12990 @opindex msmall-memory
12991 @opindex msmall
12992 Generates code for the big or small memory model.  The small memory
12993 model assumed that all data fits into one 64K word page.  At run-time
12994 the data page (DP) register must be set to point to the 64K page
12995 containing the .bss and .data program sections.  The big memory model is
12996 the default and requires reloading of the DP register for every direct
12997 memory access.
12998
12999 @item -mbk
13000 @itemx -mno-bk
13001 @opindex mbk
13002 @opindex mno-bk
13003 Allow (disallow) allocation of general integer operands into the block
13004 count register BK@.
13005
13006 @item -mdb
13007 @itemx -mno-db
13008 @opindex mdb
13009 @opindex mno-db
13010 Enable (disable) generation of code using decrement and branch,
13011 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13012 on the safe side, this is disabled for the C3x, since the maximum
13013 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13014 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13015 that it can utilize the decrement and branch instruction, but will give
13016 up if there is more than one memory reference in the loop.  Thus a loop
13017 where the loop counter is decremented can generate slightly more
13018 efficient code, in cases where the RPTB instruction cannot be utilized.
13019
13020 @item -mdp-isr-reload
13021 @itemx -mparanoid
13022 @opindex mdp-isr-reload
13023 @opindex mparanoid
13024 Force the DP register to be saved on entry to an interrupt service
13025 routine (ISR), reloaded to point to the data section, and restored on
13026 exit from the ISR@.  This should not be required unless someone has
13027 violated the small memory model by modifying the DP register, say within
13028 an object library.
13029
13030 @item -mmpyi
13031 @itemx -mno-mpyi
13032 @opindex mmpyi
13033 @opindex mno-mpyi
13034 For the C3x use the 24-bit MPYI instruction for integer multiplies
13035 instead of a library call to guarantee 32-bit results.  Note that if one
13036 of the operands is a constant, then the multiplication will be performed
13037 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13038 then squaring operations are performed inline instead of a library call.
13039
13040 @item -mfast-fix
13041 @itemx -mno-fast-fix
13042 @opindex mfast-fix
13043 @opindex mno-fast-fix
13044 The C3x/C4x FIX instruction to convert a floating point value to an
13045 integer value chooses the nearest integer less than or equal to the
13046 floating point value rather than to the nearest integer.  Thus if the
13047 floating point number is negative, the result will be incorrectly
13048 truncated an additional code is necessary to detect and correct this
13049 case.  This option can be used to disable generation of the additional
13050 code required to correct the result.
13051
13052 @item -mrptb
13053 @itemx -mno-rptb
13054 @opindex mrptb
13055 @opindex mno-rptb
13056 Enable (disable) generation of repeat block sequences using the RPTB
13057 instruction for zero overhead looping.  The RPTB construct is only used
13058 for innermost loops that do not call functions or jump across the loop
13059 boundaries.  There is no advantage having nested RPTB loops due to the
13060 overhead required to save and restore the RC, RS, and RE registers.
13061 This is enabled by default with @option{-O2}.
13062
13063 @item -mrpts=@var{count}
13064 @itemx -mno-rpts
13065 @opindex mrpts
13066 @opindex mno-rpts
13067 Enable (disable) the use of the single instruction repeat instruction
13068 RPTS@.  If a repeat block contains a single instruction, and the loop
13069 count can be guaranteed to be less than the value @var{count}, GCC will
13070 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13071 then a RPTS will be emitted even if the loop count cannot be determined
13072 at compile time.  Note that the repeated instruction following RPTS does
13073 not have to be reloaded from memory each iteration, thus freeing up the
13074 CPU buses for operands.  However, since interrupts are blocked by this
13075 instruction, it is disabled by default.
13076
13077 @item -mloop-unsigned
13078 @itemx -mno-loop-unsigned
13079 @opindex mloop-unsigned
13080 @opindex mno-loop-unsigned
13081 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13082 is @math{2^{31} + 1} since these instructions test if the iteration count is
13083 negative to terminate the loop.  If the iteration count is unsigned
13084 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13085 exceeded.  This switch allows an unsigned iteration count.
13086
13087 @item -mti
13088 @opindex mti
13089 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13090 with.  This also enforces compatibility with the API employed by the TI
13091 C3x C compiler.  For example, long doubles are passed as structures
13092 rather than in floating point registers.
13093
13094 @item -mregparm
13095 @itemx -mmemparm
13096 @opindex mregparm
13097 @opindex mmemparm
13098 Generate code that uses registers (stack) for passing arguments to functions.
13099 By default, arguments are passed in registers where possible rather
13100 than by pushing arguments on to the stack.
13101
13102 @item -mparallel-insns
13103 @itemx -mno-parallel-insns
13104 @opindex mparallel-insns
13105 @opindex mno-parallel-insns
13106 Allow the generation of parallel instructions.  This is enabled by
13107 default with @option{-O2}.
13108
13109 @item -mparallel-mpy
13110 @itemx -mno-parallel-mpy
13111 @opindex mparallel-mpy
13112 @opindex mno-parallel-mpy
13113 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13114 provided @option{-mparallel-insns} is also specified.  These instructions have
13115 tight register constraints which can pessimize the code generation
13116 of large functions.
13117
13118 @end table
13119
13120 @node V850 Options
13121 @subsection V850 Options
13122 @cindex V850 Options
13123
13124 These @samp{-m} options are defined for V850 implementations:
13125
13126 @table @gcctabopt
13127 @item -mlong-calls
13128 @itemx -mno-long-calls
13129 @opindex mlong-calls
13130 @opindex mno-long-calls
13131 Treat all calls as being far away (near).  If calls are assumed to be
13132 far away, the compiler will always load the functions address up into a
13133 register, and call indirect through the pointer.
13134
13135 @item -mno-ep
13136 @itemx -mep
13137 @opindex mno-ep
13138 @opindex mep
13139 Do not optimize (do optimize) basic blocks that use the same index
13140 pointer 4 or more times to copy pointer into the @code{ep} register, and
13141 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13142 option is on by default if you optimize.
13143
13144 @item -mno-prolog-function
13145 @itemx -mprolog-function
13146 @opindex mno-prolog-function
13147 @opindex mprolog-function
13148 Do not use (do use) external functions to save and restore registers
13149 at the prologue and epilogue of a function.  The external functions
13150 are slower, but use less code space if more than one function saves
13151 the same number of registers.  The @option{-mprolog-function} option
13152 is on by default if you optimize.
13153
13154 @item -mspace
13155 @opindex mspace
13156 Try to make the code as small as possible.  At present, this just turns
13157 on the @option{-mep} and @option{-mprolog-function} options.
13158
13159 @item -mtda=@var{n}
13160 @opindex mtda
13161 Put static or global variables whose size is @var{n} bytes or less into
13162 the tiny data area that register @code{ep} points to.  The tiny data
13163 area can hold up to 256 bytes in total (128 bytes for byte references).
13164
13165 @item -msda=@var{n}
13166 @opindex msda
13167 Put static or global variables whose size is @var{n} bytes or less into
13168 the small data area that register @code{gp} points to.  The small data
13169 area can hold up to 64 kilobytes.
13170
13171 @item -mzda=@var{n}
13172 @opindex mzda
13173 Put static or global variables whose size is @var{n} bytes or less into
13174 the first 32 kilobytes of memory.
13175
13176 @item -mv850
13177 @opindex mv850
13178 Specify that the target processor is the V850.
13179
13180 @item -mbig-switch
13181 @opindex mbig-switch
13182 Generate code suitable for big switch tables.  Use this option only if
13183 the assembler/linker complain about out of range branches within a switch
13184 table.
13185
13186 @item -mapp-regs
13187 @opindex mapp-regs
13188 This option will cause r2 and r5 to be used in the code generated by
13189 the compiler.  This setting is the default.
13190
13191 @item -mno-app-regs
13192 @opindex mno-app-regs
13193 This option will cause r2 and r5 to be treated as fixed registers.
13194
13195 @item -mv850e1
13196 @opindex mv850e1
13197 Specify that the target processor is the V850E1.  The preprocessor
13198 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
13199 this option is used.
13200
13201 @item -mv850e
13202 @opindex mv850e
13203 Specify that the target processor is the V850E@.  The preprocessor
13204 constant @samp{__v850e__} will be defined if this option is used.
13205
13206 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
13207 are defined then a default target processor will be chosen and the
13208 relevant @samp{__v850*__} preprocessor constant will be defined.
13209
13210 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
13211 defined, regardless of which processor variant is the target.
13212
13213 @item -mdisable-callt
13214 @opindex mdisable-callt
13215 This option will suppress generation of the CALLT instruction for the
13216 v850e and v850e1 flavors of the v850 architecture.  The default is
13217 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
13218
13219 @end table
13220
13221 @node VAX Options
13222 @subsection VAX Options
13223 @cindex VAX options
13224
13225 These @samp{-m} options are defined for the VAX:
13226
13227 @table @gcctabopt
13228 @item -munix
13229 @opindex munix
13230 Do not output certain jump instructions (@code{aobleq} and so on)
13231 that the Unix assembler for the VAX cannot handle across long
13232 ranges.
13233
13234 @item -mgnu
13235 @opindex mgnu
13236 Do output those jump instructions, on the assumption that you
13237 will assemble with the GNU assembler.
13238
13239 @item -mg
13240 @opindex mg
13241 Output code for g-format floating point numbers instead of d-format.
13242 @end table
13243
13244 @node x86-64 Options
13245 @subsection x86-64 Options
13246 @cindex x86-64 options
13247
13248 These are listed under @xref{i386 and x86-64 Options}.
13249
13250 @node Xstormy16 Options
13251 @subsection Xstormy16 Options
13252 @cindex Xstormy16 Options
13253
13254 These options are defined for Xstormy16:
13255
13256 @table @gcctabopt
13257 @item -msim
13258 @opindex msim
13259 Choose startup files and linker script suitable for the simulator.
13260 @end table
13261
13262 @node Xtensa Options
13263 @subsection Xtensa Options
13264 @cindex Xtensa Options
13265
13266 These options are supported for Xtensa targets:
13267
13268 @table @gcctabopt
13269 @item -mconst16
13270 @itemx -mno-const16
13271 @opindex mconst16
13272 @opindex mno-const16
13273 Enable or disable use of @code{CONST16} instructions for loading
13274 constant values.  The @code{CONST16} instruction is currently not a
13275 standard option from Tensilica.  When enabled, @code{CONST16}
13276 instructions are always used in place of the standard @code{L32R}
13277 instructions.  The use of @code{CONST16} is enabled by default only if
13278 the @code{L32R} instruction is not available.
13279
13280 @item -mfused-madd
13281 @itemx -mno-fused-madd
13282 @opindex mfused-madd
13283 @opindex mno-fused-madd
13284 Enable or disable use of fused multiply/add and multiply/subtract
13285 instructions in the floating-point option.  This has no effect if the
13286 floating-point option is not also enabled.  Disabling fused multiply/add
13287 and multiply/subtract instructions forces the compiler to use separate
13288 instructions for the multiply and add/subtract operations.  This may be
13289 desirable in some cases where strict IEEE 754-compliant results are
13290 required: the fused multiply add/subtract instructions do not round the
13291 intermediate result, thereby producing results with @emph{more} bits of
13292 precision than specified by the IEEE standard.  Disabling fused multiply
13293 add/subtract instructions also ensures that the program output is not
13294 sensitive to the compiler's ability to combine multiply and add/subtract
13295 operations.
13296
13297 @item -mtext-section-literals
13298 @itemx -mno-text-section-literals
13299 @opindex mtext-section-literals
13300 @opindex mno-text-section-literals
13301 Control the treatment of literal pools.  The default is
13302 @option{-mno-text-section-literals}, which places literals in a separate
13303 section in the output file.  This allows the literal pool to be placed
13304 in a data RAM/ROM, and it also allows the linker to combine literal
13305 pools from separate object files to remove redundant literals and
13306 improve code size.  With @option{-mtext-section-literals}, the literals
13307 are interspersed in the text section in order to keep them as close as
13308 possible to their references.  This may be necessary for large assembly
13309 files.
13310
13311 @item -mtarget-align
13312 @itemx -mno-target-align
13313 @opindex mtarget-align
13314 @opindex mno-target-align
13315 When this option is enabled, GCC instructs the assembler to
13316 automatically align instructions to reduce branch penalties at the
13317 expense of some code density.  The assembler attempts to widen density
13318 instructions to align branch targets and the instructions following call
13319 instructions.  If there are not enough preceding safe density
13320 instructions to align a target, no widening will be performed.  The
13321 default is @option{-mtarget-align}.  These options do not affect the
13322 treatment of auto-aligned instructions like @code{LOOP}, which the
13323 assembler will always align, either by widening density instructions or
13324 by inserting no-op instructions.
13325
13326 @item -mlongcalls
13327 @itemx -mno-longcalls
13328 @opindex mlongcalls
13329 @opindex mno-longcalls
13330 When this option is enabled, GCC instructs the assembler to translate
13331 direct calls to indirect calls unless it can determine that the target
13332 of a direct call is in the range allowed by the call instruction.  This
13333 translation typically occurs for calls to functions in other source
13334 files.  Specifically, the assembler translates a direct @code{CALL}
13335 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
13336 The default is @option{-mno-longcalls}.  This option should be used in
13337 programs where the call target can potentially be out of range.  This
13338 option is implemented in the assembler, not the compiler, so the
13339 assembly code generated by GCC will still show direct call
13340 instructions---look at the disassembled object code to see the actual
13341 instructions.  Note that the assembler will use an indirect call for
13342 every cross-file call, not just those that really will be out of range.
13343 @end table
13344
13345 @node zSeries Options
13346 @subsection zSeries Options
13347 @cindex zSeries options
13348
13349 These are listed under @xref{S/390 and zSeries Options}.
13350
13351 @node Code Gen Options
13352 @section Options for Code Generation Conventions
13353 @cindex code generation conventions
13354 @cindex options, code generation
13355 @cindex run-time options
13356
13357 These machine-independent options control the interface conventions
13358 used in code generation.
13359
13360 Most of them have both positive and negative forms; the negative form
13361 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
13362 one of the forms is listed---the one which is not the default.  You
13363 can figure out the other form by either removing @samp{no-} or adding
13364 it.
13365
13366 @table @gcctabopt
13367 @item -fbounds-check
13368 @opindex fbounds-check
13369 For front-ends that support it, generate additional code to check that
13370 indices used to access arrays are within the declared range.  This is
13371 currently only supported by the Java and Fortran front-ends, where
13372 this option defaults to true and false respectively.
13373
13374 @item -ftrapv
13375 @opindex ftrapv
13376 This option generates traps for signed overflow on addition, subtraction,
13377 multiplication operations.
13378
13379 @item -fwrapv
13380 @opindex fwrapv
13381 This option instructs the compiler to assume that signed arithmetic
13382 overflow of addition, subtraction and multiplication wraps around
13383 using twos-complement representation.  This flag enables some optimizations
13384 and disables others.  This option is enabled by default for the Java
13385 front-end, as required by the Java language specification.
13386
13387 @item -fexceptions
13388 @opindex fexceptions
13389 Enable exception handling.  Generates extra code needed to propagate
13390 exceptions.  For some targets, this implies GCC will generate frame
13391 unwind information for all functions, which can produce significant data
13392 size overhead, although it does not affect execution.  If you do not
13393 specify this option, GCC will enable it by default for languages like
13394 C++ which normally require exception handling, and disable it for
13395 languages like C that do not normally require it.  However, you may need
13396 to enable this option when compiling C code that needs to interoperate
13397 properly with exception handlers written in C++.  You may also wish to
13398 disable this option if you are compiling older C++ programs that don't
13399 use exception handling.
13400
13401 @item -fnon-call-exceptions
13402 @opindex fnon-call-exceptions
13403 Generate code that allows trapping instructions to throw exceptions.
13404 Note that this requires platform-specific runtime support that does
13405 not exist everywhere.  Moreover, it only allows @emph{trapping}
13406 instructions to throw exceptions, i.e.@: memory references or floating
13407 point instructions.  It does not allow exceptions to be thrown from
13408 arbitrary signal handlers such as @code{SIGALRM}.
13409
13410 @item -funwind-tables
13411 @opindex funwind-tables
13412 Similar to @option{-fexceptions}, except that it will just generate any needed
13413 static data, but will not affect the generated code in any other way.
13414 You will normally not enable this option; instead, a language processor
13415 that needs this handling would enable it on your behalf.
13416
13417 @item -fasynchronous-unwind-tables
13418 @opindex fasynchronous-unwind-tables
13419 Generate unwind table in dwarf2 format, if supported by target machine.  The
13420 table is exact at each instruction boundary, so it can be used for stack
13421 unwinding from asynchronous events (such as debugger or garbage collector).
13422
13423 @item -fpcc-struct-return
13424 @opindex fpcc-struct-return
13425 Return ``short'' @code{struct} and @code{union} values in memory like
13426 longer ones, rather than in registers.  This convention is less
13427 efficient, but it has the advantage of allowing intercallability between
13428 GCC-compiled files and files compiled with other compilers, particularly
13429 the Portable C Compiler (pcc).
13430
13431 The precise convention for returning structures in memory depends
13432 on the target configuration macros.
13433
13434 Short structures and unions are those whose size and alignment match
13435 that of some integer type.
13436
13437 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13438 switch is not binary compatible with code compiled with the
13439 @option{-freg-struct-return} switch.
13440 Use it to conform to a non-default application binary interface.
13441
13442 @item -freg-struct-return
13443 @opindex freg-struct-return
13444 Return @code{struct} and @code{union} values in registers when possible.
13445 This is more efficient for small structures than
13446 @option{-fpcc-struct-return}.
13447
13448 If you specify neither @option{-fpcc-struct-return} nor
13449 @option{-freg-struct-return}, GCC defaults to whichever convention is
13450 standard for the target.  If there is no standard convention, GCC
13451 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
13452 the principal compiler.  In those cases, we can choose the standard, and
13453 we chose the more efficient register return alternative.
13454
13455 @strong{Warning:} code compiled with the @option{-freg-struct-return}
13456 switch is not binary compatible with code compiled with the
13457 @option{-fpcc-struct-return} switch.
13458 Use it to conform to a non-default application binary interface.
13459
13460 @item -fshort-enums
13461 @opindex fshort-enums
13462 Allocate to an @code{enum} type only as many bytes as it needs for the
13463 declared range of possible values.  Specifically, the @code{enum} type
13464 will be equivalent to the smallest integer type which has enough room.
13465
13466 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
13467 code that is not binary compatible with code generated without that switch.
13468 Use it to conform to a non-default application binary interface.
13469
13470 @item -fshort-double
13471 @opindex fshort-double
13472 Use the same size for @code{double} as for @code{float}.
13473
13474 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
13475 code that is not binary compatible with code generated without that switch.
13476 Use it to conform to a non-default application binary interface.
13477
13478 @item -fshort-wchar
13479 @opindex fshort-wchar
13480 Override the underlying type for @samp{wchar_t} to be @samp{short
13481 unsigned int} instead of the default for the target.  This option is
13482 useful for building programs to run under WINE@.
13483
13484 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
13485 code that is not binary compatible with code generated without that switch.
13486 Use it to conform to a non-default application binary interface.
13487
13488 @item -fno-common
13489 @opindex fno-common
13490 In C, allocate even uninitialized global variables in the data section of the
13491 object file, rather than generating them as common blocks.  This has the
13492 effect that if the same variable is declared (without @code{extern}) in
13493 two different compilations, you will get an error when you link them.
13494 The only reason this might be useful is if you wish to verify that the
13495 program will work on other systems which always work this way.
13496
13497 @item -fno-ident
13498 @opindex fno-ident
13499 Ignore the @samp{#ident} directive.
13500
13501 @item -finhibit-size-directive
13502 @opindex finhibit-size-directive
13503 Don't output a @code{.size} assembler directive, or anything else that
13504 would cause trouble if the function is split in the middle, and the
13505 two halves are placed at locations far apart in memory.  This option is
13506 used when compiling @file{crtstuff.c}; you should not need to use it
13507 for anything else.
13508
13509 @item -fverbose-asm
13510 @opindex fverbose-asm
13511 Put extra commentary information in the generated assembly code to
13512 make it more readable.  This option is generally only of use to those
13513 who actually need to read the generated assembly code (perhaps while
13514 debugging the compiler itself).
13515
13516 @option{-fno-verbose-asm}, the default, causes the
13517 extra information to be omitted and is useful when comparing two assembler
13518 files.
13519
13520 @item -frecord-gcc-switches
13521 @opindex frecord-gcc-switches
13522 This switch causes the command line that was used to invoke the
13523 compiler to be recorded into the object file that is being created.
13524 This switch is only implemented on some targets and the exact format
13525 of the recording is target and binary file format dependent, but it
13526 usually takes the form of a section containing ASCII text.  This
13527 switch is related to the @option{-fverbose-asm} switch, but that
13528 switch only records information in the assembler output file as
13529 comments, so it never reaches the object file.
13530
13531 @item -fpic
13532 @opindex fpic
13533 @cindex global offset table
13534 @cindex PIC
13535 Generate position-independent code (PIC) suitable for use in a shared
13536 library, if supported for the target machine.  Such code accesses all
13537 constant addresses through a global offset table (GOT)@.  The dynamic
13538 loader resolves the GOT entries when the program starts (the dynamic
13539 loader is not part of GCC; it is part of the operating system).  If
13540 the GOT size for the linked executable exceeds a machine-specific
13541 maximum size, you get an error message from the linker indicating that
13542 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
13543 instead.  (These maximums are 8k on the SPARC and 32k
13544 on the m68k and RS/6000.  The 386 has no such limit.)
13545
13546 Position-independent code requires special support, and therefore works
13547 only on certain machines.  For the 386, GCC supports PIC for System V
13548 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
13549 position-independent.
13550
13551 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13552 are defined to 1.
13553
13554 @item -fPIC
13555 @opindex fPIC
13556 If supported for the target machine, emit position-independent code,
13557 suitable for dynamic linking and avoiding any limit on the size of the
13558 global offset table.  This option makes a difference on the m68k,
13559 PowerPC and SPARC@.
13560
13561 Position-independent code requires special support, and therefore works
13562 only on certain machines.
13563
13564 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13565 are defined to 2.
13566
13567 @item -fpie
13568 @itemx -fPIE
13569 @opindex fpie
13570 @opindex fPIE
13571 These options are similar to @option{-fpic} and @option{-fPIC}, but
13572 generated position independent code can be only linked into executables.
13573 Usually these options are used when @option{-pie} GCC option will be
13574 used during linking.
13575
13576 @item -fno-jump-tables
13577 @opindex fno-jump-tables
13578 Do not use jump tables for switch statements even where it would be
13579 more efficient than other code generation strategies.  This option is
13580 of use in conjunction with @option{-fpic} or @option{-fPIC} for
13581 building code which forms part of a dynamic linker and cannot
13582 reference the address of a jump table.  On some targets, jump tables
13583 do not require a GOT and this option is not needed.
13584
13585 @item -ffixed-@var{reg}
13586 @opindex ffixed
13587 Treat the register named @var{reg} as a fixed register; generated code
13588 should never refer to it (except perhaps as a stack pointer, frame
13589 pointer or in some other fixed role).
13590
13591 @var{reg} must be the name of a register.  The register names accepted
13592 are machine-specific and are defined in the @code{REGISTER_NAMES}
13593 macro in the machine description macro file.
13594
13595 This flag does not have a negative form, because it specifies a
13596 three-way choice.
13597
13598 @item -fcall-used-@var{reg}
13599 @opindex fcall-used
13600 Treat the register named @var{reg} as an allocable register that is
13601 clobbered by function calls.  It may be allocated for temporaries or
13602 variables that do not live across a call.  Functions compiled this way
13603 will not save and restore the register @var{reg}.
13604
13605 It is an error to used this flag with the frame pointer or stack pointer.
13606 Use of this flag for other registers that have fixed pervasive roles in
13607 the machine's execution model will produce disastrous results.
13608
13609 This flag does not have a negative form, because it specifies a
13610 three-way choice.
13611
13612 @item -fcall-saved-@var{reg}
13613 @opindex fcall-saved
13614 Treat the register named @var{reg} as an allocable register saved by
13615 functions.  It may be allocated even for temporaries or variables that
13616 live across a call.  Functions compiled this way will save and restore
13617 the register @var{reg} if they use it.
13618
13619 It is an error to used this flag with the frame pointer or stack pointer.
13620 Use of this flag for other registers that have fixed pervasive roles in
13621 the machine's execution model will produce disastrous results.
13622
13623 A different sort of disaster will result from the use of this flag for
13624 a register in which function values may be returned.
13625
13626 This flag does not have a negative form, because it specifies a
13627 three-way choice.
13628
13629 @item -fpack-struct[=@var{n}]
13630 @opindex fpack-struct
13631 Without a value specified, pack all structure members together without
13632 holes.  When a value is specified (which must be a small power of two), pack
13633 structure members according to this value, representing the maximum
13634 alignment (that is, objects with default alignment requirements larger than
13635 this will be output potentially unaligned at the next fitting location.
13636
13637 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
13638 code that is not binary compatible with code generated without that switch.
13639 Additionally, it makes the code suboptimal.
13640 Use it to conform to a non-default application binary interface.
13641
13642 @item -finstrument-functions
13643 @opindex finstrument-functions
13644 Generate instrumentation calls for entry and exit to functions.  Just
13645 after function entry and just before function exit, the following
13646 profiling functions will be called with the address of the current
13647 function and its call site.  (On some platforms,
13648 @code{__builtin_return_address} does not work beyond the current
13649 function, so the call site information may not be available to the
13650 profiling functions otherwise.)
13651
13652 @smallexample
13653 void __cyg_profile_func_enter (void *this_fn,
13654                                void *call_site);
13655 void __cyg_profile_func_exit  (void *this_fn,
13656                                void *call_site);
13657 @end smallexample
13658
13659 The first argument is the address of the start of the current function,
13660 which may be looked up exactly in the symbol table.
13661
13662 This instrumentation is also done for functions expanded inline in other
13663 functions.  The profiling calls will indicate where, conceptually, the
13664 inline function is entered and exited.  This means that addressable
13665 versions of such functions must be available.  If all your uses of a
13666 function are expanded inline, this may mean an additional expansion of
13667 code size.  If you use @samp{extern inline} in your C code, an
13668 addressable version of such functions must be provided.  (This is
13669 normally the case anyways, but if you get lucky and the optimizer always
13670 expands the functions inline, you might have gotten away without
13671 providing static copies.)
13672
13673 A function may be given the attribute @code{no_instrument_function}, in
13674 which case this instrumentation will not be done.  This can be used, for
13675 example, for the profiling functions listed above, high-priority
13676 interrupt routines, and any functions from which the profiling functions
13677 cannot safely be called (perhaps signal handlers, if the profiling
13678 routines generate output or allocate memory).
13679
13680 @item -fstack-check
13681 @opindex fstack-check
13682 Generate code to verify that you do not go beyond the boundary of the
13683 stack.  You should specify this flag if you are running in an
13684 environment with multiple threads, but only rarely need to specify it in
13685 a single-threaded environment since stack overflow is automatically
13686 detected on nearly all systems if there is only one stack.
13687
13688 Note that this switch does not actually cause checking to be done; the
13689 operating system must do that.  The switch causes generation of code
13690 to ensure that the operating system sees the stack being extended.
13691
13692 @item -fstack-limit-register=@var{reg}
13693 @itemx -fstack-limit-symbol=@var{sym}
13694 @itemx -fno-stack-limit
13695 @opindex fstack-limit-register
13696 @opindex fstack-limit-symbol
13697 @opindex fno-stack-limit
13698 Generate code to ensure that the stack does not grow beyond a certain value,
13699 either the value of a register or the address of a symbol.  If the stack
13700 would grow beyond the value, a signal is raised.  For most targets,
13701 the signal is raised before the stack overruns the boundary, so
13702 it is possible to catch the signal without taking special precautions.
13703
13704 For instance, if the stack starts at absolute address @samp{0x80000000}
13705 and grows downwards, you can use the flags
13706 @option{-fstack-limit-symbol=__stack_limit} and
13707 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
13708 of 128KB@.  Note that this may only work with the GNU linker.
13709
13710 @cindex aliasing of parameters
13711 @cindex parameters, aliased
13712 @item -fargument-alias
13713 @itemx -fargument-noalias
13714 @itemx -fargument-noalias-global
13715 @itemx -fargument-noalias-anything
13716 @opindex fargument-alias
13717 @opindex fargument-noalias
13718 @opindex fargument-noalias-global
13719 @opindex fargument-noalias-anything
13720 Specify the possible relationships among parameters and between
13721 parameters and global data.
13722
13723 @option{-fargument-alias} specifies that arguments (parameters) may
13724 alias each other and may alias global storage.@*
13725 @option{-fargument-noalias} specifies that arguments do not alias
13726 each other, but may alias global storage.@*
13727 @option{-fargument-noalias-global} specifies that arguments do not
13728 alias each other and do not alias global storage.
13729 @option{-fargument-noalias-anything} specifies that arguments do not
13730 alias any other storage.
13731
13732 Each language will automatically use whatever option is required by
13733 the language standard.  You should not need to use these options yourself.
13734
13735 @item -fleading-underscore
13736 @opindex fleading-underscore
13737 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
13738 change the way C symbols are represented in the object file.  One use
13739 is to help link with legacy assembly code.
13740
13741 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
13742 generate code that is not binary compatible with code generated without that
13743 switch.  Use it to conform to a non-default application binary interface.
13744 Not all targets provide complete support for this switch.
13745
13746 @item -ftls-model=@var{model}
13747 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
13748 The @var{model} argument should be one of @code{global-dynamic},
13749 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
13750
13751 The default without @option{-fpic} is @code{initial-exec}; with
13752 @option{-fpic} the default is @code{global-dynamic}.
13753
13754 @item -fvisibility=@var{default|internal|hidden|protected}
13755 @opindex fvisibility
13756 Set the default ELF image symbol visibility to the specified option---all
13757 symbols will be marked with this unless overridden within the code.
13758 Using this feature can very substantially improve linking and
13759 load times of shared object libraries, produce more optimized
13760 code, provide near-perfect API export and prevent symbol clashes.
13761 It is @strong{strongly} recommended that you use this in any shared objects
13762 you distribute.
13763
13764 Despite the nomenclature, @code{default} always means public ie;
13765 available to be linked against from outside the shared object.
13766 @code{protected} and @code{internal} are pretty useless in real-world
13767 usage so the only other commonly used option will be @code{hidden}.
13768 The default if @option{-fvisibility} isn't specified is
13769 @code{default}, i.e., make every
13770 symbol public---this causes the same behavior as previous versions of
13771 GCC@.
13772
13773 A good explanation of the benefits offered by ensuring ELF
13774 symbols have the correct visibility is given by ``How To Write
13775 Shared Libraries'' by Ulrich Drepper (which can be found at
13776 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
13777 solution made possible by this option to marking things hidden when
13778 the default is public is to make the default hidden and mark things
13779 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
13780 and @code{__attribute__ ((visibility("default")))} instead of
13781 @code{__declspec(dllexport)} you get almost identical semantics with
13782 identical syntax.  This is a great boon to those working with
13783 cross-platform projects.
13784
13785 For those adding visibility support to existing code, you may find
13786 @samp{#pragma GCC visibility} of use.  This works by you enclosing
13787 the declarations you wish to set visibility for with (for example)
13788 @samp{#pragma GCC visibility push(hidden)} and
13789 @samp{#pragma GCC visibility pop}.
13790 Bear in mind that symbol visibility should be viewed @strong{as
13791 part of the API interface contract} and thus all new code should
13792 always specify visibility when it is not the default ie; declarations
13793 only for use within the local DSO should @strong{always} be marked explicitly
13794 as hidden as so to avoid PLT indirection overheads---making this
13795 abundantly clear also aids readability and self-documentation of the code.
13796 Note that due to ISO C++ specification requirements, operator new and
13797 operator delete must always be of default visibility.
13798
13799 Be aware that headers from outside your project, in particular system
13800 headers and headers from any other library you use, may not be
13801 expecting to be compiled with visibility other than the default.  You
13802 may need to explicitly say @samp{#pragma GCC visibility push(default)}
13803 before including any such headers.
13804
13805 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
13806 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
13807 no modifications.  However, this means that calls to @samp{extern}
13808 functions with no explicit visibility will use the PLT, so it is more
13809 effective to use @samp{__attribute ((visibility))} and/or
13810 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
13811 declarations should be treated as hidden.
13812
13813 Note that @samp{-fvisibility} does affect C++ vague linkage
13814 entities. This means that, for instance, an exception class that will
13815 be thrown between DSOs must be explicitly marked with default
13816 visibility so that the @samp{type_info} nodes will be unified between
13817 the DSOs.
13818
13819 An overview of these techniques, their benefits and how to use them
13820 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
13821
13822 @end table
13823
13824 @c man end
13825
13826 @node Environment Variables
13827 @section Environment Variables Affecting GCC
13828 @cindex environment variables
13829
13830 @c man begin ENVIRONMENT
13831 This section describes several environment variables that affect how GCC
13832 operates.  Some of them work by specifying directories or prefixes to use
13833 when searching for various kinds of files.  Some are used to specify other
13834 aspects of the compilation environment.
13835
13836 Note that you can also specify places to search using options such as
13837 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
13838 take precedence over places specified using environment variables, which
13839 in turn take precedence over those specified by the configuration of GCC@.
13840 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
13841 GNU Compiler Collection (GCC) Internals}.
13842
13843 @table @env
13844 @item LANG
13845 @itemx LC_CTYPE
13846 @c @itemx LC_COLLATE
13847 @itemx LC_MESSAGES
13848 @c @itemx LC_MONETARY
13849 @c @itemx LC_NUMERIC
13850 @c @itemx LC_TIME
13851 @itemx LC_ALL
13852 @findex LANG
13853 @findex LC_CTYPE
13854 @c @findex LC_COLLATE
13855 @findex LC_MESSAGES
13856 @c @findex LC_MONETARY
13857 @c @findex LC_NUMERIC
13858 @c @findex LC_TIME
13859 @findex LC_ALL
13860 @cindex locale
13861 These environment variables control the way that GCC uses
13862 localization information that allow GCC to work with different
13863 national conventions.  GCC inspects the locale categories
13864 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
13865 so.  These locale categories can be set to any value supported by your
13866 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
13867 Kingdom encoded in UTF-8.
13868
13869 The @env{LC_CTYPE} environment variable specifies character
13870 classification.  GCC uses it to determine the character boundaries in
13871 a string; this is needed for some multibyte encodings that contain quote
13872 and escape characters that would otherwise be interpreted as a string
13873 end or escape.
13874
13875 The @env{LC_MESSAGES} environment variable specifies the language to
13876 use in diagnostic messages.
13877
13878 If the @env{LC_ALL} environment variable is set, it overrides the value
13879 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
13880 and @env{LC_MESSAGES} default to the value of the @env{LANG}
13881 environment variable.  If none of these variables are set, GCC
13882 defaults to traditional C English behavior.
13883
13884 @item TMPDIR
13885 @findex TMPDIR
13886 If @env{TMPDIR} is set, it specifies the directory to use for temporary
13887 files.  GCC uses temporary files to hold the output of one stage of
13888 compilation which is to be used as input to the next stage: for example,
13889 the output of the preprocessor, which is the input to the compiler
13890 proper.
13891
13892 @item GCC_EXEC_PREFIX
13893 @findex GCC_EXEC_PREFIX
13894 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
13895 names of the subprograms executed by the compiler.  No slash is added
13896 when this prefix is combined with the name of a subprogram, but you can
13897 specify a prefix that ends with a slash if you wish.
13898
13899 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
13900 an appropriate prefix to use based on the pathname it was invoked with.
13901
13902 If GCC cannot find the subprogram using the specified prefix, it
13903 tries looking in the usual places for the subprogram.
13904
13905 The default value of @env{GCC_EXEC_PREFIX} is
13906 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the value
13907 of @code{prefix} when you ran the @file{configure} script.
13908
13909 Other prefixes specified with @option{-B} take precedence over this prefix.
13910
13911 This prefix is also used for finding files such as @file{crt0.o} that are
13912 used for linking.
13913
13914 In addition, the prefix is used in an unusual way in finding the
13915 directories to search for header files.  For each of the standard
13916 directories whose name normally begins with @samp{/usr/local/lib/gcc}
13917 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
13918 replacing that beginning with the specified prefix to produce an
13919 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
13920 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
13921 These alternate directories are searched first; the standard directories
13922 come next.
13923
13924 @item COMPILER_PATH
13925 @findex COMPILER_PATH
13926 The value of @env{COMPILER_PATH} is a colon-separated list of
13927 directories, much like @env{PATH}.  GCC tries the directories thus
13928 specified when searching for subprograms, if it can't find the
13929 subprograms using @env{GCC_EXEC_PREFIX}.
13930
13931 @item LIBRARY_PATH
13932 @findex LIBRARY_PATH
13933 The value of @env{LIBRARY_PATH} is a colon-separated list of
13934 directories, much like @env{PATH}.  When configured as a native compiler,
13935 GCC tries the directories thus specified when searching for special
13936 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
13937 using GCC also uses these directories when searching for ordinary
13938 libraries for the @option{-l} option (but directories specified with
13939 @option{-L} come first).
13940
13941 @item LANG
13942 @findex LANG
13943 @cindex locale definition
13944 This variable is used to pass locale information to the compiler.  One way in
13945 which this information is used is to determine the character set to be used
13946 when character literals, string literals and comments are parsed in C and C++.
13947 When the compiler is configured to allow multibyte characters,
13948 the following values for @env{LANG} are recognized:
13949
13950 @table @samp
13951 @item C-JIS
13952 Recognize JIS characters.
13953 @item C-SJIS
13954 Recognize SJIS characters.
13955 @item C-EUCJP
13956 Recognize EUCJP characters.
13957 @end table
13958
13959 If @env{LANG} is not defined, or if it has some other value, then the
13960 compiler will use mblen and mbtowc as defined by the default locale to
13961 recognize and translate multibyte characters.
13962 @end table
13963
13964 @noindent
13965 Some additional environments variables affect the behavior of the
13966 preprocessor.
13967
13968 @include cppenv.texi
13969
13970 @c man end
13971
13972 @node Precompiled Headers
13973 @section Using Precompiled Headers
13974 @cindex precompiled headers
13975 @cindex speed of compilation
13976
13977 Often large projects have many header files that are included in every
13978 source file.  The time the compiler takes to process these header files
13979 over and over again can account for nearly all of the time required to
13980 build the project.  To make builds faster, GCC allows users to
13981 `precompile' a header file; then, if builds can use the precompiled
13982 header file they will be much faster.
13983
13984 To create a precompiled header file, simply compile it as you would any
13985 other file, if necessary using the @option{-x} option to make the driver
13986 treat it as a C or C++ header file.  You will probably want to use a
13987 tool like @command{make} to keep the precompiled header up-to-date when
13988 the headers it contains change.
13989
13990 A precompiled header file will be searched for when @code{#include} is
13991 seen in the compilation.  As it searches for the included file
13992 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
13993 compiler looks for a precompiled header in each directory just before it
13994 looks for the include file in that directory.  The name searched for is
13995 the name specified in the @code{#include} with @samp{.gch} appended.  If
13996 the precompiled header file can't be used, it is ignored.
13997
13998 For instance, if you have @code{#include "all.h"}, and you have
13999 @file{all.h.gch} in the same directory as @file{all.h}, then the
14000 precompiled header file will be used if possible, and the original
14001 header will be used otherwise.
14002
14003 Alternatively, you might decide to put the precompiled header file in a
14004 directory and use @option{-I} to ensure that directory is searched
14005 before (or instead of) the directory containing the original header.
14006 Then, if you want to check that the precompiled header file is always
14007 used, you can put a file of the same name as the original header in this
14008 directory containing an @code{#error} command.
14009
14010 This also works with @option{-include}.  So yet another way to use
14011 precompiled headers, good for projects not designed with precompiled
14012 header files in mind, is to simply take most of the header files used by
14013 a project, include them from another header file, precompile that header
14014 file, and @option{-include} the precompiled header.  If the header files
14015 have guards against multiple inclusion, they will be skipped because
14016 they've already been included (in the precompiled header).
14017
14018 If you need to precompile the same header file for different
14019 languages, targets, or compiler options, you can instead make a
14020 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14021 header in the directory, perhaps using @option{-o}.  It doesn't matter
14022 what you call the files in the directory, every precompiled header in
14023 the directory will be considered.  The first precompiled header
14024 encountered in the directory that is valid for this compilation will
14025 be used; they're searched in no particular order.
14026
14027 There are many other possibilities, limited only by your imagination,
14028 good sense, and the constraints of your build system.
14029
14030 A precompiled header file can be used only when these conditions apply:
14031
14032 @itemize
14033 @item
14034 Only one precompiled header can be used in a particular compilation.
14035
14036 @item
14037 A precompiled header can't be used once the first C token is seen.  You
14038 can have preprocessor directives before a precompiled header; you can
14039 even include a precompiled header from inside another header, so long as
14040 there are no C tokens before the @code{#include}.
14041
14042 @item
14043 The precompiled header file must be produced for the same language as
14044 the current compilation.  You can't use a C precompiled header for a C++
14045 compilation.
14046
14047 @item
14048 The precompiled header file must have been produced by the same compiler
14049 binary as the current compilation is using.
14050
14051 @item
14052 Any macros defined before the precompiled header is included must
14053 either be defined in the same way as when the precompiled header was
14054 generated, or must not affect the precompiled header, which usually
14055 means that they don't appear in the precompiled header at all.
14056
14057 The @option{-D} option is one way to define a macro before a
14058 precompiled header is included; using a @code{#define} can also do it.
14059 There are also some options that define macros implicitly, like
14060 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14061 defined this way.
14062
14063 @item If debugging information is output when using the precompiled
14064 header, using @option{-g} or similar, the same kind of debugging information
14065 must have been output when building the precompiled header.  However,
14066 a precompiled header built using @option{-g} can be used in a compilation
14067 when no debugging information is being output.
14068
14069 @item The same @option{-m} options must generally be used when building
14070 and using the precompiled header.  @xref{Submodel Options},
14071 for any cases where this rule is relaxed.
14072
14073 @item Each of the following options must be the same when building and using
14074 the precompiled header:
14075
14076 @gccoptlist{-fexceptions -funit-at-a-time}
14077
14078 @item
14079 Some other command-line options starting with @option{-f},
14080 @option{-p}, or @option{-O} must be defined in the same way as when
14081 the precompiled header was generated.  At present, it's not clear
14082 which options are safe to change and which are not; the safest choice
14083 is to use exactly the same options when generating and using the
14084 precompiled header.  The following are known to be safe:
14085
14086 @gccoptlist{-fmessage-length= -fpreprocessed
14087 -fsched-interblock -fsched-spec -fsched-spec-load -fsched-spec-load-dangerous
14088 -fsched-verbose=<number> -fschedule-insns -fvisibility=
14089 -pedantic-errors}
14090
14091 @end itemize
14092
14093 For all of these except the last, the compiler will automatically
14094 ignore the precompiled header if the conditions aren't met.  If you
14095 find an option combination that doesn't work and doesn't cause the
14096 precompiled header to be ignored, please consider filing a bug report,
14097 see @ref{Bugs}.
14098
14099 If you do use differing options when generating and using the
14100 precompiled header, the actual behavior will be a mixture of the
14101 behavior for the options.  For instance, if you use @option{-g} to
14102 generate the precompiled header but not when using it, you may or may
14103 not get debugging information for routines in the precompiled header.
14104
14105 @node Running Protoize
14106 @section Running Protoize
14107
14108 The program @code{protoize} is an optional part of GCC@.  You can use
14109 it to add prototypes to a program, thus converting the program to ISO
14110 C in one respect.  The companion program @code{unprotoize} does the
14111 reverse: it removes argument types from any prototypes that are found.
14112
14113 When you run these programs, you must specify a set of source files as
14114 command line arguments.  The conversion programs start out by compiling
14115 these files to see what functions they define.  The information gathered
14116 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
14117
14118 After scanning comes actual conversion.  The specified files are all
14119 eligible to be converted; any files they include (whether sources or
14120 just headers) are eligible as well.
14121
14122 But not all the eligible files are converted.  By default,
14123 @code{protoize} and @code{unprotoize} convert only source and header
14124 files in the current directory.  You can specify additional directories
14125 whose files should be converted with the @option{-d @var{directory}}
14126 option.  You can also specify particular files to exclude with the
14127 @option{-x @var{file}} option.  A file is converted if it is eligible, its
14128 directory name matches one of the specified directory names, and its
14129 name within the directory has not been excluded.
14130
14131 Basic conversion with @code{protoize} consists of rewriting most
14132 function definitions and function declarations to specify the types of
14133 the arguments.  The only ones not rewritten are those for varargs
14134 functions.
14135
14136 @code{protoize} optionally inserts prototype declarations at the
14137 beginning of the source file, to make them available for any calls that
14138 precede the function's definition.  Or it can insert prototype
14139 declarations with block scope in the blocks where undeclared functions
14140 are called.
14141
14142 Basic conversion with @code{unprotoize} consists of rewriting most
14143 function declarations to remove any argument types, and rewriting
14144 function definitions to the old-style pre-ISO form.
14145
14146 Both conversion programs print a warning for any function declaration or
14147 definition that they can't convert.  You can suppress these warnings
14148 with @option{-q}.
14149
14150 The output from @code{protoize} or @code{unprotoize} replaces the
14151 original source file.  The original file is renamed to a name ending
14152 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
14153 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
14154 for DOS) file already exists, then the source file is simply discarded.
14155
14156 @code{protoize} and @code{unprotoize} both depend on GCC itself to
14157 scan the program and collect information about the functions it uses.
14158 So neither of these programs will work until GCC is installed.
14159
14160 Here is a table of the options you can use with @code{protoize} and
14161 @code{unprotoize}.  Each option works with both programs unless
14162 otherwise stated.
14163
14164 @table @code
14165 @item -B @var{directory}
14166 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
14167 usual directory (normally @file{/usr/local/lib}).  This file contains
14168 prototype information about standard system functions.  This option
14169 applies only to @code{protoize}.
14170
14171 @item -c @var{compilation-options}
14172 Use @var{compilation-options} as the options when running @command{gcc} to
14173 produce the @samp{.X} files.  The special option @option{-aux-info} is
14174 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
14175
14176 Note that the compilation options must be given as a single argument to
14177 @code{protoize} or @code{unprotoize}.  If you want to specify several
14178 @command{gcc} options, you must quote the entire set of compilation options
14179 to make them a single word in the shell.
14180
14181 There are certain @command{gcc} arguments that you cannot use, because they
14182 would produce the wrong kind of output.  These include @option{-g},
14183 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
14184 the @var{compilation-options}, they are ignored.
14185
14186 @item -C
14187 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
14188 systems) instead of @samp{.c}.  This is convenient if you are converting
14189 a C program to C++.  This option applies only to @code{protoize}.
14190
14191 @item -g
14192 Add explicit global declarations.  This means inserting explicit
14193 declarations at the beginning of each source file for each function
14194 that is called in the file and was not declared.  These declarations
14195 precede the first function definition that contains a call to an
14196 undeclared function.  This option applies only to @code{protoize}.
14197
14198 @item -i @var{string}
14199 Indent old-style parameter declarations with the string @var{string}.
14200 This option applies only to @code{protoize}.
14201
14202 @code{unprotoize} converts prototyped function definitions to old-style
14203 function definitions, where the arguments are declared between the
14204 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
14205 uses five spaces as the indentation.  If you want to indent with just
14206 one space instead, use @option{-i " "}.
14207
14208 @item -k
14209 Keep the @samp{.X} files.  Normally, they are deleted after conversion
14210 is finished.
14211
14212 @item -l
14213 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
14214 a prototype declaration for each function in each block which calls the
14215 function without any declaration.  This option applies only to
14216 @code{protoize}.
14217
14218 @item -n
14219 Make no real changes.  This mode just prints information about the conversions
14220 that would have been done without @option{-n}.
14221
14222 @item -N
14223 Make no @samp{.save} files.  The original files are simply deleted.
14224 Use this option with caution.
14225
14226 @item -p @var{program}
14227 Use the program @var{program} as the compiler.  Normally, the name
14228 @file{gcc} is used.
14229
14230 @item -q
14231 Work quietly.  Most warnings are suppressed.
14232
14233 @item -v
14234 Print the version number, just like @option{-v} for @command{gcc}.
14235 @end table
14236
14237 If you need special compiler options to compile one of your program's
14238 source files, then you should generate that file's @samp{.X} file
14239 specially, by running @command{gcc} on that source file with the
14240 appropriate options and the option @option{-aux-info}.  Then run
14241 @code{protoize} on the entire set of files.  @code{protoize} will use
14242 the existing @samp{.X} file because it is newer than the source file.
14243 For example:
14244
14245 @smallexample
14246 gcc -Dfoo=bar file1.c -aux-info file1.X
14247 protoize *.c
14248 @end smallexample
14249
14250 @noindent
14251 You need to include the special files along with the rest in the
14252 @code{protoize} command, even though their @samp{.X} files already
14253 exist, because otherwise they won't get converted.
14254
14255 @xref{Protoize Caveats}, for more information on how to use
14256 @code{protoize} successfully.