OSDN Git Service

* doc/passes.texi: Document predictive commoning.
[pf3gnuchains/gcc-fork.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
6
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
11
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
15
16 Permission is granted to copy, distribute and/or modify this document
17 under the terms of the GNU Free Documentation License, Version 1.2 or
18 any later version published by the Free Software Foundation; with the
19 Invariant Sections being ``GNU General Public License'' and ``Funding
20 Free Software'', the Front-Cover texts being (a) (see below), and with
21 the Back-Cover Texts being (b) (see below).  A copy of the license is
22 included in the gfdl(7) man page.
23
24 (a) The FSF's Front-Cover Text is:
25
26      A GNU Manual
27
28 (b) The FSF's Back-Cover Text is:
29
30      You have freedom to copy and modify this GNU Manual, like GNU
31      software.  Copies published by the Free Software Foundation raise
32      funds for GNU development.
33 @c man end
34 @c Set file name and title for the man page.
35 @setfilename gcc
36 @settitle GNU project C and C++ compiler
37 @c man begin SYNOPSIS
38 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
39     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
40     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
41     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
42     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
43     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
44     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
45
46 Only the most useful options are listed here; see below for the
47 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
48 @c man end
49 @c man begin SEEALSO
50 gpl(7), gfdl(7), fsf-funding(7),
51 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
52 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
53 @file{ld}, @file{binutils} and @file{gdb}.
54 @c man end
55 @c man begin BUGS
56 For instructions on reporting bugs, see
57 @w{@uref{http://gcc.gnu.org/bugs.html}}.
58 @c man end
59 @c man begin AUTHOR
60 See the Info entry for @command{gcc}, or
61 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
62 for contributors to GCC@.
63 @c man end
64 @end ignore
65
66 @node Invoking GCC
67 @chapter GCC Command Options
68 @cindex GCC command options
69 @cindex command options
70 @cindex options, GCC command
71
72 @c man begin DESCRIPTION
73 When you invoke GCC, it normally does preprocessing, compilation,
74 assembly and linking.  The ``overall options'' allow you to stop this
75 process at an intermediate stage.  For example, the @option{-c} option
76 says not to run the linker.  Then the output consists of object files
77 output by the assembler.
78
79 Other options are passed on to one stage of processing.  Some options
80 control the preprocessor and others the compiler itself.  Yet other
81 options control the assembler and linker; most of these are not
82 documented here, since you rarely need to use any of them.
83
84 @cindex C compilation options
85 Most of the command line options that you can use with GCC are useful
86 for C programs; when an option is only useful with another language
87 (usually C++), the explanation says so explicitly.  If the description
88 for a particular option does not mention a source language, you can use
89 that option with all supported languages.
90
91 @cindex C++ compilation options
92 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
93 options for compiling C++ programs.
94
95 @cindex grouping options
96 @cindex options, grouping
97 The @command{gcc} program accepts options and file names as operands.  Many
98 options have multi-letter names; therefore multiple single-letter options
99 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
100 -r}}.
101
102 @cindex order of options
103 @cindex options, order
104 You can mix options and other arguments.  For the most part, the order
105 you use doesn't matter.  Order does matter when you use several
106 options of the same kind; for example, if you specify @option{-L} more
107 than once, the directories are searched in the order specified.  Also,
108 the placement of the @option{-l} option is significant.
109
110 Many options have long names starting with @samp{-f} or with
111 @samp{-W}---for example,
112 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
113 these have both positive and negative forms; the negative form of
114 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
115 only one of these two forms, whichever one is not the default.
116
117 @c man end
118
119 @xref{Option Index}, for an index to GCC's options.
120
121 @menu
122 * Option Summary::      Brief list of all options, without explanations.
123 * Overall Options::     Controlling the kind of output:
124                         an executable, object files, assembler files,
125                         or preprocessed source.
126 * Invoking G++::        Compiling C++ programs.
127 * C Dialect Options::   Controlling the variant of C language compiled.
128 * C++ Dialect Options:: Variations on C++.
129 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
130                         and Objective-C++.
131 * Language Independent Options:: Controlling how diagnostics should be
132                         formatted.
133 * Warning Options::     How picky should the compiler be?
134 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
135 * Optimize Options::    How much optimization?
136 * Preprocessor Options:: Controlling header files and macro definitions.
137                          Also, getting dependency information for Make.
138 * Assembler Options::   Passing options to the assembler.
139 * Link Options::        Specifying libraries and so on.
140 * Directory Options::   Where to find header files and libraries.
141                         Where to find the compiler executable files.
142 * Spec Files::          How to pass switches to sub-processes.
143 * Target Options::      Running a cross-compiler, or an old version of GCC.
144 * Submodel Options::    Specifying minor hardware or convention variations,
145                         such as 68010 vs 68020.
146 * Code Gen Options::    Specifying conventions for function calls, data layout
147                         and register usage.
148 * Environment Variables:: Env vars that affect GCC.
149 * Precompiled Headers:: Compiling a header once, and using it many times.
150 * Running Protoize::    Automatically adding or removing function prototypes.
151 @end menu
152
153 @c man begin OPTIONS
154
155 @node Option Summary
156 @section Option Summary
157
158 Here is a summary of all the options, grouped by type.  Explanations are
159 in the following sections.
160
161 @table @emph
162 @item Overall Options
163 @xref{Overall Options,,Options Controlling the Kind of Output}.
164 @gccoptlist{-c  -S  -E  -o @var{file}  -combine  -pipe  -pass-exit-codes  @gol
165 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{]}  --target-help  @gol
166 --version @@@var{file}}
167
168 @item C Language Options
169 @xref{C Dialect Options,,Options Controlling C Dialect}.
170 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
171 -aux-info @var{filename} @gol
172 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
173 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
174 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
175 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
176 -fsigned-bitfields  -fsigned-char @gol
177 -funsigned-bitfields  -funsigned-char}
178
179 @item C++ Language Options
180 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
181 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
182 -fconserve-space  -ffriend-injection @gol
183 -fno-elide-constructors @gol
184 -fno-enforce-eh-specs @gol
185 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
186 -fno-implicit-templates @gol
187 -fno-implicit-inline-templates @gol
188 -fno-implement-inlines  -fms-extensions @gol
189 -fno-nonansi-builtins  -fno-operator-names @gol
190 -fno-optional-diags  -fpermissive @gol
191 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
192 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
193 -fno-default-inline  -fvisibility-inlines-hidden @gol
194 -Wabi  -Wctor-dtor-privacy @gol
195 -Wnon-virtual-dtor  -Wreorder @gol
196 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
197 -Wno-non-template-friend  -Wold-style-cast @gol
198 -Woverloaded-virtual  -Wno-pmf-conversions @gol
199 -Wsign-promo}
200
201 @item Objective-C and Objective-C++ Language Options
202 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
203 Objective-C and Objective-C++ Dialects}.
204 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
205 -fgnu-runtime  -fnext-runtime @gol
206 -fno-nil-receivers @gol
207 -fobjc-call-cxx-cdtors @gol
208 -fobjc-direct-dispatch @gol
209 -fobjc-exceptions @gol
210 -fobjc-gc @gol
211 -freplace-objc-classes @gol
212 -fzero-link @gol
213 -gen-decls @gol
214 -Wassign-intercept @gol
215 -Wno-protocol  -Wselector @gol
216 -Wstrict-selector-match @gol
217 -Wundeclared-selector}
218
219 @item Language Independent Options
220 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
221 @gccoptlist{-fmessage-length=@var{n}  @gol
222 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
223 -fdiagnostics-show-option}
224
225 @item Warning Options
226 @xref{Warning Options,,Options to Request or Suppress Warnings}.
227 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
228 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
229 -Wno-attributes -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
230 -Wchar-subscripts -Wclobbered  -Wcomment @gol
231 -Wconversion  -Wcoverage-mismatch  -Wno-deprecated-declarations @gol
232 -Wdisabled-optimization  -Wno-div-by-zero  @gol
233 -Wempty-body  -Wno-endif-labels @gol
234 -Werror  -Werror=* @gol
235 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
236 -Wno-format-extra-args -Wformat-nonliteral @gol
237 -Wformat-security  -Wformat-y2k @gol
238 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
239 -Wimport  -Wno-import  -Winit-self  -Winline @gol
240 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
241 -Winvalid-pch -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations @gol
242 -Wlogical-op -Wlong-long @gol
243 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
244 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
245 -Wmissing-noreturn @gol
246 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
247 -Woverlength-strings  -Wpacked  -Wpadded @gol
248 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
249 -Wredundant-decls @gol
250 -Wreturn-type  -Wsequence-point  -Wshadow @gol
251 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
252 -Wstrict-aliasing -Wstrict-aliasing=n @gol
253 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
254 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
255 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
256 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
257 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
258 -Wunused-value  -Wunused-variable @gol
259 -Wvariadic-macros -Wvla @gol
260 -Wvolatile-register-var  -Wwrite-strings}
261
262 @item C-only Warning Options
263 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
264 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
265 -Wold-style-declaration  -Wold-style-definition @gol
266 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
267 -Wdeclaration-after-statement -Wpointer-sign}
268
269 @item Debugging Options
270 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
271 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
272 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
273 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
274 -fdump-ipa-all -fdump-ipa-cgraph @gol
275 -fdump-tree-all @gol
276 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
277 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
278 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
279 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
280 -fdump-tree-ch @gol
281 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
282 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
283 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
284 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
285 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
288 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-nrv -fdump-tree-vect @gol
290 -fdump-tree-sink @gol
291 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-salias @gol
293 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
295 -ftree-vectorizer-verbose=@var{n} @gol
296 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
297 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
298 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
299 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
300 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
301 -ftest-coverage  -ftime-report -fvar-tracking @gol
302 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
303 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
304 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
305 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
306 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
307 -print-multi-directory  -print-multi-lib @gol
308 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
309 -print-sysroot-headers-suffix @gol
310 -save-temps  -time}
311
312 @item Optimization Options
313 @xref{Optimize Options,,Options that Control Optimization}.
314 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
315 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
316 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
317 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
318 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
319 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
320 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
321 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
322 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
323 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
324 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
325 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
326 -finline-functions  -finline-functions-called-once @gol
327 -finline-limit=@var{n}  -fkeep-inline-functions @gol
328 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
329 -fmodulo-sched -fno-branch-count-reg @gol
330 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
331 -fno-function-cse  -fno-guess-branch-probability @gol
332 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
333 -funsafe-math-optimizations  -funsafe-loop-optimizations @gol
334 -ffinite-math-only  -fno-signed-zeros @gol
335 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
336 -fomit-frame-pointer  -foptimize-register-move @gol
337 -foptimize-sibling-calls  -fpredictive-commoning -fprefetch-loop-arrays @gol
338 -fprofile-generate -fprofile-use @gol
339 -fregmove  -frename-registers @gol
340 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
341 -frerun-cse-after-loop @gol
342 -frounding-math -frtl-abstract-sequences @gol
343 -fschedule-insns  -fschedule-insns2 @gol
344 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
345 -fsched-spec-load-dangerous  @gol
346 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
347 -fsched2-use-superblocks @gol
348 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
349 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
350 -fno-split-wide-types -fstack-protector  -fstack-protector-all @gol
351 -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps @gol
352 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
353 -fsplit-ivs-in-unroller -funswitch-loops @gol
354 -fvariable-expansion-in-unroller @gol
355 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
356 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
357 -fcheck-data-deps @gol
358 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
359 -ftree-ch -ftree-sra -ftree-ter -ftree-fre -ftree-vectorize @gol
360 -ftree-vect-loop-version -ftree-salias -fipa-pta -fweb @gol
361 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
362 --param @var{name}=@var{value}
363 -O  -O0  -O1  -O2  -O3  -Os}
364
365 @item Preprocessor Options
366 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
367 @gccoptlist{-A@var{question}=@var{answer} @gol
368 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
369 -C  -dD  -dI  -dM  -dN @gol
370 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
371 -idirafter @var{dir} @gol
372 -include @var{file}  -imacros @var{file} @gol
373 -iprefix @var{file}  -iwithprefix @var{dir} @gol
374 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
375 -imultilib @var{dir} -isysroot @var{dir} @gol
376 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
377 -P  -fworking-directory  -remap @gol
378 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
379 -Xpreprocessor @var{option}}
380
381 @item Assembler Option
382 @xref{Assembler Options,,Passing Options to the Assembler}.
383 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
384
385 @item Linker Options
386 @xref{Link Options,,Options for Linking}.
387 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
388 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
389 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
390 -Wl,@var{option}  -Xlinker @var{option} @gol
391 -u @var{symbol}}
392
393 @item Directory Options
394 @xref{Directory Options,,Options for Directory Search}.
395 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
396 -specs=@var{file}  -I- --sysroot=@var{dir}}
397
398 @item Target Options
399 @c I wrote this xref this way to avoid overfull hbox. -- rms
400 @xref{Target Options}.
401 @gccoptlist{-V @var{version}  -b @var{machine}}
402
403 @item Machine Dependent Options
404 @xref{Submodel Options,,Hardware Models and Configurations}.
405 @c This list is ordered alphanumerically by subsection name.
406 @c Try and put the significant identifier (CPU or system) first,
407 @c so users have a clue at guessing where the ones they want will be.
408
409 @emph{ARC Options}
410 @gccoptlist{-EB  -EL @gol
411 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
412 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
413
414 @emph{ARM Options}
415 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
416 -mabi=@var{name} @gol
417 -mapcs-stack-check  -mno-apcs-stack-check @gol
418 -mapcs-float  -mno-apcs-float @gol
419 -mapcs-reentrant  -mno-apcs-reentrant @gol
420 -msched-prolog  -mno-sched-prolog @gol
421 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
422 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
423 -mthumb-interwork  -mno-thumb-interwork @gol
424 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
425 -mstructure-size-boundary=@var{n} @gol
426 -mabort-on-noreturn @gol
427 -mlong-calls  -mno-long-calls @gol
428 -msingle-pic-base  -mno-single-pic-base @gol
429 -mpic-register=@var{reg} @gol
430 -mnop-fun-dllimport @gol
431 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
432 -mpoke-function-name @gol
433 -mthumb  -marm @gol
434 -mtpcs-frame  -mtpcs-leaf-frame @gol
435 -mcaller-super-interworking  -mcallee-super-interworking @gol
436 -mtp=@var{name}}
437
438 @emph{AVR Options}
439 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
440 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
441
442 @emph{Blackfin Options}
443 @gccoptlist{-mcpu=@var{cpu}  -msim  -momit-leaf-frame-pointer @gol
444 -mno-omit-leaf-frame-pointer  -mspecld-anomaly  -mno-specld-anomaly @gol
445 -mcsync-anomaly  -mno-csync-anomaly  -mlow-64k  -mno-low64k @gol
446 -mstack-check-l1  -mid-shared-library  -mno-id-shared-library @gol
447 -mshared-library-id=@var{n}  -mleaf-id-shared-library @gol
448 -mno-leaf-id-shared-library  -msep-data  -mno-sep-data  -mlong-calls @gol
449 -mno-long-calls}
450
451 @emph{CRIS Options}
452 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
453 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
454 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
455 -mstack-align  -mdata-align  -mconst-align @gol
456 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
457 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
458 -mmul-bug-workaround  -mno-mul-bug-workaround}
459
460 @emph{CRX Options}
461 @gccoptlist{-mmac -mpush-args}
462
463 @emph{Darwin Options}
464 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
465 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
466 -client_name  -compatibility_version  -current_version @gol
467 -dead_strip @gol
468 -dependency-file  -dylib_file  -dylinker_install_name @gol
469 -dynamic  -dynamiclib  -exported_symbols_list @gol
470 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
471 -force_flat_namespace  -headerpad_max_install_names @gol
472 -iframework @gol
473 -image_base  -init  -install_name  -keep_private_externs @gol
474 -multi_module  -multiply_defined  -multiply_defined_unused @gol
475 -noall_load   -no_dead_strip_inits_and_terms @gol
476 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
477 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
478 -private_bundle  -read_only_relocs  -sectalign @gol
479 -sectobjectsymbols  -whyload  -seg1addr @gol
480 -sectcreate  -sectobjectsymbols  -sectorder @gol
481 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
482 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
483 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
484 -single_module  -static  -sub_library  -sub_umbrella @gol
485 -twolevel_namespace  -umbrella  -undefined @gol
486 -unexported_symbols_list  -weak_reference_mismatches @gol
487 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
488 -mkernel -mone-byte-bool}
489
490 @emph{DEC Alpha Options}
491 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
492 -mieee  -mieee-with-inexact  -mieee-conformant @gol
493 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
494 -mtrap-precision=@var{mode}  -mbuild-constants @gol
495 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
496 -mbwx  -mmax  -mfix  -mcix @gol
497 -mfloat-vax  -mfloat-ieee @gol
498 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
499 -msmall-text  -mlarge-text @gol
500 -mmemory-latency=@var{time}}
501
502 @emph{DEC Alpha/VMS Options}
503 @gccoptlist{-mvms-return-codes}
504
505 @emph{FRV Options}
506 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
507 -mhard-float  -msoft-float @gol
508 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
509 -mdouble  -mno-double @gol
510 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
511 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
512 -mlinked-fp  -mlong-calls  -malign-labels @gol
513 -mlibrary-pic  -macc-4  -macc-8 @gol
514 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
515 -moptimize-membar -mno-optimize-membar @gol
516 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
517 -mvliw-branch  -mno-vliw-branch @gol
518 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
519 -mno-nested-cond-exec  -mtomcat-stats @gol
520 -mTLS -mtls @gol
521 -mcpu=@var{cpu}}
522
523 @emph{GNU/Linux Options}
524 @gccoptlist{-muclibc}
525
526 @emph{H8/300 Options}
527 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
528
529 @emph{HPPA Options}
530 @gccoptlist{-march=@var{architecture-type} @gol
531 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
532 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
533 -mfixed-range=@var{register-range} @gol
534 -mjump-in-delay -mlinker-opt -mlong-calls @gol
535 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
536 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
537 -mno-jump-in-delay  -mno-long-load-store @gol
538 -mno-portable-runtime  -mno-soft-float @gol
539 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
540 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
541 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
542 -munix=@var{unix-std}  -nolibdld  -static  -threads}
543
544 @emph{i386 and x86-64 Options}
545 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
546 -mfpmath=@var{unit} @gol
547 -masm=@var{dialect}  -mno-fancy-math-387 @gol
548 -mno-fp-ret-in-387  -msoft-float @gol
549 -mno-wide-multiply  -mrtd  -malign-double @gol
550 -mpreferred-stack-boundary=@var{num} -mcx16 -msahf @gol
551 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 @gol
552 -msse4a -m3dnow -mpopcnt -mabm @gol
553 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
554 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
555 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
556 -mpc32 -mpc64 -mpc80 mstackrealign @gol
557 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
558 -mcmodel=@var{code-model} @gol
559 -m32  -m64 -mlarge-data-threshold=@var{num}}
560
561 @emph{IA-64 Options}
562 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
563 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
564 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
565 -minline-float-divide-max-throughput @gol
566 -minline-int-divide-min-latency @gol
567 -minline-int-divide-max-throughput  @gol
568 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
569 -mno-dwarf2-asm -mearly-stop-bits @gol
570 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
571 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
572 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
573 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
574 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
575 -mno-sched-prefer-non-data-spec-insns @gol
576 -mno-sched-prefer-non-control-spec-insns @gol
577 -mno-sched-count-spec-in-critical-path}
578
579 @emph{M32R/D Options}
580 @gccoptlist{-m32r2 -m32rx -m32r @gol
581 -mdebug @gol
582 -malign-loops -mno-align-loops @gol
583 -missue-rate=@var{number} @gol
584 -mbranch-cost=@var{number} @gol
585 -mmodel=@var{code-size-model-type} @gol
586 -msdata=@var{sdata-type} @gol
587 -mno-flush-func -mflush-func=@var{name} @gol
588 -mno-flush-trap -mflush-trap=@var{number} @gol
589 -G @var{num}}
590
591 @emph{M32C Options}
592 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
593
594 @emph{M680x0 Options}
595 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
596 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
597 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
598 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
599 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
600 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
601 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
602 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
603
604 @emph{M68hc1x Options}
605 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
606 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
607 -msoft-reg-count=@var{count}}
608
609 @emph{MCore Options}
610 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
611 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
612 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
613 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
614 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
615
616 @emph{MIPS Options}
617 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
618 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
619 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
620 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64 @gol
621 -mfp32  -mfp64  -mhard-float  -msoft-float @gol
622 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
623 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
624 -mips3d  -mno-mips3d  -mmt  -mno-mt @gol
625 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
626 -G@var{num}  -membedded-data  -mno-embedded-data @gol
627 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
628 -msplit-addresses  -mno-split-addresses @gol
629 -mexplicit-relocs  -mno-explicit-relocs @gol
630 -mcheck-zero-division  -mno-check-zero-division @gol
631 -mdivide-traps  -mdivide-breaks @gol
632 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
633 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
634 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
635 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130  -mno-fix-vr4130 @gol
636 -mfix-sb1  -mno-fix-sb1 @gol
637 -mflush-func=@var{func}  -mno-flush-func @gol
638 -mbranch-likely  -mno-branch-likely @gol
639 -mfp-exceptions -mno-fp-exceptions @gol
640 -mvr4130-align -mno-vr4130-align}
641
642 @emph{MMIX Options}
643 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
644 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
645 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
646 -mno-base-addresses  -msingle-exit  -mno-single-exit}
647
648 @emph{MN10300 Options}
649 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
650 -mam33  -mno-am33 @gol
651 -mam33-2  -mno-am33-2 @gol
652 -mreturn-pointer-on-d0 @gol
653 -mno-crt0  -mrelax}
654
655 @emph{MT Options}
656 @gccoptlist{-mno-crt0 -mbacc -msim @gol
657 -march=@var{cpu-type} }
658
659 @emph{PDP-11 Options}
660 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
661 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
662 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
663 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
664 -mbranch-expensive  -mbranch-cheap @gol
665 -msplit  -mno-split  -munix-asm  -mdec-asm}
666
667 @emph{PowerPC Options}
668 See RS/6000 and PowerPC Options.
669
670 @emph{RS/6000 and PowerPC Options}
671 @gccoptlist{-mcpu=@var{cpu-type} @gol
672 -mtune=@var{cpu-type} @gol
673 -mpower  -mno-power  -mpower2  -mno-power2 @gol
674 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
675 -maltivec  -mno-altivec @gol
676 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
677 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
678 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
679 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mdfp -mno-dfp @gol
680 -mnew-mnemonics  -mold-mnemonics @gol
681 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
682 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
683 -malign-power  -malign-natural @gol
684 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
685 -mstring  -mno-string  -mupdate  -mno-update @gol
686 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
687 -mstrict-align  -mno-strict-align  -mrelocatable @gol
688 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
689 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
690 -mdynamic-no-pic  -maltivec  -mswdiv @gol
691 -mprioritize-restricted-insns=@var{priority} @gol
692 -msched-costly-dep=@var{dependence_type} @gol
693 -minsert-sched-nops=@var{scheme} @gol
694 -mcall-sysv  -mcall-netbsd @gol
695 -maix-struct-return  -msvr4-struct-return @gol
696 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
697 -misel -mno-isel @gol
698 -misel=yes  -misel=no @gol
699 -mspe -mno-spe @gol
700 -mspe=yes  -mspe=no @gol
701 -mvrsave -mno-vrsave @gol
702 -mmulhw -mno-mulhw @gol
703 -mdlmzb -mno-dlmzb @gol
704 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
705 -mprototype  -mno-prototype @gol
706 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
707 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
708
709 @emph{S/390 and zSeries Options}
710 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
711 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
712 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
713 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
714 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
715 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
716 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
717
718 @emph{Score Options}
719 @gccoptlist{-meb -mel @gol
720 -mnhwloop @gol
721 -muls @gol
722 -mmac @gol
723 -mscore5 -mscore5u -mscore7 -mscore7d}
724
725 @emph{SH Options}
726 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
727 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
728 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
729 -m5-64media  -m5-64media-nofpu @gol
730 -m5-32media  -m5-32media-nofpu @gol
731 -m5-compact  -m5-compact-nofpu @gol
732 -mb  -ml  -mdalign  -mrelax @gol
733 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
734 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
735 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
736 -mdivsi3_libfunc=@var{name}  @gol
737 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
738  -minvalid-symbols}
739
740 @emph{SPARC Options}
741 @gccoptlist{-mcpu=@var{cpu-type} @gol
742 -mtune=@var{cpu-type} @gol
743 -mcmodel=@var{code-model} @gol
744 -m32  -m64  -mapp-regs  -mno-app-regs @gol
745 -mfaster-structs  -mno-faster-structs @gol
746 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
747 -mhard-quad-float  -msoft-quad-float @gol
748 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
749 -mstack-bias  -mno-stack-bias @gol
750 -munaligned-doubles  -mno-unaligned-doubles @gol
751 -mv8plus  -mno-v8plus  -mvis  -mno-vis
752 -threads -pthreads -pthread}
753
754 @emph{SPU Options}
755 @gccoptlist{-mwarn-reloc -merror-reloc @gol
756 -msafe-dma -munsafe-dma @gol
757 -mbranch-hints @gol
758 -msmall-mem -mlarge-mem -mstdmain @gol
759 -mfixed-range=@var{register-range}}
760
761 @emph{System V Options}
762 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
763
764 @emph{TMS320C3x/C4x Options}
765 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
766 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
767 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
768 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
769
770 @emph{V850 Options}
771 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
772 -mprolog-function  -mno-prolog-function  -mspace @gol
773 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
774 -mapp-regs  -mno-app-regs @gol
775 -mdisable-callt  -mno-disable-callt @gol
776 -mv850e1 @gol
777 -mv850e @gol
778 -mv850  -mbig-switch}
779
780 @emph{VAX Options}
781 @gccoptlist{-mg  -mgnu  -munix}
782
783 @emph{VxWorks Options}
784 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
785 -Xbind-lazy  -Xbind-now}
786
787 @emph{x86-64 Options}
788 See i386 and x86-64 Options.
789
790 @emph{Xstormy16 Options}
791 @gccoptlist{-msim}
792
793 @emph{Xtensa Options}
794 @gccoptlist{-mconst16 -mno-const16 @gol
795 -mfused-madd  -mno-fused-madd @gol
796 -mtext-section-literals  -mno-text-section-literals @gol
797 -mtarget-align  -mno-target-align @gol
798 -mlongcalls  -mno-longcalls}
799
800 @emph{zSeries Options}
801 See S/390 and zSeries Options.
802
803 @item Code Generation Options
804 @xref{Code Gen Options,,Options for Code Generation Conventions}.
805 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
806 -ffixed-@var{reg}  -fexceptions @gol
807 -fnon-call-exceptions  -funwind-tables @gol
808 -fasynchronous-unwind-tables @gol
809 -finhibit-size-directive  -finstrument-functions @gol
810 -fno-common  -fno-ident @gol
811 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
812 -fno-jump-tables @gol
813 -frecord-gcc-switches @gol
814 -freg-struct-return  -fshort-enums @gol
815 -fshort-double  -fshort-wchar @gol
816 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
817 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
818 -fargument-alias  -fargument-noalias @gol
819 -fargument-noalias-global  -fargument-noalias-anything
820 -fleading-underscore  -ftls-model=@var{model} @gol
821 -ftrapv  -fwrapv  -fbounds-check @gol
822 -fvisibility}
823 @end table
824
825 @menu
826 * Overall Options::     Controlling the kind of output:
827                         an executable, object files, assembler files,
828                         or preprocessed source.
829 * C Dialect Options::   Controlling the variant of C language compiled.
830 * C++ Dialect Options:: Variations on C++.
831 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
832                         and Objective-C++.
833 * Language Independent Options:: Controlling how diagnostics should be
834                         formatted.
835 * Warning Options::     How picky should the compiler be?
836 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
837 * Optimize Options::    How much optimization?
838 * Preprocessor Options:: Controlling header files and macro definitions.
839                          Also, getting dependency information for Make.
840 * Assembler Options::   Passing options to the assembler.
841 * Link Options::        Specifying libraries and so on.
842 * Directory Options::   Where to find header files and libraries.
843                         Where to find the compiler executable files.
844 * Spec Files::          How to pass switches to sub-processes.
845 * Target Options::      Running a cross-compiler, or an old version of GCC.
846 @end menu
847
848 @node Overall Options
849 @section Options Controlling the Kind of Output
850
851 Compilation can involve up to four stages: preprocessing, compilation
852 proper, assembly and linking, always in that order.  GCC is capable of
853 preprocessing and compiling several files either into several
854 assembler input files, or into one assembler input file; then each
855 assembler input file produces an object file, and linking combines all
856 the object files (those newly compiled, and those specified as input)
857 into an executable file.
858
859 @cindex file name suffix
860 For any given input file, the file name suffix determines what kind of
861 compilation is done:
862
863 @table @gcctabopt
864 @item @var{file}.c
865 C source code which must be preprocessed.
866
867 @item @var{file}.i
868 C source code which should not be preprocessed.
869
870 @item @var{file}.ii
871 C++ source code which should not be preprocessed.
872
873 @item @var{file}.m
874 Objective-C source code.  Note that you must link with the @file{libobjc}
875 library to make an Objective-C program work.
876
877 @item @var{file}.mi
878 Objective-C source code which should not be preprocessed.
879
880 @item @var{file}.mm
881 @itemx @var{file}.M
882 Objective-C++ source code.  Note that you must link with the @file{libobjc}
883 library to make an Objective-C++ program work.  Note that @samp{.M} refers
884 to a literal capital M@.
885
886 @item @var{file}.mii
887 Objective-C++ source code which should not be preprocessed.
888
889 @item @var{file}.h
890 C, C++, Objective-C or Objective-C++ header file to be turned into a
891 precompiled header.
892
893 @item @var{file}.cc
894 @itemx @var{file}.cp
895 @itemx @var{file}.cxx
896 @itemx @var{file}.cpp
897 @itemx @var{file}.CPP
898 @itemx @var{file}.c++
899 @itemx @var{file}.C
900 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
901 the last two letters must both be literally @samp{x}.  Likewise,
902 @samp{.C} refers to a literal capital C@.
903
904 @item @var{file}.mm
905 @itemx @var{file}.M
906 Objective-C++ source code which must be preprocessed.
907
908 @item @var{file}.mii
909 Objective-C++ source code which should not be preprocessed.
910
911 @item @var{file}.hh
912 @itemx @var{file}.H
913 C++ header file to be turned into a precompiled header.
914
915 @item @var{file}.f
916 @itemx @var{file}.for
917 @itemx @var{file}.FOR
918 Fixed form Fortran source code which should not be preprocessed.
919
920 @item @var{file}.F
921 @itemx @var{file}.fpp
922 @itemx @var{file}.FPP
923 Fixed form Fortran source code which must be preprocessed (with the traditional
924 preprocessor).
925
926 @item @var{file}.f90
927 @itemx @var{file}.f95
928 Free form Fortran source code which should not be preprocessed.
929
930 @item @var{file}.F90
931 @itemx @var{file}.F95
932 Free form Fortran source code which must be preprocessed (with the
933 traditional preprocessor).
934
935 @c FIXME: Descriptions of Java file types.
936 @c @var{file}.java
937 @c @var{file}.class
938 @c @var{file}.zip
939 @c @var{file}.jar
940
941 @item @var{file}.ads
942 Ada source code file which contains a library unit declaration (a
943 declaration of a package, subprogram, or generic, or a generic
944 instantiation), or a library unit renaming declaration (a package,
945 generic, or subprogram renaming declaration).  Such files are also
946 called @dfn{specs}.
947
948 @itemx @var{file}.adb
949 Ada source code file containing a library unit body (a subprogram or
950 package body).  Such files are also called @dfn{bodies}.
951
952 @c GCC also knows about some suffixes for languages not yet included:
953 @c Pascal:
954 @c @var{file}.p
955 @c @var{file}.pas
956 @c Ratfor:
957 @c @var{file}.r
958
959 @item @var{file}.s
960 Assembler code.
961
962 @item @var{file}.S
963 Assembler code which must be preprocessed.
964
965 @item @var{other}
966 An object file to be fed straight into linking.
967 Any file name with no recognized suffix is treated this way.
968 @end table
969
970 @opindex x
971 You can specify the input language explicitly with the @option{-x} option:
972
973 @table @gcctabopt
974 @item -x @var{language}
975 Specify explicitly the @var{language} for the following input files
976 (rather than letting the compiler choose a default based on the file
977 name suffix).  This option applies to all following input files until
978 the next @option{-x} option.  Possible values for @var{language} are:
979 @smallexample
980 c  c-header  c-cpp-output
981 c++  c++-header  c++-cpp-output
982 objective-c  objective-c-header  objective-c-cpp-output
983 objective-c++ objective-c++-header objective-c++-cpp-output
984 assembler  assembler-with-cpp
985 ada
986 f95  f95-cpp-input
987 java
988 treelang
989 @end smallexample
990
991 @item -x none
992 Turn off any specification of a language, so that subsequent files are
993 handled according to their file name suffixes (as they are if @option{-x}
994 has not been used at all).
995
996 @item -pass-exit-codes
997 @opindex pass-exit-codes
998 Normally the @command{gcc} program will exit with the code of 1 if any
999 phase of the compiler returns a non-success return code.  If you specify
1000 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1001 numerically highest error produced by any phase that returned an error
1002 indication.  The C, C++, and Fortran frontends return 4, if an internal
1003 compiler error is encountered.
1004 @end table
1005
1006 If you only want some of the stages of compilation, you can use
1007 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1008 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1009 @command{gcc} is to stop.  Note that some combinations (for example,
1010 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1011
1012 @table @gcctabopt
1013 @item -c
1014 @opindex c
1015 Compile or assemble the source files, but do not link.  The linking
1016 stage simply is not done.  The ultimate output is in the form of an
1017 object file for each source file.
1018
1019 By default, the object file name for a source file is made by replacing
1020 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1021
1022 Unrecognized input files, not requiring compilation or assembly, are
1023 ignored.
1024
1025 @item -S
1026 @opindex S
1027 Stop after the stage of compilation proper; do not assemble.  The output
1028 is in the form of an assembler code file for each non-assembler input
1029 file specified.
1030
1031 By default, the assembler file name for a source file is made by
1032 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1033
1034 Input files that don't require compilation are ignored.
1035
1036 @item -E
1037 @opindex E
1038 Stop after the preprocessing stage; do not run the compiler proper.  The
1039 output is in the form of preprocessed source code, which is sent to the
1040 standard output.
1041
1042 Input files which don't require preprocessing are ignored.
1043
1044 @cindex output file option
1045 @item -o @var{file}
1046 @opindex o
1047 Place output in file @var{file}.  This applies regardless to whatever
1048 sort of output is being produced, whether it be an executable file,
1049 an object file, an assembler file or preprocessed C code.
1050
1051 If @option{-o} is not specified, the default is to put an executable
1052 file in @file{a.out}, the object file for
1053 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1054 assembler file in @file{@var{source}.s}, a precompiled header file in
1055 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1056 standard output.
1057
1058 @item -v
1059 @opindex v
1060 Print (on standard error output) the commands executed to run the stages
1061 of compilation.  Also print the version number of the compiler driver
1062 program and of the preprocessor and the compiler proper.
1063
1064 @item -###
1065 @opindex ###
1066 Like @option{-v} except the commands are not executed and all command
1067 arguments are quoted.  This is useful for shell scripts to capture the
1068 driver-generated command lines.
1069
1070 @item -pipe
1071 @opindex pipe
1072 Use pipes rather than temporary files for communication between the
1073 various stages of compilation.  This fails to work on some systems where
1074 the assembler is unable to read from a pipe; but the GNU assembler has
1075 no trouble.
1076
1077 @item -combine
1078 @opindex combine
1079 If you are compiling multiple source files, this option tells the driver
1080 to pass all the source files to the compiler at once (for those
1081 languages for which the compiler can handle this).  This will allow
1082 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1083 language for which this is supported is C@.  If you pass source files for
1084 multiple languages to the driver, using this option, the driver will invoke
1085 the compiler(s) that support IMA once each, passing each compiler all the
1086 source files appropriate for it.  For those languages that do not support
1087 IMA this option will be ignored, and the compiler will be invoked once for
1088 each source file in that language.  If you use this option in conjunction
1089 with @option{-save-temps}, the compiler will generate multiple
1090 pre-processed files
1091 (one for each source file), but only one (combined) @file{.o} or
1092 @file{.s} file.
1093
1094 @item --help
1095 @opindex help
1096 Print (on the standard output) a description of the command line options
1097 understood by @command{gcc}.  If the @option{-v} option is also specified
1098 then @option{--help} will also be passed on to the various processes
1099 invoked by @command{gcc}, so that they can display the command line options
1100 they accept.  If the @option{-Wextra} option has also been specified
1101 (prior to the @option{--help} option), then command line options which
1102 have no documentation associated with them will also be displayed.
1103
1104 @item --target-help
1105 @opindex target-help
1106 Print (on the standard output) a description of target-specific command
1107 line options for each tool.
1108
1109 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1110 Print (on the standard output) a description of the command line
1111 options understood by the compiler that fit into a specific class.
1112 The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
1113 @samp{params}, or @var{language}:
1114
1115 @table @asis
1116 @item @samp{optimizers}
1117 This will display all of the optimization options supported by the
1118 compiler.
1119
1120 @item @samp{warnings}
1121 This will display all of the options controlling warning messages
1122 produced by the compiler.
1123
1124 @item @samp{target}
1125 This will display target-specific options.  Unlike the
1126 @option{--target-help} option however, target-specific options of the
1127 linker and assembler will not be displayed.  This is because those
1128 tools do not currently support the extended @option{--help=} syntax.
1129
1130 @item @samp{params}
1131 This will display the values recognized by the @option{--param}
1132 option.
1133
1134 @item @var{language}
1135 This will display the options supported for @var{language}, where 
1136 @var{language} is the name of one of the languages supported in this 
1137 version of GCC.
1138
1139 @item @samp{common}
1140 This will display the options that are common to all languages.
1141 @end table
1142
1143 It is possible to further refine the output of the @option{--help=}
1144 option by adding a comma separated list of qualifiers after the
1145 class.  These can be any from the following list:
1146
1147 @table @asis
1148 @item @samp{undocumented}
1149 Display only those options which are undocumented.
1150
1151 @item @samp{joined}
1152 Display options which take an argument that appears after an equal
1153 sign in the same continuous piece of text, such as:
1154 @samp{--help=target}.
1155
1156 @item @samp{separate}
1157 Display options which take an argument that appears as a separate word
1158 following the original option, such as: @samp{-o output-file}.
1159 @end table
1160
1161 Thus for example to display all the undocumented target-specific
1162 switches supported by the compiler the following can be used:
1163
1164 @smallexample
1165 --help=target,undocumented
1166 @end smallexample
1167
1168 The sense of a qualifier can be inverted by prefixing it with the
1169 @var{^} character, so for example to display all binary warning
1170 options (i.e. ones that are either on or off and that do not take an
1171 argument), which have a description the following can be used:
1172
1173 @smallexample
1174 --help=warnings,^joined,^undocumented
1175 @end smallexample
1176
1177 A class can also be used as a qualifier, although this usually
1178 restricts the output by so much that there is nothing to display.  One
1179 case where it does work however is when one of the classes is
1180 @var{target}.  So for example to display all the target-specific
1181 optimization options the following can be used:
1182
1183 @smallexample
1184 --help=target,optimizers
1185 @end smallexample
1186
1187 The @option{--help=} option can be repeated on the command line.  Each
1188 successive use will display its requested class of options, skipping
1189 those that have already been displayed.
1190
1191 If the @option{-Q} option appears on the command line before the
1192 @option{--help=} option, then the descriptive text displayed by
1193 @option{--help=} is changed.  Instead of describing the displayed
1194 options, an indication is given as to whether the option is enabled,
1195 disabled or set to a specific value (assuming that the compiler
1196 knows this at the point where the @option{--help=} option is used).
1197
1198 Here is a truncated example from the ARM port of @command{gcc}:
1199
1200 @smallexample
1201   % gcc -Q -mabi=2 --help=target -c
1202   The following options are target specific:
1203   -mabi=                                2
1204   -mabort-on-noreturn                   [disabled]
1205   -mapcs                                [disabled]
1206 @end smallexample
1207
1208 The output is sensitive to the effects of previous command line
1209 options, so for example it is possible to find out which optimizations
1210 are enabled at @option{-O2} by using:
1211
1212 @smallexample
1213 -O2 --help=optimizers
1214 @end smallexample
1215
1216 Alternatively you can discover which binary optimizations are enabled
1217 by @option{-O3} by using:
1218
1219 @smallexample
1220 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1221 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1222 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1223 @end smallexample
1224
1225 @item --version
1226 @opindex version
1227 Display the version number and copyrights of the invoked GCC@.
1228
1229 @include @value{srcdir}/../libiberty/at-file.texi
1230 @end table
1231
1232 @node Invoking G++
1233 @section Compiling C++ Programs
1234
1235 @cindex suffixes for C++ source
1236 @cindex C++ source file suffixes
1237 C++ source files conventionally use one of the suffixes @samp{.C},
1238 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1239 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1240 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1241 files with these names and compiles them as C++ programs even if you
1242 call the compiler the same way as for compiling C programs (usually
1243 with the name @command{gcc}).
1244
1245 @findex g++
1246 @findex c++
1247 However, the use of @command{gcc} does not add the C++ library.
1248 @command{g++} is a program that calls GCC and treats @samp{.c},
1249 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1250 files unless @option{-x} is used, and automatically specifies linking
1251 against the C++ library.  This program is also useful when
1252 precompiling a C header file with a @samp{.h} extension for use in C++
1253 compilations.  On many systems, @command{g++} is also installed with
1254 the name @command{c++}.
1255
1256 @cindex invoking @command{g++}
1257 When you compile C++ programs, you may specify many of the same
1258 command-line options that you use for compiling programs in any
1259 language; or command-line options meaningful for C and related
1260 languages; or options that are meaningful only for C++ programs.
1261 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1262 explanations of options for languages related to C@.
1263 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1264 explanations of options that are meaningful only for C++ programs.
1265
1266 @node C Dialect Options
1267 @section Options Controlling C Dialect
1268 @cindex dialect options
1269 @cindex language dialect options
1270 @cindex options, dialect
1271
1272 The following options control the dialect of C (or languages derived
1273 from C, such as C++, Objective-C and Objective-C++) that the compiler
1274 accepts:
1275
1276 @table @gcctabopt
1277 @cindex ANSI support
1278 @cindex ISO support
1279 @item -ansi
1280 @opindex ansi
1281 In C mode, support all ISO C90 programs.  In C++ mode,
1282 remove GNU extensions that conflict with ISO C++.
1283
1284 This turns off certain features of GCC that are incompatible with ISO
1285 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1286 such as the @code{asm} and @code{typeof} keywords, and
1287 predefined macros such as @code{unix} and @code{vax} that identify the
1288 type of system you are using.  It also enables the undesirable and
1289 rarely used ISO trigraph feature.  For the C compiler,
1290 it disables recognition of C++ style @samp{//} comments as well as
1291 the @code{inline} keyword.
1292
1293 The alternate keywords @code{__asm__}, @code{__extension__},
1294 @code{__inline__} and @code{__typeof__} continue to work despite
1295 @option{-ansi}.  You would not want to use them in an ISO C program, of
1296 course, but it is useful to put them in header files that might be included
1297 in compilations done with @option{-ansi}.  Alternate predefined macros
1298 such as @code{__unix__} and @code{__vax__} are also available, with or
1299 without @option{-ansi}.
1300
1301 The @option{-ansi} option does not cause non-ISO programs to be
1302 rejected gratuitously.  For that, @option{-pedantic} is required in
1303 addition to @option{-ansi}.  @xref{Warning Options}.
1304
1305 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1306 option is used.  Some header files may notice this macro and refrain
1307 from declaring certain functions or defining certain macros that the
1308 ISO standard doesn't call for; this is to avoid interfering with any
1309 programs that might use these names for other things.
1310
1311 Functions which would normally be built in but do not have semantics
1312 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1313 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1314 built-in functions provided by GCC}, for details of the functions
1315 affected.
1316
1317 @item -std=
1318 @opindex std
1319 Determine the language standard.  This option is currently only
1320 supported when compiling C or C++.  A value for this option must be
1321 provided; possible values are
1322
1323 @table @samp
1324 @item c89
1325 @itemx iso9899:1990
1326 ISO C90 (same as @option{-ansi}).
1327
1328 @item iso9899:199409
1329 ISO C90 as modified in amendment 1.
1330
1331 @item c99
1332 @itemx c9x
1333 @itemx iso9899:1999
1334 @itemx iso9899:199x
1335 ISO C99.  Note that this standard is not yet fully supported; see
1336 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1337 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1338
1339 @item gnu89
1340 Default, ISO C90 plus GNU extensions (including some C99 features).
1341
1342 @item gnu99
1343 @itemx gnu9x
1344 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1345 this will become the default.  The name @samp{gnu9x} is deprecated.
1346
1347 @item c++98
1348 The 1998 ISO C++ standard plus amendments.
1349
1350 @item gnu++98
1351 The same as @option{-std=c++98} plus GNU extensions.  This is the
1352 default for C++ code.
1353
1354 @item c++0x
1355 The working draft of the upcoming ISO C++0x standard. This option
1356 enables experimental features that are likely to be included in
1357 C++0x. The working draft is constantly changing, and any feature that is
1358 enabled by this flag may be removed from future versions of GCC if it is
1359 not part of the C++0x standard.
1360
1361 @item gnu++0x
1362 The same as @option{-std=c++0x} plus GNU extensions. As with
1363 @option{-std=c++0x}, this option enables experimental features that may
1364 be removed in future versions of GCC.
1365 @end table
1366
1367 Even when this option is not specified, you can still use some of the
1368 features of newer standards in so far as they do not conflict with
1369 previous C standards.  For example, you may use @code{__restrict__} even
1370 when @option{-std=c99} is not specified.
1371
1372 The @option{-std} options specifying some version of ISO C have the same
1373 effects as @option{-ansi}, except that features that were not in ISO C90
1374 but are in the specified version (for example, @samp{//} comments and
1375 the @code{inline} keyword in ISO C99) are not disabled.
1376
1377 @xref{Standards,,Language Standards Supported by GCC}, for details of
1378 these standard versions.
1379
1380 @item -fgnu89-inline
1381 @opindex fgnu89-inline
1382 The option @option{-fgnu89-inline} tells GCC to use the traditional
1383 GNU semantics for @code{inline} functions when in C99 mode.
1384 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1385 is accepted and ignored by GCC versions 4.1.3 up to but not including
1386 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1387 C99 mode.  Using this option is roughly equivalent to adding the
1388 @code{gnu_inline} function attribute to all inline functions
1389 (@pxref{Function Attributes}).
1390
1391 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1392 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1393 specifies the default behavior).  This option was first supported in
1394 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1395
1396 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1397 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1398 in effect for @code{inline} functions.  @xref{Common Predefined
1399 Macros,,,cpp,The C Preprocessor}.
1400
1401 @item -aux-info @var{filename}
1402 @opindex aux-info
1403 Output to the given filename prototyped declarations for all functions
1404 declared and/or defined in a translation unit, including those in header
1405 files.  This option is silently ignored in any language other than C@.
1406
1407 Besides declarations, the file indicates, in comments, the origin of
1408 each declaration (source file and line), whether the declaration was
1409 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1410 @samp{O} for old, respectively, in the first character after the line
1411 number and the colon), and whether it came from a declaration or a
1412 definition (@samp{C} or @samp{F}, respectively, in the following
1413 character).  In the case of function definitions, a K&R-style list of
1414 arguments followed by their declarations is also provided, inside
1415 comments, after the declaration.
1416
1417 @item -fno-asm
1418 @opindex fno-asm
1419 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1420 keyword, so that code can use these words as identifiers.  You can use
1421 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1422 instead.  @option{-ansi} implies @option{-fno-asm}.
1423
1424 In C++, this switch only affects the @code{typeof} keyword, since
1425 @code{asm} and @code{inline} are standard keywords.  You may want to
1426 use the @option{-fno-gnu-keywords} flag instead, which has the same
1427 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1428 switch only affects the @code{asm} and @code{typeof} keywords, since
1429 @code{inline} is a standard keyword in ISO C99.
1430
1431 @item -fno-builtin
1432 @itemx -fno-builtin-@var{function}
1433 @opindex fno-builtin
1434 @cindex built-in functions
1435 Don't recognize built-in functions that do not begin with
1436 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1437 functions provided by GCC}, for details of the functions affected,
1438 including those which are not built-in functions when @option{-ansi} or
1439 @option{-std} options for strict ISO C conformance are used because they
1440 do not have an ISO standard meaning.
1441
1442 GCC normally generates special code to handle certain built-in functions
1443 more efficiently; for instance, calls to @code{alloca} may become single
1444 instructions that adjust the stack directly, and calls to @code{memcpy}
1445 may become inline copy loops.  The resulting code is often both smaller
1446 and faster, but since the function calls no longer appear as such, you
1447 cannot set a breakpoint on those calls, nor can you change the behavior
1448 of the functions by linking with a different library.  In addition,
1449 when a function is recognized as a built-in function, GCC may use
1450 information about that function to warn about problems with calls to
1451 that function, or to generate more efficient code, even if the
1452 resulting code still contains calls to that function.  For example,
1453 warnings are given with @option{-Wformat} for bad calls to
1454 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1455 known not to modify global memory.
1456
1457 With the @option{-fno-builtin-@var{function}} option
1458 only the built-in function @var{function} is
1459 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1460 function is named this is not built-in in this version of GCC, this
1461 option is ignored.  There is no corresponding
1462 @option{-fbuiltin-@var{function}} option; if you wish to enable
1463 built-in functions selectively when using @option{-fno-builtin} or
1464 @option{-ffreestanding}, you may define macros such as:
1465
1466 @smallexample
1467 #define abs(n)          __builtin_abs ((n))
1468 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1469 @end smallexample
1470
1471 @item -fhosted
1472 @opindex fhosted
1473 @cindex hosted environment
1474
1475 Assert that compilation takes place in a hosted environment.  This implies
1476 @option{-fbuiltin}.  A hosted environment is one in which the
1477 entire standard library is available, and in which @code{main} has a return
1478 type of @code{int}.  Examples are nearly everything except a kernel.
1479 This is equivalent to @option{-fno-freestanding}.
1480
1481 @item -ffreestanding
1482 @opindex ffreestanding
1483 @cindex hosted environment
1484
1485 Assert that compilation takes place in a freestanding environment.  This
1486 implies @option{-fno-builtin}.  A freestanding environment
1487 is one in which the standard library may not exist, and program startup may
1488 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1489 This is equivalent to @option{-fno-hosted}.
1490
1491 @xref{Standards,,Language Standards Supported by GCC}, for details of
1492 freestanding and hosted environments.
1493
1494 @item -fopenmp
1495 @opindex fopenmp
1496 @cindex openmp parallel
1497 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1498 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1499 compiler generates parallel code according to the OpenMP Application
1500 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1501
1502 @item -fms-extensions
1503 @opindex fms-extensions
1504 Accept some non-standard constructs used in Microsoft header files.
1505
1506 Some cases of unnamed fields in structures and unions are only
1507 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1508 fields within structs/unions}, for details.
1509
1510 @item -trigraphs
1511 @opindex trigraphs
1512 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1513 options for strict ISO C conformance) implies @option{-trigraphs}.
1514
1515 @item -no-integrated-cpp
1516 @opindex no-integrated-cpp
1517 Performs a compilation in two passes: preprocessing and compiling.  This
1518 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1519 @option{-B} option.  The user supplied compilation step can then add in
1520 an additional preprocessing step after normal preprocessing but before
1521 compiling.  The default is to use the integrated cpp (internal cpp)
1522
1523 The semantics of this option will change if "cc1", "cc1plus", and
1524 "cc1obj" are merged.
1525
1526 @cindex traditional C language
1527 @cindex C language, traditional
1528 @item -traditional
1529 @itemx -traditional-cpp
1530 @opindex traditional-cpp
1531 @opindex traditional
1532 Formerly, these options caused GCC to attempt to emulate a pre-standard
1533 C compiler.  They are now only supported with the @option{-E} switch.
1534 The preprocessor continues to support a pre-standard mode.  See the GNU
1535 CPP manual for details.
1536
1537 @item -fcond-mismatch
1538 @opindex fcond-mismatch
1539 Allow conditional expressions with mismatched types in the second and
1540 third arguments.  The value of such an expression is void.  This option
1541 is not supported for C++.
1542
1543 @item -flax-vector-conversions
1544 @opindex flax-vector-conversions
1545 Allow implicit conversions between vectors with differing numbers of
1546 elements and/or incompatible element types.  This option should not be
1547 used for new code.
1548
1549 @item -funsigned-char
1550 @opindex funsigned-char
1551 Let the type @code{char} be unsigned, like @code{unsigned char}.
1552
1553 Each kind of machine has a default for what @code{char} should
1554 be.  It is either like @code{unsigned char} by default or like
1555 @code{signed char} by default.
1556
1557 Ideally, a portable program should always use @code{signed char} or
1558 @code{unsigned char} when it depends on the signedness of an object.
1559 But many programs have been written to use plain @code{char} and
1560 expect it to be signed, or expect it to be unsigned, depending on the
1561 machines they were written for.  This option, and its inverse, let you
1562 make such a program work with the opposite default.
1563
1564 The type @code{char} is always a distinct type from each of
1565 @code{signed char} or @code{unsigned char}, even though its behavior
1566 is always just like one of those two.
1567
1568 @item -fsigned-char
1569 @opindex fsigned-char
1570 Let the type @code{char} be signed, like @code{signed char}.
1571
1572 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1573 the negative form of @option{-funsigned-char}.  Likewise, the option
1574 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1575
1576 @item -fsigned-bitfields
1577 @itemx -funsigned-bitfields
1578 @itemx -fno-signed-bitfields
1579 @itemx -fno-unsigned-bitfields
1580 @opindex fsigned-bitfields
1581 @opindex funsigned-bitfields
1582 @opindex fno-signed-bitfields
1583 @opindex fno-unsigned-bitfields
1584 These options control whether a bit-field is signed or unsigned, when the
1585 declaration does not use either @code{signed} or @code{unsigned}.  By
1586 default, such a bit-field is signed, because this is consistent: the
1587 basic integer types such as @code{int} are signed types.
1588 @end table
1589
1590 @node C++ Dialect Options
1591 @section Options Controlling C++ Dialect
1592
1593 @cindex compiler options, C++
1594 @cindex C++ options, command line
1595 @cindex options, C++
1596 This section describes the command-line options that are only meaningful
1597 for C++ programs; but you can also use most of the GNU compiler options
1598 regardless of what language your program is in.  For example, you
1599 might compile a file @code{firstClass.C} like this:
1600
1601 @smallexample
1602 g++ -g -frepo -O -c firstClass.C
1603 @end smallexample
1604
1605 @noindent
1606 In this example, only @option{-frepo} is an option meant
1607 only for C++ programs; you can use the other options with any
1608 language supported by GCC@.
1609
1610 Here is a list of options that are @emph{only} for compiling C++ programs:
1611
1612 @table @gcctabopt
1613
1614 @item -fabi-version=@var{n}
1615 @opindex fabi-version
1616 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1617 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1618 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1619 the version that conforms most closely to the C++ ABI specification.
1620 Therefore, the ABI obtained using version 0 will change as ABI bugs
1621 are fixed.
1622
1623 The default is version 2.
1624
1625 @item -fno-access-control
1626 @opindex fno-access-control
1627 Turn off all access checking.  This switch is mainly useful for working
1628 around bugs in the access control code.
1629
1630 @item -fcheck-new
1631 @opindex fcheck-new
1632 Check that the pointer returned by @code{operator new} is non-null
1633 before attempting to modify the storage allocated.  This check is
1634 normally unnecessary because the C++ standard specifies that
1635 @code{operator new} will only return @code{0} if it is declared
1636 @samp{throw()}, in which case the compiler will always check the
1637 return value even without this option.  In all other cases, when
1638 @code{operator new} has a non-empty exception specification, memory
1639 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1640 @samp{new (nothrow)}.
1641
1642 @item -fconserve-space
1643 @opindex fconserve-space
1644 Put uninitialized or runtime-initialized global variables into the
1645 common segment, as C does.  This saves space in the executable at the
1646 cost of not diagnosing duplicate definitions.  If you compile with this
1647 flag and your program mysteriously crashes after @code{main()} has
1648 completed, you may have an object that is being destroyed twice because
1649 two definitions were merged.
1650
1651 This option is no longer useful on most targets, now that support has
1652 been added for putting variables into BSS without making them common.
1653
1654 @item -ffriend-injection
1655 @opindex ffriend-injection
1656 Inject friend functions into the enclosing namespace, so that they are
1657 visible outside the scope of the class in which they are declared.
1658 Friend functions were documented to work this way in the old Annotated
1659 C++ Reference Manual, and versions of G++ before 4.1 always worked
1660 that way.  However, in ISO C++ a friend function which is not declared
1661 in an enclosing scope can only be found using argument dependent
1662 lookup.  This option causes friends to be injected as they were in
1663 earlier releases.
1664
1665 This option is for compatibility, and may be removed in a future
1666 release of G++.
1667
1668 @item -fno-elide-constructors
1669 @opindex fno-elide-constructors
1670 The C++ standard allows an implementation to omit creating a temporary
1671 which is only used to initialize another object of the same type.
1672 Specifying this option disables that optimization, and forces G++ to
1673 call the copy constructor in all cases.
1674
1675 @item -fno-enforce-eh-specs
1676 @opindex fno-enforce-eh-specs
1677 Don't generate code to check for violation of exception specifications
1678 at runtime.  This option violates the C++ standard, but may be useful
1679 for reducing code size in production builds, much like defining
1680 @samp{NDEBUG}.  This does not give user code permission to throw
1681 exceptions in violation of the exception specifications; the compiler
1682 will still optimize based on the specifications, so throwing an
1683 unexpected exception will result in undefined behavior.
1684
1685 @item -ffor-scope
1686 @itemx -fno-for-scope
1687 @opindex ffor-scope
1688 @opindex fno-for-scope
1689 If @option{-ffor-scope} is specified, the scope of variables declared in
1690 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1691 as specified by the C++ standard.
1692 If @option{-fno-for-scope} is specified, the scope of variables declared in
1693 a @i{for-init-statement} extends to the end of the enclosing scope,
1694 as was the case in old versions of G++, and other (traditional)
1695 implementations of C++.
1696
1697 The default if neither flag is given to follow the standard,
1698 but to allow and give a warning for old-style code that would
1699 otherwise be invalid, or have different behavior.
1700
1701 @item -fno-gnu-keywords
1702 @opindex fno-gnu-keywords
1703 Do not recognize @code{typeof} as a keyword, so that code can use this
1704 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1705 @option{-ansi} implies @option{-fno-gnu-keywords}.
1706
1707 @item -fno-implicit-templates
1708 @opindex fno-implicit-templates
1709 Never emit code for non-inline templates which are instantiated
1710 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1711 @xref{Template Instantiation}, for more information.
1712
1713 @item -fno-implicit-inline-templates
1714 @opindex fno-implicit-inline-templates
1715 Don't emit code for implicit instantiations of inline templates, either.
1716 The default is to handle inlines differently so that compiles with and
1717 without optimization will need the same set of explicit instantiations.
1718
1719 @item -fno-implement-inlines
1720 @opindex fno-implement-inlines
1721 To save space, do not emit out-of-line copies of inline functions
1722 controlled by @samp{#pragma implementation}.  This will cause linker
1723 errors if these functions are not inlined everywhere they are called.
1724
1725 @item -fms-extensions
1726 @opindex fms-extensions
1727 Disable pedantic warnings about constructs used in MFC, such as implicit
1728 int and getting a pointer to member function via non-standard syntax.
1729
1730 @item -fno-nonansi-builtins
1731 @opindex fno-nonansi-builtins
1732 Disable built-in declarations of functions that are not mandated by
1733 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1734 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1735
1736 @item -fno-operator-names
1737 @opindex fno-operator-names
1738 Do not treat the operator name keywords @code{and}, @code{bitand},
1739 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1740 synonyms as keywords.
1741
1742 @item -fno-optional-diags
1743 @opindex fno-optional-diags
1744 Disable diagnostics that the standard says a compiler does not need to
1745 issue.  Currently, the only such diagnostic issued by G++ is the one for
1746 a name having multiple meanings within a class.
1747
1748 @item -fpermissive
1749 @opindex fpermissive
1750 Downgrade some diagnostics about nonconformant code from errors to
1751 warnings.  Thus, using @option{-fpermissive} will allow some
1752 nonconforming code to compile.
1753
1754 @item -frepo
1755 @opindex frepo
1756 Enable automatic template instantiation at link time.  This option also
1757 implies @option{-fno-implicit-templates}.  @xref{Template
1758 Instantiation}, for more information.
1759
1760 @item -fno-rtti
1761 @opindex fno-rtti
1762 Disable generation of information about every class with virtual
1763 functions for use by the C++ runtime type identification features
1764 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1765 of the language, you can save some space by using this flag.  Note that
1766 exception handling uses the same information, but it will generate it as
1767 needed. The @samp{dynamic_cast} operator can still be used for casts that
1768 do not require runtime type information, i.e. casts to @code{void *} or to
1769 unambiguous base classes.
1770
1771 @item -fstats
1772 @opindex fstats
1773 Emit statistics about front-end processing at the end of the compilation.
1774 This information is generally only useful to the G++ development team.
1775
1776 @item -ftemplate-depth-@var{n}
1777 @opindex ftemplate-depth
1778 Set the maximum instantiation depth for template classes to @var{n}.
1779 A limit on the template instantiation depth is needed to detect
1780 endless recursions during template class instantiation.  ANSI/ISO C++
1781 conforming programs must not rely on a maximum depth greater than 17.
1782
1783 @item -fno-threadsafe-statics
1784 @opindex fno-threadsafe-statics
1785 Do not emit the extra code to use the routines specified in the C++
1786 ABI for thread-safe initialization of local statics.  You can use this
1787 option to reduce code size slightly in code that doesn't need to be
1788 thread-safe.
1789
1790 @item -fuse-cxa-atexit
1791 @opindex fuse-cxa-atexit
1792 Register destructors for objects with static storage duration with the
1793 @code{__cxa_atexit} function rather than the @code{atexit} function.
1794 This option is required for fully standards-compliant handling of static
1795 destructors, but will only work if your C library supports
1796 @code{__cxa_atexit}.
1797
1798 @item -fno-use-cxa-get-exception-ptr
1799 @opindex fno-use-cxa-get-exception-ptr
1800 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1801 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1802 if the runtime routine is not available.
1803
1804 @item -fvisibility-inlines-hidden
1805 @opindex fvisibility-inlines-hidden
1806 This switch declares that the user does not attempt to compare
1807 pointers to inline methods where the addresses of the two functions
1808 were taken in different shared objects.
1809
1810 The effect of this is that GCC may, effectively, mark inline methods with
1811 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1812 appear in the export table of a DSO and do not require a PLT indirection
1813 when used within the DSO@.  Enabling this option can have a dramatic effect
1814 on load and link times of a DSO as it massively reduces the size of the
1815 dynamic export table when the library makes heavy use of templates.
1816
1817 The behavior of this switch is not quite the same as marking the
1818 methods as hidden directly, because it does not affect static variables
1819 local to the function or cause the compiler to deduce that
1820 the function is defined in only one shared object.
1821
1822 You may mark a method as having a visibility explicitly to negate the
1823 effect of the switch for that method.  For example, if you do want to
1824 compare pointers to a particular inline method, you might mark it as
1825 having default visibility.  Marking the enclosing class with explicit
1826 visibility will have no effect.
1827
1828 Explicitly instantiated inline methods are unaffected by this option
1829 as their linkage might otherwise cross a shared library boundary.
1830 @xref{Template Instantiation}.
1831
1832 @item -fno-weak
1833 @opindex fno-weak
1834 Do not use weak symbol support, even if it is provided by the linker.
1835 By default, G++ will use weak symbols if they are available.  This
1836 option exists only for testing, and should not be used by end-users;
1837 it will result in inferior code and has no benefits.  This option may
1838 be removed in a future release of G++.
1839
1840 @item -nostdinc++
1841 @opindex nostdinc++
1842 Do not search for header files in the standard directories specific to
1843 C++, but do still search the other standard directories.  (This option
1844 is used when building the C++ library.)
1845 @end table
1846
1847 In addition, these optimization, warning, and code generation options
1848 have meanings only for C++ programs:
1849
1850 @table @gcctabopt
1851 @item -fno-default-inline
1852 @opindex fno-default-inline
1853 Do not assume @samp{inline} for functions defined inside a class scope.
1854 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1855 functions will have linkage like inline functions; they just won't be
1856 inlined by default.
1857
1858 @item -Wabi @r{(C++ only)}
1859 @opindex Wabi
1860 Warn when G++ generates code that is probably not compatible with the
1861 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1862 all such cases, there are probably some cases that are not warned about,
1863 even though G++ is generating incompatible code.  There may also be
1864 cases where warnings are emitted even though the code that is generated
1865 will be compatible.
1866
1867 You should rewrite your code to avoid these warnings if you are
1868 concerned about the fact that code generated by G++ may not be binary
1869 compatible with code generated by other compilers.
1870
1871 The known incompatibilities at this point include:
1872
1873 @itemize @bullet
1874
1875 @item
1876 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1877 pack data into the same byte as a base class.  For example:
1878
1879 @smallexample
1880 struct A @{ virtual void f(); int f1 : 1; @};
1881 struct B : public A @{ int f2 : 1; @};
1882 @end smallexample
1883
1884 @noindent
1885 In this case, G++ will place @code{B::f2} into the same byte
1886 as@code{A::f1}; other compilers will not.  You can avoid this problem
1887 by explicitly padding @code{A} so that its size is a multiple of the
1888 byte size on your platform; that will cause G++ and other compilers to
1889 layout @code{B} identically.
1890
1891 @item
1892 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1893 tail padding when laying out virtual bases.  For example:
1894
1895 @smallexample
1896 struct A @{ virtual void f(); char c1; @};
1897 struct B @{ B(); char c2; @};
1898 struct C : public A, public virtual B @{@};
1899 @end smallexample
1900
1901 @noindent
1902 In this case, G++ will not place @code{B} into the tail-padding for
1903 @code{A}; other compilers will.  You can avoid this problem by
1904 explicitly padding @code{A} so that its size is a multiple of its
1905 alignment (ignoring virtual base classes); that will cause G++ and other
1906 compilers to layout @code{C} identically.
1907
1908 @item
1909 Incorrect handling of bit-fields with declared widths greater than that
1910 of their underlying types, when the bit-fields appear in a union.  For
1911 example:
1912
1913 @smallexample
1914 union U @{ int i : 4096; @};
1915 @end smallexample
1916
1917 @noindent
1918 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1919 union too small by the number of bits in an @code{int}.
1920
1921 @item
1922 Empty classes can be placed at incorrect offsets.  For example:
1923
1924 @smallexample
1925 struct A @{@};
1926
1927 struct B @{
1928   A a;
1929   virtual void f ();
1930 @};
1931
1932 struct C : public B, public A @{@};
1933 @end smallexample
1934
1935 @noindent
1936 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1937 it should be placed at offset zero.  G++ mistakenly believes that the
1938 @code{A} data member of @code{B} is already at offset zero.
1939
1940 @item
1941 Names of template functions whose types involve @code{typename} or
1942 template template parameters can be mangled incorrectly.
1943
1944 @smallexample
1945 template <typename Q>
1946 void f(typename Q::X) @{@}
1947
1948 template <template <typename> class Q>
1949 void f(typename Q<int>::X) @{@}
1950 @end smallexample
1951
1952 @noindent
1953 Instantiations of these templates may be mangled incorrectly.
1954
1955 @end itemize
1956
1957 @item -Wctor-dtor-privacy @r{(C++ only)}
1958 @opindex Wctor-dtor-privacy
1959 Warn when a class seems unusable because all the constructors or
1960 destructors in that class are private, and it has neither friends nor
1961 public static member functions.
1962
1963 @item -Wnon-virtual-dtor @r{(C++ only)}
1964 @opindex Wnon-virtual-dtor
1965 Warn when a class appears to be polymorphic, thereby requiring a virtual
1966 destructor, yet it declares a non-virtual one.  This warning is also
1967 enabled if -Weffc++ is specified.
1968
1969 @item -Wreorder @r{(C++ only)}
1970 @opindex Wreorder
1971 @cindex reordering, warning
1972 @cindex warning for reordering of member initializers
1973 Warn when the order of member initializers given in the code does not
1974 match the order in which they must be executed.  For instance:
1975
1976 @smallexample
1977 struct A @{
1978   int i;
1979   int j;
1980   A(): j (0), i (1) @{ @}
1981 @};
1982 @end smallexample
1983
1984 The compiler will rearrange the member initializers for @samp{i}
1985 and @samp{j} to match the declaration order of the members, emitting
1986 a warning to that effect.  This warning is enabled by @option{-Wall}.
1987 @end table
1988
1989 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1990
1991 @table @gcctabopt
1992 @item -Weffc++ @r{(C++ only)}
1993 @opindex Weffc++
1994 Warn about violations of the following style guidelines from Scott Meyers'
1995 @cite{Effective C++} book:
1996
1997 @itemize @bullet
1998 @item
1999 Item 11:  Define a copy constructor and an assignment operator for classes
2000 with dynamically allocated memory.
2001
2002 @item
2003 Item 12:  Prefer initialization to assignment in constructors.
2004
2005 @item
2006 Item 14:  Make destructors virtual in base classes.
2007
2008 @item
2009 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2010
2011 @item
2012 Item 23:  Don't try to return a reference when you must return an object.
2013
2014 @end itemize
2015
2016 Also warn about violations of the following style guidelines from
2017 Scott Meyers' @cite{More Effective C++} book:
2018
2019 @itemize @bullet
2020 @item
2021 Item 6:  Distinguish between prefix and postfix forms of increment and
2022 decrement operators.
2023
2024 @item
2025 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2026
2027 @end itemize
2028
2029 When selecting this option, be aware that the standard library
2030 headers do not obey all of these guidelines; use @samp{grep -v}
2031 to filter out those warnings.
2032
2033 @item -Wno-deprecated @r{(C++ only)}
2034 @opindex Wno-deprecated
2035 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
2036
2037 @item -Wstrict-null-sentinel @r{(C++ only)}
2038 @opindex Wstrict-null-sentinel
2039 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2040 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2041 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2042 it is guaranteed to of the same size as a pointer.  But this use is
2043 not portable across different compilers.
2044
2045 @item -Wno-non-template-friend @r{(C++ only)}
2046 @opindex Wno-non-template-friend
2047 Disable warnings when non-templatized friend functions are declared
2048 within a template.  Since the advent of explicit template specification
2049 support in G++, if the name of the friend is an unqualified-id (i.e.,
2050 @samp{friend foo(int)}), the C++ language specification demands that the
2051 friend declare or define an ordinary, nontemplate function.  (Section
2052 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2053 could be interpreted as a particular specialization of a templatized
2054 function.  Because this non-conforming behavior is no longer the default
2055 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2056 check existing code for potential trouble spots and is on by default.
2057 This new compiler behavior can be turned off with
2058 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2059 but disables the helpful warning.
2060
2061 @item -Wold-style-cast @r{(C++ only)}
2062 @opindex Wold-style-cast
2063 Warn if an old-style (C-style) cast to a non-void type is used within
2064 a C++ program.  The new-style casts (@samp{dynamic_cast},
2065 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2066 less vulnerable to unintended effects and much easier to search for.
2067
2068 @item -Woverloaded-virtual @r{(C++ only)}
2069 @opindex Woverloaded-virtual
2070 @cindex overloaded virtual fn, warning
2071 @cindex warning for overloaded virtual fn
2072 Warn when a function declaration hides virtual functions from a
2073 base class.  For example, in:
2074
2075 @smallexample
2076 struct A @{
2077   virtual void f();
2078 @};
2079
2080 struct B: public A @{
2081   void f(int);
2082 @};
2083 @end smallexample
2084
2085 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2086 like:
2087
2088 @smallexample
2089 B* b;
2090 b->f();
2091 @end smallexample
2092
2093 will fail to compile.
2094
2095 @item -Wno-pmf-conversions @r{(C++ only)}
2096 @opindex Wno-pmf-conversions
2097 Disable the diagnostic for converting a bound pointer to member function
2098 to a plain pointer.
2099
2100 @item -Wsign-promo @r{(C++ only)}
2101 @opindex Wsign-promo
2102 Warn when overload resolution chooses a promotion from unsigned or
2103 enumerated type to a signed type, over a conversion to an unsigned type of
2104 the same size.  Previous versions of G++ would try to preserve
2105 unsignedness, but the standard mandates the current behavior.
2106
2107 @smallexample
2108 struct A @{
2109   operator int ();
2110   A& operator = (int);
2111 @};
2112
2113 main ()
2114 @{
2115   A a,b;
2116   a = b;
2117 @}
2118 @end smallexample
2119
2120 In this example, G++ will synthesize a default @samp{A& operator =
2121 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2122 @end table
2123
2124 @node Objective-C and Objective-C++ Dialect Options
2125 @section Options Controlling Objective-C and Objective-C++ Dialects
2126
2127 @cindex compiler options, Objective-C and Objective-C++
2128 @cindex Objective-C and Objective-C++ options, command line
2129 @cindex options, Objective-C and Objective-C++
2130 (NOTE: This manual does not describe the Objective-C and Objective-C++
2131 languages themselves.  See @xref{Standards,,Language Standards
2132 Supported by GCC}, for references.)
2133
2134 This section describes the command-line options that are only meaningful
2135 for Objective-C and Objective-C++ programs, but you can also use most of
2136 the language-independent GNU compiler options.
2137 For example, you might compile a file @code{some_class.m} like this:
2138
2139 @smallexample
2140 gcc -g -fgnu-runtime -O -c some_class.m
2141 @end smallexample
2142
2143 @noindent
2144 In this example, @option{-fgnu-runtime} is an option meant only for
2145 Objective-C and Objective-C++ programs; you can use the other options with
2146 any language supported by GCC@.
2147
2148 Note that since Objective-C is an extension of the C language, Objective-C
2149 compilations may also use options specific to the C front-end (e.g.,
2150 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2151 C++-specific options (e.g., @option{-Wabi}).
2152
2153 Here is a list of options that are @emph{only} for compiling Objective-C
2154 and Objective-C++ programs:
2155
2156 @table @gcctabopt
2157 @item -fconstant-string-class=@var{class-name}
2158 @opindex fconstant-string-class
2159 Use @var{class-name} as the name of the class to instantiate for each
2160 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2161 class name is @code{NXConstantString} if the GNU runtime is being used, and
2162 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2163 @option{-fconstant-cfstrings} option, if also present, will override the
2164 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2165 to be laid out as constant CoreFoundation strings.
2166
2167 @item -fgnu-runtime
2168 @opindex fgnu-runtime
2169 Generate object code compatible with the standard GNU Objective-C
2170 runtime.  This is the default for most types of systems.
2171
2172 @item -fnext-runtime
2173 @opindex fnext-runtime
2174 Generate output compatible with the NeXT runtime.  This is the default
2175 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2176 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2177 used.
2178
2179 @item -fno-nil-receivers
2180 @opindex fno-nil-receivers
2181 Assume that all Objective-C message dispatches (e.g.,
2182 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2183 is not @code{nil}.  This allows for more efficient entry points in the runtime
2184 to be used.  Currently, this option is only available in conjunction with
2185 the NeXT runtime on Mac OS X 10.3 and later.
2186
2187 @item -fobjc-call-cxx-cdtors
2188 @opindex fobjc-call-cxx-cdtors
2189 For each Objective-C class, check if any of its instance variables is a
2190 C++ object with a non-trivial default constructor.  If so, synthesize a
2191 special @code{- (id) .cxx_construct} instance method that will run
2192 non-trivial default constructors on any such instance variables, in order,
2193 and then return @code{self}.  Similarly, check if any instance variable
2194 is a C++ object with a non-trivial destructor, and if so, synthesize a
2195 special @code{- (void) .cxx_destruct} method that will run
2196 all such default destructors, in reverse order.
2197
2198 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2199 thusly generated will only operate on instance variables declared in the
2200 current Objective-C class, and not those inherited from superclasses.  It
2201 is the responsibility of the Objective-C runtime to invoke all such methods
2202 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2203 will be invoked by the runtime immediately after a new object
2204 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2205 be invoked immediately before the runtime deallocates an object instance.
2206
2207 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2208 support for invoking the @code{- (id) .cxx_construct} and
2209 @code{- (void) .cxx_destruct} methods.
2210
2211 @item -fobjc-direct-dispatch
2212 @opindex fobjc-direct-dispatch
2213 Allow fast jumps to the message dispatcher.  On Darwin this is
2214 accomplished via the comm page.
2215
2216 @item -fobjc-exceptions
2217 @opindex fobjc-exceptions
2218 Enable syntactic support for structured exception handling in Objective-C,
2219 similar to what is offered by C++ and Java.  This option is
2220 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2221 earlier.
2222
2223 @smallexample
2224   @@try @{
2225     @dots{}
2226        @@throw expr;
2227     @dots{}
2228   @}
2229   @@catch (AnObjCClass *exc) @{
2230     @dots{}
2231       @@throw expr;
2232     @dots{}
2233       @@throw;
2234     @dots{}
2235   @}
2236   @@catch (AnotherClass *exc) @{
2237     @dots{}
2238   @}
2239   @@catch (id allOthers) @{
2240     @dots{}
2241   @}
2242   @@finally @{
2243     @dots{}
2244       @@throw expr;
2245     @dots{}
2246   @}
2247 @end smallexample
2248
2249 The @code{@@throw} statement may appear anywhere in an Objective-C or
2250 Objective-C++ program; when used inside of a @code{@@catch} block, the
2251 @code{@@throw} may appear without an argument (as shown above), in which case
2252 the object caught by the @code{@@catch} will be rethrown.
2253
2254 Note that only (pointers to) Objective-C objects may be thrown and
2255 caught using this scheme.  When an object is thrown, it will be caught
2256 by the nearest @code{@@catch} clause capable of handling objects of that type,
2257 analogously to how @code{catch} blocks work in C++ and Java.  A
2258 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2259 any and all Objective-C exceptions not caught by previous @code{@@catch}
2260 clauses (if any).
2261
2262 The @code{@@finally} clause, if present, will be executed upon exit from the
2263 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2264 regardless of whether any exceptions are thrown, caught or rethrown
2265 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2266 of the @code{finally} clause in Java.
2267
2268 There are several caveats to using the new exception mechanism:
2269
2270 @itemize @bullet
2271 @item
2272 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2273 idioms provided by the @code{NSException} class, the new
2274 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2275 systems, due to additional functionality needed in the (NeXT) Objective-C
2276 runtime.
2277
2278 @item
2279 As mentioned above, the new exceptions do not support handling
2280 types other than Objective-C objects.   Furthermore, when used from
2281 Objective-C++, the Objective-C exception model does not interoperate with C++
2282 exceptions at this time.  This means you cannot @code{@@throw} an exception
2283 from Objective-C and @code{catch} it in C++, or vice versa
2284 (i.e., @code{throw @dots{} @@catch}).
2285 @end itemize
2286
2287 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2288 blocks for thread-safe execution:
2289
2290 @smallexample
2291   @@synchronized (ObjCClass *guard) @{
2292     @dots{}
2293   @}
2294 @end smallexample
2295
2296 Upon entering the @code{@@synchronized} block, a thread of execution shall
2297 first check whether a lock has been placed on the corresponding @code{guard}
2298 object by another thread.  If it has, the current thread shall wait until
2299 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2300 the current thread will place its own lock on it, execute the code contained in
2301 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2302 making @code{guard} available to other threads).
2303
2304 Unlike Java, Objective-C does not allow for entire methods to be marked
2305 @code{@@synchronized}.  Note that throwing exceptions out of
2306 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2307 to be unlocked properly.
2308
2309 @item -fobjc-gc
2310 @opindex fobjc-gc
2311 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2312
2313 @item -freplace-objc-classes
2314 @opindex freplace-objc-classes
2315 Emit a special marker instructing @command{ld(1)} not to statically link in
2316 the resulting object file, and allow @command{dyld(1)} to load it in at
2317 run time instead.  This is used in conjunction with the Fix-and-Continue
2318 debugging mode, where the object file in question may be recompiled and
2319 dynamically reloaded in the course of program execution, without the need
2320 to restart the program itself.  Currently, Fix-and-Continue functionality
2321 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2322 and later.
2323
2324 @item -fzero-link
2325 @opindex fzero-link
2326 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2327 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2328 compile time) with static class references that get initialized at load time,
2329 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2330 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2331 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2332 for individual class implementations to be modified during program execution.
2333
2334 @item -gen-decls
2335 @opindex gen-decls
2336 Dump interface declarations for all classes seen in the source file to a
2337 file named @file{@var{sourcename}.decl}.
2338
2339 @item -Wassign-intercept
2340 @opindex Wassign-intercept
2341 Warn whenever an Objective-C assignment is being intercepted by the
2342 garbage collector.
2343
2344 @item -Wno-protocol
2345 @opindex Wno-protocol
2346 If a class is declared to implement a protocol, a warning is issued for
2347 every method in the protocol that is not implemented by the class.  The
2348 default behavior is to issue a warning for every method not explicitly
2349 implemented in the class, even if a method implementation is inherited
2350 from the superclass.  If you use the @option{-Wno-protocol} option, then
2351 methods inherited from the superclass are considered to be implemented,
2352 and no warning is issued for them.
2353
2354 @item -Wselector
2355 @opindex Wselector
2356 Warn if multiple methods of different types for the same selector are
2357 found during compilation.  The check is performed on the list of methods
2358 in the final stage of compilation.  Additionally, a check is performed
2359 for each selector appearing in a @code{@@selector(@dots{})}
2360 expression, and a corresponding method for that selector has been found
2361 during compilation.  Because these checks scan the method table only at
2362 the end of compilation, these warnings are not produced if the final
2363 stage of compilation is not reached, for example because an error is
2364 found during compilation, or because the @option{-fsyntax-only} option is
2365 being used.
2366
2367 @item -Wstrict-selector-match
2368 @opindex Wstrict-selector-match
2369 Warn if multiple methods with differing argument and/or return types are
2370 found for a given selector when attempting to send a message using this
2371 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2372 is off (which is the default behavior), the compiler will omit such warnings
2373 if any differences found are confined to types which share the same size
2374 and alignment.
2375
2376 @item -Wundeclared-selector
2377 @opindex Wundeclared-selector
2378 Warn if a @code{@@selector(@dots{})} expression referring to an
2379 undeclared selector is found.  A selector is considered undeclared if no
2380 method with that name has been declared before the
2381 @code{@@selector(@dots{})} expression, either explicitly in an
2382 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2383 an @code{@@implementation} section.  This option always performs its
2384 checks as soon as a @code{@@selector(@dots{})} expression is found,
2385 while @option{-Wselector} only performs its checks in the final stage of
2386 compilation.  This also enforces the coding style convention
2387 that methods and selectors must be declared before being used.
2388
2389 @item -print-objc-runtime-info
2390 @opindex print-objc-runtime-info
2391 Generate C header describing the largest structure that is passed by
2392 value, if any.
2393
2394 @end table
2395
2396 @node Language Independent Options
2397 @section Options to Control Diagnostic Messages Formatting
2398 @cindex options to control diagnostics formatting
2399 @cindex diagnostic messages
2400 @cindex message formatting
2401
2402 Traditionally, diagnostic messages have been formatted irrespective of
2403 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2404 below can be used to control the diagnostic messages formatting
2405 algorithm, e.g.@: how many characters per line, how often source location
2406 information should be reported.  Right now, only the C++ front end can
2407 honor these options.  However it is expected, in the near future, that
2408 the remaining front ends would be able to digest them correctly.
2409
2410 @table @gcctabopt
2411 @item -fmessage-length=@var{n}
2412 @opindex fmessage-length
2413 Try to format error messages so that they fit on lines of about @var{n}
2414 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2415 the front ends supported by GCC@.  If @var{n} is zero, then no
2416 line-wrapping will be done; each error message will appear on a single
2417 line.
2418
2419 @opindex fdiagnostics-show-location
2420 @item -fdiagnostics-show-location=once
2421 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2422 reporter to emit @emph{once} source location information; that is, in
2423 case the message is too long to fit on a single physical line and has to
2424 be wrapped, the source location won't be emitted (as prefix) again,
2425 over and over, in subsequent continuation lines.  This is the default
2426 behavior.
2427
2428 @item -fdiagnostics-show-location=every-line
2429 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2430 messages reporter to emit the same source location information (as
2431 prefix) for physical lines that result from the process of breaking
2432 a message which is too long to fit on a single line.
2433
2434 @item -fdiagnostics-show-option
2435 @opindex fdiagnostics-show-option
2436 This option instructs the diagnostic machinery to add text to each
2437 diagnostic emitted, which indicates which command line option directly
2438 controls that diagnostic, when such an option is known to the
2439 diagnostic machinery.
2440
2441 @item -Wcoverage-mismatch
2442 @opindex Wcoverage-mismatch
2443 Warn if feedback profiles do not match when using the
2444 @option{-fprofile-use} option.
2445 If a source file was changed between @option{-fprofile-gen} and
2446 @option{-fprofile-use}, the files with the profile feedback can fail
2447 to match the source file and GCC can not use the profile feedback
2448 information.  By default, GCC emits an error message in this case.
2449 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2450 error.  GCC does not use appropriate feedback profiles, so using this
2451 option can result in poorly optimized code.  This option is useful
2452 only in the case of very minor changes such as bug fixes to an
2453 existing code-base.
2454
2455 @end table
2456
2457 @node Warning Options
2458 @section Options to Request or Suppress Warnings
2459 @cindex options to control warnings
2460 @cindex warning messages
2461 @cindex messages, warning
2462 @cindex suppressing warnings
2463
2464 Warnings are diagnostic messages that report constructions which
2465 are not inherently erroneous but which are risky or suggest there
2466 may have been an error.
2467
2468 You can request many specific warnings with options beginning @samp{-W},
2469 for example @option{-Wimplicit} to request warnings on implicit
2470 declarations.  Each of these specific warning options also has a
2471 negative form beginning @samp{-Wno-} to turn off warnings;
2472 for example, @option{-Wno-implicit}.  This manual lists only one of the
2473 two forms, whichever is not the default.
2474
2475 The following options control the amount and kinds of warnings produced
2476 by GCC; for further, language-specific options also refer to
2477 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2478 Options}.
2479
2480 @table @gcctabopt
2481 @cindex syntax checking
2482 @item -fsyntax-only
2483 @opindex fsyntax-only
2484 Check the code for syntax errors, but don't do anything beyond that.
2485
2486 @item -pedantic
2487 @opindex pedantic
2488 Issue all the warnings demanded by strict ISO C and ISO C++;
2489 reject all programs that use forbidden extensions, and some other
2490 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2491 version of the ISO C standard specified by any @option{-std} option used.
2492
2493 Valid ISO C and ISO C++ programs should compile properly with or without
2494 this option (though a rare few will require @option{-ansi} or a
2495 @option{-std} option specifying the required version of ISO C)@.  However,
2496 without this option, certain GNU extensions and traditional C and C++
2497 features are supported as well.  With this option, they are rejected.
2498
2499 @option{-pedantic} does not cause warning messages for use of the
2500 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2501 warnings are also disabled in the expression that follows
2502 @code{__extension__}.  However, only system header files should use
2503 these escape routes; application programs should avoid them.
2504 @xref{Alternate Keywords}.
2505
2506 Some users try to use @option{-pedantic} to check programs for strict ISO
2507 C conformance.  They soon find that it does not do quite what they want:
2508 it finds some non-ISO practices, but not all---only those for which
2509 ISO C @emph{requires} a diagnostic, and some others for which
2510 diagnostics have been added.
2511
2512 A feature to report any failure to conform to ISO C might be useful in
2513 some instances, but would require considerable additional work and would
2514 be quite different from @option{-pedantic}.  We don't have plans to
2515 support such a feature in the near future.
2516
2517 Where the standard specified with @option{-std} represents a GNU
2518 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2519 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2520 extended dialect is based.  Warnings from @option{-pedantic} are given
2521 where they are required by the base standard.  (It would not make sense
2522 for such warnings to be given only for features not in the specified GNU
2523 C dialect, since by definition the GNU dialects of C include all
2524 features the compiler supports with the given option, and there would be
2525 nothing to warn about.)
2526
2527 @item -pedantic-errors
2528 @opindex pedantic-errors
2529 Like @option{-pedantic}, except that errors are produced rather than
2530 warnings.
2531
2532 @item -w
2533 @opindex w
2534 Inhibit all warning messages.
2535
2536 @item -Wno-import
2537 @opindex Wno-import
2538 Inhibit warning messages about the use of @samp{#import}.
2539
2540 @item -Wchar-subscripts
2541 @opindex Wchar-subscripts
2542 Warn if an array subscript has type @code{char}.  This is a common cause
2543 of error, as programmers often forget that this type is signed on some
2544 machines.
2545 This warning is enabled by @option{-Wall}.
2546
2547 @item -Wcomment
2548 @opindex Wcomment
2549 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2550 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2551 This warning is enabled by @option{-Wall}.
2552
2553 @item -Wfatal-errors
2554 @opindex Wfatal-errors
2555 This option causes the compiler to abort compilation on the first error
2556 occurred rather than trying to keep going and printing further error
2557 messages.
2558
2559 @item -Wformat
2560 @opindex Wformat
2561 @opindex ffreestanding
2562 @opindex fno-builtin
2563 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2564 the arguments supplied have types appropriate to the format string
2565 specified, and that the conversions specified in the format string make
2566 sense.  This includes standard functions, and others specified by format
2567 attributes (@pxref{Function Attributes}), in the @code{printf},
2568 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2569 not in the C standard) families (or other target-specific families).
2570 Which functions are checked without format attributes having been
2571 specified depends on the standard version selected, and such checks of
2572 functions without the attribute specified are disabled by
2573 @option{-ffreestanding} or @option{-fno-builtin}.
2574
2575 The formats are checked against the format features supported by GNU
2576 libc version 2.2.  These include all ISO C90 and C99 features, as well
2577 as features from the Single Unix Specification and some BSD and GNU
2578 extensions.  Other library implementations may not support all these
2579 features; GCC does not support warning about features that go beyond a
2580 particular library's limitations.  However, if @option{-pedantic} is used
2581 with @option{-Wformat}, warnings will be given about format features not
2582 in the selected standard version (but not for @code{strfmon} formats,
2583 since those are not in any version of the C standard).  @xref{C Dialect
2584 Options,,Options Controlling C Dialect}.
2585
2586 Since @option{-Wformat} also checks for null format arguments for
2587 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2588
2589 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2590 aspects of format checking, the options @option{-Wformat-y2k},
2591 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2592 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2593 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2594
2595 @item -Wformat-y2k
2596 @opindex Wformat-y2k
2597 If @option{-Wformat} is specified, also warn about @code{strftime}
2598 formats which may yield only a two-digit year.
2599
2600 @item -Wno-format-extra-args
2601 @opindex Wno-format-extra-args
2602 If @option{-Wformat} is specified, do not warn about excess arguments to a
2603 @code{printf} or @code{scanf} format function.  The C standard specifies
2604 that such arguments are ignored.
2605
2606 Where the unused arguments lie between used arguments that are
2607 specified with @samp{$} operand number specifications, normally
2608 warnings are still given, since the implementation could not know what
2609 type to pass to @code{va_arg} to skip the unused arguments.  However,
2610 in the case of @code{scanf} formats, this option will suppress the
2611 warning if the unused arguments are all pointers, since the Single
2612 Unix Specification says that such unused arguments are allowed.
2613
2614 @item -Wno-format-zero-length
2615 @opindex Wno-format-zero-length
2616 If @option{-Wformat} is specified, do not warn about zero-length formats.
2617 The C standard specifies that zero-length formats are allowed.
2618
2619 @item -Wformat-nonliteral
2620 @opindex Wformat-nonliteral
2621 If @option{-Wformat} is specified, also warn if the format string is not a
2622 string literal and so cannot be checked, unless the format function
2623 takes its format arguments as a @code{va_list}.
2624
2625 @item -Wformat-security
2626 @opindex Wformat-security
2627 If @option{-Wformat} is specified, also warn about uses of format
2628 functions that represent possible security problems.  At present, this
2629 warns about calls to @code{printf} and @code{scanf} functions where the
2630 format string is not a string literal and there are no format arguments,
2631 as in @code{printf (foo);}.  This may be a security hole if the format
2632 string came from untrusted input and contains @samp{%n}.  (This is
2633 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2634 in future warnings may be added to @option{-Wformat-security} that are not
2635 included in @option{-Wformat-nonliteral}.)
2636
2637 @item -Wformat=2
2638 @opindex Wformat=2
2639 Enable @option{-Wformat} plus format checks not included in
2640 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2641 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2642
2643 @item -Wnonnull
2644 @opindex Wnonnull
2645 Warn about passing a null pointer for arguments marked as
2646 requiring a non-null value by the @code{nonnull} function attribute.
2647
2648 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2649 can be disabled with the @option{-Wno-nonnull} option.
2650
2651 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2652 @opindex Winit-self
2653 Warn about uninitialized variables which are initialized with themselves.
2654 Note this option can only be used with the @option{-Wuninitialized} option,
2655 which in turn only works with @option{-O1} and above.
2656
2657 For example, GCC will warn about @code{i} being uninitialized in the
2658 following snippet only when @option{-Winit-self} has been specified:
2659 @smallexample
2660 @group
2661 int f()
2662 @{
2663   int i = i;
2664   return i;
2665 @}
2666 @end group
2667 @end smallexample
2668
2669 @item -Wimplicit-int
2670 @opindex Wimplicit-int
2671 Warn when a declaration does not specify a type.
2672 This warning is enabled by @option{-Wall}.
2673
2674 @item -Wimplicit-function-declaration
2675 @opindex Wimplicit-function-declaration
2676 @opindex Wno-implicit-function-declaration
2677 Give a warning whenever a function is used before being declared. In
2678 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2679 enabled by default and it is made into an error by
2680 @option{-pedantic-errors}. This warning is also enabled by
2681 @option{-Wall}.
2682
2683 @item -Wimplicit
2684 @opindex Wimplicit
2685 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2686 This warning is enabled by @option{-Wall}.
2687
2688 @item -Wmain
2689 @opindex Wmain
2690 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2691 function with external linkage, returning int, taking either zero
2692 arguments, two, or three arguments of appropriate types.
2693 This warning is enabled by @option{-Wall}.
2694
2695 @item -Wmissing-braces
2696 @opindex Wmissing-braces
2697 Warn if an aggregate or union initializer is not fully bracketed.  In
2698 the following example, the initializer for @samp{a} is not fully
2699 bracketed, but that for @samp{b} is fully bracketed.
2700
2701 @smallexample
2702 int a[2][2] = @{ 0, 1, 2, 3 @};
2703 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2704 @end smallexample
2705
2706 This warning is enabled by @option{-Wall}.
2707
2708 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2709 @opindex Wmissing-include-dirs
2710 Warn if a user-supplied include directory does not exist.
2711
2712 @item -Wparentheses
2713 @opindex Wparentheses
2714 Warn if parentheses are omitted in certain contexts, such
2715 as when there is an assignment in a context where a truth value
2716 is expected, or when operators are nested whose precedence people
2717 often get confused about.
2718
2719 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2720 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2721 interpretation from that of ordinary mathematical notation.
2722
2723 Also warn about constructions where there may be confusion to which
2724 @code{if} statement an @code{else} branch belongs.  Here is an example of
2725 such a case:
2726
2727 @smallexample
2728 @group
2729 @{
2730   if (a)
2731     if (b)
2732       foo ();
2733   else
2734     bar ();
2735 @}
2736 @end group
2737 @end smallexample
2738
2739 In C/C++, every @code{else} branch belongs to the innermost possible
2740 @code{if} statement, which in this example is @code{if (b)}.  This is
2741 often not what the programmer expected, as illustrated in the above
2742 example by indentation the programmer chose.  When there is the
2743 potential for this confusion, GCC will issue a warning when this flag
2744 is specified.  To eliminate the warning, add explicit braces around
2745 the innermost @code{if} statement so there is no way the @code{else}
2746 could belong to the enclosing @code{if}.  The resulting code would
2747 look like this:
2748
2749 @smallexample
2750 @group
2751 @{
2752   if (a)
2753     @{
2754       if (b)
2755         foo ();
2756       else
2757         bar ();
2758     @}
2759 @}
2760 @end group
2761 @end smallexample
2762
2763 This warning is enabled by @option{-Wall}.
2764
2765 @item -Wsequence-point
2766 @opindex Wsequence-point
2767 Warn about code that may have undefined semantics because of violations
2768 of sequence point rules in the C and C++ standards.
2769
2770 The C and C++ standards defines the order in which expressions in a C/C++
2771 program are evaluated in terms of @dfn{sequence points}, which represent
2772 a partial ordering between the execution of parts of the program: those
2773 executed before the sequence point, and those executed after it.  These
2774 occur after the evaluation of a full expression (one which is not part
2775 of a larger expression), after the evaluation of the first operand of a
2776 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2777 function is called (but after the evaluation of its arguments and the
2778 expression denoting the called function), and in certain other places.
2779 Other than as expressed by the sequence point rules, the order of
2780 evaluation of subexpressions of an expression is not specified.  All
2781 these rules describe only a partial order rather than a total order,
2782 since, for example, if two functions are called within one expression
2783 with no sequence point between them, the order in which the functions
2784 are called is not specified.  However, the standards committee have
2785 ruled that function calls do not overlap.
2786
2787 It is not specified when between sequence points modifications to the
2788 values of objects take effect.  Programs whose behavior depends on this
2789 have undefined behavior; the C and C++ standards specify that ``Between
2790 the previous and next sequence point an object shall have its stored
2791 value modified at most once by the evaluation of an expression.
2792 Furthermore, the prior value shall be read only to determine the value
2793 to be stored.''.  If a program breaks these rules, the results on any
2794 particular implementation are entirely unpredictable.
2795
2796 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2797 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2798 diagnosed by this option, and it may give an occasional false positive
2799 result, but in general it has been found fairly effective at detecting
2800 this sort of problem in programs.
2801
2802 The standard is worded confusingly, therefore there is some debate
2803 over the precise meaning of the sequence point rules in subtle cases.
2804 Links to discussions of the problem, including proposed formal
2805 definitions, may be found on the GCC readings page, at
2806 @w{@uref{http://gcc.gnu.org/readings.html}}.
2807
2808 This warning is enabled by @option{-Wall} for C and C++.
2809
2810 @item -Wreturn-type
2811 @opindex Wreturn-type
2812 @opindex Wno-return-type
2813 Warn whenever a function is defined with a return-type that defaults
2814 to @code{int}.  Also warn about any @code{return} statement with no
2815 return-value in a function whose return-type is not @code{void}
2816 (falling off the end of the function body is considered returning
2817 without a value), and about a @code{return} statement with a
2818 expression in a function whose return-type is @code{void}.
2819
2820 Also warn if the return type of a function has a type qualifier
2821 such as @code{const}.  For ISO C such a type qualifier has no effect,
2822 since the value returned by a function is not an lvalue.
2823 For C++, the warning is only emitted for scalar types or @code{void}.
2824 ISO C prohibits qualified @code{void} return types on function
2825 definitions, so such return types always receive a warning
2826 even without this option.
2827
2828 For C++, a function without return type always produces a diagnostic
2829 message, even when @option{-Wno-return-type} is specified.  The only
2830 exceptions are @samp{main} and functions defined in system headers.
2831
2832 This warning is enabled by @option{-Wall}.
2833
2834 @item -Wswitch
2835 @opindex Wswitch
2836 Warn whenever a @code{switch} statement has an index of enumerated type
2837 and lacks a @code{case} for one or more of the named codes of that
2838 enumeration.  (The presence of a @code{default} label prevents this
2839 warning.)  @code{case} labels outside the enumeration range also
2840 provoke warnings when this option is used.
2841 This warning is enabled by @option{-Wall}.
2842
2843 @item -Wswitch-default
2844 @opindex Wswitch-switch
2845 Warn whenever a @code{switch} statement does not have a @code{default}
2846 case.
2847
2848 @item -Wswitch-enum
2849 @opindex Wswitch-enum
2850 Warn whenever a @code{switch} statement has an index of enumerated type
2851 and lacks a @code{case} for one or more of the named codes of that
2852 enumeration.  @code{case} labels outside the enumeration range also
2853 provoke warnings when this option is used.
2854
2855 @item -Wtrigraphs
2856 @opindex Wtrigraphs
2857 Warn if any trigraphs are encountered that might change the meaning of
2858 the program (trigraphs within comments are not warned about).
2859 This warning is enabled by @option{-Wall}.
2860
2861 @item -Wunused-function
2862 @opindex Wunused-function
2863 Warn whenever a static function is declared but not defined or a
2864 non-inline static function is unused.
2865 This warning is enabled by @option{-Wall}.
2866
2867 @item -Wunused-label
2868 @opindex Wunused-label
2869 Warn whenever a label is declared but not used.
2870 This warning is enabled by @option{-Wall}.
2871
2872 To suppress this warning use the @samp{unused} attribute
2873 (@pxref{Variable Attributes}).
2874
2875 @item -Wunused-parameter
2876 @opindex Wunused-parameter
2877 Warn whenever a function parameter is unused aside from its declaration.
2878
2879 To suppress this warning use the @samp{unused} attribute
2880 (@pxref{Variable Attributes}).
2881
2882 @item -Wunused-variable
2883 @opindex Wunused-variable
2884 Warn whenever a local variable or non-constant static variable is unused
2885 aside from its declaration.
2886 This warning is enabled by @option{-Wall}.
2887
2888 To suppress this warning use the @samp{unused} attribute
2889 (@pxref{Variable Attributes}).
2890
2891 @item -Wunused-value
2892 @opindex Wunused-value
2893 Warn whenever a statement computes a result that is explicitly not
2894 used. To suppress this warning cast the unused expression to
2895 @samp{void}. This includes an expression-statement or the left-hand
2896 side of a comma expression that contains no side effects. For example,
2897 an expression such as @samp{x[i,j]} will cause a warning, while
2898 @samp{x[(void)i,j]} will not.
2899
2900 This warning is enabled by @option{-Wall}.
2901
2902 @item -Wunused
2903 @opindex Wunused
2904 All the above @option{-Wunused} options combined.
2905
2906 In order to get a warning about an unused function parameter, you must
2907 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2908 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2909
2910 @item -Wuninitialized
2911 @opindex Wuninitialized
2912 Warn if an automatic variable is used without first being initialized or
2913 if a variable may be clobbered by a @code{setjmp} call.
2914
2915 These warnings are possible only in optimizing compilation,
2916 because they require data flow information that is computed only
2917 when optimizing.  If you do not specify @option{-O}, you will not get
2918 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2919 requiring @option{-O}.
2920
2921 If you want to warn about code which uses the uninitialized value of the
2922 variable in its own initializer, use the @option{-Winit-self} option.
2923
2924 These warnings occur for individual uninitialized or clobbered
2925 elements of structure, union or array variables as well as for
2926 variables which are uninitialized or clobbered as a whole.  They do
2927 not occur for variables or elements declared @code{volatile}.  Because
2928 these warnings depend on optimization, the exact variables or elements
2929 for which there are warnings will depend on the precise optimization
2930 options and version of GCC used.
2931
2932 Note that there may be no warning about a variable that is used only
2933 to compute a value that itself is never used, because such
2934 computations may be deleted by data flow analysis before the warnings
2935 are printed.
2936
2937 These warnings are made optional because GCC is not smart
2938 enough to see all the reasons why the code might be correct
2939 despite appearing to have an error.  Here is one example of how
2940 this can happen:
2941
2942 @smallexample
2943 @group
2944 @{
2945   int x;
2946   switch (y)
2947     @{
2948     case 1: x = 1;
2949       break;
2950     case 2: x = 4;
2951       break;
2952     case 3: x = 5;
2953     @}
2954   foo (x);
2955 @}
2956 @end group
2957 @end smallexample
2958
2959 @noindent
2960 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2961 always initialized, but GCC doesn't know this.  Here is
2962 another common case:
2963
2964 @smallexample
2965 @{
2966   int save_y;
2967   if (change_y) save_y = y, y = new_y;
2968   @dots{}
2969   if (change_y) y = save_y;
2970 @}
2971 @end smallexample
2972
2973 @noindent
2974 This has no bug because @code{save_y} is used only if it is set.
2975
2976 @cindex @code{longjmp} warnings
2977 This option also warns when a non-volatile automatic variable might be
2978 changed by a call to @code{longjmp}.  These warnings as well are possible
2979 only in optimizing compilation.
2980
2981 The compiler sees only the calls to @code{setjmp}.  It cannot know
2982 where @code{longjmp} will be called; in fact, a signal handler could
2983 call it at any point in the code.  As a result, you may get a warning
2984 even when there is in fact no problem because @code{longjmp} cannot
2985 in fact be called at the place which would cause a problem.
2986
2987 Some spurious warnings can be avoided if you declare all the functions
2988 you use that never return as @code{noreturn}.  @xref{Function
2989 Attributes}.
2990
2991 This warning is enabled by @option{-Wall}.
2992
2993 @item -Wunknown-pragmas
2994 @opindex Wunknown-pragmas
2995 @cindex warning for unknown pragmas
2996 @cindex unknown pragmas, warning
2997 @cindex pragmas, warning of unknown
2998 Warn when a #pragma directive is encountered which is not understood by
2999 GCC@.  If this command line option is used, warnings will even be issued
3000 for unknown pragmas in system header files.  This is not the case if
3001 the warnings were only enabled by the @option{-Wall} command line option.
3002
3003 @item -Wno-pragmas
3004 @opindex Wno-pragmas
3005 @opindex Wpragmas
3006 Do not warn about misuses of pragmas, such as incorrect parameters,
3007 invalid syntax, or conflicts between pragmas.  See also
3008 @samp{-Wunknown-pragmas}.
3009
3010 @item -Wstrict-aliasing
3011 @opindex Wstrict-aliasing
3012 This option is only active when @option{-fstrict-aliasing} is active.
3013 It warns about code which might break the strict aliasing rules that the
3014 compiler is using for optimization.  The warning does not catch all
3015 cases, but does attempt to catch the more common pitfalls.  It is
3016 included in @option{-Wall}.
3017 It is equivalent to -Wstrict-aliasing=3
3018
3019 @item -Wstrict-aliasing=n
3020 @opindex Wstrict-aliasing=n
3021 This option is only active when @option{-fstrict-aliasing} is active.
3022 It warns about code which might break the strict aliasing rules that the
3023 compiler is using for optimization.
3024 Higher levels correspond to higher accuracy (fewer false positives).
3025 Higher levels also correspond to more effort, similar to the way -O works.
3026 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3027 with n=3.
3028
3029 Level 1: Most aggressive, quick, least accurate.
3030 Possibly useful when higher levels
3031 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3032 false negatives.  However, it has many false positives.
3033 Warns for all pointer conversions between possibly incompatible types, 
3034 even if never dereferenced.  Runs in the frontend only.
3035
3036 Level 2: Aggressive, quick, not too precise.
3037 May still have many false positives (not as many as level 1 though),
3038 and few false negatives (but possibly more than level 1).
3039 Unlike level 1, it only warns when an address is taken.  Warns about
3040 incomplete types.  Runs in the frontend only.
3041
3042 Level 3 (default for @option{-Wstrict-aliasing}): 
3043 Should have very few false positives and few false 
3044 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3045 Takes care of the common punn+dereference pattern in the frontend:
3046 @code{*(int*)&some_float}.
3047 If optimization is enabled, it also runs in the backend, where it deals 
3048 with multiple statement cases using flow-sensitive points-to information.
3049 Only warns when the converted pointer is dereferenced.
3050 Does not warn about incomplete types.
3051
3052 @item -Wstrict-overflow
3053 @item -Wstrict-overflow=@var{n}
3054 @opindex Wstrict-overflow
3055 This option is only active when @option{-fstrict-overflow} is active.
3056 It warns about cases where the compiler optimizes based on the
3057 assumption that signed overflow does not occur.  Note that it does not
3058 warn about all cases where the code might overflow: it only warns
3059 about cases where the compiler implements some optimization.  Thus
3060 this warning depends on the optimization level.
3061
3062 An optimization which assumes that signed overflow does not occur is
3063 perfectly safe if the values of the variables involved are such that
3064 overflow never does, in fact, occur.  Therefore this warning can
3065 easily give a false positive: a warning about code which is not
3066 actually a problem.  To help focus on important issues, several
3067 warning levels are defined.  No warnings are issued for the use of
3068 undefined signed overflow when estimating how many iterations a loop
3069 will require, in particular when determining whether a loop will be
3070 executed at all.
3071
3072 @table @option
3073 @item -Wstrict-overflow=1
3074 Warn about cases which are both questionable and easy to avoid.  For
3075 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3076 compiler will simplify this to @code{1}.  This level of
3077 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3078 are not, and must be explicitly requested.
3079
3080 @item -Wstrict-overflow=2
3081 Also warn about other cases where a comparison is simplified to a
3082 constant.  For example: @code{abs (x) >= 0}.  This can only be
3083 simplified when @option{-fstrict-overflow} is in effect, because
3084 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3085 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3086 @option{-Wstrict-overflow=2}.
3087
3088 @item -Wstrict-overflow=3
3089 Also warn about other cases where a comparison is simplified.  For
3090 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3091
3092 @item -Wstrict-overflow=4
3093 Also warn about other simplifications not covered by the above cases.
3094 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3095
3096 @item -Wstrict-overflow=5
3097 Also warn about cases where the compiler reduces the magnitude of a
3098 constant involved in a comparison.  For example: @code{x + 2 > y} will
3099 be simplified to @code{x + 1 >= y}.  This is reported only at the
3100 highest warning level because this simplification applies to many
3101 comparisons, so this warning level will give a very large number of
3102 false positives.
3103 @end table
3104
3105 @item -Warray-bounds
3106 @opindex Wno-array-bounds
3107 @opindex Warray-bounds
3108 This option is only active when @option{-ftree-vrp} is active
3109 (default for -O2 and above). It warns about subscripts to arrays
3110 that are always out of bounds. This warning is enabled by @option{-Wall}.
3111
3112 @item -Wall
3113 @opindex Wall
3114 All of the above @samp{-W} options combined.  This enables all the
3115 warnings about constructions that some users consider questionable, and
3116 that are easy to avoid (or modify to prevent the warning), even in
3117 conjunction with macros.  This also enables some language-specific
3118 warnings described in @ref{C++ Dialect Options} and
3119 @ref{Objective-C and Objective-C++ Dialect Options}.
3120 @end table
3121
3122 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
3123 Some of them warn about constructions that users generally do not
3124 consider questionable, but which occasionally you might wish to check
3125 for; others warn about constructions that are necessary or hard to avoid
3126 in some cases, and there is no simple way to modify the code to suppress
3127 the warning.
3128
3129 @table @gcctabopt
3130 @item -Wextra
3131 @opindex W
3132 @opindex Wextra
3133 (This option used to be called @option{-W}.  The older name is still
3134 supported, but the newer name is more descriptive.)  Print extra warning
3135 messages for these events:
3136
3137 @itemize @bullet
3138 @item
3139 Warn if a comparison is always true or always false due to the limited
3140 range of the data type, but do not warn for constant expressions.  For
3141 example, warn if an unsigned variable is compared against zero with
3142 @samp{<} or @samp{>=}.  This warning can be independently controlled
3143 by @option{-Wtype-limits}.
3144
3145 @item @r{(C only)}
3146 Storage-class specifiers like @code{static} are not the first things
3147 in a declaration.  According to the C Standard, this usage is
3148 obsolescent.  This warning can be independently controlled by
3149 @option{-Wold-style-declaration}.
3150
3151 @item
3152 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
3153 arguments.
3154
3155 @item
3156 A comparison between signed and unsigned values could produce an
3157 incorrect result when the signed value is converted to unsigned.
3158 (But don't warn if @option{-Wno-sign-compare} is also specified.)
3159
3160 @item
3161 An aggregate has an initializer which does not initialize all members.
3162 This warning can be independently controlled by
3163 @option{-Wmissing-field-initializers}.
3164
3165 @item
3166 An initialized field without side effects is overridden when using
3167 designated initializers (@pxref{Designated Inits, , Designated
3168 Initializers}).  This warning can be independently controlled by
3169 @option{-Woverride-init}.
3170
3171 @item @r{(C only)}
3172 A function parameter is declared without a type specifier in K&R-style
3173 functions.  This warning can be independently controlled by
3174 @option{-Wmissing-parameter-type}.
3175
3176 @item
3177 An empty body occurs in an @samp{if}, @samp{else} or
3178 @samp{do while} statement. This warning can be independently
3179 controlled by @option{-Wempty-body}.
3180
3181 @item @r{(C++ only)}
3182 An empty body occurs in a @samp{while} or @samp{for} statement with no
3183 whitespacing before the semicolon. This warning can be independently
3184 controlled by @option{-Wempty-body}.
3185
3186 @item
3187 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3188 @samp{>}, or @samp{>=}.
3189
3190 @item
3191 A variable might be changed by @samp{longjmp} or @samp{vfork}.
3192 This warning can be independently controlled by @option{-Wclobbered}.
3193
3194 @item @r{(C++ only)}
3195 An enumerator and a non-enumerator both appear in a conditional expression.
3196
3197 @item @r{(C++ only)}
3198 A non-static reference or non-static @samp{const} member appears in a
3199 class without constructors.
3200
3201 @item @r{(C++ only)}
3202 Ambiguous virtual bases.
3203
3204 @item @r{(C++ only)}
3205 Subscripting an array which has been declared @samp{register}.
3206
3207 @item @r{(C++ only)}
3208 Taking the address of a variable which has been declared @samp{register}.
3209
3210 @item @r{(C++ only)}
3211 A base class is not initialized in a derived class' copy constructor.
3212 @end itemize
3213
3214 @item -Wno-div-by-zero
3215 @opindex Wno-div-by-zero
3216 @opindex Wdiv-by-zero
3217 Do not warn about compile-time integer division by zero.  Floating point
3218 division by zero is not warned about, as it can be a legitimate way of
3219 obtaining infinities and NaNs.
3220
3221 @item -Wsystem-headers
3222 @opindex Wsystem-headers
3223 @cindex warnings from system headers
3224 @cindex system headers, warnings from
3225 Print warning messages for constructs found in system header files.
3226 Warnings from system headers are normally suppressed, on the assumption
3227 that they usually do not indicate real problems and would only make the
3228 compiler output harder to read.  Using this command line option tells
3229 GCC to emit warnings from system headers as if they occurred in user
3230 code.  However, note that using @option{-Wall} in conjunction with this
3231 option will @emph{not} warn about unknown pragmas in system
3232 headers---for that, @option{-Wunknown-pragmas} must also be used.
3233
3234 @item -Wfloat-equal
3235 @opindex Wfloat-equal
3236 Warn if floating point values are used in equality comparisons.
3237
3238 The idea behind this is that sometimes it is convenient (for the
3239 programmer) to consider floating-point values as approximations to
3240 infinitely precise real numbers.  If you are doing this, then you need
3241 to compute (by analyzing the code, or in some other way) the maximum or
3242 likely maximum error that the computation introduces, and allow for it
3243 when performing comparisons (and when producing output, but that's a
3244 different problem).  In particular, instead of testing for equality, you
3245 would check to see whether the two values have ranges that overlap; and
3246 this is done with the relational operators, so equality comparisons are
3247 probably mistaken.
3248
3249 @item -Wtraditional @r{(C only)}
3250 @opindex Wtraditional
3251 Warn about certain constructs that behave differently in traditional and
3252 ISO C@.  Also warn about ISO C constructs that have no traditional C
3253 equivalent, and/or problematic constructs which should be avoided.
3254
3255 @itemize @bullet
3256 @item
3257 Macro parameters that appear within string literals in the macro body.
3258 In traditional C macro replacement takes place within string literals,
3259 but does not in ISO C@.
3260
3261 @item
3262 In traditional C, some preprocessor directives did not exist.
3263 Traditional preprocessors would only consider a line to be a directive
3264 if the @samp{#} appeared in column 1 on the line.  Therefore
3265 @option{-Wtraditional} warns about directives that traditional C
3266 understands but would ignore because the @samp{#} does not appear as the
3267 first character on the line.  It also suggests you hide directives like
3268 @samp{#pragma} not understood by traditional C by indenting them.  Some
3269 traditional implementations would not recognize @samp{#elif}, so it
3270 suggests avoiding it altogether.
3271
3272 @item
3273 A function-like macro that appears without arguments.
3274
3275 @item
3276 The unary plus operator.
3277
3278 @item
3279 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3280 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3281 constants.)  Note, these suffixes appear in macros defined in the system
3282 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3283 Use of these macros in user code might normally lead to spurious
3284 warnings, however GCC's integrated preprocessor has enough context to
3285 avoid warning in these cases.
3286
3287 @item
3288 A function declared external in one block and then used after the end of
3289 the block.
3290
3291 @item
3292 A @code{switch} statement has an operand of type @code{long}.
3293
3294 @item
3295 A non-@code{static} function declaration follows a @code{static} one.
3296 This construct is not accepted by some traditional C compilers.
3297
3298 @item
3299 The ISO type of an integer constant has a different width or
3300 signedness from its traditional type.  This warning is only issued if
3301 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3302 typically represent bit patterns, are not warned about.
3303
3304 @item
3305 Usage of ISO string concatenation is detected.
3306
3307 @item
3308 Initialization of automatic aggregates.
3309
3310 @item
3311 Identifier conflicts with labels.  Traditional C lacks a separate
3312 namespace for labels.
3313
3314 @item
3315 Initialization of unions.  If the initializer is zero, the warning is
3316 omitted.  This is done under the assumption that the zero initializer in
3317 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3318 initializer warnings and relies on default initialization to zero in the
3319 traditional C case.
3320
3321 @item
3322 Conversions by prototypes between fixed/floating point values and vice
3323 versa.  The absence of these prototypes when compiling with traditional
3324 C would cause serious problems.  This is a subset of the possible
3325 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3326
3327 @item
3328 Use of ISO C style function definitions.  This warning intentionally is
3329 @emph{not} issued for prototype declarations or variadic functions
3330 because these ISO C features will appear in your code when using
3331 libiberty's traditional C compatibility macros, @code{PARAMS} and
3332 @code{VPARAMS}.  This warning is also bypassed for nested functions
3333 because that feature is already a GCC extension and thus not relevant to
3334 traditional C compatibility.
3335 @end itemize
3336
3337 @item -Wtraditional-conversion @r{(C only)}
3338 @opindex Wtraditional-conversion
3339 Warn if a prototype causes a type conversion that is different from what
3340 would happen to the same argument in the absence of a prototype.  This
3341 includes conversions of fixed point to floating and vice versa, and
3342 conversions changing the width or signedness of a fixed point argument
3343 except when the same as the default promotion.
3344
3345 @item -Wdeclaration-after-statement @r{(C only)}
3346 @opindex Wdeclaration-after-statement
3347 Warn when a declaration is found after a statement in a block.  This
3348 construct, known from C++, was introduced with ISO C99 and is by default
3349 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3350 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3351
3352 @item -Wundef
3353 @opindex Wundef
3354 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3355
3356 @item -Wno-endif-labels
3357 @opindex Wno-endif-labels
3358 @opindex Wendif-labels
3359 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3360
3361 @item -Wshadow
3362 @opindex Wshadow
3363 Warn whenever a local variable shadows another local variable, parameter or
3364 global variable or whenever a built-in function is shadowed.
3365
3366 @item -Wlarger-than-@var{len}
3367 @opindex Wlarger-than
3368 Warn whenever an object of larger than @var{len} bytes is defined.
3369
3370 @item -Wunsafe-loop-optimizations
3371 @opindex Wunsafe-loop-optimizations
3372 Warn if the loop cannot be optimized because the compiler could not
3373 assume anything on the bounds of the loop indices.  With
3374 @option{-funsafe-loop-optimizations} warn if the compiler made
3375 such assumptions.
3376
3377 @item -Wpointer-arith
3378 @opindex Wpointer-arith
3379 Warn about anything that depends on the ``size of'' a function type or
3380 of @code{void}.  GNU C assigns these types a size of 1, for
3381 convenience in calculations with @code{void *} pointers and pointers
3382 to functions.  In C++, warn also when an arithmetic operation involves
3383 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3384
3385 @item -Wtype-limits
3386 @opindex Wtype-limits
3387 @opindex Wno-type-limits
3388 Warn if a comparison is always true or always false due to the limited
3389 range of the data type, but do not warn for constant expressions.  For
3390 example, warn if an unsigned variable is compared against zero with
3391 @samp{<} or @samp{>=}.  This warning is also enabled by
3392 @option{-Wextra}.
3393
3394 @item -Wbad-function-cast @r{(C only)}
3395 @opindex Wbad-function-cast
3396 Warn whenever a function call is cast to a non-matching type.
3397 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3398
3399 @item -Wc++-compat
3400 Warn about ISO C constructs that are outside of the common subset of
3401 ISO C and ISO C++, e.g.@: request for implicit conversion from
3402 @code{void *} to a pointer to non-@code{void} type.
3403
3404 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3405 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3406 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3407 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3408
3409 @item -Wcast-qual
3410 @opindex Wcast-qual
3411 Warn whenever a pointer is cast so as to remove a type qualifier from
3412 the target type.  For example, warn if a @code{const char *} is cast
3413 to an ordinary @code{char *}.
3414
3415 @item -Wcast-align
3416 @opindex Wcast-align
3417 Warn whenever a pointer is cast such that the required alignment of the
3418 target is increased.  For example, warn if a @code{char *} is cast to
3419 an @code{int *} on machines where integers can only be accessed at
3420 two- or four-byte boundaries.
3421
3422 @item -Wwrite-strings
3423 @opindex Wwrite-strings
3424 When compiling C, give string constants the type @code{const
3425 char[@var{length}]} so that
3426 copying the address of one into a non-@code{const} @code{char *}
3427 pointer will get a warning; when compiling C++, warn about the
3428 deprecated conversion from string literals to @code{char *}.  This
3429 warning, by default, is enabled for C++ programs.
3430 These warnings will help you find at
3431 compile time code that can try to write into a string constant, but
3432 only if you have been very careful about using @code{const} in
3433 declarations and prototypes.  Otherwise, it will just be a nuisance;
3434 this is why we did not make @option{-Wall} request these warnings.
3435
3436 @item -Wclobbered
3437 @opindex Wclobbered
3438 Warn for variables that might be changed by @samp{longjmp} or
3439 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3440
3441 @item -Wconversion
3442 @opindex Wconversion
3443 @opindex Wno-conversion
3444 Warn for implicit conversions that may alter a value. This includes
3445 conversions between real and integer, like @code{abs (x)} when
3446 @code{x} is @code{double}; conversions between signed and unsigned,
3447 like @code{unsigned ui = -1}; and conversions to smaller types, like
3448 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3449 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3450 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3451 conversions between signed and unsigned integers can be disabled by
3452 using @option{-Wno-sign-conversion}.
3453
3454 For C++, also warn for conversions between @code{NULL} and non-pointer
3455 types; confusing overload resolution for user-defined conversions; and
3456 conversions that will never use a type conversion operator:
3457 conversions to @code{void}, the same type, a base class or a reference
3458 to them. Warnings about conversions between signed and unsigned
3459 integers are disabled by default in C++ unless
3460 @option{-Wsign-conversion} is explicitly enabled.
3461
3462 @item -Wempty-body
3463 @opindex Wempty-body
3464 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3465 while} statement.  Additionally, in C++, warn when an empty body occurs
3466 in a @samp{while} or @samp{for} statement with no whitespacing before
3467 the semicolon.  This warning is also enabled by @option{-Wextra}.
3468
3469 @item -Wsign-compare
3470 @opindex Wsign-compare
3471 @cindex warning for comparison of signed and unsigned values
3472 @cindex comparison of signed and unsigned values, warning
3473 @cindex signed and unsigned values, comparison warning
3474 Warn when a comparison between signed and unsigned values could produce
3475 an incorrect result when the signed value is converted to unsigned.
3476 This warning is also enabled by @option{-Wextra}; to get the other warnings
3477 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3478
3479 @item -Wsign-conversion
3480 @opindex Wsign-conversion
3481 @opindex Wno-sign-conversion
3482 Warn for implicit conversions that may change the sign of an integer
3483 value, like assigning a signed integer expression to an unsigned
3484 integer variable. An explicit cast silences the warning. In C, this
3485 option is enabled also by @option{-Wconversion}.
3486
3487 @item -Waddress
3488 @opindex Waddress
3489 @opindex Wno-address
3490 Warn about suspicious uses of memory addresses. These include using
3491 the address of a function in a conditional expression, such as
3492 @code{void func(void); if (func)}, and comparisons against the memory
3493 address of a string literal, such as @code{if (x == "abc")}.  Such
3494 uses typically indicate a programmer error: the address of a function
3495 always evaluates to true, so their use in a conditional usually
3496 indicate that the programmer forgot the parentheses in a function
3497 call; and comparisons against string literals result in unspecified
3498 behavior and are not portable in C, so they usually indicate that the
3499 programmer intended to use @code{strcmp}.  This warning is enabled by
3500 @option{-Wall}.
3501
3502 @item -Wlogical-op
3503 @opindex Wlogical-op
3504 @opindex Wno-logical-op
3505 Warn about suspicious uses of logical operators in expressions.
3506 This includes using logical operators in contexts where a
3507 bit-wise operator is likely to be expected.
3508
3509 @item -Waggregate-return
3510 @opindex Waggregate-return
3511 Warn if any functions that return structures or unions are defined or
3512 called.  (In languages where you can return an array, this also elicits
3513 a warning.)
3514
3515 @item -Wno-attributes
3516 @opindex Wno-attributes
3517 @opindex Wattributes
3518 Do not warn if an unexpected @code{__attribute__} is used, such as
3519 unrecognized attributes, function attributes applied to variables,
3520 etc.  This will not stop errors for incorrect use of supported
3521 attributes.
3522
3523 @item -Wstrict-prototypes @r{(C only)}
3524 @opindex Wstrict-prototypes
3525 Warn if a function is declared or defined without specifying the
3526 argument types.  (An old-style function definition is permitted without
3527 a warning if preceded by a declaration which specifies the argument
3528 types.)
3529
3530 @item -Wold-style-declaration @r{(C only)}
3531 @opindex Wold-style-declaration
3532 Warn for obsolescent usages, according to the C Standard, in a
3533 declaration. For example, warn if storage-class specifiers like
3534 @code{static} are not the first things in a declaration.  This warning
3535 is also enabled by @option{-Wextra}.
3536
3537 @item -Wold-style-definition @r{(C only)}
3538 @opindex Wold-style-definition
3539 Warn if an old-style function definition is used.  A warning is given
3540 even if there is a previous prototype.
3541
3542 @item -Wmissing-parameter-type @r{(C only)}
3543 @opindex Wmissing-parameter-type
3544 A function parameter is declared without a type specifier in K&R-style
3545 functions:
3546
3547 @smallexample
3548 void foo(bar) @{ @}
3549 @end smallexample
3550
3551 This warning is also enabled by @option{-Wextra}.
3552
3553 @item -Wmissing-prototypes @r{(C only)}
3554 @opindex Wmissing-prototypes
3555 Warn if a global function is defined without a previous prototype
3556 declaration.  This warning is issued even if the definition itself
3557 provides a prototype.  The aim is to detect global functions that fail
3558 to be declared in header files.
3559
3560 @item -Wmissing-declarations @r{(C and C++ only)}
3561 @opindex Wmissing-declarations
3562 Warn if a global function is defined without a previous declaration.
3563 Do so even if the definition itself provides a prototype.
3564 Use this option to detect global functions that are not declared in
3565 header files.  In C++, no warnings are issued for function templates,
3566 or for inline functions, or for functions in anonymous namespaces.
3567
3568 @item -Wmissing-field-initializers
3569 @opindex Wmissing-field-initializers
3570 @opindex W
3571 @opindex Wextra
3572 Warn if a structure's initializer has some fields missing.  For
3573 example, the following code would cause such a warning, because
3574 @code{x.h} is implicitly zero:
3575
3576 @smallexample
3577 struct s @{ int f, g, h; @};
3578 struct s x = @{ 3, 4 @};
3579 @end smallexample
3580
3581 This option does not warn about designated initializers, so the following
3582 modification would not trigger a warning:
3583
3584 @smallexample
3585 struct s @{ int f, g, h; @};
3586 struct s x = @{ .f = 3, .g = 4 @};
3587 @end smallexample
3588
3589 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3590 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3591
3592 @item -Wmissing-noreturn
3593 @opindex Wmissing-noreturn
3594 Warn about functions which might be candidates for attribute @code{noreturn}.
3595 Note these are only possible candidates, not absolute ones.  Care should
3596 be taken to manually verify functions actually do not ever return before
3597 adding the @code{noreturn} attribute, otherwise subtle code generation
3598 bugs could be introduced.  You will not get a warning for @code{main} in
3599 hosted C environments.
3600
3601 @item -Wmissing-format-attribute
3602 @opindex Wmissing-format-attribute
3603 @opindex Wformat
3604 Warn about function pointers which might be candidates for @code{format}
3605 attributes.  Note these are only possible candidates, not absolute ones.
3606 GCC will guess that function pointers with @code{format} attributes that
3607 are used in assignment, initialization, parameter passing or return
3608 statements should have a corresponding @code{format} attribute in the
3609 resulting type.  I.e.@: the left-hand side of the assignment or
3610 initialization, the type of the parameter variable, or the return type
3611 of the containing function respectively should also have a @code{format}
3612 attribute to avoid the warning.
3613
3614 GCC will also warn about function definitions which might be
3615 candidates for @code{format} attributes.  Again, these are only
3616 possible candidates.  GCC will guess that @code{format} attributes
3617 might be appropriate for any function that calls a function like
3618 @code{vprintf} or @code{vscanf}, but this might not always be the
3619 case, and some functions for which @code{format} attributes are
3620 appropriate may not be detected.
3621
3622 @item -Wno-multichar
3623 @opindex Wno-multichar
3624 @opindex Wmultichar
3625 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3626 Usually they indicate a typo in the user's code, as they have
3627 implementation-defined values, and should not be used in portable code.
3628
3629 @item -Wnormalized=<none|id|nfc|nfkc>
3630 @opindex Wnormalized
3631 @cindex NFC
3632 @cindex NFKC
3633 @cindex character set, input normalization
3634 In ISO C and ISO C++, two identifiers are different if they are
3635 different sequences of characters.  However, sometimes when characters
3636 outside the basic ASCII character set are used, you can have two
3637 different character sequences that look the same.  To avoid confusion,
3638 the ISO 10646 standard sets out some @dfn{normalization rules} which
3639 when applied ensure that two sequences that look the same are turned into
3640 the same sequence.  GCC can warn you if you are using identifiers which
3641 have not been normalized; this option controls that warning.
3642
3643 There are four levels of warning that GCC supports.  The default is
3644 @option{-Wnormalized=nfc}, which warns about any identifier which is
3645 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3646 recommended form for most uses.
3647
3648 Unfortunately, there are some characters which ISO C and ISO C++ allow
3649 in identifiers that when turned into NFC aren't allowable as
3650 identifiers.  That is, there's no way to use these symbols in portable
3651 ISO C or C++ and have all your identifiers in NFC.
3652 @option{-Wnormalized=id} suppresses the warning for these characters.
3653 It is hoped that future versions of the standards involved will correct
3654 this, which is why this option is not the default.
3655
3656 You can switch the warning off for all characters by writing
3657 @option{-Wnormalized=none}.  You would only want to do this if you
3658 were using some other normalization scheme (like ``D''), because
3659 otherwise you can easily create bugs that are literally impossible to see.
3660
3661 Some characters in ISO 10646 have distinct meanings but look identical
3662 in some fonts or display methodologies, especially once formatting has
3663 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3664 LETTER N'', will display just like a regular @code{n} which has been
3665 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3666 normalization scheme to convert all these into a standard form as
3667 well, and GCC will warn if your code is not in NFKC if you use
3668 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3669 about every identifier that contains the letter O because it might be
3670 confused with the digit 0, and so is not the default, but may be
3671 useful as a local coding convention if the programming environment is
3672 unable to be fixed to display these characters distinctly.
3673
3674 @item -Wno-deprecated-declarations
3675 @opindex Wno-deprecated-declarations
3676 Do not warn about uses of functions (@pxref{Function Attributes}),
3677 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3678 Attributes}) marked as deprecated by using the @code{deprecated}
3679 attribute.
3680
3681 @item -Wno-overflow
3682 @opindex Wno-overflow
3683 Do not warn about compile-time overflow in constant expressions.
3684
3685 @item -Woverride-init
3686 @opindex Woverride-init
3687 @opindex W
3688 @opindex Wextra
3689 Warn if an initialized field without side effects is overridden when
3690 using designated initializers (@pxref{Designated Inits, , Designated
3691 Initializers}).
3692
3693 This warning is included in @option{-Wextra}.  To get other
3694 @option{-Wextra} warnings without this one, use @samp{-Wextra
3695 -Wno-override-init}.
3696
3697 @item -Wpacked
3698 @opindex Wpacked
3699 Warn if a structure is given the packed attribute, but the packed
3700 attribute has no effect on the layout or size of the structure.
3701 Such structures may be mis-aligned for little benefit.  For
3702 instance, in this code, the variable @code{f.x} in @code{struct bar}
3703 will be misaligned even though @code{struct bar} does not itself
3704 have the packed attribute:
3705
3706 @smallexample
3707 @group
3708 struct foo @{
3709   int x;
3710   char a, b, c, d;
3711 @} __attribute__((packed));
3712 struct bar @{
3713   char z;
3714   struct foo f;
3715 @};
3716 @end group
3717 @end smallexample
3718
3719 @item -Wpadded
3720 @opindex Wpadded
3721 Warn if padding is included in a structure, either to align an element
3722 of the structure or to align the whole structure.  Sometimes when this
3723 happens it is possible to rearrange the fields of the structure to
3724 reduce the padding and so make the structure smaller.
3725
3726 @item -Wredundant-decls
3727 @opindex Wredundant-decls
3728 Warn if anything is declared more than once in the same scope, even in
3729 cases where multiple declaration is valid and changes nothing.
3730
3731 @item -Wnested-externs @r{(C only)}
3732 @opindex Wnested-externs
3733 Warn if an @code{extern} declaration is encountered within a function.
3734
3735 @item -Wunreachable-code
3736 @opindex Wunreachable-code
3737 Warn if the compiler detects that code will never be executed.
3738
3739 This option is intended to warn when the compiler detects that at
3740 least a whole line of source code will never be executed, because
3741 some condition is never satisfied or because it is after a
3742 procedure that never returns.
3743
3744 It is possible for this option to produce a warning even though there
3745 are circumstances under which part of the affected line can be executed,
3746 so care should be taken when removing apparently-unreachable code.
3747
3748 For instance, when a function is inlined, a warning may mean that the
3749 line is unreachable in only one inlined copy of the function.
3750
3751 This option is not made part of @option{-Wall} because in a debugging
3752 version of a program there is often substantial code which checks
3753 correct functioning of the program and is, hopefully, unreachable
3754 because the program does work.  Another common use of unreachable
3755 code is to provide behavior which is selectable at compile-time.
3756
3757 @item -Winline
3758 @opindex Winline
3759 Warn if a function can not be inlined and it was declared as inline.
3760 Even with this option, the compiler will not warn about failures to
3761 inline functions declared in system headers.
3762
3763 The compiler uses a variety of heuristics to determine whether or not
3764 to inline a function.  For example, the compiler takes into account
3765 the size of the function being inlined and the amount of inlining
3766 that has already been done in the current function.  Therefore,
3767 seemingly insignificant changes in the source program can cause the
3768 warnings produced by @option{-Winline} to appear or disappear.
3769
3770 @item -Wno-invalid-offsetof @r{(C++ only)}
3771 @opindex Wno-invalid-offsetof
3772 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3773 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3774 to a non-POD type is undefined.  In existing C++ implementations,
3775 however, @samp{offsetof} typically gives meaningful results even when
3776 applied to certain kinds of non-POD types. (Such as a simple
3777 @samp{struct} that fails to be a POD type only by virtue of having a
3778 constructor.)  This flag is for users who are aware that they are
3779 writing nonportable code and who have deliberately chosen to ignore the
3780 warning about it.
3781
3782 The restrictions on @samp{offsetof} may be relaxed in a future version
3783 of the C++ standard.
3784
3785 @item -Wno-int-to-pointer-cast @r{(C only)}
3786 @opindex Wno-int-to-pointer-cast
3787 Suppress warnings from casts to pointer type of an integer of a
3788 different size.
3789
3790 @item -Wno-pointer-to-int-cast @r{(C only)}
3791 @opindex Wno-pointer-to-int-cast
3792 Suppress warnings from casts from a pointer to an integer type of a
3793 different size.
3794
3795 @item -Winvalid-pch
3796 @opindex Winvalid-pch
3797 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3798 the search path but can't be used.
3799
3800 @item -Wlong-long
3801 @opindex Wlong-long
3802 @opindex Wno-long-long
3803 Warn if @samp{long long} type is used.  This is default.  To inhibit
3804 the warning messages, use @option{-Wno-long-long}.  Flags
3805 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3806 only when @option{-pedantic} flag is used.
3807
3808 @item -Wvariadic-macros
3809 @opindex Wvariadic-macros
3810 @opindex Wno-variadic-macros
3811 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3812 alternate syntax when in pedantic ISO C99 mode.  This is default.
3813 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3814
3815 @item -Wvla
3816 @opindex Wvla
3817 @opindex Wno-vla
3818 Warn if variable length array is used in the code.
3819 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
3820 the variable length array.
3821
3822 @item -Wvolatile-register-var
3823 @opindex Wvolatile-register-var
3824 @opindex Wno-volatile-register-var
3825 Warn if a register variable is declared volatile.  The volatile
3826 modifier does not inhibit all optimizations that may eliminate reads
3827 and/or writes to register variables.
3828
3829 @item -Wdisabled-optimization
3830 @opindex Wdisabled-optimization
3831 Warn if a requested optimization pass is disabled.  This warning does
3832 not generally indicate that there is anything wrong with your code; it
3833 merely indicates that GCC's optimizers were unable to handle the code
3834 effectively.  Often, the problem is that your code is too big or too
3835 complex; GCC will refuse to optimize programs when the optimization
3836 itself is likely to take inordinate amounts of time.
3837
3838 @item -Wpointer-sign
3839 @opindex Wpointer-sign
3840 @opindex Wno-pointer-sign
3841 Warn for pointer argument passing or assignment with different signedness.
3842 This option is only supported for C and Objective-C@.  It is implied by
3843 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3844 @option{-Wno-pointer-sign}.
3845
3846 @item -Werror
3847 @opindex Werror
3848 Make all warnings into errors.
3849
3850 @item -Werror=
3851 @opindex Werror=
3852 Make the specified warning into an errors.  The specifier for a
3853 warning is appended, for example @option{-Werror=switch} turns the
3854 warnings controlled by @option{-Wswitch} into errors.  This switch
3855 takes a negative form, to be used to negate @option{-Werror} for
3856 specific warnings, for example @option{-Wno-error=switch} makes
3857 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3858 is in effect.  You can use the @option{-fdiagnostics-show-option}
3859 option to have each controllable warning amended with the option which
3860 controls it, to determine what to use with this option.
3861
3862 Note that specifying @option{-Werror=}@var{foo} automatically implies
3863 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3864 imply anything.
3865
3866 @item -Wstack-protector
3867 @opindex Wstack-protector
3868 This option is only active when @option{-fstack-protector} is active.  It
3869 warns about functions that will not be protected against stack smashing.
3870
3871 @item -Woverlength-strings
3872 @opindex Woverlength-strings
3873 Warn about string constants which are longer than the ``minimum
3874 maximum'' length specified in the C standard.  Modern compilers
3875 generally allow string constants which are much longer than the
3876 standard's minimum limit, but very portable programs should avoid
3877 using longer strings.
3878
3879 The limit applies @emph{after} string constant concatenation, and does
3880 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3881 C99, it was raised to 4095.  C++98 does not specify a normative
3882 minimum maximum, so we do not diagnose overlength strings in C++@.
3883
3884 This option is implied by @option{-pedantic}, and can be disabled with
3885 @option{-Wno-overlength-strings}.
3886 @end table
3887
3888 @node Debugging Options
3889 @section Options for Debugging Your Program or GCC
3890 @cindex options, debugging
3891 @cindex debugging information options
3892
3893 GCC has various special options that are used for debugging
3894 either your program or GCC:
3895
3896 @table @gcctabopt
3897 @item -g
3898 @opindex g
3899 Produce debugging information in the operating system's native format
3900 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3901 information.
3902
3903 On most systems that use stabs format, @option{-g} enables use of extra
3904 debugging information that only GDB can use; this extra information
3905 makes debugging work better in GDB but will probably make other debuggers
3906 crash or
3907 refuse to read the program.  If you want to control for certain whether
3908 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3909 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3910
3911 GCC allows you to use @option{-g} with
3912 @option{-O}.  The shortcuts taken by optimized code may occasionally
3913 produce surprising results: some variables you declared may not exist
3914 at all; flow of control may briefly move where you did not expect it;
3915 some statements may not be executed because they compute constant
3916 results or their values were already at hand; some statements may
3917 execute in different places because they were moved out of loops.
3918
3919 Nevertheless it proves possible to debug optimized output.  This makes
3920 it reasonable to use the optimizer for programs that might have bugs.
3921
3922 The following options are useful when GCC is generated with the
3923 capability for more than one debugging format.
3924
3925 @item -ggdb
3926 @opindex ggdb
3927 Produce debugging information for use by GDB@.  This means to use the
3928 most expressive format available (DWARF 2, stabs, or the native format
3929 if neither of those are supported), including GDB extensions if at all
3930 possible.
3931
3932 @item -gstabs
3933 @opindex gstabs
3934 Produce debugging information in stabs format (if that is supported),
3935 without GDB extensions.  This is the format used by DBX on most BSD
3936 systems.  On MIPS, Alpha and System V Release 4 systems this option
3937 produces stabs debugging output which is not understood by DBX or SDB@.
3938 On System V Release 4 systems this option requires the GNU assembler.
3939
3940 @item -feliminate-unused-debug-symbols
3941 @opindex feliminate-unused-debug-symbols
3942 Produce debugging information in stabs format (if that is supported),
3943 for only symbols that are actually used.
3944
3945 @item -femit-class-debug-always
3946 Instead of emitting debugging information for a C++ class in only one
3947 object file, emit it in all object files using the class.  This option
3948 should be used only with debuggers that are unable to handle the way GCC
3949 normally emits debugging information for classes because using this
3950 option will increase the size of debugging information by as much as a
3951 factor of two.
3952
3953 @item -gstabs+
3954 @opindex gstabs+
3955 Produce debugging information in stabs format (if that is supported),
3956 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3957 use of these extensions is likely to make other debuggers crash or
3958 refuse to read the program.
3959
3960 @item -gcoff
3961 @opindex gcoff
3962 Produce debugging information in COFF format (if that is supported).
3963 This is the format used by SDB on most System V systems prior to
3964 System V Release 4.
3965
3966 @item -gxcoff
3967 @opindex gxcoff
3968 Produce debugging information in XCOFF format (if that is supported).
3969 This is the format used by the DBX debugger on IBM RS/6000 systems.
3970
3971 @item -gxcoff+
3972 @opindex gxcoff+
3973 Produce debugging information in XCOFF format (if that is supported),
3974 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3975 use of these extensions is likely to make other debuggers crash or
3976 refuse to read the program, and may cause assemblers other than the GNU
3977 assembler (GAS) to fail with an error.
3978
3979 @item -gdwarf-2
3980 @opindex gdwarf-2
3981 Produce debugging information in DWARF version 2 format (if that is
3982 supported).  This is the format used by DBX on IRIX 6.  With this
3983 option, GCC uses features of DWARF version 3 when they are useful;
3984 version 3 is upward compatible with version 2, but may still cause
3985 problems for older debuggers.
3986
3987 @item -gvms
3988 @opindex gvms
3989 Produce debugging information in VMS debug format (if that is
3990 supported).  This is the format used by DEBUG on VMS systems.
3991
3992 @item -g@var{level}
3993 @itemx -ggdb@var{level}
3994 @itemx -gstabs@var{level}
3995 @itemx -gcoff@var{level}
3996 @itemx -gxcoff@var{level}
3997 @itemx -gvms@var{level}
3998 Request debugging information and also use @var{level} to specify how
3999 much information.  The default level is 2.
4000
4001 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4002 @option{-g}.
4003
4004 Level 1 produces minimal information, enough for making backtraces in
4005 parts of the program that you don't plan to debug.  This includes
4006 descriptions of functions and external variables, but no information
4007 about local variables and no line numbers.
4008
4009 Level 3 includes extra information, such as all the macro definitions
4010 present in the program.  Some debuggers support macro expansion when
4011 you use @option{-g3}.
4012
4013 @option{-gdwarf-2} does not accept a concatenated debug level, because
4014 GCC used to support an option @option{-gdwarf} that meant to generate
4015 debug information in version 1 of the DWARF format (which is very
4016 different from version 2), and it would have been too confusing.  That
4017 debug format is long obsolete, but the option cannot be changed now.
4018 Instead use an additional @option{-g@var{level}} option to change the
4019 debug level for DWARF2.
4020
4021 @item -feliminate-dwarf2-dups
4022 @opindex feliminate-dwarf2-dups
4023 Compress DWARF2 debugging information by eliminating duplicated
4024 information about each symbol.  This option only makes sense when
4025 generating DWARF2 debugging information with @option{-gdwarf-2}.
4026
4027 @item -femit-struct-debug-baseonly
4028 Emit debug information for struct-like types
4029 only when the base name of the compilation source file
4030 matches the base name of file in which the struct was defined.
4031
4032 This option substantially reduces the size of debugging information,
4033 but at significant potential loss in type information to the debugger.
4034 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4035 See @option{-femit-struct-debug-detailed} for more detailed control.
4036
4037 This option works only with DWARF 2.
4038
4039 @item -femit-struct-debug-reduced
4040 Emit debug information for struct-like types
4041 only when the base name of the compilation source file
4042 matches the base name of file in which the type was defined,
4043 unless the struct is a template or defined in a system header.
4044
4045 This option significantly reduces the size of debugging information,
4046 with some potential loss in type information to the debugger.
4047 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4048 See @option{-femit-struct-debug-detailed} for more detailed control.
4049
4050 This option works only with DWARF 2.
4051
4052 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4053 Specify the struct-like types
4054 for which the compiler will generate debug information.
4055 The intent is to reduce duplicate struct debug information
4056 between different object files within the same program.
4057
4058 This option is a detailed version of
4059 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4060 which will serve for most needs.
4061
4062 A specification has the syntax
4063 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4064
4065 The optional first word limits the specification to
4066 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4067 A struct type is used directly when it is the type of a variable, member.
4068 Indirect uses arise through pointers to structs.
4069 That is, when use of an incomplete struct would be legal, the use is indirect.
4070 An example is
4071 @samp{struct one direct; struct two * indirect;}.
4072
4073 The optional second word limits the specification to
4074 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4075 Generic structs are a bit complicated to explain.
4076 For C++, these are non-explicit specializations of template classes,
4077 or non-template classes within the above.
4078 Other programming languages have generics,
4079 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4080
4081 The third word specifies the source files for those
4082 structs for which the compiler will emit debug information.
4083 The values @samp{none} and @samp{any} have the normal meaning.
4084 The value @samp{base} means that
4085 the base of name of the file in which the type declaration appears
4086 must match the base of the name of the main compilation file.
4087 In practice, this means that
4088 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4089 but types declared in other header will not.
4090 The value @samp{sys} means those types satisfying @samp{base}
4091 or declared in system or compiler headers.
4092
4093 You may need to experiment to determine the best settings for your application.
4094
4095 The default is @samp{-femit-struct-debug-detailed=all}.
4096
4097 This option works only with DWARF 2.
4098
4099 @cindex @command{prof}
4100 @item -p
4101 @opindex p
4102 Generate extra code to write profile information suitable for the
4103 analysis program @command{prof}.  You must use this option when compiling
4104 the source files you want data about, and you must also use it when
4105 linking.
4106
4107 @cindex @command{gprof}
4108 @item -pg
4109 @opindex pg
4110 Generate extra code to write profile information suitable for the
4111 analysis program @command{gprof}.  You must use this option when compiling
4112 the source files you want data about, and you must also use it when
4113 linking.
4114
4115 @item -Q
4116 @opindex Q
4117 Makes the compiler print out each function name as it is compiled, and
4118 print some statistics about each pass when it finishes.
4119
4120 @item -ftime-report
4121 @opindex ftime-report
4122 Makes the compiler print some statistics about the time consumed by each
4123 pass when it finishes.
4124
4125 @item -fmem-report
4126 @opindex fmem-report
4127 Makes the compiler print some statistics about permanent memory
4128 allocation when it finishes.
4129
4130 @item -fpre-ipa-mem-report
4131 @opindex fpre-ipa-mem-report
4132 @item -fpost-ipa-mem-report
4133 @opindex fpost-ipa-mem-report
4134 Makes the compiler print some statistics about permanent memory
4135 allocation before or after interprocedural optimization.
4136
4137 @item -fprofile-arcs
4138 @opindex fprofile-arcs
4139 Add code so that program flow @dfn{arcs} are instrumented.  During
4140 execution the program records how many times each branch and call is
4141 executed and how many times it is taken or returns.  When the compiled
4142 program exits it saves this data to a file called
4143 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4144 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4145 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4146 @var{auxname} is generated from the name of the output file, if
4147 explicitly specified and it is not the final executable, otherwise it is
4148 the basename of the source file.  In both cases any suffix is removed
4149 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4150 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4151 @xref{Cross-profiling}.
4152
4153 @cindex @command{gcov}
4154 @item --coverage
4155 @opindex coverage
4156
4157 This option is used to compile and link code instrumented for coverage
4158 analysis.  The option is a synonym for @option{-fprofile-arcs}
4159 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4160 linking).  See the documentation for those options for more details.
4161
4162 @itemize
4163
4164 @item
4165 Compile the source files with @option{-fprofile-arcs} plus optimization
4166 and code generation options.  For test coverage analysis, use the
4167 additional @option{-ftest-coverage} option.  You do not need to profile
4168 every source file in a program.
4169
4170 @item
4171 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4172 (the latter implies the former).
4173
4174 @item
4175 Run the program on a representative workload to generate the arc profile
4176 information.  This may be repeated any number of times.  You can run
4177 concurrent instances of your program, and provided that the file system
4178 supports locking, the data files will be correctly updated.  Also
4179 @code{fork} calls are detected and correctly handled (double counting
4180 will not happen).
4181
4182 @item
4183 For profile-directed optimizations, compile the source files again with
4184 the same optimization and code generation options plus
4185 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4186 Control Optimization}).
4187
4188 @item
4189 For test coverage analysis, use @command{gcov} to produce human readable
4190 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4191 @command{gcov} documentation for further information.
4192
4193 @end itemize
4194
4195 With @option{-fprofile-arcs}, for each function of your program GCC
4196 creates a program flow graph, then finds a spanning tree for the graph.
4197 Only arcs that are not on the spanning tree have to be instrumented: the
4198 compiler adds code to count the number of times that these arcs are
4199 executed.  When an arc is the only exit or only entrance to a block, the
4200 instrumentation code can be added to the block; otherwise, a new basic
4201 block must be created to hold the instrumentation code.
4202
4203 @need 2000
4204 @item -ftest-coverage
4205 @opindex ftest-coverage
4206 Produce a notes file that the @command{gcov} code-coverage utility
4207 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4208 show program coverage.  Each source file's note file is called
4209 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4210 above for a description of @var{auxname} and instructions on how to
4211 generate test coverage data.  Coverage data will match the source files
4212 more closely, if you do not optimize.
4213
4214 @item -d@var{letters}
4215 @item -fdump-rtl-@var{pass}
4216 @opindex d
4217 Says to make debugging dumps during compilation at times specified by
4218 @var{letters}.    This is used for debugging the RTL-based passes of the
4219 compiler.  The file names for most of the dumps are made by appending a
4220 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4221 from the name of the output file, if explicitly specified and it is not
4222 an executable, otherwise it is the basename of the source file.
4223
4224 Most debug dumps can be enabled either passing a letter to the @option{-d}
4225 option, or with a long @option{-fdump-rtl} switch; here are the possible
4226 letters for use in @var{letters} and @var{pass}, and their meanings:
4227
4228 @table @gcctabopt
4229 @item -dA
4230 @opindex dA
4231 Annotate the assembler output with miscellaneous debugging information.
4232
4233 @item -dB
4234 @itemx -fdump-rtl-bbro
4235 @opindex dB
4236 @opindex fdump-rtl-bbro
4237 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4238
4239 @item -dc
4240 @itemx -fdump-rtl-combine
4241 @opindex dc
4242 @opindex fdump-rtl-combine
4243 Dump after the RTL instruction combination pass, to the file
4244 @file{@var{file}.129r.combine}.
4245
4246 @item -dC
4247 @itemx -fdump-rtl-ce1
4248 @itemx -fdump-rtl-ce2
4249 @opindex dC
4250 @opindex fdump-rtl-ce1
4251 @opindex fdump-rtl-ce2
4252 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
4253 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
4254 and @option{-fdump-rtl-ce2} enable dumping after the second if
4255 conversion, to the file @file{@var{file}.130r.ce2}.
4256
4257 @item -dd
4258 @itemx -fdump-rtl-btl
4259 @itemx -fdump-rtl-dbr
4260 @opindex dd
4261 @opindex fdump-rtl-btl
4262 @opindex fdump-rtl-dbr
4263 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
4264 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
4265 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
4266 scheduling, to @file{@var{file}.36.dbr}.
4267
4268 @item -dD
4269 @opindex dD
4270 Dump all macro definitions, at the end of preprocessing, in addition to
4271 normal output.
4272
4273 @item -dE
4274 @itemx -fdump-rtl-ce3
4275 @opindex dE
4276 @opindex fdump-rtl-ce3
4277 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4278
4279 @item -df
4280 @itemx -fdump-rtl-cfg
4281 @itemx -fdump-rtl-life
4282 @opindex df
4283 @opindex fdump-rtl-cfg
4284 @opindex fdump-rtl-life
4285 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
4286 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
4287 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4288 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4289
4290 @item -dg
4291 @itemx -fdump-rtl-greg
4292 @opindex dg
4293 @opindex fdump-rtl-greg
4294 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4295
4296 @item -dG
4297 @itemx -fdump-rtl-gcse
4298 @itemx -fdump-rtl-bypass
4299 @opindex dG
4300 @opindex fdump-rtl-gcse
4301 @opindex fdump-rtl-bypass
4302 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4303 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
4304 enable dumping after jump bypassing and control flow optimizations, to
4305 @file{@var{file}.115r.bypass}.
4306
4307 @item -dh
4308 @itemx -fdump-rtl-eh
4309 @opindex dh
4310 @opindex fdump-rtl-eh
4311 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4312
4313 @item -di
4314 @itemx -fdump-rtl-sibling
4315 @opindex di
4316 @opindex fdump-rtl-sibling
4317 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4318
4319 @item -dj
4320 @itemx -fdump-rtl-jump
4321 @opindex dj
4322 @opindex fdump-rtl-jump
4323 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4324
4325 @item -dk
4326 @itemx -fdump-rtl-stack
4327 @opindex dk
4328 @opindex fdump-rtl-stack
4329 Dump after conversion from GCC's "flat register file" registers to the
4330 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4331
4332 @item -dl
4333 @itemx -fdump-rtl-lreg
4334 @opindex dl
4335 @opindex fdump-rtl-lreg
4336 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4337
4338 @item -dL
4339 @itemx -fdump-rtl-loop2
4340 @opindex dL
4341 @opindex fdump-rtl-loop2
4342 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4343 loop optimization pass, to @file{@var{file}.119r.loop2},
4344 @file{@var{file}.120r.loop2_init},
4345 @file{@var{file}.121r.loop2_invariant}, and
4346 @file{@var{file}.125r.loop2_done}.
4347
4348 @item -dm
4349 @itemx -fdump-rtl-sms
4350 @opindex dm
4351 @opindex fdump-rtl-sms
4352 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4353
4354 @item -dM
4355 @itemx -fdump-rtl-mach
4356 @opindex dM
4357 @opindex fdump-rtl-mach
4358 Dump after performing the machine dependent reorganization pass, to
4359 @file{@var{file}.155r.mach}.
4360
4361 @item -dn
4362 @itemx -fdump-rtl-rnreg
4363 @opindex dn
4364 @opindex fdump-rtl-rnreg
4365 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4366
4367 @item -dN
4368 @itemx -fdump-rtl-regmove
4369 @opindex dN
4370 @opindex fdump-rtl-regmove
4371 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4372
4373 @item -do
4374 @itemx -fdump-rtl-postreload
4375 @opindex do
4376 @opindex fdump-rtl-postreload
4377 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4378
4379 @item -dr
4380 @itemx -fdump-rtl-expand
4381 @opindex dr
4382 @opindex fdump-rtl-expand
4383 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4384
4385 @item -dR
4386 @itemx -fdump-rtl-sched2
4387 @opindex dR
4388 @opindex fdump-rtl-sched2
4389 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4390
4391 @item -ds
4392 @itemx -fdump-rtl-cse
4393 @opindex ds
4394 @opindex fdump-rtl-cse
4395 Dump after CSE (including the jump optimization that sometimes follows
4396 CSE), to @file{@var{file}.113r.cse}.
4397
4398 @item -dS
4399 @itemx -fdump-rtl-sched1
4400 @opindex dS
4401 @opindex fdump-rtl-sched1
4402 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4403
4404 @item -dt
4405 @itemx -fdump-rtl-cse2
4406 @opindex dt
4407 @opindex fdump-rtl-cse2
4408 Dump after the second CSE pass (including the jump optimization that
4409 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4410
4411 @item -dT
4412 @itemx -fdump-rtl-tracer
4413 @opindex dT
4414 @opindex fdump-rtl-tracer
4415 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4416
4417 @item -dV
4418 @itemx -fdump-rtl-vpt
4419 @itemx -fdump-rtl-vartrack
4420 @opindex dV
4421 @opindex fdump-rtl-vpt
4422 @opindex fdump-rtl-vartrack
4423 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4424 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4425 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4426 to @file{@var{file}.154r.vartrack}.
4427
4428 @item -dw
4429 @itemx -fdump-rtl-flow2
4430 @opindex dw
4431 @opindex fdump-rtl-flow2
4432 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4433
4434 @item -dz
4435 @itemx -fdump-rtl-peephole2
4436 @opindex dz
4437 @opindex fdump-rtl-peephole2
4438 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4439
4440 @item -dZ
4441 @itemx -fdump-rtl-web
4442 @opindex dZ
4443 @opindex fdump-rtl-web
4444 Dump after live range splitting, to @file{@var{file}.126r.web}.
4445
4446 @item -da
4447 @itemx -fdump-rtl-all
4448 @opindex da
4449 @opindex fdump-rtl-all
4450 Produce all the dumps listed above.
4451
4452 @item -dH
4453 @opindex dH
4454 Produce a core dump whenever an error occurs.
4455
4456 @item -dm
4457 @opindex dm
4458 Print statistics on memory usage, at the end of the run, to
4459 standard error.
4460
4461 @item -dp
4462 @opindex dp
4463 Annotate the assembler output with a comment indicating which
4464 pattern and alternative was used.  The length of each instruction is
4465 also printed.
4466
4467 @item -dP
4468 @opindex dP
4469 Dump the RTL in the assembler output as a comment before each instruction.
4470 Also turns on @option{-dp} annotation.
4471
4472 @item -dv
4473 @opindex dv
4474 For each of the other indicated dump files (either with @option{-d} or
4475 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4476 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4477
4478 @item -dx
4479 @opindex dx
4480 Just generate RTL for a function instead of compiling it.  Usually used
4481 with @samp{r} (@option{-fdump-rtl-expand}).
4482
4483 @item -dy
4484 @opindex dy
4485 Dump debugging information during parsing, to standard error.
4486 @end table
4487
4488 @item -fdump-noaddr
4489 @opindex fdump-noaddr
4490 When doing debugging dumps (see @option{-d} option above), suppress
4491 address output.  This makes it more feasible to use diff on debugging
4492 dumps for compiler invocations with different compiler binaries and/or
4493 different text / bss / data / heap / stack / dso start locations.
4494
4495 @item -fdump-unnumbered
4496 @opindex fdump-unnumbered
4497 When doing debugging dumps (see @option{-d} option above), suppress instruction
4498 numbers and address output.  This makes it more feasible to
4499 use diff on debugging dumps for compiler invocations with different
4500 options, in particular with and without @option{-g}.
4501
4502 @item -fdump-translation-unit @r{(C++ only)}
4503 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4504 @opindex fdump-translation-unit
4505 Dump a representation of the tree structure for the entire translation
4506 unit to a file.  The file name is made by appending @file{.tu} to the
4507 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4508 controls the details of the dump as described for the
4509 @option{-fdump-tree} options.
4510
4511 @item -fdump-class-hierarchy @r{(C++ only)}
4512 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4513 @opindex fdump-class-hierarchy
4514 Dump a representation of each class's hierarchy and virtual function
4515 table layout to a file.  The file name is made by appending @file{.class}
4516 to the source file name.  If the @samp{-@var{options}} form is used,
4517 @var{options} controls the details of the dump as described for the
4518 @option{-fdump-tree} options.
4519
4520 @item -fdump-ipa-@var{switch}
4521 @opindex fdump-ipa
4522 Control the dumping at various stages of inter-procedural analysis
4523 language tree to a file.  The file name is generated by appending a switch
4524 specific suffix to the source file name.  The following dumps are possible:
4525
4526 @table @samp
4527 @item all
4528 Enables all inter-procedural analysis dumps; currently the only produced
4529 dump is the @samp{cgraph} dump.
4530
4531 @item cgraph
4532 Dumps information about call-graph optimization, unused function removal,
4533 and inlining decisions.
4534 @end table
4535
4536 @item -fdump-tree-@var{switch}
4537 @itemx -fdump-tree-@var{switch}-@var{options}
4538 @opindex fdump-tree
4539 Control the dumping at various stages of processing the intermediate
4540 language tree to a file.  The file name is generated by appending a switch
4541 specific suffix to the source file name.  If the @samp{-@var{options}}
4542 form is used, @var{options} is a list of @samp{-} separated options that
4543 control the details of the dump.  Not all options are applicable to all
4544 dumps, those which are not meaningful will be ignored.  The following
4545 options are available
4546
4547 @table @samp
4548 @item address
4549 Print the address of each node.  Usually this is not meaningful as it
4550 changes according to the environment and source file.  Its primary use
4551 is for tying up a dump file with a debug environment.
4552 @item slim
4553 Inhibit dumping of members of a scope or body of a function merely
4554 because that scope has been reached.  Only dump such items when they
4555 are directly reachable by some other path.  When dumping pretty-printed
4556 trees, this option inhibits dumping the bodies of control structures.
4557 @item raw
4558 Print a raw representation of the tree.  By default, trees are
4559 pretty-printed into a C-like representation.
4560 @item details
4561 Enable more detailed dumps (not honored by every dump option).
4562 @item stats
4563 Enable dumping various statistics about the pass (not honored by every dump
4564 option).
4565 @item blocks
4566 Enable showing basic block boundaries (disabled in raw dumps).
4567 @item vops
4568 Enable showing virtual operands for every statement.
4569 @item lineno
4570 Enable showing line numbers for statements.
4571 @item uid
4572 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4573 @item all
4574 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4575 @end table
4576
4577 The following tree dumps are possible:
4578 @table @samp
4579
4580 @item original
4581 Dump before any tree based optimization, to @file{@var{file}.original}.
4582
4583 @item optimized
4584 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4585
4586 @item inlined
4587 Dump after function inlining, to @file{@var{file}.inlined}.
4588
4589 @item gimple
4590 @opindex fdump-tree-gimple
4591 Dump each function before and after the gimplification pass to a file.  The
4592 file name is made by appending @file{.gimple} to the source file name.
4593
4594 @item cfg
4595 @opindex fdump-tree-cfg
4596 Dump the control flow graph of each function to a file.  The file name is
4597 made by appending @file{.cfg} to the source file name.
4598
4599 @item vcg
4600 @opindex fdump-tree-vcg
4601 Dump the control flow graph of each function to a file in VCG format.  The
4602 file name is made by appending @file{.vcg} to the source file name.  Note
4603 that if the file contains more than one function, the generated file cannot
4604 be used directly by VCG@.  You will need to cut and paste each function's
4605 graph into its own separate file first.
4606
4607 @item ch
4608 @opindex fdump-tree-ch
4609 Dump each function after copying loop headers.  The file name is made by
4610 appending @file{.ch} to the source file name.
4611
4612 @item ssa
4613 @opindex fdump-tree-ssa
4614 Dump SSA related information to a file.  The file name is made by appending
4615 @file{.ssa} to the source file name.
4616
4617 @item salias
4618 @opindex fdump-tree-salias
4619 Dump structure aliasing variable information to a file.  This file name
4620 is made by appending @file{.salias} to the source file name.
4621
4622 @item alias
4623 @opindex fdump-tree-alias
4624 Dump aliasing information for each function.  The file name is made by
4625 appending @file{.alias} to the source file name.
4626
4627 @item ccp
4628 @opindex fdump-tree-ccp
4629 Dump each function after CCP@.  The file name is made by appending
4630 @file{.ccp} to the source file name.
4631
4632 @item storeccp
4633 @opindex fdump-tree-storeccp
4634 Dump each function after STORE-CCP.  The file name is made by appending
4635 @file{.storeccp} to the source file name.
4636
4637 @item pre
4638 @opindex fdump-tree-pre
4639 Dump trees after partial redundancy elimination.  The file name is made
4640 by appending @file{.pre} to the source file name.
4641
4642 @item fre
4643 @opindex fdump-tree-fre
4644 Dump trees after full redundancy elimination.  The file name is made
4645 by appending @file{.fre} to the source file name.
4646
4647 @item copyprop
4648 @opindex fdump-tree-copyprop
4649 Dump trees after copy propagation.  The file name is made
4650 by appending @file{.copyprop} to the source file name.
4651
4652 @item store_copyprop
4653 @opindex fdump-tree-store_copyprop
4654 Dump trees after store copy-propagation.  The file name is made
4655 by appending @file{.store_copyprop} to the source file name.
4656
4657 @item dce
4658 @opindex fdump-tree-dce
4659 Dump each function after dead code elimination.  The file name is made by
4660 appending @file{.dce} to the source file name.
4661
4662 @item mudflap
4663 @opindex fdump-tree-mudflap
4664 Dump each function after adding mudflap instrumentation.  The file name is
4665 made by appending @file{.mudflap} to the source file name.
4666
4667 @item sra
4668 @opindex fdump-tree-sra
4669 Dump each function after performing scalar replacement of aggregates.  The
4670 file name is made by appending @file{.sra} to the source file name.
4671
4672 @item sink
4673 @opindex fdump-tree-sink
4674 Dump each function after performing code sinking.  The file name is made
4675 by appending @file{.sink} to the source file name.
4676
4677 @item dom
4678 @opindex fdump-tree-dom
4679 Dump each function after applying dominator tree optimizations.  The file
4680 name is made by appending @file{.dom} to the source file name.
4681
4682 @item dse
4683 @opindex fdump-tree-dse
4684 Dump each function after applying dead store elimination.  The file
4685 name is made by appending @file{.dse} to the source file name.
4686
4687 @item phiopt
4688 @opindex fdump-tree-phiopt
4689 Dump each function after optimizing PHI nodes into straightline code.  The file
4690 name is made by appending @file{.phiopt} to the source file name.
4691
4692 @item forwprop
4693 @opindex fdump-tree-forwprop
4694 Dump each function after forward propagating single use variables.  The file
4695 name is made by appending @file{.forwprop} to the source file name.
4696
4697 @item copyrename
4698 @opindex fdump-tree-copyrename
4699 Dump each function after applying the copy rename optimization.  The file
4700 name is made by appending @file{.copyrename} to the source file name.
4701
4702 @item nrv
4703 @opindex fdump-tree-nrv
4704 Dump each function after applying the named return value optimization on
4705 generic trees.  The file name is made by appending @file{.nrv} to the source
4706 file name.
4707
4708 @item vect
4709 @opindex fdump-tree-vect
4710 Dump each function after applying vectorization of loops.  The file name is
4711 made by appending @file{.vect} to the source file name.
4712
4713 @item vrp
4714 @opindex fdump-tree-vrp
4715 Dump each function after Value Range Propagation (VRP).  The file name
4716 is made by appending @file{.vrp} to the source file name.
4717
4718 @item all
4719 @opindex fdump-tree-all
4720 Enable all the available tree dumps with the flags provided in this option.
4721 @end table
4722
4723 @item -ftree-vectorizer-verbose=@var{n}
4724 @opindex ftree-vectorizer-verbose
4725 This option controls the amount of debugging output the vectorizer prints.
4726 This information is written to standard error, unless
4727 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4728 in which case it is output to the usual dump listing file, @file{.vect}.
4729 For @var{n}=0 no diagnostic information is reported.
4730 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4731 and the total number of loops that got vectorized.
4732 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4733 the first analysis phase (vect_analyze_loop_form) - i.e. countable,
4734 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4735 level that @option{-fdump-tree-vect-stats} uses.
4736 Higher verbosity levels mean either more information dumped for each
4737 reported loop, or same amount of information reported for more loops:
4738 If @var{n}=3, alignment related information is added to the reports.
4739 If @var{n}=4, data-references related information (e.g. memory dependences,
4740 memory access-patterns) is added to the reports.
4741 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4742 that did not pass the first analysis phase (i.e. may not be countable, or
4743 may have complicated control-flow).
4744 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4745 For @var{n}=7, all the information the vectorizer generates during its
4746 analysis and transformation is reported.  This is the same verbosity level
4747 that @option{-fdump-tree-vect-details} uses.
4748
4749 @item -frandom-seed=@var{string}
4750 @opindex frandom-string
4751 This option provides a seed that GCC uses when it would otherwise use
4752 random numbers.  It is used to generate certain symbol names
4753 that have to be different in every compiled file.  It is also used to
4754 place unique stamps in coverage data files and the object files that
4755 produce them.  You can use the @option{-frandom-seed} option to produce
4756 reproducibly identical object files.
4757
4758 The @var{string} should be different for every file you compile.
4759
4760 @item -fsched-verbose=@var{n}
4761 @opindex fsched-verbose
4762 On targets that use instruction scheduling, this option controls the
4763 amount of debugging output the scheduler prints.  This information is
4764 written to standard error, unless @option{-dS} or @option{-dR} is
4765 specified, in which case it is output to the usual dump
4766 listing file, @file{.sched} or @file{.sched2} respectively.  However
4767 for @var{n} greater than nine, the output is always printed to standard
4768 error.
4769
4770 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4771 same information as @option{-dRS}.  For @var{n} greater than one, it
4772 also output basic block probabilities, detailed ready list information
4773 and unit/insn info.  For @var{n} greater than two, it includes RTL
4774 at abort point, control-flow and regions info.  And for @var{n} over
4775 four, @option{-fsched-verbose} also includes dependence info.
4776
4777 @item -save-temps
4778 @opindex save-temps
4779 Store the usual ``temporary'' intermediate files permanently; place them
4780 in the current directory and name them based on the source file.  Thus,
4781 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4782 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4783 preprocessed @file{foo.i} output file even though the compiler now
4784 normally uses an integrated preprocessor.
4785
4786 When used in combination with the @option{-x} command line option,
4787 @option{-save-temps} is sensible enough to avoid over writing an
4788 input source file with the same extension as an intermediate file.
4789 The corresponding intermediate file may be obtained by renaming the
4790 source file before using @option{-save-temps}.
4791
4792 @item -time
4793 @opindex time
4794 Report the CPU time taken by each subprocess in the compilation
4795 sequence.  For C source files, this is the compiler proper and assembler
4796 (plus the linker if linking is done).  The output looks like this:
4797
4798 @smallexample
4799 # cc1 0.12 0.01
4800 # as 0.00 0.01
4801 @end smallexample
4802
4803 The first number on each line is the ``user time'', that is time spent
4804 executing the program itself.  The second number is ``system time'',
4805 time spent executing operating system routines on behalf of the program.
4806 Both numbers are in seconds.
4807
4808 @item -fvar-tracking
4809 @opindex fvar-tracking
4810 Run variable tracking pass.  It computes where variables are stored at each
4811 position in code.  Better debugging information is then generated
4812 (if the debugging information format supports this information).
4813
4814 It is enabled by default when compiling with optimization (@option{-Os},
4815 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4816 the debug info format supports it.
4817
4818 @item -print-file-name=@var{library}
4819 @opindex print-file-name
4820 Print the full absolute name of the library file @var{library} that
4821 would be used when linking---and don't do anything else.  With this
4822 option, GCC does not compile or link anything; it just prints the
4823 file name.
4824
4825 @item -print-multi-directory
4826 @opindex print-multi-directory
4827 Print the directory name corresponding to the multilib selected by any
4828 other switches present in the command line.  This directory is supposed
4829 to exist in @env{GCC_EXEC_PREFIX}.
4830
4831 @item -print-multi-lib
4832 @opindex print-multi-lib
4833 Print the mapping from multilib directory names to compiler switches
4834 that enable them.  The directory name is separated from the switches by
4835 @samp{;}, and each switch starts with an @samp{@@} instead of the
4836 @samp{-}, without spaces between multiple switches.  This is supposed to
4837 ease shell-processing.
4838
4839 @item -print-prog-name=@var{program}
4840 @opindex print-prog-name
4841 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4842
4843 @item -print-libgcc-file-name
4844 @opindex print-libgcc-file-name
4845 Same as @option{-print-file-name=libgcc.a}.
4846
4847 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4848 but you do want to link with @file{libgcc.a}.  You can do
4849
4850 @smallexample
4851 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4852 @end smallexample
4853
4854 @item -print-search-dirs
4855 @opindex print-search-dirs
4856 Print the name of the configured installation directory and a list of
4857 program and library directories @command{gcc} will search---and don't do anything else.
4858
4859 This is useful when @command{gcc} prints the error message
4860 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4861 To resolve this you either need to put @file{cpp0} and the other compiler
4862 components where @command{gcc} expects to find them, or you can set the environment
4863 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4864 Don't forget the trailing @samp{/}.
4865 @xref{Environment Variables}.
4866
4867 @item -print-sysroot-headers-suffix
4868 @opindex print-sysroot-headers-suffix
4869 Print the suffix added to the target sysroot when searching for
4870 headers, or give an error if the compiler is not configured with such
4871 a suffix---and don't do anything else.
4872
4873 @item -dumpmachine
4874 @opindex dumpmachine
4875 Print the compiler's target machine (for example,
4876 @samp{i686-pc-linux-gnu})---and don't do anything else.
4877
4878 @item -dumpversion
4879 @opindex dumpversion
4880 Print the compiler version (for example, @samp{3.0})---and don't do
4881 anything else.
4882
4883 @item -dumpspecs
4884 @opindex dumpspecs
4885 Print the compiler's built-in specs---and don't do anything else.  (This
4886 is used when GCC itself is being built.)  @xref{Spec Files}.
4887
4888 @item -feliminate-unused-debug-types
4889 @opindex feliminate-unused-debug-types
4890 Normally, when producing DWARF2 output, GCC will emit debugging
4891 information for all types declared in a compilation
4892 unit, regardless of whether or not they are actually used
4893 in that compilation unit.  Sometimes this is useful, such as
4894 if, in the debugger, you want to cast a value to a type that is
4895 not actually used in your program (but is declared).  More often,
4896 however, this results in a significant amount of wasted space.
4897 With this option, GCC will avoid producing debug symbol output
4898 for types that are nowhere used in the source file being compiled.
4899 @end table
4900
4901 @node Optimize Options
4902 @section Options That Control Optimization
4903 @cindex optimize options
4904 @cindex options, optimization
4905
4906 These options control various sorts of optimizations.
4907
4908 Without any optimization option, the compiler's goal is to reduce the
4909 cost of compilation and to make debugging produce the expected
4910 results.  Statements are independent: if you stop the program with a
4911 breakpoint between statements, you can then assign a new value to any
4912 variable or change the program counter to any other statement in the
4913 function and get exactly the results you would expect from the source
4914 code.
4915
4916 Turning on optimization flags makes the compiler attempt to improve
4917 the performance and/or code size at the expense of compilation time
4918 and possibly the ability to debug the program.
4919
4920 The compiler performs optimization based on the knowledge it has of
4921 the program.  Optimization levels @option{-O} and above, in
4922 particular, enable @emph{unit-at-a-time} mode, which allows the
4923 compiler to consider information gained from later functions in
4924 the file when compiling a function.  Compiling multiple files at
4925 once to a single output file in @emph{unit-at-a-time} mode allows
4926 the compiler to use information gained from all of the files when
4927 compiling each of them.
4928
4929 Not all optimizations are controlled directly by a flag.  Only
4930 optimizations that have a flag are listed.
4931
4932 @table @gcctabopt
4933 @item -O
4934 @itemx -O1
4935 @opindex O
4936 @opindex O1
4937 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4938 more memory for a large function.
4939
4940 With @option{-O}, the compiler tries to reduce code size and execution
4941 time, without performing any optimizations that take a great deal of
4942 compilation time.
4943
4944 @option{-O} turns on the following optimization flags:
4945 @gccoptlist{-fdefer-pop @gol
4946 -fdelayed-branch @gol
4947 -fguess-branch-probability @gol
4948 -fcprop-registers @gol
4949 -fif-conversion @gol
4950 -fif-conversion2 @gol
4951 -fsplit-wide-types @gol
4952 -ftree-ccp @gol
4953 -ftree-dce @gol
4954 -ftree-dominator-opts @gol
4955 -ftree-dse @gol
4956 -ftree-ter @gol
4957 -ftree-sra @gol
4958 -ftree-copyrename @gol
4959 -ftree-fre @gol
4960 -ftree-ch @gol
4961 -funit-at-a-time @gol
4962 -fmerge-constants}
4963
4964 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4965 where doing so does not interfere with debugging.
4966
4967 @item -O2
4968 @opindex O2
4969 Optimize even more.  GCC performs nearly all supported optimizations
4970 that do not involve a space-speed tradeoff.  The compiler does not
4971 perform loop unrolling or function inlining when you specify @option{-O2}.
4972 As compared to @option{-O}, this option increases both compilation time
4973 and the performance of the generated code.
4974
4975 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4976 also turns on the following optimization flags:
4977 @gccoptlist{-fthread-jumps @gol
4978 -fcrossjumping @gol
4979 -foptimize-sibling-calls @gol
4980 -fcse-follow-jumps  -fcse-skip-blocks @gol
4981 -fgcse  -fgcse-lm  @gol
4982 -fexpensive-optimizations @gol
4983 -frerun-cse-after-loop  @gol
4984 -fcaller-saves @gol
4985 -fpeephole2 @gol
4986 -fschedule-insns  -fschedule-insns2 @gol
4987 -fsched-interblock  -fsched-spec @gol
4988 -fregmove @gol
4989 -fstrict-aliasing -fstrict-overflow @gol
4990 -fdelete-null-pointer-checks @gol
4991 -freorder-blocks  -freorder-functions @gol
4992 -falign-functions  -falign-jumps @gol
4993 -falign-loops  -falign-labels @gol
4994 -ftree-vrp @gol
4995 -ftree-pre}
4996
4997 Please note the warning under @option{-fgcse} about
4998 invoking @option{-O2} on programs that use computed gotos.
4999
5000 @item -O3
5001 @opindex O3
5002 Optimize yet more.  @option{-O3} turns on all optimizations specified by
5003 @option{-O2} and also turns on the @option{-finline-functions},
5004 @option{-funswitch-loops}, @option{-fpredictive-commoning} and
5005 @option{-fgcse-after-reload} options.
5006
5007 @item -O0
5008 @opindex O0
5009 Reduce compilation time and make debugging produce the expected
5010 results.  This is the default.
5011
5012 @item -Os
5013 @opindex Os
5014 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5015 do not typically increase code size.  It also performs further
5016 optimizations designed to reduce code size.
5017
5018 @option{-Os} disables the following optimization flags:
5019 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5020 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5021 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5022
5023 If you use multiple @option{-O} options, with or without level numbers,
5024 the last such option is the one that is effective.
5025 @end table
5026
5027 Options of the form @option{-f@var{flag}} specify machine-independent
5028 flags.  Most flags have both positive and negative forms; the negative
5029 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5030 below, only one of the forms is listed---the one you typically will
5031 use.  You can figure out the other form by either removing @samp{no-}
5032 or adding it.
5033
5034 The following options control specific optimizations.  They are either
5035 activated by @option{-O} options or are related to ones that are.  You
5036 can use the following flags in the rare cases when ``fine-tuning'' of
5037 optimizations to be performed is desired.
5038
5039 @table @gcctabopt
5040 @item -fno-default-inline
5041 @opindex fno-default-inline
5042 Do not make member functions inline by default merely because they are
5043 defined inside the class scope (C++ only).  Otherwise, when you specify
5044 @w{@option{-O}}, member functions defined inside class scope are compiled
5045 inline by default; i.e., you don't need to add @samp{inline} in front of
5046 the member function name.
5047
5048 @item -fno-defer-pop
5049 @opindex fno-defer-pop
5050 Always pop the arguments to each function call as soon as that function
5051 returns.  For machines which must pop arguments after a function call,
5052 the compiler normally lets arguments accumulate on the stack for several
5053 function calls and pops them all at once.
5054
5055 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5056
5057 @item -fforce-addr
5058 @opindex fforce-addr
5059 Force memory address constants to be copied into registers before
5060 doing arithmetic on them.
5061
5062 @item -fforward-propagate
5063 @opindex fforward-propagate
5064 Perform a forward propagation pass on RTL.  The pass tries to combine two
5065 instructions and checks if the result can be simplified.  If loop unrolling
5066 is active, two passes are performed and the second is scheduled after
5067 loop unrolling.
5068
5069 This option is enabled by default at optimization levels @option{-O2},
5070 @option{-O3}, @option{-Os}.
5071
5072 @item -fomit-frame-pointer
5073 @opindex fomit-frame-pointer
5074 Don't keep the frame pointer in a register for functions that
5075 don't need one.  This avoids the instructions to save, set up and
5076 restore frame pointers; it also makes an extra register available
5077 in many functions.  @strong{It also makes debugging impossible on
5078 some machines.}
5079
5080 On some machines, such as the VAX, this flag has no effect, because
5081 the standard calling sequence automatically handles the frame pointer
5082 and nothing is saved by pretending it doesn't exist.  The
5083 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5084 whether a target machine supports this flag.  @xref{Registers,,Register
5085 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5086
5087 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5088
5089 @item -foptimize-sibling-calls
5090 @opindex foptimize-sibling-calls
5091 Optimize sibling and tail recursive calls.
5092
5093 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5094
5095 @item -fno-inline
5096 @opindex fno-inline
5097 Don't pay attention to the @code{inline} keyword.  Normally this option
5098 is used to keep the compiler from expanding any functions inline.
5099 Note that if you are not optimizing, no functions can be expanded inline.
5100
5101 @item -finline-functions
5102 @opindex finline-functions
5103 Integrate all simple functions into their callers.  The compiler
5104 heuristically decides which functions are simple enough to be worth
5105 integrating in this way.
5106
5107 If all calls to a given function are integrated, and the function is
5108 declared @code{static}, then the function is normally not output as
5109 assembler code in its own right.
5110
5111 Enabled at level @option{-O3}.
5112
5113 @item -finline-functions-called-once
5114 @opindex finline-functions-called-once
5115 Consider all @code{static} functions called once for inlining into their
5116 caller even if they are not marked @code{inline}.  If a call to a given
5117 function is integrated, then the function is not output as assembler code
5118 in its own right.
5119
5120 Enabled if @option{-funit-at-a-time} is enabled.
5121
5122 @item -fearly-inlining
5123 @opindex fearly-inlining
5124 Inline functions marked by @code{always_inline} and functions whose body seems
5125 smaller than the function call overhead early before doing
5126 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5127 makes profiling significantly cheaper and usually inlining faster on programs
5128 having large chains of nested wrapper functions.
5129
5130 Enabled by default.
5131
5132 @item -finline-limit=@var{n}
5133 @opindex finline-limit
5134 By default, GCC limits the size of functions that can be inlined.  This flag
5135 allows the control of this limit for functions that are explicitly marked as
5136 inline (i.e., marked with the inline keyword or defined within the class
5137 definition in c++).  @var{n} is the size of functions that can be inlined in
5138 number of pseudo instructions (not counting parameter handling).  The default
5139 value of @var{n} is 600.
5140 Increasing this value can result in more inlined code at
5141 the cost of compilation time and memory consumption.  Decreasing usually makes
5142 the compilation faster and less code will be inlined (which presumably
5143 means slower programs).  This option is particularly useful for programs that
5144 use inlining heavily such as those based on recursive templates with C++.
5145
5146 Inlining is actually controlled by a number of parameters, which may be
5147 specified individually by using @option{--param @var{name}=@var{value}}.
5148 The @option{-finline-limit=@var{n}} option sets some of these parameters
5149 as follows:
5150
5151 @table @gcctabopt
5152 @item max-inline-insns-single
5153  is set to @var{n}/2.
5154 @item max-inline-insns-auto
5155  is set to @var{n}/2.
5156 @item min-inline-insns
5157  is set to 130 or @var{n}/4, whichever is smaller.
5158 @item max-inline-insns-rtl
5159  is set to @var{n}.
5160 @end table
5161
5162 See below for a documentation of the individual
5163 parameters controlling inlining.
5164
5165 @emph{Note:} pseudo instruction represents, in this particular context, an
5166 abstract measurement of function's size.  In no way does it represent a count
5167 of assembly instructions and as such its exact meaning might change from one
5168 release to an another.
5169
5170 @item -fkeep-inline-functions
5171 @opindex fkeep-inline-functions
5172 In C, emit @code{static} functions that are declared @code{inline}
5173 into the object file, even if the function has been inlined into all
5174 of its callers.  This switch does not affect functions using the
5175 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5176 inline functions into the object file.
5177
5178 @item -fkeep-static-consts
5179 @opindex fkeep-static-consts
5180 Emit variables declared @code{static const} when optimization isn't turned
5181 on, even if the variables aren't referenced.
5182
5183 GCC enables this option by default.  If you want to force the compiler to
5184 check if the variable was referenced, regardless of whether or not
5185 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5186
5187 @item -fmerge-constants
5188 Attempt to merge identical constants (string constants and floating point
5189 constants) across compilation units.
5190
5191 This option is the default for optimized compilation if the assembler and
5192 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5193 behavior.
5194
5195 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5196
5197 @item -fmerge-all-constants
5198 Attempt to merge identical constants and identical variables.
5199
5200 This option implies @option{-fmerge-constants}.  In addition to
5201 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5202 arrays or initialized constant variables with integral or floating point
5203 types.  Languages like C or C++ require each non-automatic variable to
5204 have distinct location, so using this option will result in non-conforming
5205 behavior.
5206
5207 @item -fmodulo-sched
5208 @opindex fmodulo-sched
5209 Perform swing modulo scheduling immediately before the first scheduling
5210 pass.  This pass looks at innermost loops and reorders their
5211 instructions by overlapping different iterations.
5212
5213 @item -fno-branch-count-reg
5214 @opindex fno-branch-count-reg
5215 Do not use ``decrement and branch'' instructions on a count register,
5216 but instead generate a sequence of instructions that decrement a
5217 register, compare it against zero, then branch based upon the result.
5218 This option is only meaningful on architectures that support such
5219 instructions, which include x86, PowerPC, IA-64 and S/390.
5220
5221 The default is @option{-fbranch-count-reg}.
5222
5223 @item -fno-function-cse
5224 @opindex fno-function-cse
5225 Do not put function addresses in registers; make each instruction that
5226 calls a constant function contain the function's address explicitly.
5227
5228 This option results in less efficient code, but some strange hacks
5229 that alter the assembler output may be confused by the optimizations
5230 performed when this option is not used.
5231
5232 The default is @option{-ffunction-cse}
5233
5234 @item -fno-zero-initialized-in-bss
5235 @opindex fno-zero-initialized-in-bss
5236 If the target supports a BSS section, GCC by default puts variables that
5237 are initialized to zero into BSS@.  This can save space in the resulting
5238 code.
5239
5240 This option turns off this behavior because some programs explicitly
5241 rely on variables going to the data section.  E.g., so that the
5242 resulting executable can find the beginning of that section and/or make
5243 assumptions based on that.
5244
5245 The default is @option{-fzero-initialized-in-bss}.
5246
5247 @item -fbounds-check
5248 @opindex fbounds-check
5249 For front-ends that support it, generate additional code to check that
5250 indices used to access arrays are within the declared range.  This is
5251 currently only supported by the Java and Fortran front-ends, where
5252 this option defaults to true and false respectively.
5253
5254 @item -fmudflap -fmudflapth -fmudflapir
5255 @opindex fmudflap
5256 @opindex fmudflapth
5257 @opindex fmudflapir
5258 @cindex bounds checking
5259 @cindex mudflap
5260 For front-ends that support it (C and C++), instrument all risky
5261 pointer/array dereferencing operations, some standard library
5262 string/heap functions, and some other associated constructs with
5263 range/validity tests.  Modules so instrumented should be immune to
5264 buffer overflows, invalid heap use, and some other classes of C/C++
5265 programming errors.  The instrumentation relies on a separate runtime
5266 library (@file{libmudflap}), which will be linked into a program if
5267 @option{-fmudflap} is given at link time.  Run-time behavior of the
5268 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5269 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5270 for its options.
5271
5272 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5273 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5274 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5275 instrumentation should ignore pointer reads.  This produces less
5276 instrumentation (and therefore faster execution) and still provides
5277 some protection against outright memory corrupting writes, but allows
5278 erroneously read data to propagate within a program.
5279
5280 @item -fthread-jumps
5281 @opindex fthread-jumps
5282 Perform optimizations where we check to see if a jump branches to a
5283 location where another comparison subsumed by the first is found.  If
5284 so, the first branch is redirected to either the destination of the
5285 second branch or a point immediately following it, depending on whether
5286 the condition is known to be true or false.
5287
5288 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5289
5290 @item -fsplit-wide-types
5291 @opindex fsplit-wide-types
5292 When using a type that occupies multiple registers, such as @code{long
5293 long} on a 32-bit system, split the registers apart and allocate them
5294 independently.  This normally generates better code for those types,
5295 but may make debugging more difficult.
5296
5297 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5298 @option{-Os}.
5299
5300 @item -fcse-follow-jumps
5301 @opindex fcse-follow-jumps
5302 In common subexpression elimination, scan through jump instructions
5303 when the target of the jump is not reached by any other path.  For
5304 example, when CSE encounters an @code{if} statement with an
5305 @code{else} clause, CSE will follow the jump when the condition
5306 tested is false.
5307
5308 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5309
5310 @item -fcse-skip-blocks
5311 @opindex fcse-skip-blocks
5312 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5313 follow jumps which conditionally skip over blocks.  When CSE
5314 encounters a simple @code{if} statement with no else clause,
5315 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5316 body of the @code{if}.
5317
5318 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5319
5320 @item -frerun-cse-after-loop
5321 @opindex frerun-cse-after-loop
5322 Re-run common subexpression elimination after loop optimizations has been
5323 performed.
5324
5325 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5326
5327 @item -fgcse
5328 @opindex fgcse
5329 Perform a global common subexpression elimination pass.
5330 This pass also performs global constant and copy propagation.
5331
5332 @emph{Note:} When compiling a program using computed gotos, a GCC
5333 extension, you may get better runtime performance if you disable
5334 the global common subexpression elimination pass by adding
5335 @option{-fno-gcse} to the command line.
5336
5337 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5338
5339 @item -fgcse-lm
5340 @opindex fgcse-lm
5341 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5342 attempt to move loads which are only killed by stores into themselves.  This
5343 allows a loop containing a load/store sequence to be changed to a load outside
5344 the loop, and a copy/store within the loop.
5345
5346 Enabled by default when gcse is enabled.
5347
5348 @item -fgcse-sm
5349 @opindex fgcse-sm
5350 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5351 global common subexpression elimination.  This pass will attempt to move
5352 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5353 loops containing a load/store sequence can be changed to a load before
5354 the loop and a store after the loop.
5355
5356 Not enabled at any optimization level.
5357
5358 @item -fgcse-las
5359 @opindex fgcse-las
5360 When @option{-fgcse-las} is enabled, the global common subexpression
5361 elimination pass eliminates redundant loads that come after stores to the
5362 same memory location (both partial and full redundancies).
5363
5364 Not enabled at any optimization level.
5365
5366 @item -fgcse-after-reload
5367 @opindex fgcse-after-reload
5368 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5369 pass is performed after reload.  The purpose of this pass is to cleanup
5370 redundant spilling.
5371
5372 @item -funsafe-loop-optimizations
5373 @opindex funsafe-loop-optimizations
5374 If given, the loop optimizer will assume that loop indices do not
5375 overflow, and that the loops with nontrivial exit condition are not
5376 infinite.  This enables a wider range of loop optimizations even if
5377 the loop optimizer itself cannot prove that these assumptions are valid.
5378 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5379 if it finds this kind of loop.
5380
5381 @item -fcrossjumping
5382 @opindex crossjumping
5383 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5384 resulting code may or may not perform better than without cross-jumping.
5385
5386 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5387
5388 @item -fif-conversion
5389 @opindex if-conversion
5390 Attempt to transform conditional jumps into branch-less equivalents.  This
5391 include use of conditional moves, min, max, set flags and abs instructions, and
5392 some tricks doable by standard arithmetics.  The use of conditional execution
5393 on chips where it is available is controlled by @code{if-conversion2}.
5394
5395 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5396
5397 @item -fif-conversion2
5398 @opindex if-conversion2
5399 Use conditional execution (where available) to transform conditional jumps into
5400 branch-less equivalents.
5401
5402 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5403
5404 @item -fdelete-null-pointer-checks
5405 @opindex fdelete-null-pointer-checks
5406 Use global dataflow analysis to identify and eliminate useless checks
5407 for null pointers.  The compiler assumes that dereferencing a null
5408 pointer would have halted the program.  If a pointer is checked after
5409 it has already been dereferenced, it cannot be null.
5410
5411 In some environments, this assumption is not true, and programs can
5412 safely dereference null pointers.  Use
5413 @option{-fno-delete-null-pointer-checks} to disable this optimization
5414 for programs which depend on that behavior.
5415
5416 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5417
5418 @item -fexpensive-optimizations
5419 @opindex fexpensive-optimizations
5420 Perform a number of minor optimizations that are relatively expensive.
5421
5422 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5423
5424 @item -foptimize-register-move
5425 @itemx -fregmove
5426 @opindex foptimize-register-move
5427 @opindex fregmove
5428 Attempt to reassign register numbers in move instructions and as
5429 operands of other simple instructions in order to maximize the amount of
5430 register tying.  This is especially helpful on machines with two-operand
5431 instructions.
5432
5433 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5434 optimization.
5435
5436 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5437
5438 @item -fdelayed-branch
5439 @opindex fdelayed-branch
5440 If supported for the target machine, attempt to reorder instructions
5441 to exploit instruction slots available after delayed branch
5442 instructions.
5443
5444 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5445
5446 @item -fschedule-insns
5447 @opindex fschedule-insns
5448 If supported for the target machine, attempt to reorder instructions to
5449 eliminate execution stalls due to required data being unavailable.  This
5450 helps machines that have slow floating point or memory load instructions
5451 by allowing other instructions to be issued until the result of the load
5452 or floating point instruction is required.
5453
5454 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5455
5456 @item -fschedule-insns2
5457 @opindex fschedule-insns2
5458 Similar to @option{-fschedule-insns}, but requests an additional pass of
5459 instruction scheduling after register allocation has been done.  This is
5460 especially useful on machines with a relatively small number of
5461 registers and where memory load instructions take more than one cycle.
5462
5463 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5464
5465 @item -fno-sched-interblock
5466 @opindex fno-sched-interblock
5467 Don't schedule instructions across basic blocks.  This is normally
5468 enabled by default when scheduling before register allocation, i.e.@:
5469 with @option{-fschedule-insns} or at @option{-O2} or higher.
5470
5471 @item -fno-sched-spec
5472 @opindex fno-sched-spec
5473 Don't allow speculative motion of non-load instructions.  This is normally
5474 enabled by default when scheduling before register allocation, i.e.@:
5475 with @option{-fschedule-insns} or at @option{-O2} or higher.
5476
5477 @item -fsched-spec-load
5478 @opindex fsched-spec-load
5479 Allow speculative motion of some load instructions.  This only makes
5480 sense when scheduling before register allocation, i.e.@: with
5481 @option{-fschedule-insns} or at @option{-O2} or higher.
5482
5483 @item -fsched-spec-load-dangerous
5484 @opindex fsched-spec-load-dangerous
5485 Allow speculative motion of more load instructions.  This only makes
5486 sense when scheduling before register allocation, i.e.@: with
5487 @option{-fschedule-insns} or at @option{-O2} or higher.
5488
5489 @item -fsched-stalled-insns=@var{n}
5490 @opindex fsched-stalled-insns
5491 Define how many insns (if any) can be moved prematurely from the queue
5492 of stalled insns into the ready list, during the second scheduling pass.
5493
5494 @item -fsched-stalled-insns-dep=@var{n}
5495 @opindex fsched-stalled-insns-dep
5496 Define how many insn groups (cycles) will be examined for a dependency
5497 on a stalled insn that is candidate for premature removal from the queue
5498 of stalled insns.  Has an effect only during the second scheduling pass,
5499 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5500
5501 @item -fsched2-use-superblocks
5502 @opindex fsched2-use-superblocks
5503 When scheduling after register allocation, do use superblock scheduling
5504 algorithm.  Superblock scheduling allows motion across basic block boundaries
5505 resulting on faster schedules.  This option is experimental, as not all machine
5506 descriptions used by GCC model the CPU closely enough to avoid unreliable
5507 results from the algorithm.
5508
5509 This only makes sense when scheduling after register allocation, i.e.@: with
5510 @option{-fschedule-insns2} or at @option{-O2} or higher.
5511
5512 @item -fsched2-use-traces
5513 @opindex fsched2-use-traces
5514 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5515 allocation and additionally perform code duplication in order to increase the
5516 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5517 trace formation.
5518
5519 This mode should produce faster but significantly longer programs.  Also
5520 without @option{-fbranch-probabilities} the traces constructed may not
5521 match the reality and hurt the performance.  This only makes
5522 sense when scheduling after register allocation, i.e.@: with
5523 @option{-fschedule-insns2} or at @option{-O2} or higher.
5524
5525 @item -fsee
5526 @opindex fsee
5527 Eliminates redundant extension instructions and move the non redundant
5528 ones to optimal placement using LCM.
5529
5530 @item -freschedule-modulo-scheduled-loops
5531 @opindex fscheduling-in-modulo-scheduled-loops
5532 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5533 we may want to prevent the later scheduling passes from changing its schedule, we use this
5534 option to control that.
5535
5536 @item -fcaller-saves
5537 @opindex fcaller-saves
5538 Enable values to be allocated in registers that will be clobbered by
5539 function calls, by emitting extra instructions to save and restore the
5540 registers around such calls.  Such allocation is done only when it
5541 seems to result in better code than would otherwise be produced.
5542
5543 This option is always enabled by default on certain machines, usually
5544 those which have no call-preserved registers to use instead.
5545
5546 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5547
5548 @item -ftree-pre
5549 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5550 enabled by default at @option{-O2} and @option{-O3}.
5551
5552 @item -ftree-fre
5553 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5554 between FRE and PRE is that FRE only considers expressions
5555 that are computed on all paths leading to the redundant computation.
5556 This analysis is faster than PRE, though it exposes fewer redundancies.
5557 This flag is enabled by default at @option{-O} and higher.
5558
5559 @item -ftree-copy-prop
5560 Perform copy propagation on trees.  This pass eliminates unnecessary
5561 copy operations.  This flag is enabled by default at @option{-O} and
5562 higher.
5563
5564 @item -ftree-store-copy-prop
5565 Perform copy propagation of memory loads and stores.  This pass
5566 eliminates unnecessary copy operations in memory references
5567 (structures, global variables, arrays, etc).  This flag is enabled by
5568 default at @option{-O2} and higher.
5569
5570 @item -ftree-salias
5571 Perform structural alias analysis on trees.  This flag
5572 is enabled by default at @option{-O} and higher.
5573
5574 @item -fipa-pta
5575 Perform interprocedural pointer analysis.
5576
5577 @item -ftree-sink
5578 Perform forward store motion  on trees.  This flag is
5579 enabled by default at @option{-O} and higher.
5580
5581 @item -ftree-ccp
5582 Perform sparse conditional constant propagation (CCP) on trees.  This
5583 pass only operates on local scalar variables and is enabled by default
5584 at @option{-O} and higher.
5585
5586 @item -ftree-store-ccp
5587 Perform sparse conditional constant propagation (CCP) on trees.  This
5588 pass operates on both local scalar variables and memory stores and
5589 loads (global variables, structures, arrays, etc).  This flag is
5590 enabled by default at @option{-O2} and higher.
5591
5592 @item -ftree-dce
5593 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5594 default at @option{-O} and higher.
5595
5596 @item -ftree-dominator-opts
5597 Perform a variety of simple scalar cleanups (constant/copy
5598 propagation, redundancy elimination, range propagation and expression
5599 simplification) based on a dominator tree traversal.  This also
5600 performs jump threading (to reduce jumps to jumps). This flag is
5601 enabled by default at @option{-O} and higher.
5602
5603 @item -ftree-ch
5604 Perform loop header copying on trees.  This is beneficial since it increases
5605 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5606 is enabled by default at @option{-O} and higher.  It is not enabled
5607 for @option{-Os}, since it usually increases code size.
5608
5609 @item -ftree-loop-optimize
5610 Perform loop optimizations on trees.  This flag is enabled by default
5611 at @option{-O} and higher.
5612
5613 @item -ftree-loop-linear
5614 Perform linear loop transformations on tree.  This flag can improve cache
5615 performance and allow further loop optimizations to take place.
5616
5617 @item -fcheck-data-deps
5618 Compare the results of several data dependence analyzers.  This option
5619 is used for debugging the data dependence analyzers.
5620
5621 @item -ftree-loop-im
5622 Perform loop invariant motion on trees.  This pass moves only invariants that
5623 would be hard to handle at RTL level (function calls, operations that expand to
5624 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5625 operands of conditions that are invariant out of the loop, so that we can use
5626 just trivial invariantness analysis in loop unswitching.  The pass also includes
5627 store motion.
5628
5629 @item -ftree-loop-ivcanon
5630 Create a canonical counter for number of iterations in the loop for that
5631 determining number of iterations requires complicated analysis.  Later
5632 optimizations then may determine the number easily.  Useful especially
5633 in connection with unrolling.
5634
5635 @item -fivopts
5636 Perform induction variable optimizations (strength reduction, induction
5637 variable merging and induction variable elimination) on trees.
5638
5639 @item -ftree-sra
5640 Perform scalar replacement of aggregates.  This pass replaces structure
5641 references with scalars to prevent committing structures to memory too
5642 early.  This flag is enabled by default at @option{-O} and higher.
5643
5644 @item -ftree-copyrename
5645 Perform copy renaming on trees.  This pass attempts to rename compiler
5646 temporaries to other variables at copy locations, usually resulting in
5647 variable names which more closely resemble the original variables.  This flag
5648 is enabled by default at @option{-O} and higher.
5649
5650 @item -ftree-ter
5651 Perform temporary expression replacement during the SSA->normal phase.  Single
5652 use/single def temporaries are replaced at their use location with their
5653 defining expression.  This results in non-GIMPLE code, but gives the expanders
5654 much more complex trees to work on resulting in better RTL generation.  This is
5655 enabled by default at @option{-O} and higher.
5656
5657 @item -ftree-vectorize
5658 Perform loop vectorization on trees.
5659
5660 @item -ftree-vect-loop-version
5661 @opindex ftree-vect-loop-version
5662 Perform loop versioning when doing loop vectorization on trees.  When a loop
5663 appears to be vectorizable except that data alignment or data dependence cannot
5664 be determined at compile time then vectorized and non-vectorized versions of
5665 the loop are generated along with runtime checks for alignment or dependence
5666 to control which version is executed.  This option is enabled by default
5667 except at level @option{-Os} where it is disabled.
5668
5669 @item -ftree-vrp
5670 Perform Value Range Propagation on trees.  This is similar to the
5671 constant propagation pass, but instead of values, ranges of values are
5672 propagated.  This allows the optimizers to remove unnecessary range
5673 checks like array bound checks and null pointer checks.  This is
5674 enabled by default at @option{-O2} and higher.  Null pointer check
5675 elimination is only done if @option{-fdelete-null-pointer-checks} is
5676 enabled.
5677
5678 @item -ftracer
5679 @opindex ftracer
5680 Perform tail duplication to enlarge superblock size.  This transformation
5681 simplifies the control flow of the function allowing other optimizations to do
5682 better job.
5683
5684 @item -funroll-loops
5685 @opindex funroll-loops
5686 Unroll loops whose number of iterations can be determined at compile
5687 time or upon entry to the loop.  @option{-funroll-loops} implies
5688 @option{-frerun-cse-after-loop}.  This option makes code larger,
5689 and may or may not make it run faster.
5690
5691 @item -funroll-all-loops
5692 @opindex funroll-all-loops
5693 Unroll all loops, even if their number of iterations is uncertain when
5694 the loop is entered.  This usually makes programs run more slowly.
5695 @option{-funroll-all-loops} implies the same options as
5696 @option{-funroll-loops},
5697
5698 @item -fsplit-ivs-in-unroller
5699 @opindex fsplit-ivs-in-unroller
5700 Enables expressing of values of induction variables in later iterations
5701 of the unrolled loop using the value in the first iteration.  This breaks
5702 long dependency chains, thus improving efficiency of the scheduling passes.
5703
5704 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5705 same effect.  However in cases the loop body is more complicated than
5706 a single basic block, this is not reliable.  It also does not work at all
5707 on some of the architectures due to restrictions in the CSE pass.
5708
5709 This optimization is enabled by default.
5710
5711 @item -fvariable-expansion-in-unroller
5712 @opindex fvariable-expansion-in-unroller
5713 With this option, the compiler will create multiple copies of some
5714 local variables when unrolling a loop which can result in superior code.
5715
5716 @item -fpredictive-commoning
5717 @opindex fpredictive-commoning
5718 Perform predictive commoning optimization, i.e., reusing computations
5719 (especially memory loads and stores) performed in previous
5720 iterations of loops.
5721
5722 This option is enabled at level @option{-O3}.
5723
5724 @item -fprefetch-loop-arrays
5725 @opindex fprefetch-loop-arrays
5726 If supported by the target machine, generate instructions to prefetch
5727 memory to improve the performance of loops that access large arrays.
5728
5729 This option may generate better or worse code; results are highly
5730 dependent on the structure of loops within the source code.
5731
5732 Disabled at level @option{-Os}.
5733
5734 @item -fno-peephole
5735 @itemx -fno-peephole2
5736 @opindex fno-peephole
5737 @opindex fno-peephole2
5738 Disable any machine-specific peephole optimizations.  The difference
5739 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5740 are implemented in the compiler; some targets use one, some use the
5741 other, a few use both.
5742
5743 @option{-fpeephole} is enabled by default.
5744 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5745
5746 @item -fno-guess-branch-probability
5747 @opindex fno-guess-branch-probability
5748 Do not guess branch probabilities using heuristics.
5749
5750 GCC will use heuristics to guess branch probabilities if they are
5751 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5752 heuristics are based on the control flow graph.  If some branch probabilities
5753 are specified by @samp{__builtin_expect}, then the heuristics will be
5754 used to guess branch probabilities for the rest of the control flow graph,
5755 taking the @samp{__builtin_expect} info into account.  The interactions
5756 between the heuristics and @samp{__builtin_expect} can be complex, and in
5757 some cases, it may be useful to disable the heuristics so that the effects
5758 of @samp{__builtin_expect} are easier to understand.
5759
5760 The default is @option{-fguess-branch-probability} at levels
5761 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5762
5763 @item -freorder-blocks
5764 @opindex freorder-blocks
5765 Reorder basic blocks in the compiled function in order to reduce number of
5766 taken branches and improve code locality.
5767
5768 Enabled at levels @option{-O2}, @option{-O3}.
5769
5770 @item -freorder-blocks-and-partition
5771 @opindex freorder-blocks-and-partition
5772 In addition to reordering basic blocks in the compiled function, in order
5773 to reduce number of taken branches, partitions hot and cold basic blocks
5774 into separate sections of the assembly and .o files, to improve
5775 paging and cache locality performance.
5776
5777 This optimization is automatically turned off in the presence of
5778 exception handling, for linkonce sections, for functions with a user-defined
5779 section attribute and on any architecture that does not support named
5780 sections.
5781
5782 @item -freorder-functions
5783 @opindex freorder-functions
5784 Reorder functions in the object file in order to
5785 improve code locality.  This is implemented by using special
5786 subsections @code{.text.hot} for most frequently executed functions and
5787 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5788 the linker so object file format must support named sections and linker must
5789 place them in a reasonable way.
5790
5791 Also profile feedback must be available in to make this option effective.  See
5792 @option{-fprofile-arcs} for details.
5793
5794 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5795
5796 @item -fstrict-aliasing
5797 @opindex fstrict-aliasing
5798 Allows the compiler to assume the strictest aliasing rules applicable to
5799 the language being compiled.  For C (and C++), this activates
5800 optimizations based on the type of expressions.  In particular, an
5801 object of one type is assumed never to reside at the same address as an
5802 object of a different type, unless the types are almost the same.  For
5803 example, an @code{unsigned int} can alias an @code{int}, but not a
5804 @code{void*} or a @code{double}.  A character type may alias any other
5805 type.
5806
5807 Pay special attention to code like this:
5808 @smallexample
5809 union a_union @{
5810   int i;
5811   double d;
5812 @};
5813
5814 int f() @{
5815   a_union t;
5816   t.d = 3.0;
5817   return t.i;
5818 @}
5819 @end smallexample
5820 The practice of reading from a different union member than the one most
5821 recently written to (called ``type-punning'') is common.  Even with
5822 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5823 is accessed through the union type.  So, the code above will work as
5824 expected.  However, this code might not:
5825 @smallexample
5826 int f() @{
5827   a_union t;
5828   int* ip;
5829   t.d = 3.0;
5830   ip = &t.i;
5831   return *ip;
5832 @}
5833 @end smallexample
5834
5835 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5836
5837 @item -fstrict-overflow
5838 @opindex fstrict-overflow
5839 Allow the compiler to assume strict signed overflow rules, depending
5840 on the language being compiled.  For C (and C++) this means that
5841 overflow when doing arithmetic with signed numbers is undefined, which
5842 means that the compiler may assume that it will not happen.  This
5843 permits various optimizations.  For example, the compiler will assume
5844 that an expression like @code{i + 10 > i} will always be true for
5845 signed @code{i}.  This assumption is only valid if signed overflow is
5846 undefined, as the expression is false if @code{i + 10} overflows when
5847 using twos complement arithmetic.  When this option is in effect any
5848 attempt to determine whether an operation on signed numbers will
5849 overflow must be written carefully to not actually involve overflow.
5850
5851 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
5852 that signed overflow is fully defined: it wraps.  When
5853 @option{-fwrapv} is used, there is no difference between
5854 @option{-fstrict-overflow} and @option{-fno-strict-overflow}.  With
5855 @option{-fwrapv} certain types of overflow are permitted.  For
5856 example, if the compiler gets an overflow when doing arithmetic on
5857 constants, the overflowed value can still be used with
5858 @option{-fwrapv}, but not otherwise.
5859
5860 The @option{-fstrict-overflow} option is enabled at levels
5861 @option{-O2}, @option{-O3}, @option{-Os}.
5862
5863 @item -falign-functions
5864 @itemx -falign-functions=@var{n}
5865 @opindex falign-functions
5866 Align the start of functions to the next power-of-two greater than
5867 @var{n}, skipping up to @var{n} bytes.  For instance,
5868 @option{-falign-functions=32} aligns functions to the next 32-byte
5869 boundary, but @option{-falign-functions=24} would align to the next
5870 32-byte boundary only if this can be done by skipping 23 bytes or less.
5871
5872 @option{-fno-align-functions} and @option{-falign-functions=1} are
5873 equivalent and mean that functions will not be aligned.
5874
5875 Some assemblers only support this flag when @var{n} is a power of two;
5876 in that case, it is rounded up.
5877
5878 If @var{n} is not specified or is zero, use a machine-dependent default.
5879
5880 Enabled at levels @option{-O2}, @option{-O3}.
5881
5882 @item -falign-labels
5883 @itemx -falign-labels=@var{n}
5884 @opindex falign-labels
5885 Align all branch targets to a power-of-two boundary, skipping up to
5886 @var{n} bytes like @option{-falign-functions}.  This option can easily
5887 make code slower, because it must insert dummy operations for when the
5888 branch target is reached in the usual flow of the code.
5889
5890 @option{-fno-align-labels} and @option{-falign-labels=1} are
5891 equivalent and mean that labels will not be aligned.
5892
5893 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5894 are greater than this value, then their values are used instead.
5895
5896 If @var{n} is not specified or is zero, use a machine-dependent default
5897 which is very likely to be @samp{1}, meaning no alignment.
5898
5899 Enabled at levels @option{-O2}, @option{-O3}.
5900
5901 @item -falign-loops
5902 @itemx -falign-loops=@var{n}
5903 @opindex falign-loops
5904 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5905 like @option{-falign-functions}.  The hope is that the loop will be
5906 executed many times, which will make up for any execution of the dummy
5907 operations.
5908
5909 @option{-fno-align-loops} and @option{-falign-loops=1} are
5910 equivalent and mean that loops will not be aligned.
5911
5912 If @var{n} is not specified or is zero, use a machine-dependent default.
5913
5914 Enabled at levels @option{-O2}, @option{-O3}.
5915
5916 @item -falign-jumps
5917 @itemx -falign-jumps=@var{n}
5918 @opindex falign-jumps
5919 Align branch targets to a power-of-two boundary, for branch targets
5920 where the targets can only be reached by jumping, skipping up to @var{n}
5921 bytes like @option{-falign-functions}.  In this case, no dummy operations
5922 need be executed.
5923
5924 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5925 equivalent and mean that loops will not be aligned.
5926
5927 If @var{n} is not specified or is zero, use a machine-dependent default.
5928
5929 Enabled at levels @option{-O2}, @option{-O3}.
5930
5931 @item -funit-at-a-time
5932 @opindex funit-at-a-time
5933 Parse the whole compilation unit before starting to produce code.
5934 This allows some extra optimizations to take place but consumes
5935 more memory (in general).  There are some compatibility issues
5936 with @emph{unit-at-a-time} mode:
5937 @itemize @bullet
5938 @item
5939 enabling @emph{unit-at-a-time} mode may change the order
5940 in which functions, variables, and top-level @code{asm} statements
5941 are emitted, and will likely break code relying on some particular
5942 ordering.  The majority of such top-level @code{asm} statements,
5943 though, can be replaced by @code{section} attributes.  The
5944 @option{fno-toplevel-reorder} option may be used to keep the ordering
5945 used in the input file, at the cost of some optimizations.
5946
5947 @item
5948 @emph{unit-at-a-time} mode removes unreferenced static variables
5949 and functions.  This may result in undefined references
5950 when an @code{asm} statement refers directly to variables or functions
5951 that are otherwise unused.  In that case either the variable/function
5952 shall be listed as an operand of the @code{asm} statement operand or,
5953 in the case of top-level @code{asm} statements the attribute @code{used}
5954 shall be used on the declaration.
5955
5956 @item
5957 Static functions now can use non-standard passing conventions that
5958 may break @code{asm} statements calling functions directly.  Again,
5959 attribute @code{used} will prevent this behavior.
5960 @end itemize
5961
5962 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5963 but this scheme may not be supported by future releases of GCC@.
5964
5965 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5966
5967 @item -fno-toplevel-reorder
5968 Do not reorder top-level functions, variables, and @code{asm}
5969 statements.  Output them in the same order that they appear in the
5970 input file.  When this option is used, unreferenced static variables
5971 will not be removed.  This option is intended to support existing code
5972 which relies on a particular ordering.  For new code, it is better to
5973 use attributes.
5974
5975 @item -fweb
5976 @opindex fweb
5977 Constructs webs as commonly used for register allocation purposes and assign
5978 each web individual pseudo register.  This allows the register allocation pass
5979 to operate on pseudos directly, but also strengthens several other optimization
5980 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5981 however, make debugging impossible, since variables will no longer stay in a
5982 ``home register''.
5983
5984 Enabled by default with @option{-funroll-loops}.
5985
5986 @item -fwhole-program
5987 @opindex fwhole-program
5988 Assume that the current compilation unit represents whole program being
5989 compiled.  All public functions and variables with the exception of @code{main}
5990 and those merged by attribute @code{externally_visible} become static functions
5991 and in a affect gets more aggressively optimized by interprocedural optimizers.
5992 While this option is equivalent to proper use of @code{static} keyword for
5993 programs consisting of single file, in combination with option
5994 @option{--combine} this flag can be used to compile most of smaller scale C
5995 programs since the functions and variables become local for the whole combined
5996 compilation unit, not for the single source file itself.
5997
5998
5999 @item -fno-cprop-registers
6000 @opindex fno-cprop-registers
6001 After register allocation and post-register allocation instruction splitting,
6002 we perform a copy-propagation pass to try to reduce scheduling dependencies
6003 and occasionally eliminate the copy.
6004
6005 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6006
6007 @item -fprofile-generate
6008 @opindex fprofile-generate
6009
6010 Enable options usually used for instrumenting application to produce
6011 profile useful for later recompilation with profile feedback based
6012 optimization.  You must use @option{-fprofile-generate} both when
6013 compiling and when linking your program.
6014
6015 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6016
6017 @item -fprofile-use
6018 @opindex fprofile-use
6019 Enable profile feedback directed optimizations, and optimizations
6020 generally profitable only with profile feedback available.
6021
6022 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6023 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6024
6025 By default, GCC emits an error message if the feedback profiles do not
6026 match the source code.  This error can be turned into a warning by using
6027 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6028 code.
6029 @end table
6030
6031 The following options control compiler behavior regarding floating
6032 point arithmetic.  These options trade off between speed and
6033 correctness.  All must be specifically enabled.
6034
6035 @table @gcctabopt
6036 @item -ffloat-store
6037 @opindex ffloat-store
6038 Do not store floating point variables in registers, and inhibit other
6039 options that might change whether a floating point value is taken from a
6040 register or memory.
6041
6042 @cindex floating point precision
6043 This option prevents undesirable excess precision on machines such as
6044 the 68000 where the floating registers (of the 68881) keep more
6045 precision than a @code{double} is supposed to have.  Similarly for the
6046 x86 architecture.  For most programs, the excess precision does only
6047 good, but a few programs rely on the precise definition of IEEE floating
6048 point.  Use @option{-ffloat-store} for such programs, after modifying
6049 them to store all pertinent intermediate computations into variables.
6050
6051 @item -ffast-math
6052 @opindex ffast-math
6053 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
6054 @option{-fno-trapping-math}, @option{-ffinite-math-only},
6055 @option{-fno-rounding-math}, @option{-fno-signaling-nans},
6056 @option{-fno-signed-zeros} and @option{fcx-limited-range}.
6057
6058 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
6059
6060 This option is not turned on by any @option{-O} option since
6061 it can result in incorrect output for programs which depend on
6062 an exact implementation of IEEE or ISO rules/specifications for
6063 math functions. It may, however, yield faster code for programs
6064 that do not require the guarantees of these specifications.
6065
6066 @item -fno-math-errno
6067 @opindex fno-math-errno
6068 Do not set ERRNO after calling math functions that are executed
6069 with a single instruction, e.g., sqrt.  A program that relies on
6070 IEEE exceptions for math error handling may want to use this flag
6071 for speed while maintaining IEEE arithmetic compatibility.
6072
6073 This option is not turned on by any @option{-O} option since
6074 it can result in incorrect output for programs which depend on
6075 an exact implementation of IEEE or ISO rules/specifications for
6076 math functions. It may, however, yield faster code for programs
6077 that do not require the guarantees of these specifications.
6078
6079 The default is @option{-fmath-errno}.
6080
6081 On Darwin systems, the math library never sets @code{errno}.  There is
6082 therefore no reason for the compiler to consider the possibility that
6083 it might, and @option{-fno-math-errno} is the default.
6084
6085 @item -funsafe-math-optimizations
6086 @opindex funsafe-math-optimizations
6087 Allow optimizations for floating-point arithmetic that (a) assume
6088 that arguments and results are valid and (b) may violate IEEE or
6089 ANSI standards.  When used at link-time, it may include libraries
6090 or startup files that change the default FPU control word or other
6091 similar optimizations.
6092
6093 This option is not turned on by any @option{-O} option since
6094 it can result in incorrect output for programs which depend on
6095 an exact implementation of IEEE or ISO rules/specifications for
6096 math functions. It may, however, yield faster code for programs
6097 that do not require the guarantees of these specifications.
6098
6099 The default is @option{-fno-unsafe-math-optimizations}.
6100
6101 @item -ffinite-math-only
6102 @opindex ffinite-math-only
6103 Allow optimizations for floating-point arithmetic that assume
6104 that arguments and results are not NaNs or +-Infs.
6105
6106 This option is not turned on by any @option{-O} option since
6107 it can result in incorrect output for programs which depend on
6108 an exact implementation of IEEE or ISO rules/specifications for
6109 math functions. It may, however, yield faster code for programs
6110 that do not require the guarantees of these specifications.
6111
6112 The default is @option{-fno-finite-math-only}.
6113
6114 @item -fno-signed-zeros
6115 @opindex fno-signed-zeros
6116 Allow optimizations for floating point arithmetic that ignore the
6117 signedness of zero.  IEEE arithmetic specifies the behavior of
6118 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
6119 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
6120 This option implies that the sign of a zero result isn't significant.
6121
6122 The default is @option{-fsigned-zeros}.
6123
6124 @item -fno-trapping-math
6125 @opindex fno-trapping-math
6126 Compile code assuming that floating-point operations cannot generate
6127 user-visible traps.  These traps include division by zero, overflow,
6128 underflow, inexact result and invalid operation.  This option implies
6129 @option{-fno-signaling-nans}.  Setting this option may allow faster
6130 code if one relies on ``non-stop'' IEEE arithmetic, for example.
6131
6132 This option should never be turned on by any @option{-O} option since
6133 it can result in incorrect output for programs which depend on
6134 an exact implementation of IEEE or ISO rules/specifications for
6135 math functions.
6136
6137 The default is @option{-ftrapping-math}.
6138
6139 @item -frounding-math
6140 @opindex frounding-math
6141 Disable transformations and optimizations that assume default floating
6142 point rounding behavior.  This is round-to-zero for all floating point
6143 to integer conversions, and round-to-nearest for all other arithmetic
6144 truncations.  This option should be specified for programs that change
6145 the FP rounding mode dynamically, or that may be executed with a
6146 non-default rounding mode.  This option disables constant folding of
6147 floating point expressions at compile-time (which may be affected by
6148 rounding mode) and arithmetic transformations that are unsafe in the
6149 presence of sign-dependent rounding modes.
6150
6151 The default is @option{-fno-rounding-math}.
6152
6153 This option is experimental and does not currently guarantee to
6154 disable all GCC optimizations that are affected by rounding mode.
6155 Future versions of GCC may provide finer control of this setting
6156 using C99's @code{FENV_ACCESS} pragma.  This command line option
6157 will be used to specify the default state for @code{FENV_ACCESS}.
6158
6159 @item -frtl-abstract-sequences
6160 @opindex frtl-abstract-sequences
6161 It is a size optimization method. This option is to find identical
6162 sequences of code, which can be turned into pseudo-procedures  and
6163 then  replace  all  occurrences with  calls to  the  newly created
6164 subroutine. It is kind of an opposite of @option{-finline-functions}.
6165 This optimization runs at RTL level.
6166
6167 @item -fsignaling-nans
6168 @opindex fsignaling-nans
6169 Compile code assuming that IEEE signaling NaNs may generate user-visible
6170 traps during floating-point operations.  Setting this option disables
6171 optimizations that may change the number of exceptions visible with
6172 signaling NaNs.  This option implies @option{-ftrapping-math}.
6173
6174 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6175 be defined.
6176
6177 The default is @option{-fno-signaling-nans}.
6178
6179 This option is experimental and does not currently guarantee to
6180 disable all GCC optimizations that affect signaling NaN behavior.
6181
6182 @item -fsingle-precision-constant
6183 @opindex fsingle-precision-constant
6184 Treat floating point constant as single precision constant instead of
6185 implicitly converting it to double precision constant.
6186
6187 @item -fcx-limited-range
6188 @itemx -fno-cx-limited-range
6189 @opindex fcx-limited-range
6190 @opindex fno-cx-limited-range
6191 When enabled, this option states that a range reduction step is not
6192 needed when performing complex division.  The default is
6193 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
6194
6195 This option controls the default setting of the ISO C99
6196 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6197 all languages.
6198
6199 @end table
6200
6201 The following options control optimizations that may improve
6202 performance, but are not enabled by any @option{-O} options.  This
6203 section includes experimental options that may produce broken code.
6204
6205 @table @gcctabopt
6206 @item -fbranch-probabilities
6207 @opindex fbranch-probabilities
6208 After running a program compiled with @option{-fprofile-arcs}
6209 (@pxref{Debugging Options,, Options for Debugging Your Program or
6210 @command{gcc}}), you can compile it a second time using
6211 @option{-fbranch-probabilities}, to improve optimizations based on
6212 the number of times each branch was taken.  When the program
6213 compiled with @option{-fprofile-arcs} exits it saves arc execution
6214 counts to a file called @file{@var{sourcename}.gcda} for each source
6215 file.  The information in this data file is very dependent on the
6216 structure of the generated code, so you must use the same source code
6217 and the same optimization options for both compilations.
6218
6219 With @option{-fbranch-probabilities}, GCC puts a
6220 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6221 These can be used to improve optimization.  Currently, they are only
6222 used in one place: in @file{reorg.c}, instead of guessing which path a
6223 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6224 exactly determine which path is taken more often.
6225
6226 @item -fprofile-values
6227 @opindex fprofile-values
6228 If combined with @option{-fprofile-arcs}, it adds code so that some
6229 data about values of expressions in the program is gathered.
6230
6231 With @option{-fbranch-probabilities}, it reads back the data gathered
6232 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6233 notes to instructions for their later usage in optimizations.
6234
6235 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6236
6237 @item -fvpt
6238 @opindex fvpt
6239 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6240 a code to gather information about values of expressions.
6241
6242 With @option{-fbranch-probabilities}, it reads back the data gathered
6243 and actually performs the optimizations based on them.
6244 Currently the optimizations include specialization of division operation
6245 using the knowledge about the value of the denominator.
6246
6247 @item -frename-registers
6248 @opindex frename-registers
6249 Attempt to avoid false dependencies in scheduled code by making use
6250 of registers left over after register allocation.  This optimization
6251 will most benefit processors with lots of registers.  Depending on the
6252 debug information format adopted by the target, however, it can
6253 make debugging impossible, since variables will no longer stay in
6254 a ``home register''.
6255
6256 Enabled by default with @option{-funroll-loops}.
6257
6258 @item -ftracer
6259 @opindex ftracer
6260 Perform tail duplication to enlarge superblock size.  This transformation
6261 simplifies the control flow of the function allowing other optimizations to do
6262 better job.
6263
6264 Enabled with @option{-fprofile-use}.
6265
6266 @item -funroll-loops
6267 @opindex funroll-loops
6268 Unroll loops whose number of iterations can be determined at compile time or
6269 upon entry to the loop.  @option{-funroll-loops} implies
6270 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6271 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6272 small constant number of iterations).  This option makes code larger, and may
6273 or may not make it run faster.
6274
6275 Enabled with @option{-fprofile-use}.
6276
6277 @item -funroll-all-loops
6278 @opindex funroll-all-loops
6279 Unroll all loops, even if their number of iterations is uncertain when
6280 the loop is entered.  This usually makes programs run more slowly.
6281 @option{-funroll-all-loops} implies the same options as
6282 @option{-funroll-loops}.
6283
6284 @item -fpeel-loops
6285 @opindex fpeel-loops
6286 Peels the loops for that there is enough information that they do not
6287 roll much (from profile feedback).  It also turns on complete loop peeling
6288 (i.e.@: complete removal of loops with small constant number of iterations).
6289
6290 Enabled with @option{-fprofile-use}.
6291
6292 @item -fmove-loop-invariants
6293 @opindex fmove-loop-invariants
6294 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6295 at level @option{-O1}
6296
6297 @item -funswitch-loops
6298 @opindex funswitch-loops
6299 Move branches with loop invariant conditions out of the loop, with duplicates
6300 of the loop on both branches (modified according to result of the condition).
6301
6302 @item -ffunction-sections
6303 @itemx -fdata-sections
6304 @opindex ffunction-sections
6305 @opindex fdata-sections
6306 Place each function or data item into its own section in the output
6307 file if the target supports arbitrary sections.  The name of the
6308 function or the name of the data item determines the section's name
6309 in the output file.
6310
6311 Use these options on systems where the linker can perform optimizations
6312 to improve locality of reference in the instruction space.  Most systems
6313 using the ELF object format and SPARC processors running Solaris 2 have
6314 linkers with such optimizations.  AIX may have these optimizations in
6315 the future.
6316
6317 Only use these options when there are significant benefits from doing
6318 so.  When you specify these options, the assembler and linker will
6319 create larger object and executable files and will also be slower.
6320 You will not be able to use @code{gprof} on all systems if you
6321 specify this option and you may have problems with debugging if
6322 you specify both this option and @option{-g}.
6323
6324 @item -fbranch-target-load-optimize
6325 @opindex fbranch-target-load-optimize
6326 Perform branch target register load optimization before prologue / epilogue
6327 threading.
6328 The use of target registers can typically be exposed only during reload,
6329 thus hoisting loads out of loops and doing inter-block scheduling needs
6330 a separate optimization pass.
6331
6332 @item -fbranch-target-load-optimize2
6333 @opindex fbranch-target-load-optimize2
6334 Perform branch target register load optimization after prologue / epilogue
6335 threading.
6336
6337 @item -fbtr-bb-exclusive
6338 @opindex fbtr-bb-exclusive
6339 When performing branch target register load optimization, don't reuse
6340 branch target registers in within any basic block.
6341
6342 @item -fstack-protector
6343 Emit extra code to check for buffer overflows, such as stack smashing
6344 attacks.  This is done by adding a guard variable to functions with
6345 vulnerable objects.  This includes functions that call alloca, and
6346 functions with buffers larger than 8 bytes.  The guards are initialized
6347 when a function is entered and then checked when the function exits.
6348 If a guard check fails, an error message is printed and the program exits.
6349
6350 @item -fstack-protector-all
6351 Like @option{-fstack-protector} except that all functions are protected.
6352
6353 @item -fsection-anchors
6354 @opindex fsection-anchors
6355 Try to reduce the number of symbolic address calculations by using
6356 shared ``anchor'' symbols to address nearby objects.  This transformation
6357 can help to reduce the number of GOT entries and GOT accesses on some
6358 targets.
6359
6360 For example, the implementation of the following function @code{foo}:
6361
6362 @smallexample
6363 static int a, b, c;
6364 int foo (void) @{ return a + b + c; @}
6365 @end smallexample
6366
6367 would usually calculate the addresses of all three variables, but if you
6368 compile it with @option{-fsection-anchors}, it will access the variables
6369 from a common anchor point instead.  The effect is similar to the
6370 following pseudocode (which isn't valid C):
6371
6372 @smallexample
6373 int foo (void)
6374 @{
6375   register int *xr = &x;
6376   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6377 @}
6378 @end smallexample
6379
6380 Not all targets support this option.
6381
6382 @item --param @var{name}=@var{value}
6383 @opindex param
6384 In some places, GCC uses various constants to control the amount of
6385 optimization that is done.  For example, GCC will not inline functions
6386 that contain more that a certain number of instructions.  You can
6387 control some of these constants on the command-line using the
6388 @option{--param} option.
6389
6390 The names of specific parameters, and the meaning of the values, are
6391 tied to the internals of the compiler, and are subject to change
6392 without notice in future releases.
6393
6394 In each case, the @var{value} is an integer.  The allowable choices for
6395 @var{name} are given in the following table:
6396
6397 @table @gcctabopt
6398 @item salias-max-implicit-fields
6399 The maximum number of fields in a variable without direct
6400 structure accesses for which structure aliasing will consider trying
6401 to track each field.  The default is 5
6402
6403 @item salias-max-array-elements
6404 The maximum number of elements an array can have and its elements
6405 still be tracked individually by structure aliasing. The default is 4
6406
6407 @item sra-max-structure-size
6408 The maximum structure size, in bytes, at which the scalar replacement
6409 of aggregates (SRA) optimization will perform block copies.  The
6410 default value, 0, implies that GCC will select the most appropriate
6411 size itself.
6412
6413 @item sra-field-structure-ratio
6414 The threshold ratio (as a percentage) between instantiated fields and
6415 the complete structure size.  We say that if the ratio of the number
6416 of bytes in instantiated fields to the number of bytes in the complete
6417 structure exceeds this parameter, then block copies are not used.  The
6418 default is 75.
6419
6420 @item max-crossjump-edges
6421 The maximum number of incoming edges to consider for crossjumping.
6422 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6423 the number of edges incoming to each block.  Increasing values mean
6424 more aggressive optimization, making the compile time increase with
6425 probably small improvement in executable size.
6426
6427 @item min-crossjump-insns
6428 The minimum number of instructions which must be matched at the end
6429 of two blocks before crossjumping will be performed on them.  This
6430 value is ignored in the case where all instructions in the block being
6431 crossjumped from are matched.  The default value is 5.
6432
6433 @item max-grow-copy-bb-insns
6434 The maximum code size expansion factor when copying basic blocks
6435 instead of jumping.  The expansion is relative to a jump instruction.
6436 The default value is 8.
6437
6438 @item max-goto-duplication-insns
6439 The maximum number of instructions to duplicate to a block that jumps
6440 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6441 passes, GCC factors computed gotos early in the compilation process,
6442 and unfactors them as late as possible.  Only computed jumps at the
6443 end of a basic blocks with no more than max-goto-duplication-insns are
6444 unfactored.  The default value is 8.
6445
6446 @item max-delay-slot-insn-search
6447 The maximum number of instructions to consider when looking for an
6448 instruction to fill a delay slot.  If more than this arbitrary number of
6449 instructions is searched, the time savings from filling the delay slot
6450 will be minimal so stop searching.  Increasing values mean more
6451 aggressive optimization, making the compile time increase with probably
6452 small improvement in executable run time.
6453
6454 @item max-delay-slot-live-search
6455 When trying to fill delay slots, the maximum number of instructions to
6456 consider when searching for a block with valid live register
6457 information.  Increasing this arbitrarily chosen value means more
6458 aggressive optimization, increasing the compile time.  This parameter
6459 should be removed when the delay slot code is rewritten to maintain the
6460 control-flow graph.
6461
6462 @item max-gcse-memory
6463 The approximate maximum amount of memory that will be allocated in
6464 order to perform the global common subexpression elimination
6465 optimization.  If more memory than specified is required, the
6466 optimization will not be done.
6467
6468 @item max-gcse-passes
6469 The maximum number of passes of GCSE to run.  The default is 1.
6470
6471 @item max-pending-list-length
6472 The maximum number of pending dependencies scheduling will allow
6473 before flushing the current state and starting over.  Large functions
6474 with few branches or calls can create excessively large lists which
6475 needlessly consume memory and resources.
6476
6477 @item max-inline-insns-single
6478 Several parameters control the tree inliner used in gcc.
6479 This number sets the maximum number of instructions (counted in GCC's
6480 internal representation) in a single function that the tree inliner
6481 will consider for inlining.  This only affects functions declared
6482 inline and methods implemented in a class declaration (C++).
6483 The default value is 450.
6484
6485 @item max-inline-insns-auto
6486 When you use @option{-finline-functions} (included in @option{-O3}),
6487 a lot of functions that would otherwise not be considered for inlining
6488 by the compiler will be investigated.  To those functions, a different
6489 (more restrictive) limit compared to functions declared inline can
6490 be applied.
6491 The default value is 90.
6492
6493 @item large-function-insns
6494 The limit specifying really large functions.  For functions larger than this
6495 limit after inlining inlining is constrained by
6496 @option{--param large-function-growth}.  This parameter is useful primarily
6497 to avoid extreme compilation time caused by non-linear algorithms used by the
6498 backend.
6499 This parameter is ignored when @option{-funit-at-a-time} is not used.
6500 The default value is 2700.
6501
6502 @item large-function-growth
6503 Specifies maximal growth of large function caused by inlining in percents.
6504 This parameter is ignored when @option{-funit-at-a-time} is not used.
6505 The default value is 100 which limits large function growth to 2.0 times
6506 the original size.
6507
6508 @item large-unit-insns
6509 The limit specifying large translation unit.  Growth caused by inlining of
6510 units larger than this limit is limited by @option{--param inline-unit-growth}.
6511 For small units this might be too tight (consider unit consisting of function A
6512 that is inline and B that just calls A three time.  If B is small relative to
6513 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6514 large units consisting of small inlininable functions however the overall unit
6515 growth limit is needed to avoid exponential explosion of code size.  Thus for
6516 smaller units, the size is increased to @option{--param large-unit-insns}
6517 before applying @option{--param inline-unit-growth}.  The default is 10000
6518
6519 @item inline-unit-growth
6520 Specifies maximal overall growth of the compilation unit caused by inlining.
6521 This parameter is ignored when @option{-funit-at-a-time} is not used.
6522 The default value is 30 which limits unit growth to 1.3 times the original
6523 size.
6524
6525 @item large-stack-frame
6526 The limit specifying large stack frames.  While inlining the algorithm is trying
6527 to not grow past this limit too much.  Default value is 256 bytes.
6528
6529 @item large-stack-frame-growth
6530 Specifies maximal growth of large stack frames caused by inlining in percents.
6531 The default value is 1000 which limits large stack frame growth to 11 times
6532 the original size.
6533
6534 @item max-inline-insns-recursive
6535 @itemx max-inline-insns-recursive-auto
6536 Specifies maximum number of instructions out-of-line copy of self recursive inline
6537 function can grow into by performing recursive inlining.
6538
6539 For functions declared inline @option{--param max-inline-insns-recursive} is
6540 taken into account.  For function not declared inline, recursive inlining
6541 happens only when @option{-finline-functions} (included in @option{-O3}) is
6542 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6543 default value is 450.
6544
6545 @item max-inline-recursive-depth
6546 @itemx max-inline-recursive-depth-auto
6547 Specifies maximum recursion depth used by the recursive inlining.
6548
6549 For functions declared inline @option{--param max-inline-recursive-depth} is
6550 taken into account.  For function not declared inline, recursive inlining
6551 happens only when @option{-finline-functions} (included in @option{-O3}) is
6552 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6553 default value is 450.
6554
6555 @item min-inline-recursive-probability
6556 Recursive inlining is profitable only for function having deep recursion
6557 in average and can hurt for function having little recursion depth by
6558 increasing the prologue size or complexity of function body to other
6559 optimizers.
6560
6561 When profile feedback is available (see @option{-fprofile-generate}) the actual
6562 recursion depth can be guessed from probability that function will recurse via
6563 given call expression.  This parameter limits inlining only to call expression
6564 whose probability exceeds given threshold (in percents).  The default value is
6565 10.
6566
6567 @item inline-call-cost
6568 Specify cost of call instruction relative to simple arithmetics operations
6569 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6570 functions and at the same time increases size of leaf function that is believed to
6571 reduce function size by being inlined.  In effect it increases amount of
6572 inlining for code having large abstraction penalty (many functions that just
6573 pass the arguments to other functions) and decrease inlining for code with low
6574 abstraction penalty.  The default value is 16.
6575
6576 @item min-vect-loop-bound
6577 The minimum number of iterations under which a loop will not get vectorized
6578 when @option{-ftree-vectorize} is used.  The number of iterations after
6579 vectorization needs to be greater than the value specified by this option
6580 to allow vectorization.  The default value is 0.
6581
6582 @item max-unrolled-insns
6583 The maximum number of instructions that a loop should have if that loop
6584 is unrolled, and if the loop is unrolled, it determines how many times
6585 the loop code is unrolled.
6586
6587 @item max-average-unrolled-insns
6588 The maximum number of instructions biased by probabilities of their execution
6589 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6590 it determines how many times the loop code is unrolled.
6591
6592 @item max-unroll-times
6593 The maximum number of unrollings of a single loop.
6594
6595 @item max-peeled-insns
6596 The maximum number of instructions that a loop should have if that loop
6597 is peeled, and if the loop is peeled, it determines how many times
6598 the loop code is peeled.
6599
6600 @item max-peel-times
6601 The maximum number of peelings of a single loop.
6602
6603 @item max-completely-peeled-insns
6604 The maximum number of insns of a completely peeled loop.
6605
6606 @item max-completely-peel-times
6607 The maximum number of iterations of a loop to be suitable for complete peeling.
6608
6609 @item max-unswitch-insns
6610 The maximum number of insns of an unswitched loop.
6611
6612 @item max-unswitch-level
6613 The maximum number of branches unswitched in a single loop.
6614
6615 @item lim-expensive
6616 The minimum cost of an expensive expression in the loop invariant motion.
6617
6618 @item iv-consider-all-candidates-bound
6619 Bound on number of candidates for induction variables below that
6620 all candidates are considered for each use in induction variable
6621 optimizations.  Only the most relevant candidates are considered
6622 if there are more candidates, to avoid quadratic time complexity.
6623
6624 @item iv-max-considered-uses
6625 The induction variable optimizations give up on loops that contain more
6626 induction variable uses.
6627
6628 @item iv-always-prune-cand-set-bound
6629 If number of candidates in the set is smaller than this value,
6630 we always try to remove unnecessary ivs from the set during its
6631 optimization when a new iv is added to the set.
6632
6633 @item scev-max-expr-size
6634 Bound on size of expressions used in the scalar evolutions analyzer.
6635 Large expressions slow the analyzer.
6636
6637 @item omega-max-vars
6638 The maximum number of variables in an Omega constraint system.
6639 The default value is 128.
6640
6641 @item omega-max-geqs
6642 The maximum number of inequalities in an Omega constraint system.
6643 The default value is 256.
6644
6645 @item omega-max-eqs
6646 The maximum number of equalities in an Omega constraint system.
6647 The default value is 128.
6648
6649 @item omega-max-wild-cards
6650 The maximum number of wildcard variables that the Omega solver will
6651 be able to insert.  The default value is 18.
6652
6653 @item omega-hash-table-size
6654 The size of the hash table in the Omega solver.  The default value is
6655 550.
6656
6657 @item omega-max-keys
6658 The maximal number of keys used by the Omega solver.  The default
6659 value is 500.
6660
6661 @item omega-eliminate-redundant-constraints
6662 When set to 1, use expensive methods to eliminate all redundant
6663 constraints.  The default value is 0.
6664
6665 @item vect-max-version-checks
6666 The maximum number of runtime checks that can be performed when doing
6667 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6668 for more information.
6669
6670 @item max-iterations-to-track
6671
6672 The maximum number of iterations of a loop the brute force algorithm
6673 for analysis of # of iterations of the loop tries to evaluate.
6674
6675 @item hot-bb-count-fraction
6676 Select fraction of the maximal count of repetitions of basic block in program
6677 given basic block needs to have to be considered hot.
6678
6679 @item hot-bb-frequency-fraction
6680 Select fraction of the maximal frequency of executions of basic block in
6681 function given basic block needs to have to be considered hot
6682
6683 @item max-predicted-iterations
6684 The maximum number of loop iterations we predict statically.  This is useful
6685 in cases where function contain single loop with known bound and other loop
6686 with unknown.  We predict the known number of iterations correctly, while
6687 the unknown number of iterations average to roughly 10.  This means that the
6688 loop without bounds would appear artificially cold relative to the other one.
6689
6690 @item tracer-dynamic-coverage
6691 @itemx tracer-dynamic-coverage-feedback
6692
6693 This value is used to limit superblock formation once the given percentage of
6694 executed instructions is covered.  This limits unnecessary code size
6695 expansion.
6696
6697 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6698 feedback is available.  The real profiles (as opposed to statically estimated
6699 ones) are much less balanced allowing the threshold to be larger value.
6700
6701 @item tracer-max-code-growth
6702 Stop tail duplication once code growth has reached given percentage.  This is
6703 rather hokey argument, as most of the duplicates will be eliminated later in
6704 cross jumping, so it may be set to much higher values than is the desired code
6705 growth.
6706
6707 @item tracer-min-branch-ratio
6708
6709 Stop reverse growth when the reverse probability of best edge is less than this
6710 threshold (in percent).
6711
6712 @item tracer-min-branch-ratio
6713 @itemx tracer-min-branch-ratio-feedback
6714
6715 Stop forward growth if the best edge do have probability lower than this
6716 threshold.
6717
6718 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6719 compilation for profile feedback and one for compilation without.  The value
6720 for compilation with profile feedback needs to be more conservative (higher) in
6721 order to make tracer effective.
6722
6723 @item max-cse-path-length
6724
6725 Maximum number of basic blocks on path that cse considers.  The default is 10.
6726
6727 @item max-cse-insns
6728 The maximum instructions CSE process before flushing. The default is 1000.
6729
6730 @item max-aliased-vops
6731
6732 Maximum number of virtual operands per function allowed to represent
6733 aliases before triggering the alias partitioning heuristic.  Alias
6734 partitioning reduces compile times and memory consumption needed for
6735 aliasing at the expense of precision loss in alias information.  The
6736 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
6737 for -O3.
6738
6739 Notice that if a function contains more memory statements than the
6740 value of this parameter, it is not really possible to achieve this
6741 reduction.  In this case, the compiler will use the number of memory
6742 statements as the value for @option{max-aliased-vops}.
6743
6744 @item avg-aliased-vops
6745
6746 Average number of virtual operands per statement allowed to represent
6747 aliases before triggering the alias partitioning heuristic.  This
6748 works in conjunction with @option{max-aliased-vops}.  If a function
6749 contains more than @option{max-aliased-vops} virtual operators, then
6750 memory symbols will be grouped into memory partitions until either the
6751 total number of virtual operators is below @option{max-aliased-vops}
6752 or the average number of virtual operators per memory statement is
6753 below @option{avg-aliased-vops}.  The default value for this parameter
6754 is 1 for -O1 and -O2, and 3 for -O3.
6755
6756 @item ggc-min-expand
6757
6758 GCC uses a garbage collector to manage its own memory allocation.  This
6759 parameter specifies the minimum percentage by which the garbage
6760 collector's heap should be allowed to expand between collections.
6761 Tuning this may improve compilation speed; it has no effect on code
6762 generation.
6763
6764 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6765 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6766 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6767 GCC is not able to calculate RAM on a particular platform, the lower
6768 bound of 30% is used.  Setting this parameter and
6769 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6770 every opportunity.  This is extremely slow, but can be useful for
6771 debugging.
6772
6773 @item ggc-min-heapsize
6774
6775 Minimum size of the garbage collector's heap before it begins bothering
6776 to collect garbage.  The first collection occurs after the heap expands
6777 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6778 tuning this may improve compilation speed, and has no effect on code
6779 generation.
6780
6781 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6782 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6783 with a lower bound of 4096 (four megabytes) and an upper bound of
6784 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6785 particular platform, the lower bound is used.  Setting this parameter
6786 very large effectively disables garbage collection.  Setting this
6787 parameter and @option{ggc-min-expand} to zero causes a full collection
6788 to occur at every opportunity.
6789
6790 @item max-reload-search-insns
6791 The maximum number of instruction reload should look backward for equivalent
6792 register.  Increasing values mean more aggressive optimization, making the
6793 compile time increase with probably slightly better performance.  The default
6794 value is 100.
6795
6796 @item max-cselib-memory-locations
6797 The maximum number of memory locations cselib should take into account.
6798 Increasing values mean more aggressive optimization, making the compile time
6799 increase with probably slightly better performance.  The default value is 500.
6800
6801 @item max-flow-memory-locations
6802 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6803 The default value is 100.
6804
6805 @item reorder-blocks-duplicate
6806 @itemx reorder-blocks-duplicate-feedback
6807
6808 Used by basic block reordering pass to decide whether to use unconditional
6809 branch or duplicate the code on its destination.  Code is duplicated when its
6810 estimated size is smaller than this value multiplied by the estimated size of
6811 unconditional jump in the hot spots of the program.
6812
6813 The @option{reorder-block-duplicate-feedback} is used only when profile
6814 feedback is available and may be set to higher values than
6815 @option{reorder-block-duplicate} since information about the hot spots is more
6816 accurate.
6817
6818 @item max-sched-ready-insns
6819 The maximum number of instructions ready to be issued the scheduler should
6820 consider at any given time during the first scheduling pass.  Increasing
6821 values mean more thorough searches, making the compilation time increase
6822 with probably little benefit.  The default value is 100.
6823
6824 @item max-sched-region-blocks
6825 The maximum number of blocks in a region to be considered for
6826 interblock scheduling.  The default value is 10.
6827
6828 @item max-sched-region-insns
6829 The maximum number of insns in a region to be considered for
6830 interblock scheduling.  The default value is 100.
6831
6832 @item min-spec-prob
6833 The minimum probability (in percents) of reaching a source block
6834 for interblock speculative scheduling.  The default value is 40.
6835
6836 @item max-sched-extend-regions-iters
6837 The maximum number of iterations through CFG to extend regions.
6838 0 - disable region extension,
6839 N - do at most N iterations.
6840 The default value is 0.
6841
6842 @item max-sched-insn-conflict-delay
6843 The maximum conflict delay for an insn to be considered for speculative motion.
6844 The default value is 3.
6845
6846 @item sched-spec-prob-cutoff
6847 The minimal probability of speculation success (in percents), so that
6848 speculative insn will be scheduled.
6849 The default value is 40.
6850
6851 @item max-last-value-rtl
6852
6853 The maximum size measured as number of RTLs that can be recorded in an expression
6854 in combiner for a pseudo register as last known value of that register.  The default
6855 is 10000.
6856
6857 @item integer-share-limit
6858 Small integer constants can use a shared data structure, reducing the
6859 compiler's memory usage and increasing its speed.  This sets the maximum
6860 value of a shared integer constant's.  The default value is 256.
6861
6862 @item min-virtual-mappings
6863 Specifies the minimum number of virtual mappings in the incremental
6864 SSA updater that should be registered to trigger the virtual mappings
6865 heuristic defined by virtual-mappings-ratio.  The default value is
6866 100.
6867
6868 @item virtual-mappings-ratio
6869 If the number of virtual mappings is virtual-mappings-ratio bigger
6870 than the number of virtual symbols to be updated, then the incremental
6871 SSA updater switches to a full update for those symbols.  The default
6872 ratio is 3.
6873
6874 @item ssp-buffer-size
6875 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6876 protection when @option{-fstack-protection} is used.
6877
6878 @item max-jump-thread-duplication-stmts
6879 Maximum number of statements allowed in a block that needs to be
6880 duplicated when threading jumps.
6881
6882 @item max-fields-for-field-sensitive
6883 Maximum number of fields in a structure we will treat in
6884 a field sensitive manner during pointer analysis.
6885
6886 @item prefetch-latency
6887 Estimate on average number of instructions that are executed before
6888 prefetch finishes.  The distance we prefetch ahead is proportional
6889 to this constant.  Increasing this number may also lead to less
6890 streams being prefetched (see @option{simultaneous-prefetches}).
6891
6892 @item simultaneous-prefetches
6893 Maximum number of prefetches that can run at the same time.
6894
6895 @item l1-cache-line-size
6896 The size of cache line in L1 cache, in bytes.
6897
6898 @item l1-cache-size
6899 The number of cache lines in L1 cache.
6900
6901 @item verify-canonical-types
6902 Whether the compiler should verify the ``canonical'' types used for
6903 type equality comparisons within the C++ and Objective-C++ front
6904 ends. Set to 1 (the default when GCC is configured with
6905 --enable-checking) to enable verification, 0 to disable verification
6906 (the default when GCC is configured with --disable-checking).
6907
6908 @end table
6909 @end table
6910
6911 @node Preprocessor Options
6912 @section Options Controlling the Preprocessor
6913 @cindex preprocessor options
6914 @cindex options, preprocessor
6915
6916 These options control the C preprocessor, which is run on each C source
6917 file before actual compilation.
6918
6919 If you use the @option{-E} option, nothing is done except preprocessing.
6920 Some of these options make sense only together with @option{-E} because
6921 they cause the preprocessor output to be unsuitable for actual
6922 compilation.
6923
6924 @table @gcctabopt
6925 @opindex Wp
6926 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6927 and pass @var{option} directly through to the preprocessor.  If
6928 @var{option} contains commas, it is split into multiple options at the
6929 commas.  However, many options are modified, translated or interpreted
6930 by the compiler driver before being passed to the preprocessor, and
6931 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6932 interface is undocumented and subject to change, so whenever possible
6933 you should avoid using @option{-Wp} and let the driver handle the
6934 options instead.
6935
6936 @item -Xpreprocessor @var{option}
6937 @opindex preprocessor
6938 Pass @var{option} as an option to the preprocessor.  You can use this to
6939 supply system-specific preprocessor options which GCC does not know how to
6940 recognize.
6941
6942 If you want to pass an option that takes an argument, you must use
6943 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6944 @end table
6945
6946 @include cppopts.texi
6947
6948 @node Assembler Options
6949 @section Passing Options to the Assembler
6950
6951 @c prevent bad page break with this line
6952 You can pass options to the assembler.
6953
6954 @table @gcctabopt
6955 @item -Wa,@var{option}
6956 @opindex Wa
6957 Pass @var{option} as an option to the assembler.  If @var{option}
6958 contains commas, it is split into multiple options at the commas.
6959
6960 @item -Xassembler @var{option}
6961 @opindex Xassembler
6962 Pass @var{option} as an option to the assembler.  You can use this to
6963 supply system-specific assembler options which GCC does not know how to
6964 recognize.
6965
6966 If you want to pass an option that takes an argument, you must use
6967 @option{-Xassembler} twice, once for the option and once for the argument.
6968
6969 @end table
6970
6971 @node Link Options
6972 @section Options for Linking
6973 @cindex link options
6974 @cindex options, linking
6975
6976 These options come into play when the compiler links object files into
6977 an executable output file.  They are meaningless if the compiler is
6978 not doing a link step.
6979
6980 @table @gcctabopt
6981 @cindex file names
6982 @item @var{object-file-name}
6983 A file name that does not end in a special recognized suffix is
6984 considered to name an object file or library.  (Object files are
6985 distinguished from libraries by the linker according to the file
6986 contents.)  If linking is done, these object files are used as input
6987 to the linker.
6988
6989 @item -c
6990 @itemx -S
6991 @itemx -E
6992 @opindex c
6993 @opindex S
6994 @opindex E
6995 If any of these options is used, then the linker is not run, and
6996 object file names should not be used as arguments.  @xref{Overall
6997 Options}.
6998
6999 @cindex Libraries
7000 @item -l@var{library}
7001 @itemx -l @var{library}
7002 @opindex l
7003 Search the library named @var{library} when linking.  (The second
7004 alternative with the library as a separate argument is only for
7005 POSIX compliance and is not recommended.)
7006
7007 It makes a difference where in the command you write this option; the
7008 linker searches and processes libraries and object files in the order they
7009 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
7010 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
7011 to functions in @samp{z}, those functions may not be loaded.
7012
7013 The linker searches a standard list of directories for the library,
7014 which is actually a file named @file{lib@var{library}.a}.  The linker
7015 then uses this file as if it had been specified precisely by name.
7016
7017 The directories searched include several standard system directories
7018 plus any that you specify with @option{-L}.
7019
7020 Normally the files found this way are library files---archive files
7021 whose members are object files.  The linker handles an archive file by
7022 scanning through it for members which define symbols that have so far
7023 been referenced but not defined.  But if the file that is found is an
7024 ordinary object file, it is linked in the usual fashion.  The only
7025 difference between using an @option{-l} option and specifying a file name
7026 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
7027 and searches several directories.
7028
7029 @item -lobjc
7030 @opindex lobjc
7031 You need this special case of the @option{-l} option in order to
7032 link an Objective-C or Objective-C++ program.
7033
7034 @item -nostartfiles
7035 @opindex nostartfiles
7036 Do not use the standard system startup files when linking.
7037 The standard system libraries are used normally, unless @option{-nostdlib}
7038 or @option{-nodefaultlibs} is used.
7039
7040 @item -nodefaultlibs
7041 @opindex nodefaultlibs
7042 Do not use the standard system libraries when linking.
7043 Only the libraries you specify will be passed to the linker.
7044 The standard startup files are used normally, unless @option{-nostartfiles}
7045 is used.  The compiler may generate calls to @code{memcmp},
7046 @code{memset}, @code{memcpy} and @code{memmove}.
7047 These entries are usually resolved by entries in
7048 libc.  These entry points should be supplied through some other
7049 mechanism when this option is specified.
7050
7051 @item -nostdlib
7052 @opindex nostdlib
7053 Do not use the standard system startup files or libraries when linking.
7054 No startup files and only the libraries you specify will be passed to
7055 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
7056 @code{memcpy} and @code{memmove}.
7057 These entries are usually resolved by entries in
7058 libc.  These entry points should be supplied through some other
7059 mechanism when this option is specified.
7060
7061 @cindex @option{-lgcc}, use with @option{-nostdlib}
7062 @cindex @option{-nostdlib} and unresolved references
7063 @cindex unresolved references and @option{-nostdlib}
7064 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
7065 @cindex @option{-nodefaultlibs} and unresolved references
7066 @cindex unresolved references and @option{-nodefaultlibs}
7067 One of the standard libraries bypassed by @option{-nostdlib} and
7068 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
7069 that GCC uses to overcome shortcomings of particular machines, or special
7070 needs for some languages.
7071 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
7072 Collection (GCC) Internals},
7073 for more discussion of @file{libgcc.a}.)
7074 In most cases, you need @file{libgcc.a} even when you want to avoid
7075 other standard libraries.  In other words, when you specify @option{-nostdlib}
7076 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
7077 This ensures that you have no unresolved references to internal GCC
7078 library subroutines.  (For example, @samp{__main}, used to ensure C++
7079 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
7080 GNU Compiler Collection (GCC) Internals}.)
7081
7082 @item -pie
7083 @opindex pie
7084 Produce a position independent executable on targets which support it.
7085 For predictable results, you must also specify the same set of options
7086 that were used to generate code (@option{-fpie}, @option{-fPIE},
7087 or model suboptions) when you specify this option.
7088
7089 @item -rdynamic
7090 @opindex rdynamic
7091 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
7092 that support it. This instructs the linker to add all symbols, not
7093 only used ones, to the dynamic symbol table. This option is needed
7094 for some uses of @code{dlopen} or to allow obtaining backtraces
7095 from within a program.
7096
7097 @item -s
7098 @opindex s
7099 Remove all symbol table and relocation information from the executable.
7100
7101 @item -static
7102 @opindex static
7103 On systems that support dynamic linking, this prevents linking with the shared
7104 libraries.  On other systems, this option has no effect.
7105
7106 @item -shared
7107 @opindex shared
7108 Produce a shared object which can then be linked with other objects to
7109 form an executable.  Not all systems support this option.  For predictable
7110 results, you must also specify the same set of options that were used to
7111 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
7112 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
7113 needs to build supplementary stub code for constructors to work.  On
7114 multi-libbed systems, @samp{gcc -shared} must select the correct support
7115 libraries to link against.  Failing to supply the correct flags may lead
7116 to subtle defects.  Supplying them in cases where they are not necessary
7117 is innocuous.}
7118
7119 @item -shared-libgcc
7120 @itemx -static-libgcc
7121 @opindex shared-libgcc
7122 @opindex static-libgcc
7123 On systems that provide @file{libgcc} as a shared library, these options
7124 force the use of either the shared or static version respectively.
7125 If no shared version of @file{libgcc} was built when the compiler was
7126 configured, these options have no effect.
7127
7128 There are several situations in which an application should use the
7129 shared @file{libgcc} instead of the static version.  The most common
7130 of these is when the application wishes to throw and catch exceptions
7131 across different shared libraries.  In that case, each of the libraries
7132 as well as the application itself should use the shared @file{libgcc}.
7133
7134 Therefore, the G++ and GCJ drivers automatically add
7135 @option{-shared-libgcc} whenever you build a shared library or a main
7136 executable, because C++ and Java programs typically use exceptions, so
7137 this is the right thing to do.
7138
7139 If, instead, you use the GCC driver to create shared libraries, you may
7140 find that they will not always be linked with the shared @file{libgcc}.
7141 If GCC finds, at its configuration time, that you have a non-GNU linker
7142 or a GNU linker that does not support option @option{--eh-frame-hdr},
7143 it will link the shared version of @file{libgcc} into shared libraries
7144 by default.  Otherwise, it will take advantage of the linker and optimize
7145 away the linking with the shared version of @file{libgcc}, linking with
7146 the static version of libgcc by default.  This allows exceptions to
7147 propagate through such shared libraries, without incurring relocation
7148 costs at library load time.
7149
7150 However, if a library or main executable is supposed to throw or catch
7151 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7152 for the languages used in the program, or using the option
7153 @option{-shared-libgcc}, such that it is linked with the shared
7154 @file{libgcc}.
7155
7156 @item -symbolic
7157 @opindex symbolic
7158 Bind references to global symbols when building a shared object.  Warn
7159 about any unresolved references (unless overridden by the link editor
7160 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7161 this option.
7162
7163 @item -Xlinker @var{option}
7164 @opindex Xlinker
7165 Pass @var{option} as an option to the linker.  You can use this to
7166 supply system-specific linker options which GCC does not know how to
7167 recognize.
7168
7169 If you want to pass an option that takes an argument, you must use
7170 @option{-Xlinker} twice, once for the option and once for the argument.
7171 For example, to pass @option{-assert definitions}, you must write
7172 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7173 @option{-Xlinker "-assert definitions"}, because this passes the entire
7174 string as a single argument, which is not what the linker expects.
7175
7176 @item -Wl,@var{option}
7177 @opindex Wl
7178 Pass @var{option} as an option to the linker.  If @var{option} contains
7179 commas, it is split into multiple options at the commas.
7180
7181 @item -u @var{symbol}
7182 @opindex u
7183 Pretend the symbol @var{symbol} is undefined, to force linking of
7184 library modules to define it.  You can use @option{-u} multiple times with
7185 different symbols to force loading of additional library modules.
7186 @end table
7187
7188 @node Directory Options
7189 @section Options for Directory Search
7190 @cindex directory options
7191 @cindex options, directory search
7192 @cindex search path
7193
7194 These options specify directories to search for header files, for
7195 libraries and for parts of the compiler:
7196
7197 @table @gcctabopt
7198 @item -I@var{dir}
7199 @opindex I
7200 Add the directory @var{dir} to the head of the list of directories to be
7201 searched for header files.  This can be used to override a system header
7202 file, substituting your own version, since these directories are
7203 searched before the system header file directories.  However, you should
7204 not use this option to add directories that contain vendor-supplied
7205 system header files (use @option{-isystem} for that).  If you use more than
7206 one @option{-I} option, the directories are scanned in left-to-right
7207 order; the standard system directories come after.
7208
7209 If a standard system include directory, or a directory specified with
7210 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7211 option will be ignored.  The directory will still be searched but as a
7212 system directory at its normal position in the system include chain.
7213 This is to ensure that GCC's procedure to fix buggy system headers and
7214 the ordering for the include_next directive are not inadvertently changed.
7215 If you really need to change the search order for system directories,
7216 use the @option{-nostdinc} and/or @option{-isystem} options.
7217
7218 @item -iquote@var{dir}
7219 @opindex iquote
7220 Add the directory @var{dir} to the head of the list of directories to
7221 be searched for header files only for the case of @samp{#include
7222 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7223 otherwise just like @option{-I}.
7224
7225 @item -L@var{dir}
7226 @opindex L
7227 Add directory @var{dir} to the list of directories to be searched
7228 for @option{-l}.
7229
7230 @item -B@var{prefix}
7231 @opindex B
7232 This option specifies where to find the executables, libraries,
7233 include files, and data files of the compiler itself.
7234
7235 The compiler driver program runs one or more of the subprograms
7236 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7237 @var{prefix} as a prefix for each program it tries to run, both with and
7238 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7239
7240 For each subprogram to be run, the compiler driver first tries the
7241 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7242 was not specified, the driver tries two standard prefixes, which are
7243 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7244 those results in a file name that is found, the unmodified program
7245 name is searched for using the directories specified in your
7246 @env{PATH} environment variable.
7247
7248 The compiler will check to see if the path provided by the @option{-B}
7249 refers to a directory, and if necessary it will add a directory
7250 separator character at the end of the path.
7251
7252 @option{-B} prefixes that effectively specify directory names also apply
7253 to libraries in the linker, because the compiler translates these
7254 options into @option{-L} options for the linker.  They also apply to
7255 includes files in the preprocessor, because the compiler translates these
7256 options into @option{-isystem} options for the preprocessor.  In this case,
7257 the compiler appends @samp{include} to the prefix.
7258
7259 The run-time support file @file{libgcc.a} can also be searched for using
7260 the @option{-B} prefix, if needed.  If it is not found there, the two
7261 standard prefixes above are tried, and that is all.  The file is left
7262 out of the link if it is not found by those means.
7263
7264 Another way to specify a prefix much like the @option{-B} prefix is to use
7265 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7266 Variables}.
7267
7268 As a special kludge, if the path provided by @option{-B} is
7269 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7270 9, then it will be replaced by @file{[dir/]include}.  This is to help
7271 with boot-strapping the compiler.
7272
7273 @item -specs=@var{file}
7274 @opindex specs
7275 Process @var{file} after the compiler reads in the standard @file{specs}
7276 file, in order to override the defaults that the @file{gcc} driver
7277 program uses when determining what switches to pass to @file{cc1},
7278 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7279 @option{-specs=@var{file}} can be specified on the command line, and they
7280 are processed in order, from left to right.
7281
7282 @item --sysroot=@var{dir}
7283 @opindex sysroot
7284 Use @var{dir} as the logical root directory for headers and libraries.
7285 For example, if the compiler would normally search for headers in
7286 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7287 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7288
7289 If you use both this option and the @option{-isysroot} option, then
7290 the @option{--sysroot} option will apply to libraries, but the
7291 @option{-isysroot} option will apply to header files.
7292
7293 The GNU linker (beginning with version 2.16) has the necessary support
7294 for this option.  If your linker does not support this option, the
7295 header file aspect of @option{--sysroot} will still work, but the
7296 library aspect will not.
7297
7298 @item -I-
7299 @opindex I-
7300 This option has been deprecated.  Please use @option{-iquote} instead for
7301 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7302 Any directories you specify with @option{-I} options before the @option{-I-}
7303 option are searched only for the case of @samp{#include "@var{file}"};
7304 they are not searched for @samp{#include <@var{file}>}.
7305
7306 If additional directories are specified with @option{-I} options after
7307 the @option{-I-}, these directories are searched for all @samp{#include}
7308 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7309 this way.)
7310
7311 In addition, the @option{-I-} option inhibits the use of the current
7312 directory (where the current input file came from) as the first search
7313 directory for @samp{#include "@var{file}"}.  There is no way to
7314 override this effect of @option{-I-}.  With @option{-I.} you can specify
7315 searching the directory which was current when the compiler was
7316 invoked.  That is not exactly the same as what the preprocessor does
7317 by default, but it is often satisfactory.
7318
7319 @option{-I-} does not inhibit the use of the standard system directories
7320 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7321 independent.
7322 @end table
7323
7324 @c man end
7325
7326 @node Spec Files
7327 @section Specifying subprocesses and the switches to pass to them
7328 @cindex Spec Files
7329
7330 @command{gcc} is a driver program.  It performs its job by invoking a
7331 sequence of other programs to do the work of compiling, assembling and
7332 linking.  GCC interprets its command-line parameters and uses these to
7333 deduce which programs it should invoke, and which command-line options
7334 it ought to place on their command lines.  This behavior is controlled
7335 by @dfn{spec strings}.  In most cases there is one spec string for each
7336 program that GCC can invoke, but a few programs have multiple spec
7337 strings to control their behavior.  The spec strings built into GCC can
7338 be overridden by using the @option{-specs=} command-line switch to specify
7339 a spec file.
7340
7341 @dfn{Spec files} are plaintext files that are used to construct spec
7342 strings.  They consist of a sequence of directives separated by blank
7343 lines.  The type of directive is determined by the first non-whitespace
7344 character on the line and it can be one of the following:
7345
7346 @table @code
7347 @item %@var{command}
7348 Issues a @var{command} to the spec file processor.  The commands that can
7349 appear here are:
7350
7351 @table @code
7352 @item %include <@var{file}>
7353 @cindex %include
7354 Search for @var{file} and insert its text at the current point in the
7355 specs file.
7356
7357 @item %include_noerr <@var{file}>
7358 @cindex %include_noerr
7359 Just like @samp{%include}, but do not generate an error message if the include
7360 file cannot be found.
7361
7362 @item %rename @var{old_name} @var{new_name}
7363 @cindex %rename
7364 Rename the spec string @var{old_name} to @var{new_name}.
7365
7366 @end table
7367
7368 @item *[@var{spec_name}]:
7369 This tells the compiler to create, override or delete the named spec
7370 string.  All lines after this directive up to the next directive or
7371 blank line are considered to be the text for the spec string.  If this
7372 results in an empty string then the spec will be deleted.  (Or, if the
7373 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7374 does not currently exist a new spec will be created.  If the spec does
7375 exist then its contents will be overridden by the text of this
7376 directive, unless the first character of that text is the @samp{+}
7377 character, in which case the text will be appended to the spec.
7378
7379 @item [@var{suffix}]:
7380 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7381 and up to the next directive or blank line are considered to make up the
7382 spec string for the indicated suffix.  When the compiler encounters an
7383 input file with the named suffix, it will processes the spec string in
7384 order to work out how to compile that file.  For example:
7385
7386 @smallexample
7387 .ZZ:
7388 z-compile -input %i
7389 @end smallexample
7390
7391 This says that any input file whose name ends in @samp{.ZZ} should be
7392 passed to the program @samp{z-compile}, which should be invoked with the
7393 command-line switch @option{-input} and with the result of performing the
7394 @samp{%i} substitution.  (See below.)
7395
7396 As an alternative to providing a spec string, the text that follows a
7397 suffix directive can be one of the following:
7398
7399 @table @code
7400 @item @@@var{language}
7401 This says that the suffix is an alias for a known @var{language}.  This is
7402 similar to using the @option{-x} command-line switch to GCC to specify a
7403 language explicitly.  For example:
7404
7405 @smallexample
7406 .ZZ:
7407 @@c++
7408 @end smallexample
7409
7410 Says that .ZZ files are, in fact, C++ source files.
7411
7412 @item #@var{name}
7413 This causes an error messages saying:
7414
7415 @smallexample
7416 @var{name} compiler not installed on this system.
7417 @end smallexample
7418 @end table
7419
7420 GCC already has an extensive list of suffixes built into it.
7421 This directive will add an entry to the end of the list of suffixes, but
7422 since the list is searched from the end backwards, it is effectively
7423 possible to override earlier entries using this technique.
7424
7425 @end table
7426
7427 GCC has the following spec strings built into it.  Spec files can
7428 override these strings or create their own.  Note that individual
7429 targets can also add their own spec strings to this list.
7430
7431 @smallexample
7432 asm          Options to pass to the assembler
7433 asm_final    Options to pass to the assembler post-processor
7434 cpp          Options to pass to the C preprocessor
7435 cc1          Options to pass to the C compiler
7436 cc1plus      Options to pass to the C++ compiler
7437 endfile      Object files to include at the end of the link
7438 link         Options to pass to the linker
7439 lib          Libraries to include on the command line to the linker
7440 libgcc       Decides which GCC support library to pass to the linker
7441 linker       Sets the name of the linker
7442 predefines   Defines to be passed to the C preprocessor
7443 signed_char  Defines to pass to CPP to say whether @code{char} is signed
7444              by default
7445 startfile    Object files to include at the start of the link
7446 @end smallexample
7447
7448 Here is a small example of a spec file:
7449
7450 @smallexample
7451 %rename lib                 old_lib
7452
7453 *lib:
7454 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
7455 @end smallexample
7456
7457 This example renames the spec called @samp{lib} to @samp{old_lib} and
7458 then overrides the previous definition of @samp{lib} with a new one.
7459 The new definition adds in some extra command-line options before
7460 including the text of the old definition.
7461
7462 @dfn{Spec strings} are a list of command-line options to be passed to their
7463 corresponding program.  In addition, the spec strings can contain
7464 @samp{%}-prefixed sequences to substitute variable text or to
7465 conditionally insert text into the command line.  Using these constructs
7466 it is possible to generate quite complex command lines.
7467
7468 Here is a table of all defined @samp{%}-sequences for spec
7469 strings.  Note that spaces are not generated automatically around the
7470 results of expanding these sequences.  Therefore you can concatenate them
7471 together or combine them with constant text in a single argument.
7472
7473 @table @code
7474 @item %%
7475 Substitute one @samp{%} into the program name or argument.
7476
7477 @item %i
7478 Substitute the name of the input file being processed.
7479
7480 @item %b
7481 Substitute the basename of the input file being processed.
7482 This is the substring up to (and not including) the last period
7483 and not including the directory.
7484
7485 @item %B
7486 This is the same as @samp{%b}, but include the file suffix (text after
7487 the last period).
7488
7489 @item %d
7490 Marks the argument containing or following the @samp{%d} as a
7491 temporary file name, so that that file will be deleted if GCC exits
7492 successfully.  Unlike @samp{%g}, this contributes no text to the
7493 argument.
7494
7495 @item %g@var{suffix}
7496 Substitute a file name that has suffix @var{suffix} and is chosen
7497 once per compilation, and mark the argument in the same way as
7498 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7499 name is now chosen in a way that is hard to predict even when previously
7500 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7501 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7502 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7503 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7504 was simply substituted with a file name chosen once per compilation,
7505 without regard to any appended suffix (which was therefore treated
7506 just like ordinary text), making such attacks more likely to succeed.
7507
7508 @item %u@var{suffix}
7509 Like @samp{%g}, but generates a new temporary file name even if
7510 @samp{%u@var{suffix}} was already seen.
7511
7512 @item %U@var{suffix}
7513 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7514 new one if there is no such last file name.  In the absence of any
7515 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7516 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7517 would involve the generation of two distinct file names, one
7518 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7519 simply substituted with a file name chosen for the previous @samp{%u},
7520 without regard to any appended suffix.
7521
7522 @item %j@var{suffix}
7523 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7524 writable, and if save-temps is off; otherwise, substitute the name
7525 of a temporary file, just like @samp{%u}.  This temporary file is not
7526 meant for communication between processes, but rather as a junk
7527 disposal mechanism.
7528
7529 @item %|@var{suffix}
7530 @itemx %m@var{suffix}
7531 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7532 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7533 all.  These are the two most common ways to instruct a program that it
7534 should read from standard input or write to standard output.  If you
7535 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7536 construct: see for example @file{f/lang-specs.h}.
7537
7538 @item %.@var{SUFFIX}
7539 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7540 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7541 terminated by the next space or %.
7542
7543 @item %w
7544 Marks the argument containing or following the @samp{%w} as the
7545 designated output file of this compilation.  This puts the argument
7546 into the sequence of arguments that @samp{%o} will substitute later.
7547
7548 @item %o
7549 Substitutes the names of all the output files, with spaces
7550 automatically placed around them.  You should write spaces
7551 around the @samp{%o} as well or the results are undefined.
7552 @samp{%o} is for use in the specs for running the linker.
7553 Input files whose names have no recognized suffix are not compiled
7554 at all, but they are included among the output files, so they will
7555 be linked.
7556
7557 @item %O
7558 Substitutes the suffix for object files.  Note that this is
7559 handled specially when it immediately follows @samp{%g, %u, or %U},
7560 because of the need for those to form complete file names.  The
7561 handling is such that @samp{%O} is treated exactly as if it had already
7562 been substituted, except that @samp{%g, %u, and %U} do not currently
7563 support additional @var{suffix} characters following @samp{%O} as they would
7564 following, for example, @samp{.o}.
7565
7566 @item %p
7567 Substitutes the standard macro predefinitions for the
7568 current target machine.  Use this when running @code{cpp}.
7569
7570 @item %P
7571 Like @samp{%p}, but puts @samp{__} before and after the name of each
7572 predefined macro, except for macros that start with @samp{__} or with
7573 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7574 C@.
7575
7576 @item %I
7577 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7578 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7579 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7580 and @option{-imultilib} as necessary.
7581
7582 @item %s
7583 Current argument is the name of a library or startup file of some sort.
7584 Search for that file in a standard list of directories and substitute
7585 the full name found.
7586
7587 @item %e@var{str}
7588 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7589 Use this when inconsistent options are detected.
7590
7591 @item %(@var{name})
7592 Substitute the contents of spec string @var{name} at this point.
7593
7594 @item %[@var{name}]
7595 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7596
7597 @item %x@{@var{option}@}
7598 Accumulate an option for @samp{%X}.
7599
7600 @item %X
7601 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7602 spec string.
7603
7604 @item %Y
7605 Output the accumulated assembler options specified by @option{-Wa}.
7606
7607 @item %Z
7608 Output the accumulated preprocessor options specified by @option{-Wp}.
7609
7610 @item %a
7611 Process the @code{asm} spec.  This is used to compute the
7612 switches to be passed to the assembler.
7613
7614 @item %A
7615 Process the @code{asm_final} spec.  This is a spec string for
7616 passing switches to an assembler post-processor, if such a program is
7617 needed.
7618
7619 @item %l
7620 Process the @code{link} spec.  This is the spec for computing the
7621 command line passed to the linker.  Typically it will make use of the
7622 @samp{%L %G %S %D and %E} sequences.
7623
7624 @item %D
7625 Dump out a @option{-L} option for each directory that GCC believes might
7626 contain startup files.  If the target supports multilibs then the
7627 current multilib directory will be prepended to each of these paths.
7628
7629 @item %L
7630 Process the @code{lib} spec.  This is a spec string for deciding which
7631 libraries should be included on the command line to the linker.
7632
7633 @item %G
7634 Process the @code{libgcc} spec.  This is a spec string for deciding
7635 which GCC support library should be included on the command line to the linker.
7636
7637 @item %S
7638 Process the @code{startfile} spec.  This is a spec for deciding which
7639 object files should be the first ones passed to the linker.  Typically
7640 this might be a file named @file{crt0.o}.
7641
7642 @item %E
7643 Process the @code{endfile} spec.  This is a spec string that specifies
7644 the last object files that will be passed to the linker.
7645
7646 @item %C
7647 Process the @code{cpp} spec.  This is used to construct the arguments
7648 to be passed to the C preprocessor.
7649
7650 @item %1
7651 Process the @code{cc1} spec.  This is used to construct the options to be
7652 passed to the actual C compiler (@samp{cc1}).
7653
7654 @item %2
7655 Process the @code{cc1plus} spec.  This is used to construct the options to be
7656 passed to the actual C++ compiler (@samp{cc1plus}).
7657
7658 @item %*
7659 Substitute the variable part of a matched option.  See below.
7660 Note that each comma in the substituted string is replaced by
7661 a single space.
7662
7663 @item %<@code{S}
7664 Remove all occurrences of @code{-S} from the command line.  Note---this
7665 command is position dependent.  @samp{%} commands in the spec string
7666 before this one will see @code{-S}, @samp{%} commands in the spec string
7667 after this one will not.
7668
7669 @item %:@var{function}(@var{args})
7670 Call the named function @var{function}, passing it @var{args}.
7671 @var{args} is first processed as a nested spec string, then split
7672 into an argument vector in the usual fashion.  The function returns
7673 a string which is processed as if it had appeared literally as part
7674 of the current spec.
7675
7676 The following built-in spec functions are provided:
7677
7678 @table @code
7679 @item @code{getenv}
7680 The @code{getenv} spec function takes two arguments: an environment
7681 variable name and a string.  If the environment variable is not
7682 defined, a fatal error is issued.  Otherwise, the return value is the
7683 value of the environment variable concatenated with the string.  For
7684 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
7685
7686 @smallexample
7687 %:getenv(TOPDIR /include)
7688 @end smallexample
7689
7690 expands to @file{/path/to/top/include}.
7691
7692 @item @code{if-exists}
7693 The @code{if-exists} spec function takes one argument, an absolute
7694 pathname to a file.  If the file exists, @code{if-exists} returns the
7695 pathname.  Here is a small example of its usage:
7696
7697 @smallexample
7698 *startfile:
7699 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7700 @end smallexample
7701
7702 @item @code{if-exists-else}
7703 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7704 spec function, except that it takes two arguments.  The first argument is
7705 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7706 returns the pathname.  If it does not exist, it returns the second argument.
7707 This way, @code{if-exists-else} can be used to select one file or another,
7708 based on the existence of the first.  Here is a small example of its usage:
7709
7710 @smallexample
7711 *startfile:
7712 crt0%O%s %:if-exists(crti%O%s) \
7713 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7714 @end smallexample
7715
7716 @item @code{replace-outfile}
7717 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7718 first argument in the outfiles array and replaces it with the second argument.  Here
7719 is a small example of its usage:
7720
7721 @smallexample
7722 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7723 @end smallexample
7724
7725 @item @code{print-asm-header}
7726 The @code{print-asm-header} function takes no arguments and simply
7727 prints a banner like:
7728
7729 @smallexample
7730 Assember options
7731 ================
7732
7733 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
7734 @end smallexample
7735
7736 It is used to separate compiler options from assembler options
7737 in the @option{--target-help} output.
7738 @end table
7739
7740 @item %@{@code{S}@}
7741 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7742 If that switch was not specified, this substitutes nothing.  Note that
7743 the leading dash is omitted when specifying this option, and it is
7744 automatically inserted if the substitution is performed.  Thus the spec
7745 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7746 and would output the command line option @option{-foo}.
7747
7748 @item %W@{@code{S}@}
7749 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7750 deleted on failure.
7751
7752 @item %@{@code{S}*@}
7753 Substitutes all the switches specified to GCC whose names start
7754 with @code{-S}, but which also take an argument.  This is used for
7755 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7756 GCC considers @option{-o foo} as being
7757 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7758 text, including the space.  Thus two arguments would be generated.
7759
7760 @item %@{@code{S}*&@code{T}*@}
7761 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7762 (the order of @code{S} and @code{T} in the spec is not significant).
7763 There can be any number of ampersand-separated variables; for each the
7764 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7765
7766 @item %@{@code{S}:@code{X}@}
7767 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7768
7769 @item %@{!@code{S}:@code{X}@}
7770 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7771
7772 @item %@{@code{S}*:@code{X}@}
7773 Substitutes @code{X} if one or more switches whose names start with
7774 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7775 once, no matter how many such switches appeared.  However, if @code{%*}
7776 appears somewhere in @code{X}, then @code{X} will be substituted once
7777 for each matching switch, with the @code{%*} replaced by the part of
7778 that switch that matched the @code{*}.
7779
7780 @item %@{.@code{S}:@code{X}@}
7781 Substitutes @code{X}, if processing a file with suffix @code{S}.
7782
7783 @item %@{!.@code{S}:@code{X}@}
7784 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7785
7786 @item %@{,@code{S}:@code{X}@}
7787 Substitutes @code{X}, if processing a file for language @code{S}.
7788
7789 @item %@{!,@code{S}:@code{X}@}
7790 Substitutes @code{X}, if not processing a file for language @code{S}.
7791
7792 @item %@{@code{S}|@code{P}:@code{X}@}
7793 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
7794 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
7795 @code{*} sequences as well, although they have a stronger binding than
7796 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
7797 alternatives must be starred, and only the first matching alternative
7798 is substituted.
7799
7800 For example, a spec string like this:
7801
7802 @smallexample
7803 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7804 @end smallexample
7805
7806 will output the following command-line options from the following input
7807 command-line options:
7808
7809 @smallexample
7810 fred.c        -foo -baz
7811 jim.d         -bar -boggle
7812 -d fred.c     -foo -baz -boggle
7813 -d jim.d      -bar -baz -boggle
7814 @end smallexample
7815
7816 @item %@{S:X; T:Y; :D@}
7817
7818 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7819 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7820 be as many clauses as you need.  This may be combined with @code{.},
7821 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
7822
7823
7824 @end table
7825
7826 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7827 construct may contain other nested @samp{%} constructs or spaces, or
7828 even newlines.  They are processed as usual, as described above.
7829 Trailing white space in @code{X} is ignored.  White space may also
7830 appear anywhere on the left side of the colon in these constructs,
7831 except between @code{.} or @code{*} and the corresponding word.
7832
7833 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7834 handled specifically in these constructs.  If another value of
7835 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7836 @option{-W} switch is found later in the command line, the earlier
7837 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7838 just one letter, which passes all matching options.
7839
7840 The character @samp{|} at the beginning of the predicate text is used to
7841 indicate that a command should be piped to the following command, but
7842 only if @option{-pipe} is specified.
7843
7844 It is built into GCC which switches take arguments and which do not.
7845 (You might think it would be useful to generalize this to allow each
7846 compiler's spec to say which switches take arguments.  But this cannot
7847 be done in a consistent fashion.  GCC cannot even decide which input
7848 files have been specified without knowing which switches take arguments,
7849 and it must know which input files to compile in order to tell which
7850 compilers to run).
7851
7852 GCC also knows implicitly that arguments starting in @option{-l} are to be
7853 treated as compiler output files, and passed to the linker in their
7854 proper position among the other output files.
7855
7856 @c man begin OPTIONS
7857
7858 @node Target Options
7859 @section Specifying Target Machine and Compiler Version
7860 @cindex target options
7861 @cindex cross compiling
7862 @cindex specifying machine version
7863 @cindex specifying compiler version and target machine
7864 @cindex compiler version, specifying
7865 @cindex target machine, specifying
7866
7867 The usual way to run GCC is to run the executable called @file{gcc}, or
7868 @file{<machine>-gcc} when cross-compiling, or
7869 @file{<machine>-gcc-<version>} to run a version other than the one that
7870 was installed last.  Sometimes this is inconvenient, so GCC provides
7871 options that will switch to another cross-compiler or version.
7872
7873 @table @gcctabopt
7874 @item -b @var{machine}
7875 @opindex b
7876 The argument @var{machine} specifies the target machine for compilation.
7877
7878 The value to use for @var{machine} is the same as was specified as the
7879 machine type when configuring GCC as a cross-compiler.  For
7880 example, if a cross-compiler was configured with @samp{configure
7881 arm-elf}, meaning to compile for an arm processor with elf binaries,
7882 then you would specify @option{-b arm-elf} to run that cross compiler.
7883 Because there are other options beginning with @option{-b}, the
7884 configuration must contain a hyphen.
7885
7886 @item -V @var{version}
7887 @opindex V
7888 The argument @var{version} specifies which version of GCC to run.
7889 This is useful when multiple versions are installed.  For example,
7890 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7891 @end table
7892
7893 The @option{-V} and @option{-b} options work by running the
7894 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7895 use them if you can just run that directly.
7896
7897 @node Submodel Options
7898 @section Hardware Models and Configurations
7899 @cindex submodel options
7900 @cindex specifying hardware config
7901 @cindex hardware models and configurations, specifying
7902 @cindex machine dependent options
7903
7904 Earlier we discussed the standard option @option{-b} which chooses among
7905 different installed compilers for completely different target
7906 machines, such as VAX vs.@: 68000 vs.@: 80386.
7907
7908 In addition, each of these target machine types can have its own
7909 special options, starting with @samp{-m}, to choose among various
7910 hardware models or configurations---for example, 68010 vs 68020,
7911 floating coprocessor or none.  A single installed version of the
7912 compiler can compile for any model or configuration, according to the
7913 options specified.
7914
7915 Some configurations of the compiler also support additional special
7916 options, usually for compatibility with other compilers on the same
7917 platform.
7918
7919 @c This list is ordered alphanumerically by subsection name.
7920 @c It should be the same order and spelling as these options are listed
7921 @c in Machine Dependent Options
7922
7923 @menu
7924 * ARC Options::
7925 * ARM Options::
7926 * AVR Options::
7927 * Blackfin Options::
7928 * CRIS Options::
7929 * CRX Options::
7930 * Darwin Options::
7931 * DEC Alpha Options::
7932 * DEC Alpha/VMS Options::
7933 * FRV Options::
7934 * GNU/Linux Options::
7935 * H8/300 Options::
7936 * HPPA Options::
7937 * i386 and x86-64 Options::
7938 * IA-64 Options::
7939 * M32C Options::
7940 * M32R/D Options::
7941 * M680x0 Options::
7942 * M68hc1x Options::
7943 * MCore Options::
7944 * MIPS Options::
7945 * MMIX Options::
7946 * MN10300 Options::
7947 * MT Options::
7948 * PDP-11 Options::
7949 * PowerPC Options::
7950 * RS/6000 and PowerPC Options::
7951 * S/390 and zSeries Options::
7952 * Score Options::
7953 * SH Options::
7954 * SPARC Options::
7955 * SPU Options::
7956 * System V Options::
7957 * TMS320C3x/C4x Options::
7958 * V850 Options::
7959 * VAX Options::
7960 * VxWorks Options::
7961 * x86-64 Options::
7962 * Xstormy16 Options::
7963 * Xtensa Options::
7964 * zSeries Options::
7965 @end menu
7966
7967 @node ARC Options
7968 @subsection ARC Options
7969 @cindex ARC Options
7970
7971 These options are defined for ARC implementations:
7972
7973 @table @gcctabopt
7974 @item -EL
7975 @opindex EL
7976 Compile code for little endian mode.  This is the default.
7977
7978 @item -EB
7979 @opindex EB
7980 Compile code for big endian mode.
7981
7982 @item -mmangle-cpu
7983 @opindex mmangle-cpu
7984 Prepend the name of the cpu to all public symbol names.
7985 In multiple-processor systems, there are many ARC variants with different
7986 instruction and register set characteristics.  This flag prevents code
7987 compiled for one cpu to be linked with code compiled for another.
7988 No facility exists for handling variants that are ``almost identical''.
7989 This is an all or nothing option.
7990
7991 @item -mcpu=@var{cpu}
7992 @opindex mcpu
7993 Compile code for ARC variant @var{cpu}.
7994 Which variants are supported depend on the configuration.
7995 All variants support @option{-mcpu=base}, this is the default.
7996
7997 @item -mtext=@var{text-section}
7998 @itemx -mdata=@var{data-section}
7999 @itemx -mrodata=@var{readonly-data-section}
8000 @opindex mtext
8001 @opindex mdata
8002 @opindex mrodata
8003 Put functions, data, and readonly data in @var{text-section},
8004 @var{data-section}, and @var{readonly-data-section} respectively
8005 by default.  This can be overridden with the @code{section} attribute.
8006 @xref{Variable Attributes}.
8007
8008 @end table
8009
8010 @node ARM Options
8011 @subsection ARM Options
8012 @cindex ARM options
8013
8014 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
8015 architectures:
8016
8017 @table @gcctabopt
8018 @item -mabi=@var{name}
8019 @opindex mabi
8020 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
8021 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
8022
8023 @item -mapcs-frame
8024 @opindex mapcs-frame
8025 Generate a stack frame that is compliant with the ARM Procedure Call
8026 Standard for all functions, even if this is not strictly necessary for
8027 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
8028 with this option will cause the stack frames not to be generated for
8029 leaf functions.  The default is @option{-mno-apcs-frame}.
8030
8031 @item -mapcs
8032 @opindex mapcs
8033 This is a synonym for @option{-mapcs-frame}.
8034
8035 @ignore
8036 @c not currently implemented
8037 @item -mapcs-stack-check
8038 @opindex mapcs-stack-check
8039 Generate code to check the amount of stack space available upon entry to
8040 every function (that actually uses some stack space).  If there is
8041 insufficient space available then either the function
8042 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
8043 called, depending upon the amount of stack space required.  The run time
8044 system is required to provide these functions.  The default is
8045 @option{-mno-apcs-stack-check}, since this produces smaller code.
8046
8047 @c not currently implemented
8048 @item -mapcs-float
8049 @opindex mapcs-float
8050 Pass floating point arguments using the float point registers.  This is
8051 one of the variants of the APCS@.  This option is recommended if the
8052 target hardware has a floating point unit or if a lot of floating point
8053 arithmetic is going to be performed by the code.  The default is
8054 @option{-mno-apcs-float}, since integer only code is slightly increased in
8055 size if @option{-mapcs-float} is used.
8056
8057 @c not currently implemented
8058 @item -mapcs-reentrant
8059 @opindex mapcs-reentrant
8060 Generate reentrant, position independent code.  The default is
8061 @option{-mno-apcs-reentrant}.
8062 @end ignore
8063
8064 @item -mthumb-interwork
8065 @opindex mthumb-interwork
8066 Generate code which supports calling between the ARM and Thumb
8067 instruction sets.  Without this option the two instruction sets cannot
8068 be reliably used inside one program.  The default is
8069 @option{-mno-thumb-interwork}, since slightly larger code is generated
8070 when @option{-mthumb-interwork} is specified.
8071
8072 @item -mno-sched-prolog
8073 @opindex mno-sched-prolog
8074 Prevent the reordering of instructions in the function prolog, or the
8075 merging of those instruction with the instructions in the function's
8076 body.  This means that all functions will start with a recognizable set
8077 of instructions (or in fact one of a choice from a small set of
8078 different function prologues), and this information can be used to
8079 locate the start if functions inside an executable piece of code.  The
8080 default is @option{-msched-prolog}.
8081
8082 @item -mhard-float
8083 @opindex mhard-float
8084 Generate output containing floating point instructions.  This is the
8085 default.
8086
8087 @item -msoft-float
8088 @opindex msoft-float
8089 Generate output containing library calls for floating point.
8090 @strong{Warning:} the requisite libraries are not available for all ARM
8091 targets.  Normally the facilities of the machine's usual C compiler are
8092 used, but this cannot be done directly in cross-compilation.  You must make
8093 your own arrangements to provide suitable library functions for
8094 cross-compilation.
8095
8096 @option{-msoft-float} changes the calling convention in the output file;
8097 therefore, it is only useful if you compile @emph{all} of a program with
8098 this option.  In particular, you need to compile @file{libgcc.a}, the
8099 library that comes with GCC, with @option{-msoft-float} in order for
8100 this to work.
8101
8102 @item -mfloat-abi=@var{name}
8103 @opindex mfloat-abi
8104 Specifies which ABI to use for floating point values.  Permissible values
8105 are: @samp{soft}, @samp{softfp} and @samp{hard}.
8106
8107 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
8108 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
8109 of floating point instructions, but still uses the soft-float calling
8110 conventions.
8111
8112 @item -mlittle-endian
8113 @opindex mlittle-endian
8114 Generate code for a processor running in little-endian mode.  This is
8115 the default for all standard configurations.
8116
8117 @item -mbig-endian
8118 @opindex mbig-endian
8119 Generate code for a processor running in big-endian mode; the default is
8120 to compile code for a little-endian processor.
8121
8122 @item -mwords-little-endian
8123 @opindex mwords-little-endian
8124 This option only applies when generating code for big-endian processors.
8125 Generate code for a little-endian word order but a big-endian byte
8126 order.  That is, a byte order of the form @samp{32107654}.  Note: this
8127 option should only be used if you require compatibility with code for
8128 big-endian ARM processors generated by versions of the compiler prior to
8129 2.8.
8130
8131 @item -mcpu=@var{name}
8132 @opindex mcpu
8133 This specifies the name of the target ARM processor.  GCC uses this name
8134 to determine what kind of instructions it can emit when generating
8135 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
8136 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
8137 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
8138 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
8139 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
8140 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
8141 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
8142 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
8143 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
8144 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
8145 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
8146 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
8147 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
8148 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
8149 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3},
8150 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
8151
8152 @itemx -mtune=@var{name}
8153 @opindex mtune
8154 This option is very similar to the @option{-mcpu=} option, except that
8155 instead of specifying the actual target processor type, and hence
8156 restricting which instructions can be used, it specifies that GCC should
8157 tune the performance of the code as if the target were of the type
8158 specified in this option, but still choosing the instructions that it
8159 will generate based on the cpu specified by a @option{-mcpu=} option.
8160 For some ARM implementations better performance can be obtained by using
8161 this option.
8162
8163 @item -march=@var{name}
8164 @opindex march
8165 This specifies the name of the target ARM architecture.  GCC uses this
8166 name to determine what kind of instructions it can emit when generating
8167 assembly code.  This option can be used in conjunction with or instead
8168 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8169 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8170 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8171 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a},
8172 @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{ep9312}.
8173
8174 @item -mfpu=@var{name}
8175 @itemx -mfpe=@var{number}
8176 @itemx -mfp=@var{number}
8177 @opindex mfpu
8178 @opindex mfpe
8179 @opindex mfp
8180 This specifies what floating point hardware (or hardware emulation) is
8181 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8182 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
8183 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8184 with older versions of GCC@.
8185
8186 If @option{-msoft-float} is specified this specifies the format of
8187 floating point values.
8188
8189 @item -mstructure-size-boundary=@var{n}
8190 @opindex mstructure-size-boundary
8191 The size of all structures and unions will be rounded up to a multiple
8192 of the number of bits set by this option.  Permissible values are 8, 32
8193 and 64.  The default value varies for different toolchains.  For the COFF
8194 targeted toolchain the default value is 8.  A value of 64 is only allowed
8195 if the underlying ABI supports it.
8196
8197 Specifying the larger number can produce faster, more efficient code, but
8198 can also increase the size of the program.  Different values are potentially
8199 incompatible.  Code compiled with one value cannot necessarily expect to
8200 work with code or libraries compiled with another value, if they exchange
8201 information using structures or unions.
8202
8203 @item -mabort-on-noreturn
8204 @opindex mabort-on-noreturn
8205 Generate a call to the function @code{abort} at the end of a
8206 @code{noreturn} function.  It will be executed if the function tries to
8207 return.
8208
8209 @item -mlong-calls
8210 @itemx -mno-long-calls
8211 @opindex mlong-calls
8212 @opindex mno-long-calls
8213 Tells the compiler to perform function calls by first loading the
8214 address of the function into a register and then performing a subroutine
8215 call on this register.  This switch is needed if the target function
8216 will lie outside of the 64 megabyte addressing range of the offset based
8217 version of subroutine call instruction.
8218
8219 Even if this switch is enabled, not all function calls will be turned
8220 into long calls.  The heuristic is that static functions, functions
8221 which have the @samp{short-call} attribute, functions that are inside
8222 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8223 definitions have already been compiled within the current compilation
8224 unit, will not be turned into long calls.  The exception to this rule is
8225 that weak function definitions, functions with the @samp{long-call}
8226 attribute or the @samp{section} attribute, and functions that are within
8227 the scope of a @samp{#pragma long_calls} directive, will always be
8228 turned into long calls.
8229
8230 This feature is not enabled by default.  Specifying
8231 @option{-mno-long-calls} will restore the default behavior, as will
8232 placing the function calls within the scope of a @samp{#pragma
8233 long_calls_off} directive.  Note these switches have no effect on how
8234 the compiler generates code to handle function calls via function
8235 pointers.
8236
8237 @item -mnop-fun-dllimport
8238 @opindex mnop-fun-dllimport
8239 Disable support for the @code{dllimport} attribute.
8240
8241 @item -msingle-pic-base
8242 @opindex msingle-pic-base
8243 Treat the register used for PIC addressing as read-only, rather than
8244 loading it in the prologue for each function.  The run-time system is
8245 responsible for initializing this register with an appropriate value
8246 before execution begins.
8247
8248 @item -mpic-register=@var{reg}
8249 @opindex mpic-register
8250 Specify the register to be used for PIC addressing.  The default is R10
8251 unless stack-checking is enabled, when R9 is used.
8252
8253 @item -mcirrus-fix-invalid-insns
8254 @opindex mcirrus-fix-invalid-insns
8255 @opindex mno-cirrus-fix-invalid-insns
8256 Insert NOPs into the instruction stream to in order to work around
8257 problems with invalid Maverick instruction combinations.  This option
8258 is only valid if the @option{-mcpu=ep9312} option has been used to
8259 enable generation of instructions for the Cirrus Maverick floating
8260 point co-processor.  This option is not enabled by default, since the
8261 problem is only present in older Maverick implementations.  The default
8262 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8263 switch.
8264
8265 @item -mpoke-function-name
8266 @opindex mpoke-function-name
8267 Write the name of each function into the text section, directly
8268 preceding the function prologue.  The generated code is similar to this:
8269
8270 @smallexample
8271      t0
8272          .ascii "arm_poke_function_name", 0
8273          .align
8274      t1
8275          .word 0xff000000 + (t1 - t0)
8276      arm_poke_function_name
8277          mov     ip, sp
8278          stmfd   sp!, @{fp, ip, lr, pc@}
8279          sub     fp, ip, #4
8280 @end smallexample
8281
8282 When performing a stack backtrace, code can inspect the value of
8283 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8284 location @code{pc - 12} and the top 8 bits are set, then we know that
8285 there is a function name embedded immediately preceding this location
8286 and has length @code{((pc[-3]) & 0xff000000)}.
8287
8288 @item -mthumb
8289 @opindex mthumb
8290 Generate code for the Thumb instruction set.  The default is to
8291 use the 32-bit ARM instruction set.
8292 This option automatically enables either 16-bit Thumb-1 or
8293 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8294 and @option{-march=@var{name}} options.
8295
8296 @item -mtpcs-frame
8297 @opindex mtpcs-frame
8298 Generate a stack frame that is compliant with the Thumb Procedure Call
8299 Standard for all non-leaf functions.  (A leaf function is one that does
8300 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8301
8302 @item -mtpcs-leaf-frame
8303 @opindex mtpcs-leaf-frame
8304 Generate a stack frame that is compliant with the Thumb Procedure Call
8305 Standard for all leaf functions.  (A leaf function is one that does
8306 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8307
8308 @item -mcallee-super-interworking
8309 @opindex mcallee-super-interworking
8310 Gives all externally visible functions in the file being compiled an ARM
8311 instruction set header which switches to Thumb mode before executing the
8312 rest of the function.  This allows these functions to be called from
8313 non-interworking code.
8314
8315 @item -mcaller-super-interworking
8316 @opindex mcaller-super-interworking
8317 Allows calls via function pointers (including virtual functions) to
8318 execute correctly regardless of whether the target code has been
8319 compiled for interworking or not.  There is a small overhead in the cost
8320 of executing a function pointer if this option is enabled.
8321
8322 @item -mtp=@var{name}
8323 @opindex mtp
8324 Specify the access model for the thread local storage pointer.  The valid
8325 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8326 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8327 (supported in the arm6k architecture), and @option{auto}, which uses the
8328 best available method for the selected processor.  The default setting is
8329 @option{auto}.
8330
8331 @end table
8332
8333 @node AVR Options
8334 @subsection AVR Options
8335 @cindex AVR Options
8336
8337 These options are defined for AVR implementations:
8338
8339 @table @gcctabopt
8340 @item -mmcu=@var{mcu}
8341 @opindex mmcu
8342 Specify ATMEL AVR instruction set or MCU type.
8343
8344 Instruction set avr1 is for the minimal AVR core, not supported by the C
8345 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8346 attiny11, attiny12, attiny15, attiny28).
8347
8348 Instruction set avr2 (default) is for the classic AVR core with up to
8349 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8350 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8351 at90c8534, at90s8535).
8352
8353 Instruction set avr3 is for the classic AVR core with up to 128K program
8354 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8355
8356 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8357 memory space (MCU types: atmega8, atmega83, atmega85).
8358
8359 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8360 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8361 atmega64, atmega128, at43usb355, at94k).
8362
8363 @item -msize
8364 @opindex msize
8365 Output instruction sizes to the asm file.
8366
8367 @item -minit-stack=@var{N}
8368 @opindex minit-stack
8369 Specify the initial stack address, which may be a symbol or numeric value,
8370 @samp{__stack} is the default.
8371
8372 @item -mno-interrupts
8373 @opindex mno-interrupts
8374 Generated code is not compatible with hardware interrupts.
8375 Code size will be smaller.
8376
8377 @item -mcall-prologues
8378 @opindex mcall-prologues
8379 Functions prologues/epilogues expanded as call to appropriate
8380 subroutines.  Code size will be smaller.
8381
8382 @item -mno-tablejump
8383 @opindex mno-tablejump
8384 Do not generate tablejump insns which sometimes increase code size.
8385
8386 @item -mtiny-stack
8387 @opindex mtiny-stack
8388 Change only the low 8 bits of the stack pointer.
8389
8390 @item -mint8
8391 @opindex mint8
8392 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8393 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8394 and long long will be 4 bytes.  Please note that this option does not
8395 comply to the C standards, but it will provide you with smaller code
8396 size.
8397 @end table
8398
8399 @node Blackfin Options
8400 @subsection Blackfin Options
8401 @cindex Blackfin Options
8402
8403 @table @gcctabopt
8404 @item -mcpu=@var{cpu}
8405 @opindex mcpu=
8406 Specifies the name of the target Blackfin processor. Currently, @var{cpu}
8407 can be one of @samp{bf531}, @samp{bf532}, @samp{bf533},
8408 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf561}.
8409 Without this option, @samp{bf532} is used as the processor by default.
8410 The corresponding predefined processor macros for @var{cpu} is to
8411 be defined.  For the @samp{bfin-elf} toolchain, this causes the hardware
8412 BSP provided by libgloss to be linked in if @samp{-msim} is not given.
8413 Support for @samp{bf561} is incomplete; only the processor macro is defined.
8414
8415 @item -msim
8416 @opindex msim
8417 Specifies that the program will be run on the simulator.  This causes
8418 the simulator BSP provided by libgloss to be linked in.  This option
8419 has effect only for @samp{bfin-elf} toolchain.
8420
8421 @item -momit-leaf-frame-pointer
8422 @opindex momit-leaf-frame-pointer
8423 Don't keep the frame pointer in a register for leaf functions.  This
8424 avoids the instructions to save, set up and restore frame pointers and
8425 makes an extra register available in leaf functions.  The option
8426 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8427 which might make debugging harder.
8428
8429 @item -mspecld-anomaly
8430 @opindex mspecld-anomaly
8431 When enabled, the compiler will ensure that the generated code does not
8432 contain speculative loads after jump instructions.  This option is enabled
8433 by default.
8434
8435 @item -mno-specld-anomaly
8436 @opindex mno-specld-anomaly
8437 Don't generate extra code to prevent speculative loads from occurring.
8438
8439 @item -mcsync-anomaly
8440 @opindex mcsync-anomaly
8441 When enabled, the compiler will ensure that the generated code does not
8442 contain CSYNC or SSYNC instructions too soon after conditional branches.
8443 This option is enabled by default.
8444
8445 @item -mno-csync-anomaly
8446 @opindex mno-csync-anomaly
8447 Don't generate extra code to prevent CSYNC or SSYNC instructions from
8448 occurring too soon after a conditional branch.
8449
8450 @item -mlow-64k
8451 @opindex mlow-64k
8452 When enabled, the compiler is free to take advantage of the knowledge that
8453 the entire program fits into the low 64k of memory.
8454
8455 @item -mno-low-64k
8456 @opindex mno-low-64k
8457 Assume that the program is arbitrarily large.  This is the default.
8458
8459 @item -mstack-check-l1
8460 @opindex mstack-check-l1
8461 Do stack checking using information placed into L1 scratchpad memory by the
8462 uClinux kernel.
8463
8464 @item -mid-shared-library
8465 @opindex mid-shared-library
8466 Generate code that supports shared libraries via the library ID method.
8467 This allows for execute in place and shared libraries in an environment
8468 without virtual memory management.  This option implies @option{-fPIC}.
8469
8470 @item -mno-id-shared-library
8471 @opindex mno-id-shared-library
8472 Generate code that doesn't assume ID based shared libraries are being used.
8473 This is the default.
8474
8475 @item -mleaf-id-shared-library
8476 @opindex mleaf-id-shared-library
8477 Generate code that supports shared libraries via the library ID method,
8478 but assumes that this library or executable won't link against any other
8479 ID shared libraries.  That allows the compiler to use faster code for jumps
8480 and calls.
8481
8482 @item -mno-leaf-id-shared-library
8483 @opindex mno-leaf-id-shared-library
8484 Do not assume that the code being compiled won't link against any ID shared
8485 libraries.  Slower code will be generated for jump and call insns.
8486
8487 @item -mshared-library-id=n
8488 @opindex mshared-library-id
8489 Specified the identification number of the ID based shared library being
8490 compiled.  Specifying a value of 0 will generate more compact code, specifying
8491 other values will force the allocation of that number to the current
8492 library but is no more space or time efficient than omitting this option.
8493
8494 @item -msep-data
8495 @opindex msep-data
8496 Generate code that allows the data segment to be located in a different
8497 area of memory from the text segment.  This allows for execute in place in
8498 an environment without virtual memory management by eliminating relocations
8499 against the text section.
8500
8501 @item -mno-sep-data
8502 @opindex mno-sep-data
8503 Generate code that assumes that the data segment follows the text segment.
8504 This is the default.
8505
8506 @item -mlong-calls
8507 @itemx -mno-long-calls
8508 @opindex mlong-calls
8509 @opindex mno-long-calls
8510 Tells the compiler to perform function calls by first loading the
8511 address of the function into a register and then performing a subroutine
8512 call on this register.  This switch is needed if the target function
8513 will lie outside of the 24 bit addressing range of the offset based
8514 version of subroutine call instruction.
8515
8516 This feature is not enabled by default.  Specifying
8517 @option{-mno-long-calls} will restore the default behavior.  Note these
8518 switches have no effect on how the compiler generates code to handle
8519 function calls via function pointers.
8520 @end table
8521
8522 @node CRIS Options
8523 @subsection CRIS Options
8524 @cindex CRIS Options
8525
8526 These options are defined specifically for the CRIS ports.
8527
8528 @table @gcctabopt
8529 @item -march=@var{architecture-type}
8530 @itemx -mcpu=@var{architecture-type}
8531 @opindex march
8532 @opindex mcpu
8533 Generate code for the specified architecture.  The choices for
8534 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8535 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8536 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8537 @samp{v10}.
8538
8539 @item -mtune=@var{architecture-type}
8540 @opindex mtune
8541 Tune to @var{architecture-type} everything applicable about the generated
8542 code, except for the ABI and the set of available instructions.  The
8543 choices for @var{architecture-type} are the same as for
8544 @option{-march=@var{architecture-type}}.
8545
8546 @item -mmax-stack-frame=@var{n}
8547 @opindex mmax-stack-frame
8548 Warn when the stack frame of a function exceeds @var{n} bytes.
8549
8550 @item -melinux-stacksize=@var{n}
8551 @opindex melinux-stacksize
8552 Only available with the @samp{cris-axis-aout} target.  Arranges for
8553 indications in the program to the kernel loader that the stack of the
8554 program should be set to @var{n} bytes.
8555
8556 @item -metrax4
8557 @itemx -metrax100
8558 @opindex metrax4
8559 @opindex metrax100
8560 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8561 @option{-march=v3} and @option{-march=v8} respectively.
8562
8563 @item -mmul-bug-workaround
8564 @itemx -mno-mul-bug-workaround
8565 @opindex mmul-bug-workaround
8566 @opindex mno-mul-bug-workaround
8567 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8568 models where it applies.  This option is active by default.
8569
8570 @item -mpdebug
8571 @opindex mpdebug
8572 Enable CRIS-specific verbose debug-related information in the assembly
8573 code.  This option also has the effect to turn off the @samp{#NO_APP}
8574 formatted-code indicator to the assembler at the beginning of the
8575 assembly file.
8576
8577 @item -mcc-init
8578 @opindex mcc-init
8579 Do not use condition-code results from previous instruction; always emit
8580 compare and test instructions before use of condition codes.
8581
8582 @item -mno-side-effects
8583 @opindex mno-side-effects
8584 Do not emit instructions with side-effects in addressing modes other than
8585 post-increment.
8586
8587 @item -mstack-align
8588 @itemx -mno-stack-align
8589 @itemx -mdata-align
8590 @itemx -mno-data-align
8591 @itemx -mconst-align
8592 @itemx -mno-const-align
8593 @opindex mstack-align
8594 @opindex mno-stack-align
8595 @opindex mdata-align
8596 @opindex mno-data-align
8597 @opindex mconst-align
8598 @opindex mno-const-align
8599 These options (no-options) arranges (eliminate arrangements) for the
8600 stack-frame, individual data and constants to be aligned for the maximum
8601 single data access size for the chosen CPU model.  The default is to
8602 arrange for 32-bit alignment.  ABI details such as structure layout are
8603 not affected by these options.
8604
8605 @item -m32-bit
8606 @itemx -m16-bit
8607 @itemx -m8-bit
8608 @opindex m32-bit
8609 @opindex m16-bit
8610 @opindex m8-bit
8611 Similar to the stack- data- and const-align options above, these options
8612 arrange for stack-frame, writable data and constants to all be 32-bit,
8613 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8614
8615 @item -mno-prologue-epilogue
8616 @itemx -mprologue-epilogue
8617 @opindex mno-prologue-epilogue
8618 @opindex mprologue-epilogue
8619 With @option{-mno-prologue-epilogue}, the normal function prologue and
8620 epilogue that sets up the stack-frame are omitted and no return
8621 instructions or return sequences are generated in the code.  Use this
8622 option only together with visual inspection of the compiled code: no
8623 warnings or errors are generated when call-saved registers must be saved,
8624 or storage for local variable needs to be allocated.
8625
8626 @item -mno-gotplt
8627 @itemx -mgotplt
8628 @opindex mno-gotplt
8629 @opindex mgotplt
8630 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8631 instruction sequences that load addresses for functions from the PLT part
8632 of the GOT rather than (traditional on other architectures) calls to the
8633 PLT@.  The default is @option{-mgotplt}.
8634
8635 @item -maout
8636 @opindex maout
8637 Legacy no-op option only recognized with the cris-axis-aout target.
8638
8639 @item -melf
8640 @opindex melf
8641 Legacy no-op option only recognized with the cris-axis-elf and
8642 cris-axis-linux-gnu targets.
8643
8644 @item -melinux
8645 @opindex melinux
8646 Only recognized with the cris-axis-aout target, where it selects a
8647 GNU/linux-like multilib, include files and instruction set for
8648 @option{-march=v8}.
8649
8650 @item -mlinux
8651 @opindex mlinux
8652 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8653
8654 @item -sim
8655 @opindex sim
8656 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8657 to link with input-output functions from a simulator library.  Code,
8658 initialized data and zero-initialized data are allocated consecutively.
8659
8660 @item -sim2
8661 @opindex sim2
8662 Like @option{-sim}, but pass linker options to locate initialized data at
8663 0x40000000 and zero-initialized data at 0x80000000.
8664 @end table
8665
8666 @node CRX Options
8667 @subsection CRX Options
8668 @cindex CRX Options
8669
8670 These options are defined specifically for the CRX ports.
8671
8672 @table @gcctabopt
8673
8674 @item -mmac
8675 @opindex mmac
8676 Enable the use of multiply-accumulate instructions. Disabled by default.
8677
8678 @item -mpush-args
8679 @opindex mpush-args
8680 Push instructions will be used to pass outgoing arguments when functions
8681 are called. Enabled by default.
8682 @end table
8683
8684 @node Darwin Options
8685 @subsection Darwin Options
8686 @cindex Darwin options
8687
8688 These options are defined for all architectures running the Darwin operating
8689 system.
8690
8691 FSF GCC on Darwin does not create ``fat'' object files; it will create
8692 an object file for the single architecture that it was built to
8693 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8694 @option{-arch} options are used; it does so by running the compiler or
8695 linker multiple times and joining the results together with
8696 @file{lipo}.
8697
8698 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8699 @samp{i686}) is determined by the flags that specify the ISA
8700 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8701 @option{-force_cpusubtype_ALL} option can be used to override this.
8702
8703 The Darwin tools vary in their behavior when presented with an ISA
8704 mismatch.  The assembler, @file{as}, will only permit instructions to
8705 be used that are valid for the subtype of the file it is generating,
8706 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8707 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8708 and print an error if asked to create a shared library with a less
8709 restrictive subtype than its input files (for instance, trying to put
8710 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8711 for executables, @file{ld}, will quietly give the executable the most
8712 restrictive subtype of any of its input files.
8713
8714 @table @gcctabopt
8715 @item -F@var{dir}
8716 @opindex F
8717 Add the framework directory @var{dir} to the head of the list of
8718 directories to be searched for header files.  These directories are
8719 interleaved with those specified by @option{-I} options and are
8720 scanned in a left-to-right order.
8721
8722 A framework directory is a directory with frameworks in it.  A
8723 framework is a directory with a @samp{"Headers"} and/or
8724 @samp{"PrivateHeaders"} directory contained directly in it that ends
8725 in @samp{".framework"}.  The name of a framework is the name of this
8726 directory excluding the @samp{".framework"}.  Headers associated with
8727 the framework are found in one of those two directories, with
8728 @samp{"Headers"} being searched first.  A subframework is a framework
8729 directory that is in a framework's @samp{"Frameworks"} directory.
8730 Includes of subframework headers can only appear in a header of a
8731 framework that contains the subframework, or in a sibling subframework
8732 header.  Two subframeworks are siblings if they occur in the same
8733 framework.  A subframework should not have the same name as a
8734 framework, a warning will be issued if this is violated.  Currently a
8735 subframework cannot have subframeworks, in the future, the mechanism
8736 may be extended to support this.  The standard frameworks can be found
8737 in @samp{"/System/Library/Frameworks"} and
8738 @samp{"/Library/Frameworks"}.  An example include looks like
8739 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8740 the name of the framework and header.h is found in the
8741 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8742
8743 @item -iframework@var{dir}
8744 @opindex iframework
8745 Like @option{-F} except the directory is a treated as a system
8746 directory.  The main difference between this @option{-iframework} and
8747 @option{-F} is that with @option{-iframework} the compiler does not
8748 warn about constructs contained within header files found via
8749 @var{dir}.  This option is valid only for the C family of languages.
8750
8751 @item -gused
8752 @opindex gused
8753 Emit debugging information for symbols that are used.  For STABS
8754 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8755 This is by default ON@.
8756
8757 @item -gfull
8758 @opindex gfull
8759 Emit debugging information for all symbols and types.
8760
8761 @item -mmacosx-version-min=@var{version}
8762 The earliest version of MacOS X that this executable will run on
8763 is @var{version}.  Typical values of @var{version} include @code{10.1},
8764 @code{10.2}, and @code{10.3.9}.
8765
8766 The default for this option is to make choices that seem to be most
8767 useful.
8768
8769 @item -mkernel
8770 @opindex mkernel
8771 Enable kernel development mode.  The @option{-mkernel} option sets
8772 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8773 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8774 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8775 applicable.  This mode also sets @option{-mno-altivec},
8776 @option{-msoft-float}, @option{-fno-builtin} and
8777 @option{-mlong-branch} for PowerPC targets.
8778
8779 @item -mone-byte-bool
8780 @opindex mone-byte-bool
8781 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8782 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8783 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8784 option has no effect on x86.
8785
8786 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8787 to generate code that is not binary compatible with code generated
8788 without that switch.  Using this switch may require recompiling all
8789 other modules in a program, including system libraries.  Use this
8790 switch to conform to a non-default data model.
8791
8792 @item -mfix-and-continue
8793 @itemx -ffix-and-continue
8794 @itemx -findirect-data
8795 @opindex mfix-and-continue
8796 @opindex ffix-and-continue
8797 @opindex findirect-data
8798 Generate code suitable for fast turn around development.  Needed to
8799 enable gdb to dynamically load @code{.o} files into already running
8800 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8801 are provided for backwards compatibility.
8802
8803 @item -all_load
8804 @opindex all_load
8805 Loads all members of static archive libraries.
8806 See man ld(1) for more information.
8807
8808 @item -arch_errors_fatal
8809 @opindex arch_errors_fatal
8810 Cause the errors having to do with files that have the wrong architecture
8811 to be fatal.
8812
8813 @item -bind_at_load
8814 @opindex bind_at_load
8815 Causes the output file to be marked such that the dynamic linker will
8816 bind all undefined references when the file is loaded or launched.
8817
8818 @item -bundle
8819 @opindex bundle
8820 Produce a Mach-o bundle format file.
8821 See man ld(1) for more information.
8822
8823 @item -bundle_loader @var{executable}
8824 @opindex bundle_loader
8825 This option specifies the @var{executable} that will be loading the build
8826 output file being linked.  See man ld(1) for more information.
8827
8828 @item -dynamiclib
8829 @opindex dynamiclib
8830 When passed this option, GCC will produce a dynamic library instead of
8831 an executable when linking, using the Darwin @file{libtool} command.
8832
8833 @item -force_cpusubtype_ALL
8834 @opindex force_cpusubtype_ALL
8835 This causes GCC's output file to have the @var{ALL} subtype, instead of
8836 one controlled by the @option{-mcpu} or @option{-march} option.
8837
8838 @item -allowable_client  @var{client_name}
8839 @itemx -client_name
8840 @itemx -compatibility_version
8841 @itemx -current_version
8842 @itemx -dead_strip
8843 @itemx -dependency-file
8844 @itemx -dylib_file
8845 @itemx -dylinker_install_name
8846 @itemx -dynamic
8847 @itemx -exported_symbols_list
8848 @itemx -filelist
8849 @itemx -flat_namespace
8850 @itemx -force_flat_namespace
8851 @itemx -headerpad_max_install_names
8852 @itemx -image_base
8853 @itemx -init
8854 @itemx -install_name
8855 @itemx -keep_private_externs
8856 @itemx -multi_module
8857 @itemx -multiply_defined
8858 @itemx -multiply_defined_unused
8859 @itemx -noall_load
8860 @itemx -no_dead_strip_inits_and_terms
8861 @itemx -nofixprebinding
8862 @itemx -nomultidefs
8863 @itemx -noprebind
8864 @itemx -noseglinkedit
8865 @itemx -pagezero_size
8866 @itemx -prebind
8867 @itemx -prebind_all_twolevel_modules
8868 @itemx -private_bundle
8869 @itemx -read_only_relocs
8870 @itemx -sectalign
8871 @itemx -sectobjectsymbols
8872 @itemx -whyload
8873 @itemx -seg1addr
8874 @itemx -sectcreate
8875 @itemx -sectobjectsymbols
8876 @itemx -sectorder
8877 @itemx -segaddr
8878 @itemx -segs_read_only_addr
8879 @itemx -segs_read_write_addr
8880 @itemx -seg_addr_table
8881 @itemx -seg_addr_table_filename
8882 @itemx -seglinkedit
8883 @itemx -segprot
8884 @itemx -segs_read_only_addr
8885 @itemx -segs_read_write_addr
8886 @itemx -single_module
8887 @itemx -static
8888 @itemx -sub_library
8889 @itemx -sub_umbrella
8890 @itemx -twolevel_namespace
8891 @itemx -umbrella
8892 @itemx -undefined
8893 @itemx -unexported_symbols_list
8894 @itemx -weak_reference_mismatches
8895 @itemx -whatsloaded
8896
8897 @opindex allowable_client
8898 @opindex client_name
8899 @opindex compatibility_version
8900 @opindex current_version
8901 @opindex dead_strip
8902 @opindex dependency-file
8903 @opindex dylib_file
8904 @opindex dylinker_install_name
8905 @opindex dynamic
8906 @opindex exported_symbols_list
8907 @opindex filelist
8908 @opindex flat_namespace
8909 @opindex force_flat_namespace
8910 @opindex headerpad_max_install_names
8911 @opindex image_base
8912 @opindex init
8913 @opindex install_name
8914 @opindex keep_private_externs
8915 @opindex multi_module
8916 @opindex multiply_defined
8917 @opindex multiply_defined_unused
8918 @opindex noall_load
8919 @opindex no_dead_strip_inits_and_terms
8920 @opindex nofixprebinding
8921 @opindex nomultidefs
8922 @opindex noprebind
8923 @opindex noseglinkedit
8924 @opindex pagezero_size
8925 @opindex prebind
8926 @opindex prebind_all_twolevel_modules
8927 @opindex private_bundle
8928 @opindex read_only_relocs
8929 @opindex sectalign
8930 @opindex sectobjectsymbols
8931 @opindex whyload
8932 @opindex seg1addr
8933 @opindex sectcreate
8934 @opindex sectobjectsymbols
8935 @opindex sectorder
8936 @opindex segaddr
8937 @opindex segs_read_only_addr
8938 @opindex segs_read_write_addr
8939 @opindex seg_addr_table
8940 @opindex seg_addr_table_filename
8941 @opindex seglinkedit
8942 @opindex segprot
8943 @opindex segs_read_only_addr
8944 @opindex segs_read_write_addr
8945 @opindex single_module
8946 @opindex static
8947 @opindex sub_library
8948 @opindex sub_umbrella
8949 @opindex twolevel_namespace
8950 @opindex umbrella
8951 @opindex undefined
8952 @opindex unexported_symbols_list
8953 @opindex weak_reference_mismatches
8954 @opindex whatsloaded
8955
8956 These options are passed to the Darwin linker.  The Darwin linker man page
8957 describes them in detail.
8958 @end table
8959
8960 @node DEC Alpha Options
8961 @subsection DEC Alpha Options
8962
8963 These @samp{-m} options are defined for the DEC Alpha implementations:
8964
8965 @table @gcctabopt
8966 @item -mno-soft-float
8967 @itemx -msoft-float
8968 @opindex mno-soft-float
8969 @opindex msoft-float
8970 Use (do not use) the hardware floating-point instructions for
8971 floating-point operations.  When @option{-msoft-float} is specified,
8972 functions in @file{libgcc.a} will be used to perform floating-point
8973 operations.  Unless they are replaced by routines that emulate the
8974 floating-point operations, or compiled in such a way as to call such
8975 emulations routines, these routines will issue floating-point
8976 operations.   If you are compiling for an Alpha without floating-point
8977 operations, you must ensure that the library is built so as not to call
8978 them.
8979
8980 Note that Alpha implementations without floating-point operations are
8981 required to have floating-point registers.
8982
8983 @item -mfp-reg
8984 @itemx -mno-fp-regs
8985 @opindex mfp-reg
8986 @opindex mno-fp-regs
8987 Generate code that uses (does not use) the floating-point register set.
8988 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8989 register set is not used, floating point operands are passed in integer
8990 registers as if they were integers and floating-point results are passed
8991 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8992 so any function with a floating-point argument or return value called by code
8993 compiled with @option{-mno-fp-regs} must also be compiled with that
8994 option.
8995
8996 A typical use of this option is building a kernel that does not use,
8997 and hence need not save and restore, any floating-point registers.
8998
8999 @item -mieee
9000 @opindex mieee
9001 The Alpha architecture implements floating-point hardware optimized for
9002 maximum performance.  It is mostly compliant with the IEEE floating
9003 point standard.  However, for full compliance, software assistance is
9004 required.  This option generates code fully IEEE compliant code
9005 @emph{except} that the @var{inexact-flag} is not maintained (see below).
9006 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
9007 defined during compilation.  The resulting code is less efficient but is
9008 able to correctly support denormalized numbers and exceptional IEEE
9009 values such as not-a-number and plus/minus infinity.  Other Alpha
9010 compilers call this option @option{-ieee_with_no_inexact}.
9011
9012 @item -mieee-with-inexact
9013 @opindex mieee-with-inexact
9014 This is like @option{-mieee} except the generated code also maintains
9015 the IEEE @var{inexact-flag}.  Turning on this option causes the
9016 generated code to implement fully-compliant IEEE math.  In addition to
9017 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
9018 macro.  On some Alpha implementations the resulting code may execute
9019 significantly slower than the code generated by default.  Since there is
9020 very little code that depends on the @var{inexact-flag}, you should
9021 normally not specify this option.  Other Alpha compilers call this
9022 option @option{-ieee_with_inexact}.
9023
9024 @item -mfp-trap-mode=@var{trap-mode}
9025 @opindex mfp-trap-mode
9026 This option controls what floating-point related traps are enabled.
9027 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
9028 The trap mode can be set to one of four values:
9029
9030 @table @samp
9031 @item n
9032 This is the default (normal) setting.  The only traps that are enabled
9033 are the ones that cannot be disabled in software (e.g., division by zero
9034 trap).
9035
9036 @item u
9037 In addition to the traps enabled by @samp{n}, underflow traps are enabled
9038 as well.
9039
9040 @item su
9041 Like @samp{u}, but the instructions are marked to be safe for software
9042 completion (see Alpha architecture manual for details).
9043
9044 @item sui
9045 Like @samp{su}, but inexact traps are enabled as well.
9046 @end table
9047
9048 @item -mfp-rounding-mode=@var{rounding-mode}
9049 @opindex mfp-rounding-mode
9050 Selects the IEEE rounding mode.  Other Alpha compilers call this option
9051 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
9052 of:
9053
9054 @table @samp
9055 @item n
9056 Normal IEEE rounding mode.  Floating point numbers are rounded towards
9057 the nearest machine number or towards the even machine number in case
9058 of a tie.
9059
9060 @item m
9061 Round towards minus infinity.
9062
9063 @item c
9064 Chopped rounding mode.  Floating point numbers are rounded towards zero.
9065
9066 @item d
9067 Dynamic rounding mode.  A field in the floating point control register
9068 (@var{fpcr}, see Alpha architecture reference manual) controls the
9069 rounding mode in effect.  The C library initializes this register for
9070 rounding towards plus infinity.  Thus, unless your program modifies the
9071 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
9072 @end table
9073
9074 @item -mtrap-precision=@var{trap-precision}
9075 @opindex mtrap-precision
9076 In the Alpha architecture, floating point traps are imprecise.  This
9077 means without software assistance it is impossible to recover from a
9078 floating trap and program execution normally needs to be terminated.
9079 GCC can generate code that can assist operating system trap handlers
9080 in determining the exact location that caused a floating point trap.
9081 Depending on the requirements of an application, different levels of
9082 precisions can be selected:
9083
9084 @table @samp
9085 @item p
9086 Program precision.  This option is the default and means a trap handler
9087 can only identify which program caused a floating point exception.
9088
9089 @item f
9090 Function precision.  The trap handler can determine the function that
9091 caused a floating point exception.
9092
9093 @item i
9094 Instruction precision.  The trap handler can determine the exact
9095 instruction that caused a floating point exception.
9096 @end table
9097
9098 Other Alpha compilers provide the equivalent options called
9099 @option{-scope_safe} and @option{-resumption_safe}.
9100
9101 @item -mieee-conformant
9102 @opindex mieee-conformant
9103 This option marks the generated code as IEEE conformant.  You must not
9104 use this option unless you also specify @option{-mtrap-precision=i} and either
9105 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
9106 is to emit the line @samp{.eflag 48} in the function prologue of the
9107 generated assembly file.  Under DEC Unix, this has the effect that
9108 IEEE-conformant math library routines will be linked in.
9109
9110 @item -mbuild-constants
9111 @opindex mbuild-constants
9112 Normally GCC examines a 32- or 64-bit integer constant to
9113 see if it can construct it from smaller constants in two or three
9114 instructions.  If it cannot, it will output the constant as a literal and
9115 generate code to load it from the data segment at runtime.
9116
9117 Use this option to require GCC to construct @emph{all} integer constants
9118 using code, even if it takes more instructions (the maximum is six).
9119
9120 You would typically use this option to build a shared library dynamic
9121 loader.  Itself a shared library, it must relocate itself in memory
9122 before it can find the variables and constants in its own data segment.
9123
9124 @item -malpha-as
9125 @itemx -mgas
9126 @opindex malpha-as
9127 @opindex mgas
9128 Select whether to generate code to be assembled by the vendor-supplied
9129 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
9130
9131 @item -mbwx
9132 @itemx -mno-bwx
9133 @itemx -mcix
9134 @itemx -mno-cix
9135 @itemx -mfix
9136 @itemx -mno-fix
9137 @itemx -mmax
9138 @itemx -mno-max
9139 @opindex mbwx
9140 @opindex mno-bwx
9141 @opindex mcix
9142 @opindex mno-cix
9143 @opindex mfix
9144 @opindex mno-fix
9145 @opindex mmax
9146 @opindex mno-max
9147 Indicate whether GCC should generate code to use the optional BWX,
9148 CIX, FIX and MAX instruction sets.  The default is to use the instruction
9149 sets supported by the CPU type specified via @option{-mcpu=} option or that
9150 of the CPU on which GCC was built if none was specified.
9151
9152 @item -mfloat-vax
9153 @itemx -mfloat-ieee
9154 @opindex mfloat-vax
9155 @opindex mfloat-ieee
9156 Generate code that uses (does not use) VAX F and G floating point
9157 arithmetic instead of IEEE single and double precision.
9158
9159 @item -mexplicit-relocs
9160 @itemx -mno-explicit-relocs
9161 @opindex mexplicit-relocs
9162 @opindex mno-explicit-relocs
9163 Older Alpha assemblers provided no way to generate symbol relocations
9164 except via assembler macros.  Use of these macros does not allow
9165 optimal instruction scheduling.  GNU binutils as of version 2.12
9166 supports a new syntax that allows the compiler to explicitly mark
9167 which relocations should apply to which instructions.  This option
9168 is mostly useful for debugging, as GCC detects the capabilities of
9169 the assembler when it is built and sets the default accordingly.
9170
9171 @item -msmall-data
9172 @itemx -mlarge-data
9173 @opindex msmall-data
9174 @opindex mlarge-data
9175 When @option{-mexplicit-relocs} is in effect, static data is
9176 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9177 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9178 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9179 16-bit relocations off of the @code{$gp} register.  This limits the
9180 size of the small data area to 64KB, but allows the variables to be
9181 directly accessed via a single instruction.
9182
9183 The default is @option{-mlarge-data}.  With this option the data area
9184 is limited to just below 2GB@.  Programs that require more than 2GB of
9185 data must use @code{malloc} or @code{mmap} to allocate the data in the
9186 heap instead of in the program's data segment.
9187
9188 When generating code for shared libraries, @option{-fpic} implies
9189 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9190
9191 @item -msmall-text
9192 @itemx -mlarge-text
9193 @opindex msmall-text
9194 @opindex mlarge-text
9195 When @option{-msmall-text} is used, the compiler assumes that the
9196 code of the entire program (or shared library) fits in 4MB, and is
9197 thus reachable with a branch instruction.  When @option{-msmall-data}
9198 is used, the compiler can assume that all local symbols share the
9199 same @code{$gp} value, and thus reduce the number of instructions
9200 required for a function call from 4 to 1.
9201
9202 The default is @option{-mlarge-text}.
9203
9204 @item -mcpu=@var{cpu_type}
9205 @opindex mcpu
9206 Set the instruction set and instruction scheduling parameters for
9207 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9208 style name or the corresponding chip number.  GCC supports scheduling
9209 parameters for the EV4, EV5 and EV6 family of processors and will
9210 choose the default values for the instruction set from the processor
9211 you specify.  If you do not specify a processor type, GCC will default
9212 to the processor on which the compiler was built.
9213
9214 Supported values for @var{cpu_type} are
9215
9216 @table @samp
9217 @item ev4
9218 @itemx ev45
9219 @itemx 21064
9220 Schedules as an EV4 and has no instruction set extensions.
9221
9222 @item ev5
9223 @itemx 21164
9224 Schedules as an EV5 and has no instruction set extensions.
9225
9226 @item ev56
9227 @itemx 21164a
9228 Schedules as an EV5 and supports the BWX extension.
9229
9230 @item pca56
9231 @itemx 21164pc
9232 @itemx 21164PC
9233 Schedules as an EV5 and supports the BWX and MAX extensions.
9234
9235 @item ev6
9236 @itemx 21264
9237 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9238
9239 @item ev67
9240 @itemx 21264a
9241 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9242 @end table
9243
9244 @item -mtune=@var{cpu_type}
9245 @opindex mtune
9246 Set only the instruction scheduling parameters for machine type
9247 @var{cpu_type}.  The instruction set is not changed.
9248
9249 @item -mmemory-latency=@var{time}
9250 @opindex mmemory-latency
9251 Sets the latency the scheduler should assume for typical memory
9252 references as seen by the application.  This number is highly
9253 dependent on the memory access patterns used by the application
9254 and the size of the external cache on the machine.
9255
9256 Valid options for @var{time} are
9257
9258 @table @samp
9259 @item @var{number}
9260 A decimal number representing clock cycles.
9261
9262 @item L1
9263 @itemx L2
9264 @itemx L3
9265 @itemx main
9266 The compiler contains estimates of the number of clock cycles for
9267 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9268 (also called Dcache, Scache, and Bcache), as well as to main memory.
9269 Note that L3 is only valid for EV5.
9270
9271 @end table
9272 @end table
9273
9274 @node DEC Alpha/VMS Options
9275 @subsection DEC Alpha/VMS Options
9276
9277 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9278
9279 @table @gcctabopt
9280 @item -mvms-return-codes
9281 @opindex mvms-return-codes
9282 Return VMS condition codes from main.  The default is to return POSIX
9283 style condition (e.g.@ error) codes.
9284 @end table
9285
9286 @node FRV Options
9287 @subsection FRV Options
9288 @cindex FRV Options
9289
9290 @table @gcctabopt
9291 @item -mgpr-32
9292 @opindex mgpr-32
9293
9294 Only use the first 32 general purpose registers.
9295
9296 @item -mgpr-64
9297 @opindex mgpr-64
9298
9299 Use all 64 general purpose registers.
9300
9301 @item -mfpr-32
9302 @opindex mfpr-32
9303
9304 Use only the first 32 floating point registers.
9305
9306 @item -mfpr-64
9307 @opindex mfpr-64
9308
9309 Use all 64 floating point registers
9310
9311 @item -mhard-float
9312 @opindex mhard-float
9313
9314 Use hardware instructions for floating point operations.
9315
9316 @item -msoft-float
9317 @opindex msoft-float
9318
9319 Use library routines for floating point operations.
9320
9321 @item -malloc-cc
9322 @opindex malloc-cc
9323
9324 Dynamically allocate condition code registers.
9325
9326 @item -mfixed-cc
9327 @opindex mfixed-cc
9328
9329 Do not try to dynamically allocate condition code registers, only
9330 use @code{icc0} and @code{fcc0}.
9331
9332 @item -mdword
9333 @opindex mdword
9334
9335 Change ABI to use double word insns.
9336
9337 @item -mno-dword
9338 @opindex mno-dword
9339
9340 Do not use double word instructions.
9341
9342 @item -mdouble
9343 @opindex mdouble
9344
9345 Use floating point double instructions.
9346
9347 @item -mno-double
9348 @opindex mno-double
9349
9350 Do not use floating point double instructions.
9351
9352 @item -mmedia
9353 @opindex mmedia
9354
9355 Use media instructions.
9356
9357 @item -mno-media
9358 @opindex mno-media
9359
9360 Do not use media instructions.
9361
9362 @item -mmuladd
9363 @opindex mmuladd
9364
9365 Use multiply and add/subtract instructions.
9366
9367 @item -mno-muladd
9368 @opindex mno-muladd
9369
9370 Do not use multiply and add/subtract instructions.
9371
9372 @item -mfdpic
9373 @opindex mfdpic
9374
9375 Select the FDPIC ABI, that uses function descriptors to represent
9376 pointers to functions.  Without any PIC/PIE-related options, it
9377 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
9378 assumes GOT entries and small data are within a 12-bit range from the
9379 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
9380 are computed with 32 bits.
9381
9382 @item -minline-plt
9383 @opindex minline-plt
9384
9385 Enable inlining of PLT entries in function calls to functions that are
9386 not known to bind locally.  It has no effect without @option{-mfdpic}.
9387 It's enabled by default if optimizing for speed and compiling for
9388 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
9389 optimization option such as @option{-O3} or above is present in the
9390 command line.
9391
9392 @item -mTLS
9393 @opindex TLS
9394
9395 Assume a large TLS segment when generating thread-local code.
9396
9397 @item -mtls
9398 @opindex tls
9399
9400 Do not assume a large TLS segment when generating thread-local code.
9401
9402 @item -mgprel-ro
9403 @opindex mgprel-ro
9404
9405 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
9406 that is known to be in read-only sections.  It's enabled by default,
9407 except for @option{-fpic} or @option{-fpie}: even though it may help
9408 make the global offset table smaller, it trades 1 instruction for 4.
9409 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
9410 one of which may be shared by multiple symbols, and it avoids the need
9411 for a GOT entry for the referenced symbol, so it's more likely to be a
9412 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
9413
9414 @item -multilib-library-pic
9415 @opindex multilib-library-pic
9416
9417 Link with the (library, not FD) pic libraries.  It's implied by
9418 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
9419 @option{-fpic} without @option{-mfdpic}.  You should never have to use
9420 it explicitly.
9421
9422 @item -mlinked-fp
9423 @opindex mlinked-fp
9424
9425 Follow the EABI requirement of always creating a frame pointer whenever
9426 a stack frame is allocated.  This option is enabled by default and can
9427 be disabled with @option{-mno-linked-fp}.
9428
9429 @item -mlong-calls
9430 @opindex mlong-calls
9431
9432 Use indirect addressing to call functions outside the current
9433 compilation unit.  This allows the functions to be placed anywhere
9434 within the 32-bit address space.
9435
9436 @item -malign-labels
9437 @opindex malign-labels
9438
9439 Try to align labels to an 8-byte boundary by inserting nops into the
9440 previous packet.  This option only has an effect when VLIW packing
9441 is enabled.  It doesn't create new packets; it merely adds nops to
9442 existing ones.
9443
9444 @item -mlibrary-pic
9445 @opindex mlibrary-pic
9446
9447 Generate position-independent EABI code.
9448
9449 @item -macc-4
9450 @opindex macc-4
9451
9452 Use only the first four media accumulator registers.
9453
9454 @item -macc-8
9455 @opindex macc-8
9456
9457 Use all eight media accumulator registers.
9458
9459 @item -mpack
9460 @opindex mpack
9461
9462 Pack VLIW instructions.
9463
9464 @item -mno-pack
9465 @opindex mno-pack
9466
9467 Do not pack VLIW instructions.
9468
9469 @item -mno-eflags
9470 @opindex mno-eflags
9471
9472 Do not mark ABI switches in e_flags.
9473
9474 @item -mcond-move
9475 @opindex mcond-move
9476
9477 Enable the use of conditional-move instructions (default).
9478
9479 This switch is mainly for debugging the compiler and will likely be removed
9480 in a future version.
9481
9482 @item -mno-cond-move
9483 @opindex mno-cond-move
9484
9485 Disable the use of conditional-move instructions.
9486
9487 This switch is mainly for debugging the compiler and will likely be removed
9488 in a future version.
9489
9490 @item -mscc
9491 @opindex mscc
9492
9493 Enable the use of conditional set instructions (default).
9494
9495 This switch is mainly for debugging the compiler and will likely be removed
9496 in a future version.
9497
9498 @item -mno-scc
9499 @opindex mno-scc
9500
9501 Disable the use of conditional set instructions.
9502
9503 This switch is mainly for debugging the compiler and will likely be removed
9504 in a future version.
9505
9506 @item -mcond-exec
9507 @opindex mcond-exec
9508
9509 Enable the use of conditional execution (default).
9510
9511 This switch is mainly for debugging the compiler and will likely be removed
9512 in a future version.
9513
9514 @item -mno-cond-exec
9515 @opindex mno-cond-exec
9516
9517 Disable the use of conditional execution.
9518
9519 This switch is mainly for debugging the compiler and will likely be removed
9520 in a future version.
9521
9522 @item -mvliw-branch
9523 @opindex mvliw-branch
9524
9525 Run a pass to pack branches into VLIW instructions (default).
9526
9527 This switch is mainly for debugging the compiler and will likely be removed
9528 in a future version.
9529
9530 @item -mno-vliw-branch
9531 @opindex mno-vliw-branch
9532
9533 Do not run a pass to pack branches into VLIW instructions.
9534
9535 This switch is mainly for debugging the compiler and will likely be removed
9536 in a future version.
9537
9538 @item -mmulti-cond-exec
9539 @opindex mmulti-cond-exec
9540
9541 Enable optimization of @code{&&} and @code{||} in conditional execution
9542 (default).
9543
9544 This switch is mainly for debugging the compiler and will likely be removed
9545 in a future version.
9546
9547 @item -mno-multi-cond-exec
9548 @opindex mno-multi-cond-exec
9549
9550 Disable optimization of @code{&&} and @code{||} in conditional execution.
9551
9552 This switch is mainly for debugging the compiler and will likely be removed
9553 in a future version.
9554
9555 @item -mnested-cond-exec
9556 @opindex mnested-cond-exec
9557
9558 Enable nested conditional execution optimizations (default).
9559
9560 This switch is mainly for debugging the compiler and will likely be removed
9561 in a future version.
9562
9563 @item -mno-nested-cond-exec
9564 @opindex mno-nested-cond-exec
9565
9566 Disable nested conditional execution optimizations.
9567
9568 This switch is mainly for debugging the compiler and will likely be removed
9569 in a future version.
9570
9571 @item -moptimize-membar
9572 @opindex moptimize-membar
9573
9574 This switch removes redundant @code{membar} instructions from the
9575 compiler generated code.  It is enabled by default.
9576
9577 @item -mno-optimize-membar
9578 @opindex mno-optimize-membar
9579
9580 This switch disables the automatic removal of redundant @code{membar}
9581 instructions from the generated code.
9582
9583 @item -mtomcat-stats
9584 @opindex mtomcat-stats
9585
9586 Cause gas to print out tomcat statistics.
9587
9588 @item -mcpu=@var{cpu}
9589 @opindex mcpu
9590
9591 Select the processor type for which to generate code.  Possible values are
9592 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9593 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9594
9595 @end table
9596
9597 @node GNU/Linux Options
9598 @subsection GNU/Linux Options
9599
9600 These @samp{-m} options are defined for GNU/Linux targets:
9601
9602 @table @gcctabopt
9603 @item -mglibc
9604 @opindex mglibc
9605 Use the GNU C library instead of uClibc.  This is the default except
9606 on @samp{*-*-linux-*uclibc*} targets.
9607
9608 @item -muclibc
9609 @opindex muclibc
9610 Use uClibc instead of the GNU C library.  This is the default on
9611 @samp{*-*-linux-*uclibc*} targets.
9612 @end table
9613
9614 @node H8/300 Options
9615 @subsection H8/300 Options
9616
9617 These @samp{-m} options are defined for the H8/300 implementations:
9618
9619 @table @gcctabopt
9620 @item -mrelax
9621 @opindex mrelax
9622 Shorten some address references at link time, when possible; uses the
9623 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9624 ld, Using ld}, for a fuller description.
9625
9626 @item -mh
9627 @opindex mh
9628 Generate code for the H8/300H@.
9629
9630 @item -ms
9631 @opindex ms
9632 Generate code for the H8S@.
9633
9634 @item -mn
9635 @opindex mn
9636 Generate code for the H8S and H8/300H in the normal mode.  This switch
9637 must be used either with @option{-mh} or @option{-ms}.
9638
9639 @item -ms2600
9640 @opindex ms2600
9641 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9642
9643 @item -mint32
9644 @opindex mint32
9645 Make @code{int} data 32 bits by default.
9646
9647 @item -malign-300
9648 @opindex malign-300
9649 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9650 The default for the H8/300H and H8S is to align longs and floats on 4
9651 byte boundaries.
9652 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9653 This option has no effect on the H8/300.
9654 @end table
9655
9656 @node HPPA Options
9657 @subsection HPPA Options
9658 @cindex HPPA Options
9659
9660 These @samp{-m} options are defined for the HPPA family of computers:
9661
9662 @table @gcctabopt
9663 @item -march=@var{architecture-type}
9664 @opindex march
9665 Generate code for the specified architecture.  The choices for
9666 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9667 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9668 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9669 architecture option for your machine.  Code compiled for lower numbered
9670 architectures will run on higher numbered architectures, but not the
9671 other way around.
9672
9673 @item -mpa-risc-1-0
9674 @itemx -mpa-risc-1-1
9675 @itemx -mpa-risc-2-0
9676 @opindex mpa-risc-1-0
9677 @opindex mpa-risc-1-1
9678 @opindex mpa-risc-2-0
9679 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9680
9681 @item -mbig-switch
9682 @opindex mbig-switch
9683 Generate code suitable for big switch tables.  Use this option only if
9684 the assembler/linker complain about out of range branches within a switch
9685 table.
9686
9687 @item -mjump-in-delay
9688 @opindex mjump-in-delay
9689 Fill delay slots of function calls with unconditional jump instructions
9690 by modifying the return pointer for the function call to be the target
9691 of the conditional jump.
9692
9693 @item -mdisable-fpregs
9694 @opindex mdisable-fpregs
9695 Prevent floating point registers from being used in any manner.  This is
9696 necessary for compiling kernels which perform lazy context switching of
9697 floating point registers.  If you use this option and attempt to perform
9698 floating point operations, the compiler will abort.
9699
9700 @item -mdisable-indexing
9701 @opindex mdisable-indexing
9702 Prevent the compiler from using indexing address modes.  This avoids some
9703 rather obscure problems when compiling MIG generated code under MACH@.
9704
9705 @item -mno-space-regs
9706 @opindex mno-space-regs
9707 Generate code that assumes the target has no space registers.  This allows
9708 GCC to generate faster indirect calls and use unscaled index address modes.
9709
9710 Such code is suitable for level 0 PA systems and kernels.
9711
9712 @item -mfast-indirect-calls
9713 @opindex mfast-indirect-calls
9714 Generate code that assumes calls never cross space boundaries.  This
9715 allows GCC to emit code which performs faster indirect calls.
9716
9717 This option will not work in the presence of shared libraries or nested
9718 functions.
9719
9720 @item -mfixed-range=@var{register-range}
9721 @opindex mfixed-range
9722 Generate code treating the given register range as fixed registers.
9723 A fixed register is one that the register allocator can not use.  This is
9724 useful when compiling kernel code.  A register range is specified as
9725 two registers separated by a dash.  Multiple register ranges can be
9726 specified separated by a comma.
9727
9728 @item -mlong-load-store
9729 @opindex mlong-load-store
9730 Generate 3-instruction load and store sequences as sometimes required by
9731 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9732 the HP compilers.
9733
9734 @item -mportable-runtime
9735 @opindex mportable-runtime
9736 Use the portable calling conventions proposed by HP for ELF systems.
9737
9738 @item -mgas
9739 @opindex mgas
9740 Enable the use of assembler directives only GAS understands.
9741
9742 @item -mschedule=@var{cpu-type}
9743 @opindex mschedule
9744 Schedule code according to the constraints for the machine type
9745 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9746 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9747 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9748 proper scheduling option for your machine.  The default scheduling is
9749 @samp{8000}.
9750
9751 @item -mlinker-opt
9752 @opindex mlinker-opt
9753 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9754 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9755 linkers in which they give bogus error messages when linking some programs.
9756
9757 @item -msoft-float
9758 @opindex msoft-float
9759 Generate output containing library calls for floating point.
9760 @strong{Warning:} the requisite libraries are not available for all HPPA
9761 targets.  Normally the facilities of the machine's usual C compiler are
9762 used, but this cannot be done directly in cross-compilation.  You must make
9763 your own arrangements to provide suitable library functions for
9764 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9765 does provide software floating point support.
9766
9767 @option{-msoft-float} changes the calling convention in the output file;
9768 therefore, it is only useful if you compile @emph{all} of a program with
9769 this option.  In particular, you need to compile @file{libgcc.a}, the
9770 library that comes with GCC, with @option{-msoft-float} in order for
9771 this to work.
9772
9773 @item -msio
9774 @opindex msio
9775 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9776 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9777 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9778 options are available under HP-UX and HI-UX@.
9779
9780 @item -mgnu-ld
9781 @opindex gnu-ld
9782 Use GNU ld specific options.  This passes @option{-shared} to ld when
9783 building a shared library.  It is the default when GCC is configured,
9784 explicitly or implicitly, with the GNU linker.  This option does not
9785 have any affect on which ld is called, it only changes what parameters
9786 are passed to that ld.  The ld that is called is determined by the
9787 @option{--with-ld} configure option, GCC's program search path, and
9788 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9789 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9790 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9791
9792 @item -mhp-ld
9793 @opindex hp-ld
9794 Use HP ld specific options.  This passes @option{-b} to ld when building
9795 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9796 links.  It is the default when GCC is configured, explicitly or
9797 implicitly, with the HP linker.  This option does not have any affect on
9798 which ld is called, it only changes what parameters are passed to that
9799 ld.  The ld that is called is determined by the @option{--with-ld}
9800 configure option, GCC's program search path, and finally by the user's
9801 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9802 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9803 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9804
9805 @item -mlong-calls
9806 @opindex mno-long-calls
9807 Generate code that uses long call sequences.  This ensures that a call
9808 is always able to reach linker generated stubs.  The default is to generate
9809 long calls only when the distance from the call site to the beginning
9810 of the function or translation unit, as the case may be, exceeds a
9811 predefined limit set by the branch type being used.  The limits for
9812 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9813 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9814 240,000 bytes.
9815
9816 Distances are measured from the beginning of functions when using the
9817 @option{-ffunction-sections} option, or when using the @option{-mgas}
9818 and @option{-mno-portable-runtime} options together under HP-UX with
9819 the SOM linker.
9820
9821 It is normally not desirable to use this option as it will degrade
9822 performance.  However, it may be useful in large applications,
9823 particularly when partial linking is used to build the application.
9824
9825 The types of long calls used depends on the capabilities of the
9826 assembler and linker, and the type of code being generated.  The
9827 impact on systems that support long absolute calls, and long pic
9828 symbol-difference or pc-relative calls should be relatively small.
9829 However, an indirect call is used on 32-bit ELF systems in pic code
9830 and it is quite long.
9831
9832 @item -munix=@var{unix-std}
9833 @opindex march
9834 Generate compiler predefines and select a startfile for the specified
9835 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9836 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9837 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9838 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9839 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9840 and later.
9841
9842 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9843 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9844 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9845 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9846 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9847 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9848
9849 It is @emph{important} to note that this option changes the interfaces
9850 for various library routines.  It also affects the operational behavior
9851 of the C library.  Thus, @emph{extreme} care is needed in using this
9852 option.
9853
9854 Library code that is intended to operate with more than one UNIX
9855 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9856 as appropriate.  Most GNU software doesn't provide this capability.
9857
9858 @item -nolibdld
9859 @opindex nolibdld
9860 Suppress the generation of link options to search libdld.sl when the
9861 @option{-static} option is specified on HP-UX 10 and later.
9862
9863 @item -static
9864 @opindex static
9865 The HP-UX implementation of setlocale in libc has a dependency on
9866 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9867 when the @option{-static} option is specified, special link options
9868 are needed to resolve this dependency.
9869
9870 On HP-UX 10 and later, the GCC driver adds the necessary options to
9871 link with libdld.sl when the @option{-static} option is specified.
9872 This causes the resulting binary to be dynamic.  On the 64-bit port,
9873 the linkers generate dynamic binaries by default in any case.  The
9874 @option{-nolibdld} option can be used to prevent the GCC driver from
9875 adding these link options.
9876
9877 @item -threads
9878 @opindex threads
9879 Add support for multithreading with the @dfn{dce thread} library
9880 under HP-UX@.  This option sets flags for both the preprocessor and
9881 linker.
9882 @end table
9883
9884 @node i386 and x86-64 Options
9885 @subsection Intel 386 and AMD x86-64 Options
9886 @cindex i386 Options
9887 @cindex x86-64 Options
9888 @cindex Intel 386 Options
9889 @cindex AMD x86-64 Options
9890
9891 These @samp{-m} options are defined for the i386 and x86-64 family of
9892 computers:
9893
9894 @table @gcctabopt
9895 @item -mtune=@var{cpu-type}
9896 @opindex mtune
9897 Tune to @var{cpu-type} everything applicable about the generated code, except
9898 for the ABI and the set of available instructions.  The choices for
9899 @var{cpu-type} are:
9900 @table @emph
9901 @item generic
9902 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9903 If you know the CPU on which your code will run, then you should use
9904 the corresponding @option{-mtune} option instead of
9905 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9906 of your application will have, then you should use this option.
9907
9908 As new processors are deployed in the marketplace, the behavior of this
9909 option will change.  Therefore, if you upgrade to a newer version of
9910 GCC, the code generated option will change to reflect the processors
9911 that were most common when that version of GCC was released.
9912
9913 There is no @option{-march=generic} option because @option{-march}
9914 indicates the instruction set the compiler can use, and there is no
9915 generic instruction set applicable to all processors.  In contrast,
9916 @option{-mtune} indicates the processor (or, in this case, collection of
9917 processors) for which the code is optimized.
9918 @item native
9919 This selects the CPU to tune for at compilation time by determining
9920 the processor type of the compiling machine.  Using @option{-mtune=native}
9921 will produce code optimized for the local machine under the constraints
9922 of the selected instruction set.  Using @option{-march=native} will
9923 enable all instruction subsets supported by the local machine (hence
9924 the result might not run on different machines).
9925 @item i386
9926 Original Intel's i386 CPU@.
9927 @item i486
9928 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9929 @item i586, pentium
9930 Intel Pentium CPU with no MMX support.
9931 @item pentium-mmx
9932 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9933 @item pentiumpro
9934 Intel PentiumPro CPU@.
9935 @item i686
9936 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9937 instruction set will be used, so the code will run on all i686 family chips.
9938 @item pentium2
9939 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9940 @item pentium3, pentium3m
9941 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9942 support.
9943 @item pentium-m
9944 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9945 support.  Used by Centrino notebooks.
9946 @item pentium4, pentium4m
9947 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9948 @item prescott
9949 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9950 set support.
9951 @item nocona
9952 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9953 SSE2 and SSE3 instruction set support.
9954 @item core2
9955 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9956 instruction set support.
9957 @item k6
9958 AMD K6 CPU with MMX instruction set support.
9959 @item k6-2, k6-3
9960 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9961 @item athlon, athlon-tbird
9962 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9963 support.
9964 @item athlon-4, athlon-xp, athlon-mp
9965 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9966 instruction set support.
9967 @item k8, opteron, athlon64, athlon-fx
9968 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9969 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9970 @item k8-sse3, opteron-sse3, athlon64-sse3
9971 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
9972 @item amdfam10, barcelona
9973 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
9974 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
9975 instruction set extensions.)
9976 @item winchip-c6
9977 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9978 set support.
9979 @item winchip2
9980 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9981 instruction set support.
9982 @item c3
9983 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9984 implemented for this chip.)
9985 @item c3-2
9986 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9987 implemented for this chip.)
9988 @item geode
9989 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9990 @end table
9991
9992 While picking a specific @var{cpu-type} will schedule things appropriately
9993 for that particular chip, the compiler will not generate any code that
9994 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9995 being used.
9996
9997 @item -march=@var{cpu-type}
9998 @opindex march
9999 Generate instructions for the machine type @var{cpu-type}.  The choices
10000 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
10001 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
10002
10003 @item -mcpu=@var{cpu-type}
10004 @opindex mcpu
10005 A deprecated synonym for @option{-mtune}.
10006
10007 @item -mfpmath=@var{unit}
10008 @opindex march
10009 Generate floating point arithmetics for selected unit @var{unit}.  The choices
10010 for @var{unit} are:
10011
10012 @table @samp
10013 @item 387
10014 Use the standard 387 floating point coprocessor present majority of chips and
10015 emulated otherwise.  Code compiled with this option will run almost everywhere.
10016 The temporary results are computed in 80bit precision instead of precision
10017 specified by the type resulting in slightly different results compared to most
10018 of other chips.  See @option{-ffloat-store} for more detailed description.
10019
10020 This is the default choice for i386 compiler.
10021
10022 @item sse
10023 Use scalar floating point instructions present in the SSE instruction set.
10024 This instruction set is supported by Pentium3 and newer chips, in the AMD line
10025 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
10026 instruction set supports only single precision arithmetics, thus the double and
10027 extended precision arithmetics is still done using 387.  Later version, present
10028 only in Pentium4 and the future AMD x86-64 chips supports double precision
10029 arithmetics too.
10030
10031 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
10032 or @option{-msse2} switches to enable SSE extensions and make this option
10033 effective.  For the x86-64 compiler, these extensions are enabled by default.
10034
10035 The resulting code should be considerably faster in the majority of cases and avoid
10036 the numerical instability problems of 387 code, but may break some existing
10037 code that expects temporaries to be 80bit.
10038
10039 This is the default choice for the x86-64 compiler.
10040
10041 @item sse,387
10042 Attempt to utilize both instruction sets at once.  This effectively double the
10043 amount of available registers and on chips with separate execution units for
10044 387 and SSE the execution resources too.  Use this option with care, as it is
10045 still experimental, because the GCC register allocator does not model separate
10046 functional units well resulting in instable performance.
10047 @end table
10048
10049 @item -masm=@var{dialect}
10050 @opindex masm=@var{dialect}
10051 Output asm instructions using selected @var{dialect}.  Supported
10052 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
10053 not support @samp{intel}.
10054
10055 @item -mieee-fp
10056 @itemx -mno-ieee-fp
10057 @opindex mieee-fp
10058 @opindex mno-ieee-fp
10059 Control whether or not the compiler uses IEEE floating point
10060 comparisons.  These handle correctly the case where the result of a
10061 comparison is unordered.
10062
10063 @item -msoft-float
10064 @opindex msoft-float
10065 Generate output containing library calls for floating point.
10066 @strong{Warning:} the requisite libraries are not part of GCC@.
10067 Normally the facilities of the machine's usual C compiler are used, but
10068 this can't be done directly in cross-compilation.  You must make your
10069 own arrangements to provide suitable library functions for
10070 cross-compilation.
10071
10072 On machines where a function returns floating point results in the 80387
10073 register stack, some floating point opcodes may be emitted even if
10074 @option{-msoft-float} is used.
10075
10076 @item -mno-fp-ret-in-387
10077 @opindex mno-fp-ret-in-387
10078 Do not use the FPU registers for return values of functions.
10079
10080 The usual calling convention has functions return values of types
10081 @code{float} and @code{double} in an FPU register, even if there
10082 is no FPU@.  The idea is that the operating system should emulate
10083 an FPU@.
10084
10085 The option @option{-mno-fp-ret-in-387} causes such values to be returned
10086 in ordinary CPU registers instead.
10087
10088 @item -mno-fancy-math-387
10089 @opindex mno-fancy-math-387
10090 Some 387 emulators do not support the @code{sin}, @code{cos} and
10091 @code{sqrt} instructions for the 387.  Specify this option to avoid
10092 generating those instructions.  This option is the default on FreeBSD,
10093 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
10094 indicates that the target cpu will always have an FPU and so the
10095 instruction will not need emulation.  As of revision 2.6.1, these
10096 instructions are not generated unless you also use the
10097 @option{-funsafe-math-optimizations} switch.
10098
10099 @item -malign-double
10100 @itemx -mno-align-double
10101 @opindex malign-double
10102 @opindex mno-align-double
10103 Control whether GCC aligns @code{double}, @code{long double}, and
10104 @code{long long} variables on a two word boundary or a one word
10105 boundary.  Aligning @code{double} variables on a two word boundary will
10106 produce code that runs somewhat faster on a @samp{Pentium} at the
10107 expense of more memory.
10108
10109 On x86-64, @option{-malign-double} is enabled by default.
10110
10111 @strong{Warning:} if you use the @option{-malign-double} switch,
10112 structures containing the above types will be aligned differently than
10113 the published application binary interface specifications for the 386
10114 and will not be binary compatible with structures in code compiled
10115 without that switch.
10116
10117 @item -m96bit-long-double
10118 @itemx -m128bit-long-double
10119 @opindex m96bit-long-double
10120 @opindex m128bit-long-double
10121 These switches control the size of @code{long double} type.  The i386
10122 application binary interface specifies the size to be 96 bits,
10123 so @option{-m96bit-long-double} is the default in 32 bit mode.
10124
10125 Modern architectures (Pentium and newer) would prefer @code{long double}
10126 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
10127 conforming to the ABI, this would not be possible.  So specifying a
10128 @option{-m128bit-long-double} will align @code{long double}
10129 to a 16 byte boundary by padding the @code{long double} with an additional
10130 32 bit zero.
10131
10132 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
10133 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
10134
10135 Notice that neither of these options enable any extra precision over the x87
10136 standard of 80 bits for a @code{long double}.
10137
10138 @strong{Warning:} if you override the default value for your target ABI, the
10139 structures and arrays containing @code{long double} variables will change
10140 their size as well as function calling convention for function taking
10141 @code{long double} will be modified.  Hence they will not be binary
10142 compatible with arrays or structures in code compiled without that switch.
10143
10144 @item -mmlarge-data-threshold=@var{number}
10145 @opindex mlarge-data-threshold=@var{number}
10146 When @option{-mcmodel=medium} is specified, the data greater than
10147 @var{threshold} are placed in large data section.  This value must be the
10148 same across all object linked into the binary and defaults to 65535.
10149
10150 @item -mrtd
10151 @opindex mrtd
10152 Use a different function-calling convention, in which functions that
10153 take a fixed number of arguments return with the @code{ret} @var{num}
10154 instruction, which pops their arguments while returning.  This saves one
10155 instruction in the caller since there is no need to pop the arguments
10156 there.
10157
10158 You can specify that an individual function is called with this calling
10159 sequence with the function attribute @samp{stdcall}.  You can also
10160 override the @option{-mrtd} option by using the function attribute
10161 @samp{cdecl}.  @xref{Function Attributes}.
10162
10163 @strong{Warning:} this calling convention is incompatible with the one
10164 normally used on Unix, so you cannot use it if you need to call
10165 libraries compiled with the Unix compiler.
10166
10167 Also, you must provide function prototypes for all functions that
10168 take variable numbers of arguments (including @code{printf});
10169 otherwise incorrect code will be generated for calls to those
10170 functions.
10171
10172 In addition, seriously incorrect code will result if you call a
10173 function with too many arguments.  (Normally, extra arguments are
10174 harmlessly ignored.)
10175
10176 @item -mregparm=@var{num}
10177 @opindex mregparm
10178 Control how many registers are used to pass integer arguments.  By
10179 default, no registers are used to pass arguments, and at most 3
10180 registers can be used.  You can control this behavior for a specific
10181 function by using the function attribute @samp{regparm}.
10182 @xref{Function Attributes}.
10183
10184 @strong{Warning:} if you use this switch, and
10185 @var{num} is nonzero, then you must build all modules with the same
10186 value, including any libraries.  This includes the system libraries and
10187 startup modules.
10188
10189 @item -msseregparm
10190 @opindex msseregparm
10191 Use SSE register passing conventions for float and double arguments
10192 and return values.  You can control this behavior for a specific
10193 function by using the function attribute @samp{sseregparm}.
10194 @xref{Function Attributes}.
10195
10196 @strong{Warning:} if you use this switch then you must build all
10197 modules with the same value, including any libraries.  This includes
10198 the system libraries and startup modules.
10199
10200 @item -mpc32
10201 @itemx -mpc64
10202 @itemx -mpc80
10203 @opindex mpc32
10204 @opindex mpc64
10205 @opindex mpc80
10206
10207 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10208 is specified, the significands of results of floating-point operations are
10209 rounded to 24 bits (single precision); @option{-mpc64} rounds the the
10210 significands of results of floating-point operations to 53 bits (double
10211 precision) and @option{-mpc80} rounds the significands of results of
10212 floating-point operations to 64 bits (extended double precision), which is
10213 the default.  When this option is used, floating-point operations in higher
10214 precisions are not available to the programmer without setting the FPU
10215 control word explicitly.
10216
10217 Setting the rounding of floating-point operations to less than the default
10218 80 bits can speed some programs by 2% or more.  Note that some mathematical
10219 libraries assume that extended precision (80 bit) floating-point operations
10220 are enabled by default; routines in such libraries could suffer significant
10221 loss of accuracy, typically through so-called "catastrophic cancellation",
10222 when this option is used to set the precision to less than extended precision. 
10223
10224 @item -mstackrealign
10225 @opindex mstackrealign
10226 Realign the stack at entry.  On the Intel x86, the
10227 @option{-mstackrealign} option will generate an alternate prologue and
10228 epilogue that realigns the runtime stack.  This supports mixing legacy
10229 codes that keep a 4-byte aligned stack with modern codes that keep a
10230 16-byte stack for SSE compatibility.  The alternate prologue and
10231 epilogue are slower and bigger than the regular ones, and the
10232 alternate prologue requires an extra scratch register; this lowers the
10233 number of registers available if used in conjunction with the
10234 @code{regparm} attribute.  The @option{-mstackrealign} option is
10235 incompatible with the nested function prologue; this is considered a
10236 hard error.  See also the attribute @code{force_align_arg_pointer},
10237 applicable to individual functions.
10238
10239 @item -mpreferred-stack-boundary=@var{num}
10240 @opindex mpreferred-stack-boundary
10241 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10242 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10243 the default is 4 (16 bytes or 128 bits).
10244
10245 On Pentium and PentiumPro, @code{double} and @code{long double} values
10246 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10247 suffer significant run time performance penalties.  On Pentium III, the
10248 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10249 properly if it is not 16 byte aligned.
10250
10251 To ensure proper alignment of this values on the stack, the stack boundary
10252 must be as aligned as that required by any value stored on the stack.
10253 Further, every function must be generated such that it keeps the stack
10254 aligned.  Thus calling a function compiled with a higher preferred
10255 stack boundary from a function compiled with a lower preferred stack
10256 boundary will most likely misalign the stack.  It is recommended that
10257 libraries that use callbacks always use the default setting.
10258
10259 This extra alignment does consume extra stack space, and generally
10260 increases code size.  Code that is sensitive to stack space usage, such
10261 as embedded systems and operating system kernels, may want to reduce the
10262 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10263
10264 @item -mmmx
10265 @itemx -mno-mmx
10266 @item -msse
10267 @itemx -mno-sse
10268 @item -msse2
10269 @itemx -mno-sse2
10270 @item -msse3
10271 @itemx -mno-sse3
10272 @item -mssse3
10273 @itemx -mno-ssse3
10274 @item -msse4.1
10275 @itemx -mno-sse4.1
10276 @item -msse4a
10277 @item -mno-sse4a
10278 @item -m3dnow
10279 @itemx -mno-3dnow
10280 @item -mpopcnt
10281 @itemx -mno-popcnt
10282 @item -mabm
10283 @itemx -mno-abm
10284 @opindex mmmx
10285 @opindex mno-mmx
10286 @opindex msse
10287 @opindex mno-sse
10288 @opindex m3dnow
10289 @opindex mno-3dnow
10290 These switches enable or disable the use of instructions in the MMX,
10291 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4A, ABM or 3DNow! extended
10292 instruction sets.
10293 These extensions are also available as built-in functions: see
10294 @ref{X86 Built-in Functions}, for details of the functions enabled and
10295 disabled by these switches.
10296
10297 To have SSE/SSE2 instructions generated automatically from floating-point
10298 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10299
10300 These options will enable GCC to use these extended instructions in
10301 generated code, even without @option{-mfpmath=sse}.  Applications which
10302 perform runtime CPU detection must compile separate files for each
10303 supported architecture, using the appropriate flags.  In particular,
10304 the file containing the CPU detection code should be compiled without
10305 these options.
10306
10307 @item -mcx16
10308 @opindex mcx16
10309 This option will enable GCC to use CMPXCHG16B instruction in generated code.
10310 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
10311 data types.  This is useful for high resolution counters that could be updated
10312 by multiple processors (or cores).  This instruction is generated as part of
10313 atomic built-in functions: see @ref{Atomic Builtins} for details.
10314
10315 @item -msahf
10316 @opindex msahf
10317 This option will enable GCC to use SAHF instruction in generated 64-bit code.
10318 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
10319 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
10320 SAHF are load and store instructions, respectively, for certain status flags.
10321 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
10322 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
10323
10324 @item -mpush-args
10325 @itemx -mno-push-args
10326 @opindex mpush-args
10327 @opindex mno-push-args
10328 Use PUSH operations to store outgoing parameters.  This method is shorter
10329 and usually equally fast as method using SUB/MOV operations and is enabled
10330 by default.  In some cases disabling it may improve performance because of
10331 improved scheduling and reduced dependencies.
10332
10333 @item -maccumulate-outgoing-args
10334 @opindex maccumulate-outgoing-args
10335 If enabled, the maximum amount of space required for outgoing arguments will be
10336 computed in the function prologue.  This is faster on most modern CPUs
10337 because of reduced dependencies, improved scheduling and reduced stack usage
10338 when preferred stack boundary is not equal to 2.  The drawback is a notable
10339 increase in code size.  This switch implies @option{-mno-push-args}.
10340
10341 @item -mthreads
10342 @opindex mthreads
10343 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
10344 on thread-safe exception handling must compile and link all code with the
10345 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
10346 @option{-D_MT}; when linking, it links in a special thread helper library
10347 @option{-lmingwthrd} which cleans up per thread exception handling data.
10348
10349 @item -mno-align-stringops
10350 @opindex mno-align-stringops
10351 Do not align destination of inlined string operations.  This switch reduces
10352 code size and improves performance in case the destination is already aligned,
10353 but GCC doesn't know about it.
10354
10355 @item -minline-all-stringops
10356 @opindex minline-all-stringops
10357 By default GCC inlines string operations only when destination is known to be
10358 aligned at least to 4 byte boundary.  This enables more inlining, increase code
10359 size, but may improve performance of code that depends on fast memcpy, strlen
10360 and memset for short lengths.
10361
10362 @item -minline-stringops-dynamically
10363 @opindex minline-stringops-dynamically
10364 For string operation of unknown size, inline runtime checks so for small
10365 blocks inline code is used, while for large blocks library call is used.
10366
10367 @item -mstringop-strategy=@var{alg}
10368 @opindex mstringop-strategy=@var{alg}
10369 Overwrite internal decision heuristic about particular algorithm to inline
10370 string operation with.  The allowed values are @code{rep_byte},
10371 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
10372 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
10373 expanding inline loop, @code{libcall} for always expanding library call.
10374
10375 @item -momit-leaf-frame-pointer
10376 @opindex momit-leaf-frame-pointer
10377 Don't keep the frame pointer in a register for leaf functions.  This
10378 avoids the instructions to save, set up and restore frame pointers and
10379 makes an extra register available in leaf functions.  The option
10380 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10381 which might make debugging harder.
10382
10383 @item -mtls-direct-seg-refs
10384 @itemx -mno-tls-direct-seg-refs
10385 @opindex mtls-direct-seg-refs
10386 Controls whether TLS variables may be accessed with offsets from the
10387 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
10388 or whether the thread base pointer must be added.  Whether or not this
10389 is legal depends on the operating system, and whether it maps the
10390 segment to cover the entire TLS area.
10391
10392 For systems that use GNU libc, the default is on.
10393 @end table
10394
10395 These @samp{-m} switches are supported in addition to the above
10396 on AMD x86-64 processors in 64-bit environments.
10397
10398 @table @gcctabopt
10399 @item -m32
10400 @itemx -m64
10401 @opindex m32
10402 @opindex m64
10403 Generate code for a 32-bit or 64-bit environment.
10404 The 32-bit environment sets int, long and pointer to 32 bits and
10405 generates code that runs on any i386 system.
10406 The 64-bit environment sets int to 32 bits and long and pointer
10407 to 64 bits and generates code for AMD's x86-64 architecture. For
10408 darwin only the -m64 option turns off the @option{-fno-pic} and
10409 @option{-mdynamic-no-pic} options.
10410
10411 @item -mno-red-zone
10412 @opindex no-red-zone
10413 Do not use a so called red zone for x86-64 code.  The red zone is mandated
10414 by the x86-64 ABI, it is a 128-byte area beyond the location of the
10415 stack pointer that will not be modified by signal or interrupt handlers
10416 and therefore can be used for temporary data without adjusting the stack
10417 pointer.  The flag @option{-mno-red-zone} disables this red zone.
10418
10419 @item -mcmodel=small
10420 @opindex mcmodel=small
10421 Generate code for the small code model: the program and its symbols must
10422 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
10423 Programs can be statically or dynamically linked.  This is the default
10424 code model.
10425
10426 @item -mcmodel=kernel
10427 @opindex mcmodel=kernel
10428 Generate code for the kernel code model.  The kernel runs in the
10429 negative 2 GB of the address space.
10430 This model has to be used for Linux kernel code.
10431
10432 @item -mcmodel=medium
10433 @opindex mcmodel=medium
10434 Generate code for the medium model: The program is linked in the lower 2
10435 GB of the address space but symbols can be located anywhere in the
10436 address space.  Programs can be statically or dynamically linked, but
10437 building of shared libraries are not supported with the medium model.
10438
10439 @item -mcmodel=large
10440 @opindex mcmodel=large
10441 Generate code for the large model: This model makes no assumptions
10442 about addresses and sizes of sections.
10443 @end table
10444
10445 @node IA-64 Options
10446 @subsection IA-64 Options
10447 @cindex IA-64 Options
10448
10449 These are the @samp{-m} options defined for the Intel IA-64 architecture.
10450
10451 @table @gcctabopt
10452 @item -mbig-endian
10453 @opindex mbig-endian
10454 Generate code for a big endian target.  This is the default for HP-UX@.
10455
10456 @item -mlittle-endian
10457 @opindex mlittle-endian
10458 Generate code for a little endian target.  This is the default for AIX5
10459 and GNU/Linux.
10460
10461 @item -mgnu-as
10462 @itemx -mno-gnu-as
10463 @opindex mgnu-as
10464 @opindex mno-gnu-as
10465 Generate (or don't) code for the GNU assembler.  This is the default.
10466 @c Also, this is the default if the configure option @option{--with-gnu-as}
10467 @c is used.
10468
10469 @item -mgnu-ld
10470 @itemx -mno-gnu-ld
10471 @opindex mgnu-ld
10472 @opindex mno-gnu-ld
10473 Generate (or don't) code for the GNU linker.  This is the default.
10474 @c Also, this is the default if the configure option @option{--with-gnu-ld}
10475 @c is used.
10476
10477 @item -mno-pic
10478 @opindex mno-pic
10479 Generate code that does not use a global pointer register.  The result
10480 is not position independent code, and violates the IA-64 ABI@.
10481
10482 @item -mvolatile-asm-stop
10483 @itemx -mno-volatile-asm-stop
10484 @opindex mvolatile-asm-stop
10485 @opindex mno-volatile-asm-stop
10486 Generate (or don't) a stop bit immediately before and after volatile asm
10487 statements.
10488
10489 @item -mregister-names
10490 @itemx -mno-register-names
10491 @opindex mregister-names
10492 @opindex mno-register-names
10493 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
10494 the stacked registers.  This may make assembler output more readable.
10495
10496 @item -mno-sdata
10497 @itemx -msdata
10498 @opindex mno-sdata
10499 @opindex msdata
10500 Disable (or enable) optimizations that use the small data section.  This may
10501 be useful for working around optimizer bugs.
10502
10503 @item -mconstant-gp
10504 @opindex mconstant-gp
10505 Generate code that uses a single constant global pointer value.  This is
10506 useful when compiling kernel code.
10507
10508 @item -mauto-pic
10509 @opindex mauto-pic
10510 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
10511 This is useful when compiling firmware code.
10512
10513 @item -minline-float-divide-min-latency
10514 @opindex minline-float-divide-min-latency
10515 Generate code for inline divides of floating point values
10516 using the minimum latency algorithm.
10517
10518 @item -minline-float-divide-max-throughput
10519 @opindex minline-float-divide-max-throughput
10520 Generate code for inline divides of floating point values
10521 using the maximum throughput algorithm.
10522
10523 @item -minline-int-divide-min-latency
10524 @opindex minline-int-divide-min-latency
10525 Generate code for inline divides of integer values
10526 using the minimum latency algorithm.
10527
10528 @item -minline-int-divide-max-throughput
10529 @opindex minline-int-divide-max-throughput
10530 Generate code for inline divides of integer values
10531 using the maximum throughput algorithm.
10532
10533 @item -minline-sqrt-min-latency
10534 @opindex minline-sqrt-min-latency
10535 Generate code for inline square roots
10536 using the minimum latency algorithm.
10537
10538 @item -minline-sqrt-max-throughput
10539 @opindex minline-sqrt-max-throughput
10540 Generate code for inline square roots
10541 using the maximum throughput algorithm.
10542
10543 @item -mno-dwarf2-asm
10544 @itemx -mdwarf2-asm
10545 @opindex mno-dwarf2-asm
10546 @opindex mdwarf2-asm
10547 Don't (or do) generate assembler code for the DWARF2 line number debugging
10548 info.  This may be useful when not using the GNU assembler.
10549
10550 @item -mearly-stop-bits
10551 @itemx -mno-early-stop-bits
10552 @opindex mearly-stop-bits
10553 @opindex mno-early-stop-bits
10554 Allow stop bits to be placed earlier than immediately preceding the
10555 instruction that triggered the stop bit.  This can improve instruction
10556 scheduling, but does not always do so.
10557
10558 @item -mfixed-range=@var{register-range}
10559 @opindex mfixed-range
10560 Generate code treating the given register range as fixed registers.
10561 A fixed register is one that the register allocator can not use.  This is
10562 useful when compiling kernel code.  A register range is specified as
10563 two registers separated by a dash.  Multiple register ranges can be
10564 specified separated by a comma.
10565
10566 @item -mtls-size=@var{tls-size}
10567 @opindex mtls-size
10568 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
10569 64.
10570
10571 @item -mtune=@var{cpu-type}
10572 @opindex mtune
10573 Tune the instruction scheduling for a particular CPU, Valid values are
10574 itanium, itanium1, merced, itanium2, and mckinley.
10575
10576 @item -mt
10577 @itemx -pthread
10578 @opindex mt
10579 @opindex pthread
10580 Add support for multithreading using the POSIX threads library.  This
10581 option sets flags for both the preprocessor and linker.  It does
10582 not affect the thread safety of object code produced by the compiler or
10583 that of libraries supplied with it.  These are HP-UX specific flags.
10584
10585 @item -milp32
10586 @itemx -mlp64
10587 @opindex milp32
10588 @opindex mlp64
10589 Generate code for a 32-bit or 64-bit environment.
10590 The 32-bit environment sets int, long and pointer to 32 bits.
10591 The 64-bit environment sets int to 32 bits and long and pointer
10592 to 64 bits.  These are HP-UX specific flags.
10593
10594 @item -mno-sched-br-data-spec
10595 @itemx -msched-br-data-spec
10596 @opindex mno-sched-br-data-spec
10597 @opindex msched-br-data-spec
10598 (Dis/En)able data speculative scheduling before reload.
10599 This will result in generation of the ld.a instructions and
10600 the corresponding check instructions (ld.c / chk.a).
10601 The default is 'disable'.
10602
10603 @item -msched-ar-data-spec
10604 @itemx -mno-sched-ar-data-spec
10605 @opindex msched-ar-data-spec
10606 @opindex mno-sched-ar-data-spec
10607 (En/Dis)able data speculative scheduling after reload.
10608 This will result in generation of the ld.a instructions and
10609 the corresponding check instructions (ld.c / chk.a).
10610 The default is 'enable'.
10611
10612 @item -mno-sched-control-spec
10613 @itemx -msched-control-spec
10614 @opindex mno-sched-control-spec
10615 @opindex msched-control-spec
10616 (Dis/En)able control speculative scheduling.  This feature is
10617 available only during region scheduling (i.e. before reload).
10618 This will result in generation of the ld.s instructions and
10619 the corresponding check instructions chk.s .
10620 The default is 'disable'.
10621
10622 @item -msched-br-in-data-spec
10623 @itemx -mno-sched-br-in-data-spec
10624 @opindex msched-br-in-data-spec
10625 @opindex mno-sched-br-in-data-spec
10626 (En/Dis)able speculative scheduling of the instructions that
10627 are dependent on the data speculative loads before reload.
10628 This is effective only with @option{-msched-br-data-spec} enabled.
10629 The default is 'enable'.
10630
10631 @item -msched-ar-in-data-spec
10632 @itemx -mno-sched-ar-in-data-spec
10633 @opindex msched-ar-in-data-spec
10634 @opindex mno-sched-ar-in-data-spec
10635 (En/Dis)able speculative scheduling of the instructions that
10636 are dependent on the data speculative loads after reload.
10637 This is effective only with @option{-msched-ar-data-spec} enabled.
10638 The default is 'enable'.
10639
10640 @item -msched-in-control-spec
10641 @itemx -mno-sched-in-control-spec
10642 @opindex msched-in-control-spec
10643 @opindex mno-sched-in-control-spec
10644 (En/Dis)able speculative scheduling of the instructions that
10645 are dependent on the control speculative loads.
10646 This is effective only with @option{-msched-control-spec} enabled.
10647 The default is 'enable'.
10648
10649 @item -msched-ldc
10650 @itemx -mno-sched-ldc
10651 @opindex msched-ldc
10652 @opindex mno-sched-ldc
10653 (En/Dis)able use of simple data speculation checks ld.c .
10654 If disabled, only chk.a instructions will be emitted to check
10655 data speculative loads.
10656 The default is 'enable'.
10657
10658 @item -mno-sched-control-ldc
10659 @itemx -msched-control-ldc
10660 @opindex mno-sched-control-ldc
10661 @opindex msched-control-ldc
10662 (Dis/En)able use of ld.c instructions to check control speculative loads.
10663 If enabled, in case of control speculative load with no speculatively
10664 scheduled dependent instructions this load will be emitted as ld.sa and
10665 ld.c will be used to check it.
10666 The default is 'disable'.
10667
10668 @item -mno-sched-spec-verbose
10669 @itemx -msched-spec-verbose
10670 @opindex mno-sched-spec-verbose
10671 @opindex msched-spec-verbose
10672 (Dis/En)able printing of the information about speculative motions.
10673
10674 @item -mno-sched-prefer-non-data-spec-insns
10675 @itemx -msched-prefer-non-data-spec-insns
10676 @opindex mno-sched-prefer-non-data-spec-insns
10677 @opindex msched-prefer-non-data-spec-insns
10678 If enabled, data speculative instructions will be chosen for schedule
10679 only if there are no other choices at the moment.  This will make
10680 the use of the data speculation much more conservative.
10681 The default is 'disable'.
10682
10683 @item -mno-sched-prefer-non-control-spec-insns
10684 @itemx -msched-prefer-non-control-spec-insns
10685 @opindex mno-sched-prefer-non-control-spec-insns
10686 @opindex msched-prefer-non-control-spec-insns
10687 If enabled, control speculative instructions will be chosen for schedule
10688 only if there are no other choices at the moment.  This will make
10689 the use of the control speculation much more conservative.
10690 The default is 'disable'.
10691
10692 @item -mno-sched-count-spec-in-critical-path
10693 @itemx -msched-count-spec-in-critical-path
10694 @opindex mno-sched-count-spec-in-critical-path
10695 @opindex msched-count-spec-in-critical-path
10696 If enabled, speculative dependencies will be considered during
10697 computation of the instructions priorities.  This will make the use of the
10698 speculation a bit more conservative.
10699 The default is 'disable'.
10700
10701 @end table
10702
10703 @node M32C Options
10704 @subsection M32C Options
10705 @cindex M32C options
10706
10707 @table @gcctabopt
10708 @item -mcpu=@var{name}
10709 @opindex mcpu=
10710 Select the CPU for which code is generated.  @var{name} may be one of
10711 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10712 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10713 the M32C/80 series.
10714
10715 @item -msim
10716 @opindex msim
10717 Specifies that the program will be run on the simulator.  This causes
10718 an alternate runtime library to be linked in which supports, for
10719 example, file I/O.  You must not use this option when generating
10720 programs that will run on real hardware; you must provide your own
10721 runtime library for whatever I/O functions are needed.
10722
10723 @item -memregs=@var{number}
10724 @opindex memregs=
10725 Specifies the number of memory-based pseudo-registers GCC will use
10726 during code generation.  These pseudo-registers will be used like real
10727 registers, so there is a tradeoff between GCC's ability to fit the
10728 code into available registers, and the performance penalty of using
10729 memory instead of registers.  Note that all modules in a program must
10730 be compiled with the same value for this option.  Because of that, you
10731 must not use this option with the default runtime libraries gcc
10732 builds.
10733
10734 @end table
10735
10736 @node M32R/D Options
10737 @subsection M32R/D Options
10738 @cindex M32R/D options
10739
10740 These @option{-m} options are defined for Renesas M32R/D architectures:
10741
10742 @table @gcctabopt
10743 @item -m32r2
10744 @opindex m32r2
10745 Generate code for the M32R/2@.
10746
10747 @item -m32rx
10748 @opindex m32rx
10749 Generate code for the M32R/X@.
10750
10751 @item -m32r
10752 @opindex m32r
10753 Generate code for the M32R@.  This is the default.
10754
10755 @item -mmodel=small
10756 @opindex mmodel=small
10757 Assume all objects live in the lower 16MB of memory (so that their addresses
10758 can be loaded with the @code{ld24} instruction), and assume all subroutines
10759 are reachable with the @code{bl} instruction.
10760 This is the default.
10761
10762 The addressability of a particular object can be set with the
10763 @code{model} attribute.
10764
10765 @item -mmodel=medium
10766 @opindex mmodel=medium
10767 Assume objects may be anywhere in the 32-bit address space (the compiler
10768 will generate @code{seth/add3} instructions to load their addresses), and
10769 assume all subroutines are reachable with the @code{bl} instruction.
10770
10771 @item -mmodel=large
10772 @opindex mmodel=large
10773 Assume objects may be anywhere in the 32-bit address space (the compiler
10774 will generate @code{seth/add3} instructions to load their addresses), and
10775 assume subroutines may not be reachable with the @code{bl} instruction
10776 (the compiler will generate the much slower @code{seth/add3/jl}
10777 instruction sequence).
10778
10779 @item -msdata=none
10780 @opindex msdata=none
10781 Disable use of the small data area.  Variables will be put into
10782 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10783 @code{section} attribute has been specified).
10784 This is the default.
10785
10786 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10787 Objects may be explicitly put in the small data area with the
10788 @code{section} attribute using one of these sections.
10789
10790 @item -msdata=sdata
10791 @opindex msdata=sdata
10792 Put small global and static data in the small data area, but do not
10793 generate special code to reference them.
10794
10795 @item -msdata=use
10796 @opindex msdata=use
10797 Put small global and static data in the small data area, and generate
10798 special instructions to reference them.
10799
10800 @item -G @var{num}
10801 @opindex G
10802 @cindex smaller data references
10803 Put global and static objects less than or equal to @var{num} bytes
10804 into the small data or bss sections instead of the normal data or bss
10805 sections.  The default value of @var{num} is 8.
10806 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10807 for this option to have any effect.
10808
10809 All modules should be compiled with the same @option{-G @var{num}} value.
10810 Compiling with different values of @var{num} may or may not work; if it
10811 doesn't the linker will give an error message---incorrect code will not be
10812 generated.
10813
10814 @item -mdebug
10815 @opindex mdebug
10816 Makes the M32R specific code in the compiler display some statistics
10817 that might help in debugging programs.
10818
10819 @item -malign-loops
10820 @opindex malign-loops
10821 Align all loops to a 32-byte boundary.
10822
10823 @item -mno-align-loops
10824 @opindex mno-align-loops
10825 Do not enforce a 32-byte alignment for loops.  This is the default.
10826
10827 @item -missue-rate=@var{number}
10828 @opindex missue-rate=@var{number}
10829 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10830 or 2.
10831
10832 @item -mbranch-cost=@var{number}
10833 @opindex mbranch-cost=@var{number}
10834 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10835 preferred over conditional code, if it is 2, then the opposite will
10836 apply.
10837
10838 @item -mflush-trap=@var{number}
10839 @opindex mflush-trap=@var{number}
10840 Specifies the trap number to use to flush the cache.  The default is
10841 12.  Valid numbers are between 0 and 15 inclusive.
10842
10843 @item -mno-flush-trap
10844 @opindex mno-flush-trap
10845 Specifies that the cache cannot be flushed by using a trap.
10846
10847 @item -mflush-func=@var{name}
10848 @opindex mflush-func=@var{name}
10849 Specifies the name of the operating system function to call to flush
10850 the cache.  The default is @emph{_flush_cache}, but a function call
10851 will only be used if a trap is not available.
10852
10853 @item -mno-flush-func
10854 @opindex mno-flush-func
10855 Indicates that there is no OS function for flushing the cache.
10856
10857 @end table
10858
10859 @node M680x0 Options
10860 @subsection M680x0 Options
10861 @cindex M680x0 options
10862
10863 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
10864 The default settings depend on which architecture was selected when
10865 the compiler was configured; the defaults for the most common choices
10866 are given below.
10867
10868 @table @gcctabopt
10869 @item -march=@var{arch}
10870 @opindex march
10871 Generate code for a specific M680x0 or ColdFire instruction set
10872 architecture.  Permissible values of @var{arch} for M680x0
10873 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
10874 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
10875 architectures are selected according to Freescale's ISA classification
10876 and the permissible values are: @samp{isaa}, @samp{isaaplus},
10877 @samp{isab} and @samp{isac}.
10878
10879 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
10880 code for a ColdFire target.  The @var{arch} in this macro is one of the
10881 @option{-march} arguments given above.
10882
10883 When used together, @option{-march} and @option{-mtune} select code
10884 that runs on a family of similar processors but that is optimized
10885 for a particular microarchitecture.
10886
10887 @item -mcpu=@var{cpu}
10888 @opindex mcpu
10889 Generate code for a specific M680x0 or ColdFire processor.
10890 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
10891 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
10892 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
10893 below, which also classifies the CPUs into families:
10894
10895 @multitable @columnfractions 0.20 0.80
10896 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
10897 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
10898 @item @samp{5206e} @tab @samp{5206e}
10899 @item @samp{5208} @tab @samp{5207} @samp{5208}
10900 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
10901 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
10902 @item @samp{5216} @tab @samp{5214} @samp{5216}
10903 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
10904 @item @samp{5225} @tab @samp{5224} @samp{5225}
10905 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
10906 @item @samp{5249} @tab @samp{5249}
10907 @item @samp{5250} @tab @samp{5250}
10908 @item @samp{5271} @tab @samp{5270} @samp{5271}
10909 @item @samp{5272} @tab @samp{5272}
10910 @item @samp{5275} @tab @samp{5274} @samp{5275}
10911 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
10912 @item @samp{5307} @tab @samp{5307}
10913 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
10914 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
10915 @item @samp{5407} @tab @samp{5407}
10916 @item @samp{5475} @tab @samp{5470} @samp{5471} @samp{5472} @samp{5473} @samp{5474} @samp{5475} @samp{547x} @samp{5480} @samp{5481} @samp{5482} @samp{5483} @samp{5484} @samp{5485}
10917 @end multitable
10918
10919 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
10920 @var{arch} is compatible with @var{cpu}.  Other combinations of
10921 @option{-mcpu} and @option{-march} are rejected.
10922
10923 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
10924 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
10925 where the value of @var{family} is given by the table above.
10926
10927 @item -mtune=@var{tune}
10928 @opindex mtune
10929 Tune the code for a particular microarchitecture, within the
10930 constraints set by @option{-march} and @option{-mcpu}.
10931 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
10932 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
10933 and @samp{cpu32}.  The ColdFire microarchitectures
10934 are: @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
10935
10936 You can also use @option{-mtune=68020-40} for code that needs
10937 to run relatively well on 68020, 68030 and 68040 targets.
10938 @option{-mtune=68020-60} is similar but includes 68060 targets
10939 as well.  These two options select the same tuning decisions as
10940 @option{-m68020-40} and @option{-m68020-60} respectively.
10941
10942 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
10943 when tuning for 680x0 architecture @var{arch}.  It also defines
10944 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
10945 option is used.  If gcc is tuning for a range of architectures,
10946 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
10947 it defines the macros for every architecture in the range.
10948
10949 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
10950 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
10951 of the arguments given above.
10952
10953 @item -m68000
10954 @itemx -mc68000
10955 @opindex m68000
10956 @opindex mc68000
10957 Generate output for a 68000.  This is the default
10958 when the compiler is configured for 68000-based systems.
10959 It is equivalent to @option{-march=68000}.
10960
10961 Use this option for microcontrollers with a 68000 or EC000 core,
10962 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10963
10964 @item -m68010
10965 @opindex m68010
10966 Generate output for a 68010.  This is the default
10967 when the compiler is configured for 68010-based systems.
10968 It is equivalent to @option{-march=68010}.
10969
10970 @item -m68020
10971 @itemx -mc68020
10972 @opindex m68020
10973 @opindex mc68020
10974 Generate output for a 68020.  This is the default
10975 when the compiler is configured for 68020-based systems.
10976 It is equivalent to @option{-march=68020}.
10977
10978 @item -m68030
10979 @opindex m68030
10980 Generate output for a 68030.  This is the default when the compiler is
10981 configured for 68030-based systems.  It is equivalent to
10982 @option{-march=68030}.
10983
10984 @item -m68040
10985 @opindex m68040
10986 Generate output for a 68040.  This is the default when the compiler is
10987 configured for 68040-based systems.  It is equivalent to
10988 @option{-march=68040}.
10989
10990 This option inhibits the use of 68881/68882 instructions that have to be
10991 emulated by software on the 68040.  Use this option if your 68040 does not
10992 have code to emulate those instructions.
10993
10994 @item -m68060
10995 @opindex m68060
10996 Generate output for a 68060.  This is the default when the compiler is
10997 configured for 68060-based systems.  It is equivalent to
10998 @option{-march=68060}.
10999
11000 This option inhibits the use of 68020 and 68881/68882 instructions that
11001 have to be emulated by software on the 68060.  Use this option if your 68060
11002 does not have code to emulate those instructions.
11003
11004 @item -mcpu32
11005 @opindex mcpu32
11006 Generate output for a CPU32.  This is the default
11007 when the compiler is configured for CPU32-based systems.
11008 It is equivalent to @option{-march=cpu32}.
11009
11010 Use this option for microcontrollers with a
11011 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
11012 68336, 68340, 68341, 68349 and 68360.
11013
11014 @item -m5200
11015 @opindex m5200
11016 Generate output for a 520X ColdFire CPU.  This is the default
11017 when the compiler is configured for 520X-based systems.
11018 It is equivalent to @option{-mcpu=5206}, and is now deprecated
11019 in favor of that option.
11020
11021 Use this option for microcontroller with a 5200 core, including
11022 the MCF5202, MCF5203, MCF5204 and MCF5206.
11023
11024 @item -m5206e
11025 @opindex m5206e
11026 Generate output for a 5206e ColdFire CPU.  The option is now
11027 deprecated in favor of the equivalent @option{-mcpu=5206e}.
11028
11029 @item -m528x
11030 @opindex m528x
11031 Generate output for a member of the ColdFire 528X family.
11032 The option is now deprecated in favor of the equivalent
11033 @option{-mcpu=528x}.
11034
11035 @item -m5307
11036 @opindex m5307
11037 Generate output for a ColdFire 5307 CPU.  The option is now deprecated
11038 in favor of the equivalent @option{-mcpu=5307}.
11039
11040 @item -m5407
11041 @opindex m5407
11042 Generate output for a ColdFire 5407 CPU.  The option is now deprecated
11043 in favor of the equivalent @option{-mcpu=5407}.
11044
11045 @item -mcfv4e
11046 @opindex mcfv4e
11047 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
11048 This includes use of hardware floating point instructions.
11049 The option is equivalent to @option{-mcpu=547x}, and is now
11050 deprecated in favor of that option.
11051
11052 @item -m68020-40
11053 @opindex m68020-40
11054 Generate output for a 68040, without using any of the new instructions.
11055 This results in code which can run relatively efficiently on either a
11056 68020/68881 or a 68030 or a 68040.  The generated code does use the
11057 68881 instructions that are emulated on the 68040.
11058
11059 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
11060
11061 @item -m68020-60
11062 @opindex m68020-60
11063 Generate output for a 68060, without using any of the new instructions.
11064 This results in code which can run relatively efficiently on either a
11065 68020/68881 or a 68030 or a 68040.  The generated code does use the
11066 68881 instructions that are emulated on the 68060.
11067
11068 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
11069
11070 @item -mhard-float
11071 @itemx -m68881
11072 @opindex mhard-float
11073 @opindex m68881
11074 Generate floating-point instructions.  This is the default for 68020
11075 and above, and for ColdFire devices that have an FPU.  It defines the
11076 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
11077 on ColdFire targets.
11078
11079 @item -msoft-float
11080 @opindex msoft-float
11081 Do not generate floating-point instructions; use library calls instead.
11082 This is the default for 68000, 68010, and 68832 targets.  It is also
11083 the default for ColdFire devices that have no FPU.
11084
11085 @item -mdiv
11086 @itemx -mno-div
11087 @opindex mdiv
11088 @opindex mno-div
11089 Generate (do not generate) ColdFire hardware divide and remainder
11090 instructions.  If @option{-march} is used without @option{-mcpu},
11091 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
11092 architectures.  Otherwise, the default is taken from the target CPU
11093 (either the default CPU, or the one specified by @option{-mcpu}).  For
11094 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
11095 @option{-mcpu=5206e}.
11096
11097 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
11098
11099 @item -mshort
11100 @opindex mshort
11101 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11102 Additionally, parameters passed on the stack are also aligned to a
11103 16-bit boundary even on targets whose API mandates promotion to 32-bit.
11104
11105 @item -mno-short
11106 @opindex mno-short
11107 Do not consider type @code{int} to be 16 bits wide.  This is the default.
11108
11109 @item -mnobitfield
11110 @itemx -mno-bitfield
11111 @opindex mnobitfield
11112 @opindex mno-bitfield
11113 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
11114 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
11115
11116 @item -mbitfield
11117 @opindex mbitfield
11118 Do use the bit-field instructions.  The @option{-m68020} option implies
11119 @option{-mbitfield}.  This is the default if you use a configuration
11120 designed for a 68020.
11121
11122 @item -mrtd
11123 @opindex mrtd
11124 Use a different function-calling convention, in which functions
11125 that take a fixed number of arguments return with the @code{rtd}
11126 instruction, which pops their arguments while returning.  This
11127 saves one instruction in the caller since there is no need to pop
11128 the arguments there.
11129
11130 This calling convention is incompatible with the one normally
11131 used on Unix, so you cannot use it if you need to call libraries
11132 compiled with the Unix compiler.
11133
11134 Also, you must provide function prototypes for all functions that
11135 take variable numbers of arguments (including @code{printf});
11136 otherwise incorrect code will be generated for calls to those
11137 functions.
11138
11139 In addition, seriously incorrect code will result if you call a
11140 function with too many arguments.  (Normally, extra arguments are
11141 harmlessly ignored.)
11142
11143 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
11144 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
11145
11146 @item -mno-rtd
11147 @opindex mno-rtd
11148 Do not use the calling conventions selected by @option{-mrtd}.
11149 This is the default.
11150
11151 @item -malign-int
11152 @itemx -mno-align-int
11153 @opindex malign-int
11154 @opindex mno-align-int
11155 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
11156 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
11157 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
11158 Aligning variables on 32-bit boundaries produces code that runs somewhat
11159 faster on processors with 32-bit busses at the expense of more memory.
11160
11161 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
11162 align structures containing the above types  differently than
11163 most published application binary interface specifications for the m68k.
11164
11165 @item -mpcrel
11166 @opindex mpcrel
11167 Use the pc-relative addressing mode of the 68000 directly, instead of
11168 using a global offset table.  At present, this option implies @option{-fpic},
11169 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
11170 not presently supported with @option{-mpcrel}, though this could be supported for
11171 68020 and higher processors.
11172
11173 @item -mno-strict-align
11174 @itemx -mstrict-align
11175 @opindex mno-strict-align
11176 @opindex mstrict-align
11177 Do not (do) assume that unaligned memory references will be handled by
11178 the system.
11179
11180 @item -msep-data
11181 Generate code that allows the data segment to be located in a different
11182 area of memory from the text segment.  This allows for execute in place in
11183 an environment without virtual memory management.  This option implies
11184 @option{-fPIC}.
11185
11186 @item -mno-sep-data
11187 Generate code that assumes that the data segment follows the text segment.
11188 This is the default.
11189
11190 @item -mid-shared-library
11191 Generate code that supports shared libraries via the library ID method.
11192 This allows for execute in place and shared libraries in an environment
11193 without virtual memory management.  This option implies @option{-fPIC}.
11194
11195 @item -mno-id-shared-library
11196 Generate code that doesn't assume ID based shared libraries are being used.
11197 This is the default.
11198
11199 @item -mshared-library-id=n
11200 Specified the identification number of the ID based shared library being
11201 compiled.  Specifying a value of 0 will generate more compact code, specifying
11202 other values will force the allocation of that number to the current
11203 library but is no more space or time efficient than omitting this option.
11204
11205 @end table
11206
11207 @node M68hc1x Options
11208 @subsection M68hc1x Options
11209 @cindex M68hc1x options
11210
11211 These are the @samp{-m} options defined for the 68hc11 and 68hc12
11212 microcontrollers.  The default values for these options depends on
11213 which style of microcontroller was selected when the compiler was configured;
11214 the defaults for the most common choices are given below.
11215
11216 @table @gcctabopt
11217 @item -m6811
11218 @itemx -m68hc11
11219 @opindex m6811
11220 @opindex m68hc11
11221 Generate output for a 68HC11.  This is the default
11222 when the compiler is configured for 68HC11-based systems.
11223
11224 @item -m6812
11225 @itemx -m68hc12
11226 @opindex m6812
11227 @opindex m68hc12
11228 Generate output for a 68HC12.  This is the default
11229 when the compiler is configured for 68HC12-based systems.
11230
11231 @item -m68S12
11232 @itemx -m68hcs12
11233 @opindex m68S12
11234 @opindex m68hcs12
11235 Generate output for a 68HCS12.
11236
11237 @item -mauto-incdec
11238 @opindex mauto-incdec
11239 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
11240 addressing modes.
11241
11242 @item -minmax
11243 @itemx -nominmax
11244 @opindex minmax
11245 @opindex mnominmax
11246 Enable the use of 68HC12 min and max instructions.
11247
11248 @item -mlong-calls
11249 @itemx -mno-long-calls
11250 @opindex mlong-calls
11251 @opindex mno-long-calls
11252 Treat all calls as being far away (near).  If calls are assumed to be
11253 far away, the compiler will use the @code{call} instruction to
11254 call a function and the @code{rtc} instruction for returning.
11255
11256 @item -mshort
11257 @opindex mshort
11258 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11259
11260 @item -msoft-reg-count=@var{count}
11261 @opindex msoft-reg-count
11262 Specify the number of pseudo-soft registers which are used for the
11263 code generation.  The maximum number is 32.  Using more pseudo-soft
11264 register may or may not result in better code depending on the program.
11265 The default is 4 for 68HC11 and 2 for 68HC12.
11266
11267 @end table
11268
11269 @node MCore Options
11270 @subsection MCore Options
11271 @cindex MCore options
11272
11273 These are the @samp{-m} options defined for the Motorola M*Core
11274 processors.
11275
11276 @table @gcctabopt
11277
11278 @item -mhardlit
11279 @itemx -mno-hardlit
11280 @opindex mhardlit
11281 @opindex mno-hardlit
11282 Inline constants into the code stream if it can be done in two
11283 instructions or less.
11284
11285 @item -mdiv
11286 @itemx -mno-div
11287 @opindex mdiv
11288 @opindex mno-div
11289 Use the divide instruction.  (Enabled by default).
11290
11291 @item -mrelax-immediate
11292 @itemx -mno-relax-immediate
11293 @opindex mrelax-immediate
11294 @opindex mno-relax-immediate
11295 Allow arbitrary sized immediates in bit operations.
11296
11297 @item -mwide-bitfields
11298 @itemx -mno-wide-bitfields
11299 @opindex mwide-bitfields
11300 @opindex mno-wide-bitfields
11301 Always treat bit-fields as int-sized.
11302
11303 @item -m4byte-functions
11304 @itemx -mno-4byte-functions
11305 @opindex m4byte-functions
11306 @opindex mno-4byte-functions
11307 Force all functions to be aligned to a four byte boundary.
11308
11309 @item -mcallgraph-data
11310 @itemx -mno-callgraph-data
11311 @opindex mcallgraph-data
11312 @opindex mno-callgraph-data
11313 Emit callgraph information.
11314
11315 @item -mslow-bytes
11316 @itemx -mno-slow-bytes
11317 @opindex mslow-bytes
11318 @opindex mno-slow-bytes
11319 Prefer word access when reading byte quantities.
11320
11321 @item -mlittle-endian
11322 @itemx -mbig-endian
11323 @opindex mlittle-endian
11324 @opindex mbig-endian
11325 Generate code for a little endian target.
11326
11327 @item -m210
11328 @itemx -m340
11329 @opindex m210
11330 @opindex m340
11331 Generate code for the 210 processor.
11332 @end table
11333
11334 @node MIPS Options
11335 @subsection MIPS Options
11336 @cindex MIPS options
11337
11338 @table @gcctabopt
11339
11340 @item -EB
11341 @opindex EB
11342 Generate big-endian code.
11343
11344 @item -EL
11345 @opindex EL
11346 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
11347 configurations.
11348
11349 @item -march=@var{arch}
11350 @opindex march
11351 Generate code that will run on @var{arch}, which can be the name of a
11352 generic MIPS ISA, or the name of a particular processor.
11353 The ISA names are:
11354 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
11355 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
11356 The processor names are:
11357 @samp{4kc}, @samp{4km}, @samp{4kp},
11358 @samp{4kec}, @samp{4kem}, @samp{4kep},
11359 @samp{5kc}, @samp{5kf},
11360 @samp{20kc},
11361 @samp{24kc}, @samp{24kf}, @samp{24kx},
11362 @samp{24kec}, @samp{24kef}, @samp{24kex},
11363 @samp{34kc}, @samp{34kf}, @samp{34kx},
11364 @samp{74kc}, @samp{74kf}, @samp{74kx},
11365 @samp{m4k},
11366 @samp{orion},
11367 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
11368 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
11369 @samp{rm7000}, @samp{rm9000},
11370 @samp{sb1},
11371 @samp{sr71000},
11372 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
11373 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
11374 The special value @samp{from-abi} selects the
11375 most compatible architecture for the selected ABI (that is,
11376 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
11377
11378 In processor names, a final @samp{000} can be abbreviated as @samp{k}
11379 (for example, @samp{-march=r2k}).  Prefixes are optional, and
11380 @samp{vr} may be written @samp{r}.
11381
11382 GCC defines two macros based on the value of this option.  The first
11383 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
11384 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
11385 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
11386 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
11387 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
11388
11389 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
11390 above.  In other words, it will have the full prefix and will not
11391 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
11392 the macro names the resolved architecture (either @samp{"mips1"} or
11393 @samp{"mips3"}).  It names the default architecture when no
11394 @option{-march} option is given.
11395
11396 @item -mtune=@var{arch}
11397 @opindex mtune
11398 Optimize for @var{arch}.  Among other things, this option controls
11399 the way instructions are scheduled, and the perceived cost of arithmetic
11400 operations.  The list of @var{arch} values is the same as for
11401 @option{-march}.
11402
11403 When this option is not used, GCC will optimize for the processor
11404 specified by @option{-march}.  By using @option{-march} and
11405 @option{-mtune} together, it is possible to generate code that will
11406 run on a family of processors, but optimize the code for one
11407 particular member of that family.
11408
11409 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
11410 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
11411 @samp{-march} ones described above.
11412
11413 @item -mips1
11414 @opindex mips1
11415 Equivalent to @samp{-march=mips1}.
11416
11417 @item -mips2
11418 @opindex mips2
11419 Equivalent to @samp{-march=mips2}.
11420
11421 @item -mips3
11422 @opindex mips3
11423 Equivalent to @samp{-march=mips3}.
11424
11425 @item -mips4
11426 @opindex mips4
11427 Equivalent to @samp{-march=mips4}.
11428
11429 @item -mips32
11430 @opindex mips32
11431 Equivalent to @samp{-march=mips32}.
11432
11433 @item -mips32r2
11434 @opindex mips32r2
11435 Equivalent to @samp{-march=mips32r2}.
11436
11437 @item -mips64
11438 @opindex mips64
11439 Equivalent to @samp{-march=mips64}.
11440
11441 @item -mips16
11442 @itemx -mno-mips16
11443 @opindex mips16
11444 @opindex mno-mips16
11445 Generate (do not generate) MIPS16 code.  If GCC is targetting a
11446 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
11447
11448 @item -mabi=32
11449 @itemx -mabi=o64
11450 @itemx -mabi=n32
11451 @itemx -mabi=64
11452 @itemx -mabi=eabi
11453 @opindex mabi=32
11454 @opindex mabi=o64
11455 @opindex mabi=n32
11456 @opindex mabi=64
11457 @opindex mabi=eabi
11458 Generate code for the given ABI@.
11459
11460 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
11461 generates 64-bit code when you select a 64-bit architecture, but you
11462 can use @option{-mgp32} to get 32-bit code instead.
11463
11464 For information about the O64 ABI, see
11465 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
11466
11467 GCC supports a variant of the o32 ABI in which floating-point registers
11468 are 64 rather than 32 bits wide.  You can select this combination with
11469 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
11470 and @samp{mfhc1} instructions and is therefore only supported for
11471 MIPS32R2 processors.
11472
11473 The register assignments for arguments and return values remain the
11474 same, but each scalar value is passed in a single 64-bit register
11475 rather than a pair of 32-bit registers.  For example, scalar
11476 floating-point values are returned in @samp{$f0} only, not a
11477 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
11478 remains the same, but all 64 bits are saved.
11479
11480 @item -mabicalls
11481 @itemx -mno-abicalls
11482 @opindex mabicalls
11483 @opindex mno-abicalls
11484 Generate (do not generate) code that is suitable for SVR4-style
11485 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
11486 systems.
11487
11488 @item -mshared
11489 @itemx -mno-shared
11490 Generate (do not generate) code that is fully position-independent,
11491 and that can therefore be linked into shared libraries.  This option
11492 only affects @option{-mabicalls}.
11493
11494 All @option{-mabicalls} code has traditionally been position-independent,
11495 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
11496 as an extension, the GNU toolchain allows executables to use absolute
11497 accesses for locally-binding symbols.  It can also use shorter GP
11498 initialization sequences and generate direct calls to locally-defined
11499 functions.  This mode is selected by @option{-mno-shared}.
11500
11501 @option{-mno-shared} depends on binutils 2.16 or higher and generates
11502 objects that can only be linked by the GNU linker.  However, the option
11503 does not affect the ABI of the final executable; it only affects the ABI
11504 of relocatable objects.  Using @option{-mno-shared} will generally make
11505 executables both smaller and quicker.
11506
11507 @option{-mshared} is the default.
11508
11509 @item -mxgot
11510 @itemx -mno-xgot
11511 @opindex mxgot
11512 @opindex mno-xgot
11513 Lift (do not lift) the usual restrictions on the size of the global
11514 offset table.
11515
11516 GCC normally uses a single instruction to load values from the GOT@.
11517 While this is relatively efficient, it will only work if the GOT
11518 is smaller than about 64k.  Anything larger will cause the linker
11519 to report an error such as:
11520
11521 @cindex relocation truncated to fit (MIPS)
11522 @smallexample
11523 relocation truncated to fit: R_MIPS_GOT16 foobar
11524 @end smallexample
11525
11526 If this happens, you should recompile your code with @option{-mxgot}.
11527 It should then work with very large GOTs, although it will also be
11528 less efficient, since it will take three instructions to fetch the
11529 value of a global symbol.
11530
11531 Note that some linkers can create multiple GOTs.  If you have such a
11532 linker, you should only need to use @option{-mxgot} when a single object
11533 file accesses more than 64k's worth of GOT entries.  Very few do.
11534
11535 These options have no effect unless GCC is generating position
11536 independent code.
11537
11538 @item -mgp32
11539 @opindex mgp32
11540 Assume that general-purpose registers are 32 bits wide.
11541
11542 @item -mgp64
11543 @opindex mgp64
11544 Assume that general-purpose registers are 64 bits wide.
11545
11546 @item -mfp32
11547 @opindex mfp32
11548 Assume that floating-point registers are 32 bits wide.
11549
11550 @item -mfp64
11551 @opindex mfp64
11552 Assume that floating-point registers are 64 bits wide.
11553
11554 @item -mhard-float
11555 @opindex mhard-float
11556 Use floating-point coprocessor instructions.
11557
11558 @item -msoft-float
11559 @opindex msoft-float
11560 Do not use floating-point coprocessor instructions.  Implement
11561 floating-point calculations using library calls instead.
11562
11563 @item -msingle-float
11564 @opindex msingle-float
11565 Assume that the floating-point coprocessor only supports single-precision
11566 operations.
11567
11568 @item -mdouble-float
11569 @opindex mdouble-float
11570 Assume that the floating-point coprocessor supports double-precision
11571 operations.  This is the default.
11572
11573 @item -mdsp
11574 @itemx -mno-dsp
11575 @opindex mdsp
11576 @opindex mno-dsp
11577 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
11578
11579 @item -mdspr2
11580 @itemx -mno-dspr2
11581 @opindex mdspr2
11582 @opindex mno-dspr2
11583 Use (do not use) the MIPS DSP ASE REV 2.  @xref{MIPS DSP Built-in Functions}.
11584 The option @option{-mdspr2} implies @option{-mdsp}.
11585
11586 @item -mpaired-single
11587 @itemx -mno-paired-single
11588 @opindex mpaired-single
11589 @opindex mno-paired-single
11590 Use (do not use) paired-single floating-point instructions.
11591 @xref{MIPS Paired-Single Support}.  This option can only be used
11592 when generating 64-bit code and requires hardware floating-point
11593 support to be enabled.
11594
11595 @item -mdmx
11596 @itemx -mno-mdmx
11597 @opindex mdmx
11598 @opindex mno-mdmx
11599 Use (do not use) MIPS Digital Media Extension instructions.
11600 This option can only be used when generating 64-bit code and requires
11601 hardware floating-point support to be enabled.
11602
11603 @item -mips3d
11604 @itemx -mno-mips3d
11605 @opindex mips3d
11606 @opindex mno-mips3d
11607 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
11608 The option @option{-mips3d} implies @option{-mpaired-single}.
11609
11610 @item -mmt
11611 @itemx -mno-mt
11612 @opindex mmt
11613 @opindex mno-mt
11614 Use (do not use) MT Multithreading instructions.
11615
11616 @item -mlong64
11617 @opindex mlong64
11618 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
11619 an explanation of the default and the way that the pointer size is
11620 determined.
11621
11622 @item -mlong32
11623 @opindex mlong32
11624 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
11625
11626 The default size of @code{int}s, @code{long}s and pointers depends on
11627 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
11628 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
11629 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
11630 or the same size as integer registers, whichever is smaller.
11631
11632 @item -msym32
11633 @itemx -mno-sym32
11634 @opindex msym32
11635 @opindex mno-sym32
11636 Assume (do not assume) that all symbols have 32-bit values, regardless
11637 of the selected ABI@.  This option is useful in combination with
11638 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
11639 to generate shorter and faster references to symbolic addresses.
11640
11641 @item -G @var{num}
11642 @opindex G
11643 @cindex smaller data references (MIPS)
11644 @cindex gp-relative references (MIPS)
11645 Put global and static items less than or equal to @var{num} bytes into
11646 the small data or bss section instead of the normal data or bss section.
11647 This allows the data to be accessed using a single instruction.
11648
11649 All modules should be compiled with the same @option{-G @var{num}}
11650 value.
11651
11652 @item -membedded-data
11653 @itemx -mno-embedded-data
11654 @opindex membedded-data
11655 @opindex mno-embedded-data
11656 Allocate variables to the read-only data section first if possible, then
11657 next in the small data section if possible, otherwise in data.  This gives
11658 slightly slower code than the default, but reduces the amount of RAM required
11659 when executing, and thus may be preferred for some embedded systems.
11660
11661 @item -muninit-const-in-rodata
11662 @itemx -mno-uninit-const-in-rodata
11663 @opindex muninit-const-in-rodata
11664 @opindex mno-uninit-const-in-rodata
11665 Put uninitialized @code{const} variables in the read-only data section.
11666 This option is only meaningful in conjunction with @option{-membedded-data}.
11667
11668 @item -msplit-addresses
11669 @itemx -mno-split-addresses
11670 @opindex msplit-addresses
11671 @opindex mno-split-addresses
11672 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
11673 relocation operators.  This option has been superseded by
11674 @option{-mexplicit-relocs} but is retained for backwards compatibility.
11675
11676 @item -mexplicit-relocs
11677 @itemx -mno-explicit-relocs
11678 @opindex mexplicit-relocs
11679 @opindex mno-explicit-relocs
11680 Use (do not use) assembler relocation operators when dealing with symbolic
11681 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
11682 is to use assembler macros instead.
11683
11684 @option{-mexplicit-relocs} is the default if GCC was configured
11685 to use an assembler that supports relocation operators.
11686
11687 @item -mcheck-zero-division
11688 @itemx -mno-check-zero-division
11689 @opindex mcheck-zero-division
11690 @opindex mno-check-zero-division
11691 Trap (do not trap) on integer division by zero.
11692
11693 The default is @option{-mcheck-zero-division}.
11694
11695 @item -mdivide-traps
11696 @itemx -mdivide-breaks
11697 @opindex mdivide-traps
11698 @opindex mdivide-breaks
11699 MIPS systems check for division by zero by generating either a
11700 conditional trap or a break instruction.  Using traps results in
11701 smaller code, but is only supported on MIPS II and later.  Also, some
11702 versions of the Linux kernel have a bug that prevents trap from
11703 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
11704 allow conditional traps on architectures that support them and
11705 @option{-mdivide-breaks} to force the use of breaks.
11706
11707 The default is usually @option{-mdivide-traps}, but this can be
11708 overridden at configure time using @option{--with-divide=breaks}.
11709 Divide-by-zero checks can be completely disabled using
11710 @option{-mno-check-zero-division}.
11711
11712 @item -mmemcpy
11713 @itemx -mno-memcpy
11714 @opindex mmemcpy
11715 @opindex mno-memcpy
11716 Force (do not force) the use of @code{memcpy()} for non-trivial block
11717 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
11718 most constant-sized copies.
11719
11720 @item -mlong-calls
11721 @itemx -mno-long-calls
11722 @opindex mlong-calls
11723 @opindex mno-long-calls
11724 Disable (do not disable) use of the @code{jal} instruction.  Calling
11725 functions using @code{jal} is more efficient but requires the caller
11726 and callee to be in the same 256 megabyte segment.
11727
11728 This option has no effect on abicalls code.  The default is
11729 @option{-mno-long-calls}.
11730
11731 @item -mmad
11732 @itemx -mno-mad
11733 @opindex mmad
11734 @opindex mno-mad
11735 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
11736 instructions, as provided by the R4650 ISA@.
11737
11738 @item -mfused-madd
11739 @itemx -mno-fused-madd
11740 @opindex mfused-madd
11741 @opindex mno-fused-madd
11742 Enable (disable) use of the floating point multiply-accumulate
11743 instructions, when they are available.  The default is
11744 @option{-mfused-madd}.
11745
11746 When multiply-accumulate instructions are used, the intermediate
11747 product is calculated to infinite precision and is not subject to
11748 the FCSR Flush to Zero bit.  This may be undesirable in some
11749 circumstances.
11750
11751 @item -nocpp
11752 @opindex nocpp
11753 Tell the MIPS assembler to not run its preprocessor over user
11754 assembler files (with a @samp{.s} suffix) when assembling them.
11755
11756 @item -mfix-r4000
11757 @itemx -mno-fix-r4000
11758 @opindex mfix-r4000
11759 @opindex mno-fix-r4000
11760 Work around certain R4000 CPU errata:
11761 @itemize @minus
11762 @item
11763 A double-word or a variable shift may give an incorrect result if executed
11764 immediately after starting an integer division.
11765 @item
11766 A double-word or a variable shift may give an incorrect result if executed
11767 while an integer multiplication is in progress.
11768 @item
11769 An integer division may give an incorrect result if started in a delay slot
11770 of a taken branch or a jump.
11771 @end itemize
11772
11773 @item -mfix-r4400
11774 @itemx -mno-fix-r4400
11775 @opindex mfix-r4400
11776 @opindex mno-fix-r4400
11777 Work around certain R4400 CPU errata:
11778 @itemize @minus
11779 @item
11780 A double-word or a variable shift may give an incorrect result if executed
11781 immediately after starting an integer division.
11782 @end itemize
11783
11784 @item -mfix-vr4120
11785 @itemx -mno-fix-vr4120
11786 @opindex mfix-vr4120
11787 Work around certain VR4120 errata:
11788 @itemize @minus
11789 @item
11790 @code{dmultu} does not always produce the correct result.
11791 @item
11792 @code{div} and @code{ddiv} do not always produce the correct result if one
11793 of the operands is negative.
11794 @end itemize
11795 The workarounds for the division errata rely on special functions in
11796 @file{libgcc.a}.  At present, these functions are only provided by
11797 the @code{mips64vr*-elf} configurations.
11798
11799 Other VR4120 errata require a nop to be inserted between certain pairs of
11800 instructions.  These errata are handled by the assembler, not by GCC itself.
11801
11802 @item -mfix-vr4130
11803 @opindex mfix-vr4130
11804 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11805 workarounds are implemented by the assembler rather than by GCC,
11806 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11807 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11808 instructions are available instead.
11809
11810 @item -mfix-sb1
11811 @itemx -mno-fix-sb1
11812 @opindex mfix-sb1
11813 Work around certain SB-1 CPU core errata.
11814 (This flag currently works around the SB-1 revision 2
11815 ``F1'' and ``F2'' floating point errata.)
11816
11817 @item -mflush-func=@var{func}
11818 @itemx -mno-flush-func
11819 @opindex mflush-func
11820 Specifies the function to call to flush the I and D caches, or to not
11821 call any such function.  If called, the function must take the same
11822 arguments as the common @code{_flush_func()}, that is, the address of the
11823 memory range for which the cache is being flushed, the size of the
11824 memory range, and the number 3 (to flush both caches).  The default
11825 depends on the target GCC was configured for, but commonly is either
11826 @samp{_flush_func} or @samp{__cpu_flush}.
11827
11828 @item -mbranch-likely
11829 @itemx -mno-branch-likely
11830 @opindex mbranch-likely
11831 @opindex mno-branch-likely
11832 Enable or disable use of Branch Likely instructions, regardless of the
11833 default for the selected architecture.  By default, Branch Likely
11834 instructions may be generated if they are supported by the selected
11835 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11836 and processors which implement those architectures; for those, Branch
11837 Likely instructions will not be generated by default because the MIPS32
11838 and MIPS64 architectures specifically deprecate their use.
11839
11840 @item -mfp-exceptions
11841 @itemx -mno-fp-exceptions
11842 @opindex mfp-exceptions
11843 Specifies whether FP exceptions are enabled.  This affects how we schedule
11844 FP instructions for some processors.  The default is that FP exceptions are
11845 enabled.
11846
11847 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11848 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11849 FP pipe.
11850
11851 @item -mvr4130-align
11852 @itemx -mno-vr4130-align
11853 @opindex mvr4130-align
11854 The VR4130 pipeline is two-way superscalar, but can only issue two
11855 instructions together if the first one is 8-byte aligned.  When this
11856 option is enabled, GCC will align pairs of instructions that it
11857 thinks should execute in parallel.
11858
11859 This option only has an effect when optimizing for the VR4130.
11860 It normally makes code faster, but at the expense of making it bigger.
11861 It is enabled by default at optimization level @option{-O3}.
11862 @end table
11863
11864 @node MMIX Options
11865 @subsection MMIX Options
11866 @cindex MMIX Options
11867
11868 These options are defined for the MMIX:
11869
11870 @table @gcctabopt
11871 @item -mlibfuncs
11872 @itemx -mno-libfuncs
11873 @opindex mlibfuncs
11874 @opindex mno-libfuncs
11875 Specify that intrinsic library functions are being compiled, passing all
11876 values in registers, no matter the size.
11877
11878 @item -mepsilon
11879 @itemx -mno-epsilon
11880 @opindex mepsilon
11881 @opindex mno-epsilon
11882 Generate floating-point comparison instructions that compare with respect
11883 to the @code{rE} epsilon register.
11884
11885 @item -mabi=mmixware
11886 @itemx -mabi=gnu
11887 @opindex mabi-mmixware
11888 @opindex mabi=gnu
11889 Generate code that passes function parameters and return values that (in
11890 the called function) are seen as registers @code{$0} and up, as opposed to
11891 the GNU ABI which uses global registers @code{$231} and up.
11892
11893 @item -mzero-extend
11894 @itemx -mno-zero-extend
11895 @opindex mzero-extend
11896 @opindex mno-zero-extend
11897 When reading data from memory in sizes shorter than 64 bits, use (do not
11898 use) zero-extending load instructions by default, rather than
11899 sign-extending ones.
11900
11901 @item -mknuthdiv
11902 @itemx -mno-knuthdiv
11903 @opindex mknuthdiv
11904 @opindex mno-knuthdiv
11905 Make the result of a division yielding a remainder have the same sign as
11906 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11907 remainder follows the sign of the dividend.  Both methods are
11908 arithmetically valid, the latter being almost exclusively used.
11909
11910 @item -mtoplevel-symbols
11911 @itemx -mno-toplevel-symbols
11912 @opindex mtoplevel-symbols
11913 @opindex mno-toplevel-symbols
11914 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11915 code can be used with the @code{PREFIX} assembly directive.
11916
11917 @item -melf
11918 @opindex melf
11919 Generate an executable in the ELF format, rather than the default
11920 @samp{mmo} format used by the @command{mmix} simulator.
11921
11922 @item -mbranch-predict
11923 @itemx -mno-branch-predict
11924 @opindex mbranch-predict
11925 @opindex mno-branch-predict
11926 Use (do not use) the probable-branch instructions, when static branch
11927 prediction indicates a probable branch.
11928
11929 @item -mbase-addresses
11930 @itemx -mno-base-addresses
11931 @opindex mbase-addresses
11932 @opindex mno-base-addresses
11933 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11934 base address automatically generates a request (handled by the assembler
11935 and the linker) for a constant to be set up in a global register.  The
11936 register is used for one or more base address requests within the range 0
11937 to 255 from the value held in the register.  The generally leads to short
11938 and fast code, but the number of different data items that can be
11939 addressed is limited.  This means that a program that uses lots of static
11940 data may require @option{-mno-base-addresses}.
11941
11942 @item -msingle-exit
11943 @itemx -mno-single-exit
11944 @opindex msingle-exit
11945 @opindex mno-single-exit
11946 Force (do not force) generated code to have a single exit point in each
11947 function.
11948 @end table
11949
11950 @node MN10300 Options
11951 @subsection MN10300 Options
11952 @cindex MN10300 options
11953
11954 These @option{-m} options are defined for Matsushita MN10300 architectures:
11955
11956 @table @gcctabopt
11957 @item -mmult-bug
11958 @opindex mmult-bug
11959 Generate code to avoid bugs in the multiply instructions for the MN10300
11960 processors.  This is the default.
11961
11962 @item -mno-mult-bug
11963 @opindex mno-mult-bug
11964 Do not generate code to avoid bugs in the multiply instructions for the
11965 MN10300 processors.
11966
11967 @item -mam33
11968 @opindex mam33
11969 Generate code which uses features specific to the AM33 processor.
11970
11971 @item -mno-am33
11972 @opindex mno-am33
11973 Do not generate code which uses features specific to the AM33 processor.  This
11974 is the default.
11975
11976 @item -mreturn-pointer-on-d0
11977 @opindex mreturn-pointer-on-d0
11978 When generating a function which returns a pointer, return the pointer
11979 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11980 only in a0, and attempts to call such functions without a prototype
11981 would result in errors.  Note that this option is on by default; use
11982 @option{-mno-return-pointer-on-d0} to disable it.
11983
11984 @item -mno-crt0
11985 @opindex mno-crt0
11986 Do not link in the C run-time initialization object file.
11987
11988 @item -mrelax
11989 @opindex mrelax
11990 Indicate to the linker that it should perform a relaxation optimization pass
11991 to shorten branches, calls and absolute memory addresses.  This option only
11992 has an effect when used on the command line for the final link step.
11993
11994 This option makes symbolic debugging impossible.
11995 @end table
11996
11997 @node MT Options
11998 @subsection MT Options
11999 @cindex MT options
12000
12001 These @option{-m} options are defined for Morpho MT architectures:
12002
12003 @table @gcctabopt
12004
12005 @item -march=@var{cpu-type}
12006 @opindex march
12007 Generate code that will run on @var{cpu-type}, which is the name of a system
12008 representing a certain processor type.  Possible values for
12009 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
12010 @samp{ms1-16-003} and @samp{ms2}.
12011
12012 When this option is not used, the default is @option{-march=ms1-16-002}.
12013
12014 @item -mbacc
12015 @opindex mbacc
12016 Use byte loads and stores when generating code.
12017
12018 @item -mno-bacc
12019 @opindex mno-bacc
12020 Do not use byte loads and stores when generating code.
12021
12022 @item -msim
12023 @opindex msim
12024 Use simulator runtime
12025
12026 @item -mno-crt0
12027 @opindex mno-crt0
12028 Do not link in the C run-time initialization object file
12029 @file{crti.o}.  Other run-time initialization and termination files
12030 such as @file{startup.o} and @file{exit.o} are still included on the
12031 linker command line.
12032
12033 @end table
12034
12035 @node PDP-11 Options
12036 @subsection PDP-11 Options
12037 @cindex PDP-11 Options
12038
12039 These options are defined for the PDP-11:
12040
12041 @table @gcctabopt
12042 @item -mfpu
12043 @opindex mfpu
12044 Use hardware FPP floating point.  This is the default.  (FIS floating
12045 point on the PDP-11/40 is not supported.)
12046
12047 @item -msoft-float
12048 @opindex msoft-float
12049 Do not use hardware floating point.
12050
12051 @item -mac0
12052 @opindex mac0
12053 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
12054
12055 @item -mno-ac0
12056 @opindex mno-ac0
12057 Return floating-point results in memory.  This is the default.
12058
12059 @item -m40
12060 @opindex m40
12061 Generate code for a PDP-11/40.
12062
12063 @item -m45
12064 @opindex m45
12065 Generate code for a PDP-11/45.  This is the default.
12066
12067 @item -m10
12068 @opindex m10
12069 Generate code for a PDP-11/10.
12070
12071 @item -mbcopy-builtin
12072 @opindex bcopy-builtin
12073 Use inline @code{movmemhi} patterns for copying memory.  This is the
12074 default.
12075
12076 @item -mbcopy
12077 @opindex mbcopy
12078 Do not use inline @code{movmemhi} patterns for copying memory.
12079
12080 @item -mint16
12081 @itemx -mno-int32
12082 @opindex mint16
12083 @opindex mno-int32
12084 Use 16-bit @code{int}.  This is the default.
12085
12086 @item -mint32
12087 @itemx -mno-int16
12088 @opindex mint32
12089 @opindex mno-int16
12090 Use 32-bit @code{int}.
12091
12092 @item -mfloat64
12093 @itemx -mno-float32
12094 @opindex mfloat64
12095 @opindex mno-float32
12096 Use 64-bit @code{float}.  This is the default.
12097
12098 @item -mfloat32
12099 @itemx -mno-float64
12100 @opindex mfloat32
12101 @opindex mno-float64
12102 Use 32-bit @code{float}.
12103
12104 @item -mabshi
12105 @opindex mabshi
12106 Use @code{abshi2} pattern.  This is the default.
12107
12108 @item -mno-abshi
12109 @opindex mno-abshi
12110 Do not use @code{abshi2} pattern.
12111
12112 @item -mbranch-expensive
12113 @opindex mbranch-expensive
12114 Pretend that branches are expensive.  This is for experimenting with
12115 code generation only.
12116
12117 @item -mbranch-cheap
12118 @opindex mbranch-cheap
12119 Do not pretend that branches are expensive.  This is the default.
12120
12121 @item -msplit
12122 @opindex msplit
12123 Generate code for a system with split I&D@.
12124
12125 @item -mno-split
12126 @opindex mno-split
12127 Generate code for a system without split I&D@.  This is the default.
12128
12129 @item -munix-asm
12130 @opindex munix-asm
12131 Use Unix assembler syntax.  This is the default when configured for
12132 @samp{pdp11-*-bsd}.
12133
12134 @item -mdec-asm
12135 @opindex mdec-asm
12136 Use DEC assembler syntax.  This is the default when configured for any
12137 PDP-11 target other than @samp{pdp11-*-bsd}.
12138 @end table
12139
12140 @node PowerPC Options
12141 @subsection PowerPC Options
12142 @cindex PowerPC options
12143
12144 These are listed under @xref{RS/6000 and PowerPC Options}.
12145
12146 @node RS/6000 and PowerPC Options
12147 @subsection IBM RS/6000 and PowerPC Options
12148 @cindex RS/6000 and PowerPC Options
12149 @cindex IBM RS/6000 and PowerPC Options
12150
12151 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
12152 @table @gcctabopt
12153 @item -mpower
12154 @itemx -mno-power
12155 @itemx -mpower2
12156 @itemx -mno-power2
12157 @itemx -mpowerpc
12158 @itemx -mno-powerpc
12159 @itemx -mpowerpc-gpopt
12160 @itemx -mno-powerpc-gpopt
12161 @itemx -mpowerpc-gfxopt
12162 @itemx -mno-powerpc-gfxopt
12163 @itemx -mpowerpc64
12164 @itemx -mno-powerpc64
12165 @itemx -mmfcrf
12166 @itemx -mno-mfcrf
12167 @itemx -mpopcntb
12168 @itemx -mno-popcntb
12169 @itemx -mfprnd
12170 @itemx -mno-fprnd
12171 @itemx -mcmpb
12172 @itemx -mno-cmpb
12173 @itemx -mmfpgpr
12174 @itemx -mno-mfpgpr
12175 @itemx -mdfp
12176 @itemx -mno-dfp
12177 @opindex mpower
12178 @opindex mno-power
12179 @opindex mpower2
12180 @opindex mno-power2
12181 @opindex mpowerpc
12182 @opindex mno-powerpc
12183 @opindex mpowerpc-gpopt
12184 @opindex mno-powerpc-gpopt
12185 @opindex mpowerpc-gfxopt
12186 @opindex mno-powerpc-gfxopt
12187 @opindex mpowerpc64
12188 @opindex mno-powerpc64
12189 @opindex mmfcrf
12190 @opindex mno-mfcrf
12191 @opindex mpopcntb
12192 @opindex mno-popcntb
12193 @opindex mfprnd
12194 @opindex mno-fprnd
12195 @opindex mcmpb
12196 @opindex mno-cmpb
12197 @opindex mmfpgpr
12198 @opindex mno-mfpgpr
12199 @opindex mdfp
12200 @opindex mno-dfp
12201 GCC supports two related instruction set architectures for the
12202 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
12203 instructions supported by the @samp{rios} chip set used in the original
12204 RS/6000 systems and the @dfn{PowerPC} instruction set is the
12205 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
12206 the IBM 4xx, 6xx, and follow-on microprocessors.
12207
12208 Neither architecture is a subset of the other.  However there is a
12209 large common subset of instructions supported by both.  An MQ
12210 register is included in processors supporting the POWER architecture.
12211
12212 You use these options to specify which instructions are available on the
12213 processor you are using.  The default value of these options is
12214 determined when configuring GCC@.  Specifying the
12215 @option{-mcpu=@var{cpu_type}} overrides the specification of these
12216 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
12217 rather than the options listed above.
12218
12219 The @option{-mpower} option allows GCC to generate instructions that
12220 are found only in the POWER architecture and to use the MQ register.
12221 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
12222 to generate instructions that are present in the POWER2 architecture but
12223 not the original POWER architecture.
12224
12225 The @option{-mpowerpc} option allows GCC to generate instructions that
12226 are found only in the 32-bit subset of the PowerPC architecture.
12227 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
12228 GCC to use the optional PowerPC architecture instructions in the
12229 General Purpose group, including floating-point square root.  Specifying
12230 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
12231 use the optional PowerPC architecture instructions in the Graphics
12232 group, including floating-point select.
12233
12234 The @option{-mmfcrf} option allows GCC to generate the move from
12235 condition register field instruction implemented on the POWER4
12236 processor and other processors that support the PowerPC V2.01
12237 architecture.
12238 The @option{-mpopcntb} option allows GCC to generate the popcount and
12239 double precision FP reciprocal estimate instruction implemented on the
12240 POWER5 processor and other processors that support the PowerPC V2.02
12241 architecture.
12242 The @option{-mfprnd} option allows GCC to generate the FP round to
12243 integer instructions implemented on the POWER5+ processor and other
12244 processors that support the PowerPC V2.03 architecture.
12245 The @option{-mcmpb} option allows GCC to generate the compare bytes
12246 instruction implemented on the POWER6 processor and other processors
12247 that support the PowerPC V2.05 architecture.
12248 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
12249 general purpose register instructions implemented on the POWER6X
12250 processor and other processors that support the extended PowerPC V2.05
12251 architecture.
12252 The @option{-mdfp} option allows GCC to generate the decimal floating
12253 point instructions implemented on some POWER processors.
12254
12255 The @option{-mpowerpc64} option allows GCC to generate the additional
12256 64-bit instructions that are found in the full PowerPC64 architecture
12257 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
12258 @option{-mno-powerpc64}.
12259
12260 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
12261 will use only the instructions in the common subset of both
12262 architectures plus some special AIX common-mode calls, and will not use
12263 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
12264 permits GCC to use any instruction from either architecture and to
12265 allow use of the MQ register; specify this for the Motorola MPC601.
12266
12267 @item -mnew-mnemonics
12268 @itemx -mold-mnemonics
12269 @opindex mnew-mnemonics
12270 @opindex mold-mnemonics
12271 Select which mnemonics to use in the generated assembler code.  With
12272 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
12273 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
12274 assembler mnemonics defined for the POWER architecture.  Instructions
12275 defined in only one architecture have only one mnemonic; GCC uses that
12276 mnemonic irrespective of which of these options is specified.
12277
12278 GCC defaults to the mnemonics appropriate for the architecture in
12279 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
12280 value of these option.  Unless you are building a cross-compiler, you
12281 should normally not specify either @option{-mnew-mnemonics} or
12282 @option{-mold-mnemonics}, but should instead accept the default.
12283
12284 @item -mcpu=@var{cpu_type}
12285 @opindex mcpu
12286 Set architecture type, register usage, choice of mnemonics, and
12287 instruction scheduling parameters for machine type @var{cpu_type}.
12288 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
12289 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
12290 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
12291 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
12292 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
12293 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
12294 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
12295 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
12296 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
12297 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
12298
12299 @option{-mcpu=common} selects a completely generic processor.  Code
12300 generated under this option will run on any POWER or PowerPC processor.
12301 GCC will use only the instructions in the common subset of both
12302 architectures, and will not use the MQ register.  GCC assumes a generic
12303 processor model for scheduling purposes.
12304
12305 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
12306 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
12307 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
12308 types, with an appropriate, generic processor model assumed for
12309 scheduling purposes.
12310
12311 The other options specify a specific processor.  Code generated under
12312 those options will run best on that processor, and may not run at all on
12313 others.
12314
12315 The @option{-mcpu} options automatically enable or disable the
12316 following options:
12317
12318 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
12319 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
12320 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
12321
12322 The particular options set for any particular CPU will vary between
12323 compiler versions, depending on what setting seems to produce optimal
12324 code for that CPU; it doesn't necessarily reflect the actual hardware's
12325 capabilities.  If you wish to set an individual option to a particular
12326 value, you may specify it after the @option{-mcpu} option, like
12327 @samp{-mcpu=970 -mno-altivec}.
12328
12329 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
12330 not enabled or disabled by the @option{-mcpu} option at present because
12331 AIX does not have full support for these options.  You may still
12332 enable or disable them individually if you're sure it'll work in your
12333 environment.
12334
12335 @item -mtune=@var{cpu_type}
12336 @opindex mtune
12337 Set the instruction scheduling parameters for machine type
12338 @var{cpu_type}, but do not set the architecture type, register usage, or
12339 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
12340 values for @var{cpu_type} are used for @option{-mtune} as for
12341 @option{-mcpu}.  If both are specified, the code generated will use the
12342 architecture, registers, and mnemonics set by @option{-mcpu}, but the
12343 scheduling parameters set by @option{-mtune}.
12344
12345 @item -mswdiv
12346 @itemx -mno-swdiv
12347 @opindex mswdiv
12348 @opindex mno-swdiv
12349 Generate code to compute division as reciprocal estimate and iterative
12350 refinement, creating opportunities for increased throughput.  This
12351 feature requires: optional PowerPC Graphics instruction set for single
12352 precision and FRE instruction for double precision, assuming divides
12353 cannot generate user-visible traps, and the domain values not include
12354 Infinities, denormals or zero denominator.
12355
12356 @item -maltivec
12357 @itemx -mno-altivec
12358 @opindex maltivec
12359 @opindex mno-altivec
12360 Generate code that uses (does not use) AltiVec instructions, and also
12361 enable the use of built-in functions that allow more direct access to
12362 the AltiVec instruction set.  You may also need to set
12363 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
12364 enhancements.
12365
12366 @item -mvrsave
12367 @item -mno-vrsave
12368 @opindex mvrsave
12369 @opindex mno-vrsave
12370 Generate VRSAVE instructions when generating AltiVec code.
12371
12372 @item -msecure-plt
12373 @opindex msecure-plt
12374 Generate code that allows ld and ld.so to build executables and shared
12375 libraries with non-exec .plt and .got sections.  This is a PowerPC
12376 32-bit SYSV ABI option.
12377
12378 @item -mbss-plt
12379 @opindex mbss-plt
12380 Generate code that uses a BSS .plt section that ld.so fills in, and
12381 requires .plt and .got sections that are both writable and executable.
12382 This is a PowerPC 32-bit SYSV ABI option.
12383
12384 @item -misel
12385 @itemx -mno-isel
12386 @opindex misel
12387 @opindex mno-isel
12388 This switch enables or disables the generation of ISEL instructions.
12389
12390 @item -misel=@var{yes/no}
12391 This switch has been deprecated.  Use @option{-misel} and
12392 @option{-mno-isel} instead.
12393
12394 @item -mspe
12395 @itemx -mno-spe
12396 @opindex mspe
12397 @opindex mno-spe
12398 This switch enables or disables the generation of SPE simd
12399 instructions.
12400
12401 @item -mspe=@var{yes/no}
12402 This option has been deprecated.  Use @option{-mspe} and
12403 @option{-mno-spe} instead.
12404
12405 @item -mfloat-gprs=@var{yes/single/double/no}
12406 @itemx -mfloat-gprs
12407 @opindex mfloat-gprs
12408 This switch enables or disables the generation of floating point
12409 operations on the general purpose registers for architectures that
12410 support it.
12411
12412 The argument @var{yes} or @var{single} enables the use of
12413 single-precision floating point operations.
12414
12415 The argument @var{double} enables the use of single and
12416 double-precision floating point operations.
12417
12418 The argument @var{no} disables floating point operations on the
12419 general purpose registers.
12420
12421 This option is currently only available on the MPC854x.
12422
12423 @item -m32
12424 @itemx -m64
12425 @opindex m32
12426 @opindex m64
12427 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
12428 targets (including GNU/Linux).  The 32-bit environment sets int, long
12429 and pointer to 32 bits and generates code that runs on any PowerPC
12430 variant.  The 64-bit environment sets int to 32 bits and long and
12431 pointer to 64 bits, and generates code for PowerPC64, as for
12432 @option{-mpowerpc64}.
12433
12434 @item -mfull-toc
12435 @itemx -mno-fp-in-toc
12436 @itemx -mno-sum-in-toc
12437 @itemx -mminimal-toc
12438 @opindex mfull-toc
12439 @opindex mno-fp-in-toc
12440 @opindex mno-sum-in-toc
12441 @opindex mminimal-toc
12442 Modify generation of the TOC (Table Of Contents), which is created for
12443 every executable file.  The @option{-mfull-toc} option is selected by
12444 default.  In that case, GCC will allocate at least one TOC entry for
12445 each unique non-automatic variable reference in your program.  GCC
12446 will also place floating-point constants in the TOC@.  However, only
12447 16,384 entries are available in the TOC@.
12448
12449 If you receive a linker error message that saying you have overflowed
12450 the available TOC space, you can reduce the amount of TOC space used
12451 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
12452 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
12453 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
12454 generate code to calculate the sum of an address and a constant at
12455 run-time instead of putting that sum into the TOC@.  You may specify one
12456 or both of these options.  Each causes GCC to produce very slightly
12457 slower and larger code at the expense of conserving TOC space.
12458
12459 If you still run out of space in the TOC even when you specify both of
12460 these options, specify @option{-mminimal-toc} instead.  This option causes
12461 GCC to make only one TOC entry for every file.  When you specify this
12462 option, GCC will produce code that is slower and larger but which
12463 uses extremely little TOC space.  You may wish to use this option
12464 only on files that contain less frequently executed code.
12465
12466 @item -maix64
12467 @itemx -maix32
12468 @opindex maix64
12469 @opindex maix32
12470 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
12471 @code{long} type, and the infrastructure needed to support them.
12472 Specifying @option{-maix64} implies @option{-mpowerpc64} and
12473 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
12474 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
12475
12476 @item -mxl-compat
12477 @itemx -mno-xl-compat
12478 @opindex mxl-compat
12479 @opindex mno-xl-compat
12480 Produce code that conforms more closely to IBM XL compiler semantics
12481 when using AIX-compatible ABI.  Pass floating-point arguments to
12482 prototyped functions beyond the register save area (RSA) on the stack
12483 in addition to argument FPRs.  Do not assume that most significant
12484 double in 128-bit long double value is properly rounded when comparing
12485 values and converting to double.  Use XL symbol names for long double
12486 support routines.
12487
12488 The AIX calling convention was extended but not initially documented to
12489 handle an obscure K&R C case of calling a function that takes the
12490 address of its arguments with fewer arguments than declared.  IBM XL
12491 compilers access floating point arguments which do not fit in the
12492 RSA from the stack when a subroutine is compiled without
12493 optimization.  Because always storing floating-point arguments on the
12494 stack is inefficient and rarely needed, this option is not enabled by
12495 default and only is necessary when calling subroutines compiled by IBM
12496 XL compilers without optimization.
12497
12498 @item -mpe
12499 @opindex mpe
12500 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
12501 application written to use message passing with special startup code to
12502 enable the application to run.  The system must have PE installed in the
12503 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
12504 must be overridden with the @option{-specs=} option to specify the
12505 appropriate directory location.  The Parallel Environment does not
12506 support threads, so the @option{-mpe} option and the @option{-pthread}
12507 option are incompatible.
12508
12509 @item -malign-natural
12510 @itemx -malign-power
12511 @opindex malign-natural
12512 @opindex malign-power
12513 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
12514 @option{-malign-natural} overrides the ABI-defined alignment of larger
12515 types, such as floating-point doubles, on their natural size-based boundary.
12516 The option @option{-malign-power} instructs GCC to follow the ABI-specified
12517 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
12518
12519 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
12520 is not supported.
12521
12522 @item -msoft-float
12523 @itemx -mhard-float
12524 @opindex msoft-float
12525 @opindex mhard-float
12526 Generate code that does not use (uses) the floating-point register set.
12527 Software floating point emulation is provided if you use the
12528 @option{-msoft-float} option, and pass the option to GCC when linking.
12529
12530 @item -mmultiple
12531 @itemx -mno-multiple
12532 @opindex mmultiple
12533 @opindex mno-multiple
12534 Generate code that uses (does not use) the load multiple word
12535 instructions and the store multiple word instructions.  These
12536 instructions are generated by default on POWER systems, and not
12537 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
12538 endian PowerPC systems, since those instructions do not work when the
12539 processor is in little endian mode.  The exceptions are PPC740 and
12540 PPC750 which permit the instructions usage in little endian mode.
12541
12542 @item -mstring
12543 @itemx -mno-string
12544 @opindex mstring
12545 @opindex mno-string
12546 Generate code that uses (does not use) the load string instructions
12547 and the store string word instructions to save multiple registers and
12548 do small block moves.  These instructions are generated by default on
12549 POWER systems, and not generated on PowerPC systems.  Do not use
12550 @option{-mstring} on little endian PowerPC systems, since those
12551 instructions do not work when the processor is in little endian mode.
12552 The exceptions are PPC740 and PPC750 which permit the instructions
12553 usage in little endian mode.
12554
12555 @item -mupdate
12556 @itemx -mno-update
12557 @opindex mupdate
12558 @opindex mno-update
12559 Generate code that uses (does not use) the load or store instructions
12560 that update the base register to the address of the calculated memory
12561 location.  These instructions are generated by default.  If you use
12562 @option{-mno-update}, there is a small window between the time that the
12563 stack pointer is updated and the address of the previous frame is
12564 stored, which means code that walks the stack frame across interrupts or
12565 signals may get corrupted data.
12566
12567 @item -mfused-madd
12568 @itemx -mno-fused-madd
12569 @opindex mfused-madd
12570 @opindex mno-fused-madd
12571 Generate code that uses (does not use) the floating point multiply and
12572 accumulate instructions.  These instructions are generated by default if
12573 hardware floating is used.
12574
12575 @item -mmulhw
12576 @itemx -mno-mulhw
12577 @opindex mmulhw
12578 @opindex mno-mulhw
12579 Generate code that uses (does not use) the half-word multiply and
12580 multiply-accumulate instructions on the IBM 405 and 440 processors.
12581 These instructions are generated by default when targetting those
12582 processors.
12583
12584 @item -mdlmzb
12585 @itemx -mno-dlmzb
12586 @opindex mdlmzb
12587 @opindex mno-dlmzb
12588 Generate code that uses (does not use) the string-search @samp{dlmzb}
12589 instruction on the IBM 405 and 440 processors.  This instruction is
12590 generated by default when targetting those processors.
12591
12592 @item -mno-bit-align
12593 @itemx -mbit-align
12594 @opindex mno-bit-align
12595 @opindex mbit-align
12596 On System V.4 and embedded PowerPC systems do not (do) force structures
12597 and unions that contain bit-fields to be aligned to the base type of the
12598 bit-field.
12599
12600 For example, by default a structure containing nothing but 8
12601 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
12602 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
12603 the structure would be aligned to a 1 byte boundary and be one byte in
12604 size.
12605
12606 @item -mno-strict-align
12607 @itemx -mstrict-align
12608 @opindex mno-strict-align
12609 @opindex mstrict-align
12610 On System V.4 and embedded PowerPC systems do not (do) assume that
12611 unaligned memory references will be handled by the system.
12612
12613 @item -mrelocatable
12614 @itemx -mno-relocatable
12615 @opindex mrelocatable
12616 @opindex mno-relocatable
12617 On embedded PowerPC systems generate code that allows (does not allow)
12618 the program to be relocated to a different address at runtime.  If you
12619 use @option{-mrelocatable} on any module, all objects linked together must
12620 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
12621
12622 @item -mrelocatable-lib
12623 @itemx -mno-relocatable-lib
12624 @opindex mrelocatable-lib
12625 @opindex mno-relocatable-lib
12626 On embedded PowerPC systems generate code that allows (does not allow)
12627 the program to be relocated to a different address at runtime.  Modules
12628 compiled with @option{-mrelocatable-lib} can be linked with either modules
12629 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
12630 with modules compiled with the @option{-mrelocatable} options.
12631
12632 @item -mno-toc
12633 @itemx -mtoc
12634 @opindex mno-toc
12635 @opindex mtoc
12636 On System V.4 and embedded PowerPC systems do not (do) assume that
12637 register 2 contains a pointer to a global area pointing to the addresses
12638 used in the program.
12639
12640 @item -mlittle
12641 @itemx -mlittle-endian
12642 @opindex mlittle
12643 @opindex mlittle-endian
12644 On System V.4 and embedded PowerPC systems compile code for the
12645 processor in little endian mode.  The @option{-mlittle-endian} option is
12646 the same as @option{-mlittle}.
12647
12648 @item -mbig
12649 @itemx -mbig-endian
12650 @opindex mbig
12651 @opindex mbig-endian
12652 On System V.4 and embedded PowerPC systems compile code for the
12653 processor in big endian mode.  The @option{-mbig-endian} option is
12654 the same as @option{-mbig}.
12655
12656 @item -mdynamic-no-pic
12657 @opindex mdynamic-no-pic
12658 On Darwin and Mac OS X systems, compile code so that it is not
12659 relocatable, but that its external references are relocatable.  The
12660 resulting code is suitable for applications, but not shared
12661 libraries.
12662
12663 @item -mprioritize-restricted-insns=@var{priority}
12664 @opindex mprioritize-restricted-insns
12665 This option controls the priority that is assigned to
12666 dispatch-slot restricted instructions during the second scheduling
12667 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
12668 @var{no/highest/second-highest} priority to dispatch slot restricted
12669 instructions.
12670
12671 @item -msched-costly-dep=@var{dependence_type}
12672 @opindex msched-costly-dep
12673 This option controls which dependences are considered costly
12674 by the target during instruction scheduling.  The argument
12675 @var{dependence_type} takes one of the following values:
12676 @var{no}: no dependence is costly,
12677 @var{all}: all dependences are costly,
12678 @var{true_store_to_load}: a true dependence from store to load is costly,
12679 @var{store_to_load}: any dependence from store to load is costly,
12680 @var{number}: any dependence which latency >= @var{number} is costly.
12681
12682 @item -minsert-sched-nops=@var{scheme}
12683 @opindex minsert-sched-nops
12684 This option controls which nop insertion scheme will be used during
12685 the second scheduling pass.  The argument @var{scheme} takes one of the
12686 following values:
12687 @var{no}: Don't insert nops.
12688 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
12689 according to the scheduler's grouping.
12690 @var{regroup_exact}: Insert nops to force costly dependent insns into
12691 separate groups.  Insert exactly as many nops as needed to force an insn
12692 to a new group, according to the estimated processor grouping.
12693 @var{number}: Insert nops to force costly dependent insns into
12694 separate groups.  Insert @var{number} nops to force an insn to a new group.
12695
12696 @item -mcall-sysv
12697 @opindex mcall-sysv
12698 On System V.4 and embedded PowerPC systems compile code using calling
12699 conventions that adheres to the March 1995 draft of the System V
12700 Application Binary Interface, PowerPC processor supplement.  This is the
12701 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
12702
12703 @item -mcall-sysv-eabi
12704 @opindex mcall-sysv-eabi
12705 Specify both @option{-mcall-sysv} and @option{-meabi} options.
12706
12707 @item -mcall-sysv-noeabi
12708 @opindex mcall-sysv-noeabi
12709 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
12710
12711 @item -mcall-solaris
12712 @opindex mcall-solaris
12713 On System V.4 and embedded PowerPC systems compile code for the Solaris
12714 operating system.
12715
12716 @item -mcall-linux
12717 @opindex mcall-linux
12718 On System V.4 and embedded PowerPC systems compile code for the
12719 Linux-based GNU system.
12720
12721 @item -mcall-gnu
12722 @opindex mcall-gnu
12723 On System V.4 and embedded PowerPC systems compile code for the
12724 Hurd-based GNU system.
12725
12726 @item -mcall-netbsd
12727 @opindex mcall-netbsd
12728 On System V.4 and embedded PowerPC systems compile code for the
12729 NetBSD operating system.
12730
12731 @item -maix-struct-return
12732 @opindex maix-struct-return
12733 Return all structures in memory (as specified by the AIX ABI)@.
12734
12735 @item -msvr4-struct-return
12736 @opindex msvr4-struct-return
12737 Return structures smaller than 8 bytes in registers (as specified by the
12738 SVR4 ABI)@.
12739
12740 @item -mabi=@var{abi-type}
12741 @opindex mabi
12742 Extend the current ABI with a particular extension, or remove such extension.
12743 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
12744 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
12745
12746 @item -mabi=spe
12747 @opindex mabi=spe
12748 Extend the current ABI with SPE ABI extensions.  This does not change
12749 the default ABI, instead it adds the SPE ABI extensions to the current
12750 ABI@.
12751
12752 @item -mabi=no-spe
12753 @opindex mabi=no-spe
12754 Disable Booke SPE ABI extensions for the current ABI@.
12755
12756 @item -mabi=ibmlongdouble
12757 @opindex mabi=ibmlongdouble
12758 Change the current ABI to use IBM extended precision long double.
12759 This is a PowerPC 32-bit SYSV ABI option.
12760
12761 @item -mabi=ieeelongdouble
12762 @opindex mabi=ieeelongdouble
12763 Change the current ABI to use IEEE extended precision long double.
12764 This is a PowerPC 32-bit Linux ABI option.
12765
12766 @item -mprototype
12767 @itemx -mno-prototype
12768 @opindex mprototype
12769 @opindex mno-prototype
12770 On System V.4 and embedded PowerPC systems assume that all calls to
12771 variable argument functions are properly prototyped.  Otherwise, the
12772 compiler must insert an instruction before every non prototyped call to
12773 set or clear bit 6 of the condition code register (@var{CR}) to
12774 indicate whether floating point values were passed in the floating point
12775 registers in case the function takes a variable arguments.  With
12776 @option{-mprototype}, only calls to prototyped variable argument functions
12777 will set or clear the bit.
12778
12779 @item -msim
12780 @opindex msim
12781 On embedded PowerPC systems, assume that the startup module is called
12782 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12783 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12784 configurations.
12785
12786 @item -mmvme
12787 @opindex mmvme
12788 On embedded PowerPC systems, assume that the startup module is called
12789 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12790 @file{libc.a}.
12791
12792 @item -mads
12793 @opindex mads
12794 On embedded PowerPC systems, assume that the startup module is called
12795 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12796 @file{libc.a}.
12797
12798 @item -myellowknife
12799 @opindex myellowknife
12800 On embedded PowerPC systems, assume that the startup module is called
12801 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12802 @file{libc.a}.
12803
12804 @item -mvxworks
12805 @opindex mvxworks
12806 On System V.4 and embedded PowerPC systems, specify that you are
12807 compiling for a VxWorks system.
12808
12809 @item -mwindiss
12810 @opindex mwindiss
12811 Specify that you are compiling for the WindISS simulation environment.
12812
12813 @item -memb
12814 @opindex memb
12815 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12816 header to indicate that @samp{eabi} extended relocations are used.
12817
12818 @item -meabi
12819 @itemx -mno-eabi
12820 @opindex meabi
12821 @opindex mno-eabi
12822 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12823 Embedded Applications Binary Interface (eabi) which is a set of
12824 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12825 means that the stack is aligned to an 8 byte boundary, a function
12826 @code{__eabi} is called to from @code{main} to set up the eabi
12827 environment, and the @option{-msdata} option can use both @code{r2} and
12828 @code{r13} to point to two separate small data areas.  Selecting
12829 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12830 do not call an initialization function from @code{main}, and the
12831 @option{-msdata} option will only use @code{r13} to point to a single
12832 small data area.  The @option{-meabi} option is on by default if you
12833 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12834
12835 @item -msdata=eabi
12836 @opindex msdata=eabi
12837 On System V.4 and embedded PowerPC systems, put small initialized
12838 @code{const} global and static data in the @samp{.sdata2} section, which
12839 is pointed to by register @code{r2}.  Put small initialized
12840 non-@code{const} global and static data in the @samp{.sdata} section,
12841 which is pointed to by register @code{r13}.  Put small uninitialized
12842 global and static data in the @samp{.sbss} section, which is adjacent to
12843 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12844 incompatible with the @option{-mrelocatable} option.  The
12845 @option{-msdata=eabi} option also sets the @option{-memb} option.
12846
12847 @item -msdata=sysv
12848 @opindex msdata=sysv
12849 On System V.4 and embedded PowerPC systems, put small global and static
12850 data in the @samp{.sdata} section, which is pointed to by register
12851 @code{r13}.  Put small uninitialized global and static data in the
12852 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12853 The @option{-msdata=sysv} option is incompatible with the
12854 @option{-mrelocatable} option.
12855
12856 @item -msdata=default
12857 @itemx -msdata
12858 @opindex msdata=default
12859 @opindex msdata
12860 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12861 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12862 same as @option{-msdata=sysv}.
12863
12864 @item -msdata-data
12865 @opindex msdata-data
12866 On System V.4 and embedded PowerPC systems, put small global
12867 data in the @samp{.sdata} section.  Put small uninitialized global
12868 data in the @samp{.sbss} section.  Do not use register @code{r13}
12869 to address small data however.  This is the default behavior unless
12870 other @option{-msdata} options are used.
12871
12872 @item -msdata=none
12873 @itemx -mno-sdata
12874 @opindex msdata=none
12875 @opindex mno-sdata
12876 On embedded PowerPC systems, put all initialized global and static data
12877 in the @samp{.data} section, and all uninitialized data in the
12878 @samp{.bss} section.
12879
12880 @item -G @var{num}
12881 @opindex G
12882 @cindex smaller data references (PowerPC)
12883 @cindex .sdata/.sdata2 references (PowerPC)
12884 On embedded PowerPC systems, put global and static items less than or
12885 equal to @var{num} bytes into the small data or bss sections instead of
12886 the normal data or bss section.  By default, @var{num} is 8.  The
12887 @option{-G @var{num}} switch is also passed to the linker.
12888 All modules should be compiled with the same @option{-G @var{num}} value.
12889
12890 @item -mregnames
12891 @itemx -mno-regnames
12892 @opindex mregnames
12893 @opindex mno-regnames
12894 On System V.4 and embedded PowerPC systems do (do not) emit register
12895 names in the assembly language output using symbolic forms.
12896
12897 @item -mlongcall
12898 @itemx -mno-longcall
12899 @opindex mlongcall
12900 @opindex mno-longcall
12901 By default assume that all calls are far away so that a longer more
12902 expensive calling sequence is required.  This is required for calls
12903 further than 32 megabytes (33,554,432 bytes) from the current location.
12904 A short call will be generated if the compiler knows
12905 the call cannot be that far away.  This setting can be overridden by
12906 the @code{shortcall} function attribute, or by @code{#pragma
12907 longcall(0)}.
12908
12909 Some linkers are capable of detecting out-of-range calls and generating
12910 glue code on the fly.  On these systems, long calls are unnecessary and
12911 generate slower code.  As of this writing, the AIX linker can do this,
12912 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12913 to the GNU linker for 32-bit PowerPC systems as well.
12914
12915 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12916 callee, L42'', plus a ``branch island'' (glue code).  The two target
12917 addresses represent the callee and the ``branch island''.  The
12918 Darwin/PPC linker will prefer the first address and generate a ``bl
12919 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12920 otherwise, the linker will generate ``bl L42'' to call the ``branch
12921 island''.  The ``branch island'' is appended to the body of the
12922 calling function; it computes the full 32-bit address of the callee
12923 and jumps to it.
12924
12925 On Mach-O (Darwin) systems, this option directs the compiler emit to
12926 the glue for every direct call, and the Darwin linker decides whether
12927 to use or discard it.
12928
12929 In the future, we may cause GCC to ignore all longcall specifications
12930 when the linker is known to generate glue.
12931
12932 @item -pthread
12933 @opindex pthread
12934 Adds support for multithreading with the @dfn{pthreads} library.
12935 This option sets flags for both the preprocessor and linker.
12936
12937 @end table
12938
12939 @node S/390 and zSeries Options
12940 @subsection S/390 and zSeries Options
12941 @cindex S/390 and zSeries Options
12942
12943 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12944
12945 @table @gcctabopt
12946 @item -mhard-float
12947 @itemx -msoft-float
12948 @opindex mhard-float
12949 @opindex msoft-float
12950 Use (do not use) the hardware floating-point instructions and registers
12951 for floating-point operations.  When @option{-msoft-float} is specified,
12952 functions in @file{libgcc.a} will be used to perform floating-point
12953 operations.  When @option{-mhard-float} is specified, the compiler
12954 generates IEEE floating-point instructions.  This is the default.
12955
12956 @item -mlong-double-64
12957 @itemx -mlong-double-128
12958 @opindex mlong-double-64
12959 @opindex mlong-double-128
12960 These switches control the size of @code{long double} type. A size
12961 of 64bit makes the @code{long double} type equivalent to the @code{double}
12962 type. This is the default.
12963
12964 @item -mbackchain
12965 @itemx -mno-backchain
12966 @opindex mbackchain
12967 @opindex mno-backchain
12968 Store (do not store) the address of the caller's frame as backchain pointer
12969 into the callee's stack frame.
12970 A backchain may be needed to allow debugging using tools that do not understand
12971 DWARF-2 call frame information.
12972 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12973 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12974 the backchain is placed into the topmost word of the 96/160 byte register
12975 save area.
12976
12977 In general, code compiled with @option{-mbackchain} is call-compatible with
12978 code compiled with @option{-mmo-backchain}; however, use of the backchain
12979 for debugging purposes usually requires that the whole binary is built with
12980 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12981 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12982 to build a linux kernel use @option{-msoft-float}.
12983
12984 The default is to not maintain the backchain.
12985
12986 @item -mpacked-stack
12987 @item -mno-packed-stack
12988 @opindex mpacked-stack
12989 @opindex mno-packed-stack
12990 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12991 specified, the compiler uses the all fields of the 96/160 byte register save
12992 area only for their default purpose; unused fields still take up stack space.
12993 When @option{-mpacked-stack} is specified, register save slots are densely
12994 packed at the top of the register save area; unused space is reused for other
12995 purposes, allowing for more efficient use of the available stack space.
12996 However, when @option{-mbackchain} is also in effect, the topmost word of
12997 the save area is always used to store the backchain, and the return address
12998 register is always saved two words below the backchain.
12999
13000 As long as the stack frame backchain is not used, code generated with
13001 @option{-mpacked-stack} is call-compatible with code generated with
13002 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
13003 S/390 or zSeries generated code that uses the stack frame backchain at run
13004 time, not just for debugging purposes.  Such code is not call-compatible
13005 with code compiled with @option{-mpacked-stack}.  Also, note that the
13006 combination of @option{-mbackchain},
13007 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13008 to build a linux kernel use @option{-msoft-float}.
13009
13010 The default is to not use the packed stack layout.
13011
13012 @item -msmall-exec
13013 @itemx -mno-small-exec
13014 @opindex msmall-exec
13015 @opindex mno-small-exec
13016 Generate (or do not generate) code using the @code{bras} instruction
13017 to do subroutine calls.
13018 This only works reliably if the total executable size does not
13019 exceed 64k.  The default is to use the @code{basr} instruction instead,
13020 which does not have this limitation.
13021
13022 @item -m64
13023 @itemx -m31
13024 @opindex m64
13025 @opindex m31
13026 When @option{-m31} is specified, generate code compliant to the
13027 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
13028 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
13029 particular to generate 64-bit instructions.  For the @samp{s390}
13030 targets, the default is @option{-m31}, while the @samp{s390x}
13031 targets default to @option{-m64}.
13032
13033 @item -mzarch
13034 @itemx -mesa
13035 @opindex mzarch
13036 @opindex mesa
13037 When @option{-mzarch} is specified, generate code using the
13038 instructions available on z/Architecture.
13039 When @option{-mesa} is specified, generate code using the
13040 instructions available on ESA/390.  Note that @option{-mesa} is
13041 not possible with @option{-m64}.
13042 When generating code compliant to the GNU/Linux for S/390 ABI,
13043 the default is @option{-mesa}.  When generating code compliant
13044 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
13045
13046 @item -mmvcle
13047 @itemx -mno-mvcle
13048 @opindex mmvcle
13049 @opindex mno-mvcle
13050 Generate (or do not generate) code using the @code{mvcle} instruction
13051 to perform block moves.  When @option{-mno-mvcle} is specified,
13052 use a @code{mvc} loop instead.  This is the default unless optimizing for
13053 size.
13054
13055 @item -mdebug
13056 @itemx -mno-debug
13057 @opindex mdebug
13058 @opindex mno-debug
13059 Print (or do not print) additional debug information when compiling.
13060 The default is to not print debug information.
13061
13062 @item -march=@var{cpu-type}
13063 @opindex march
13064 Generate code that will run on @var{cpu-type}, which is the name of a system
13065 representing a certain processor type.  Possible values for
13066 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
13067 When generating code using the instructions available on z/Architecture,
13068 the default is @option{-march=z900}.  Otherwise, the default is
13069 @option{-march=g5}.
13070
13071 @item -mtune=@var{cpu-type}
13072 @opindex mtune
13073 Tune to @var{cpu-type} everything applicable about the generated code,
13074 except for the ABI and the set of available instructions.
13075 The list of @var{cpu-type} values is the same as for @option{-march}.
13076 The default is the value used for @option{-march}.
13077
13078 @item -mtpf-trace
13079 @itemx -mno-tpf-trace
13080 @opindex mtpf-trace
13081 @opindex mno-tpf-trace
13082 Generate code that adds (does not add) in TPF OS specific branches to trace
13083 routines in the operating system.  This option is off by default, even
13084 when compiling for the TPF OS@.
13085
13086 @item -mfused-madd
13087 @itemx -mno-fused-madd
13088 @opindex mfused-madd
13089 @opindex mno-fused-madd
13090 Generate code that uses (does not use) the floating point multiply and
13091 accumulate instructions.  These instructions are generated by default if
13092 hardware floating point is used.
13093
13094 @item -mwarn-framesize=@var{framesize}
13095 @opindex mwarn-framesize
13096 Emit a warning if the current function exceeds the given frame size.  Because
13097 this is a compile time check it doesn't need to be a real problem when the program
13098 runs.  It is intended to identify functions which most probably cause
13099 a stack overflow.  It is useful to be used in an environment with limited stack
13100 size e.g.@: the linux kernel.
13101
13102 @item -mwarn-dynamicstack
13103 @opindex mwarn-dynamicstack
13104 Emit a warning if the function calls alloca or uses dynamically
13105 sized arrays.  This is generally a bad idea with a limited stack size.
13106
13107 @item -mstack-guard=@var{stack-guard}
13108 @item -mstack-size=@var{stack-size}
13109 @opindex mstack-guard
13110 @opindex mstack-size
13111 If these options are provided the s390 back end emits additional instructions in
13112 the function prologue which trigger a trap if the stack size is @var{stack-guard}
13113 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
13114 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
13115 the frame size of the compiled function is chosen.
13116 These options are intended to be used to help debugging stack overflow problems.
13117 The additionally emitted code causes only little overhead and hence can also be
13118 used in production like systems without greater performance degradation.  The given
13119 values have to be exact powers of 2 and @var{stack-size} has to be greater than
13120 @var{stack-guard} without exceeding 64k.
13121 In order to be efficient the extra code makes the assumption that the stack starts
13122 at an address aligned to the value given by @var{stack-size}.
13123 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
13124 @end table
13125
13126 @node Score Options
13127 @subsection Score Options
13128 @cindex Score Options
13129
13130 These options are defined for Score implementations:
13131
13132 @table @gcctabopt
13133 @item -meb
13134 @opindex meb
13135 Compile code for big endian mode.  This is the default.
13136
13137 @item -mel
13138 @opindex mel
13139 Compile code for little endian mode. 
13140
13141 @item -mnhwloop
13142 @opindex mnhwloop
13143 Disable generate bcnz instruction.
13144
13145 @item -muls
13146 @opindex muls
13147 Enable generate unaligned load and store instruction.
13148
13149 @item -mmac
13150 @opindex mmac
13151 Enable the use of multiply-accumulate instructions. Disabled by default. 
13152
13153 @item -mscore5
13154 @opindex mscore5
13155 Specify the SCORE5 as the target architecture.
13156
13157 @item -mscore5u
13158 @opindex mscore5u
13159 Specify the SCORE5U of the target architecture.
13160
13161 @item -mscore7
13162 @opindex mscore7
13163 Specify the SCORE7 as the target architecture. This is the default.
13164
13165 @item -mscore7d
13166 @opindex mscore7d
13167 Specify the SCORE7D as the target architecture.
13168 @end table
13169
13170 @node SH Options
13171 @subsection SH Options
13172
13173 These @samp{-m} options are defined for the SH implementations:
13174
13175 @table @gcctabopt
13176 @item -m1
13177 @opindex m1
13178 Generate code for the SH1.
13179
13180 @item -m2
13181 @opindex m2
13182 Generate code for the SH2.
13183
13184 @item -m2e
13185 Generate code for the SH2e.
13186
13187 @item -m3
13188 @opindex m3
13189 Generate code for the SH3.
13190
13191 @item -m3e
13192 @opindex m3e
13193 Generate code for the SH3e.
13194
13195 @item -m4-nofpu
13196 @opindex m4-nofpu
13197 Generate code for the SH4 without a floating-point unit.
13198
13199 @item -m4-single-only
13200 @opindex m4-single-only
13201 Generate code for the SH4 with a floating-point unit that only
13202 supports single-precision arithmetic.
13203
13204 @item -m4-single
13205 @opindex m4-single
13206 Generate code for the SH4 assuming the floating-point unit is in
13207 single-precision mode by default.
13208
13209 @item -m4
13210 @opindex m4
13211 Generate code for the SH4.
13212
13213 @item -m4a-nofpu
13214 @opindex m4a-nofpu
13215 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
13216 floating-point unit is not used.
13217
13218 @item -m4a-single-only
13219 @opindex m4a-single-only
13220 Generate code for the SH4a, in such a way that no double-precision
13221 floating point operations are used.
13222
13223 @item -m4a-single
13224 @opindex m4a-single
13225 Generate code for the SH4a assuming the floating-point unit is in
13226 single-precision mode by default.
13227
13228 @item -m4a
13229 @opindex m4a
13230 Generate code for the SH4a.
13231
13232 @item -m4al
13233 @opindex m4al
13234 Same as @option{-m4a-nofpu}, except that it implicitly passes
13235 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
13236 instructions at the moment.
13237
13238 @item -mb
13239 @opindex mb
13240 Compile code for the processor in big endian mode.
13241
13242 @item -ml
13243 @opindex ml
13244 Compile code for the processor in little endian mode.
13245
13246 @item -mdalign
13247 @opindex mdalign
13248 Align doubles at 64-bit boundaries.  Note that this changes the calling
13249 conventions, and thus some functions from the standard C library will
13250 not work unless you recompile it first with @option{-mdalign}.
13251
13252 @item -mrelax
13253 @opindex mrelax
13254 Shorten some address references at link time, when possible; uses the
13255 linker option @option{-relax}.
13256
13257 @item -mbigtable
13258 @opindex mbigtable
13259 Use 32-bit offsets in @code{switch} tables.  The default is to use
13260 16-bit offsets.
13261
13262 @item -mfmovd
13263 @opindex mfmovd
13264 Enable the use of the instruction @code{fmovd}.
13265
13266 @item -mhitachi
13267 @opindex mhitachi
13268 Comply with the calling conventions defined by Renesas.
13269
13270 @item -mrenesas
13271 @opindex mhitachi
13272 Comply with the calling conventions defined by Renesas.
13273
13274 @item -mno-renesas
13275 @opindex mhitachi
13276 Comply with the calling conventions defined for GCC before the Renesas
13277 conventions were available.  This option is the default for all
13278 targets of the SH toolchain except for @samp{sh-symbianelf}.
13279
13280 @item -mnomacsave
13281 @opindex mnomacsave
13282 Mark the @code{MAC} register as call-clobbered, even if
13283 @option{-mhitachi} is given.
13284
13285 @item -mieee
13286 @opindex mieee
13287 Increase IEEE-compliance of floating-point code.
13288 At the moment, this is equivalent to @option{-fno-finite-math-only}.
13289 When generating 16 bit SH opcodes, getting IEEE-conforming results for
13290 comparisons of NANs / infinities incurs extra overhead in every
13291 floating point comparison, therefore the default is set to
13292 @option{-ffinite-math-only}.
13293
13294 @item -minline-ic_invalidate
13295 @opindex minline-ic_invalidate
13296 Inline code to invalidate instruction cache entries after setting up
13297 nested function trampolines.
13298 This option has no effect if -musermode is in effect and the selected
13299 code generation option (e.g. -m4) does not allow the use of the icbi
13300 instruction.
13301 If the selected code generation option does not allow the use of the icbi
13302 instruction, and -musermode is not in effect, the inlined code will
13303 manipulate the instruction cache address array directly with an associative
13304 write.  This not only requires privileged mode, but it will also
13305 fail if the cache line had been mapped via the TLB and has become unmapped.
13306
13307 @item -misize
13308 @opindex misize
13309 Dump instruction size and location in the assembly code.
13310
13311 @item -mpadstruct
13312 @opindex mpadstruct
13313 This option is deprecated.  It pads structures to multiple of 4 bytes,
13314 which is incompatible with the SH ABI@.
13315
13316 @item -mspace
13317 @opindex mspace
13318 Optimize for space instead of speed.  Implied by @option{-Os}.
13319
13320 @item -mprefergot
13321 @opindex mprefergot
13322 When generating position-independent code, emit function calls using
13323 the Global Offset Table instead of the Procedure Linkage Table.
13324
13325 @item -musermode
13326 @opindex musermode
13327 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
13328 if the inlined code would not work in user mode.
13329 This is the default when the target is @code{sh-*-linux*}.
13330
13331 @item -multcost=@var{number}
13332 @opindex multcost=@var{number}
13333 Set the cost to assume for a multiply insn.
13334
13335 @item -mdiv=@var{strategy}
13336 @opindex mdiv=@var{strategy}
13337 Set the division strategy to use for SHmedia code.  @var{strategy} must be
13338 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
13339 inv:call2, inv:fp .
13340 "fp" performs the operation in floating point.  This has a very high latency,
13341 but needs only a few instructions, so it might be a good choice if
13342 your code has enough easily exploitable ILP to allow the compiler to
13343 schedule the floating point instructions together with other instructions.
13344 Division by zero causes a floating point exception.
13345 "inv" uses integer operations to calculate the inverse of the divisor,
13346 and then multiplies the dividend with the inverse.  This strategy allows
13347 cse and hoisting of the inverse calculation.  Division by zero calculates
13348 an unspecified result, but does not trap.
13349 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
13350 have been found, or if the entire operation has been hoisted to the same
13351 place, the last stages of the inverse calculation are intertwined with the
13352 final multiply to reduce the overall latency, at the expense of using a few
13353 more instructions, and thus offering fewer scheduling opportunities with
13354 other code.
13355 "call" calls a library function that usually implements the inv:minlat
13356 strategy.
13357 This gives high code density for m5-*media-nofpu compilations.
13358 "call2" uses a different entry point of the same library function, where it
13359 assumes that a pointer to a lookup table has already been set up, which
13360 exposes the pointer load to cse / code hoisting optimizations.
13361 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
13362 code generation, but if the code stays unoptimized, revert to the "call",
13363 "call2", or "fp" strategies, respectively.  Note that the
13364 potentially-trapping side effect of division by zero is carried by a
13365 separate instruction, so it is possible that all the integer instructions
13366 are hoisted out, but the marker for the side effect stays where it is.
13367 A recombination to fp operations or a call is not possible in that case.
13368 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
13369 that the inverse calculation was nor separated from the multiply, they speed
13370 up division where the dividend fits into 20 bits (plus sign where applicable),
13371 by inserting a test to skip a number of operations in this case; this test
13372 slows down the case of larger dividends.  inv20u assumes the case of a such
13373 a small dividend to be unlikely, and inv20l assumes it to be likely.
13374
13375 @item -mdivsi3_libfunc=@var{name}
13376 @opindex mdivsi3_libfunc=@var{name}
13377 Set the name of the library function used for 32 bit signed division to
13378 @var{name}.  This only affect the name used in the call and inv:call
13379 division strategies, and the compiler will still expect the same
13380 sets of input/output/clobbered registers as if this option was not present.
13381
13382 @item -madjust-unroll
13383 @opindex madjust-unroll
13384 Throttle unrolling to avoid thrashing target registers.
13385 This option only has an effect if the gcc code base supports the
13386 TARGET_ADJUST_UNROLL_MAX target hook.
13387
13388 @item -mindexed-addressing
13389 @opindex mindexed-addressing
13390 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
13391 This is only safe if the hardware and/or OS implement 32 bit wrap-around
13392 semantics for the indexed addressing mode.  The architecture allows the
13393 implementation of processors with 64 bit MMU, which the OS could use to
13394 get 32 bit addressing, but since no current hardware implementation supports
13395 this or any other way to make the indexed addressing mode safe to use in
13396 the 32 bit ABI, the default is -mno-indexed-addressing.
13397
13398 @item -mgettrcost=@var{number}
13399 @opindex mgettrcost=@var{number}
13400 Set the cost assumed for the gettr instruction to @var{number}.
13401 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
13402
13403 @item -mpt-fixed
13404 @opindex mpt-fixed
13405 Assume pt* instructions won't trap.  This will generally generate better
13406 scheduled code, but is unsafe on current hardware.  The current architecture
13407 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
13408 This has the unintentional effect of making it unsafe to schedule ptabs /
13409 ptrel before a branch, or hoist it out of a loop.  For example,
13410 __do_global_ctors, a part of libgcc that runs constructors at program
13411 startup, calls functions in a list which is delimited by @minus{}1.  With the
13412 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
13413 That means that all the constructors will be run a bit quicker, but when
13414 the loop comes to the end of the list, the program crashes because ptabs
13415 loads @minus{}1 into a target register.  Since this option is unsafe for any
13416 hardware implementing the current architecture specification, the default
13417 is -mno-pt-fixed.  Unless the user specifies a specific cost with
13418 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
13419 this deters register allocation using target registers for storing
13420 ordinary integers.
13421
13422 @item -minvalid-symbols
13423 @opindex minvalid-symbols
13424 Assume symbols might be invalid.  Ordinary function symbols generated by
13425 the compiler will always be valid to load with movi/shori/ptabs or
13426 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
13427 to generate symbols that will cause ptabs / ptrel to trap.
13428 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
13429 It will then prevent cross-basic-block cse, hoisting and most scheduling
13430 of symbol loads.  The default is @option{-mno-invalid-symbols}.
13431 @end table
13432
13433 @node SPARC Options
13434 @subsection SPARC Options
13435 @cindex SPARC options
13436
13437 These @samp{-m} options are supported on the SPARC:
13438
13439 @table @gcctabopt
13440 @item -mno-app-regs
13441 @itemx -mapp-regs
13442 @opindex mno-app-regs
13443 @opindex mapp-regs
13444 Specify @option{-mapp-regs} to generate output using the global registers
13445 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
13446 is the default.
13447
13448 To be fully SVR4 ABI compliant at the cost of some performance loss,
13449 specify @option{-mno-app-regs}.  You should compile libraries and system
13450 software with this option.
13451
13452 @item -mfpu
13453 @itemx -mhard-float
13454 @opindex mfpu
13455 @opindex mhard-float
13456 Generate output containing floating point instructions.  This is the
13457 default.
13458
13459 @item -mno-fpu
13460 @itemx -msoft-float
13461 @opindex mno-fpu
13462 @opindex msoft-float
13463 Generate output containing library calls for floating point.
13464 @strong{Warning:} the requisite libraries are not available for all SPARC
13465 targets.  Normally the facilities of the machine's usual C compiler are
13466 used, but this cannot be done directly in cross-compilation.  You must make
13467 your own arrangements to provide suitable library functions for
13468 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
13469 @samp{sparclite-*-*} do provide software floating point support.
13470
13471 @option{-msoft-float} changes the calling convention in the output file;
13472 therefore, it is only useful if you compile @emph{all} of a program with
13473 this option.  In particular, you need to compile @file{libgcc.a}, the
13474 library that comes with GCC, with @option{-msoft-float} in order for
13475 this to work.
13476
13477 @item -mhard-quad-float
13478 @opindex mhard-quad-float
13479 Generate output containing quad-word (long double) floating point
13480 instructions.
13481
13482 @item -msoft-quad-float
13483 @opindex msoft-quad-float
13484 Generate output containing library calls for quad-word (long double)
13485 floating point instructions.  The functions called are those specified
13486 in the SPARC ABI@.  This is the default.
13487
13488 As of this writing, there are no SPARC implementations that have hardware
13489 support for the quad-word floating point instructions.  They all invoke
13490 a trap handler for one of these instructions, and then the trap handler
13491 emulates the effect of the instruction.  Because of the trap handler overhead,
13492 this is much slower than calling the ABI library routines.  Thus the
13493 @option{-msoft-quad-float} option is the default.
13494
13495 @item -mno-unaligned-doubles
13496 @itemx -munaligned-doubles
13497 @opindex mno-unaligned-doubles
13498 @opindex munaligned-doubles
13499 Assume that doubles have 8 byte alignment.  This is the default.
13500
13501 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
13502 alignment only if they are contained in another type, or if they have an
13503 absolute address.  Otherwise, it assumes they have 4 byte alignment.
13504 Specifying this option avoids some rare compatibility problems with code
13505 generated by other compilers.  It is not the default because it results
13506 in a performance loss, especially for floating point code.
13507
13508 @item -mno-faster-structs
13509 @itemx -mfaster-structs
13510 @opindex mno-faster-structs
13511 @opindex mfaster-structs
13512 With @option{-mfaster-structs}, the compiler assumes that structures
13513 should have 8 byte alignment.  This enables the use of pairs of
13514 @code{ldd} and @code{std} instructions for copies in structure
13515 assignment, in place of twice as many @code{ld} and @code{st} pairs.
13516 However, the use of this changed alignment directly violates the SPARC
13517 ABI@.  Thus, it's intended only for use on targets where the developer
13518 acknowledges that their resulting code will not be directly in line with
13519 the rules of the ABI@.
13520
13521 @item -mimpure-text
13522 @opindex mimpure-text
13523 @option{-mimpure-text}, used in addition to @option{-shared}, tells
13524 the compiler to not pass @option{-z text} to the linker when linking a
13525 shared object.  Using this option, you can link position-dependent
13526 code into a shared object.
13527
13528 @option{-mimpure-text} suppresses the ``relocations remain against
13529 allocatable but non-writable sections'' linker error message.
13530 However, the necessary relocations will trigger copy-on-write, and the
13531 shared object is not actually shared across processes.  Instead of
13532 using @option{-mimpure-text}, you should compile all source code with
13533 @option{-fpic} or @option{-fPIC}.
13534
13535 This option is only available on SunOS and Solaris.
13536
13537 @item -mcpu=@var{cpu_type}
13538 @opindex mcpu
13539 Set the instruction set, register set, and instruction scheduling parameters
13540 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
13541 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
13542 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
13543 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
13544 @samp{ultrasparc3}, and @samp{niagara}.
13545
13546 Default instruction scheduling parameters are used for values that select
13547 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
13548 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
13549
13550 Here is a list of each supported architecture and their supported
13551 implementations.
13552
13553 @smallexample
13554     v7:             cypress
13555     v8:             supersparc, hypersparc
13556     sparclite:      f930, f934, sparclite86x
13557     sparclet:       tsc701
13558     v9:             ultrasparc, ultrasparc3, niagara
13559 @end smallexample
13560
13561 By default (unless configured otherwise), GCC generates code for the V7
13562 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
13563 additionally optimizes it for the Cypress CY7C602 chip, as used in the
13564 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
13565 SPARCStation 1, 2, IPX etc.
13566
13567 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
13568 architecture.  The only difference from V7 code is that the compiler emits
13569 the integer multiply and integer divide instructions which exist in SPARC-V8
13570 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
13571 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
13572 2000 series.
13573
13574 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
13575 the SPARC architecture.  This adds the integer multiply, integer divide step
13576 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
13577 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
13578 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
13579 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
13580 MB86934 chip, which is the more recent SPARClite with FPU@.
13581
13582 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
13583 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
13584 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
13585 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
13586 optimizes it for the TEMIC SPARClet chip.
13587
13588 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
13589 architecture.  This adds 64-bit integer and floating-point move instructions,
13590 3 additional floating-point condition code registers and conditional move
13591 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
13592 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
13593 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
13594 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
13595 @option{-mcpu=niagara}, the compiler additionally optimizes it for
13596 Sun UltraSPARC T1 chips.
13597
13598 @item -mtune=@var{cpu_type}
13599 @opindex mtune
13600 Set the instruction scheduling parameters for machine type
13601 @var{cpu_type}, but do not set the instruction set or register set that the
13602 option @option{-mcpu=@var{cpu_type}} would.
13603
13604 The same values for @option{-mcpu=@var{cpu_type}} can be used for
13605 @option{-mtune=@var{cpu_type}}, but the only useful values are those
13606 that select a particular cpu implementation.  Those are @samp{cypress},
13607 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
13608 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
13609 @samp{ultrasparc3}, and @samp{niagara}.
13610
13611 @item -mv8plus
13612 @itemx -mno-v8plus
13613 @opindex mv8plus
13614 @opindex mno-v8plus
13615 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
13616 difference from the V8 ABI is that the global and out registers are
13617 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
13618 mode for all SPARC-V9 processors.
13619
13620 @item -mvis
13621 @itemx -mno-vis
13622 @opindex mvis
13623 @opindex mno-vis
13624 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
13625 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
13626 @end table
13627
13628 These @samp{-m} options are supported in addition to the above
13629 on SPARC-V9 processors in 64-bit environments:
13630
13631 @table @gcctabopt
13632 @item -mlittle-endian
13633 @opindex mlittle-endian
13634 Generate code for a processor running in little-endian mode.  It is only
13635 available for a few configurations and most notably not on Solaris and Linux.
13636
13637 @item -m32
13638 @itemx -m64
13639 @opindex m32
13640 @opindex m64
13641 Generate code for a 32-bit or 64-bit environment.
13642 The 32-bit environment sets int, long and pointer to 32 bits.
13643 The 64-bit environment sets int to 32 bits and long and pointer
13644 to 64 bits.
13645
13646 @item -mcmodel=medlow
13647 @opindex mcmodel=medlow
13648 Generate code for the Medium/Low code model: 64-bit addresses, programs
13649 must be linked in the low 32 bits of memory.  Programs can be statically
13650 or dynamically linked.
13651
13652 @item -mcmodel=medmid
13653 @opindex mcmodel=medmid
13654 Generate code for the Medium/Middle code model: 64-bit addresses, programs
13655 must be linked in the low 44 bits of memory, the text and data segments must
13656 be less than 2GB in size and the data segment must be located within 2GB of
13657 the text segment.
13658
13659 @item -mcmodel=medany
13660 @opindex mcmodel=medany
13661 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
13662 may be linked anywhere in memory, the text and data segments must be less
13663 than 2GB in size and the data segment must be located within 2GB of the
13664 text segment.
13665
13666 @item -mcmodel=embmedany
13667 @opindex mcmodel=embmedany
13668 Generate code for the Medium/Anywhere code model for embedded systems:
13669 64-bit addresses, the text and data segments must be less than 2GB in
13670 size, both starting anywhere in memory (determined at link time).  The
13671 global register %g4 points to the base of the data segment.  Programs
13672 are statically linked and PIC is not supported.
13673
13674 @item -mstack-bias
13675 @itemx -mno-stack-bias
13676 @opindex mstack-bias
13677 @opindex mno-stack-bias
13678 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
13679 frame pointer if present, are offset by @minus{}2047 which must be added back
13680 when making stack frame references.  This is the default in 64-bit mode.
13681 Otherwise, assume no such offset is present.
13682 @end table
13683
13684 These switches are supported in addition to the above on Solaris:
13685
13686 @table @gcctabopt
13687 @item -threads
13688 @opindex threads
13689 Add support for multithreading using the Solaris threads library.  This
13690 option sets flags for both the preprocessor and linker.  This option does
13691 not affect the thread safety of object code produced by the compiler or
13692 that of libraries supplied with it.
13693
13694 @item -pthreads
13695 @opindex pthreads
13696 Add support for multithreading using the POSIX threads library.  This
13697 option sets flags for both the preprocessor and linker.  This option does
13698 not affect the thread safety of object code produced  by the compiler or
13699 that of libraries supplied with it.
13700
13701 @item -pthread
13702 @opindex pthread
13703 This is a synonym for @option{-pthreads}.
13704 @end table
13705
13706 @node SPU Options
13707 @subsection SPU Options
13708 @cindex SPU options
13709
13710 These @samp{-m} options are supported on the SPU:
13711
13712 @table @gcctabopt
13713 @item -mwarn-reloc
13714 @itemx -merror-reloc
13715 @opindex mwarn-reloc
13716 @opindex merror-reloc
13717
13718 The loader for SPU does not handle dynamic relocations.  By default, GCC
13719 will give an error when it generates code that requires a dynamic
13720 relocation.  @option{-mno-error-reloc} disables the error,
13721 @option{-mwarn-reloc} will generate a warning instead.
13722
13723 @item -msafe-dma
13724 @itemx -munsafe-dma
13725 @opindex msafe-dma
13726 @opindex munsafe-dma
13727
13728 Instructions which initiate or test completion of DMA must not be
13729 reordered with respect to loads and stores of the memory which is being
13730 accessed.  Users typically address this problem using the volatile
13731 keyword, but that can lead to inefficient code in places where the
13732 memory is known to not change.  Rather than mark the memory as volatile
13733 we treat the DMA instructions as potentially effecting all memory.  With
13734 @option{-munsafe-dma} users must use the volatile keyword to protect
13735 memory accesses.
13736
13737 @item -mbranch-hints
13738 @opindex mbranch-hints
13739
13740 By default, GCC will generate a branch hint instruction to avoid
13741 pipeline stalls for always taken or probably taken branches.  A hint
13742 will not be generated closer than 8 instructions away from its branch.
13743 There is little reason to disable them, except for debugging purposes,
13744 or to make an object a little bit smaller.
13745
13746 @item -msmall-mem
13747 @itemx -mlarge-mem
13748 @opindex msmall-mem
13749 @opindex mlarge-mem
13750
13751 By default, GCC generates code assuming that addresses are never larger
13752 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
13753 a full 32 bit address.
13754
13755 @item -mstdmain
13756 @opindex mstdmain
13757
13758 By default, GCC links against startup code that assumes the SPU-style
13759 main function interface (which has an unconventional parameter list).
13760 With @option{-mstdmain}, GCC will link your program against startup
13761 code that assumes a C99-style interface to @code{main}, including a
13762 local copy of @code{argv} strings.
13763
13764 @item -mfixed-range=@var{register-range}
13765 @opindex mfixed-range
13766 Generate code treating the given register range as fixed registers.
13767 A fixed register is one that the register allocator can not use.  This is
13768 useful when compiling kernel code.  A register range is specified as
13769 two registers separated by a dash.  Multiple register ranges can be
13770 specified separated by a comma.
13771
13772 @end table
13773
13774 @node System V Options
13775 @subsection Options for System V
13776
13777 These additional options are available on System V Release 4 for
13778 compatibility with other compilers on those systems:
13779
13780 @table @gcctabopt
13781 @item -G
13782 @opindex G
13783 Create a shared object.
13784 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13785
13786 @item -Qy
13787 @opindex Qy
13788 Identify the versions of each tool used by the compiler, in a
13789 @code{.ident} assembler directive in the output.
13790
13791 @item -Qn
13792 @opindex Qn
13793 Refrain from adding @code{.ident} directives to the output file (this is
13794 the default).
13795
13796 @item -YP,@var{dirs}
13797 @opindex YP
13798 Search the directories @var{dirs}, and no others, for libraries
13799 specified with @option{-l}.
13800
13801 @item -Ym,@var{dir}
13802 @opindex Ym
13803 Look in the directory @var{dir} to find the M4 preprocessor.
13804 The assembler uses this option.
13805 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13806 @c the generic assembler that comes with Solaris takes just -Ym.
13807 @end table
13808
13809 @node TMS320C3x/C4x Options
13810 @subsection TMS320C3x/C4x Options
13811 @cindex TMS320C3x/C4x Options
13812
13813 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
13814
13815 @table @gcctabopt
13816
13817 @item -mcpu=@var{cpu_type}
13818 @opindex mcpu
13819 Set the instruction set, register set, and instruction scheduling
13820 parameters for machine type @var{cpu_type}.  Supported values for
13821 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
13822 @samp{c44}.  The default is @samp{c40} to generate code for the
13823 TMS320C40.
13824
13825 @item -mbig-memory
13826 @itemx -mbig
13827 @itemx -msmall-memory
13828 @itemx -msmall
13829 @opindex mbig-memory
13830 @opindex mbig
13831 @opindex msmall-memory
13832 @opindex msmall
13833 Generates code for the big or small memory model.  The small memory
13834 model assumed that all data fits into one 64K word page.  At run-time
13835 the data page (DP) register must be set to point to the 64K page
13836 containing the .bss and .data program sections.  The big memory model is
13837 the default and requires reloading of the DP register for every direct
13838 memory access.
13839
13840 @item -mbk
13841 @itemx -mno-bk
13842 @opindex mbk
13843 @opindex mno-bk
13844 Allow (disallow) allocation of general integer operands into the block
13845 count register BK@.
13846
13847 @item -mdb
13848 @itemx -mno-db
13849 @opindex mdb
13850 @opindex mno-db
13851 Enable (disable) generation of code using decrement and branch,
13852 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13853 on the safe side, this is disabled for the C3x, since the maximum
13854 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13855 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13856 that it can utilize the decrement and branch instruction, but will give
13857 up if there is more than one memory reference in the loop.  Thus a loop
13858 where the loop counter is decremented can generate slightly more
13859 efficient code, in cases where the RPTB instruction cannot be utilized.
13860
13861 @item -mdp-isr-reload
13862 @itemx -mparanoid
13863 @opindex mdp-isr-reload
13864 @opindex mparanoid
13865 Force the DP register to be saved on entry to an interrupt service
13866 routine (ISR), reloaded to point to the data section, and restored on
13867 exit from the ISR@.  This should not be required unless someone has
13868 violated the small memory model by modifying the DP register, say within
13869 an object library.
13870
13871 @item -mmpyi
13872 @itemx -mno-mpyi
13873 @opindex mmpyi
13874 @opindex mno-mpyi
13875 For the C3x use the 24-bit MPYI instruction for integer multiplies
13876 instead of a library call to guarantee 32-bit results.  Note that if one
13877 of the operands is a constant, then the multiplication will be performed
13878 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13879 then squaring operations are performed inline instead of a library call.
13880
13881 @item -mfast-fix
13882 @itemx -mno-fast-fix
13883 @opindex mfast-fix
13884 @opindex mno-fast-fix
13885 The C3x/C4x FIX instruction to convert a floating point value to an
13886 integer value chooses the nearest integer less than or equal to the
13887 floating point value rather than to the nearest integer.  Thus if the
13888 floating point number is negative, the result will be incorrectly
13889 truncated an additional code is necessary to detect and correct this
13890 case.  This option can be used to disable generation of the additional
13891 code required to correct the result.
13892
13893 @item -mrptb
13894 @itemx -mno-rptb
13895 @opindex mrptb
13896 @opindex mno-rptb
13897 Enable (disable) generation of repeat block sequences using the RPTB
13898 instruction for zero overhead looping.  The RPTB construct is only used
13899 for innermost loops that do not call functions or jump across the loop
13900 boundaries.  There is no advantage having nested RPTB loops due to the
13901 overhead required to save and restore the RC, RS, and RE registers.
13902 This is enabled by default with @option{-O2}.
13903
13904 @item -mrpts=@var{count}
13905 @itemx -mno-rpts
13906 @opindex mrpts
13907 @opindex mno-rpts
13908 Enable (disable) the use of the single instruction repeat instruction
13909 RPTS@.  If a repeat block contains a single instruction, and the loop
13910 count can be guaranteed to be less than the value @var{count}, GCC will
13911 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13912 then a RPTS will be emitted even if the loop count cannot be determined
13913 at compile time.  Note that the repeated instruction following RPTS does
13914 not have to be reloaded from memory each iteration, thus freeing up the
13915 CPU buses for operands.  However, since interrupts are blocked by this
13916 instruction, it is disabled by default.
13917
13918 @item -mloop-unsigned
13919 @itemx -mno-loop-unsigned
13920 @opindex mloop-unsigned
13921 @opindex mno-loop-unsigned
13922 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13923 is @math{2^{31} + 1} since these instructions test if the iteration count is
13924 negative to terminate the loop.  If the iteration count is unsigned
13925 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13926 exceeded.  This switch allows an unsigned iteration count.
13927
13928 @item -mti
13929 @opindex mti
13930 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13931 with.  This also enforces compatibility with the API employed by the TI
13932 C3x C compiler.  For example, long doubles are passed as structures
13933 rather than in floating point registers.
13934
13935 @item -mregparm
13936 @itemx -mmemparm
13937 @opindex mregparm
13938 @opindex mmemparm
13939 Generate code that uses registers (stack) for passing arguments to functions.
13940 By default, arguments are passed in registers where possible rather
13941 than by pushing arguments on to the stack.
13942
13943 @item -mparallel-insns
13944 @itemx -mno-parallel-insns
13945 @opindex mparallel-insns
13946 @opindex mno-parallel-insns
13947 Allow the generation of parallel instructions.  This is enabled by
13948 default with @option{-O2}.
13949
13950 @item -mparallel-mpy
13951 @itemx -mno-parallel-mpy
13952 @opindex mparallel-mpy
13953 @opindex mno-parallel-mpy
13954 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13955 provided @option{-mparallel-insns} is also specified.  These instructions have
13956 tight register constraints which can pessimize the code generation
13957 of large functions.
13958
13959 @end table
13960
13961 @node V850 Options
13962 @subsection V850 Options
13963 @cindex V850 Options
13964
13965 These @samp{-m} options are defined for V850 implementations:
13966
13967 @table @gcctabopt
13968 @item -mlong-calls
13969 @itemx -mno-long-calls
13970 @opindex mlong-calls
13971 @opindex mno-long-calls
13972 Treat all calls as being far away (near).  If calls are assumed to be
13973 far away, the compiler will always load the functions address up into a
13974 register, and call indirect through the pointer.
13975
13976 @item -mno-ep
13977 @itemx -mep
13978 @opindex mno-ep
13979 @opindex mep
13980 Do not optimize (do optimize) basic blocks that use the same index
13981 pointer 4 or more times to copy pointer into the @code{ep} register, and
13982 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13983 option is on by default if you optimize.
13984
13985 @item -mno-prolog-function
13986 @itemx -mprolog-function
13987 @opindex mno-prolog-function
13988 @opindex mprolog-function
13989 Do not use (do use) external functions to save and restore registers
13990 at the prologue and epilogue of a function.  The external functions
13991 are slower, but use less code space if more than one function saves
13992 the same number of registers.  The @option{-mprolog-function} option
13993 is on by default if you optimize.
13994
13995 @item -mspace
13996 @opindex mspace
13997 Try to make the code as small as possible.  At present, this just turns
13998 on the @option{-mep} and @option{-mprolog-function} options.
13999
14000 @item -mtda=@var{n}
14001 @opindex mtda
14002 Put static or global variables whose size is @var{n} bytes or less into
14003 the tiny data area that register @code{ep} points to.  The tiny data
14004 area can hold up to 256 bytes in total (128 bytes for byte references).
14005
14006 @item -msda=@var{n}
14007 @opindex msda
14008 Put static or global variables whose size is @var{n} bytes or less into
14009 the small data area that register @code{gp} points to.  The small data
14010 area can hold up to 64 kilobytes.
14011
14012 @item -mzda=@var{n}
14013 @opindex mzda
14014 Put static or global variables whose size is @var{n} bytes or less into
14015 the first 32 kilobytes of memory.
14016
14017 @item -mv850
14018 @opindex mv850
14019 Specify that the target processor is the V850.
14020
14021 @item -mbig-switch
14022 @opindex mbig-switch
14023 Generate code suitable for big switch tables.  Use this option only if
14024 the assembler/linker complain about out of range branches within a switch
14025 table.
14026
14027 @item -mapp-regs
14028 @opindex mapp-regs
14029 This option will cause r2 and r5 to be used in the code generated by
14030 the compiler.  This setting is the default.
14031
14032 @item -mno-app-regs
14033 @opindex mno-app-regs
14034 This option will cause r2 and r5 to be treated as fixed registers.
14035
14036 @item -mv850e1
14037 @opindex mv850e1
14038 Specify that the target processor is the V850E1.  The preprocessor
14039 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
14040 this option is used.
14041
14042 @item -mv850e
14043 @opindex mv850e
14044 Specify that the target processor is the V850E@.  The preprocessor
14045 constant @samp{__v850e__} will be defined if this option is used.
14046
14047 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
14048 are defined then a default target processor will be chosen and the
14049 relevant @samp{__v850*__} preprocessor constant will be defined.
14050
14051 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
14052 defined, regardless of which processor variant is the target.
14053
14054 @item -mdisable-callt
14055 @opindex mdisable-callt
14056 This option will suppress generation of the CALLT instruction for the
14057 v850e and v850e1 flavors of the v850 architecture.  The default is
14058 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
14059
14060 @end table
14061
14062 @node VAX Options
14063 @subsection VAX Options
14064 @cindex VAX options
14065
14066 These @samp{-m} options are defined for the VAX:
14067
14068 @table @gcctabopt
14069 @item -munix
14070 @opindex munix
14071 Do not output certain jump instructions (@code{aobleq} and so on)
14072 that the Unix assembler for the VAX cannot handle across long
14073 ranges.
14074
14075 @item -mgnu
14076 @opindex mgnu
14077 Do output those jump instructions, on the assumption that you
14078 will assemble with the GNU assembler.
14079
14080 @item -mg
14081 @opindex mg
14082 Output code for g-format floating point numbers instead of d-format.
14083 @end table
14084
14085 @node VxWorks Options
14086 @subsection VxWorks Options
14087 @cindex VxWorks Options
14088
14089 The options in this section are defined for all VxWorks targets.
14090 Options specific to the target hardware are listed with the other
14091 options for that target.
14092
14093 @table @gcctabopt
14094 @item -mrtp
14095 @opindex mrtp
14096 GCC can generate code for both VxWorks kernels and real time processes
14097 (RTPs).  This option switches from the former to the latter.  It also
14098 defines the preprocessor macro @code{__RTP__}.
14099
14100 @item -non-static
14101 @opindex non-static
14102 Link an RTP executable against shared libraries rather than static
14103 libraries.  The options @option{-static} and @option{-shared} can
14104 also be used for RTPs (@pxref{Link Options}); @option{-static}
14105 is the default.
14106
14107 @item -Bstatic
14108 @itemx -Bdynamic
14109 @opindex Bstatic
14110 @opindex Bdynamic
14111 These options are passed down to the linker.  They are defined for
14112 compatibility with Diab.
14113
14114 @item -Xbind-lazy
14115 @opindex Xbind-lazy
14116 Enable lazy binding of function calls.  This option is equivalent to
14117 @option{-Wl,-z,now} and is defined for compatibility with Diab.
14118
14119 @item -Xbind-now
14120 @opindex Xbind-now
14121 Disable lazy binding of function calls.  This option is the default and
14122 is defined for compatibility with Diab.
14123 @end table
14124
14125 @node x86-64 Options
14126 @subsection x86-64 Options
14127 @cindex x86-64 options
14128
14129 These are listed under @xref{i386 and x86-64 Options}.
14130
14131 @node Xstormy16 Options
14132 @subsection Xstormy16 Options
14133 @cindex Xstormy16 Options
14134
14135 These options are defined for Xstormy16:
14136
14137 @table @gcctabopt
14138 @item -msim
14139 @opindex msim
14140 Choose startup files and linker script suitable for the simulator.
14141 @end table
14142
14143 @node Xtensa Options
14144 @subsection Xtensa Options
14145 @cindex Xtensa Options
14146
14147 These options are supported for Xtensa targets:
14148
14149 @table @gcctabopt
14150 @item -mconst16
14151 @itemx -mno-const16
14152 @opindex mconst16
14153 @opindex mno-const16
14154 Enable or disable use of @code{CONST16} instructions for loading
14155 constant values.  The @code{CONST16} instruction is currently not a
14156 standard option from Tensilica.  When enabled, @code{CONST16}
14157 instructions are always used in place of the standard @code{L32R}
14158 instructions.  The use of @code{CONST16} is enabled by default only if
14159 the @code{L32R} instruction is not available.
14160
14161 @item -mfused-madd
14162 @itemx -mno-fused-madd
14163 @opindex mfused-madd
14164 @opindex mno-fused-madd
14165 Enable or disable use of fused multiply/add and multiply/subtract
14166 instructions in the floating-point option.  This has no effect if the
14167 floating-point option is not also enabled.  Disabling fused multiply/add
14168 and multiply/subtract instructions forces the compiler to use separate
14169 instructions for the multiply and add/subtract operations.  This may be
14170 desirable in some cases where strict IEEE 754-compliant results are
14171 required: the fused multiply add/subtract instructions do not round the
14172 intermediate result, thereby producing results with @emph{more} bits of
14173 precision than specified by the IEEE standard.  Disabling fused multiply
14174 add/subtract instructions also ensures that the program output is not
14175 sensitive to the compiler's ability to combine multiply and add/subtract
14176 operations.
14177
14178 @item -mtext-section-literals
14179 @itemx -mno-text-section-literals
14180 @opindex mtext-section-literals
14181 @opindex mno-text-section-literals
14182 Control the treatment of literal pools.  The default is
14183 @option{-mno-text-section-literals}, which places literals in a separate
14184 section in the output file.  This allows the literal pool to be placed
14185 in a data RAM/ROM, and it also allows the linker to combine literal
14186 pools from separate object files to remove redundant literals and
14187 improve code size.  With @option{-mtext-section-literals}, the literals
14188 are interspersed in the text section in order to keep them as close as
14189 possible to their references.  This may be necessary for large assembly
14190 files.
14191
14192 @item -mtarget-align
14193 @itemx -mno-target-align
14194 @opindex mtarget-align
14195 @opindex mno-target-align
14196 When this option is enabled, GCC instructs the assembler to
14197 automatically align instructions to reduce branch penalties at the
14198 expense of some code density.  The assembler attempts to widen density
14199 instructions to align branch targets and the instructions following call
14200 instructions.  If there are not enough preceding safe density
14201 instructions to align a target, no widening will be performed.  The
14202 default is @option{-mtarget-align}.  These options do not affect the
14203 treatment of auto-aligned instructions like @code{LOOP}, which the
14204 assembler will always align, either by widening density instructions or
14205 by inserting no-op instructions.
14206
14207 @item -mlongcalls
14208 @itemx -mno-longcalls
14209 @opindex mlongcalls
14210 @opindex mno-longcalls
14211 When this option is enabled, GCC instructs the assembler to translate
14212 direct calls to indirect calls unless it can determine that the target
14213 of a direct call is in the range allowed by the call instruction.  This
14214 translation typically occurs for calls to functions in other source
14215 files.  Specifically, the assembler translates a direct @code{CALL}
14216 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
14217 The default is @option{-mno-longcalls}.  This option should be used in
14218 programs where the call target can potentially be out of range.  This
14219 option is implemented in the assembler, not the compiler, so the
14220 assembly code generated by GCC will still show direct call
14221 instructions---look at the disassembled object code to see the actual
14222 instructions.  Note that the assembler will use an indirect call for
14223 every cross-file call, not just those that really will be out of range.
14224 @end table
14225
14226 @node zSeries Options
14227 @subsection zSeries Options
14228 @cindex zSeries options
14229
14230 These are listed under @xref{S/390 and zSeries Options}.
14231
14232 @node Code Gen Options
14233 @section Options for Code Generation Conventions
14234 @cindex code generation conventions
14235 @cindex options, code generation
14236 @cindex run-time options
14237
14238 These machine-independent options control the interface conventions
14239 used in code generation.
14240
14241 Most of them have both positive and negative forms; the negative form
14242 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
14243 one of the forms is listed---the one which is not the default.  You
14244 can figure out the other form by either removing @samp{no-} or adding
14245 it.
14246
14247 @table @gcctabopt
14248 @item -fbounds-check
14249 @opindex fbounds-check
14250 For front-ends that support it, generate additional code to check that
14251 indices used to access arrays are within the declared range.  This is
14252 currently only supported by the Java and Fortran front-ends, where
14253 this option defaults to true and false respectively.
14254
14255 @item -ftrapv
14256 @opindex ftrapv
14257 This option generates traps for signed overflow on addition, subtraction,
14258 multiplication operations.
14259
14260 @item -fwrapv
14261 @opindex fwrapv
14262 This option instructs the compiler to assume that signed arithmetic
14263 overflow of addition, subtraction and multiplication wraps around
14264 using twos-complement representation.  This flag enables some optimizations
14265 and disables others.  This option is enabled by default for the Java
14266 front-end, as required by the Java language specification.
14267
14268 @item -fexceptions
14269 @opindex fexceptions
14270 Enable exception handling.  Generates extra code needed to propagate
14271 exceptions.  For some targets, this implies GCC will generate frame
14272 unwind information for all functions, which can produce significant data
14273 size overhead, although it does not affect execution.  If you do not
14274 specify this option, GCC will enable it by default for languages like
14275 C++ which normally require exception handling, and disable it for
14276 languages like C that do not normally require it.  However, you may need
14277 to enable this option when compiling C code that needs to interoperate
14278 properly with exception handlers written in C++.  You may also wish to
14279 disable this option if you are compiling older C++ programs that don't
14280 use exception handling.
14281
14282 @item -fnon-call-exceptions
14283 @opindex fnon-call-exceptions
14284 Generate code that allows trapping instructions to throw exceptions.
14285 Note that this requires platform-specific runtime support that does
14286 not exist everywhere.  Moreover, it only allows @emph{trapping}
14287 instructions to throw exceptions, i.e.@: memory references or floating
14288 point instructions.  It does not allow exceptions to be thrown from
14289 arbitrary signal handlers such as @code{SIGALRM}.
14290
14291 @item -funwind-tables
14292 @opindex funwind-tables
14293 Similar to @option{-fexceptions}, except that it will just generate any needed
14294 static data, but will not affect the generated code in any other way.
14295 You will normally not enable this option; instead, a language processor
14296 that needs this handling would enable it on your behalf.
14297
14298 @item -fasynchronous-unwind-tables
14299 @opindex fasynchronous-unwind-tables
14300 Generate unwind table in dwarf2 format, if supported by target machine.  The
14301 table is exact at each instruction boundary, so it can be used for stack
14302 unwinding from asynchronous events (such as debugger or garbage collector).
14303
14304 @item -fpcc-struct-return
14305 @opindex fpcc-struct-return
14306 Return ``short'' @code{struct} and @code{union} values in memory like
14307 longer ones, rather than in registers.  This convention is less
14308 efficient, but it has the advantage of allowing intercallability between
14309 GCC-compiled files and files compiled with other compilers, particularly
14310 the Portable C Compiler (pcc).
14311
14312 The precise convention for returning structures in memory depends
14313 on the target configuration macros.
14314
14315 Short structures and unions are those whose size and alignment match
14316 that of some integer type.
14317
14318 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
14319 switch is not binary compatible with code compiled with the
14320 @option{-freg-struct-return} switch.
14321 Use it to conform to a non-default application binary interface.
14322
14323 @item -freg-struct-return
14324 @opindex freg-struct-return
14325 Return @code{struct} and @code{union} values in registers when possible.
14326 This is more efficient for small structures than
14327 @option{-fpcc-struct-return}.
14328
14329 If you specify neither @option{-fpcc-struct-return} nor
14330 @option{-freg-struct-return}, GCC defaults to whichever convention is
14331 standard for the target.  If there is no standard convention, GCC
14332 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
14333 the principal compiler.  In those cases, we can choose the standard, and
14334 we chose the more efficient register return alternative.
14335
14336 @strong{Warning:} code compiled with the @option{-freg-struct-return}
14337 switch is not binary compatible with code compiled with the
14338 @option{-fpcc-struct-return} switch.
14339 Use it to conform to a non-default application binary interface.
14340
14341 @item -fshort-enums
14342 @opindex fshort-enums
14343 Allocate to an @code{enum} type only as many bytes as it needs for the
14344 declared range of possible values.  Specifically, the @code{enum} type
14345 will be equivalent to the smallest integer type which has enough room.
14346
14347 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
14348 code that is not binary compatible with code generated without that switch.
14349 Use it to conform to a non-default application binary interface.
14350
14351 @item -fshort-double
14352 @opindex fshort-double
14353 Use the same size for @code{double} as for @code{float}.
14354
14355 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
14356 code that is not binary compatible with code generated without that switch.
14357 Use it to conform to a non-default application binary interface.
14358
14359 @item -fshort-wchar
14360 @opindex fshort-wchar
14361 Override the underlying type for @samp{wchar_t} to be @samp{short
14362 unsigned int} instead of the default for the target.  This option is
14363 useful for building programs to run under WINE@.
14364
14365 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
14366 code that is not binary compatible with code generated without that switch.
14367 Use it to conform to a non-default application binary interface.
14368
14369 @item -fno-common
14370 @opindex fno-common
14371 In C, allocate even uninitialized global variables in the data section of the
14372 object file, rather than generating them as common blocks.  This has the
14373 effect that if the same variable is declared (without @code{extern}) in
14374 two different compilations, you will get an error when you link them.
14375 The only reason this might be useful is if you wish to verify that the
14376 program will work on other systems which always work this way.
14377
14378 @item -fno-ident
14379 @opindex fno-ident
14380 Ignore the @samp{#ident} directive.
14381
14382 @item -finhibit-size-directive
14383 @opindex finhibit-size-directive
14384 Don't output a @code{.size} assembler directive, or anything else that
14385 would cause trouble if the function is split in the middle, and the
14386 two halves are placed at locations far apart in memory.  This option is
14387 used when compiling @file{crtstuff.c}; you should not need to use it
14388 for anything else.
14389
14390 @item -fverbose-asm
14391 @opindex fverbose-asm
14392 Put extra commentary information in the generated assembly code to
14393 make it more readable.  This option is generally only of use to those
14394 who actually need to read the generated assembly code (perhaps while
14395 debugging the compiler itself).
14396
14397 @option{-fno-verbose-asm}, the default, causes the
14398 extra information to be omitted and is useful when comparing two assembler
14399 files.
14400
14401 @item -frecord-gcc-switches
14402 @opindex frecord-gcc-switches
14403 This switch causes the command line that was used to invoke the
14404 compiler to be recorded into the object file that is being created.
14405 This switch is only implemented on some targets and the exact format
14406 of the recording is target and binary file format dependent, but it
14407 usually takes the form of a section containing ASCII text.  This
14408 switch is related to the @option{-fverbose-asm} switch, but that
14409 switch only records information in the assembler output file as
14410 comments, so it never reaches the object file.
14411
14412 @item -fpic
14413 @opindex fpic
14414 @cindex global offset table
14415 @cindex PIC
14416 Generate position-independent code (PIC) suitable for use in a shared
14417 library, if supported for the target machine.  Such code accesses all
14418 constant addresses through a global offset table (GOT)@.  The dynamic
14419 loader resolves the GOT entries when the program starts (the dynamic
14420 loader is not part of GCC; it is part of the operating system).  If
14421 the GOT size for the linked executable exceeds a machine-specific
14422 maximum size, you get an error message from the linker indicating that
14423 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
14424 instead.  (These maximums are 8k on the SPARC and 32k
14425 on the m68k and RS/6000.  The 386 has no such limit.)
14426
14427 Position-independent code requires special support, and therefore works
14428 only on certain machines.  For the 386, GCC supports PIC for System V
14429 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
14430 position-independent.
14431
14432 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14433 are defined to 1.
14434
14435 @item -fPIC
14436 @opindex fPIC
14437 If supported for the target machine, emit position-independent code,
14438 suitable for dynamic linking and avoiding any limit on the size of the
14439 global offset table.  This option makes a difference on the m68k,
14440 PowerPC and SPARC@.
14441
14442 Position-independent code requires special support, and therefore works
14443 only on certain machines.
14444
14445 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
14446 are defined to 2.
14447
14448 @item -fpie
14449 @itemx -fPIE
14450 @opindex fpie
14451 @opindex fPIE
14452 These options are similar to @option{-fpic} and @option{-fPIC}, but
14453 generated position independent code can be only linked into executables.
14454 Usually these options are used when @option{-pie} GCC option will be
14455 used during linking.
14456
14457 @option{-fpie} and @option{-fPIE} both define the macros
14458 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
14459 for @option{-fpie} and 2 for @option{-fPIE}.
14460
14461 @item -fno-jump-tables
14462 @opindex fno-jump-tables
14463 Do not use jump tables for switch statements even where it would be
14464 more efficient than other code generation strategies.  This option is
14465 of use in conjunction with @option{-fpic} or @option{-fPIC} for
14466 building code which forms part of a dynamic linker and cannot
14467 reference the address of a jump table.  On some targets, jump tables
14468 do not require a GOT and this option is not needed.
14469
14470 @item -ffixed-@var{reg}
14471 @opindex ffixed
14472 Treat the register named @var{reg} as a fixed register; generated code
14473 should never refer to it (except perhaps as a stack pointer, frame
14474 pointer or in some other fixed role).
14475
14476 @var{reg} must be the name of a register.  The register names accepted
14477 are machine-specific and are defined in the @code{REGISTER_NAMES}
14478 macro in the machine description macro file.
14479
14480 This flag does not have a negative form, because it specifies a
14481 three-way choice.
14482
14483 @item -fcall-used-@var{reg}
14484 @opindex fcall-used
14485 Treat the register named @var{reg} as an allocable register that is
14486 clobbered by function calls.  It may be allocated for temporaries or
14487 variables that do not live across a call.  Functions compiled this way
14488 will not save and restore the register @var{reg}.
14489
14490 It is an error to used this flag with the frame pointer or stack pointer.
14491 Use of this flag for other registers that have fixed pervasive roles in
14492 the machine's execution model will produce disastrous results.
14493
14494 This flag does not have a negative form, because it specifies a
14495 three-way choice.
14496
14497 @item -fcall-saved-@var{reg}
14498 @opindex fcall-saved
14499 Treat the register named @var{reg} as an allocable register saved by
14500 functions.  It may be allocated even for temporaries or variables that
14501 live across a call.  Functions compiled this way will save and restore
14502 the register @var{reg} if they use it.
14503
14504 It is an error to used this flag with the frame pointer or stack pointer.
14505 Use of this flag for other registers that have fixed pervasive roles in
14506 the machine's execution model will produce disastrous results.
14507
14508 A different sort of disaster will result from the use of this flag for
14509 a register in which function values may be returned.
14510
14511 This flag does not have a negative form, because it specifies a
14512 three-way choice.
14513
14514 @item -fpack-struct[=@var{n}]
14515 @opindex fpack-struct
14516 Without a value specified, pack all structure members together without
14517 holes.  When a value is specified (which must be a small power of two), pack
14518 structure members according to this value, representing the maximum
14519 alignment (that is, objects with default alignment requirements larger than
14520 this will be output potentially unaligned at the next fitting location.
14521
14522 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
14523 code that is not binary compatible with code generated without that switch.
14524 Additionally, it makes the code suboptimal.
14525 Use it to conform to a non-default application binary interface.
14526
14527 @item -finstrument-functions
14528 @opindex finstrument-functions
14529 Generate instrumentation calls for entry and exit to functions.  Just
14530 after function entry and just before function exit, the following
14531 profiling functions will be called with the address of the current
14532 function and its call site.  (On some platforms,
14533 @code{__builtin_return_address} does not work beyond the current
14534 function, so the call site information may not be available to the
14535 profiling functions otherwise.)
14536
14537 @smallexample
14538 void __cyg_profile_func_enter (void *this_fn,
14539                                void *call_site);
14540 void __cyg_profile_func_exit  (void *this_fn,
14541                                void *call_site);
14542 @end smallexample
14543
14544 The first argument is the address of the start of the current function,
14545 which may be looked up exactly in the symbol table.
14546
14547 This instrumentation is also done for functions expanded inline in other
14548 functions.  The profiling calls will indicate where, conceptually, the
14549 inline function is entered and exited.  This means that addressable
14550 versions of such functions must be available.  If all your uses of a
14551 function are expanded inline, this may mean an additional expansion of
14552 code size.  If you use @samp{extern inline} in your C code, an
14553 addressable version of such functions must be provided.  (This is
14554 normally the case anyways, but if you get lucky and the optimizer always
14555 expands the functions inline, you might have gotten away without
14556 providing static copies.)
14557
14558 A function may be given the attribute @code{no_instrument_function}, in
14559 which case this instrumentation will not be done.  This can be used, for
14560 example, for the profiling functions listed above, high-priority
14561 interrupt routines, and any functions from which the profiling functions
14562 cannot safely be called (perhaps signal handlers, if the profiling
14563 routines generate output or allocate memory).
14564
14565 @item -fstack-check
14566 @opindex fstack-check
14567 Generate code to verify that you do not go beyond the boundary of the
14568 stack.  You should specify this flag if you are running in an
14569 environment with multiple threads, but only rarely need to specify it in
14570 a single-threaded environment since stack overflow is automatically
14571 detected on nearly all systems if there is only one stack.
14572
14573 Note that this switch does not actually cause checking to be done; the
14574 operating system must do that.  The switch causes generation of code
14575 to ensure that the operating system sees the stack being extended.
14576
14577 @item -fstack-limit-register=@var{reg}
14578 @itemx -fstack-limit-symbol=@var{sym}
14579 @itemx -fno-stack-limit
14580 @opindex fstack-limit-register
14581 @opindex fstack-limit-symbol
14582 @opindex fno-stack-limit
14583 Generate code to ensure that the stack does not grow beyond a certain value,
14584 either the value of a register or the address of a symbol.  If the stack
14585 would grow beyond the value, a signal is raised.  For most targets,
14586 the signal is raised before the stack overruns the boundary, so
14587 it is possible to catch the signal without taking special precautions.
14588
14589 For instance, if the stack starts at absolute address @samp{0x80000000}
14590 and grows downwards, you can use the flags
14591 @option{-fstack-limit-symbol=__stack_limit} and
14592 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
14593 of 128KB@.  Note that this may only work with the GNU linker.
14594
14595 @cindex aliasing of parameters
14596 @cindex parameters, aliased
14597 @item -fargument-alias
14598 @itemx -fargument-noalias
14599 @itemx -fargument-noalias-global
14600 @itemx -fargument-noalias-anything
14601 @opindex fargument-alias
14602 @opindex fargument-noalias
14603 @opindex fargument-noalias-global
14604 @opindex fargument-noalias-anything
14605 Specify the possible relationships among parameters and between
14606 parameters and global data.
14607
14608 @option{-fargument-alias} specifies that arguments (parameters) may
14609 alias each other and may alias global storage.@*
14610 @option{-fargument-noalias} specifies that arguments do not alias
14611 each other, but may alias global storage.@*
14612 @option{-fargument-noalias-global} specifies that arguments do not
14613 alias each other and do not alias global storage.
14614 @option{-fargument-noalias-anything} specifies that arguments do not
14615 alias any other storage.
14616
14617 Each language will automatically use whatever option is required by
14618 the language standard.  You should not need to use these options yourself.
14619
14620 @item -fleading-underscore
14621 @opindex fleading-underscore
14622 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
14623 change the way C symbols are represented in the object file.  One use
14624 is to help link with legacy assembly code.
14625
14626 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
14627 generate code that is not binary compatible with code generated without that
14628 switch.  Use it to conform to a non-default application binary interface.
14629 Not all targets provide complete support for this switch.
14630
14631 @item -ftls-model=@var{model}
14632 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
14633 The @var{model} argument should be one of @code{global-dynamic},
14634 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
14635
14636 The default without @option{-fpic} is @code{initial-exec}; with
14637 @option{-fpic} the default is @code{global-dynamic}.
14638
14639 @item -fvisibility=@var{default|internal|hidden|protected}
14640 @opindex fvisibility
14641 Set the default ELF image symbol visibility to the specified option---all
14642 symbols will be marked with this unless overridden within the code.
14643 Using this feature can very substantially improve linking and
14644 load times of shared object libraries, produce more optimized
14645 code, provide near-perfect API export and prevent symbol clashes.
14646 It is @strong{strongly} recommended that you use this in any shared objects
14647 you distribute.
14648
14649 Despite the nomenclature, @code{default} always means public ie;
14650 available to be linked against from outside the shared object.
14651 @code{protected} and @code{internal} are pretty useless in real-world
14652 usage so the only other commonly used option will be @code{hidden}.
14653 The default if @option{-fvisibility} isn't specified is
14654 @code{default}, i.e., make every
14655 symbol public---this causes the same behavior as previous versions of
14656 GCC@.
14657
14658 A good explanation of the benefits offered by ensuring ELF
14659 symbols have the correct visibility is given by ``How To Write
14660 Shared Libraries'' by Ulrich Drepper (which can be found at
14661 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
14662 solution made possible by this option to marking things hidden when
14663 the default is public is to make the default hidden and mark things
14664 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
14665 and @code{__attribute__ ((visibility("default")))} instead of
14666 @code{__declspec(dllexport)} you get almost identical semantics with
14667 identical syntax.  This is a great boon to those working with
14668 cross-platform projects.
14669
14670 For those adding visibility support to existing code, you may find
14671 @samp{#pragma GCC visibility} of use.  This works by you enclosing
14672 the declarations you wish to set visibility for with (for example)
14673 @samp{#pragma GCC visibility push(hidden)} and
14674 @samp{#pragma GCC visibility pop}.
14675 Bear in mind that symbol visibility should be viewed @strong{as
14676 part of the API interface contract} and thus all new code should
14677 always specify visibility when it is not the default ie; declarations
14678 only for use within the local DSO should @strong{always} be marked explicitly
14679 as hidden as so to avoid PLT indirection overheads---making this
14680 abundantly clear also aids readability and self-documentation of the code.
14681 Note that due to ISO C++ specification requirements, operator new and
14682 operator delete must always be of default visibility.
14683
14684 Be aware that headers from outside your project, in particular system
14685 headers and headers from any other library you use, may not be
14686 expecting to be compiled with visibility other than the default.  You
14687 may need to explicitly say @samp{#pragma GCC visibility push(default)}
14688 before including any such headers.
14689
14690 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
14691 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
14692 no modifications.  However, this means that calls to @samp{extern}
14693 functions with no explicit visibility will use the PLT, so it is more
14694 effective to use @samp{__attribute ((visibility))} and/or
14695 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
14696 declarations should be treated as hidden.
14697
14698 Note that @samp{-fvisibility} does affect C++ vague linkage
14699 entities. This means that, for instance, an exception class that will
14700 be thrown between DSOs must be explicitly marked with default
14701 visibility so that the @samp{type_info} nodes will be unified between
14702 the DSOs.
14703
14704 An overview of these techniques, their benefits and how to use them
14705 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
14706
14707 @end table
14708
14709 @c man end
14710
14711 @node Environment Variables
14712 @section Environment Variables Affecting GCC
14713 @cindex environment variables
14714
14715 @c man begin ENVIRONMENT
14716 This section describes several environment variables that affect how GCC
14717 operates.  Some of them work by specifying directories or prefixes to use
14718 when searching for various kinds of files.  Some are used to specify other
14719 aspects of the compilation environment.
14720
14721 Note that you can also specify places to search using options such as
14722 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
14723 take precedence over places specified using environment variables, which
14724 in turn take precedence over those specified by the configuration of GCC@.
14725 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
14726 GNU Compiler Collection (GCC) Internals}.
14727
14728 @table @env
14729 @item LANG
14730 @itemx LC_CTYPE
14731 @c @itemx LC_COLLATE
14732 @itemx LC_MESSAGES
14733 @c @itemx LC_MONETARY
14734 @c @itemx LC_NUMERIC
14735 @c @itemx LC_TIME
14736 @itemx LC_ALL
14737 @findex LANG
14738 @findex LC_CTYPE
14739 @c @findex LC_COLLATE
14740 @findex LC_MESSAGES
14741 @c @findex LC_MONETARY
14742 @c @findex LC_NUMERIC
14743 @c @findex LC_TIME
14744 @findex LC_ALL
14745 @cindex locale
14746 These environment variables control the way that GCC uses
14747 localization information that allow GCC to work with different
14748 national conventions.  GCC inspects the locale categories
14749 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
14750 so.  These locale categories can be set to any value supported by your
14751 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
14752 Kingdom encoded in UTF-8.
14753
14754 The @env{LC_CTYPE} environment variable specifies character
14755 classification.  GCC uses it to determine the character boundaries in
14756 a string; this is needed for some multibyte encodings that contain quote
14757 and escape characters that would otherwise be interpreted as a string
14758 end or escape.
14759
14760 The @env{LC_MESSAGES} environment variable specifies the language to
14761 use in diagnostic messages.
14762
14763 If the @env{LC_ALL} environment variable is set, it overrides the value
14764 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
14765 and @env{LC_MESSAGES} default to the value of the @env{LANG}
14766 environment variable.  If none of these variables are set, GCC
14767 defaults to traditional C English behavior.
14768
14769 @item TMPDIR
14770 @findex TMPDIR
14771 If @env{TMPDIR} is set, it specifies the directory to use for temporary
14772 files.  GCC uses temporary files to hold the output of one stage of
14773 compilation which is to be used as input to the next stage: for example,
14774 the output of the preprocessor, which is the input to the compiler
14775 proper.
14776
14777 @item GCC_EXEC_PREFIX
14778 @findex GCC_EXEC_PREFIX
14779 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
14780 names of the subprograms executed by the compiler.  No slash is added
14781 when this prefix is combined with the name of a subprogram, but you can
14782 specify a prefix that ends with a slash if you wish.
14783
14784 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
14785 an appropriate prefix to use based on the pathname it was invoked with.
14786
14787 If GCC cannot find the subprogram using the specified prefix, it
14788 tries looking in the usual places for the subprogram.
14789
14790 The default value of @env{GCC_EXEC_PREFIX} is
14791 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
14792 the installed compiler. In many cases @var{prefix} is the value
14793 of @code{prefix} when you ran the @file{configure} script.
14794
14795 Other prefixes specified with @option{-B} take precedence over this prefix.
14796
14797 This prefix is also used for finding files such as @file{crt0.o} that are
14798 used for linking.
14799
14800 In addition, the prefix is used in an unusual way in finding the
14801 directories to search for header files.  For each of the standard
14802 directories whose name normally begins with @samp{/usr/local/lib/gcc}
14803 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
14804 replacing that beginning with the specified prefix to produce an
14805 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
14806 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
14807 These alternate directories are searched first; the standard directories
14808 come next. If a standard directory begins with the configured
14809 @var{prefix} then the value of @var{prefix} is replaced by
14810 @env{GCC_EXEC_PREFIX} when looking for header files.
14811
14812 @item COMPILER_PATH
14813 @findex COMPILER_PATH
14814 The value of @env{COMPILER_PATH} is a colon-separated list of
14815 directories, much like @env{PATH}.  GCC tries the directories thus
14816 specified when searching for subprograms, if it can't find the
14817 subprograms using @env{GCC_EXEC_PREFIX}.
14818
14819 @item LIBRARY_PATH
14820 @findex LIBRARY_PATH
14821 The value of @env{LIBRARY_PATH} is a colon-separated list of
14822 directories, much like @env{PATH}.  When configured as a native compiler,
14823 GCC tries the directories thus specified when searching for special
14824 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
14825 using GCC also uses these directories when searching for ordinary
14826 libraries for the @option{-l} option (but directories specified with
14827 @option{-L} come first).
14828
14829 @item LANG
14830 @findex LANG
14831 @cindex locale definition
14832 This variable is used to pass locale information to the compiler.  One way in
14833 which this information is used is to determine the character set to be used
14834 when character literals, string literals and comments are parsed in C and C++.
14835 When the compiler is configured to allow multibyte characters,
14836 the following values for @env{LANG} are recognized:
14837
14838 @table @samp
14839 @item C-JIS
14840 Recognize JIS characters.
14841 @item C-SJIS
14842 Recognize SJIS characters.
14843 @item C-EUCJP
14844 Recognize EUCJP characters.
14845 @end table
14846
14847 If @env{LANG} is not defined, or if it has some other value, then the
14848 compiler will use mblen and mbtowc as defined by the default locale to
14849 recognize and translate multibyte characters.
14850 @end table
14851
14852 @noindent
14853 Some additional environments variables affect the behavior of the
14854 preprocessor.
14855
14856 @include cppenv.texi
14857
14858 @c man end
14859
14860 @node Precompiled Headers
14861 @section Using Precompiled Headers
14862 @cindex precompiled headers
14863 @cindex speed of compilation
14864
14865 Often large projects have many header files that are included in every
14866 source file.  The time the compiler takes to process these header files
14867 over and over again can account for nearly all of the time required to
14868 build the project.  To make builds faster, GCC allows users to
14869 `precompile' a header file; then, if builds can use the precompiled
14870 header file they will be much faster.
14871
14872 To create a precompiled header file, simply compile it as you would any
14873 other file, if necessary using the @option{-x} option to make the driver
14874 treat it as a C or C++ header file.  You will probably want to use a
14875 tool like @command{make} to keep the precompiled header up-to-date when
14876 the headers it contains change.
14877
14878 A precompiled header file will be searched for when @code{#include} is
14879 seen in the compilation.  As it searches for the included file
14880 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
14881 compiler looks for a precompiled header in each directory just before it
14882 looks for the include file in that directory.  The name searched for is
14883 the name specified in the @code{#include} with @samp{.gch} appended.  If
14884 the precompiled header file can't be used, it is ignored.
14885
14886 For instance, if you have @code{#include "all.h"}, and you have
14887 @file{all.h.gch} in the same directory as @file{all.h}, then the
14888 precompiled header file will be used if possible, and the original
14889 header will be used otherwise.
14890
14891 Alternatively, you might decide to put the precompiled header file in a
14892 directory and use @option{-I} to ensure that directory is searched
14893 before (or instead of) the directory containing the original header.
14894 Then, if you want to check that the precompiled header file is always
14895 used, you can put a file of the same name as the original header in this
14896 directory containing an @code{#error} command.
14897
14898 This also works with @option{-include}.  So yet another way to use
14899 precompiled headers, good for projects not designed with precompiled
14900 header files in mind, is to simply take most of the header files used by
14901 a project, include them from another header file, precompile that header
14902 file, and @option{-include} the precompiled header.  If the header files
14903 have guards against multiple inclusion, they will be skipped because
14904 they've already been included (in the precompiled header).
14905
14906 If you need to precompile the same header file for different
14907 languages, targets, or compiler options, you can instead make a
14908 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14909 header in the directory, perhaps using @option{-o}.  It doesn't matter
14910 what you call the files in the directory, every precompiled header in
14911 the directory will be considered.  The first precompiled header
14912 encountered in the directory that is valid for this compilation will
14913 be used; they're searched in no particular order.
14914
14915 There are many other possibilities, limited only by your imagination,
14916 good sense, and the constraints of your build system.
14917
14918 A precompiled header file can be used only when these conditions apply:
14919
14920 @itemize
14921 @item
14922 Only one precompiled header can be used in a particular compilation.
14923
14924 @item
14925 A precompiled header can't be used once the first C token is seen.  You
14926 can have preprocessor directives before a precompiled header; you can
14927 even include a precompiled header from inside another header, so long as
14928 there are no C tokens before the @code{#include}.
14929
14930 @item
14931 The precompiled header file must be produced for the same language as
14932 the current compilation.  You can't use a C precompiled header for a C++
14933 compilation.
14934
14935 @item
14936 The precompiled header file must have been produced by the same compiler
14937 binary as the current compilation is using.
14938
14939 @item
14940 Any macros defined before the precompiled header is included must
14941 either be defined in the same way as when the precompiled header was
14942 generated, or must not affect the precompiled header, which usually
14943 means that they don't appear in the precompiled header at all.
14944
14945 The @option{-D} option is one way to define a macro before a
14946 precompiled header is included; using a @code{#define} can also do it.
14947 There are also some options that define macros implicitly, like
14948 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14949 defined this way.
14950
14951 @item If debugging information is output when using the precompiled
14952 header, using @option{-g} or similar, the same kind of debugging information
14953 must have been output when building the precompiled header.  However,
14954 a precompiled header built using @option{-g} can be used in a compilation
14955 when no debugging information is being output.
14956
14957 @item The same @option{-m} options must generally be used when building
14958 and using the precompiled header.  @xref{Submodel Options},
14959 for any cases where this rule is relaxed.
14960
14961 @item Each of the following options must be the same when building and using
14962 the precompiled header:
14963
14964 @gccoptlist{-fexceptions -funit-at-a-time}
14965
14966 @item
14967 Some other command-line options starting with @option{-f},
14968 @option{-p}, or @option{-O} must be defined in the same way as when
14969 the precompiled header was generated.  At present, it's not clear
14970 which options are safe to change and which are not; the safest choice
14971 is to use exactly the same options when generating and using the
14972 precompiled header.  The following are known to be safe:
14973
14974 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
14975 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
14976 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
14977 -pedantic-errors}
14978
14979 @end itemize
14980
14981 For all of these except the last, the compiler will automatically
14982 ignore the precompiled header if the conditions aren't met.  If you
14983 find an option combination that doesn't work and doesn't cause the
14984 precompiled header to be ignored, please consider filing a bug report,
14985 see @ref{Bugs}.
14986
14987 If you do use differing options when generating and using the
14988 precompiled header, the actual behavior will be a mixture of the
14989 behavior for the options.  For instance, if you use @option{-g} to
14990 generate the precompiled header but not when using it, you may or may
14991 not get debugging information for routines in the precompiled header.
14992
14993 @node Running Protoize
14994 @section Running Protoize
14995
14996 The program @code{protoize} is an optional part of GCC@.  You can use
14997 it to add prototypes to a program, thus converting the program to ISO
14998 C in one respect.  The companion program @code{unprotoize} does the
14999 reverse: it removes argument types from any prototypes that are found.
15000
15001 When you run these programs, you must specify a set of source files as
15002 command line arguments.  The conversion programs start out by compiling
15003 these files to see what functions they define.  The information gathered
15004 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
15005
15006 After scanning comes actual conversion.  The specified files are all
15007 eligible to be converted; any files they include (whether sources or
15008 just headers) are eligible as well.
15009
15010 But not all the eligible files are converted.  By default,
15011 @code{protoize} and @code{unprotoize} convert only source and header
15012 files in the current directory.  You can specify additional directories
15013 whose files should be converted with the @option{-d @var{directory}}
15014 option.  You can also specify particular files to exclude with the
15015 @option{-x @var{file}} option.  A file is converted if it is eligible, its
15016 directory name matches one of the specified directory names, and its
15017 name within the directory has not been excluded.
15018
15019 Basic conversion with @code{protoize} consists of rewriting most
15020 function definitions and function declarations to specify the types of
15021 the arguments.  The only ones not rewritten are those for varargs
15022 functions.
15023
15024 @code{protoize} optionally inserts prototype declarations at the
15025 beginning of the source file, to make them available for any calls that
15026 precede the function's definition.  Or it can insert prototype
15027 declarations with block scope in the blocks where undeclared functions
15028 are called.
15029
15030 Basic conversion with @code{unprotoize} consists of rewriting most
15031 function declarations to remove any argument types, and rewriting
15032 function definitions to the old-style pre-ISO form.
15033
15034 Both conversion programs print a warning for any function declaration or
15035 definition that they can't convert.  You can suppress these warnings
15036 with @option{-q}.
15037
15038 The output from @code{protoize} or @code{unprotoize} replaces the
15039 original source file.  The original file is renamed to a name ending
15040 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
15041 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
15042 for DOS) file already exists, then the source file is simply discarded.
15043
15044 @code{protoize} and @code{unprotoize} both depend on GCC itself to
15045 scan the program and collect information about the functions it uses.
15046 So neither of these programs will work until GCC is installed.
15047
15048 Here is a table of the options you can use with @code{protoize} and
15049 @code{unprotoize}.  Each option works with both programs unless
15050 otherwise stated.
15051
15052 @table @code
15053 @item -B @var{directory}
15054 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
15055 usual directory (normally @file{/usr/local/lib}).  This file contains
15056 prototype information about standard system functions.  This option
15057 applies only to @code{protoize}.
15058
15059 @item -c @var{compilation-options}
15060 Use @var{compilation-options} as the options when running @command{gcc} to
15061 produce the @samp{.X} files.  The special option @option{-aux-info} is
15062 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
15063
15064 Note that the compilation options must be given as a single argument to
15065 @code{protoize} or @code{unprotoize}.  If you want to specify several
15066 @command{gcc} options, you must quote the entire set of compilation options
15067 to make them a single word in the shell.
15068
15069 There are certain @command{gcc} arguments that you cannot use, because they
15070 would produce the wrong kind of output.  These include @option{-g},
15071 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
15072 the @var{compilation-options}, they are ignored.
15073
15074 @item -C
15075 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
15076 systems) instead of @samp{.c}.  This is convenient if you are converting
15077 a C program to C++.  This option applies only to @code{protoize}.
15078
15079 @item -g
15080 Add explicit global declarations.  This means inserting explicit
15081 declarations at the beginning of each source file for each function
15082 that is called in the file and was not declared.  These declarations
15083 precede the first function definition that contains a call to an
15084 undeclared function.  This option applies only to @code{protoize}.
15085
15086 @item -i @var{string}
15087 Indent old-style parameter declarations with the string @var{string}.
15088 This option applies only to @code{protoize}.
15089
15090 @code{unprotoize} converts prototyped function definitions to old-style
15091 function definitions, where the arguments are declared between the
15092 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
15093 uses five spaces as the indentation.  If you want to indent with just
15094 one space instead, use @option{-i " "}.
15095
15096 @item -k
15097 Keep the @samp{.X} files.  Normally, they are deleted after conversion
15098 is finished.
15099
15100 @item -l
15101 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
15102 a prototype declaration for each function in each block which calls the
15103 function without any declaration.  This option applies only to
15104 @code{protoize}.
15105
15106 @item -n
15107 Make no real changes.  This mode just prints information about the conversions
15108 that would have been done without @option{-n}.
15109
15110 @item -N
15111 Make no @samp{.save} files.  The original files are simply deleted.
15112 Use this option with caution.
15113
15114 @item -p @var{program}
15115 Use the program @var{program} as the compiler.  Normally, the name
15116 @file{gcc} is used.
15117
15118 @item -q
15119 Work quietly.  Most warnings are suppressed.
15120
15121 @item -v
15122 Print the version number, just like @option{-v} for @command{gcc}.
15123 @end table
15124
15125 If you need special compiler options to compile one of your program's
15126 source files, then you should generate that file's @samp{.X} file
15127 specially, by running @command{gcc} on that source file with the
15128 appropriate options and the option @option{-aux-info}.  Then run
15129 @code{protoize} on the entire set of files.  @code{protoize} will use
15130 the existing @samp{.X} file because it is newer than the source file.
15131 For example:
15132
15133 @smallexample
15134 gcc -Dfoo=bar file1.c -aux-info file1.X
15135 protoize *.c
15136 @end smallexample
15137
15138 @noindent
15139 You need to include the special files along with the rest in the
15140 @code{protoize} command, even though their @samp{.X} files already
15141 exist, because otherwise they won't get converted.
15142
15143 @xref{Protoize Caveats}, for more information on how to use
15144 @code{protoize} successfully.