2007-03-16 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / doc / invoke.texi
blob1cdd82e40dee74a50c994e42a16c22394035fd82
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
3 @c This is part of the GCC manual.
4 @c For copying conditions, see the file gcc.texi.
6 @ignore
7 @c man begin INCLUDE
8 @include gcc-vers.texi
9 @c man end
11 @c man begin COPYRIGHT
12 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
13 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
15 Permission is granted to copy, distribute and/or modify this document
16 under the terms of the GNU Free Documentation License, Version 1.2 or
17 any later version published by the Free Software Foundation; with the
18 Invariant Sections being ``GNU General Public License'' and ``Funding
19 Free Software'', the Front-Cover texts being (a) (see below), and with
20 the Back-Cover Texts being (b) (see below).  A copy of the license is
21 included in the gfdl(7) man page.
23 (a) The FSF's Front-Cover Text is:
25      A GNU Manual
27 (b) The FSF's Back-Cover Text is:
29      You have freedom to copy and modify this GNU Manual, like GNU
30      software.  Copies published by the Free Software Foundation raise
31      funds for GNU development.
32 @c man end
33 @c Set file name and title for the man page.
34 @setfilename gcc
35 @settitle GNU project C and C++ compiler
36 @c man begin SYNOPSIS
37 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
38     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
39     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
40     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
41     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
42     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
43     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
45 Only the most useful options are listed here; see below for the
46 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
47 @c man end
48 @c man begin SEEALSO
49 gpl(7), gfdl(7), fsf-funding(7),
50 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
51 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
52 @file{ld}, @file{binutils} and @file{gdb}.
53 @c man end
54 @c man begin BUGS
55 For instructions on reporting bugs, see
56 @w{@uref{http://gcc.gnu.org/bugs.html}}.
57 @c man end
58 @c man begin AUTHOR
59 See the Info entry for @command{gcc}, or
60 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
61 for contributors to GCC@.
62 @c man end
63 @end ignore
65 @node Invoking GCC
66 @chapter GCC Command Options
67 @cindex GCC command options
68 @cindex command options
69 @cindex options, GCC command
71 @c man begin DESCRIPTION
72 When you invoke GCC, it normally does preprocessing, compilation,
73 assembly and linking.  The ``overall options'' allow you to stop this
74 process at an intermediate stage.  For example, the @option{-c} option
75 says not to run the linker.  Then the output consists of object files
76 output by the assembler.
78 Other options are passed on to one stage of processing.  Some options
79 control the preprocessor and others the compiler itself.  Yet other
80 options control the assembler and linker; most of these are not
81 documented here, since you rarely need to use any of them.
83 @cindex C compilation options
84 Most of the command line options that you can use with GCC are useful
85 for C programs; when an option is only useful with another language
86 (usually C++), the explanation says so explicitly.  If the description
87 for a particular option does not mention a source language, you can use
88 that option with all supported languages.
90 @cindex C++ compilation options
91 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
92 options for compiling C++ programs.
94 @cindex grouping options
95 @cindex options, grouping
96 The @command{gcc} program accepts options and file names as operands.  Many
97 options have multi-letter names; therefore multiple single-letter options
98 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
99 -r}}.
101 @cindex order of options
102 @cindex options, order
103 You can mix options and other arguments.  For the most part, the order
104 you use doesn't matter.  Order does matter when you use several options
105 of the same kind; for example, if you specify @option{-L} more than once,
106 the directories are searched in the order specified.
108 Many options have long names starting with @samp{-f} or with
109 @samp{-W}---for example, 
110 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
111 these have both positive and negative forms; the negative form of
112 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
113 only one of these two forms, whichever one is not the default.
115 @c man end
117 @xref{Option Index}, for an index to GCC's options.
119 @menu
120 * Option Summary::      Brief list of all options, without explanations.
121 * Overall Options::     Controlling the kind of output:
122                         an executable, object files, assembler files,
123                         or preprocessed source.
124 * Invoking G++::        Compiling C++ programs.
125 * C Dialect Options::   Controlling the variant of C language compiled.
126 * C++ Dialect Options:: Variations on C++.
127 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
128                         and Objective-C++.
129 * Language Independent Options:: Controlling how diagnostics should be
130                         formatted.
131 * Warning Options::     How picky should the compiler be?
132 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
133 * Optimize Options::    How much optimization?
134 * Preprocessor Options:: Controlling header files and macro definitions.
135                          Also, getting dependency information for Make.
136 * Assembler Options::   Passing options to the assembler.
137 * Link Options::        Specifying libraries and so on.
138 * Directory Options::   Where to find header files and libraries.
139                         Where to find the compiler executable files.
140 * Spec Files::          How to pass switches to sub-processes.
141 * Target Options::      Running a cross-compiler, or an old version of GCC.
142 * Submodel Options::    Specifying minor hardware or convention variations,
143                         such as 68010 vs 68020.
144 * Code Gen Options::    Specifying conventions for function calls, data layout
145                         and register usage.
146 * Environment Variables:: Env vars that affect GCC.
147 * Precompiled Headers:: Compiling a header once, and using it many times.
148 * Running Protoize::    Automatically adding or removing function prototypes.
149 @end menu
151 @c man begin OPTIONS
153 @node Option Summary
154 @section Option Summary
156 Here is a summary of all the options, grouped by type.  Explanations are
157 in the following sections.
159 @table @emph
160 @item Overall Options
161 @xref{Overall Options,,Options Controlling the Kind of Output}.
162 @gccoptlist{-c  -S  -E  -o @var{file}  -combine -pipe  -pass-exit-codes  @gol
163 -x @var{language}  -v  -###  --help  --target-help  --version @@@var{file}}
165 @item C Language Options
166 @xref{C Dialect Options,,Options Controlling C Dialect}.
167 @gccoptlist{-ansi  -std=@var{standard}  -aux-info @var{filename} @gol
168 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
169 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
170 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
171 -fallow-single-precision  -fcond-mismatch @gol
172 -fsigned-bitfields  -fsigned-char @gol
173 -funsigned-bitfields  -funsigned-char}
175 @item C++ Language Options
176 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
177 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
178 -fconserve-space  -ffriend-injection @gol
179 -fno-elide-constructors @gol
180 -fno-enforce-eh-specs @gol
181 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
182 -fno-implicit-templates @gol
183 -fno-implicit-inline-templates @gol
184 -fno-implement-inlines  -fms-extensions @gol
185 -fno-nonansi-builtins  -fno-operator-names @gol
186 -fno-optional-diags  -fpermissive @gol
187 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
188 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
189 -fno-default-inline  -fvisibility-inlines-hidden @gol
190 -Wabi  -Wctor-dtor-privacy @gol
191 -Wnon-virtual-dtor  -Wreorder @gol
192 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
193 -Wno-non-template-friend  -Wold-style-cast @gol
194 -Woverloaded-virtual  -Wno-pmf-conversions @gol
195 -Wsign-promo}
197 @item Objective-C and Objective-C++ Language Options
198 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
199 Objective-C and Objective-C++ Dialects}.
200 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
201 -fgnu-runtime  -fnext-runtime @gol
202 -fno-nil-receivers @gol
203 -fobjc-call-cxx-cdtors @gol
204 -fobjc-direct-dispatch @gol
205 -fobjc-exceptions @gol
206 -fobjc-gc @gol
207 -freplace-objc-classes @gol
208 -fzero-link @gol
209 -gen-decls @gol
210 -Wassign-intercept @gol
211 -Wno-protocol  -Wselector @gol
212 -Wstrict-selector-match @gol
213 -Wundeclared-selector}
215 @item Language Independent Options
216 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
217 @gccoptlist{-fmessage-length=@var{n}  @gol
218 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
219 -fdiagnostics-show-option}
221 @item Warning Options
222 @xref{Warning Options,,Options to Request or Suppress Warnings}.
223 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
224 -w  -Wextra  -Wall  -Waggregate-return -Walways-true -Wno-attributes @gol
225 -Wc++-compat -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment @gol
226 -Wconversion  -Wno-deprecated-declarations @gol
227 -Wdisabled-optimization  -Wno-div-by-zero  -Wno-endif-labels @gol
228 -Werror  -Werror-* -Werror-implicit-function-declaration @gol
229 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
230 -Wno-format-extra-args -Wformat-nonliteral @gol
231 -Wformat-security  -Wformat-y2k @gol
232 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
233 -Wimport  -Wno-import  -Winit-self  -Winline @gol
234 -Wno-int-to-pointer-cast @gol
235 -Wno-invalid-offsetof  -Winvalid-pch @gol
236 -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations  -Wlong-long @gol
237 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
238 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
239 -Wmissing-noreturn @gol
240 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
241 -Woverlength-strings  -Wpacked  -Wpadded @gol
242 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
243 -Wredundant-decls @gol
244 -Wreturn-type  -Wsequence-point  -Wshadow @gol
245 -Wsign-compare  -Wstack-protector @gol
246 -Wstrict-aliasing -Wstrict-aliasing=2 @gol
247 -Wstring-literal-comparison @gol
248 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
249 -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
250 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
251 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
252 -Wunused-value  -Wunused-variable  -Wvariadic-macros @gol
253 -Wvolatile-register-var  -Wwrite-strings}
255 @item C-only Warning Options
256 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
257 -Wmissing-prototypes  -Wnested-externs  -Wold-style-definition @gol
258 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
259 -Wdeclaration-after-statement -Wpointer-sign}
261 @item Debugging Options
262 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
263 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
264 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
265 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
266 -fdump-ipa-all -fdump-ipa-cgraph @gol
267 -fdump-tree-all @gol
268 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
269 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
270 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
271 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
272 -fdump-tree-ch @gol
273 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
274 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
275 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
276 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
277 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
278 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
279 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
280 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
281 -fdump-tree-nrv -fdump-tree-vect @gol
282 -fdump-tree-sink @gol
283 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
284 -fdump-tree-salias @gol
285 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
287 -ftree-vectorizer-verbose=@var{n} @gol
288 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
289 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
290 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
291 -fmem-report -fprofile-arcs @gol
292 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
293 -ftest-coverage  -ftime-report -fvar-tracking @gol
294 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
295 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
296 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
297 -print-multi-directory  -print-multi-lib @gol
298 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
299 -save-temps  -time}
301 @item Optimization Options
302 @xref{Optimize Options,,Options that Control Optimization}.
303 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
304 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
305 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
306 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
307 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
308 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
309 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
310 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
311 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
312 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
313 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
314 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
315 -finline-functions  -finline-functions-called-once @gol
316 -finline-limit=@var{n} -fira -fira-alogirthm=@var{algorithm} @gol
317 -fno-ira-assign-after-call-split @gol
318 -fira-biased-coloring -fira-ipra -fno-ira-move-spills @gol
319 -fira-propagate-cost @gol
320 -fno-ira-share-spill-slots -fno-ira-share-save-slots @gol
321 -fno-ira-split-around-calls @gol
322 -fkeep-inline-functions -fkeep-static-consts @gol
323 -fmerge-constants  -fmerge-all-constants @gol
324 -fmodulo-sched -fno-branch-count-reg @gol
325 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
326 -fno-function-cse  -fno-guess-branch-probability @gol
327 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
328 -funsafe-math-optimizations  -funsafe-loop-optimizations  -ffinite-math-only @gol
329 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
330 -fomit-frame-pointer  -foptimize-register-move @gol
331 -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
332 -fprofile-generate -fprofile-use @gol
333 -fregmove  -frename-registers @gol
334 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
335 -frerun-cse-after-loop @gol
336 -frounding-math -frtl-abstract-sequences @gol
337 -fschedule-insns  -fschedule-insns2 @gol
338 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
339 -fsched-spec-load-dangerous  @gol
340 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
341 -fsched2-use-superblocks @gol
342 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
343 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
344 -fstack-protector  -fstack-protector-all @gol
345 -fstrict-aliasing  -ftracer  -fthread-jumps @gol
346 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
347 -fsplit-ivs-in-unroller -funswitch-loops @gol
348 -fvariable-expansion-in-unroller @gol
349 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
350 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
351 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
352 -ftree-ch -ftree-sra -ftree-ter -ftree-lrs -ftree-fre -ftree-vectorize @gol
353 -ftree-vect-loop-version -ftree-salias -fipa-pta -fweb @gol
354 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
355 --param @var{name}=@var{value}
356 -O  -O0  -O1  -O2  -O3  -Os}
358 @item Preprocessor Options
359 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
360 @gccoptlist{-A@var{question}=@var{answer} @gol
361 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
362 -C  -dD  -dI  -dM  -dN @gol
363 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
364 -idirafter @var{dir} @gol
365 -include @var{file}  -imacros @var{file} @gol
366 -iprefix @var{file}  -iwithprefix @var{dir} @gol
367 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
368 -imultilib @var{dir} -isysroot @var{dir} @gol
369 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
370 -P  -fworking-directory  -remap @gol
371 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
372 -Xpreprocessor @var{option}}
374 @item Assembler Option
375 @xref{Assembler Options,,Passing Options to the Assembler}.
376 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
378 @item Linker Options
379 @xref{Link Options,,Options for Linking}.
380 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
381 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
382 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
383 -Wl,@var{option}  -Xlinker @var{option} @gol
384 -u @var{symbol}}
386 @item Directory Options
387 @xref{Directory Options,,Options for Directory Search}.
388 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
389 -specs=@var{file}  -I- --sysroot=@var{dir}}
391 @item Target Options
392 @c I wrote this xref this way to avoid overfull hbox. -- rms
393 @xref{Target Options}.
394 @gccoptlist{-V @var{version}  -b @var{machine}}
396 @item Machine Dependent Options
397 @xref{Submodel Options,,Hardware Models and Configurations}.
398 @c This list is ordered alphanumerically by subsection name.
399 @c Try and put the significant identifier (CPU or system) first,
400 @c so users have a clue at guessing where the ones they want will be.
402 @emph{ARC Options}
403 @gccoptlist{-EB  -EL @gol
404 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
405 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
407 @emph{ARM Options}
408 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
409 -mabi=@var{name} @gol
410 -mapcs-stack-check  -mno-apcs-stack-check @gol
411 -mapcs-float  -mno-apcs-float @gol
412 -mapcs-reentrant  -mno-apcs-reentrant @gol
413 -msched-prolog  -mno-sched-prolog @gol
414 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
415 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
416 -mthumb-interwork  -mno-thumb-interwork @gol
417 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
418 -mstructure-size-boundary=@var{n} @gol
419 -mabort-on-noreturn @gol
420 -mlong-calls  -mno-long-calls @gol
421 -msingle-pic-base  -mno-single-pic-base @gol
422 -mpic-register=@var{reg} @gol
423 -mnop-fun-dllimport @gol
424 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
425 -mpoke-function-name @gol
426 -mthumb  -marm @gol
427 -mtpcs-frame  -mtpcs-leaf-frame @gol
428 -mcaller-super-interworking  -mcallee-super-interworking @gol
429 -mtp=@var{name}}
431 @emph{AVR Options}
432 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
433 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
435 @emph{Blackfin Options}
436 @gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol
437 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly @gol
438 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
439 -mno-id-shared-library -mshared-library-id=@var{n} @gol
440 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
441 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls}
443 @emph{CRIS Options}
444 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
445 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
446 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
447 -mstack-align  -mdata-align  -mconst-align @gol
448 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
449 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
450 -mmul-bug-workaround  -mno-mul-bug-workaround}
452 @emph{CRX Options}
453 @gccoptlist{-mmac -mpush-args}
455 @emph{Darwin Options}
456 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
457 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
458 -client_name  -compatibility_version  -current_version @gol
459 -dead_strip @gol
460 -dependency-file  -dylib_file  -dylinker_install_name @gol
461 -dynamic  -dynamiclib  -exported_symbols_list @gol
462 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
463 -force_flat_namespace  -headerpad_max_install_names @gol
464 -image_base  -init  -install_name  -keep_private_externs @gol
465 -multi_module  -multiply_defined  -multiply_defined_unused @gol
466 -noall_load   -no_dead_strip_inits_and_terms @gol
467 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
468 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
469 -private_bundle  -read_only_relocs  -sectalign @gol
470 -sectobjectsymbols  -whyload  -seg1addr @gol
471 -sectcreate  -sectobjectsymbols  -sectorder @gol
472 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
473 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
474 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
475 -single_module  -static  -sub_library  -sub_umbrella @gol
476 -twolevel_namespace  -umbrella  -undefined @gol
477 -unexported_symbols_list  -weak_reference_mismatches @gol
478 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
479 -mkernel -mone-byte-bool}
481 @emph{DEC Alpha Options}
482 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
483 -mieee  -mieee-with-inexact  -mieee-conformant @gol
484 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
485 -mtrap-precision=@var{mode}  -mbuild-constants @gol
486 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
487 -mbwx  -mmax  -mfix  -mcix @gol
488 -mfloat-vax  -mfloat-ieee @gol
489 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
490 -msmall-text  -mlarge-text @gol
491 -mmemory-latency=@var{time}}
493 @emph{DEC Alpha/VMS Options}
494 @gccoptlist{-mvms-return-codes}
496 @emph{FRV Options}
497 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
498 -mhard-float  -msoft-float @gol
499 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
500 -mdouble  -mno-double @gol
501 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
502 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
503 -mlinked-fp  -mlong-calls  -malign-labels @gol
504 -mlibrary-pic  -macc-4  -macc-8 @gol
505 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
506 -moptimize-membar -mno-optimize-membar @gol
507 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
508 -mvliw-branch  -mno-vliw-branch @gol
509 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
510 -mno-nested-cond-exec  -mtomcat-stats @gol
511 -mTLS -mtls @gol
512 -mcpu=@var{cpu}}
514 @emph{GNU/Linux Options}
515 @gccoptlist{-muclibc}
517 @emph{H8/300 Options}
518 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
520 @emph{HPPA Options}
521 @gccoptlist{-march=@var{architecture-type} @gol
522 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
523 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
524 -mfixed-range=@var{register-range} @gol
525 -mjump-in-delay -mlinker-opt -mlong-calls @gol
526 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
527 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
528 -mno-jump-in-delay  -mno-long-load-store @gol
529 -mno-portable-runtime  -mno-soft-float @gol
530 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
531 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
532 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
533 -munix=@var{unix-std}  -nolibdld  -static  -threads}
535 @emph{i386 and x86-64 Options}
536 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
537 -mfpmath=@var{unit} @gol
538 -masm=@var{dialect}  -mno-fancy-math-387 @gol
539 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
540 -mno-wide-multiply  -mrtd  -malign-double @gol
541 -mpreferred-stack-boundary=@var{num} @gol
542 -mmmx  -msse  -msse2 -msse3 -mssse3 -m3dnow @gol
543 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
544 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
545 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
546 -mstackrealign @gol
547 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
548 -mcmodel=@var{code-model} @gol
549 -m32  -m64 -mlarge-data-threshold=@var{num}}
551 @emph{IA-64 Options}
552 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
553 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
554 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
555 -minline-float-divide-max-throughput @gol
556 -minline-int-divide-min-latency @gol
557 -minline-int-divide-max-throughput  @gol
558 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
559 -mno-dwarf2-asm -mearly-stop-bits @gol
560 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
561 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
562 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
563 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
564 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
565 -mno-sched-prefer-non-data-spec-insns @gol
566 -mno-sched-prefer-non-control-spec-insns @gol
567 -mno-sched-count-spec-in-critical-path}
569 @emph{M32R/D Options}
570 @gccoptlist{-m32r2 -m32rx -m32r @gol
571 -mdebug @gol
572 -malign-loops -mno-align-loops @gol
573 -missue-rate=@var{number} @gol
574 -mbranch-cost=@var{number} @gol
575 -mmodel=@var{code-size-model-type} @gol
576 -msdata=@var{sdata-type} @gol
577 -mno-flush-func -mflush-func=@var{name} @gol
578 -mno-flush-trap -mflush-trap=@var{number} @gol
579 -G @var{num}}
581 @emph{M32C Options}
582 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
584 @emph{M680x0 Options}
585 @gccoptlist{-m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
586 -m68060  -mcpu32  -m5200  -mcfv4e -m68881  -mbitfield  @gol
587 -mc68000  -mc68020   @gol
588 -mnobitfield  -mrtd  -mshort  -msoft-float  -mpcrel @gol
589 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
590 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
592 @emph{M68hc1x Options}
593 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
594 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
595 -msoft-reg-count=@var{count}}
597 @emph{MCore Options}
598 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
599 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
600 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
601 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
602 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
604 @emph{MIPS Options}
605 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
606 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
607 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
608 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64  @gol
609 -mfp32  -mfp64  -mhard-float  -msoft-float  @gol
610 -msingle-float  -mdouble-float  -mdsp  -mpaired-single  -mips3d @gol
611 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
612 -G@var{num}  -membedded-data  -mno-embedded-data @gol
613 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
614 -msplit-addresses  -mno-split-addresses  @gol
615 -mexplicit-relocs  -mno-explicit-relocs  @gol
616 -mcheck-zero-division  -mno-check-zero-division @gol
617 -mdivide-traps  -mdivide-breaks @gol
618 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
619 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
620 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
621 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130 @gol
622 -mfix-sb1  -mno-fix-sb1 @gol
623 -mflush-func=@var{func}  -mno-flush-func @gol
624 -mbranch-likely  -mno-branch-likely @gol
625 -mfp-exceptions -mno-fp-exceptions @gol
626 -mvr4130-align -mno-vr4130-align}
628 @emph{MMIX Options}
629 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
630 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
631 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
632 -mno-base-addresses  -msingle-exit  -mno-single-exit}
634 @emph{MN10300 Options}
635 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
636 -mam33  -mno-am33 @gol
637 -mam33-2  -mno-am33-2 @gol
638 -mreturn-pointer-on-d0 @gol
639 -mno-crt0  -mrelax}
641 @emph{MT Options}
642 @gccoptlist{-mno-crt0 -mbacc -msim @gol
643 -march=@var{cpu-type} }
645 @emph{PDP-11 Options}
646 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
647 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
648 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
649 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
650 -mbranch-expensive  -mbranch-cheap @gol
651 -msplit  -mno-split  -munix-asm  -mdec-asm}
653 @emph{PowerPC Options}
654 See RS/6000 and PowerPC Options.
656 @emph{RS/6000 and PowerPC Options}
657 @gccoptlist{-mcpu=@var{cpu-type} @gol
658 -mtune=@var{cpu-type} @gol
659 -mpower  -mno-power  -mpower2  -mno-power2 @gol
660 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
661 -maltivec  -mno-altivec @gol
662 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
663 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
664 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
665 -mmfpgpr -mno-mfpgpr @gol
666 -mnew-mnemonics  -mold-mnemonics @gol
667 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
668 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
669 -malign-power  -malign-natural @gol
670 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
671 -mstring  -mno-string  -mupdate  -mno-update @gol
672 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
673 -mstrict-align  -mno-strict-align  -mrelocatable @gol
674 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
675 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
676 -mdynamic-no-pic  -maltivec  -mswdiv @gol
677 -mprioritize-restricted-insns=@var{priority} @gol
678 -msched-costly-dep=@var{dependence_type} @gol
679 -minsert-sched-nops=@var{scheme} @gol
680 -mcall-sysv  -mcall-netbsd @gol
681 -maix-struct-return  -msvr4-struct-return @gol
682 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
683 -misel -mno-isel @gol
684 -misel=yes  -misel=no @gol
685 -mspe -mno-spe @gol
686 -mspe=yes  -mspe=no @gol
687 -mvrsave -mno-vrsave @gol
688 -mmulhw -mno-mulhw @gol
689 -mdlmzb -mno-dlmzb @gol
690 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
691 -mprototype  -mno-prototype @gol
692 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
693 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
695 @emph{S/390 and zSeries Options}
696 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
697 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
698 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
699 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
700 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
701 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
702 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
704 @emph{Score Options}
705 @gccoptlist{-mel -mel @gol
706 -mmac @gol
707 -mscore5u -mscore7}
709 @emph{SH Options}
710 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
711 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
712 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
713 -m5-64media  -m5-64media-nofpu @gol
714 -m5-32media  -m5-32media-nofpu @gol
715 -m5-compact  -m5-compact-nofpu @gol
716 -mb  -ml  -mdalign  -mrelax @gol
717 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
718 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
719 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
720 -mdivsi3_libfunc=@var{name}  @gol
721 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
722  -minvalid-symbols}
724 @emph{SPARC Options}
725 @gccoptlist{-mcpu=@var{cpu-type} @gol
726 -mtune=@var{cpu-type} @gol
727 -mcmodel=@var{code-model} @gol
728 -m32  -m64  -mapp-regs  -mno-app-regs @gol
729 -mfaster-structs  -mno-faster-structs @gol
730 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
731 -mhard-quad-float  -msoft-quad-float @gol
732 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
733 -mstack-bias  -mno-stack-bias @gol
734 -munaligned-doubles  -mno-unaligned-doubles @gol
735 -mv8plus  -mno-v8plus  -mvis  -mno-vis
736 -threads -pthreads -pthread}
738 @emph{SPU Options}
739 @gccoptlist{-mwarn-reloc -merror-reloc @gol
740 -msafe-dma -munsafe-dma @gol
741 -mbranch-hints @gol
742 -msmall-mem -mlarge-mem -mstdmain @gol
743 -mfixed-range=@var{register-range}}
745 @emph{System V Options}
746 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
748 @emph{TMS320C3x/C4x Options}
749 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
750 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
751 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
752 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
754 @emph{V850 Options}
755 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
756 -mprolog-function  -mno-prolog-function  -mspace @gol
757 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
758 -mapp-regs  -mno-app-regs @gol
759 -mdisable-callt  -mno-disable-callt @gol
760 -mv850e1 @gol
761 -mv850e @gol
762 -mv850  -mbig-switch}
764 @emph{VAX Options}
765 @gccoptlist{-mg  -mgnu  -munix}
767 @emph{x86-64 Options}
768 See i386 and x86-64 Options.
770 @emph{Xstormy16 Options}
771 @gccoptlist{-msim}
773 @emph{Xtensa Options}
774 @gccoptlist{-mconst16 -mno-const16 @gol
775 -mfused-madd  -mno-fused-madd @gol
776 -mtext-section-literals  -mno-text-section-literals @gol
777 -mtarget-align  -mno-target-align @gol
778 -mlongcalls  -mno-longcalls}
780 @emph{zSeries Options}
781 See S/390 and zSeries Options.
783 @item Code Generation Options
784 @xref{Code Gen Options,,Options for Code Generation Conventions}.
785 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
786 -ffixed-@var{reg}  -fexceptions @gol
787 -fnon-call-exceptions  -funwind-tables @gol
788 -fasynchronous-unwind-tables @gol
789 -finhibit-size-directive  -finstrument-functions @gol
790 -fno-common  -fno-ident @gol
791 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
792 -fno-jump-tables @gol
793 -frecord-gcc-switches @gol
794 -freg-struct-return  -fshort-enums @gol
795 -fshort-double  -fshort-wchar @gol
796 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
797 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
798 -fargument-alias  -fargument-noalias @gol
799 -fargument-noalias-global  -fargument-noalias-anything
800 -fleading-underscore  -ftls-model=@var{model} @gol
801 -ftrapv  -fwrapv  -fbounds-check @gol
802 -fvisibility}
803 @end table
805 @menu
806 * Overall Options::     Controlling the kind of output:
807                         an executable, object files, assembler files,
808                         or preprocessed source.
809 * C Dialect Options::   Controlling the variant of C language compiled.
810 * C++ Dialect Options:: Variations on C++.
811 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
812                         and Objective-C++.
813 * Language Independent Options:: Controlling how diagnostics should be
814                         formatted.
815 * Warning Options::     How picky should the compiler be?
816 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
817 * Optimize Options::    How much optimization?
818 * Preprocessor Options:: Controlling header files and macro definitions.
819                          Also, getting dependency information for Make.
820 * Assembler Options::   Passing options to the assembler.
821 * Link Options::        Specifying libraries and so on.
822 * Directory Options::   Where to find header files and libraries.
823                         Where to find the compiler executable files.
824 * Spec Files::          How to pass switches to sub-processes.
825 * Target Options::      Running a cross-compiler, or an old version of GCC.
826 @end menu
828 @node Overall Options
829 @section Options Controlling the Kind of Output
831 Compilation can involve up to four stages: preprocessing, compilation
832 proper, assembly and linking, always in that order.  GCC is capable of
833 preprocessing and compiling several files either into several
834 assembler input files, or into one assembler input file; then each
835 assembler input file produces an object file, and linking combines all
836 the object files (those newly compiled, and those specified as input)
837 into an executable file.
839 @cindex file name suffix
840 For any given input file, the file name suffix determines what kind of
841 compilation is done:
843 @table @gcctabopt
844 @item @var{file}.c
845 C source code which must be preprocessed.
847 @item @var{file}.i
848 C source code which should not be preprocessed.
850 @item @var{file}.ii
851 C++ source code which should not be preprocessed.
853 @item @var{file}.m
854 Objective-C source code.  Note that you must link with the @file{libobjc}
855 library to make an Objective-C program work.
857 @item @var{file}.mi
858 Objective-C source code which should not be preprocessed.
860 @item @var{file}.mm
861 @itemx @var{file}.M
862 Objective-C++ source code.  Note that you must link with the @file{libobjc}
863 library to make an Objective-C++ program work.  Note that @samp{.M} refers
864 to a literal capital M@.
866 @item @var{file}.mii
867 Objective-C++ source code which should not be preprocessed.
869 @item @var{file}.h
870 C, C++, Objective-C or Objective-C++ header file to be turned into a
871 precompiled header.
873 @item @var{file}.cc
874 @itemx @var{file}.cp
875 @itemx @var{file}.cxx
876 @itemx @var{file}.cpp
877 @itemx @var{file}.CPP
878 @itemx @var{file}.c++
879 @itemx @var{file}.C
880 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
881 the last two letters must both be literally @samp{x}.  Likewise,
882 @samp{.C} refers to a literal capital C@.
884 @item @var{file}.mm
885 @itemx @var{file}.M
886 Objective-C++ source code which must be preprocessed.
888 @item @var{file}.mii
889 Objective-C++ source code which should not be preprocessed.
891 @item @var{file}.hh
892 @itemx @var{file}.H
893 C++ header file to be turned into a precompiled header.
895 @item @var{file}.f
896 @itemx @var{file}.for
897 @itemx @var{file}.FOR
898 Fixed form Fortran source code which should not be preprocessed.
900 @item @var{file}.F
901 @itemx @var{file}.fpp
902 @itemx @var{file}.FPP
903 Fixed form Fortran source code which must be preprocessed (with the traditional
904 preprocessor).
906 @item @var{file}.f90
907 @itemx @var{file}.f95
908 Free form Fortran source code which should not be preprocessed.
910 @item @var{file}.F90
911 @itemx @var{file}.F95
912 Free form Fortran source code which must be preprocessed (with the
913 traditional preprocessor).
915 @c FIXME: Descriptions of Java file types.
916 @c @var{file}.java
917 @c @var{file}.class
918 @c @var{file}.zip
919 @c @var{file}.jar
921 @item @var{file}.ads
922 Ada source code file which contains a library unit declaration (a
923 declaration of a package, subprogram, or generic, or a generic
924 instantiation), or a library unit renaming declaration (a package,
925 generic, or subprogram renaming declaration).  Such files are also
926 called @dfn{specs}.
928 @itemx @var{file}.adb
929 Ada source code file containing a library unit body (a subprogram or
930 package body).  Such files are also called @dfn{bodies}.
932 @c GCC also knows about some suffixes for languages not yet included:
933 @c Pascal:
934 @c @var{file}.p
935 @c @var{file}.pas
936 @c Ratfor:
937 @c @var{file}.r
939 @item @var{file}.s
940 Assembler code.
942 @item @var{file}.S
943 Assembler code which must be preprocessed.
945 @item @var{other}
946 An object file to be fed straight into linking.
947 Any file name with no recognized suffix is treated this way.
948 @end table
950 @opindex x
951 You can specify the input language explicitly with the @option{-x} option:
953 @table @gcctabopt
954 @item -x @var{language}
955 Specify explicitly the @var{language} for the following input files
956 (rather than letting the compiler choose a default based on the file
957 name suffix).  This option applies to all following input files until
958 the next @option{-x} option.  Possible values for @var{language} are:
959 @smallexample
960 c  c-header  c-cpp-output
961 c++  c++-header  c++-cpp-output
962 objective-c  objective-c-header  objective-c-cpp-output
963 objective-c++ objective-c++-header objective-c++-cpp-output
964 assembler  assembler-with-cpp
966 f95  f95-cpp-input
967 java
968 treelang
969 @end smallexample
971 @item -x none
972 Turn off any specification of a language, so that subsequent files are
973 handled according to their file name suffixes (as they are if @option{-x}
974 has not been used at all).
976 @item -pass-exit-codes
977 @opindex pass-exit-codes
978 Normally the @command{gcc} program will exit with the code of 1 if any
979 phase of the compiler returns a non-success return code.  If you specify
980 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
981 numerically highest error produced by any phase that returned an error
982 indication.  The C, C++, and Fortran frontends return 4, if an internal
983 compiler error is encountered.
984 @end table
986 If you only want some of the stages of compilation, you can use
987 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
988 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
989 @command{gcc} is to stop.  Note that some combinations (for example,
990 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
992 @table @gcctabopt
993 @item -c
994 @opindex c
995 Compile or assemble the source files, but do not link.  The linking
996 stage simply is not done.  The ultimate output is in the form of an
997 object file for each source file.
999 By default, the object file name for a source file is made by replacing
1000 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1002 Unrecognized input files, not requiring compilation or assembly, are
1003 ignored.
1005 @item -S
1006 @opindex S
1007 Stop after the stage of compilation proper; do not assemble.  The output
1008 is in the form of an assembler code file for each non-assembler input
1009 file specified.
1011 By default, the assembler file name for a source file is made by
1012 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1014 Input files that don't require compilation are ignored.
1016 @item -E
1017 @opindex E
1018 Stop after the preprocessing stage; do not run the compiler proper.  The
1019 output is in the form of preprocessed source code, which is sent to the
1020 standard output.
1022 Input files which don't require preprocessing are ignored.
1024 @cindex output file option
1025 @item -o @var{file}
1026 @opindex o
1027 Place output in file @var{file}.  This applies regardless to whatever
1028 sort of output is being produced, whether it be an executable file,
1029 an object file, an assembler file or preprocessed C code.
1031 If @option{-o} is not specified, the default is to put an executable
1032 file in @file{a.out}, the object file for
1033 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1034 assembler file in @file{@var{source}.s}, a precompiled header file in
1035 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1036 standard output.
1038 @item -v
1039 @opindex v
1040 Print (on standard error output) the commands executed to run the stages
1041 of compilation.  Also print the version number of the compiler driver
1042 program and of the preprocessor and the compiler proper.
1044 @item -###
1045 @opindex ###
1046 Like @option{-v} except the commands are not executed and all command
1047 arguments are quoted.  This is useful for shell scripts to capture the
1048 driver-generated command lines.
1050 @item -pipe
1051 @opindex pipe
1052 Use pipes rather than temporary files for communication between the
1053 various stages of compilation.  This fails to work on some systems where
1054 the assembler is unable to read from a pipe; but the GNU assembler has
1055 no trouble.
1057 @item -combine
1058 @opindex combine
1059 If you are compiling multiple source files, this option tells the driver
1060 to pass all the source files to the compiler at once (for those
1061 languages for which the compiler can handle this).  This will allow
1062 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1063 language for which this is supported is C@.  If you pass source files for
1064 multiple languages to the driver, using this option, the driver will invoke
1065 the compiler(s) that support IMA once each, passing each compiler all the
1066 source files appropriate for it.  For those languages that do not support
1067 IMA this option will be ignored, and the compiler will be invoked once for
1068 each source file in that language.  If you use this option in conjunction
1069 with @option{-save-temps}, the compiler will generate multiple
1070 pre-processed files
1071 (one for each source file), but only one (combined) @file{.o} or
1072 @file{.s} file.
1074 @item --help
1075 @opindex help
1076 Print (on the standard output) a description of the command line options
1077 understood by @command{gcc}.  If the @option{-v} option is also specified
1078 then @option{--help} will also be passed on to the various processes
1079 invoked by @command{gcc}, so that they can display the command line options
1080 they accept.  If the @option{-Wextra} option is also specified then command
1081 line options which have no documentation associated with them will also
1082 be displayed.
1084 @item --target-help
1085 @opindex target-help
1086 Print (on the standard output) a description of target specific command
1087 line options for each tool.
1089 @item --version
1090 @opindex version
1091 Display the version number and copyrights of the invoked GCC@.
1093 @include @value{srcdir}/../libiberty/at-file.texi
1094 @end table
1096 @node Invoking G++
1097 @section Compiling C++ Programs
1099 @cindex suffixes for C++ source
1100 @cindex C++ source file suffixes
1101 C++ source files conventionally use one of the suffixes @samp{.C},
1102 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1103 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1104 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1105 files with these names and compiles them as C++ programs even if you
1106 call the compiler the same way as for compiling C programs (usually
1107 with the name @command{gcc}).
1109 @findex g++
1110 @findex c++
1111 However, the use of @command{gcc} does not add the C++ library.
1112 @command{g++} is a program that calls GCC and treats @samp{.c},
1113 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1114 files unless @option{-x} is used, and automatically specifies linking
1115 against the C++ library.  This program is also useful when
1116 precompiling a C header file with a @samp{.h} extension for use in C++
1117 compilations.  On many systems, @command{g++} is also installed with
1118 the name @command{c++}.
1120 @cindex invoking @command{g++}
1121 When you compile C++ programs, you may specify many of the same
1122 command-line options that you use for compiling programs in any
1123 language; or command-line options meaningful for C and related
1124 languages; or options that are meaningful only for C++ programs.
1125 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1126 explanations of options for languages related to C@.
1127 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1128 explanations of options that are meaningful only for C++ programs.
1130 @node C Dialect Options
1131 @section Options Controlling C Dialect
1132 @cindex dialect options
1133 @cindex language dialect options
1134 @cindex options, dialect
1136 The following options control the dialect of C (or languages derived
1137 from C, such as C++, Objective-C and Objective-C++) that the compiler
1138 accepts:
1140 @table @gcctabopt
1141 @cindex ANSI support
1142 @cindex ISO support
1143 @item -ansi
1144 @opindex ansi
1145 In C mode, support all ISO C90 programs.  In C++ mode,
1146 remove GNU extensions that conflict with ISO C++.
1148 This turns off certain features of GCC that are incompatible with ISO
1149 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1150 such as the @code{asm} and @code{typeof} keywords, and
1151 predefined macros such as @code{unix} and @code{vax} that identify the
1152 type of system you are using.  It also enables the undesirable and
1153 rarely used ISO trigraph feature.  For the C compiler,
1154 it disables recognition of C++ style @samp{//} comments as well as
1155 the @code{inline} keyword.
1157 The alternate keywords @code{__asm__}, @code{__extension__},
1158 @code{__inline__} and @code{__typeof__} continue to work despite
1159 @option{-ansi}.  You would not want to use them in an ISO C program, of
1160 course, but it is useful to put them in header files that might be included
1161 in compilations done with @option{-ansi}.  Alternate predefined macros
1162 such as @code{__unix__} and @code{__vax__} are also available, with or
1163 without @option{-ansi}.
1165 The @option{-ansi} option does not cause non-ISO programs to be
1166 rejected gratuitously.  For that, @option{-pedantic} is required in
1167 addition to @option{-ansi}.  @xref{Warning Options}.
1169 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1170 option is used.  Some header files may notice this macro and refrain
1171 from declaring certain functions or defining certain macros that the
1172 ISO standard doesn't call for; this is to avoid interfering with any
1173 programs that might use these names for other things.
1175 Functions which would normally be built in but do not have semantics
1176 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1177 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1178 built-in functions provided by GCC}, for details of the functions
1179 affected.
1181 @item -std=
1182 @opindex std
1183 Determine the language standard.  This option is currently only
1184 supported when compiling C or C++.  A value for this option must be
1185 provided; possible values are
1187 @table @samp
1188 @item c89
1189 @itemx iso9899:1990
1190 ISO C90 (same as @option{-ansi}).
1192 @item iso9899:199409
1193 ISO C90 as modified in amendment 1.
1195 @item c99
1196 @itemx c9x
1197 @itemx iso9899:1999
1198 @itemx iso9899:199x
1199 ISO C99.  Note that this standard is not yet fully supported; see
1200 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1201 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1203 @item gnu89
1204 Default, ISO C90 plus GNU extensions (including some C99 features).
1206 @item gnu99
1207 @itemx gnu9x
1208 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1209 this will become the default.  The name @samp{gnu9x} is deprecated.
1211 @item c++98
1212 The 1998 ISO C++ standard plus amendments.
1214 @item gnu++98
1215 The same as @option{-std=c++98} plus GNU extensions.  This is the
1216 default for C++ code.
1218 @item c++0x
1219 The working draft of the upcoming ISO C++0x standard. This option
1220 enables experimental features that are likely to be included in
1221 C++0x. The working draft is constantly changing, and any feature that is
1222 enabled by this flag may be removed from future versions of GCC if it is
1223 not part of the C++0x standard.
1225 @item gnu++0x
1226 The same as @option{-std=c++0x} plus GNU extensions. As with
1227 @option{-std=c++0x}, this option enables experimental features that may
1228 be removed in future versions of GCC.
1229 @end table
1231 Even when this option is not specified, you can still use some of the
1232 features of newer standards in so far as they do not conflict with
1233 previous C standards.  For example, you may use @code{__restrict__} even
1234 when @option{-std=c99} is not specified.
1236 The @option{-std} options specifying some version of ISO C have the same
1237 effects as @option{-ansi}, except that features that were not in ISO C90
1238 but are in the specified version (for example, @samp{//} comments and
1239 the @code{inline} keyword in ISO C99) are not disabled.
1241 @xref{Standards,,Language Standards Supported by GCC}, for details of
1242 these standard versions.
1244 @item -aux-info @var{filename}
1245 @opindex aux-info
1246 Output to the given filename prototyped declarations for all functions
1247 declared and/or defined in a translation unit, including those in header
1248 files.  This option is silently ignored in any language other than C@.
1250 Besides declarations, the file indicates, in comments, the origin of
1251 each declaration (source file and line), whether the declaration was
1252 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1253 @samp{O} for old, respectively, in the first character after the line
1254 number and the colon), and whether it came from a declaration or a
1255 definition (@samp{C} or @samp{F}, respectively, in the following
1256 character).  In the case of function definitions, a K&R-style list of
1257 arguments followed by their declarations is also provided, inside
1258 comments, after the declaration.
1260 @item -fno-asm
1261 @opindex fno-asm
1262 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1263 keyword, so that code can use these words as identifiers.  You can use
1264 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1265 instead.  @option{-ansi} implies @option{-fno-asm}.
1267 In C++, this switch only affects the @code{typeof} keyword, since
1268 @code{asm} and @code{inline} are standard keywords.  You may want to
1269 use the @option{-fno-gnu-keywords} flag instead, which has the same
1270 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1271 switch only affects the @code{asm} and @code{typeof} keywords, since
1272 @code{inline} is a standard keyword in ISO C99.
1274 @item -fno-builtin
1275 @itemx -fno-builtin-@var{function}
1276 @opindex fno-builtin
1277 @cindex built-in functions
1278 Don't recognize built-in functions that do not begin with
1279 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1280 functions provided by GCC}, for details of the functions affected,
1281 including those which are not built-in functions when @option{-ansi} or
1282 @option{-std} options for strict ISO C conformance are used because they
1283 do not have an ISO standard meaning.
1285 GCC normally generates special code to handle certain built-in functions
1286 more efficiently; for instance, calls to @code{alloca} may become single
1287 instructions that adjust the stack directly, and calls to @code{memcpy}
1288 may become inline copy loops.  The resulting code is often both smaller
1289 and faster, but since the function calls no longer appear as such, you
1290 cannot set a breakpoint on those calls, nor can you change the behavior
1291 of the functions by linking with a different library.  In addition,
1292 when a function is recognized as a built-in function, GCC may use
1293 information about that function to warn about problems with calls to
1294 that function, or to generate more efficient code, even if the
1295 resulting code still contains calls to that function.  For example,
1296 warnings are given with @option{-Wformat} for bad calls to
1297 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1298 known not to modify global memory.
1300 With the @option{-fno-builtin-@var{function}} option
1301 only the built-in function @var{function} is
1302 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1303 function is named this is not built-in in this version of GCC, this
1304 option is ignored.  There is no corresponding
1305 @option{-fbuiltin-@var{function}} option; if you wish to enable
1306 built-in functions selectively when using @option{-fno-builtin} or
1307 @option{-ffreestanding}, you may define macros such as:
1309 @smallexample
1310 #define abs(n)          __builtin_abs ((n))
1311 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1312 @end smallexample
1314 @item -fhosted
1315 @opindex fhosted
1316 @cindex hosted environment
1318 Assert that compilation takes place in a hosted environment.  This implies
1319 @option{-fbuiltin}.  A hosted environment is one in which the
1320 entire standard library is available, and in which @code{main} has a return
1321 type of @code{int}.  Examples are nearly everything except a kernel.
1322 This is equivalent to @option{-fno-freestanding}.
1324 @item -ffreestanding
1325 @opindex ffreestanding
1326 @cindex hosted environment
1328 Assert that compilation takes place in a freestanding environment.  This
1329 implies @option{-fno-builtin}.  A freestanding environment
1330 is one in which the standard library may not exist, and program startup may
1331 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1332 This is equivalent to @option{-fno-hosted}.
1334 @xref{Standards,,Language Standards Supported by GCC}, for details of
1335 freestanding and hosted environments.
1337 @item -fopenmp
1338 @opindex fopenmp
1339 @cindex openmp parallel
1340 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1341 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1342 compiler generates parallel code according to the OpenMP Application
1343 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1345 @item -fms-extensions
1346 @opindex fms-extensions
1347 Accept some non-standard constructs used in Microsoft header files.
1349 Some cases of unnamed fields in structures and unions are only
1350 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1351 fields within structs/unions}, for details.
1353 @item -trigraphs
1354 @opindex trigraphs
1355 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1356 options for strict ISO C conformance) implies @option{-trigraphs}.
1358 @item -no-integrated-cpp
1359 @opindex no-integrated-cpp
1360 Performs a compilation in two passes: preprocessing and compiling.  This
1361 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1362 @option{-B} option.  The user supplied compilation step can then add in
1363 an additional preprocessing step after normal preprocessing but before
1364 compiling.  The default is to use the integrated cpp (internal cpp)
1366 The semantics of this option will change if "cc1", "cc1plus", and
1367 "cc1obj" are merged.
1369 @cindex traditional C language
1370 @cindex C language, traditional
1371 @item -traditional
1372 @itemx -traditional-cpp
1373 @opindex traditional-cpp
1374 @opindex traditional
1375 Formerly, these options caused GCC to attempt to emulate a pre-standard
1376 C compiler.  They are now only supported with the @option{-E} switch.
1377 The preprocessor continues to support a pre-standard mode.  See the GNU
1378 CPP manual for details.
1380 @item -fcond-mismatch
1381 @opindex fcond-mismatch
1382 Allow conditional expressions with mismatched types in the second and
1383 third arguments.  The value of such an expression is void.  This option
1384 is not supported for C++.
1386 @item -funsigned-char
1387 @opindex funsigned-char
1388 Let the type @code{char} be unsigned, like @code{unsigned char}.
1390 Each kind of machine has a default for what @code{char} should
1391 be.  It is either like @code{unsigned char} by default or like
1392 @code{signed char} by default.
1394 Ideally, a portable program should always use @code{signed char} or
1395 @code{unsigned char} when it depends on the signedness of an object.
1396 But many programs have been written to use plain @code{char} and
1397 expect it to be signed, or expect it to be unsigned, depending on the
1398 machines they were written for.  This option, and its inverse, let you
1399 make such a program work with the opposite default.
1401 The type @code{char} is always a distinct type from each of
1402 @code{signed char} or @code{unsigned char}, even though its behavior
1403 is always just like one of those two.
1405 @item -fsigned-char
1406 @opindex fsigned-char
1407 Let the type @code{char} be signed, like @code{signed char}.
1409 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1410 the negative form of @option{-funsigned-char}.  Likewise, the option
1411 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1413 @item -fsigned-bitfields
1414 @itemx -funsigned-bitfields
1415 @itemx -fno-signed-bitfields
1416 @itemx -fno-unsigned-bitfields
1417 @opindex fsigned-bitfields
1418 @opindex funsigned-bitfields
1419 @opindex fno-signed-bitfields
1420 @opindex fno-unsigned-bitfields
1421 These options control whether a bit-field is signed or unsigned, when the
1422 declaration does not use either @code{signed} or @code{unsigned}.  By
1423 default, such a bit-field is signed, because this is consistent: the
1424 basic integer types such as @code{int} are signed types.
1425 @end table
1427 @node C++ Dialect Options
1428 @section Options Controlling C++ Dialect
1430 @cindex compiler options, C++
1431 @cindex C++ options, command line
1432 @cindex options, C++
1433 This section describes the command-line options that are only meaningful
1434 for C++ programs; but you can also use most of the GNU compiler options
1435 regardless of what language your program is in.  For example, you
1436 might compile a file @code{firstClass.C} like this:
1438 @smallexample
1439 g++ -g -frepo -O -c firstClass.C
1440 @end smallexample
1442 @noindent
1443 In this example, only @option{-frepo} is an option meant
1444 only for C++ programs; you can use the other options with any
1445 language supported by GCC@.
1447 Here is a list of options that are @emph{only} for compiling C++ programs:
1449 @table @gcctabopt
1451 @item -fabi-version=@var{n}
1452 @opindex fabi-version
1453 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1454 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1455 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1456 the version that conforms most closely to the C++ ABI specification.
1457 Therefore, the ABI obtained using version 0 will change as ABI bugs
1458 are fixed.
1460 The default is version 2.
1462 @item -fno-access-control
1463 @opindex fno-access-control
1464 Turn off all access checking.  This switch is mainly useful for working
1465 around bugs in the access control code.
1467 @item -fcheck-new
1468 @opindex fcheck-new
1469 Check that the pointer returned by @code{operator new} is non-null
1470 before attempting to modify the storage allocated.  This check is
1471 normally unnecessary because the C++ standard specifies that
1472 @code{operator new} will only return @code{0} if it is declared
1473 @samp{throw()}, in which case the compiler will always check the
1474 return value even without this option.  In all other cases, when
1475 @code{operator new} has a non-empty exception specification, memory
1476 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1477 @samp{new (nothrow)}.
1479 @item -fconserve-space
1480 @opindex fconserve-space
1481 Put uninitialized or runtime-initialized global variables into the
1482 common segment, as C does.  This saves space in the executable at the
1483 cost of not diagnosing duplicate definitions.  If you compile with this
1484 flag and your program mysteriously crashes after @code{main()} has
1485 completed, you may have an object that is being destroyed twice because
1486 two definitions were merged.
1488 This option is no longer useful on most targets, now that support has
1489 been added for putting variables into BSS without making them common.
1491 @item -ffriend-injection
1492 @opindex ffriend-injection
1493 Inject friend functions into the enclosing namespace, so that they are
1494 visible outside the scope of the class in which they are declared.
1495 Friend functions were documented to work this way in the old Annotated
1496 C++ Reference Manual, and versions of G++ before 4.1 always worked
1497 that way.  However, in ISO C++ a friend function which is not declared
1498 in an enclosing scope can only be found using argument dependent
1499 lookup.  This option causes friends to be injected as they were in
1500 earlier releases.
1502 This option is for compatibility, and may be removed in a future
1503 release of G++.
1505 @item -fno-elide-constructors
1506 @opindex fno-elide-constructors
1507 The C++ standard allows an implementation to omit creating a temporary
1508 which is only used to initialize another object of the same type.
1509 Specifying this option disables that optimization, and forces G++ to
1510 call the copy constructor in all cases.
1512 @item -fno-enforce-eh-specs
1513 @opindex fno-enforce-eh-specs
1514 Don't generate code to check for violation of exception specifications
1515 at runtime.  This option violates the C++ standard, but may be useful
1516 for reducing code size in production builds, much like defining
1517 @samp{NDEBUG}.  This does not give user code permission to throw
1518 exceptions in violation of the exception specifications; the compiler
1519 will still optimize based on the specifications, so throwing an
1520 unexpected exception will result in undefined behavior.
1522 @item -ffor-scope
1523 @itemx -fno-for-scope
1524 @opindex ffor-scope
1525 @opindex fno-for-scope
1526 If @option{-ffor-scope} is specified, the scope of variables declared in
1527 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1528 as specified by the C++ standard.
1529 If @option{-fno-for-scope} is specified, the scope of variables declared in
1530 a @i{for-init-statement} extends to the end of the enclosing scope,
1531 as was the case in old versions of G++, and other (traditional)
1532 implementations of C++.
1534 The default if neither flag is given to follow the standard,
1535 but to allow and give a warning for old-style code that would
1536 otherwise be invalid, or have different behavior.
1538 @item -fno-gnu-keywords
1539 @opindex fno-gnu-keywords
1540 Do not recognize @code{typeof} as a keyword, so that code can use this
1541 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1542 @option{-ansi} implies @option{-fno-gnu-keywords}.
1544 @item -fno-implicit-templates
1545 @opindex fno-implicit-templates
1546 Never emit code for non-inline templates which are instantiated
1547 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1548 @xref{Template Instantiation}, for more information.
1550 @item -fno-implicit-inline-templates
1551 @opindex fno-implicit-inline-templates
1552 Don't emit code for implicit instantiations of inline templates, either.
1553 The default is to handle inlines differently so that compiles with and
1554 without optimization will need the same set of explicit instantiations.
1556 @item -fno-implement-inlines
1557 @opindex fno-implement-inlines
1558 To save space, do not emit out-of-line copies of inline functions
1559 controlled by @samp{#pragma implementation}.  This will cause linker
1560 errors if these functions are not inlined everywhere they are called.
1562 @item -fms-extensions
1563 @opindex fms-extensions
1564 Disable pedantic warnings about constructs used in MFC, such as implicit
1565 int and getting a pointer to member function via non-standard syntax.
1567 @item -fno-nonansi-builtins
1568 @opindex fno-nonansi-builtins
1569 Disable built-in declarations of functions that are not mandated by
1570 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1571 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1573 @item -fno-operator-names
1574 @opindex fno-operator-names
1575 Do not treat the operator name keywords @code{and}, @code{bitand},
1576 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1577 synonyms as keywords.
1579 @item -fno-optional-diags
1580 @opindex fno-optional-diags
1581 Disable diagnostics that the standard says a compiler does not need to
1582 issue.  Currently, the only such diagnostic issued by G++ is the one for
1583 a name having multiple meanings within a class.
1585 @item -fpermissive
1586 @opindex fpermissive
1587 Downgrade some diagnostics about nonconformant code from errors to
1588 warnings.  Thus, using @option{-fpermissive} will allow some
1589 nonconforming code to compile.
1591 @item -frepo
1592 @opindex frepo
1593 Enable automatic template instantiation at link time.  This option also
1594 implies @option{-fno-implicit-templates}.  @xref{Template
1595 Instantiation}, for more information.
1597 @item -fno-rtti
1598 @opindex fno-rtti
1599 Disable generation of information about every class with virtual
1600 functions for use by the C++ runtime type identification features
1601 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1602 of the language, you can save some space by using this flag.  Note that
1603 exception handling uses the same information, but it will generate it as
1604 needed. The @samp{dynamic_cast} operator can still be used for casts that
1605 do not require runtime type information, i.e. casts to @code{void *} or to
1606 unambiguous base classes.
1608 @item -fstats
1609 @opindex fstats
1610 Emit statistics about front-end processing at the end of the compilation.
1611 This information is generally only useful to the G++ development team.
1613 @item -ftemplate-depth-@var{n}
1614 @opindex ftemplate-depth
1615 Set the maximum instantiation depth for template classes to @var{n}.
1616 A limit on the template instantiation depth is needed to detect
1617 endless recursions during template class instantiation.  ANSI/ISO C++
1618 conforming programs must not rely on a maximum depth greater than 17.
1620 @item -fno-threadsafe-statics
1621 @opindex fno-threadsafe-statics
1622 Do not emit the extra code to use the routines specified in the C++
1623 ABI for thread-safe initialization of local statics.  You can use this
1624 option to reduce code size slightly in code that doesn't need to be
1625 thread-safe.
1627 @item -fuse-cxa-atexit
1628 @opindex fuse-cxa-atexit
1629 Register destructors for objects with static storage duration with the
1630 @code{__cxa_atexit} function rather than the @code{atexit} function.
1631 This option is required for fully standards-compliant handling of static
1632 destructors, but will only work if your C library supports
1633 @code{__cxa_atexit}.
1635 @item -fno-use-cxa-get-exception-ptr
1636 @opindex fno-use-cxa-get-exception-ptr
1637 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1638 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1639 if the runtime routine is not available.
1641 @item -fvisibility-inlines-hidden
1642 @opindex fvisibility-inlines-hidden
1643 This switch declares that the user does not attempt to compare
1644 pointers to inline methods where the addresses of the two functions
1645 were taken in different shared objects.
1647 The effect of this is that GCC may, effectively, mark inline methods with
1648 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1649 appear in the export table of a DSO and do not require a PLT indirection
1650 when used within the DSO@.  Enabling this option can have a dramatic effect
1651 on load and link times of a DSO as it massively reduces the size of the
1652 dynamic export table when the library makes heavy use of templates.
1654 The behaviour of this switch is not quite the same as marking the
1655 methods as hidden directly, because it does not affect static variables
1656 local to the function or cause the compiler to deduce that
1657 the function is defined in only one shared object.
1659 You may mark a method as having a visibility explicitly to negate the
1660 effect of the switch for that method.  For example, if you do want to
1661 compare pointers to a particular inline method, you might mark it as
1662 having default visibility.  Marking the enclosing class with explicit
1663 visibility will have no effect.
1665 Explicitly instantiated inline methods are unaffected by this option
1666 as their linkage might otherwise cross a shared library boundary.
1667 @xref{Template Instantiation}.
1669 @item -fno-weak
1670 @opindex fno-weak
1671 Do not use weak symbol support, even if it is provided by the linker.
1672 By default, G++ will use weak symbols if they are available.  This
1673 option exists only for testing, and should not be used by end-users;
1674 it will result in inferior code and has no benefits.  This option may
1675 be removed in a future release of G++.
1677 @item -nostdinc++
1678 @opindex nostdinc++
1679 Do not search for header files in the standard directories specific to
1680 C++, but do still search the other standard directories.  (This option
1681 is used when building the C++ library.)
1682 @end table
1684 In addition, these optimization, warning, and code generation options
1685 have meanings only for C++ programs:
1687 @table @gcctabopt
1688 @item -fno-default-inline
1689 @opindex fno-default-inline
1690 Do not assume @samp{inline} for functions defined inside a class scope.
1691 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1692 functions will have linkage like inline functions; they just won't be
1693 inlined by default.
1695 @item -Wabi @r{(C++ only)}
1696 @opindex Wabi
1697 Warn when G++ generates code that is probably not compatible with the
1698 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1699 all such cases, there are probably some cases that are not warned about,
1700 even though G++ is generating incompatible code.  There may also be
1701 cases where warnings are emitted even though the code that is generated
1702 will be compatible.
1704 You should rewrite your code to avoid these warnings if you are
1705 concerned about the fact that code generated by G++ may not be binary
1706 compatible with code generated by other compilers.
1708 The known incompatibilities at this point include:
1710 @itemize @bullet
1712 @item
1713 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1714 pack data into the same byte as a base class.  For example:
1716 @smallexample
1717 struct A @{ virtual void f(); int f1 : 1; @};
1718 struct B : public A @{ int f2 : 1; @};
1719 @end smallexample
1721 @noindent
1722 In this case, G++ will place @code{B::f2} into the same byte
1723 as@code{A::f1}; other compilers will not.  You can avoid this problem
1724 by explicitly padding @code{A} so that its size is a multiple of the
1725 byte size on your platform; that will cause G++ and other compilers to
1726 layout @code{B} identically.
1728 @item
1729 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1730 tail padding when laying out virtual bases.  For example:
1732 @smallexample
1733 struct A @{ virtual void f(); char c1; @};
1734 struct B @{ B(); char c2; @};
1735 struct C : public A, public virtual B @{@};
1736 @end smallexample
1738 @noindent
1739 In this case, G++ will not place @code{B} into the tail-padding for
1740 @code{A}; other compilers will.  You can avoid this problem by
1741 explicitly padding @code{A} so that its size is a multiple of its
1742 alignment (ignoring virtual base classes); that will cause G++ and other
1743 compilers to layout @code{C} identically.
1745 @item
1746 Incorrect handling of bit-fields with declared widths greater than that
1747 of their underlying types, when the bit-fields appear in a union.  For
1748 example:
1750 @smallexample
1751 union U @{ int i : 4096; @};
1752 @end smallexample
1754 @noindent
1755 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1756 union too small by the number of bits in an @code{int}.
1758 @item
1759 Empty classes can be placed at incorrect offsets.  For example:
1761 @smallexample
1762 struct A @{@};
1764 struct B @{
1765   A a;
1766   virtual void f ();
1769 struct C : public B, public A @{@};
1770 @end smallexample
1772 @noindent
1773 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1774 it should be placed at offset zero.  G++ mistakenly believes that the
1775 @code{A} data member of @code{B} is already at offset zero.
1777 @item
1778 Names of template functions whose types involve @code{typename} or
1779 template template parameters can be mangled incorrectly.
1781 @smallexample
1782 template <typename Q>
1783 void f(typename Q::X) @{@}
1785 template <template <typename> class Q>
1786 void f(typename Q<int>::X) @{@}
1787 @end smallexample
1789 @noindent
1790 Instantiations of these templates may be mangled incorrectly.
1792 @end itemize
1794 @item -Wctor-dtor-privacy @r{(C++ only)}
1795 @opindex Wctor-dtor-privacy
1796 Warn when a class seems unusable because all the constructors or
1797 destructors in that class are private, and it has neither friends nor
1798 public static member functions.
1800 @item -Wnon-virtual-dtor @r{(C++ only)}
1801 @opindex Wnon-virtual-dtor
1802 Warn when a class appears to be polymorphic, thereby requiring a virtual
1803 destructor, yet it declares a non-virtual one.  This warning is also
1804 enabled if -Weffc++ is specified.
1806 @item -Wreorder @r{(C++ only)}
1807 @opindex Wreorder
1808 @cindex reordering, warning
1809 @cindex warning for reordering of member initializers
1810 Warn when the order of member initializers given in the code does not
1811 match the order in which they must be executed.  For instance:
1813 @smallexample
1814 struct A @{
1815   int i;
1816   int j;
1817   A(): j (0), i (1) @{ @}
1819 @end smallexample
1821 The compiler will rearrange the member initializers for @samp{i}
1822 and @samp{j} to match the declaration order of the members, emitting
1823 a warning to that effect.  This warning is enabled by @option{-Wall}.
1824 @end table
1826 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1828 @table @gcctabopt
1829 @item -Weffc++ @r{(C++ only)}
1830 @opindex Weffc++
1831 Warn about violations of the following style guidelines from Scott Meyers'
1832 @cite{Effective C++} book:
1834 @itemize @bullet
1835 @item
1836 Item 11:  Define a copy constructor and an assignment operator for classes
1837 with dynamically allocated memory.
1839 @item
1840 Item 12:  Prefer initialization to assignment in constructors.
1842 @item
1843 Item 14:  Make destructors virtual in base classes.
1845 @item
1846 Item 15:  Have @code{operator=} return a reference to @code{*this}.
1848 @item
1849 Item 23:  Don't try to return a reference when you must return an object.
1851 @end itemize
1853 Also warn about violations of the following style guidelines from
1854 Scott Meyers' @cite{More Effective C++} book:
1856 @itemize @bullet
1857 @item
1858 Item 6:  Distinguish between prefix and postfix forms of increment and
1859 decrement operators.
1861 @item
1862 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
1864 @end itemize
1866 When selecting this option, be aware that the standard library
1867 headers do not obey all of these guidelines; use @samp{grep -v}
1868 to filter out those warnings.
1870 @item -Wno-deprecated @r{(C++ only)}
1871 @opindex Wno-deprecated
1872 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
1874 @item -Wstrict-null-sentinel @r{(C++ only)}
1875 @opindex Wstrict-null-sentinel
1876 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
1877 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
1878 to @code{__null}.  Although it is a null pointer constant not a null pointer,
1879 it is guaranteed to of the same size as a pointer.  But this use is
1880 not portable across different compilers.
1882 @item -Wno-non-template-friend @r{(C++ only)}
1883 @opindex Wno-non-template-friend
1884 Disable warnings when non-templatized friend functions are declared
1885 within a template.  Since the advent of explicit template specification
1886 support in G++, if the name of the friend is an unqualified-id (i.e.,
1887 @samp{friend foo(int)}), the C++ language specification demands that the
1888 friend declare or define an ordinary, nontemplate function.  (Section
1889 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
1890 could be interpreted as a particular specialization of a templatized
1891 function.  Because this non-conforming behavior is no longer the default
1892 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
1893 check existing code for potential trouble spots and is on by default.
1894 This new compiler behavior can be turned off with
1895 @option{-Wno-non-template-friend} which keeps the conformant compiler code
1896 but disables the helpful warning.
1898 @item -Wold-style-cast @r{(C++ only)}
1899 @opindex Wold-style-cast
1900 Warn if an old-style (C-style) cast to a non-void type is used within
1901 a C++ program.  The new-style casts (@samp{dynamic_cast},
1902 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
1903 less vulnerable to unintended effects and much easier to search for.
1905 @item -Woverloaded-virtual @r{(C++ only)}
1906 @opindex Woverloaded-virtual
1907 @cindex overloaded virtual fn, warning
1908 @cindex warning for overloaded virtual fn
1909 Warn when a function declaration hides virtual functions from a
1910 base class.  For example, in:
1912 @smallexample
1913 struct A @{
1914   virtual void f();
1917 struct B: public A @{
1918   void f(int);
1920 @end smallexample
1922 the @code{A} class version of @code{f} is hidden in @code{B}, and code
1923 like:
1925 @smallexample
1926 B* b;
1927 b->f();
1928 @end smallexample
1930 will fail to compile.
1932 @item -Wno-pmf-conversions @r{(C++ only)}
1933 @opindex Wno-pmf-conversions
1934 Disable the diagnostic for converting a bound pointer to member function
1935 to a plain pointer.
1937 @item -Wsign-promo @r{(C++ only)}
1938 @opindex Wsign-promo
1939 Warn when overload resolution chooses a promotion from unsigned or
1940 enumerated type to a signed type, over a conversion to an unsigned type of
1941 the same size.  Previous versions of G++ would try to preserve
1942 unsignedness, but the standard mandates the current behavior.
1944 @smallexample
1945 struct A @{
1946   operator int ();
1947   A& operator = (int);
1950 main ()
1952   A a,b;
1953   a = b;
1955 @end smallexample
1957 In this example, G++ will synthesize a default @samp{A& operator =
1958 (const A&);}, while cfront will use the user-defined @samp{operator =}.
1959 @end table
1961 @node Objective-C and Objective-C++ Dialect Options
1962 @section Options Controlling Objective-C and Objective-C++ Dialects
1964 @cindex compiler options, Objective-C and Objective-C++
1965 @cindex Objective-C and Objective-C++ options, command line
1966 @cindex options, Objective-C and Objective-C++
1967 (NOTE: This manual does not describe the Objective-C and Objective-C++
1968 languages themselves.  See @xref{Standards,,Language Standards
1969 Supported by GCC}, for references.)
1971 This section describes the command-line options that are only meaningful
1972 for Objective-C and Objective-C++ programs, but you can also use most of
1973 the language-independent GNU compiler options.
1974 For example, you might compile a file @code{some_class.m} like this:
1976 @smallexample
1977 gcc -g -fgnu-runtime -O -c some_class.m
1978 @end smallexample
1980 @noindent
1981 In this example, @option{-fgnu-runtime} is an option meant only for
1982 Objective-C and Objective-C++ programs; you can use the other options with
1983 any language supported by GCC@.
1985 Note that since Objective-C is an extension of the C language, Objective-C
1986 compilations may also use options specific to the C front-end (e.g.,
1987 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
1988 C++-specific options (e.g., @option{-Wabi}).
1990 Here is a list of options that are @emph{only} for compiling Objective-C
1991 and Objective-C++ programs:
1993 @table @gcctabopt
1994 @item -fconstant-string-class=@var{class-name}
1995 @opindex fconstant-string-class
1996 Use @var{class-name} as the name of the class to instantiate for each
1997 literal string specified with the syntax @code{@@"@dots{}"}.  The default
1998 class name is @code{NXConstantString} if the GNU runtime is being used, and
1999 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2000 @option{-fconstant-cfstrings} option, if also present, will override the
2001 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2002 to be laid out as constant CoreFoundation strings.
2004 @item -fgnu-runtime
2005 @opindex fgnu-runtime
2006 Generate object code compatible with the standard GNU Objective-C
2007 runtime.  This is the default for most types of systems.
2009 @item -fnext-runtime
2010 @opindex fnext-runtime
2011 Generate output compatible with the NeXT runtime.  This is the default
2012 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2013 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2014 used.
2016 @item -fno-nil-receivers
2017 @opindex fno-nil-receivers
2018 Assume that all Objective-C message dispatches (e.g.,
2019 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2020 is not @code{nil}.  This allows for more efficient entry points in the runtime
2021 to be used.  Currently, this option is only available in conjunction with
2022 the NeXT runtime on Mac OS X 10.3 and later.
2024 @item -fobjc-call-cxx-cdtors
2025 @opindex fobjc-call-cxx-cdtors
2026 For each Objective-C class, check if any of its instance variables is a
2027 C++ object with a non-trivial default constructor.  If so, synthesize a
2028 special @code{- (id) .cxx_construct} instance method that will run
2029 non-trivial default constructors on any such instance variables, in order,
2030 and then return @code{self}.  Similarly, check if any instance variable
2031 is a C++ object with a non-trivial destructor, and if so, synthesize a
2032 special @code{- (void) .cxx_destruct} method that will run
2033 all such default destructors, in reverse order.
2035 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2036 thusly generated will only operate on instance variables declared in the
2037 current Objective-C class, and not those inherited from superclasses.  It
2038 is the responsibility of the Objective-C runtime to invoke all such methods
2039 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2040 will be invoked by the runtime immediately after a new object
2041 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2042 be invoked immediately before the runtime deallocates an object instance.
2044 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2045 support for invoking the @code{- (id) .cxx_construct} and
2046 @code{- (void) .cxx_destruct} methods.
2048 @item -fobjc-direct-dispatch
2049 @opindex fobjc-direct-dispatch
2050 Allow fast jumps to the message dispatcher.  On Darwin this is
2051 accomplished via the comm page.
2053 @item -fobjc-exceptions
2054 @opindex fobjc-exceptions
2055 Enable syntactic support for structured exception handling in Objective-C,
2056 similar to what is offered by C++ and Java.  This option is
2057 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2058 earlier.
2060 @smallexample
2061   @@try @{
2062     @dots{}
2063        @@throw expr;
2064     @dots{}
2065   @}
2066   @@catch (AnObjCClass *exc) @{
2067     @dots{}
2068       @@throw expr;
2069     @dots{}
2070       @@throw;
2071     @dots{}
2072   @}
2073   @@catch (AnotherClass *exc) @{
2074     @dots{}
2075   @}
2076   @@catch (id allOthers) @{
2077     @dots{}
2078   @}
2079   @@finally @{
2080     @dots{}
2081       @@throw expr;
2082     @dots{}
2083   @}
2084 @end smallexample
2086 The @code{@@throw} statement may appear anywhere in an Objective-C or
2087 Objective-C++ program; when used inside of a @code{@@catch} block, the
2088 @code{@@throw} may appear without an argument (as shown above), in which case
2089 the object caught by the @code{@@catch} will be rethrown.
2091 Note that only (pointers to) Objective-C objects may be thrown and
2092 caught using this scheme.  When an object is thrown, it will be caught
2093 by the nearest @code{@@catch} clause capable of handling objects of that type,
2094 analogously to how @code{catch} blocks work in C++ and Java.  A
2095 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2096 any and all Objective-C exceptions not caught by previous @code{@@catch}
2097 clauses (if any).
2099 The @code{@@finally} clause, if present, will be executed upon exit from the
2100 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2101 regardless of whether any exceptions are thrown, caught or rethrown
2102 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2103 of the @code{finally} clause in Java.
2105 There are several caveats to using the new exception mechanism:
2107 @itemize @bullet
2108 @item
2109 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2110 idioms provided by the @code{NSException} class, the new
2111 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2112 systems, due to additional functionality needed in the (NeXT) Objective-C
2113 runtime.
2115 @item
2116 As mentioned above, the new exceptions do not support handling
2117 types other than Objective-C objects.   Furthermore, when used from
2118 Objective-C++, the Objective-C exception model does not interoperate with C++
2119 exceptions at this time.  This means you cannot @code{@@throw} an exception
2120 from Objective-C and @code{catch} it in C++, or vice versa
2121 (i.e., @code{throw @dots{} @@catch}).
2122 @end itemize
2124 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2125 blocks for thread-safe execution:
2127 @smallexample
2128   @@synchronized (ObjCClass *guard) @{
2129     @dots{}
2130   @}
2131 @end smallexample
2133 Upon entering the @code{@@synchronized} block, a thread of execution shall
2134 first check whether a lock has been placed on the corresponding @code{guard}
2135 object by another thread.  If it has, the current thread shall wait until
2136 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2137 the current thread will place its own lock on it, execute the code contained in
2138 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2139 making @code{guard} available to other threads).
2141 Unlike Java, Objective-C does not allow for entire methods to be marked
2142 @code{@@synchronized}.  Note that throwing exceptions out of
2143 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2144 to be unlocked properly.
2146 @item -fobjc-gc
2147 @opindex fobjc-gc
2148 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2150 @item -freplace-objc-classes
2151 @opindex freplace-objc-classes
2152 Emit a special marker instructing @command{ld(1)} not to statically link in
2153 the resulting object file, and allow @command{dyld(1)} to load it in at
2154 run time instead.  This is used in conjunction with the Fix-and-Continue
2155 debugging mode, where the object file in question may be recompiled and
2156 dynamically reloaded in the course of program execution, without the need
2157 to restart the program itself.  Currently, Fix-and-Continue functionality
2158 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2159 and later.
2161 @item -fzero-link
2162 @opindex fzero-link
2163 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2164 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2165 compile time) with static class references that get initialized at load time,
2166 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2167 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2168 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2169 for individual class implementations to be modified during program execution.
2171 @item -gen-decls
2172 @opindex gen-decls
2173 Dump interface declarations for all classes seen in the source file to a
2174 file named @file{@var{sourcename}.decl}.
2176 @item -Wassign-intercept
2177 @opindex Wassign-intercept
2178 Warn whenever an Objective-C assignment is being intercepted by the
2179 garbage collector.
2181 @item -Wno-protocol
2182 @opindex Wno-protocol
2183 If a class is declared to implement a protocol, a warning is issued for
2184 every method in the protocol that is not implemented by the class.  The
2185 default behavior is to issue a warning for every method not explicitly
2186 implemented in the class, even if a method implementation is inherited
2187 from the superclass.  If you use the @option{-Wno-protocol} option, then
2188 methods inherited from the superclass are considered to be implemented,
2189 and no warning is issued for them.
2191 @item -Wselector
2192 @opindex Wselector
2193 Warn if multiple methods of different types for the same selector are
2194 found during compilation.  The check is performed on the list of methods
2195 in the final stage of compilation.  Additionally, a check is performed
2196 for each selector appearing in a @code{@@selector(@dots{})}
2197 expression, and a corresponding method for that selector has been found
2198 during compilation.  Because these checks scan the method table only at
2199 the end of compilation, these warnings are not produced if the final
2200 stage of compilation is not reached, for example because an error is
2201 found during compilation, or because the @option{-fsyntax-only} option is
2202 being used.
2204 @item -Wstrict-selector-match
2205 @opindex Wstrict-selector-match
2206 Warn if multiple methods with differing argument and/or return types are
2207 found for a given selector when attempting to send a message using this
2208 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2209 is off (which is the default behavior), the compiler will omit such warnings
2210 if any differences found are confined to types which share the same size
2211 and alignment.
2213 @item -Wundeclared-selector
2214 @opindex Wundeclared-selector
2215 Warn if a @code{@@selector(@dots{})} expression referring to an
2216 undeclared selector is found.  A selector is considered undeclared if no
2217 method with that name has been declared before the
2218 @code{@@selector(@dots{})} expression, either explicitly in an
2219 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2220 an @code{@@implementation} section.  This option always performs its
2221 checks as soon as a @code{@@selector(@dots{})} expression is found,
2222 while @option{-Wselector} only performs its checks in the final stage of
2223 compilation.  This also enforces the coding style convention
2224 that methods and selectors must be declared before being used.
2226 @item -print-objc-runtime-info
2227 @opindex print-objc-runtime-info
2228 Generate C header describing the largest structure that is passed by
2229 value, if any.
2231 @end table
2233 @node Language Independent Options
2234 @section Options to Control Diagnostic Messages Formatting
2235 @cindex options to control diagnostics formatting
2236 @cindex diagnostic messages
2237 @cindex message formatting
2239 Traditionally, diagnostic messages have been formatted irrespective of
2240 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2241 below can be used to control the diagnostic messages formatting
2242 algorithm, e.g.@: how many characters per line, how often source location
2243 information should be reported.  Right now, only the C++ front end can
2244 honor these options.  However it is expected, in the near future, that
2245 the remaining front ends would be able to digest them correctly.
2247 @table @gcctabopt
2248 @item -fmessage-length=@var{n}
2249 @opindex fmessage-length
2250 Try to format error messages so that they fit on lines of about @var{n}
2251 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2252 the front ends supported by GCC@.  If @var{n} is zero, then no
2253 line-wrapping will be done; each error message will appear on a single
2254 line.
2256 @opindex fdiagnostics-show-location
2257 @item -fdiagnostics-show-location=once
2258 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2259 reporter to emit @emph{once} source location information; that is, in
2260 case the message is too long to fit on a single physical line and has to
2261 be wrapped, the source location won't be emitted (as prefix) again,
2262 over and over, in subsequent continuation lines.  This is the default
2263 behavior.
2265 @item -fdiagnostics-show-location=every-line
2266 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2267 messages reporter to emit the same source location information (as
2268 prefix) for physical lines that result from the process of breaking
2269 a message which is too long to fit on a single line.
2271 @item -fdiagnostics-show-option
2272 @opindex fdiagnostics-show-option
2273 This option instructs the diagnostic machinery to add text to each
2274 diagnostic emitted, which indicates which command line option directly
2275 controls that diagnostic, when such an option is known to the
2276 diagnostic machinery.
2278 @end table
2280 @node Warning Options
2281 @section Options to Request or Suppress Warnings
2282 @cindex options to control warnings
2283 @cindex warning messages
2284 @cindex messages, warning
2285 @cindex suppressing warnings
2287 Warnings are diagnostic messages that report constructions which
2288 are not inherently erroneous but which are risky or suggest there
2289 may have been an error.
2291 You can request many specific warnings with options beginning @samp{-W},
2292 for example @option{-Wimplicit} to request warnings on implicit
2293 declarations.  Each of these specific warning options also has a
2294 negative form beginning @samp{-Wno-} to turn off warnings;
2295 for example, @option{-Wno-implicit}.  This manual lists only one of the
2296 two forms, whichever is not the default.
2298 The following options control the amount and kinds of warnings produced
2299 by GCC; for further, language-specific options also refer to
2300 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2301 Options}.
2303 @table @gcctabopt
2304 @cindex syntax checking
2305 @item -fsyntax-only
2306 @opindex fsyntax-only
2307 Check the code for syntax errors, but don't do anything beyond that.
2309 @item -pedantic
2310 @opindex pedantic
2311 Issue all the warnings demanded by strict ISO C and ISO C++;
2312 reject all programs that use forbidden extensions, and some other
2313 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2314 version of the ISO C standard specified by any @option{-std} option used.
2316 Valid ISO C and ISO C++ programs should compile properly with or without
2317 this option (though a rare few will require @option{-ansi} or a
2318 @option{-std} option specifying the required version of ISO C)@.  However,
2319 without this option, certain GNU extensions and traditional C and C++
2320 features are supported as well.  With this option, they are rejected.
2322 @option{-pedantic} does not cause warning messages for use of the
2323 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2324 warnings are also disabled in the expression that follows
2325 @code{__extension__}.  However, only system header files should use
2326 these escape routes; application programs should avoid them.
2327 @xref{Alternate Keywords}.
2329 Some users try to use @option{-pedantic} to check programs for strict ISO
2330 C conformance.  They soon find that it does not do quite what they want:
2331 it finds some non-ISO practices, but not all---only those for which
2332 ISO C @emph{requires} a diagnostic, and some others for which
2333 diagnostics have been added.
2335 A feature to report any failure to conform to ISO C might be useful in
2336 some instances, but would require considerable additional work and would
2337 be quite different from @option{-pedantic}.  We don't have plans to
2338 support such a feature in the near future.
2340 Where the standard specified with @option{-std} represents a GNU
2341 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2342 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2343 extended dialect is based.  Warnings from @option{-pedantic} are given
2344 where they are required by the base standard.  (It would not make sense
2345 for such warnings to be given only for features not in the specified GNU
2346 C dialect, since by definition the GNU dialects of C include all
2347 features the compiler supports with the given option, and there would be
2348 nothing to warn about.)
2350 @item -pedantic-errors
2351 @opindex pedantic-errors
2352 Like @option{-pedantic}, except that errors are produced rather than
2353 warnings.
2355 @item -w
2356 @opindex w
2357 Inhibit all warning messages.
2359 @item -Wno-import
2360 @opindex Wno-import
2361 Inhibit warning messages about the use of @samp{#import}.
2363 @item -Wchar-subscripts
2364 @opindex Wchar-subscripts
2365 Warn if an array subscript has type @code{char}.  This is a common cause
2366 of error, as programmers often forget that this type is signed on some
2367 machines.
2368 This warning is enabled by @option{-Wall}.
2370 @item -Wcomment
2371 @opindex Wcomment
2372 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2373 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2374 This warning is enabled by @option{-Wall}.
2376 @item -Wfatal-errors
2377 @opindex Wfatal-errors
2378 This option causes the compiler to abort compilation on the first error
2379 occurred rather than trying to keep going and printing further error
2380 messages.
2382 @item -Wformat
2383 @opindex Wformat
2384 @opindex ffreestanding
2385 @opindex fno-builtin
2386 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2387 the arguments supplied have types appropriate to the format string
2388 specified, and that the conversions specified in the format string make
2389 sense.  This includes standard functions, and others specified by format
2390 attributes (@pxref{Function Attributes}), in the @code{printf},
2391 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2392 not in the C standard) families (or other target-specific families).
2393 Which functions are checked without format attributes having been
2394 specified depends on the standard version selected, and such checks of
2395 functions without the attribute specified are disabled by
2396 @option{-ffreestanding} or @option{-fno-builtin}.
2398 The formats are checked against the format features supported by GNU
2399 libc version 2.2.  These include all ISO C90 and C99 features, as well
2400 as features from the Single Unix Specification and some BSD and GNU
2401 extensions.  Other library implementations may not support all these
2402 features; GCC does not support warning about features that go beyond a
2403 particular library's limitations.  However, if @option{-pedantic} is used
2404 with @option{-Wformat}, warnings will be given about format features not
2405 in the selected standard version (but not for @code{strfmon} formats,
2406 since those are not in any version of the C standard).  @xref{C Dialect
2407 Options,,Options Controlling C Dialect}.
2409 Since @option{-Wformat} also checks for null format arguments for
2410 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2412 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2413 aspects of format checking, the options @option{-Wformat-y2k},
2414 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2415 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2416 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2418 @item -Wformat-y2k
2419 @opindex Wformat-y2k
2420 If @option{-Wformat} is specified, also warn about @code{strftime}
2421 formats which may yield only a two-digit year.
2423 @item -Wno-format-extra-args
2424 @opindex Wno-format-extra-args
2425 If @option{-Wformat} is specified, do not warn about excess arguments to a
2426 @code{printf} or @code{scanf} format function.  The C standard specifies
2427 that such arguments are ignored.
2429 Where the unused arguments lie between used arguments that are
2430 specified with @samp{$} operand number specifications, normally
2431 warnings are still given, since the implementation could not know what
2432 type to pass to @code{va_arg} to skip the unused arguments.  However,
2433 in the case of @code{scanf} formats, this option will suppress the
2434 warning if the unused arguments are all pointers, since the Single
2435 Unix Specification says that such unused arguments are allowed.
2437 @item -Wno-format-zero-length
2438 @opindex Wno-format-zero-length
2439 If @option{-Wformat} is specified, do not warn about zero-length formats.
2440 The C standard specifies that zero-length formats are allowed.
2442 @item -Wformat-nonliteral
2443 @opindex Wformat-nonliteral
2444 If @option{-Wformat} is specified, also warn if the format string is not a
2445 string literal and so cannot be checked, unless the format function
2446 takes its format arguments as a @code{va_list}.
2448 @item -Wformat-security
2449 @opindex Wformat-security
2450 If @option{-Wformat} is specified, also warn about uses of format
2451 functions that represent possible security problems.  At present, this
2452 warns about calls to @code{printf} and @code{scanf} functions where the
2453 format string is not a string literal and there are no format arguments,
2454 as in @code{printf (foo);}.  This may be a security hole if the format
2455 string came from untrusted input and contains @samp{%n}.  (This is
2456 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2457 in future warnings may be added to @option{-Wformat-security} that are not
2458 included in @option{-Wformat-nonliteral}.)
2460 @item -Wformat=2
2461 @opindex Wformat=2
2462 Enable @option{-Wformat} plus format checks not included in
2463 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2464 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2466 @item -Wnonnull
2467 @opindex Wnonnull
2468 Warn about passing a null pointer for arguments marked as
2469 requiring a non-null value by the @code{nonnull} function attribute.
2471 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2472 can be disabled with the @option{-Wno-nonnull} option.
2474 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2475 @opindex Winit-self
2476 Warn about uninitialized variables which are initialized with themselves.
2477 Note this option can only be used with the @option{-Wuninitialized} option,
2478 which in turn only works with @option{-O1} and above.
2480 For example, GCC will warn about @code{i} being uninitialized in the
2481 following snippet only when @option{-Winit-self} has been specified:
2482 @smallexample
2483 @group
2484 int f()
2486   int i = i;
2487   return i;
2489 @end group
2490 @end smallexample
2492 @item -Wimplicit-int
2493 @opindex Wimplicit-int
2494 Warn when a declaration does not specify a type.
2495 This warning is enabled by @option{-Wall}.
2497 @item -Wimplicit-function-declaration
2498 @itemx -Werror-implicit-function-declaration
2499 @opindex Wimplicit-function-declaration
2500 @opindex Werror-implicit-function-declaration
2501 Give a warning (or error) whenever a function is used before being
2502 declared.  The form @option{-Wno-error-implicit-function-declaration}
2503 is not supported.
2504 This warning is enabled by @option{-Wall} (as a warning, not an error).
2506 @item -Wimplicit
2507 @opindex Wimplicit
2508 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2509 This warning is enabled by @option{-Wall}.
2511 @item -Wmain
2512 @opindex Wmain
2513 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2514 function with external linkage, returning int, taking either zero
2515 arguments, two, or three arguments of appropriate types.
2516 This warning is enabled by @option{-Wall}.
2518 @item -Wmissing-braces
2519 @opindex Wmissing-braces
2520 Warn if an aggregate or union initializer is not fully bracketed.  In
2521 the following example, the initializer for @samp{a} is not fully
2522 bracketed, but that for @samp{b} is fully bracketed.
2524 @smallexample
2525 int a[2][2] = @{ 0, 1, 2, 3 @};
2526 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2527 @end smallexample
2529 This warning is enabled by @option{-Wall}.
2531 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2532 @opindex Wmissing-include-dirs
2533 Warn if a user-supplied include directory does not exist.
2535 @item -Wparentheses
2536 @opindex Wparentheses
2537 Warn if parentheses are omitted in certain contexts, such
2538 as when there is an assignment in a context where a truth value
2539 is expected, or when operators are nested whose precedence people
2540 often get confused about.
2542 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2543 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2544 interpretation from that of ordinary mathematical notation.
2546 Also warn about constructions where there may be confusion to which
2547 @code{if} statement an @code{else} branch belongs.  Here is an example of
2548 such a case:
2550 @smallexample
2551 @group
2553   if (a)
2554     if (b)
2555       foo ();
2556   else
2557     bar ();
2559 @end group
2560 @end smallexample
2562 In C/C++, every @code{else} branch belongs to the innermost possible
2563 @code{if} statement, which in this example is @code{if (b)}.  This is
2564 often not what the programmer expected, as illustrated in the above
2565 example by indentation the programmer chose.  When there is the
2566 potential for this confusion, GCC will issue a warning when this flag
2567 is specified.  To eliminate the warning, add explicit braces around
2568 the innermost @code{if} statement so there is no way the @code{else}
2569 could belong to the enclosing @code{if}.  The resulting code would
2570 look like this:
2572 @smallexample
2573 @group
2575   if (a)
2576     @{
2577       if (b)
2578         foo ();
2579       else
2580         bar ();
2581     @}
2583 @end group
2584 @end smallexample
2586 This warning is enabled by @option{-Wall}.
2588 @item -Wsequence-point
2589 @opindex Wsequence-point
2590 Warn about code that may have undefined semantics because of violations
2591 of sequence point rules in the C and C++ standards.
2593 The C and C++ standards defines the order in which expressions in a C/C++
2594 program are evaluated in terms of @dfn{sequence points}, which represent
2595 a partial ordering between the execution of parts of the program: those
2596 executed before the sequence point, and those executed after it.  These
2597 occur after the evaluation of a full expression (one which is not part
2598 of a larger expression), after the evaluation of the first operand of a
2599 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2600 function is called (but after the evaluation of its arguments and the
2601 expression denoting the called function), and in certain other places.
2602 Other than as expressed by the sequence point rules, the order of
2603 evaluation of subexpressions of an expression is not specified.  All
2604 these rules describe only a partial order rather than a total order,
2605 since, for example, if two functions are called within one expression
2606 with no sequence point between them, the order in which the functions
2607 are called is not specified.  However, the standards committee have
2608 ruled that function calls do not overlap.
2610 It is not specified when between sequence points modifications to the
2611 values of objects take effect.  Programs whose behavior depends on this
2612 have undefined behavior; the C and C++ standards specify that ``Between
2613 the previous and next sequence point an object shall have its stored
2614 value modified at most once by the evaluation of an expression.  
2615 Furthermore, the prior value shall be read only to determine the value
2616 to be stored.''.  If a program breaks these rules, the results on any
2617 particular implementation are entirely unpredictable.
2619 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2620 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2621 diagnosed by this option, and it may give an occasional false positive
2622 result, but in general it has been found fairly effective at detecting
2623 this sort of problem in programs.
2625 The standard is worded confusingly, therefore there is some debate
2626 over the precise meaning of the sequence point rules in subtle cases.
2627 Links to discussions of the problem, including proposed formal
2628 definitions, may be found on the GCC readings page, at
2629 @w{@uref{http://gcc.gnu.org/readings.html}}.
2631 This warning is enabled by @option{-Wall} for C and C++.
2633 @item -Wreturn-type
2634 @opindex Wreturn-type
2635 Warn whenever a function is defined with a return-type that defaults to
2636 @code{int}.  Also warn about any @code{return} statement with no
2637 return-value in a function whose return-type is not @code{void}.
2639 For C, also warn if the return type of a function has a type qualifier
2640 such as @code{const}.  Such a type qualifier has no effect, since the
2641 value returned by a function is not an lvalue.  ISO C prohibits
2642 qualified @code{void} return types on function definitions, so such
2643 return types always receive a warning even without this option.
2645 For C++, a function without return type always produces a diagnostic
2646 message, even when @option{-Wno-return-type} is specified.  The only
2647 exceptions are @samp{main} and functions defined in system headers.
2649 This warning is enabled by @option{-Wall}.
2651 @item -Wswitch
2652 @opindex Wswitch
2653 Warn whenever a @code{switch} statement has an index of enumerated type
2654 and lacks a @code{case} for one or more of the named codes of that
2655 enumeration.  (The presence of a @code{default} label prevents this
2656 warning.)  @code{case} labels outside the enumeration range also
2657 provoke warnings when this option is used.
2658 This warning is enabled by @option{-Wall}.
2660 @item -Wswitch-default
2661 @opindex Wswitch-switch
2662 Warn whenever a @code{switch} statement does not have a @code{default}
2663 case.
2665 @item -Wswitch-enum
2666 @opindex Wswitch-enum
2667 Warn whenever a @code{switch} statement has an index of enumerated type
2668 and lacks a @code{case} for one or more of the named codes of that
2669 enumeration.  @code{case} labels outside the enumeration range also
2670 provoke warnings when this option is used.
2672 @item -Wtrigraphs
2673 @opindex Wtrigraphs
2674 Warn if any trigraphs are encountered that might change the meaning of
2675 the program (trigraphs within comments are not warned about).
2676 This warning is enabled by @option{-Wall}.
2678 @item -Wunused-function
2679 @opindex Wunused-function
2680 Warn whenever a static function is declared but not defined or a
2681 non-inline static function is unused.
2682 This warning is enabled by @option{-Wall}.
2684 @item -Wunused-label
2685 @opindex Wunused-label
2686 Warn whenever a label is declared but not used.
2687 This warning is enabled by @option{-Wall}.
2689 To suppress this warning use the @samp{unused} attribute
2690 (@pxref{Variable Attributes}).
2692 @item -Wunused-parameter
2693 @opindex Wunused-parameter
2694 Warn whenever a function parameter is unused aside from its declaration.
2696 To suppress this warning use the @samp{unused} attribute
2697 (@pxref{Variable Attributes}).
2699 @item -Wunused-variable
2700 @opindex Wunused-variable
2701 Warn whenever a local variable or non-constant static variable is unused
2702 aside from its declaration.
2703 This warning is enabled by @option{-Wall}.
2705 To suppress this warning use the @samp{unused} attribute
2706 (@pxref{Variable Attributes}).
2708 @item -Wunused-value
2709 @opindex Wunused-value
2710 Warn whenever a statement computes a result that is explicitly not used.
2711 This warning is enabled by @option{-Wall}.
2713 To suppress this warning cast the expression to @samp{void}.
2715 @item -Wunused
2716 @opindex Wunused
2717 All the above @option{-Wunused} options combined.
2719 In order to get a warning about an unused function parameter, you must
2720 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2721 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2723 @item -Wuninitialized
2724 @opindex Wuninitialized
2725 Warn if an automatic variable is used without first being initialized or
2726 if a variable may be clobbered by a @code{setjmp} call.
2728 These warnings are possible only in optimizing compilation,
2729 because they require data flow information that is computed only
2730 when optimizing.  If you do not specify @option{-O}, you will not get 
2731 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2732 requiring @option{-O}.
2734 If you want to warn about code which uses the uninitialized value of the
2735 variable in its own initializer, use the @option{-Winit-self} option.
2737 These warnings occur for individual uninitialized or clobbered
2738 elements of structure, union or array variables as well as for
2739 variables which are uninitialized or clobbered as a whole.  They do
2740 not occur for variables or elements declared @code{volatile}.  Because
2741 these warnings depend on optimization, the exact variables or elements
2742 for which there are warnings will depend on the precise optimization
2743 options and version of GCC used.
2745 Note that there may be no warning about a variable that is used only
2746 to compute a value that itself is never used, because such
2747 computations may be deleted by data flow analysis before the warnings
2748 are printed.
2750 These warnings are made optional because GCC is not smart
2751 enough to see all the reasons why the code might be correct
2752 despite appearing to have an error.  Here is one example of how
2753 this can happen:
2755 @smallexample
2756 @group
2758   int x;
2759   switch (y)
2760     @{
2761     case 1: x = 1;
2762       break;
2763     case 2: x = 4;
2764       break;
2765     case 3: x = 5;
2766     @}
2767   foo (x);
2769 @end group
2770 @end smallexample
2772 @noindent
2773 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2774 always initialized, but GCC doesn't know this.  Here is
2775 another common case:
2777 @smallexample
2779   int save_y;
2780   if (change_y) save_y = y, y = new_y;
2781   @dots{}
2782   if (change_y) y = save_y;
2784 @end smallexample
2786 @noindent
2787 This has no bug because @code{save_y} is used only if it is set.
2789 @cindex @code{longjmp} warnings
2790 This option also warns when a non-volatile automatic variable might be
2791 changed by a call to @code{longjmp}.  These warnings as well are possible
2792 only in optimizing compilation.
2794 The compiler sees only the calls to @code{setjmp}.  It cannot know
2795 where @code{longjmp} will be called; in fact, a signal handler could
2796 call it at any point in the code.  As a result, you may get a warning
2797 even when there is in fact no problem because @code{longjmp} cannot
2798 in fact be called at the place which would cause a problem.
2800 Some spurious warnings can be avoided if you declare all the functions
2801 you use that never return as @code{noreturn}.  @xref{Function
2802 Attributes}.
2804 This warning is enabled by @option{-Wall}.
2806 @item -Wunknown-pragmas
2807 @opindex Wunknown-pragmas
2808 @cindex warning for unknown pragmas
2809 @cindex unknown pragmas, warning
2810 @cindex pragmas, warning of unknown
2811 Warn when a #pragma directive is encountered which is not understood by
2812 GCC@.  If this command line option is used, warnings will even be issued
2813 for unknown pragmas in system header files.  This is not the case if
2814 the warnings were only enabled by the @option{-Wall} command line option.
2816 @item -Wno-pragmas
2817 @opindex Wno-pragmas
2818 @opindex Wpragmas
2819 Do not warn about misuses of pragmas, such as incorrect parameters,
2820 invalid syntax, or conflicts between pragmas.  See also
2821 @samp{-Wunknown-pragmas}.
2823 @item -Wstrict-aliasing
2824 @opindex Wstrict-aliasing
2825 This option is only active when @option{-fstrict-aliasing} is active.
2826 It warns about code which might break the strict aliasing rules that the
2827 compiler is using for optimization.  The warning does not catch all
2828 cases, but does attempt to catch the more common pitfalls.  It is
2829 included in @option{-Wall}.
2831 @item -Wstrict-aliasing=2
2832 @opindex Wstrict-aliasing=2
2833 This option is only active when @option{-fstrict-aliasing} is active.
2834 It warns about code which might break the strict aliasing rules that the
2835 compiler is using for optimization.  This warning catches more cases than
2836 @option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
2837 cases that are safe.
2839 @item -Wall
2840 @opindex Wall
2841 All of the above @samp{-W} options combined.  This enables all the
2842 warnings about constructions that some users consider questionable, and
2843 that are easy to avoid (or modify to prevent the warning), even in
2844 conjunction with macros.  This also enables some language-specific
2845 warnings described in @ref{C++ Dialect Options} and
2846 @ref{Objective-C and Objective-C++ Dialect Options}.
2847 @end table
2849 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
2850 Some of them warn about constructions that users generally do not
2851 consider questionable, but which occasionally you might wish to check
2852 for; others warn about constructions that are necessary or hard to avoid
2853 in some cases, and there is no simple way to modify the code to suppress
2854 the warning.
2856 @table @gcctabopt
2857 @item -Wextra
2858 @opindex W
2859 @opindex Wextra
2860 (This option used to be called @option{-W}.  The older name is still
2861 supported, but the newer name is more descriptive.)  Print extra warning
2862 messages for these events:
2864 @itemize @bullet
2865 @item
2866 A function can return either with or without a value.  (Falling
2867 off the end of the function body is considered returning without
2868 a value.)  For example, this function would evoke such a
2869 warning:
2871 @smallexample
2872 @group
2873 foo (a)
2875   if (a > 0)
2876     return a;
2878 @end group
2879 @end smallexample
2881 @item
2882 An expression-statement or the left-hand side of a comma expression
2883 contains no side effects.
2884 To suppress the warning, cast the unused expression to void.
2885 For example, an expression such as @samp{x[i,j]} will cause a warning,
2886 but @samp{x[(void)i,j]} will not.
2888 @item
2889 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
2891 @item
2892 Storage-class specifiers like @code{static} are not the first things in
2893 a declaration.  According to the C Standard, this usage is obsolescent.
2895 @item
2896 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
2897 arguments.
2899 @item
2900 A comparison between signed and unsigned values could produce an
2901 incorrect result when the signed value is converted to unsigned.
2902 (But don't warn if @option{-Wno-sign-compare} is also specified.)
2904 @item
2905 An aggregate has an initializer which does not initialize all members.
2906 This warning can be independently controlled by
2907 @option{-Wmissing-field-initializers}.
2909 @item
2910 An initialized field without side effects is overridden when using
2911 designated initializers (@pxref{Designated Inits, , Designated
2912 Initializers}).  This warning can be independently controlled by
2913 @option{-Woverride-init}.
2915 @item
2916 A function parameter is declared without a type specifier in K&R-style
2917 functions:
2919 @smallexample
2920 void foo(bar) @{ @}
2921 @end smallexample
2923 @item
2924 An empty body occurs in an @samp{if} or @samp{else} statement.
2926 @item
2927 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2928 @samp{>}, or @samp{>=}.
2930 @item
2931 A variable might be changed by @samp{longjmp} or @samp{vfork}.
2933 @item
2934 Any of several floating-point events that often indicate errors, such as
2935 overflow, underflow, loss of precision, etc.
2937 @item @r{(C++ only)}
2938 An enumerator and a non-enumerator both appear in a conditional expression.
2940 @item @r{(C++ only)}
2941 A non-static reference or non-static @samp{const} member appears in a
2942 class without constructors.
2944 @item @r{(C++ only)}
2945 Ambiguous virtual bases.
2947 @item @r{(C++ only)}
2948 Subscripting an array which has been declared @samp{register}.
2950 @item @r{(C++ only)}
2951 Taking the address of a variable which has been declared @samp{register}.
2953 @item @r{(C++ only)}
2954 A base class is not initialized in a derived class' copy constructor.
2955 @end itemize
2957 @item -Wno-div-by-zero
2958 @opindex Wno-div-by-zero
2959 @opindex Wdiv-by-zero
2960 Do not warn about compile-time integer division by zero.  Floating point
2961 division by zero is not warned about, as it can be a legitimate way of
2962 obtaining infinities and NaNs.
2964 @item -Wsystem-headers
2965 @opindex Wsystem-headers
2966 @cindex warnings from system headers
2967 @cindex system headers, warnings from
2968 Print warning messages for constructs found in system header files.
2969 Warnings from system headers are normally suppressed, on the assumption
2970 that they usually do not indicate real problems and would only make the
2971 compiler output harder to read.  Using this command line option tells
2972 GCC to emit warnings from system headers as if they occurred in user
2973 code.  However, note that using @option{-Wall} in conjunction with this
2974 option will @emph{not} warn about unknown pragmas in system
2975 headers---for that, @option{-Wunknown-pragmas} must also be used.
2977 @item -Wfloat-equal
2978 @opindex Wfloat-equal
2979 Warn if floating point values are used in equality comparisons.
2981 The idea behind this is that sometimes it is convenient (for the
2982 programmer) to consider floating-point values as approximations to
2983 infinitely precise real numbers.  If you are doing this, then you need
2984 to compute (by analyzing the code, or in some other way) the maximum or
2985 likely maximum error that the computation introduces, and allow for it
2986 when performing comparisons (and when producing output, but that's a
2987 different problem).  In particular, instead of testing for equality, you
2988 would check to see whether the two values have ranges that overlap; and
2989 this is done with the relational operators, so equality comparisons are
2990 probably mistaken.
2992 @item -Wtraditional @r{(C only)}
2993 @opindex Wtraditional
2994 Warn about certain constructs that behave differently in traditional and
2995 ISO C@.  Also warn about ISO C constructs that have no traditional C
2996 equivalent, and/or problematic constructs which should be avoided.
2998 @itemize @bullet
2999 @item
3000 Macro parameters that appear within string literals in the macro body.
3001 In traditional C macro replacement takes place within string literals,
3002 but does not in ISO C@.
3004 @item
3005 In traditional C, some preprocessor directives did not exist.
3006 Traditional preprocessors would only consider a line to be a directive
3007 if the @samp{#} appeared in column 1 on the line.  Therefore
3008 @option{-Wtraditional} warns about directives that traditional C
3009 understands but would ignore because the @samp{#} does not appear as the
3010 first character on the line.  It also suggests you hide directives like
3011 @samp{#pragma} not understood by traditional C by indenting them.  Some
3012 traditional implementations would not recognize @samp{#elif}, so it
3013 suggests avoiding it altogether.
3015 @item
3016 A function-like macro that appears without arguments.
3018 @item
3019 The unary plus operator.
3021 @item
3022 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3023 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3024 constants.)  Note, these suffixes appear in macros defined in the system
3025 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3026 Use of these macros in user code might normally lead to spurious
3027 warnings, however GCC's integrated preprocessor has enough context to
3028 avoid warning in these cases.
3030 @item
3031 A function declared external in one block and then used after the end of
3032 the block.
3034 @item
3035 A @code{switch} statement has an operand of type @code{long}.
3037 @item
3038 A non-@code{static} function declaration follows a @code{static} one.
3039 This construct is not accepted by some traditional C compilers.
3041 @item
3042 The ISO type of an integer constant has a different width or
3043 signedness from its traditional type.  This warning is only issued if
3044 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3045 typically represent bit patterns, are not warned about.
3047 @item
3048 Usage of ISO string concatenation is detected.
3050 @item
3051 Initialization of automatic aggregates.
3053 @item
3054 Identifier conflicts with labels.  Traditional C lacks a separate
3055 namespace for labels.
3057 @item
3058 Initialization of unions.  If the initializer is zero, the warning is
3059 omitted.  This is done under the assumption that the zero initializer in
3060 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3061 initializer warnings and relies on default initialization to zero in the
3062 traditional C case.
3064 @item
3065 Conversions by prototypes between fixed/floating point values and vice
3066 versa.  The absence of these prototypes when compiling with traditional
3067 C would cause serious problems.  This is a subset of the possible
3068 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3070 @item
3071 Use of ISO C style function definitions.  This warning intentionally is
3072 @emph{not} issued for prototype declarations or variadic functions
3073 because these ISO C features will appear in your code when using
3074 libiberty's traditional C compatibility macros, @code{PARAMS} and
3075 @code{VPARAMS}.  This warning is also bypassed for nested functions
3076 because that feature is already a GCC extension and thus not relevant to
3077 traditional C compatibility.
3078 @end itemize
3080 @item -Wtraditional-conversion @r{(C only)}
3081 @opindex Wtraditional-conversion
3082 Warn if a prototype causes a type conversion that is different from what
3083 would happen to the same argument in the absence of a prototype.  This
3084 includes conversions of fixed point to floating and vice versa, and
3085 conversions changing the width or signedness of a fixed point argument
3086 except when the same as the default promotion.
3088 @item -Wdeclaration-after-statement @r{(C only)}
3089 @opindex Wdeclaration-after-statement
3090 Warn when a declaration is found after a statement in a block.  This
3091 construct, known from C++, was introduced with ISO C99 and is by default
3092 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3093 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3095 @item -Wundef
3096 @opindex Wundef
3097 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3099 @item -Wno-endif-labels
3100 @opindex Wno-endif-labels
3101 @opindex Wendif-labels
3102 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3104 @item -Wshadow
3105 @opindex Wshadow
3106 Warn whenever a local variable shadows another local variable, parameter or
3107 global variable or whenever a built-in function is shadowed.
3109 @item -Wlarger-than-@var{len}
3110 @opindex Wlarger-than
3111 Warn whenever an object of larger than @var{len} bytes is defined.
3113 @item -Wunsafe-loop-optimizations
3114 @opindex Wunsafe-loop-optimizations
3115 Warn if the loop cannot be optimized because the compiler could not
3116 assume anything on the bounds of the loop indices.  With
3117 @option{-funsafe-loop-optimizations} warn if the compiler made
3118 such assumptions.
3120 @item -Wpointer-arith
3121 @opindex Wpointer-arith
3122 Warn about anything that depends on the ``size of'' a function type or
3123 of @code{void}.  GNU C assigns these types a size of 1, for
3124 convenience in calculations with @code{void *} pointers and pointers
3125 to functions.
3127 @item -Wbad-function-cast @r{(C only)}
3128 @opindex Wbad-function-cast
3129 Warn whenever a function call is cast to a non-matching type.
3130 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3132 @item -Wc++-compat
3133 Warn about ISO C constructs that are outside of the common subset of
3134 ISO C and ISO C++, e.g.@: request for implicit conversion from
3135 @code{void *} to a pointer to non-@code{void} type.
3137 @item -Wcast-qual
3138 @opindex Wcast-qual
3139 Warn whenever a pointer is cast so as to remove a type qualifier from
3140 the target type.  For example, warn if a @code{const char *} is cast
3141 to an ordinary @code{char *}.
3143 @item -Wcast-align
3144 @opindex Wcast-align
3145 Warn whenever a pointer is cast such that the required alignment of the
3146 target is increased.  For example, warn if a @code{char *} is cast to
3147 an @code{int *} on machines where integers can only be accessed at
3148 two- or four-byte boundaries.
3150 @item -Wwrite-strings
3151 @opindex Wwrite-strings
3152 When compiling C, give string constants the type @code{const
3153 char[@var{length}]} so that
3154 copying the address of one into a non-@code{const} @code{char *}
3155 pointer will get a warning; when compiling C++, warn about the
3156 deprecated conversion from string literals to @code{char *}.  This
3157 warning, by default, is enabled for C++ programs.
3158 These warnings will help you find at
3159 compile time code that can try to write into a string constant, but
3160 only if you have been very careful about using @code{const} in
3161 declarations and prototypes.  Otherwise, it will just be a nuisance;
3162 this is why we did not make @option{-Wall} request these warnings.
3164 @item -Wconversion
3165 @opindex Wconversion
3166 Warn for implicit conversions that may alter a value. This includes
3167 conversions between real and integer, like @code{abs (x)} when
3168 @code{x} is @code{double}; conversions between signed and unsigned,
3169 like @code{unsigned ui = -1}; and conversions to smaller types, like
3170 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3171 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3172 changed by the conversion like in @code{abs (2.0)}.
3174 @item -Wsign-compare
3175 @opindex Wsign-compare
3176 @cindex warning for comparison of signed and unsigned values
3177 @cindex comparison of signed and unsigned values, warning
3178 @cindex signed and unsigned values, comparison warning
3179 Warn when a comparison between signed and unsigned values could produce
3180 an incorrect result when the signed value is converted to unsigned.
3181 This warning is also enabled by @option{-Wextra}; to get the other warnings
3182 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3184 @item -Waggregate-return
3185 @opindex Waggregate-return
3186 Warn if any functions that return structures or unions are defined or
3187 called.  (In languages where you can return an array, this also elicits
3188 a warning.)
3190 @item -Walways-true
3191 @opindex Walways-true
3192 Warn about comparisons which are always true such as testing if
3193 unsigned values are greater than or equal to zero.  This warning is
3194 enabled by @option{-Wall}.
3196 @item -Wno-attributes
3197 @opindex Wno-attributes
3198 @opindex Wattributes
3199 Do not warn if an unexpected @code{__attribute__} is used, such as
3200 unrecognized attributes, function attributes applied to variables,
3201 etc.  This will not stop errors for incorrect use of supported
3202 attributes.
3204 @item -Wstrict-prototypes @r{(C only)}
3205 @opindex Wstrict-prototypes
3206 Warn if a function is declared or defined without specifying the
3207 argument types.  (An old-style function definition is permitted without
3208 a warning if preceded by a declaration which specifies the argument
3209 types.)
3211 @item -Wold-style-definition @r{(C only)}
3212 @opindex Wold-style-definition
3213 Warn if an old-style function definition is used.  A warning is given
3214 even if there is a previous prototype.
3216 @item -Wmissing-prototypes @r{(C only)}
3217 @opindex Wmissing-prototypes
3218 Warn if a global function is defined without a previous prototype
3219 declaration.  This warning is issued even if the definition itself
3220 provides a prototype.  The aim is to detect global functions that fail
3221 to be declared in header files.
3223 @item -Wmissing-declarations @r{(C only)}
3224 @opindex Wmissing-declarations
3225 Warn if a global function is defined without a previous declaration.
3226 Do so even if the definition itself provides a prototype.
3227 Use this option to detect global functions that are not declared in
3228 header files.
3230 @item -Wmissing-field-initializers
3231 @opindex Wmissing-field-initializers
3232 @opindex W
3233 @opindex Wextra
3234 Warn if a structure's initializer has some fields missing.  For
3235 example, the following code would cause such a warning, because
3236 @code{x.h} is implicitly zero:
3238 @smallexample
3239 struct s @{ int f, g, h; @};
3240 struct s x = @{ 3, 4 @};
3241 @end smallexample
3243 This option does not warn about designated initializers, so the following
3244 modification would not trigger a warning:
3246 @smallexample
3247 struct s @{ int f, g, h; @};
3248 struct s x = @{ .f = 3, .g = 4 @};
3249 @end smallexample
3251 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3252 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3254 @item -Wmissing-noreturn
3255 @opindex Wmissing-noreturn
3256 Warn about functions which might be candidates for attribute @code{noreturn}.
3257 Note these are only possible candidates, not absolute ones.  Care should
3258 be taken to manually verify functions actually do not ever return before
3259 adding the @code{noreturn} attribute, otherwise subtle code generation
3260 bugs could be introduced.  You will not get a warning for @code{main} in
3261 hosted C environments.
3263 @item -Wmissing-format-attribute
3264 @opindex Wmissing-format-attribute
3265 @opindex Wformat
3266 Warn about function pointers which might be candidates for @code{format}
3267 attributes.  Note these are only possible candidates, not absolute ones.
3268 GCC will guess that function pointers with @code{format} attributes that
3269 are used in assignment, initialization, parameter passing or return
3270 statements should have a corresponding @code{format} attribute in the
3271 resulting type.  I.e.@: the left-hand side of the assignment or
3272 initialization, the type of the parameter variable, or the return type
3273 of the containing function respectively should also have a @code{format}
3274 attribute to avoid the warning.
3276 GCC will also warn about function definitions which might be
3277 candidates for @code{format} attributes.  Again, these are only
3278 possible candidates.  GCC will guess that @code{format} attributes
3279 might be appropriate for any function that calls a function like
3280 @code{vprintf} or @code{vscanf}, but this might not always be the
3281 case, and some functions for which @code{format} attributes are
3282 appropriate may not be detected.
3284 @item -Wno-multichar
3285 @opindex Wno-multichar
3286 @opindex Wmultichar
3287 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3288 Usually they indicate a typo in the user's code, as they have
3289 implementation-defined values, and should not be used in portable code.
3291 @item -Wnormalized=<none|id|nfc|nfkc>
3292 @opindex Wnormalized
3293 @cindex NFC
3294 @cindex NFKC
3295 @cindex character set, input normalization
3296 In ISO C and ISO C++, two identifiers are different if they are
3297 different sequences of characters.  However, sometimes when characters
3298 outside the basic ASCII character set are used, you can have two
3299 different character sequences that look the same.  To avoid confusion,
3300 the ISO 10646 standard sets out some @dfn{normalization rules} which
3301 when applied ensure that two sequences that look the same are turned into
3302 the same sequence.  GCC can warn you if you are using identifiers which
3303 have not been normalized; this option controls that warning.
3305 There are four levels of warning that GCC supports.  The default is
3306 @option{-Wnormalized=nfc}, which warns about any identifier which is
3307 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3308 recommended form for most uses.
3310 Unfortunately, there are some characters which ISO C and ISO C++ allow
3311 in identifiers that when turned into NFC aren't allowable as
3312 identifiers.  That is, there's no way to use these symbols in portable
3313 ISO C or C++ and have all your identifiers in NFC.
3314 @option{-Wnormalized=id} suppresses the warning for these characters.
3315 It is hoped that future versions of the standards involved will correct
3316 this, which is why this option is not the default.
3318 You can switch the warning off for all characters by writing
3319 @option{-Wnormalized=none}.  You would only want to do this if you
3320 were using some other normalization scheme (like ``D''), because
3321 otherwise you can easily create bugs that are literally impossible to see.
3323 Some characters in ISO 10646 have distinct meanings but look identical
3324 in some fonts or display methodologies, especially once formatting has
3325 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3326 LETTER N'', will display just like a regular @code{n} which has been
3327 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3328 normalization scheme to convert all these into a standard form as
3329 well, and GCC will warn if your code is not in NFKC if you use
3330 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3331 about every identifier that contains the letter O because it might be
3332 confused with the digit 0, and so is not the default, but may be
3333 useful as a local coding convention if the programming environment is
3334 unable to be fixed to display these characters distinctly.
3336 @item -Wno-deprecated-declarations
3337 @opindex Wno-deprecated-declarations
3338 Do not warn about uses of functions (@pxref{Function Attributes}),
3339 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3340 Attributes}) marked as deprecated by using the @code{deprecated}
3341 attribute.
3343 @item -Wno-overflow
3344 @opindex Wno-overflow
3345 Do not warn about compile-time overflow in constant expressions.
3347 @item -Woverride-init
3348 @opindex Woverride-init
3349 @opindex W
3350 @opindex Wextra
3351 Warn if an initialized field without side effects is overridden when
3352 using designated initializers (@pxref{Designated Inits, , Designated
3353 Initializers}).
3355 This warning is included in @option{-Wextra}.  To get other
3356 @option{-Wextra} warnings without this one, use @samp{-Wextra
3357 -Wno-override-init}.
3359 @item -Wpacked
3360 @opindex Wpacked
3361 Warn if a structure is given the packed attribute, but the packed
3362 attribute has no effect on the layout or size of the structure.
3363 Such structures may be mis-aligned for little benefit.  For
3364 instance, in this code, the variable @code{f.x} in @code{struct bar}
3365 will be misaligned even though @code{struct bar} does not itself
3366 have the packed attribute:
3368 @smallexample
3369 @group
3370 struct foo @{
3371   int x;
3372   char a, b, c, d;
3373 @} __attribute__((packed));
3374 struct bar @{
3375   char z;
3376   struct foo f;
3378 @end group
3379 @end smallexample
3381 @item -Wpadded
3382 @opindex Wpadded
3383 Warn if padding is included in a structure, either to align an element
3384 of the structure or to align the whole structure.  Sometimes when this
3385 happens it is possible to rearrange the fields of the structure to
3386 reduce the padding and so make the structure smaller.
3388 @item -Wredundant-decls
3389 @opindex Wredundant-decls
3390 Warn if anything is declared more than once in the same scope, even in
3391 cases where multiple declaration is valid and changes nothing.
3393 @item -Wnested-externs @r{(C only)}
3394 @opindex Wnested-externs
3395 Warn if an @code{extern} declaration is encountered within a function.
3397 @item -Wunreachable-code
3398 @opindex Wunreachable-code
3399 Warn if the compiler detects that code will never be executed.
3401 This option is intended to warn when the compiler detects that at
3402 least a whole line of source code will never be executed, because
3403 some condition is never satisfied or because it is after a
3404 procedure that never returns.
3406 It is possible for this option to produce a warning even though there
3407 are circumstances under which part of the affected line can be executed,
3408 so care should be taken when removing apparently-unreachable code.
3410 For instance, when a function is inlined, a warning may mean that the
3411 line is unreachable in only one inlined copy of the function.
3413 This option is not made part of @option{-Wall} because in a debugging
3414 version of a program there is often substantial code which checks
3415 correct functioning of the program and is, hopefully, unreachable
3416 because the program does work.  Another common use of unreachable
3417 code is to provide behavior which is selectable at compile-time.
3419 @item -Winline
3420 @opindex Winline
3421 Warn if a function can not be inlined and it was declared as inline.
3422 Even with this option, the compiler will not warn about failures to
3423 inline functions declared in system headers.
3425 The compiler uses a variety of heuristics to determine whether or not
3426 to inline a function.  For example, the compiler takes into account
3427 the size of the function being inlined and the amount of inlining
3428 that has already been done in the current function.  Therefore,
3429 seemingly insignificant changes in the source program can cause the
3430 warnings produced by @option{-Winline} to appear or disappear.
3432 @item -Wno-invalid-offsetof @r{(C++ only)}
3433 @opindex Wno-invalid-offsetof
3434 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3435 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3436 to a non-POD type is undefined.  In existing C++ implementations,
3437 however, @samp{offsetof} typically gives meaningful results even when
3438 applied to certain kinds of non-POD types. (Such as a simple
3439 @samp{struct} that fails to be a POD type only by virtue of having a
3440 constructor.)  This flag is for users who are aware that they are
3441 writing nonportable code and who have deliberately chosen to ignore the
3442 warning about it.
3444 The restrictions on @samp{offsetof} may be relaxed in a future version
3445 of the C++ standard.
3447 @item -Wno-int-to-pointer-cast @r{(C only)}
3448 @opindex Wno-int-to-pointer-cast
3449 Suppress warnings from casts to pointer type of an integer of a
3450 different size.
3452 @item -Wno-pointer-to-int-cast @r{(C only)}
3453 @opindex Wno-pointer-to-int-cast
3454 Suppress warnings from casts from a pointer to an integer type of a
3455 different size.
3457 @item -Winvalid-pch
3458 @opindex Winvalid-pch
3459 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3460 the search path but can't be used.
3462 @item -Wlong-long
3463 @opindex Wlong-long
3464 @opindex Wno-long-long
3465 Warn if @samp{long long} type is used.  This is default.  To inhibit
3466 the warning messages, use @option{-Wno-long-long}.  Flags
3467 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3468 only when @option{-pedantic} flag is used.
3470 @item -Wvariadic-macros
3471 @opindex Wvariadic-macros
3472 @opindex Wno-variadic-macros
3473 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3474 alternate syntax when in pedantic ISO C99 mode.  This is default.
3475 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3477 @item -Wvolatile-register-var
3478 @opindex Wvolatile-register-var
3479 @opindex Wno-volatile-register-var
3480 Warn if a register variable is declared volatile.  The volatile
3481 modifier does not inhibit all optimizations that may eliminate reads
3482 and/or writes to register variables.
3484 @item -Wdisabled-optimization
3485 @opindex Wdisabled-optimization
3486 Warn if a requested optimization pass is disabled.  This warning does
3487 not generally indicate that there is anything wrong with your code; it
3488 merely indicates that GCC's optimizers were unable to handle the code
3489 effectively.  Often, the problem is that your code is too big or too
3490 complex; GCC will refuse to optimize programs when the optimization
3491 itself is likely to take inordinate amounts of time.
3493 @item -Wpointer-sign
3494 @opindex Wpointer-sign
3495 @opindex Wno-pointer-sign
3496 Warn for pointer argument passing or assignment with different signedness.
3497 This option is only supported for C and Objective-C@.  It is implied by
3498 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3499 @option{-Wno-pointer-sign}.
3501 @item -Werror
3502 @opindex Werror
3503 Make all warnings into errors.
3505 @item -Werror=
3506 @opindex Werror=
3507 Make the specified warning into an errors.  The specifier for a
3508 warning is appended, for example @option{-Werror=switch} turns the
3509 warnings controlled by @option{-Wswitch} into errors.  This switch
3510 takes a negative form, to be used to negate @option{-Werror} for
3511 specific warnings, for example @option{-Wno-error=switch} makes
3512 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3513 is in effect.  You can use the @option{-fdiagnostics-show-option}
3514 option to have each controllable warning amended with the option which
3515 controls it, to determine what to use with this option.
3517 Note that specifying @option{-Werror=}@var{foo} automatically implies
3518 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3519 imply anything.
3521 @item -Wstack-protector
3522 @opindex Wstack-protector
3523 This option is only active when @option{-fstack-protector} is active.  It
3524 warns about functions that will not be protected against stack smashing.
3526 @item -Wstring-literal-comparison
3527 @opindex Wstring-literal-comparison
3528 Warn about suspicious comparisons to string literal constants.  In C,
3529 direct comparisons against the memory address of a string literal, such
3530 as @code{if (x == "abc")}, typically indicate a programmer error, and
3531 even when intentional, result in unspecified behavior and are not portable.
3532 Usually these warnings alert that the programmer intended to use
3533 @code{strcmp}.  This warning is enabled by @option{-Wall}.
3535 @item -Woverlength-strings
3536 @opindex Woverlength-strings
3537 Warn about string constants which are longer than the ``minimum
3538 maximum'' length specified in the C standard.  Modern compilers
3539 generally allow string constants which are much longer than the
3540 standard's minimum limit, but very portable programs should avoid
3541 using longer strings.
3543 The limit applies @emph{after} string constant concatenation, and does
3544 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3545 C99, it was raised to 4095.  C++98 does not specify a normative
3546 minimum maximum, so we do not diagnose overlength strings in C++@.
3548 This option is implied by @option{-pedantic}, and can be disabled with
3549 @option{-Wno-overlength-strings}.
3550 @end table
3552 @node Debugging Options
3553 @section Options for Debugging Your Program or GCC
3554 @cindex options, debugging
3555 @cindex debugging information options
3557 GCC has various special options that are used for debugging
3558 either your program or GCC:
3560 @table @gcctabopt
3561 @item -g
3562 @opindex g
3563 Produce debugging information in the operating system's native format
3564 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3565 information.
3567 On most systems that use stabs format, @option{-g} enables use of extra
3568 debugging information that only GDB can use; this extra information
3569 makes debugging work better in GDB but will probably make other debuggers
3570 crash or
3571 refuse to read the program.  If you want to control for certain whether
3572 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3573 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3575 GCC allows you to use @option{-g} with
3576 @option{-O}.  The shortcuts taken by optimized code may occasionally
3577 produce surprising results: some variables you declared may not exist
3578 at all; flow of control may briefly move where you did not expect it;
3579 some statements may not be executed because they compute constant
3580 results or their values were already at hand; some statements may
3581 execute in different places because they were moved out of loops.
3583 Nevertheless it proves possible to debug optimized output.  This makes
3584 it reasonable to use the optimizer for programs that might have bugs.
3586 The following options are useful when GCC is generated with the
3587 capability for more than one debugging format.
3589 @item -ggdb
3590 @opindex ggdb
3591 Produce debugging information for use by GDB@.  This means to use the
3592 most expressive format available (DWARF 2, stabs, or the native format
3593 if neither of those are supported), including GDB extensions if at all
3594 possible.
3596 @item -gstabs
3597 @opindex gstabs
3598 Produce debugging information in stabs format (if that is supported),
3599 without GDB extensions.  This is the format used by DBX on most BSD
3600 systems.  On MIPS, Alpha and System V Release 4 systems this option
3601 produces stabs debugging output which is not understood by DBX or SDB@.
3602 On System V Release 4 systems this option requires the GNU assembler.
3604 @item -feliminate-unused-debug-symbols
3605 @opindex feliminate-unused-debug-symbols
3606 Produce debugging information in stabs format (if that is supported),
3607 for only symbols that are actually used.
3609 @item -femit-class-debug-always
3610 Instead of emitting debugging information for a C++ class in only one
3611 object file, emit it in all object files using the class.  This option
3612 should be used only with debuggers that are unable to handle the way GCC
3613 normally emits debugging information for classes because using this
3614 option will increase the size of debugging information by as much as a
3615 factor of two.
3617 @item -gstabs+
3618 @opindex gstabs+
3619 Produce debugging information in stabs format (if that is supported),
3620 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3621 use of these extensions is likely to make other debuggers crash or
3622 refuse to read the program.
3624 @item -gcoff
3625 @opindex gcoff
3626 Produce debugging information in COFF format (if that is supported).
3627 This is the format used by SDB on most System V systems prior to
3628 System V Release 4.
3630 @item -gxcoff
3631 @opindex gxcoff
3632 Produce debugging information in XCOFF format (if that is supported).
3633 This is the format used by the DBX debugger on IBM RS/6000 systems.
3635 @item -gxcoff+
3636 @opindex gxcoff+
3637 Produce debugging information in XCOFF format (if that is supported),
3638 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3639 use of these extensions is likely to make other debuggers crash or
3640 refuse to read the program, and may cause assemblers other than the GNU
3641 assembler (GAS) to fail with an error.
3643 @item -gdwarf-2
3644 @opindex gdwarf-2
3645 Produce debugging information in DWARF version 2 format (if that is
3646 supported).  This is the format used by DBX on IRIX 6.  With this
3647 option, GCC uses features of DWARF version 3 when they are useful;
3648 version 3 is upward compatible with version 2, but may still cause
3649 problems for older debuggers.
3651 @item -gvms
3652 @opindex gvms
3653 Produce debugging information in VMS debug format (if that is
3654 supported).  This is the format used by DEBUG on VMS systems.
3656 @item -g@var{level}
3657 @itemx -ggdb@var{level}
3658 @itemx -gstabs@var{level}
3659 @itemx -gcoff@var{level}
3660 @itemx -gxcoff@var{level}
3661 @itemx -gvms@var{level}
3662 Request debugging information and also use @var{level} to specify how
3663 much information.  The default level is 2.
3665 Level 1 produces minimal information, enough for making backtraces in
3666 parts of the program that you don't plan to debug.  This includes
3667 descriptions of functions and external variables, but no information
3668 about local variables and no line numbers.
3670 Level 3 includes extra information, such as all the macro definitions
3671 present in the program.  Some debuggers support macro expansion when
3672 you use @option{-g3}.
3674 @option{-gdwarf-2} does not accept a concatenated debug level, because
3675 GCC used to support an option @option{-gdwarf} that meant to generate
3676 debug information in version 1 of the DWARF format (which is very
3677 different from version 2), and it would have been too confusing.  That
3678 debug format is long obsolete, but the option cannot be changed now.
3679 Instead use an additional @option{-g@var{level}} option to change the
3680 debug level for DWARF2.
3682 @item -feliminate-dwarf2-dups
3683 @opindex feliminate-dwarf2-dups
3684 Compress DWARF2 debugging information by eliminating duplicated
3685 information about each symbol.  This option only makes sense when
3686 generating DWARF2 debugging information with @option{-gdwarf-2}.
3688 @cindex @command{prof}
3689 @item -p
3690 @opindex p
3691 Generate extra code to write profile information suitable for the
3692 analysis program @command{prof}.  You must use this option when compiling
3693 the source files you want data about, and you must also use it when
3694 linking.
3696 @cindex @command{gprof}
3697 @item -pg
3698 @opindex pg
3699 Generate extra code to write profile information suitable for the
3700 analysis program @command{gprof}.  You must use this option when compiling
3701 the source files you want data about, and you must also use it when
3702 linking.
3704 @item -Q
3705 @opindex Q
3706 Makes the compiler print out each function name as it is compiled, and
3707 print some statistics about each pass when it finishes.
3709 @item -ftime-report
3710 @opindex ftime-report
3711 Makes the compiler print some statistics about the time consumed by each
3712 pass when it finishes.
3714 @item -fmem-report
3715 @opindex fmem-report
3716 Makes the compiler print some statistics about permanent memory
3717 allocation when it finishes.
3719 @item -fprofile-arcs
3720 @opindex fprofile-arcs
3721 Add code so that program flow @dfn{arcs} are instrumented.  During
3722 execution the program records how many times each branch and call is
3723 executed and how many times it is taken or returns.  When the compiled
3724 program exits it saves this data to a file called
3725 @file{@var{auxname}.gcda} for each source file.  The data may be used for
3726 profile-directed optimizations (@option{-fbranch-probabilities}), or for
3727 test coverage analysis (@option{-ftest-coverage}).  Each object file's
3728 @var{auxname} is generated from the name of the output file, if
3729 explicitly specified and it is not the final executable, otherwise it is
3730 the basename of the source file.  In both cases any suffix is removed
3731 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
3732 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
3733 @xref{Cross-profiling}.
3735 @cindex @command{gcov}
3736 @item --coverage
3737 @opindex coverage
3739 This option is used to compile and link code instrumented for coverage
3740 analysis.  The option is a synonym for @option{-fprofile-arcs}
3741 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
3742 linking).  See the documentation for those options for more details.
3744 @itemize
3746 @item
3747 Compile the source files with @option{-fprofile-arcs} plus optimization
3748 and code generation options.  For test coverage analysis, use the
3749 additional @option{-ftest-coverage} option.  You do not need to profile
3750 every source file in a program.
3752 @item
3753 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
3754 (the latter implies the former).
3756 @item
3757 Run the program on a representative workload to generate the arc profile
3758 information.  This may be repeated any number of times.  You can run
3759 concurrent instances of your program, and provided that the file system
3760 supports locking, the data files will be correctly updated.  Also
3761 @code{fork} calls are detected and correctly handled (double counting
3762 will not happen).
3764 @item
3765 For profile-directed optimizations, compile the source files again with
3766 the same optimization and code generation options plus
3767 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
3768 Control Optimization}).
3770 @item
3771 For test coverage analysis, use @command{gcov} to produce human readable
3772 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
3773 @command{gcov} documentation for further information.
3775 @end itemize
3777 With @option{-fprofile-arcs}, for each function of your program GCC
3778 creates a program flow graph, then finds a spanning tree for the graph.
3779 Only arcs that are not on the spanning tree have to be instrumented: the
3780 compiler adds code to count the number of times that these arcs are
3781 executed.  When an arc is the only exit or only entrance to a block, the
3782 instrumentation code can be added to the block; otherwise, a new basic
3783 block must be created to hold the instrumentation code.
3785 @need 2000
3786 @item -ftest-coverage
3787 @opindex ftest-coverage
3788 Produce a notes file that the @command{gcov} code-coverage utility
3789 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
3790 show program coverage.  Each source file's note file is called
3791 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
3792 above for a description of @var{auxname} and instructions on how to
3793 generate test coverage data.  Coverage data will match the source files
3794 more closely, if you do not optimize.
3796 @item -d@var{letters}
3797 @item -fdump-rtl-@var{pass}
3798 @opindex d
3799 Says to make debugging dumps during compilation at times specified by
3800 @var{letters}.    This is used for debugging the RTL-based passes of the
3801 compiler.  The file names for most of the dumps are made by appending a
3802 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
3803 from the name of the output file, if explicitly specified and it is not
3804 an executable, otherwise it is the basename of the source file.
3806 Most debug dumps can be enabled either passing a letter to the @option{-d}
3807 option, or with a long @option{-fdump-rtl} switch; here are the possible
3808 letters for use in @var{letters} and @var{pass}, and their meanings:
3810 @table @gcctabopt
3811 @item -dA
3812 @opindex dA
3813 Annotate the assembler output with miscellaneous debugging information.
3815 @item -dB
3816 @itemx -fdump-rtl-bbro
3817 @opindex dB
3818 @opindex fdump-rtl-bbro
3819 Dump after block reordering, to @file{@var{file}.148r.bbro}.
3821 @item -dc
3822 @itemx -fdump-rtl-combine
3823 @opindex dc
3824 @opindex fdump-rtl-combine
3825 Dump after instruction combination, to the file @file{@var{file}.129r.combine}.
3827 @item -dC
3828 @itemx -fdump-rtl-ce1
3829 @itemx -fdump-rtl-ce2
3830 @opindex dC
3831 @opindex fdump-rtl-ce1
3832 @opindex fdump-rtl-ce2
3833 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
3834 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
3835 and @option{-fdump-rtl-ce2} enable dumping after the second if
3836 conversion, to the file @file{@var{file}.130r.ce2}.
3838 @item -dd
3839 @itemx -fdump-rtl-btl
3840 @itemx -fdump-rtl-dbr
3841 @opindex dd
3842 @opindex fdump-rtl-btl
3843 @opindex fdump-rtl-dbr
3844 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
3845 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
3846 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
3847 scheduling, to @file{@var{file}.36.dbr}.
3849 @item -dD
3850 @opindex dD
3851 Dump all macro definitions, at the end of preprocessing, in addition to
3852 normal output.
3854 @item -dE
3855 @itemx -fdump-rtl-ce3
3856 @opindex dE
3857 @opindex fdump-rtl-ce3
3858 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
3860 @item -df
3861 @itemx -fdump-rtl-cfg
3862 @itemx -fdump-rtl-life
3863 @opindex df
3864 @opindex fdump-rtl-cfg
3865 @opindex fdump-rtl-life
3866 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
3867 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
3868 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
3869 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
3871 @item -dg
3872 @itemx -fdump-rtl-greg
3873 @opindex dg
3874 @opindex fdump-rtl-greg
3875 Dump after global register allocation, to @file{@var{file}.139r.greg}.
3877 @item -dG
3878 @itemx -fdump-rtl-gcse
3879 @itemx -fdump-rtl-bypass
3880 @opindex dG
3881 @opindex fdump-rtl-gcse
3882 @opindex fdump-rtl-bypass
3883 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
3884 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
3885 enable dumping after jump bypassing and control flow optimizations, to
3886 @file{@var{file}.115r.bypass}.
3888 @item -dh
3889 @itemx -fdump-rtl-eh
3890 @opindex dh
3891 @opindex fdump-rtl-eh
3892 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
3894 @item -di
3895 @itemx -fdump-rtl-sibling
3896 @opindex di
3897 @opindex fdump-rtl-sibling
3898 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
3900 @item -dj
3901 @itemx -fdump-rtl-jump
3902 @opindex dj
3903 @opindex fdump-rtl-jump
3904 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
3906 @item -dk
3907 @itemx -fdump-rtl-stack
3908 @opindex dk
3909 @opindex fdump-rtl-stack
3910 Dump after conversion from registers to stack, to @file{@var{file}.152r.stack}.
3912 @item -dl
3913 @itemx -fdump-rtl-lreg
3914 @opindex dl
3915 @opindex fdump-rtl-lreg
3916 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
3918 @item -dL
3919 @itemx -fdump-rtl-loop2
3920 @opindex dL
3921 @opindex fdump-rtl-loop2
3922 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
3923 loop optimization pass, to @file{@var{file}.119r.loop2},
3924 @file{@var{file}.120r.loop2_init},
3925 @file{@var{file}.121r.loop2_invariant}, and
3926 @file{@var{file}.125r.loop2_done}.
3928 @item -dm
3929 @itemx -fdump-rtl-sms
3930 @opindex dm
3931 @opindex fdump-rtl-sms
3932 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
3934 @item -dM
3935 @itemx -fdump-rtl-mach
3936 @opindex dM
3937 @opindex fdump-rtl-mach
3938 Dump after performing the machine dependent reorganization pass, to
3939 @file{@var{file}.155r.mach}.
3941 @item -dn
3942 @itemx -fdump-rtl-rnreg
3943 @opindex dn
3944 @opindex fdump-rtl-rnreg
3945 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
3947 @item -dN
3948 @itemx -fdump-rtl-regmove
3949 @opindex dN
3950 @opindex fdump-rtl-regmove
3951 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
3953 @item -do
3954 @itemx -fdump-rtl-postreload
3955 @opindex do
3956 @opindex fdump-rtl-postreload
3957 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
3959 @item -dr
3960 @itemx -fdump-rtl-expand
3961 @opindex dr
3962 @opindex fdump-rtl-expand
3963 Dump after RTL generation, to @file{@var{file}.104r.expand}.
3965 @item -dR
3966 @itemx -fdump-rtl-sched2
3967 @opindex dR
3968 @opindex fdump-rtl-sched2
3969 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
3971 @item -ds
3972 @itemx -fdump-rtl-cse
3973 @opindex ds
3974 @opindex fdump-rtl-cse
3975 Dump after CSE (including the jump optimization that sometimes follows
3976 CSE), to @file{@var{file}.113r.cse}.
3978 @item -dS
3979 @itemx -fdump-rtl-sched1
3980 @opindex dS
3981 @opindex fdump-rtl-sched1
3982 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
3984 @item -dt
3985 @itemx -fdump-rtl-cse2
3986 @opindex dt
3987 @opindex fdump-rtl-cse2
3988 Dump after the second CSE pass (including the jump optimization that
3989 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
3991 @item -dT
3992 @itemx -fdump-rtl-tracer
3993 @opindex dT
3994 @opindex fdump-rtl-tracer
3995 Dump after running tracer, to @file{@var{file}.118r.tracer}.
3997 @item -dV
3998 @itemx -fdump-rtl-vpt
3999 @itemx -fdump-rtl-vartrack
4000 @opindex dV
4001 @opindex fdump-rtl-vpt
4002 @opindex fdump-rtl-vartrack
4003 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4004 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4005 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4006 to @file{@var{file}.154r.vartrack}.
4008 @item -dw
4009 @itemx -fdump-rtl-flow2
4010 @opindex dw
4011 @opindex fdump-rtl-flow2
4012 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4014 @item -dz
4015 @itemx -fdump-rtl-peephole2
4016 @opindex dz
4017 @opindex fdump-rtl-peephole2
4018 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4020 @item -dZ
4021 @itemx -fdump-rtl-web
4022 @opindex dZ
4023 @opindex fdump-rtl-web
4024 Dump after live range splitting, to @file{@var{file}.126r.web}.
4026 @item -da
4027 @itemx -fdump-rtl-all
4028 @opindex da
4029 @opindex fdump-rtl-all
4030 Produce all the dumps listed above.
4032 @item -dH
4033 @opindex dH
4034 Produce a core dump whenever an error occurs.
4036 @item -dm
4037 @opindex dm
4038 Print statistics on memory usage, at the end of the run, to
4039 standard error.
4041 @item -dp
4042 @opindex dp
4043 Annotate the assembler output with a comment indicating which
4044 pattern and alternative was used.  The length of each instruction is
4045 also printed.
4047 @item -dP
4048 @opindex dP
4049 Dump the RTL in the assembler output as a comment before each instruction.
4050 Also turns on @option{-dp} annotation.
4052 @item -dv
4053 @opindex dv
4054 For each of the other indicated dump files (either with @option{-d} or
4055 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4056 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4058 @item -dx
4059 @opindex dx
4060 Just generate RTL for a function instead of compiling it.  Usually used
4061 with @samp{r} (@option{-fdump-rtl-expand}).
4063 @item -dy
4064 @opindex dy
4065 Dump debugging information during parsing, to standard error.
4066 @end table
4068 @item -fdump-noaddr
4069 @opindex fdump-noaddr
4070 When doing debugging dumps (see @option{-d} option above), suppress
4071 address output.  This makes it more feasible to use diff on debugging
4072 dumps for compiler invocations with different compiler binaries and/or
4073 different text / bss / data / heap / stack / dso start locations.
4075 @item -fdump-unnumbered
4076 @opindex fdump-unnumbered
4077 When doing debugging dumps (see @option{-d} option above), suppress instruction
4078 numbers, line number note and address output.  This makes it more feasible to
4079 use diff on debugging dumps for compiler invocations with different
4080 options, in particular with and without @option{-g}.
4082 @item -fdump-translation-unit @r{(C++ only)}
4083 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4084 @opindex fdump-translation-unit
4085 Dump a representation of the tree structure for the entire translation
4086 unit to a file.  The file name is made by appending @file{.tu} to the
4087 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4088 controls the details of the dump as described for the
4089 @option{-fdump-tree} options.
4091 @item -fdump-class-hierarchy @r{(C++ only)}
4092 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4093 @opindex fdump-class-hierarchy
4094 Dump a representation of each class's hierarchy and virtual function
4095 table layout to a file.  The file name is made by appending @file{.class}
4096 to the source file name.  If the @samp{-@var{options}} form is used,
4097 @var{options} controls the details of the dump as described for the
4098 @option{-fdump-tree} options.
4100 @item -fdump-ipa-@var{switch}
4101 @opindex fdump-ipa
4102 Control the dumping at various stages of inter-procedural analysis
4103 language tree to a file.  The file name is generated by appending a switch
4104 specific suffix to the source file name.  The following dumps are possible:
4106 @table @samp
4107 @item all
4108 Enables all inter-procedural analysis dumps; currently the only produced
4109 dump is the @samp{cgraph} dump.
4111 @item cgraph
4112 Dumps information about call-graph optimization, unused function removal,
4113 and inlining decisions.
4114 @end table
4116 @item -fdump-tree-@var{switch}
4117 @itemx -fdump-tree-@var{switch}-@var{options}
4118 @opindex fdump-tree
4119 Control the dumping at various stages of processing the intermediate
4120 language tree to a file.  The file name is generated by appending a switch
4121 specific suffix to the source file name.  If the @samp{-@var{options}}
4122 form is used, @var{options} is a list of @samp{-} separated options that
4123 control the details of the dump.  Not all options are applicable to all
4124 dumps, those which are not meaningful will be ignored.  The following
4125 options are available
4127 @table @samp
4128 @item address
4129 Print the address of each node.  Usually this is not meaningful as it
4130 changes according to the environment and source file.  Its primary use
4131 is for tying up a dump file with a debug environment.
4132 @item slim
4133 Inhibit dumping of members of a scope or body of a function merely
4134 because that scope has been reached.  Only dump such items when they
4135 are directly reachable by some other path.  When dumping pretty-printed
4136 trees, this option inhibits dumping the bodies of control structures.
4137 @item raw
4138 Print a raw representation of the tree.  By default, trees are
4139 pretty-printed into a C-like representation.
4140 @item details
4141 Enable more detailed dumps (not honored by every dump option).
4142 @item stats
4143 Enable dumping various statistics about the pass (not honored by every dump
4144 option).
4145 @item blocks
4146 Enable showing basic block boundaries (disabled in raw dumps).
4147 @item vops
4148 Enable showing virtual operands for every statement.
4149 @item lineno
4150 Enable showing line numbers for statements.
4151 @item uid
4152 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4153 @item all
4154 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4155 @end table
4157 The following tree dumps are possible:
4158 @table @samp
4160 @item original
4161 Dump before any tree based optimization, to @file{@var{file}.original}.
4163 @item optimized
4164 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4166 @item inlined
4167 Dump after function inlining, to @file{@var{file}.inlined}.
4169 @item gimple
4170 @opindex fdump-tree-gimple
4171 Dump each function before and after the gimplification pass to a file.  The
4172 file name is made by appending @file{.gimple} to the source file name.
4174 @item cfg
4175 @opindex fdump-tree-cfg
4176 Dump the control flow graph of each function to a file.  The file name is
4177 made by appending @file{.cfg} to the source file name.
4179 @item vcg
4180 @opindex fdump-tree-vcg
4181 Dump the control flow graph of each function to a file in VCG format.  The
4182 file name is made by appending @file{.vcg} to the source file name.  Note
4183 that if the file contains more than one function, the generated file cannot
4184 be used directly by VCG@.  You will need to cut and paste each function's
4185 graph into its own separate file first.
4187 @item ch
4188 @opindex fdump-tree-ch
4189 Dump each function after copying loop headers.  The file name is made by
4190 appending @file{.ch} to the source file name.
4192 @item ssa
4193 @opindex fdump-tree-ssa
4194 Dump SSA related information to a file.  The file name is made by appending
4195 @file{.ssa} to the source file name.
4197 @item salias
4198 @opindex fdump-tree-salias
4199 Dump structure aliasing variable information to a file.  This file name
4200 is made by appending @file{.salias} to the source file name.
4202 @item alias
4203 @opindex fdump-tree-alias
4204 Dump aliasing information for each function.  The file name is made by
4205 appending @file{.alias} to the source file name.
4207 @item ccp
4208 @opindex fdump-tree-ccp
4209 Dump each function after CCP@.  The file name is made by appending
4210 @file{.ccp} to the source file name.
4212 @item storeccp
4213 @opindex fdump-tree-storeccp
4214 Dump each function after STORE-CCP.  The file name is made by appending
4215 @file{.storeccp} to the source file name.
4217 @item pre
4218 @opindex fdump-tree-pre
4219 Dump trees after partial redundancy elimination.  The file name is made
4220 by appending @file{.pre} to the source file name.
4222 @item fre
4223 @opindex fdump-tree-fre
4224 Dump trees after full redundancy elimination.  The file name is made
4225 by appending @file{.fre} to the source file name.
4227 @item copyprop
4228 @opindex fdump-tree-copyprop
4229 Dump trees after copy propagation.  The file name is made
4230 by appending @file{.copyprop} to the source file name.
4232 @item store_copyprop
4233 @opindex fdump-tree-store_copyprop
4234 Dump trees after store copy-propagation.  The file name is made
4235 by appending @file{.store_copyprop} to the source file name.
4237 @item dce
4238 @opindex fdump-tree-dce
4239 Dump each function after dead code elimination.  The file name is made by
4240 appending @file{.dce} to the source file name.
4242 @item mudflap
4243 @opindex fdump-tree-mudflap
4244 Dump each function after adding mudflap instrumentation.  The file name is
4245 made by appending @file{.mudflap} to the source file name.
4247 @item sra
4248 @opindex fdump-tree-sra
4249 Dump each function after performing scalar replacement of aggregates.  The
4250 file name is made by appending @file{.sra} to the source file name.
4252 @item sink
4253 @opindex fdump-tree-sink
4254 Dump each function after performing code sinking.  The file name is made
4255 by appending @file{.sink} to the source file name. 
4257 @item dom
4258 @opindex fdump-tree-dom
4259 Dump each function after applying dominator tree optimizations.  The file
4260 name is made by appending @file{.dom} to the source file name.
4262 @item dse
4263 @opindex fdump-tree-dse
4264 Dump each function after applying dead store elimination.  The file
4265 name is made by appending @file{.dse} to the source file name.
4267 @item phiopt
4268 @opindex fdump-tree-phiopt
4269 Dump each function after optimizing PHI nodes into straightline code.  The file
4270 name is made by appending @file{.phiopt} to the source file name.
4272 @item forwprop
4273 @opindex fdump-tree-forwprop
4274 Dump each function after forward propagating single use variables.  The file
4275 name is made by appending @file{.forwprop} to the source file name.
4277 @item copyrename
4278 @opindex fdump-tree-copyrename
4279 Dump each function after applying the copy rename optimization.  The file
4280 name is made by appending @file{.copyrename} to the source file name.
4282 @item nrv
4283 @opindex fdump-tree-nrv
4284 Dump each function after applying the named return value optimization on
4285 generic trees.  The file name is made by appending @file{.nrv} to the source
4286 file name.
4288 @item vect
4289 @opindex fdump-tree-vect
4290 Dump each function after applying vectorization of loops.  The file name is
4291 made by appending @file{.vect} to the source file name.
4293 @item vrp
4294 @opindex fdump-tree-vrp
4295 Dump each function after Value Range Propagation (VRP).  The file name
4296 is made by appending @file{.vrp} to the source file name.
4298 @item all
4299 @opindex fdump-tree-all
4300 Enable all the available tree dumps with the flags provided in this option.
4301 @end table
4303 @item -ftree-vectorizer-verbose=@var{n}
4304 @opindex ftree-vectorizer-verbose
4305 This option controls the amount of debugging output the vectorizer prints.
4306 This information is written to standard error, unless 
4307 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified, 
4308 in which case it is output to the usual dump listing file, @file{.vect}.
4309 For @var{n}=0 no diagnostic information is reported.
4310 If @var{n}=1 the vectorizer reports each loop that got vectorized, 
4311 and the total number of loops that got vectorized.
4312 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed 
4313 the first analysis phase (vect_analyze_loop_form) - i.e. countable, 
4314 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity 
4315 level that @option{-fdump-tree-vect-stats} uses.
4316 Higher verbosity levels mean either more information dumped for each 
4317 reported loop, or same amount of information reported for more loops:
4318 If @var{n}=3, alignment related information is added to the reports.
4319 If @var{n}=4, data-references related information (e.g. memory dependences, 
4320 memory access-patterns) is added to the reports.
4321 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops 
4322 that did not pass the first analysis phase (i.e. may not be countable, or 
4323 may have complicated control-flow).
4324 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4325 For @var{n}=7, all the information the vectorizer generates during its 
4326 analysis and transformation is reported.  This is the same verbosity level
4327 that @option{-fdump-tree-vect-details} uses.
4329 @item -frandom-seed=@var{string}
4330 @opindex frandom-string
4331 This option provides a seed that GCC uses when it would otherwise use
4332 random numbers.  It is used to generate certain symbol names
4333 that have to be different in every compiled file.  It is also used to
4334 place unique stamps in coverage data files and the object files that
4335 produce them.  You can use the @option{-frandom-seed} option to produce
4336 reproducibly identical object files.
4338 The @var{string} should be different for every file you compile.
4340 @item -fsched-verbose=@var{n}
4341 @opindex fsched-verbose
4342 On targets that use instruction scheduling, this option controls the
4343 amount of debugging output the scheduler prints.  This information is
4344 written to standard error, unless @option{-dS} or @option{-dR} is
4345 specified, in which case it is output to the usual dump
4346 listing file, @file{.sched} or @file{.sched2} respectively.  However
4347 for @var{n} greater than nine, the output is always printed to standard
4348 error.
4350 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4351 same information as @option{-dRS}.  For @var{n} greater than one, it
4352 also output basic block probabilities, detailed ready list information
4353 and unit/insn info.  For @var{n} greater than two, it includes RTL
4354 at abort point, control-flow and regions info.  And for @var{n} over
4355 four, @option{-fsched-verbose} also includes dependence info.
4357 @item -save-temps
4358 @opindex save-temps
4359 Store the usual ``temporary'' intermediate files permanently; place them
4360 in the current directory and name them based on the source file.  Thus,
4361 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4362 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4363 preprocessed @file{foo.i} output file even though the compiler now
4364 normally uses an integrated preprocessor.
4366 When used in combination with the @option{-x} command line option,
4367 @option{-save-temps} is sensible enough to avoid over writing an
4368 input source file with the same extension as an intermediate file.
4369 The corresponding intermediate file may be obtained by renaming the
4370 source file before using @option{-save-temps}.
4372 @item -time
4373 @opindex time
4374 Report the CPU time taken by each subprocess in the compilation
4375 sequence.  For C source files, this is the compiler proper and assembler
4376 (plus the linker if linking is done).  The output looks like this:
4378 @smallexample
4379 # cc1 0.12 0.01
4380 # as 0.00 0.01
4381 @end smallexample
4383 The first number on each line is the ``user time'', that is time spent
4384 executing the program itself.  The second number is ``system time'',
4385 time spent executing operating system routines on behalf of the program.
4386 Both numbers are in seconds.
4388 @item -fvar-tracking
4389 @opindex fvar-tracking
4390 Run variable tracking pass.  It computes where variables are stored at each
4391 position in code.  Better debugging information is then generated
4392 (if the debugging information format supports this information).
4394 It is enabled by default when compiling with optimization (@option{-Os},
4395 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4396 the debug info format supports it.
4398 @item -print-file-name=@var{library}
4399 @opindex print-file-name
4400 Print the full absolute name of the library file @var{library} that
4401 would be used when linking---and don't do anything else.  With this
4402 option, GCC does not compile or link anything; it just prints the
4403 file name.
4405 @item -print-multi-directory
4406 @opindex print-multi-directory
4407 Print the directory name corresponding to the multilib selected by any
4408 other switches present in the command line.  This directory is supposed
4409 to exist in @env{GCC_EXEC_PREFIX}.
4411 @item -print-multi-lib
4412 @opindex print-multi-lib
4413 Print the mapping from multilib directory names to compiler switches
4414 that enable them.  The directory name is separated from the switches by
4415 @samp{;}, and each switch starts with an @samp{@@} instead of the
4416 @samp{-}, without spaces between multiple switches.  This is supposed to
4417 ease shell-processing.
4419 @item -print-prog-name=@var{program}
4420 @opindex print-prog-name
4421 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4423 @item -print-libgcc-file-name
4424 @opindex print-libgcc-file-name
4425 Same as @option{-print-file-name=libgcc.a}.
4427 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4428 but you do want to link with @file{libgcc.a}.  You can do
4430 @smallexample
4431 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4432 @end smallexample
4434 @item -print-search-dirs
4435 @opindex print-search-dirs
4436 Print the name of the configured installation directory and a list of
4437 program and library directories @command{gcc} will search---and don't do anything else.
4439 This is useful when @command{gcc} prints the error message
4440 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4441 To resolve this you either need to put @file{cpp0} and the other compiler
4442 components where @command{gcc} expects to find them, or you can set the environment
4443 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4444 Don't forget the trailing @samp{/}.
4445 @xref{Environment Variables}.
4447 @item -dumpmachine
4448 @opindex dumpmachine
4449 Print the compiler's target machine (for example,
4450 @samp{i686-pc-linux-gnu})---and don't do anything else.
4452 @item -dumpversion
4453 @opindex dumpversion
4454 Print the compiler version (for example, @samp{3.0})---and don't do
4455 anything else.
4457 @item -dumpspecs
4458 @opindex dumpspecs
4459 Print the compiler's built-in specs---and don't do anything else.  (This
4460 is used when GCC itself is being built.)  @xref{Spec Files}.
4462 @item -feliminate-unused-debug-types
4463 @opindex feliminate-unused-debug-types
4464 Normally, when producing DWARF2 output, GCC will emit debugging
4465 information for all types declared in a compilation
4466 unit, regardless of whether or not they are actually used
4467 in that compilation unit.  Sometimes this is useful, such as
4468 if, in the debugger, you want to cast a value to a type that is
4469 not actually used in your program (but is declared).  More often,
4470 however, this results in a significant amount of wasted space.
4471 With this option, GCC will avoid producing debug symbol output
4472 for types that are nowhere used in the source file being compiled.
4473 @end table
4475 @node Optimize Options
4476 @section Options That Control Optimization
4477 @cindex optimize options
4478 @cindex options, optimization
4480 These options control various sorts of optimizations.
4482 Without any optimization option, the compiler's goal is to reduce the
4483 cost of compilation and to make debugging produce the expected
4484 results.  Statements are independent: if you stop the program with a
4485 breakpoint between statements, you can then assign a new value to any
4486 variable or change the program counter to any other statement in the
4487 function and get exactly the results you would expect from the source
4488 code.
4490 Turning on optimization flags makes the compiler attempt to improve
4491 the performance and/or code size at the expense of compilation time
4492 and possibly the ability to debug the program.
4494 The compiler performs optimization based on the knowledge it has of
4495 the program.  Optimization levels @option{-O} and above, in
4496 particular, enable @emph{unit-at-a-time} mode, which allows the
4497 compiler to consider information gained from later functions in
4498 the file when compiling a function.  Compiling multiple files at
4499 once to a single output file in @emph{unit-at-a-time} mode allows
4500 the compiler to use information gained from all of the files when
4501 compiling each of them.
4503 Not all optimizations are controlled directly by a flag.  Only
4504 optimizations that have a flag are listed.
4506 @table @gcctabopt
4507 @item -O
4508 @itemx -O1
4509 @opindex O
4510 @opindex O1
4511 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4512 more memory for a large function.
4514 With @option{-O}, the compiler tries to reduce code size and execution
4515 time, without performing any optimizations that take a great deal of
4516 compilation time.
4518 @option{-O} turns on the following optimization flags:
4519 @gccoptlist{-fdefer-pop @gol
4520 -fdelayed-branch @gol
4521 -fguess-branch-probability @gol
4522 -fcprop-registers @gol
4523 -fif-conversion @gol
4524 -fif-conversion2 @gol
4525 -ftree-ccp @gol
4526 -ftree-dce @gol
4527 -ftree-dominator-opts @gol
4528 -ftree-dse @gol
4529 -ftree-ter @gol
4530 -ftree-lrs @gol
4531 -ftree-sra @gol
4532 -ftree-copyrename @gol
4533 -ftree-fre @gol
4534 -ftree-ch @gol
4535 -funit-at-a-time @gol
4536 -fmerge-constants}
4538 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4539 where doing so does not interfere with debugging.
4541 @item -O2
4542 @opindex O2
4543 Optimize even more.  GCC performs nearly all supported optimizations
4544 that do not involve a space-speed tradeoff.  The compiler does not
4545 perform loop unrolling or function inlining when you specify @option{-O2}.
4546 As compared to @option{-O}, this option increases both compilation time
4547 and the performance of the generated code.
4549 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4550 also turns on the following optimization flags:
4551 @gccoptlist{-fthread-jumps @gol
4552 -fcrossjumping @gol
4553 -foptimize-sibling-calls @gol
4554 -fcse-follow-jumps  -fcse-skip-blocks @gol
4555 -fgcse  -fgcse-lm  @gol
4556 -fexpensive-optimizations @gol
4557 -frerun-cse-after-loop  @gol
4558 -fcaller-saves @gol
4559 -fpeephole2 @gol
4560 -fschedule-insns  -fschedule-insns2 @gol
4561 -fsched-interblock  -fsched-spec @gol
4562 -fregmove @gol
4563 -fstrict-aliasing @gol
4564 -fdelete-null-pointer-checks @gol
4565 -freorder-blocks  -freorder-functions @gol
4566 -falign-functions  -falign-jumps @gol
4567 -falign-loops  -falign-labels @gol
4568 -ftree-vrp @gol
4569 -ftree-pre}
4571 Please note the warning under @option{-fgcse} about
4572 invoking @option{-O2} on programs that use computed gotos.
4574 @item -O3
4575 @opindex O3
4576 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4577 @option{-O2} and also turns on the @option{-finline-functions},
4578 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4580 @item -O0
4581 @opindex O0
4582 Do not optimize.  This is the default.
4584 @item -Os
4585 @opindex Os
4586 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4587 do not typically increase code size.  It also performs further
4588 optimizations designed to reduce code size.
4590 @option{-Os} disables the following optimization flags:
4591 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4592 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
4593 -fprefetch-loop-arrays  -ftree-vect-loop-version}
4595 If you use multiple @option{-O} options, with or without level numbers,
4596 the last such option is the one that is effective.
4597 @end table
4599 Options of the form @option{-f@var{flag}} specify machine-independent
4600 flags.  Most flags have both positive and negative forms; the negative
4601 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4602 below, only one of the forms is listed---the one you typically will
4603 use.  You can figure out the other form by either removing @samp{no-}
4604 or adding it.
4606 The following options control specific optimizations.  They are either
4607 activated by @option{-O} options or are related to ones that are.  You
4608 can use the following flags in the rare cases when ``fine-tuning'' of
4609 optimizations to be performed is desired.
4611 @table @gcctabopt
4612 @item -fno-default-inline
4613 @opindex fno-default-inline
4614 Do not make member functions inline by default merely because they are
4615 defined inside the class scope (C++ only).  Otherwise, when you specify
4616 @w{@option{-O}}, member functions defined inside class scope are compiled
4617 inline by default; i.e., you don't need to add @samp{inline} in front of
4618 the member function name.
4620 @item -fno-defer-pop
4621 @opindex fno-defer-pop
4622 Always pop the arguments to each function call as soon as that function
4623 returns.  For machines which must pop arguments after a function call,
4624 the compiler normally lets arguments accumulate on the stack for several
4625 function calls and pops them all at once.
4627 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4629 @item -fforce-mem
4630 @opindex fforce-mem
4631 Force memory operands to be copied into registers before doing
4632 arithmetic on them.  This produces better code by making all memory
4633 references potential common subexpressions.  When they are not common
4634 subexpressions, instruction combination should eliminate the separate
4635 register-load. This option is now a nop and will be removed in 4.2.
4637 @item -fforce-addr
4638 @opindex fforce-addr
4639 Force memory address constants to be copied into registers before
4640 doing arithmetic on them.
4642 @item -fforward-propagate
4643 @opindex fforward-propagate
4644 Perform a forward propagation pass on RTL.  The pass tries to combine two
4645 instructions and checks if the result can be simplified.  If loop unrolling
4646 is active, two passes are performed and the second is scheduled after
4647 loop unrolling.
4649 This option is enabled by default at optimization levels @option{-O2},
4650 @option{-O3}, @option{-Os}.
4652 @item -fomit-frame-pointer
4653 @opindex fomit-frame-pointer
4654 Don't keep the frame pointer in a register for functions that
4655 don't need one.  This avoids the instructions to save, set up and
4656 restore frame pointers; it also makes an extra register available
4657 in many functions.  @strong{It also makes debugging impossible on
4658 some machines.}
4660 On some machines, such as the VAX, this flag has no effect, because
4661 the standard calling sequence automatically handles the frame pointer
4662 and nothing is saved by pretending it doesn't exist.  The
4663 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4664 whether a target machine supports this flag.  @xref{Registers,,Register
4665 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4667 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4669 @item -foptimize-sibling-calls
4670 @opindex foptimize-sibling-calls
4671 Optimize sibling and tail recursive calls.
4673 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4675 @item -fno-inline
4676 @opindex fno-inline
4677 Don't pay attention to the @code{inline} keyword.  Normally this option
4678 is used to keep the compiler from expanding any functions inline.
4679 Note that if you are not optimizing, no functions can be expanded inline.
4681 @item -finline-functions
4682 @opindex finline-functions
4683 Integrate all simple functions into their callers.  The compiler
4684 heuristically decides which functions are simple enough to be worth
4685 integrating in this way.
4687 If all calls to a given function are integrated, and the function is
4688 declared @code{static}, then the function is normally not output as
4689 assembler code in its own right.
4691 Enabled at level @option{-O3}.
4693 @item -finline-functions-called-once
4694 @opindex finline-functions-called-once
4695 Consider all @code{static} functions called once for inlining into their
4696 caller even if they are not marked @code{inline}.  If a call to a given
4697 function is integrated, then the function is not output as assembler code
4698 in its own right.
4700 Enabled if @option{-funit-at-a-time} is enabled.
4702 @item -fearly-inlining
4703 @opindex fearly-inlining
4704 Inline functions marked by @code{always_inline} and functions whose body seems
4705 smaller than the function call overhead early before doing
4706 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4707 makes profiling significantly cheaper and usually inlining faster on programs
4708 having large chains of nested wrapper functions.
4710 Enabled by default.
4712 @item -finline-limit=@var{n}
4713 @opindex finline-limit
4714 By default, GCC limits the size of functions that can be inlined.  This flag
4715 allows the control of this limit for functions that are explicitly marked as
4716 inline (i.e., marked with the inline keyword or defined within the class
4717 definition in c++).  @var{n} is the size of functions that can be inlined in
4718 number of pseudo instructions (not counting parameter handling).  The default
4719 value of @var{n} is 600.
4720 Increasing this value can result in more inlined code at
4721 the cost of compilation time and memory consumption.  Decreasing usually makes
4722 the compilation faster and less code will be inlined (which presumably
4723 means slower programs).  This option is particularly useful for programs that
4724 use inlining heavily such as those based on recursive templates with C++.
4726 Inlining is actually controlled by a number of parameters, which may be
4727 specified individually by using @option{--param @var{name}=@var{value}}.
4728 The @option{-finline-limit=@var{n}} option sets some of these parameters
4729 as follows:
4731 @table @gcctabopt
4732 @item max-inline-insns-single
4733  is set to @var{n}/2.
4734 @item max-inline-insns-auto
4735  is set to @var{n}/2.
4736 @item min-inline-insns
4737  is set to 130 or @var{n}/4, whichever is smaller.
4738 @item max-inline-insns-rtl
4739  is set to @var{n}.
4740 @end table
4742 See below for a documentation of the individual
4743 parameters controlling inlining.
4745 @emph{Note:} pseudo instruction represents, in this particular context, an
4746 abstract measurement of function's size.  In no way does it represent a count
4747 of assembly instructions and as such its exact meaning might change from one
4748 release to an another.
4750 @item -fkeep-inline-functions
4751 @opindex fkeep-inline-functions
4752 In C, emit @code{static} functions that are declared @code{inline}
4753 into the object file, even if the function has been inlined into all
4754 of its callers.  This switch does not affect functions using the
4755 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
4756 inline functions into the object file.
4758 @item -fkeep-static-consts
4759 @opindex fkeep-static-consts
4760 Emit variables declared @code{static const} when optimization isn't turned
4761 on, even if the variables aren't referenced.
4763 GCC enables this option by default.  If you want to force the compiler to
4764 check if the variable was referenced, regardless of whether or not
4765 optimization is turned on, use the @option{-fno-keep-static-consts} option.
4767 @item -fmerge-constants
4768 Attempt to merge identical constants (string constants and floating point
4769 constants) across compilation units.
4771 This option is the default for optimized compilation if the assembler and
4772 linker support it.  Use @option{-fno-merge-constants} to inhibit this
4773 behavior.
4775 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4777 @item -fmerge-all-constants
4778 Attempt to merge identical constants and identical variables.
4780 This option implies @option{-fmerge-constants}.  In addition to
4781 @option{-fmerge-constants} this considers e.g.@: even constant initialized
4782 arrays or initialized constant variables with integral or floating point
4783 types.  Languages like C or C++ require each non-automatic variable to
4784 have distinct location, so using this option will result in non-conforming
4785 behavior.
4787 @item -fmodulo-sched
4788 @opindex fmodulo-sched
4789 Perform swing modulo scheduling immediately before the first scheduling
4790 pass.  This pass looks at innermost loops and reorders their
4791 instructions by overlapping different iterations.
4793 @item -fno-branch-count-reg
4794 @opindex fno-branch-count-reg
4795 Do not use ``decrement and branch'' instructions on a count register,
4796 but instead generate a sequence of instructions that decrement a
4797 register, compare it against zero, then branch based upon the result.
4798 This option is only meaningful on architectures that support such
4799 instructions, which include x86, PowerPC, IA-64 and S/390.
4801 The default is @option{-fbranch-count-reg}.
4803 @item -fno-function-cse
4804 @opindex fno-function-cse
4805 Do not put function addresses in registers; make each instruction that
4806 calls a constant function contain the function's address explicitly.
4808 This option results in less efficient code, but some strange hacks
4809 that alter the assembler output may be confused by the optimizations
4810 performed when this option is not used.
4812 The default is @option{-ffunction-cse}
4814 @item -fno-zero-initialized-in-bss
4815 @opindex fno-zero-initialized-in-bss
4816 If the target supports a BSS section, GCC by default puts variables that
4817 are initialized to zero into BSS@.  This can save space in the resulting
4818 code.
4820 This option turns off this behavior because some programs explicitly
4821 rely on variables going to the data section.  E.g., so that the
4822 resulting executable can find the beginning of that section and/or make
4823 assumptions based on that.
4825 The default is @option{-fzero-initialized-in-bss}.
4827 @item -fbounds-check
4828 @opindex fbounds-check
4829 For front-ends that support it, generate additional code to check that
4830 indices used to access arrays are within the declared range.  This is
4831 currently only supported by the Java and Fortran front-ends, where
4832 this option defaults to true and false respectively.
4834 @item -fmudflap -fmudflapth -fmudflapir
4835 @opindex fmudflap
4836 @opindex fmudflapth
4837 @opindex fmudflapir
4838 @cindex bounds checking
4839 @cindex mudflap
4840 For front-ends that support it (C and C++), instrument all risky
4841 pointer/array dereferencing operations, some standard library
4842 string/heap functions, and some other associated constructs with
4843 range/validity tests.  Modules so instrumented should be immune to
4844 buffer overflows, invalid heap use, and some other classes of C/C++
4845 programming errors.  The instrumentation relies on a separate runtime
4846 library (@file{libmudflap}), which will be linked into a program if
4847 @option{-fmudflap} is given at link time.  Run-time behavior of the
4848 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
4849 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
4850 for its options.
4852 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
4853 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
4854 addition to @option{-fmudflap} or @option{-fmudflapth}, if
4855 instrumentation should ignore pointer reads.  This produces less
4856 instrumentation (and therefore faster execution) and still provides
4857 some protection against outright memory corrupting writes, but allows
4858 erroneously read data to propagate within a program.
4860 @item -fthread-jumps
4861 @opindex fthread-jumps
4862 Perform optimizations where we check to see if a jump branches to a
4863 location where another comparison subsumed by the first is found.  If
4864 so, the first branch is redirected to either the destination of the
4865 second branch or a point immediately following it, depending on whether
4866 the condition is known to be true or false.
4868 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4870 @item -fcse-follow-jumps
4871 @opindex fcse-follow-jumps
4872 In common subexpression elimination, scan through jump instructions
4873 when the target of the jump is not reached by any other path.  For
4874 example, when CSE encounters an @code{if} statement with an
4875 @code{else} clause, CSE will follow the jump when the condition
4876 tested is false.
4878 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4880 @item -fcse-skip-blocks
4881 @opindex fcse-skip-blocks
4882 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
4883 follow jumps which conditionally skip over blocks.  When CSE
4884 encounters a simple @code{if} statement with no else clause,
4885 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
4886 body of the @code{if}.
4888 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4890 @item -frerun-cse-after-loop
4891 @opindex frerun-cse-after-loop
4892 Re-run common subexpression elimination after loop optimizations has been
4893 performed.
4895 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4897 @item -fgcse
4898 @opindex fgcse
4899 Perform a global common subexpression elimination pass.
4900 This pass also performs global constant and copy propagation.
4902 @emph{Note:} When compiling a program using computed gotos, a GCC
4903 extension, you may get better runtime performance if you disable
4904 the global common subexpression elimination pass by adding
4905 @option{-fno-gcse} to the command line.
4907 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4909 @item -fgcse-lm
4910 @opindex fgcse-lm
4911 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
4912 attempt to move loads which are only killed by stores into themselves.  This
4913 allows a loop containing a load/store sequence to be changed to a load outside
4914 the loop, and a copy/store within the loop.
4916 Enabled by default when gcse is enabled.
4918 @item -fgcse-sm
4919 @opindex fgcse-sm
4920 When @option{-fgcse-sm} is enabled, a store motion pass is run after
4921 global common subexpression elimination.  This pass will attempt to move
4922 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
4923 loops containing a load/store sequence can be changed to a load before
4924 the loop and a store after the loop.
4926 Not enabled at any optimization level.
4928 @item -fgcse-las
4929 @opindex fgcse-las
4930 When @option{-fgcse-las} is enabled, the global common subexpression
4931 elimination pass eliminates redundant loads that come after stores to the
4932 same memory location (both partial and full redundancies).
4934 Not enabled at any optimization level.
4936 @item -fgcse-after-reload
4937 @opindex fgcse-after-reload
4938 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
4939 pass is performed after reload.  The purpose of this pass is to cleanup
4940 redundant spilling.
4942 @item -funsafe-loop-optimizations
4943 @opindex funsafe-loop-optimizations
4944 If given, the loop optimizer will assume that loop indices do not
4945 overflow, and that the loops with nontrivial exit condition are not
4946 infinite.  This enables a wider range of loop optimizations even if
4947 the loop optimizer itself cannot prove that these assumptions are valid.
4948 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
4949 if it finds this kind of loop.
4951 @item -fcrossjumping
4952 @opindex crossjumping
4953 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
4954 resulting code may or may not perform better than without cross-jumping.
4956 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4958 @item -fif-conversion
4959 @opindex if-conversion
4960 Attempt to transform conditional jumps into branch-less equivalents.  This
4961 include use of conditional moves, min, max, set flags and abs instructions, and
4962 some tricks doable by standard arithmetics.  The use of conditional execution
4963 on chips where it is available is controlled by @code{if-conversion2}.
4965 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4967 @item -fif-conversion2
4968 @opindex if-conversion2
4969 Use conditional execution (where available) to transform conditional jumps into
4970 branch-less equivalents.
4972 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4974 @item -fdelete-null-pointer-checks
4975 @opindex fdelete-null-pointer-checks
4976 Use global dataflow analysis to identify and eliminate useless checks
4977 for null pointers.  The compiler assumes that dereferencing a null
4978 pointer would have halted the program.  If a pointer is checked after
4979 it has already been dereferenced, it cannot be null.
4981 In some environments, this assumption is not true, and programs can
4982 safely dereference null pointers.  Use
4983 @option{-fno-delete-null-pointer-checks} to disable this optimization
4984 for programs which depend on that behavior.
4986 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4988 @item -fexpensive-optimizations
4989 @opindex fexpensive-optimizations
4990 Perform a number of minor optimizations that are relatively expensive.
4992 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4994 @item -foptimize-register-move
4995 @itemx -fregmove
4996 @opindex foptimize-register-move
4997 @opindex fregmove
4998 Attempt to reassign register numbers in move instructions and as
4999 operands of other simple instructions in order to maximize the amount of
5000 register tying.  This is especially helpful on machines with two-operand
5001 instructions.
5003 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5004 optimization.
5006 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5008 @item -fira
5009 @opindex fira
5010 If supported for the target machine, use the integrated register
5011 allocator (@acronym{IRA}) for the register allocation.
5013 @item -fira-biased-coloring
5014 @opindex fira-biased-coloring
5015 Use biased coloring for the integrated register allocator for possible
5016 improvement of the generated code.  It makes register allocator
5017 slower.
5019 @item -fira-algorithm=@var{algorithm}
5020 Use specified algorithm for the integrated register allocator.  The
5021 @var{algorithm} argument should be one of @code{regional}, @code{CB},
5022 @code{mixed} or @code{priority}.  The second algorithm specifies
5023 Chaitin-Briggs coloring, the fourth one specifies Chow's priority
5024 based coloring, the first one which is the default specifies regional
5025 coloring based on Chaitin-Briggs coloring, and the third one specifies
5026 a mix of Chaitin-Briggs and regional algorithms where loops with small
5027 register pressure are ignored.  The first algorithm is the best for
5028 the generated code quality especially for machines with small or
5029 moderate size register set, the second one is faster and generates
5030 decent code and the smallest size code, the priority-based one is the
5031 fastest one, and the mixed algorithm can give the best result in some
5032 cases.
5034 @item -fno-ira-assign-after-call-split
5035 @opindex fno-ira-assign-after-call-split
5036 Switch off additional assignment after splitting pseudos around calls.
5037 After splitting pseudos there is a chance that spilled pseudos
5038 conflicting with the new pseudos living through calls gets a hard
5039 register.
5041 @item -fira-ipra
5042 @opindex fira-ipra
5043 Switch on a simple form of inter-procedural register allocation when
5044 the integrated register allocator (@acronym{IRA}) is used.
5046 @item -fira-propagate-cost
5047 @opindex -fira-propagate-cost
5048 This is an experimental option used to propagate hard reg costs down
5049 to nested regions for regional or mixed ira allocation algorithm.
5051 @item -fno-ira-move-spills
5052 @opindex fno-ira-move-spills
5053 Switch off increasing gap between the corresponding save and restore
5054 insns.  All saves and the corresponding restores of call used hard
5055 registers living through a call will be in the same basic block.
5057 @item -fno-ira-share-save-slots
5058 @opindex fno-ira-share-save-slots
5059 Switch off sharing stack slots used for saving call used hard
5060 registers living through a call.  Each hard register will get a
5061 separate stack slot and as a result function stack frame will be
5062 bigger.
5064 @item -fno-ira-share-spill-slots
5065 @opindex fno-ira-share-spill-slots
5066 Switch off sharing stack slots allocated for pseudo-registers.  Each
5067 pseudo-register which did not get a hard register will get a separate
5068 stack slot and as a result function stack frame will be bigger.
5070 @item -fno-ira-split-around-calls
5071 @opindex fno-ira-split-around-calls
5072 Switch off splitting pseudos around calls before the reload.  By
5073 default save restore insns are generated by splitting pseudos around
5074 the calls in the integrated register allocator instead of the reload.
5076 @item -fdelayed-branch
5077 @opindex fdelayed-branch
5078 If supported for the target machine, attempt to reorder instructions
5079 to exploit instruction slots available after delayed branch
5080 instructions.
5082 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5084 @item -fschedule-insns
5085 @opindex fschedule-insns
5086 If supported for the target machine, attempt to reorder instructions to
5087 eliminate execution stalls due to required data being unavailable.  This
5088 helps machines that have slow floating point or memory load instructions
5089 by allowing other instructions to be issued until the result of the load
5090 or floating point instruction is required.
5092 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5094 @item -fschedule-insns2
5095 @opindex fschedule-insns2
5096 Similar to @option{-fschedule-insns}, but requests an additional pass of
5097 instruction scheduling after register allocation has been done.  This is
5098 especially useful on machines with a relatively small number of
5099 registers and where memory load instructions take more than one cycle.
5101 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5103 @item -fno-sched-interblock
5104 @opindex fno-sched-interblock
5105 Don't schedule instructions across basic blocks.  This is normally
5106 enabled by default when scheduling before register allocation, i.e.@:
5107 with @option{-fschedule-insns} or at @option{-O2} or higher.
5109 @item -fno-sched-spec
5110 @opindex fno-sched-spec
5111 Don't allow speculative motion of non-load instructions.  This is normally
5112 enabled by default when scheduling before register allocation, i.e.@:
5113 with @option{-fschedule-insns} or at @option{-O2} or higher.
5115 @item -fsched-spec-load
5116 @opindex fsched-spec-load
5117 Allow speculative motion of some load instructions.  This only makes
5118 sense when scheduling before register allocation, i.e.@: with
5119 @option{-fschedule-insns} or at @option{-O2} or higher.
5121 @item -fsched-spec-load-dangerous
5122 @opindex fsched-spec-load-dangerous
5123 Allow speculative motion of more load instructions.  This only makes
5124 sense when scheduling before register allocation, i.e.@: with
5125 @option{-fschedule-insns} or at @option{-O2} or higher.
5127 @item -fsched-stalled-insns=@var{n}
5128 @opindex fsched-stalled-insns
5129 Define how many insns (if any) can be moved prematurely from the queue
5130 of stalled insns into the ready list, during the second scheduling pass.
5132 @item -fsched-stalled-insns-dep=@var{n}
5133 @opindex fsched-stalled-insns-dep
5134 Define how many insn groups (cycles) will be examined for a dependency
5135 on a stalled insn that is candidate for premature removal from the queue
5136 of stalled insns.  Has an effect only during the second scheduling pass,
5137 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5139 @item -fsched2-use-superblocks
5140 @opindex fsched2-use-superblocks
5141 When scheduling after register allocation, do use superblock scheduling
5142 algorithm.  Superblock scheduling allows motion across basic block boundaries
5143 resulting on faster schedules.  This option is experimental, as not all machine
5144 descriptions used by GCC model the CPU closely enough to avoid unreliable
5145 results from the algorithm.
5147 This only makes sense when scheduling after register allocation, i.e.@: with
5148 @option{-fschedule-insns2} or at @option{-O2} or higher.
5150 @item -fsched2-use-traces
5151 @opindex fsched2-use-traces
5152 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5153 allocation and additionally perform code duplication in order to increase the
5154 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5155 trace formation.
5157 This mode should produce faster but significantly longer programs.  Also
5158 without @option{-fbranch-probabilities} the traces constructed may not
5159 match the reality and hurt the performance.  This only makes
5160 sense when scheduling after register allocation, i.e.@: with
5161 @option{-fschedule-insns2} or at @option{-O2} or higher.
5163 @item -fsee
5164 @opindex fsee
5165 Eliminates redundant extension instructions and move the non redundant
5166 ones to optimal placement using LCM.
5168 @item -freschedule-modulo-scheduled-loops
5169 @opindex fscheduling-in-modulo-scheduled-loops
5170 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5171 we may want to prevent the later scheduling passes from changing its schedule, we use this
5172 option to control that.
5174 @item -fcaller-saves
5175 @opindex fcaller-saves
5176 Enable values to be allocated in registers that will be clobbered by
5177 function calls, by emitting extra instructions to save and restore the
5178 registers around such calls.  Such allocation is done only when it
5179 seems to result in better code than would otherwise be produced.
5181 This option is always enabled by default on certain machines, usually
5182 those which have no call-preserved registers to use instead.
5184 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5186 @item -ftree-pre
5187 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5188 enabled by default at @option{-O2} and @option{-O3}.
5190 @item -ftree-fre
5191 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5192 between FRE and PRE is that FRE only considers expressions
5193 that are computed on all paths leading to the redundant computation.
5194 This analysis faster than PRE, though it exposes fewer redundancies.
5195 This flag is enabled by default at @option{-O} and higher.
5197 @item -ftree-copy-prop
5198 Perform copy propagation on trees.  This pass eliminates unnecessary
5199 copy operations.  This flag is enabled by default at @option{-O} and
5200 higher.
5202 @item -ftree-store-copy-prop
5203 Perform copy propagation of memory loads and stores.  This pass
5204 eliminates unnecessary copy operations in memory references
5205 (structures, global variables, arrays, etc).  This flag is enabled by
5206 default at @option{-O2} and higher.
5208 @item -ftree-salias
5209 Perform structural alias analysis on trees.  This flag
5210 is enabled by default at @option{-O} and higher.
5212 @item -fipa-pta
5213 Perform interprocedural pointer analysis.
5215 @item -ftree-sink
5216 Perform forward store motion  on trees.  This flag is
5217 enabled by default at @option{-O} and higher.
5219 @item -ftree-ccp
5220 Perform sparse conditional constant propagation (CCP) on trees.  This
5221 pass only operates on local scalar variables and is enabled by default
5222 at @option{-O} and higher.
5224 @item -ftree-store-ccp
5225 Perform sparse conditional constant propagation (CCP) on trees.  This
5226 pass operates on both local scalar variables and memory stores and
5227 loads (global variables, structures, arrays, etc).  This flag is
5228 enabled by default at @option{-O2} and higher.
5230 @item -ftree-dce
5231 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5232 default at @option{-O} and higher.
5234 @item -ftree-dominator-opts
5235 Perform a variety of simple scalar cleanups (constant/copy
5236 propagation, redundancy elimination, range propagation and expression
5237 simplification) based on a dominator tree traversal.  This also
5238 performs jump threading (to reduce jumps to jumps). This flag is
5239 enabled by default at @option{-O} and higher.
5241 @item -ftree-ch
5242 Perform loop header copying on trees.  This is beneficial since it increases
5243 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5244 is enabled by default at @option{-O} and higher.  It is not enabled
5245 for @option{-Os}, since it usually increases code size.
5247 @item -ftree-loop-optimize
5248 Perform loop optimizations on trees.  This flag is enabled by default
5249 at @option{-O} and higher.
5251 @item -ftree-loop-linear
5252 Perform linear loop transformations on tree.  This flag can improve cache
5253 performance and allow further loop optimizations to take place.
5255 @item -ftree-loop-im
5256 Perform loop invariant motion on trees.  This pass moves only invariants that
5257 would be hard to handle at RTL level (function calls, operations that expand to
5258 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5259 operands of conditions that are invariant out of the loop, so that we can use
5260 just trivial invariantness analysis in loop unswitching.  The pass also includes
5261 store motion.
5263 @item -ftree-loop-ivcanon
5264 Create a canonical counter for number of iterations in the loop for that
5265 determining number of iterations requires complicated analysis.  Later
5266 optimizations then may determine the number easily.  Useful especially
5267 in connection with unrolling.
5269 @item -fivopts
5270 Perform induction variable optimizations (strength reduction, induction
5271 variable merging and induction variable elimination) on trees.
5273 @item -ftree-sra
5274 Perform scalar replacement of aggregates.  This pass replaces structure
5275 references with scalars to prevent committing structures to memory too
5276 early.  This flag is enabled by default at @option{-O} and higher.
5278 @item -ftree-copyrename
5279 Perform copy renaming on trees.  This pass attempts to rename compiler
5280 temporaries to other variables at copy locations, usually resulting in
5281 variable names which more closely resemble the original variables.  This flag
5282 is enabled by default at @option{-O} and higher.
5284 @item -ftree-ter
5285 Perform temporary expression replacement during the SSA->normal phase.  Single
5286 use/single def temporaries are replaced at their use location with their
5287 defining expression.  This results in non-GIMPLE code, but gives the expanders
5288 much more complex trees to work on resulting in better RTL generation.  This is
5289 enabled by default at @option{-O} and higher.
5291 @item -ftree-lrs
5292 Perform live range splitting during the SSA->normal phase.  Distinct live
5293 ranges of a variable are split into unique variables, allowing for better
5294 optimization later.  This is enabled by default at @option{-O} and higher.
5296 @item -ftree-vectorize
5297 Perform loop vectorization on trees.
5299 @item -ftree-vect-loop-version
5300 @opindex ftree-vect-loop-version
5301 Perform loop versioning when doing loop vectorization on trees.  When a loop
5302 appears to be vectorizable except that data alignment or data dependence cannot
5303 be determined at compile time then vectorized and non-vectorized versions of
5304 the loop are generated along with runtime checks for alignment or dependence
5305 to control which version is executed.  This option is enabled by default
5306 except at level @option{-Os} where it is disabled.
5308 @item -ftree-vrp
5309 Perform Value Range Propagation on trees.  This is similar to the
5310 constant propagation pass, but instead of values, ranges of values are
5311 propagated.  This allows the optimizers to remove unnecessary range
5312 checks like array bound checks and null pointer checks.  This is
5313 enabled by default at @option{-O2} and higher.  Null pointer check
5314 elimination is only done if @option{-fdelete-null-pointer-checks} is
5315 enabled.
5317 @item -ftracer
5318 @opindex ftracer
5319 Perform tail duplication to enlarge superblock size.  This transformation
5320 simplifies the control flow of the function allowing other optimizations to do
5321 better job.
5323 @item -funroll-loops
5324 @opindex funroll-loops
5325 Unroll loops whose number of iterations can be determined at compile
5326 time or upon entry to the loop.  @option{-funroll-loops} implies
5327 @option{-frerun-cse-after-loop}.  This option makes code larger,
5328 and may or may not make it run faster.
5330 @item -funroll-all-loops
5331 @opindex funroll-all-loops
5332 Unroll all loops, even if their number of iterations is uncertain when
5333 the loop is entered.  This usually makes programs run more slowly.
5334 @option{-funroll-all-loops} implies the same options as
5335 @option{-funroll-loops},
5337 @item -fsplit-ivs-in-unroller
5338 @opindex -fsplit-ivs-in-unroller
5339 Enables expressing of values of induction variables in later iterations
5340 of the unrolled loop using the value in the first iteration.  This breaks
5341 long dependency chains, thus improving efficiency of the scheduling passes.
5343 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5344 same effect.  However in cases the loop body is more complicated than
5345 a single basic block, this is not reliable.  It also does not work at all
5346 on some of the architectures due to restrictions in the CSE pass.
5348 This optimization is enabled by default.
5350 @item -fvariable-expansion-in-unroller
5351 @opindex -fvariable-expansion-in-unroller
5352 With this option, the compiler will create multiple copies of some
5353 local variables when unrolling a loop which can result in superior code.
5355 @item -fprefetch-loop-arrays
5356 @opindex fprefetch-loop-arrays
5357 If supported by the target machine, generate instructions to prefetch
5358 memory to improve the performance of loops that access large arrays.
5360 This option may generate better or worse code; results are highly
5361 dependent on the structure of loops within the source code.
5363 Disabled at level @option{-Os}.
5365 @item -fno-peephole
5366 @itemx -fno-peephole2
5367 @opindex fno-peephole
5368 @opindex fno-peephole2
5369 Disable any machine-specific peephole optimizations.  The difference
5370 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5371 are implemented in the compiler; some targets use one, some use the
5372 other, a few use both.
5374 @option{-fpeephole} is enabled by default.
5375 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5377 @item -fno-guess-branch-probability
5378 @opindex fno-guess-branch-probability
5379 Do not guess branch probabilities using heuristics.
5381 GCC will use heuristics to guess branch probabilities if they are
5382 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5383 heuristics are based on the control flow graph.  If some branch probabilities
5384 are specified by @samp{__builtin_expect}, then the heuristics will be
5385 used to guess branch probabilities for the rest of the control flow graph,
5386 taking the @samp{__builtin_expect} info into account.  The interactions
5387 between the heuristics and @samp{__builtin_expect} can be complex, and in
5388 some cases, it may be useful to disable the heuristics so that the effects
5389 of @samp{__builtin_expect} are easier to understand.
5391 The default is @option{-fguess-branch-probability} at levels
5392 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5394 @item -freorder-blocks
5395 @opindex freorder-blocks
5396 Reorder basic blocks in the compiled function in order to reduce number of
5397 taken branches and improve code locality.
5399 Enabled at levels @option{-O2}, @option{-O3}.
5401 @item -freorder-blocks-and-partition
5402 @opindex freorder-blocks-and-partition
5403 In addition to reordering basic blocks in the compiled function, in order
5404 to reduce number of taken branches, partitions hot and cold basic blocks
5405 into separate sections of the assembly and .o files, to improve
5406 paging and cache locality performance.
5408 This optimization is automatically turned off in the presence of
5409 exception handling, for linkonce sections, for functions with a user-defined
5410 section attribute and on any architecture that does not support named
5411 sections.
5413 @item -freorder-functions
5414 @opindex freorder-functions
5415 Reorder functions in the object file in order to
5416 improve code locality.  This is implemented by using special
5417 subsections @code{.text.hot} for most frequently executed functions and
5418 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5419 the linker so object file format must support named sections and linker must
5420 place them in a reasonable way.
5422 Also profile feedback must be available in to make this option effective.  See
5423 @option{-fprofile-arcs} for details.
5425 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5427 @item -fstrict-aliasing
5428 @opindex fstrict-aliasing
5429 Allows the compiler to assume the strictest aliasing rules applicable to
5430 the language being compiled.  For C (and C++), this activates
5431 optimizations based on the type of expressions.  In particular, an
5432 object of one type is assumed never to reside at the same address as an
5433 object of a different type, unless the types are almost the same.  For
5434 example, an @code{unsigned int} can alias an @code{int}, but not a
5435 @code{void*} or a @code{double}.  A character type may alias any other
5436 type.
5438 Pay special attention to code like this:
5439 @smallexample
5440 union a_union @{
5441   int i;
5442   double d;
5445 int f() @{
5446   a_union t;
5447   t.d = 3.0;
5448   return t.i;
5450 @end smallexample
5451 The practice of reading from a different union member than the one most
5452 recently written to (called ``type-punning'') is common.  Even with
5453 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5454 is accessed through the union type.  So, the code above will work as
5455 expected.  However, this code might not:
5456 @smallexample
5457 int f() @{
5458   a_union t;
5459   int* ip;
5460   t.d = 3.0;
5461   ip = &t.i;
5462   return *ip;
5464 @end smallexample
5466 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5468 @item -falign-functions
5469 @itemx -falign-functions=@var{n}
5470 @opindex falign-functions
5471 Align the start of functions to the next power-of-two greater than
5472 @var{n}, skipping up to @var{n} bytes.  For instance,
5473 @option{-falign-functions=32} aligns functions to the next 32-byte
5474 boundary, but @option{-falign-functions=24} would align to the next
5475 32-byte boundary only if this can be done by skipping 23 bytes or less.
5477 @option{-fno-align-functions} and @option{-falign-functions=1} are
5478 equivalent and mean that functions will not be aligned.
5480 Some assemblers only support this flag when @var{n} is a power of two;
5481 in that case, it is rounded up.
5483 If @var{n} is not specified or is zero, use a machine-dependent default.
5485 Enabled at levels @option{-O2}, @option{-O3}.
5487 @item -falign-labels
5488 @itemx -falign-labels=@var{n}
5489 @opindex falign-labels
5490 Align all branch targets to a power-of-two boundary, skipping up to
5491 @var{n} bytes like @option{-falign-functions}.  This option can easily
5492 make code slower, because it must insert dummy operations for when the
5493 branch target is reached in the usual flow of the code.
5495 @option{-fno-align-labels} and @option{-falign-labels=1} are
5496 equivalent and mean that labels will not be aligned.
5498 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5499 are greater than this value, then their values are used instead.
5501 If @var{n} is not specified or is zero, use a machine-dependent default
5502 which is very likely to be @samp{1}, meaning no alignment.
5504 Enabled at levels @option{-O2}, @option{-O3}.
5506 @item -falign-loops
5507 @itemx -falign-loops=@var{n}
5508 @opindex falign-loops
5509 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5510 like @option{-falign-functions}.  The hope is that the loop will be
5511 executed many times, which will make up for any execution of the dummy
5512 operations.
5514 @option{-fno-align-loops} and @option{-falign-loops=1} are
5515 equivalent and mean that loops will not be aligned.
5517 If @var{n} is not specified or is zero, use a machine-dependent default.
5519 Enabled at levels @option{-O2}, @option{-O3}.
5521 @item -falign-jumps
5522 @itemx -falign-jumps=@var{n}
5523 @opindex falign-jumps
5524 Align branch targets to a power-of-two boundary, for branch targets
5525 where the targets can only be reached by jumping, skipping up to @var{n}
5526 bytes like @option{-falign-functions}.  In this case, no dummy operations
5527 need be executed.
5529 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5530 equivalent and mean that loops will not be aligned.
5532 If @var{n} is not specified or is zero, use a machine-dependent default.
5534 Enabled at levels @option{-O2}, @option{-O3}.
5536 @item -funit-at-a-time
5537 @opindex funit-at-a-time
5538 Parse the whole compilation unit before starting to produce code.
5539 This allows some extra optimizations to take place but consumes
5540 more memory (in general).  There are some compatibility issues
5541 with @emph{unit-at-a-time} mode:
5542 @itemize @bullet
5543 @item
5544 enabling @emph{unit-at-a-time} mode may change the order
5545 in which functions, variables, and top-level @code{asm} statements
5546 are emitted, and will likely break code relying on some particular
5547 ordering.  The majority of such top-level @code{asm} statements,
5548 though, can be replaced by @code{section} attributes.  The
5549 @option{fno-toplevel-reorder} option may be used to keep the ordering
5550 used in the input file, at the cost of some optimizations.
5552 @item
5553 @emph{unit-at-a-time} mode removes unreferenced static variables
5554 and functions.  This may result in undefined references
5555 when an @code{asm} statement refers directly to variables or functions
5556 that are otherwise unused.  In that case either the variable/function
5557 shall be listed as an operand of the @code{asm} statement operand or,
5558 in the case of top-level @code{asm} statements the attribute @code{used}
5559 shall be used on the declaration.
5561 @item
5562 Static functions now can use non-standard passing conventions that
5563 may break @code{asm} statements calling functions directly.  Again,
5564 attribute @code{used} will prevent this behavior.
5565 @end itemize
5567 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5568 but this scheme may not be supported by future releases of GCC@.
5570 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5572 @item -fno-toplevel-reorder
5573 Do not reorder top-level functions, variables, and @code{asm}
5574 statements.  Output them in the same order that they appear in the
5575 input file.  When this option is used, unreferenced static variables
5576 will not be removed.  This option is intended to support existing code
5577 which relies on a particular ordering.  For new code, it is better to
5578 use attributes.
5580 @item -fweb
5581 @opindex fweb
5582 Constructs webs as commonly used for register allocation purposes and assign
5583 each web individual pseudo register.  This allows the register allocation pass
5584 to operate on pseudos directly, but also strengthens several other optimization
5585 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5586 however, make debugging impossible, since variables will no longer stay in a
5587 ``home register''.
5589 Enabled by default with @option{-funroll-loops}.
5591 @item -fwhole-program
5592 @opindex fwhole-program
5593 Assume that the current compilation unit represents whole program being
5594 compiled.  All public functions and variables with the exception of @code{main}
5595 and those merged by attribute @code{externally_visible} become static functions
5596 and in a affect gets more aggressively optimized by interprocedural optimizers.
5597 While this option is equivalent to proper use of @code{static} keyword for
5598 programs consisting of single file, in combination with option
5599 @option{--combine} this flag can be used to compile most of smaller scale C
5600 programs since the functions and variables become local for the whole combined
5601 compilation unit, not for the single source file itself.
5604 @item -fno-cprop-registers
5605 @opindex fno-cprop-registers
5606 After register allocation and post-register allocation instruction splitting,
5607 we perform a copy-propagation pass to try to reduce scheduling dependencies
5608 and occasionally eliminate the copy.
5610 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5612 @item -fprofile-generate
5613 @opindex fprofile-generate
5615 Enable options usually used for instrumenting application to produce
5616 profile useful for later recompilation with profile feedback based
5617 optimization.  You must use @option{-fprofile-generate} both when
5618 compiling and when linking your program.
5620 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5622 @item -fprofile-use
5623 @opindex fprofile-use
5624 Enable profile feedback directed optimizations, and optimizations
5625 generally profitable only with profile feedback available.
5627 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5628 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
5630 @end table
5632 The following options control compiler behavior regarding floating
5633 point arithmetic.  These options trade off between speed and
5634 correctness.  All must be specifically enabled.
5636 @table @gcctabopt
5637 @item -ffloat-store
5638 @opindex ffloat-store
5639 Do not store floating point variables in registers, and inhibit other
5640 options that might change whether a floating point value is taken from a
5641 register or memory.
5643 @cindex floating point precision
5644 This option prevents undesirable excess precision on machines such as
5645 the 68000 where the floating registers (of the 68881) keep more
5646 precision than a @code{double} is supposed to have.  Similarly for the
5647 x86 architecture.  For most programs, the excess precision does only
5648 good, but a few programs rely on the precise definition of IEEE floating
5649 point.  Use @option{-ffloat-store} for such programs, after modifying
5650 them to store all pertinent intermediate computations into variables.
5652 @item -ffast-math
5653 @opindex ffast-math
5654 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5655 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5656 @option{-fno-rounding-math}, @option{-fno-signaling-nans}
5657 and @option{fcx-limited-range}.
5659 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5661 This option should never be turned on by any @option{-O} option since
5662 it can result in incorrect output for programs which depend on
5663 an exact implementation of IEEE or ISO rules/specifications for
5664 math functions.
5666 @item -fno-math-errno
5667 @opindex fno-math-errno
5668 Do not set ERRNO after calling math functions that are executed
5669 with a single instruction, e.g., sqrt.  A program that relies on
5670 IEEE exceptions for math error handling may want to use this flag
5671 for speed while maintaining IEEE arithmetic compatibility.
5673 This option should never be turned on by any @option{-O} option since
5674 it can result in incorrect output for programs which depend on
5675 an exact implementation of IEEE or ISO rules/specifications for
5676 math functions.
5678 The default is @option{-fmath-errno}.
5680 On Darwin systems, the math library never sets @code{errno}.  There is therefore
5681 no reason for the compiler to consider the possibility that it might,
5682 and @option{-fno-math-errno} is the default.
5684 @item -funsafe-math-optimizations
5685 @opindex funsafe-math-optimizations
5686 Allow optimizations for floating-point arithmetic that (a) assume
5687 that arguments and results are valid and (b) may violate IEEE or
5688 ANSI standards.  When used at link-time, it may include libraries
5689 or startup files that change the default FPU control word or other
5690 similar optimizations.
5692 This option should never be turned on by any @option{-O} option since
5693 it can result in incorrect output for programs which depend on
5694 an exact implementation of IEEE or ISO rules/specifications for
5695 math functions.
5697 The default is @option{-fno-unsafe-math-optimizations}.
5699 @item -ffinite-math-only
5700 @opindex ffinite-math-only
5701 Allow optimizations for floating-point arithmetic that assume
5702 that arguments and results are not NaNs or +-Infs.
5704 This option should never be turned on by any @option{-O} option since
5705 it can result in incorrect output for programs which depend on
5706 an exact implementation of IEEE or ISO rules/specifications.
5708 The default is @option{-fno-finite-math-only}.
5710 @item -fno-trapping-math
5711 @opindex fno-trapping-math
5712 Compile code assuming that floating-point operations cannot generate
5713 user-visible traps.  These traps include division by zero, overflow,
5714 underflow, inexact result and invalid operation.  This option implies
5715 @option{-fno-signaling-nans}.  Setting this option may allow faster
5716 code if one relies on ``non-stop'' IEEE arithmetic, for example.
5718 This option should never be turned on by any @option{-O} option since
5719 it can result in incorrect output for programs which depend on
5720 an exact implementation of IEEE or ISO rules/specifications for
5721 math functions.
5723 The default is @option{-ftrapping-math}.
5725 @item -frounding-math
5726 @opindex frounding-math
5727 Disable transformations and optimizations that assume default floating
5728 point rounding behavior.  This is round-to-zero for all floating point
5729 to integer conversions, and round-to-nearest for all other arithmetic
5730 truncations.  This option should be specified for programs that change
5731 the FP rounding mode dynamically, or that may be executed with a
5732 non-default rounding mode.  This option disables constant folding of
5733 floating point expressions at compile-time (which may be affected by
5734 rounding mode) and arithmetic transformations that are unsafe in the
5735 presence of sign-dependent rounding modes.
5737 The default is @option{-fno-rounding-math}.
5739 This option is experimental and does not currently guarantee to
5740 disable all GCC optimizations that are affected by rounding mode.
5741 Future versions of GCC may provide finer control of this setting
5742 using C99's @code{FENV_ACCESS} pragma.  This command line option
5743 will be used to specify the default state for @code{FENV_ACCESS}.
5745 @item -frtl-abstract-sequences
5746 @opindex frtl-abstract-sequences
5747 It is a size optimization method. This option is to find identical
5748 sequences of code, which can be turned into pseudo-procedures  and
5749 then  replace  all  occurrences with  calls to  the  newly created
5750 subroutine. It is kind of an opposite of @option{-finline-functions}.
5751 This optimization runs at RTL level.
5753 @item -fsignaling-nans
5754 @opindex fsignaling-nans
5755 Compile code assuming that IEEE signaling NaNs may generate user-visible
5756 traps during floating-point operations.  Setting this option disables
5757 optimizations that may change the number of exceptions visible with
5758 signaling NaNs.  This option implies @option{-ftrapping-math}.
5760 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
5761 be defined.
5763 The default is @option{-fno-signaling-nans}.
5765 This option is experimental and does not currently guarantee to
5766 disable all GCC optimizations that affect signaling NaN behavior.
5768 @item -fsingle-precision-constant
5769 @opindex fsingle-precision-constant
5770 Treat floating point constant as single precision constant instead of
5771 implicitly converting it to double precision constant.
5773 @item -fcx-limited-range
5774 @itemx -fno-cx-limited-range
5775 @opindex fcx-limited-range
5776 @opindex fno-cx-limited-range
5777 When enabled, this option states that a range reduction step is not
5778 needed when performing complex division.  The default is
5779 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
5781 This option controls the default setting of the ISO C99 
5782 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
5783 all languages.
5785 @end table
5787 The following options control optimizations that may improve
5788 performance, but are not enabled by any @option{-O} options.  This
5789 section includes experimental options that may produce broken code.
5791 @table @gcctabopt
5792 @item -fbranch-probabilities
5793 @opindex fbranch-probabilities
5794 After running a program compiled with @option{-fprofile-arcs}
5795 (@pxref{Debugging Options,, Options for Debugging Your Program or
5796 @command{gcc}}), you can compile it a second time using
5797 @option{-fbranch-probabilities}, to improve optimizations based on
5798 the number of times each branch was taken.  When the program
5799 compiled with @option{-fprofile-arcs} exits it saves arc execution
5800 counts to a file called @file{@var{sourcename}.gcda} for each source
5801 file  The information in this data file is very dependent on the
5802 structure of the generated code, so you must use the same source code
5803 and the same optimization options for both compilations.
5805 With @option{-fbranch-probabilities}, GCC puts a
5806 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
5807 These can be used to improve optimization.  Currently, they are only
5808 used in one place: in @file{reorg.c}, instead of guessing which path a
5809 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
5810 exactly determine which path is taken more often.
5812 @item -fprofile-values
5813 @opindex fprofile-values
5814 If combined with @option{-fprofile-arcs}, it adds code so that some
5815 data about values of expressions in the program is gathered.
5817 With @option{-fbranch-probabilities}, it reads back the data gathered
5818 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
5819 notes to instructions for their later usage in optimizations.
5821 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
5823 @item -fvpt
5824 @opindex fvpt
5825 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
5826 a code to gather information about values of expressions.
5828 With @option{-fbranch-probabilities}, it reads back the data gathered
5829 and actually performs the optimizations based on them.
5830 Currently the optimizations include specialization of division operation
5831 using the knowledge about the value of the denominator.
5833 @item -frename-registers
5834 @opindex frename-registers
5835 Attempt to avoid false dependencies in scheduled code by making use
5836 of registers left over after register allocation.  This optimization
5837 will most benefit processors with lots of registers.  Depending on the
5838 debug information format adopted by the target, however, it can
5839 make debugging impossible, since variables will no longer stay in
5840 a ``home register''.
5842 Enabled by default with @option{-funroll-loops}.
5844 @item -ftracer
5845 @opindex ftracer
5846 Perform tail duplication to enlarge superblock size.  This transformation
5847 simplifies the control flow of the function allowing other optimizations to do
5848 better job.
5850 Enabled with @option{-fprofile-use}.
5852 @item -funroll-loops
5853 @opindex funroll-loops
5854 Unroll loops whose number of iterations can be determined at compile time or
5855 upon entry to the loop.  @option{-funroll-loops} implies
5856 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}. 
5857 It also turns on complete loop peeling (i.e.@: complete removal of loops with
5858 small constant number of iterations).  This option makes code larger, and may
5859 or may not make it run faster.
5861 Enabled with @option{-fprofile-use}.
5863 @item -funroll-all-loops
5864 @opindex funroll-all-loops
5865 Unroll all loops, even if their number of iterations is uncertain when
5866 the loop is entered.  This usually makes programs run more slowly.
5867 @option{-funroll-all-loops} implies the same options as
5868 @option{-funroll-loops}.
5870 @item -fpeel-loops
5871 @opindex fpeel-loops
5872 Peels the loops for that there is enough information that they do not
5873 roll much (from profile feedback).  It also turns on complete loop peeling
5874 (i.e.@: complete removal of loops with small constant number of iterations).
5876 Enabled with @option{-fprofile-use}.
5878 @item -fmove-loop-invariants
5879 @opindex fmove-loop-invariants
5880 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
5881 at level @option{-O1}
5883 @item -funswitch-loops
5884 @opindex funswitch-loops
5885 Move branches with loop invariant conditions out of the loop, with duplicates
5886 of the loop on both branches (modified according to result of the condition).
5888 @item -ffunction-sections
5889 @itemx -fdata-sections
5890 @opindex ffunction-sections
5891 @opindex fdata-sections
5892 Place each function or data item into its own section in the output
5893 file if the target supports arbitrary sections.  The name of the
5894 function or the name of the data item determines the section's name
5895 in the output file.
5897 Use these options on systems where the linker can perform optimizations
5898 to improve locality of reference in the instruction space.  Most systems
5899 using the ELF object format and SPARC processors running Solaris 2 have
5900 linkers with such optimizations.  AIX may have these optimizations in
5901 the future.
5903 Only use these options when there are significant benefits from doing
5904 so.  When you specify these options, the assembler and linker will
5905 create larger object and executable files and will also be slower.
5906 You will not be able to use @code{gprof} on all systems if you
5907 specify this option and you may have problems with debugging if
5908 you specify both this option and @option{-g}.
5910 @item -fbranch-target-load-optimize
5911 @opindex fbranch-target-load-optimize
5912 Perform branch target register load optimization before prologue / epilogue
5913 threading.
5914 The use of target registers can typically be exposed only during reload,
5915 thus hoisting loads out of loops and doing inter-block scheduling needs
5916 a separate optimization pass.
5918 @item -fbranch-target-load-optimize2
5919 @opindex fbranch-target-load-optimize2
5920 Perform branch target register load optimization after prologue / epilogue
5921 threading.
5923 @item -fbtr-bb-exclusive
5924 @opindex fbtr-bb-exclusive
5925 When performing branch target register load optimization, don't reuse
5926 branch target registers in within any basic block.
5928 @item -fstack-protector
5929 Emit extra code to check for buffer overflows, such as stack smashing
5930 attacks.  This is done by adding a guard variable to functions with
5931 vulnerable objects.  This includes functions that call alloca, and
5932 functions with buffers larger than 8 bytes.  The guards are initialized
5933 when a function is entered and then checked when the function exits.
5934 If a guard check fails, an error message is printed and the program exits.
5936 @item -fstack-protector-all
5937 Like @option{-fstack-protector} except that all functions are protected.
5939 @item -fsection-anchors
5940 @opindex fsection-anchors
5941 Try to reduce the number of symbolic address calculations by using
5942 shared ``anchor'' symbols to address nearby objects.  This transformation
5943 can help to reduce the number of GOT entries and GOT accesses on some
5944 targets.
5946 For example, the implementation of the following function @code{foo}:
5948 @smallexample
5949 static int a, b, c;
5950 int foo (void) @{ return a + b + c; @}
5951 @end smallexample
5953 would usually calculate the addresses of all three variables, but if you
5954 compile it with @option{-fsection-anchors}, it will access the variables
5955 from a common anchor point instead.  The effect is similar to the
5956 following pseudocode (which isn't valid C):
5958 @smallexample
5959 int foo (void)
5961   register int *xr = &x;
5962   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
5964 @end smallexample
5966 Not all targets support this option.
5968 @item --param @var{name}=@var{value}
5969 @opindex param
5970 In some places, GCC uses various constants to control the amount of
5971 optimization that is done.  For example, GCC will not inline functions
5972 that contain more that a certain number of instructions.  You can
5973 control some of these constants on the command-line using the
5974 @option{--param} option.
5976 The names of specific parameters, and the meaning of the values, are
5977 tied to the internals of the compiler, and are subject to change
5978 without notice in future releases.
5980 In each case, the @var{value} is an integer.  The allowable choices for
5981 @var{name} are given in the following table:
5983 @table @gcctabopt
5984 @item salias-max-implicit-fields
5985 The maximum number of fields in a variable without direct
5986 structure accesses for which structure aliasing will consider trying 
5987 to track each field.  The default is 5
5989 @item salias-max-array-elements
5990 The maximum number of elements an array can have and its elements
5991 still be tracked individually by structure aliasing. The default is 4
5993 @item sra-max-structure-size
5994 The maximum structure size, in bytes, at which the scalar replacement
5995 of aggregates (SRA) optimization will perform block copies.  The
5996 default value, 0, implies that GCC will select the most appropriate
5997 size itself.
5999 @item sra-field-structure-ratio
6000 The threshold ratio (as a percentage) between instantiated fields and
6001 the complete structure size.  We say that if the ratio of the number
6002 of bytes in instantiated fields to the number of bytes in the complete
6003 structure exceeds this parameter, then block copies are not used.  The
6004 default is 75.
6006 @item max-crossjump-edges
6007 The maximum number of incoming edges to consider for crossjumping.
6008 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6009 the number of edges incoming to each block.  Increasing values mean
6010 more aggressive optimization, making the compile time increase with
6011 probably small improvement in executable size.
6013 @item min-crossjump-insns
6014 The minimum number of instructions which must be matched at the end
6015 of two blocks before crossjumping will be performed on them.  This
6016 value is ignored in the case where all instructions in the block being
6017 crossjumped from are matched.  The default value is 5.
6019 @item max-grow-copy-bb-insns
6020 The maximum code size expansion factor when copying basic blocks
6021 instead of jumping.  The expansion is relative to a jump instruction.
6022 The default value is 8.
6024 @item max-goto-duplication-insns
6025 The maximum number of instructions to duplicate to a block that jumps
6026 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6027 passes, GCC factors computed gotos early in the compilation process,
6028 and unfactors them as late as possible.  Only computed jumps at the
6029 end of a basic blocks with no more than max-goto-duplication-insns are
6030 unfactored.  The default value is 8.
6032 @item max-delay-slot-insn-search
6033 The maximum number of instructions to consider when looking for an
6034 instruction to fill a delay slot.  If more than this arbitrary number of
6035 instructions is searched, the time savings from filling the delay slot
6036 will be minimal so stop searching.  Increasing values mean more
6037 aggressive optimization, making the compile time increase with probably
6038 small improvement in executable run time.
6040 @item max-delay-slot-live-search
6041 When trying to fill delay slots, the maximum number of instructions to
6042 consider when searching for a block with valid live register
6043 information.  Increasing this arbitrarily chosen value means more
6044 aggressive optimization, increasing the compile time.  This parameter
6045 should be removed when the delay slot code is rewritten to maintain the
6046 control-flow graph.
6048 @item max-gcse-memory
6049 The approximate maximum amount of memory that will be allocated in
6050 order to perform the global common subexpression elimination
6051 optimization.  If more memory than specified is required, the
6052 optimization will not be done.
6054 @item max-gcse-passes
6055 The maximum number of passes of GCSE to run.  The default is 1.
6057 @item max-pending-list-length
6058 The maximum number of pending dependencies scheduling will allow
6059 before flushing the current state and starting over.  Large functions
6060 with few branches or calls can create excessively large lists which
6061 needlessly consume memory and resources.
6063 @item max-inline-insns-single
6064 Several parameters control the tree inliner used in gcc.
6065 This number sets the maximum number of instructions (counted in GCC's
6066 internal representation) in a single function that the tree inliner
6067 will consider for inlining.  This only affects functions declared
6068 inline and methods implemented in a class declaration (C++).
6069 The default value is 450.
6071 @item max-inline-insns-auto
6072 When you use @option{-finline-functions} (included in @option{-O3}),
6073 a lot of functions that would otherwise not be considered for inlining
6074 by the compiler will be investigated.  To those functions, a different
6075 (more restrictive) limit compared to functions declared inline can
6076 be applied.
6077 The default value is 90.
6079 @item large-function-insns
6080 The limit specifying really large functions.  For functions larger than this
6081 limit after inlining inlining is constrained by
6082 @option{--param large-function-growth}.  This parameter is useful primarily
6083 to avoid extreme compilation time caused by non-linear algorithms used by the
6084 backend.
6085 This parameter is ignored when @option{-funit-at-a-time} is not used.
6086 The default value is 2700.
6088 @item large-function-growth
6089 Specifies maximal growth of large function caused by inlining in percents.
6090 This parameter is ignored when @option{-funit-at-a-time} is not used.
6091 The default value is 100 which limits large function growth to 2.0 times
6092 the original size.
6094 @item large-unit-insns
6095 The limit specifying large translation unit.  Growth caused by inlining of
6096 units larger than this limit is limited by @option{--param inline-unit-growth}.
6097 For small units this might be too tight (consider unit consisting of function A
6098 that is inline and B that just calls A three time.  If B is small relative to
6099 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6100 large units consisting of small inlininable functions however the overall unit
6101 growth limit is needed to avoid exponential explosion of code size.  Thus for
6102 smaller units, the size is increased to @option{--param large-unit-insns}
6103 before applying @option{--param inline-unit-growth}.  The default is 10000
6105 @item inline-unit-growth
6106 Specifies maximal overall growth of the compilation unit caused by inlining.
6107 This parameter is ignored when @option{-funit-at-a-time} is not used.
6108 The default value is 50 which limits unit growth to 1.5 times the original
6109 size.
6111 @item large-stack-frame
6112 The limit specifying large stack frames.  While inlining the algorithm is trying
6113 to not grow past this limit too much.  Default value is 256 bytes.
6115 @item large-stack-frame-growth
6116 Specifies maximal growth of large stack frames caused by inlining in percents.
6117 The default value is 1000 which limits large stack frame growth to 11 times
6118 the original size.
6120 @item max-inline-insns-recursive
6121 @itemx max-inline-insns-recursive-auto
6122 Specifies maximum number of instructions out-of-line copy of self recursive inline
6123 function can grow into by performing recursive inlining.
6125 For functions declared inline @option{--param max-inline-insns-recursive} is
6126 taken into account.  For function not declared inline, recursive inlining
6127 happens only when @option{-finline-functions} (included in @option{-O3}) is
6128 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6129 default value is 450.
6131 @item max-inline-recursive-depth
6132 @itemx max-inline-recursive-depth-auto
6133 Specifies maximum recursion depth used by the recursive inlining.
6135 For functions declared inline @option{--param max-inline-recursive-depth} is
6136 taken into account.  For function not declared inline, recursive inlining
6137 happens only when @option{-finline-functions} (included in @option{-O3}) is
6138 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6139 default value is 450.
6141 @item min-inline-recursive-probability
6142 Recursive inlining is profitable only for function having deep recursion
6143 in average and can hurt for function having little recursion depth by
6144 increasing the prologue size or complexity of function body to other
6145 optimizers.
6147 When profile feedback is available (see @option{-fprofile-generate}) the actual
6148 recursion depth can be guessed from probability that function will recurse via
6149 given call expression.  This parameter limits inlining only to call expression
6150 whose probability exceeds given threshold (in percents).  The default value is
6153 @item inline-call-cost
6154 Specify cost of call instruction relative to simple arithmetics operations
6155 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6156 functions and at the same time increases size of leaf function that is believed to
6157 reduce function size by being inlined.  In effect it increases amount of
6158 inlining for code having large abstraction penalty (many functions that just
6159 pass the arguments to other functions) and decrease inlining for code with low
6160 abstraction penalty.  The default value is 16.
6162 @item max-unrolled-insns
6163 The maximum number of instructions that a loop should have if that loop
6164 is unrolled, and if the loop is unrolled, it determines how many times
6165 the loop code is unrolled.
6167 @item max-average-unrolled-insns
6168 The maximum number of instructions biased by probabilities of their execution
6169 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6170 it determines how many times the loop code is unrolled.
6172 @item max-unroll-times
6173 The maximum number of unrollings of a single loop.
6175 @item max-peeled-insns
6176 The maximum number of instructions that a loop should have if that loop
6177 is peeled, and if the loop is peeled, it determines how many times
6178 the loop code is peeled.
6180 @item max-peel-times
6181 The maximum number of peelings of a single loop.
6183 @item max-completely-peeled-insns
6184 The maximum number of insns of a completely peeled loop.
6186 @item max-completely-peel-times
6187 The maximum number of iterations of a loop to be suitable for complete peeling.
6189 @item max-unswitch-insns
6190 The maximum number of insns of an unswitched loop.
6192 @item max-unswitch-level
6193 The maximum number of branches unswitched in a single loop.
6195 @item lim-expensive
6196 The minimum cost of an expensive expression in the loop invariant motion.
6198 @item iv-consider-all-candidates-bound
6199 Bound on number of candidates for induction variables below that
6200 all candidates are considered for each use in induction variable
6201 optimizations.  Only the most relevant candidates are considered
6202 if there are more candidates, to avoid quadratic time complexity.
6204 @item iv-max-considered-uses
6205 The induction variable optimizations give up on loops that contain more
6206 induction variable uses.
6208 @item iv-always-prune-cand-set-bound
6209 If number of candidates in the set is smaller than this value,
6210 we always try to remove unnecessary ivs from the set during its
6211 optimization when a new iv is added to the set.
6213 @item scev-max-expr-size
6214 Bound on size of expressions used in the scalar evolutions analyzer.
6215 Large expressions slow the analyzer.
6217 @item vect-max-version-checks
6218 The maximum number of runtime checks that can be performed when doing
6219 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6220 for more information.
6222 @item max-iterations-to-track
6224 The maximum number of iterations of a loop the brute force algorithm
6225 for analysis of # of iterations of the loop tries to evaluate.
6227 @item hot-bb-count-fraction
6228 Select fraction of the maximal count of repetitions of basic block in program
6229 given basic block needs to have to be considered hot.
6231 @item hot-bb-frequency-fraction
6232 Select fraction of the maximal frequency of executions of basic block in
6233 function given basic block needs to have to be considered hot
6235 @item max-predicted-iterations
6236 The maximum number of loop iterations we predict statically.  This is useful
6237 in cases where function contain single loop with known bound and other loop
6238 with unknown.  We predict the known number of iterations correctly, while
6239 the unknown number of iterations average to roughly 10.  This means that the
6240 loop without bounds would appear artificially cold relative to the other one.
6242 @item tracer-dynamic-coverage
6243 @itemx tracer-dynamic-coverage-feedback
6245 This value is used to limit superblock formation once the given percentage of
6246 executed instructions is covered.  This limits unnecessary code size
6247 expansion.
6249 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6250 feedback is available.  The real profiles (as opposed to statically estimated
6251 ones) are much less balanced allowing the threshold to be larger value.
6253 @item tracer-max-code-growth
6254 Stop tail duplication once code growth has reached given percentage.  This is
6255 rather hokey argument, as most of the duplicates will be eliminated later in
6256 cross jumping, so it may be set to much higher values than is the desired code
6257 growth.
6259 @item tracer-min-branch-ratio
6261 Stop reverse growth when the reverse probability of best edge is less than this
6262 threshold (in percent).
6264 @item tracer-min-branch-ratio
6265 @itemx tracer-min-branch-ratio-feedback
6267 Stop forward growth if the best edge do have probability lower than this
6268 threshold.
6270 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6271 compilation for profile feedback and one for compilation without.  The value
6272 for compilation with profile feedback needs to be more conservative (higher) in
6273 order to make tracer effective.
6275 @item max-cse-path-length
6277 Maximum number of basic blocks on path that cse considers.  The default is 10.
6279 @item max-cse-insns
6280 The maximum instructions CSE process before flushing. The default is 1000.
6282 @item max-aliased-vops
6284 Maximum number of virtual operands per statement allowed to represent
6285 aliases before triggering the alias grouping heuristic.  Alias
6286 grouping reduces compile times and memory consumption needed for
6287 aliasing at the expense of precision loss in alias information.
6289 @item ggc-min-expand
6291 GCC uses a garbage collector to manage its own memory allocation.  This
6292 parameter specifies the minimum percentage by which the garbage
6293 collector's heap should be allowed to expand between collections.
6294 Tuning this may improve compilation speed; it has no effect on code
6295 generation.
6297 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6298 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6299 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6300 GCC is not able to calculate RAM on a particular platform, the lower
6301 bound of 30% is used.  Setting this parameter and
6302 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6303 every opportunity.  This is extremely slow, but can be useful for
6304 debugging.
6306 @item ggc-min-heapsize
6308 Minimum size of the garbage collector's heap before it begins bothering
6309 to collect garbage.  The first collection occurs after the heap expands
6310 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6311 tuning this may improve compilation speed, and has no effect on code
6312 generation.
6314 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6315 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6316 with a lower bound of 4096 (four megabytes) and an upper bound of
6317 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6318 particular platform, the lower bound is used.  Setting this parameter
6319 very large effectively disables garbage collection.  Setting this
6320 parameter and @option{ggc-min-expand} to zero causes a full collection
6321 to occur at every opportunity.
6323 @item max-reload-search-insns
6324 The maximum number of instruction reload should look backward for equivalent
6325 register.  Increasing values mean more aggressive optimization, making the
6326 compile time increase with probably slightly better performance.  The default
6327 value is 100.
6329 @item max-cselib-memory-locations
6330 The maximum number of memory locations cselib should take into account.
6331 Increasing values mean more aggressive optimization, making the compile time
6332 increase with probably slightly better performance.  The default value is 500.
6334 @item max-flow-memory-locations
6335 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6336 The default value is 100.
6338 @item reorder-blocks-duplicate
6339 @itemx reorder-blocks-duplicate-feedback
6341 Used by basic block reordering pass to decide whether to use unconditional
6342 branch or duplicate the code on its destination.  Code is duplicated when its
6343 estimated size is smaller than this value multiplied by the estimated size of
6344 unconditional jump in the hot spots of the program.
6346 The @option{reorder-block-duplicate-feedback} is used only when profile
6347 feedback is available and may be set to higher values than
6348 @option{reorder-block-duplicate} since information about the hot spots is more
6349 accurate.
6351 @item max-sched-ready-insns
6352 The maximum number of instructions ready to be issued the scheduler should
6353 consider at any given time during the first scheduling pass.  Increasing
6354 values mean more thorough searches, making the compilation time increase
6355 with probably little benefit.  The default value is 100.
6357 @item max-sched-region-blocks
6358 The maximum number of blocks in a region to be considered for
6359 interblock scheduling.  The default value is 10.
6361 @item max-sched-region-insns
6362 The maximum number of insns in a region to be considered for
6363 interblock scheduling.  The default value is 100.
6365 @item min-spec-prob
6366 The minimum probability (in percents) of reaching a source block
6367 for interblock speculative scheduling.  The default value is 40.
6369 @item max-sched-extend-regions-iters
6370 The maximum number of iterations through CFG to extend regions.
6371 0 - disable region extension,
6372 N - do at most N iterations.
6373 The default value is 0.
6375 @item max-sched-insn-conflict-delay
6376 The maximum conflict delay for an insn to be considered for speculative motion.
6377 The default value is 3.
6379 @item sched-spec-prob-cutoff
6380 The minimal probability of speculation success (in percents), so that
6381 speculative insn will be scheduled.
6382 The default value is 40.
6384 @item max-last-value-rtl
6386 The maximum size measured as number of RTLs that can be recorded in an expression
6387 in combiner for a pseudo register as last known value of that register.  The default
6388 is 10000.
6390 @item integer-share-limit
6391 Small integer constants can use a shared data structure, reducing the
6392 compiler's memory usage and increasing its speed.  This sets the maximum
6393 value of a shared integer constant's.  The default value is 256.
6395 @item min-virtual-mappings
6396 Specifies the minimum number of virtual mappings in the incremental
6397 SSA updater that should be registered to trigger the virtual mappings
6398 heuristic defined by virtual-mappings-ratio.  The default value is
6399 100.
6401 @item virtual-mappings-ratio
6402 If the number of virtual mappings is virtual-mappings-ratio bigger
6403 than the number of virtual symbols to be updated, then the incremental
6404 SSA updater switches to a full update for those symbols.  The default
6405 ratio is 3.
6407 @item ssp-buffer-size
6408 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6409 protection when @option{-fstack-protection} is used.
6411 @item max-jump-thread-duplication-stmts
6412 Maximum number of statements allowed in a block that needs to be
6413 duplicated when threading jumps.
6415 @item max-fields-for-field-sensitive
6416 Maximum number of fields in a structure we will treat in
6417 a field sensitive manner during pointer analysis.
6419 @item prefetch-latency
6420 Estimate on average number of instructions that are executed before
6421 prefetch finishes.  The distance we prefetch ahead is proportional
6422 to this constant.  Increasing this number may also lead to less
6423 streams being prefetched (see @option{simultaneous-prefetches}).
6425 @item simultaneous-prefetches
6426 Maximum number of prefetches that can run at the same time.
6428 @item l1-cache-line-size
6429 The size of cache line in L1 cache, in bytes.
6431 @item l1-cache-size
6432 The number of cache lines in L1 cache.
6434 @end table
6435 @end table
6437 @node Preprocessor Options
6438 @section Options Controlling the Preprocessor
6439 @cindex preprocessor options
6440 @cindex options, preprocessor
6442 These options control the C preprocessor, which is run on each C source
6443 file before actual compilation.
6445 If you use the @option{-E} option, nothing is done except preprocessing.
6446 Some of these options make sense only together with @option{-E} because
6447 they cause the preprocessor output to be unsuitable for actual
6448 compilation.
6450 @table @gcctabopt
6451 @opindex Wp
6452 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6453 and pass @var{option} directly through to the preprocessor.  If
6454 @var{option} contains commas, it is split into multiple options at the
6455 commas.  However, many options are modified, translated or interpreted
6456 by the compiler driver before being passed to the preprocessor, and
6457 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6458 interface is undocumented and subject to change, so whenever possible
6459 you should avoid using @option{-Wp} and let the driver handle the
6460 options instead.
6462 @item -Xpreprocessor @var{option}
6463 @opindex preprocessor
6464 Pass @var{option} as an option to the preprocessor.  You can use this to
6465 supply system-specific preprocessor options which GCC does not know how to
6466 recognize.
6468 If you want to pass an option that takes an argument, you must use
6469 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6470 @end table
6472 @include cppopts.texi
6474 @node Assembler Options
6475 @section Passing Options to the Assembler
6477 @c prevent bad page break with this line
6478 You can pass options to the assembler.
6480 @table @gcctabopt
6481 @item -Wa,@var{option}
6482 @opindex Wa
6483 Pass @var{option} as an option to the assembler.  If @var{option}
6484 contains commas, it is split into multiple options at the commas.
6486 @item -Xassembler @var{option}
6487 @opindex Xassembler
6488 Pass @var{option} as an option to the assembler.  You can use this to
6489 supply system-specific assembler options which GCC does not know how to
6490 recognize.
6492 If you want to pass an option that takes an argument, you must use
6493 @option{-Xassembler} twice, once for the option and once for the argument.
6495 @end table
6497 @node Link Options
6498 @section Options for Linking
6499 @cindex link options
6500 @cindex options, linking
6502 These options come into play when the compiler links object files into
6503 an executable output file.  They are meaningless if the compiler is
6504 not doing a link step.
6506 @table @gcctabopt
6507 @cindex file names
6508 @item @var{object-file-name}
6509 A file name that does not end in a special recognized suffix is
6510 considered to name an object file or library.  (Object files are
6511 distinguished from libraries by the linker according to the file
6512 contents.)  If linking is done, these object files are used as input
6513 to the linker.
6515 @item -c
6516 @itemx -S
6517 @itemx -E
6518 @opindex c
6519 @opindex S
6520 @opindex E
6521 If any of these options is used, then the linker is not run, and
6522 object file names should not be used as arguments.  @xref{Overall
6523 Options}.
6525 @cindex Libraries
6526 @item -l@var{library}
6527 @itemx -l @var{library}
6528 @opindex l
6529 Search the library named @var{library} when linking.  (The second
6530 alternative with the library as a separate argument is only for
6531 POSIX compliance and is not recommended.)
6533 It makes a difference where in the command you write this option; the
6534 linker searches and processes libraries and object files in the order they
6535 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6536 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6537 to functions in @samp{z}, those functions may not be loaded.
6539 The linker searches a standard list of directories for the library,
6540 which is actually a file named @file{lib@var{library}.a}.  The linker
6541 then uses this file as if it had been specified precisely by name.
6543 The directories searched include several standard system directories
6544 plus any that you specify with @option{-L}.
6546 Normally the files found this way are library files---archive files
6547 whose members are object files.  The linker handles an archive file by
6548 scanning through it for members which define symbols that have so far
6549 been referenced but not defined.  But if the file that is found is an
6550 ordinary object file, it is linked in the usual fashion.  The only
6551 difference between using an @option{-l} option and specifying a file name
6552 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6553 and searches several directories.
6555 @item -lobjc
6556 @opindex lobjc
6557 You need this special case of the @option{-l} option in order to
6558 link an Objective-C or Objective-C++ program.
6560 @item -nostartfiles
6561 @opindex nostartfiles
6562 Do not use the standard system startup files when linking.
6563 The standard system libraries are used normally, unless @option{-nostdlib}
6564 or @option{-nodefaultlibs} is used.
6566 @item -nodefaultlibs
6567 @opindex nodefaultlibs
6568 Do not use the standard system libraries when linking.
6569 Only the libraries you specify will be passed to the linker.
6570 The standard startup files are used normally, unless @option{-nostartfiles}
6571 is used.  The compiler may generate calls to @code{memcmp},
6572 @code{memset}, @code{memcpy} and @code{memmove}.
6573 These entries are usually resolved by entries in
6574 libc.  These entry points should be supplied through some other
6575 mechanism when this option is specified.
6577 @item -nostdlib
6578 @opindex nostdlib
6579 Do not use the standard system startup files or libraries when linking.
6580 No startup files and only the libraries you specify will be passed to
6581 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6582 @code{memcpy} and @code{memmove}.
6583 These entries are usually resolved by entries in
6584 libc.  These entry points should be supplied through some other
6585 mechanism when this option is specified.
6587 @cindex @option{-lgcc}, use with @option{-nostdlib}
6588 @cindex @option{-nostdlib} and unresolved references
6589 @cindex unresolved references and @option{-nostdlib}
6590 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6591 @cindex @option{-nodefaultlibs} and unresolved references
6592 @cindex unresolved references and @option{-nodefaultlibs}
6593 One of the standard libraries bypassed by @option{-nostdlib} and
6594 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6595 that GCC uses to overcome shortcomings of particular machines, or special
6596 needs for some languages.
6597 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6598 Collection (GCC) Internals},
6599 for more discussion of @file{libgcc.a}.)
6600 In most cases, you need @file{libgcc.a} even when you want to avoid
6601 other standard libraries.  In other words, when you specify @option{-nostdlib}
6602 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6603 This ensures that you have no unresolved references to internal GCC
6604 library subroutines.  (For example, @samp{__main}, used to ensure C++
6605 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6606 GNU Compiler Collection (GCC) Internals}.)
6608 @item -pie
6609 @opindex pie
6610 Produce a position independent executable on targets which support it.
6611 For predictable results, you must also specify the same set of options
6612 that were used to generate code (@option{-fpie}, @option{-fPIE},
6613 or model suboptions) when you specify this option.
6615 @item -rdynamic
6616 @opindex rdynamic
6617 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6618 that support it. This instructs the linker to add all symbols, not
6619 only used ones, to the dynamic symbol table. This option is needed
6620 for some uses of @code{dlopen} or to allow obtaining backtraces
6621 from within a program.
6623 @item -s
6624 @opindex s
6625 Remove all symbol table and relocation information from the executable.
6627 @item -static
6628 @opindex static
6629 On systems that support dynamic linking, this prevents linking with the shared
6630 libraries.  On other systems, this option has no effect.
6632 @item -shared
6633 @opindex shared
6634 Produce a shared object which can then be linked with other objects to
6635 form an executable.  Not all systems support this option.  For predictable
6636 results, you must also specify the same set of options that were used to
6637 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6638 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6639 needs to build supplementary stub code for constructors to work.  On
6640 multi-libbed systems, @samp{gcc -shared} must select the correct support
6641 libraries to link against.  Failing to supply the correct flags may lead
6642 to subtle defects.  Supplying them in cases where they are not necessary
6643 is innocuous.}
6645 @item -shared-libgcc
6646 @itemx -static-libgcc
6647 @opindex shared-libgcc
6648 @opindex static-libgcc
6649 On systems that provide @file{libgcc} as a shared library, these options
6650 force the use of either the shared or static version respectively.
6651 If no shared version of @file{libgcc} was built when the compiler was
6652 configured, these options have no effect.
6654 There are several situations in which an application should use the
6655 shared @file{libgcc} instead of the static version.  The most common
6656 of these is when the application wishes to throw and catch exceptions
6657 across different shared libraries.  In that case, each of the libraries
6658 as well as the application itself should use the shared @file{libgcc}.
6660 Therefore, the G++ and GCJ drivers automatically add
6661 @option{-shared-libgcc} whenever you build a shared library or a main
6662 executable, because C++ and Java programs typically use exceptions, so
6663 this is the right thing to do.
6665 If, instead, you use the GCC driver to create shared libraries, you may
6666 find that they will not always be linked with the shared @file{libgcc}.
6667 If GCC finds, at its configuration time, that you have a non-GNU linker
6668 or a GNU linker that does not support option @option{--eh-frame-hdr},
6669 it will link the shared version of @file{libgcc} into shared libraries
6670 by default.  Otherwise, it will take advantage of the linker and optimize
6671 away the linking with the shared version of @file{libgcc}, linking with
6672 the static version of libgcc by default.  This allows exceptions to
6673 propagate through such shared libraries, without incurring relocation
6674 costs at library load time.
6676 However, if a library or main executable is supposed to throw or catch
6677 exceptions, you must link it using the G++ or GCJ driver, as appropriate
6678 for the languages used in the program, or using the option
6679 @option{-shared-libgcc}, such that it is linked with the shared
6680 @file{libgcc}.
6682 @item -symbolic
6683 @opindex symbolic
6684 Bind references to global symbols when building a shared object.  Warn
6685 about any unresolved references (unless overridden by the link editor
6686 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
6687 this option.
6689 @item -Xlinker @var{option}
6690 @opindex Xlinker
6691 Pass @var{option} as an option to the linker.  You can use this to
6692 supply system-specific linker options which GCC does not know how to
6693 recognize.
6695 If you want to pass an option that takes an argument, you must use
6696 @option{-Xlinker} twice, once for the option and once for the argument.
6697 For example, to pass @option{-assert definitions}, you must write
6698 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
6699 @option{-Xlinker "-assert definitions"}, because this passes the entire
6700 string as a single argument, which is not what the linker expects.
6702 @item -Wl,@var{option}
6703 @opindex Wl
6704 Pass @var{option} as an option to the linker.  If @var{option} contains
6705 commas, it is split into multiple options at the commas.
6707 @item -u @var{symbol}
6708 @opindex u
6709 Pretend the symbol @var{symbol} is undefined, to force linking of
6710 library modules to define it.  You can use @option{-u} multiple times with
6711 different symbols to force loading of additional library modules.
6712 @end table
6714 @node Directory Options
6715 @section Options for Directory Search
6716 @cindex directory options
6717 @cindex options, directory search
6718 @cindex search path
6720 These options specify directories to search for header files, for
6721 libraries and for parts of the compiler:
6723 @table @gcctabopt
6724 @item -I@var{dir}
6725 @opindex I
6726 Add the directory @var{dir} to the head of the list of directories to be
6727 searched for header files.  This can be used to override a system header
6728 file, substituting your own version, since these directories are
6729 searched before the system header file directories.  However, you should
6730 not use this option to add directories that contain vendor-supplied
6731 system header files (use @option{-isystem} for that).  If you use more than
6732 one @option{-I} option, the directories are scanned in left-to-right
6733 order; the standard system directories come after.
6735 If a standard system include directory, or a directory specified with
6736 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
6737 option will be ignored.  The directory will still be searched but as a
6738 system directory at its normal position in the system include chain.
6739 This is to ensure that GCC's procedure to fix buggy system headers and
6740 the ordering for the include_next directive are not inadvertently changed.
6741 If you really need to change the search order for system directories,
6742 use the @option{-nostdinc} and/or @option{-isystem} options.
6744 @item -iquote@var{dir}
6745 @opindex iquote
6746 Add the directory @var{dir} to the head of the list of directories to
6747 be searched for header files only for the case of @samp{#include
6748 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
6749 otherwise just like @option{-I}.
6751 @item -L@var{dir}
6752 @opindex L
6753 Add directory @var{dir} to the list of directories to be searched
6754 for @option{-l}.
6756 @item -B@var{prefix}
6757 @opindex B
6758 This option specifies where to find the executables, libraries,
6759 include files, and data files of the compiler itself.
6761 The compiler driver program runs one or more of the subprograms
6762 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
6763 @var{prefix} as a prefix for each program it tries to run, both with and
6764 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
6766 For each subprogram to be run, the compiler driver first tries the
6767 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
6768 was not specified, the driver tries two standard prefixes, which are
6769 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
6770 those results in a file name that is found, the unmodified program
6771 name is searched for using the directories specified in your
6772 @env{PATH} environment variable.
6774 The compiler will check to see if the path provided by the @option{-B}
6775 refers to a directory, and if necessary it will add a directory
6776 separator character at the end of the path.
6778 @option{-B} prefixes that effectively specify directory names also apply
6779 to libraries in the linker, because the compiler translates these
6780 options into @option{-L} options for the linker.  They also apply to
6781 includes files in the preprocessor, because the compiler translates these
6782 options into @option{-isystem} options for the preprocessor.  In this case,
6783 the compiler appends @samp{include} to the prefix.
6785 The run-time support file @file{libgcc.a} can also be searched for using
6786 the @option{-B} prefix, if needed.  If it is not found there, the two
6787 standard prefixes above are tried, and that is all.  The file is left
6788 out of the link if it is not found by those means.
6790 Another way to specify a prefix much like the @option{-B} prefix is to use
6791 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
6792 Variables}.
6794 As a special kludge, if the path provided by @option{-B} is
6795 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
6796 9, then it will be replaced by @file{[dir/]include}.  This is to help
6797 with boot-strapping the compiler.
6799 @item -specs=@var{file}
6800 @opindex specs
6801 Process @var{file} after the compiler reads in the standard @file{specs}
6802 file, in order to override the defaults that the @file{gcc} driver
6803 program uses when determining what switches to pass to @file{cc1},
6804 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
6805 @option{-specs=@var{file}} can be specified on the command line, and they
6806 are processed in order, from left to right.
6808 @item --sysroot=@var{dir}
6809 @opindex sysroot
6810 Use @var{dir} as the logical root directory for headers and libraries.
6811 For example, if the compiler would normally search for headers in
6812 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
6813 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.  
6815 If you use both this option and the @option{-isysroot} option, then
6816 the @option{--sysroot} option will apply to libraries, but the
6817 @option{-isysroot} option will apply to header files.
6819 The GNU linker (beginning with version 2.16) has the necessary support
6820 for this option.  If your linker does not support this option, the
6821 header file aspect of @option{--sysroot} will still work, but the
6822 library aspect will not.
6824 @item -I-
6825 @opindex I-
6826 This option has been deprecated.  Please use @option{-iquote} instead for
6827 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
6828 Any directories you specify with @option{-I} options before the @option{-I-}
6829 option are searched only for the case of @samp{#include "@var{file}"};
6830 they are not searched for @samp{#include <@var{file}>}.
6832 If additional directories are specified with @option{-I} options after
6833 the @option{-I-}, these directories are searched for all @samp{#include}
6834 directives.  (Ordinarily @emph{all} @option{-I} directories are used
6835 this way.)
6837 In addition, the @option{-I-} option inhibits the use of the current
6838 directory (where the current input file came from) as the first search
6839 directory for @samp{#include "@var{file}"}.  There is no way to
6840 override this effect of @option{-I-}.  With @option{-I.} you can specify
6841 searching the directory which was current when the compiler was
6842 invoked.  That is not exactly the same as what the preprocessor does
6843 by default, but it is often satisfactory.
6845 @option{-I-} does not inhibit the use of the standard system directories
6846 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
6847 independent.
6848 @end table
6850 @c man end
6852 @node Spec Files
6853 @section Specifying subprocesses and the switches to pass to them
6854 @cindex Spec Files
6856 @command{gcc} is a driver program.  It performs its job by invoking a
6857 sequence of other programs to do the work of compiling, assembling and
6858 linking.  GCC interprets its command-line parameters and uses these to
6859 deduce which programs it should invoke, and which command-line options
6860 it ought to place on their command lines.  This behavior is controlled
6861 by @dfn{spec strings}.  In most cases there is one spec string for each
6862 program that GCC can invoke, but a few programs have multiple spec
6863 strings to control their behavior.  The spec strings built into GCC can
6864 be overridden by using the @option{-specs=} command-line switch to specify
6865 a spec file.
6867 @dfn{Spec files} are plaintext files that are used to construct spec
6868 strings.  They consist of a sequence of directives separated by blank
6869 lines.  The type of directive is determined by the first non-whitespace
6870 character on the line and it can be one of the following:
6872 @table @code
6873 @item %@var{command}
6874 Issues a @var{command} to the spec file processor.  The commands that can
6875 appear here are:
6877 @table @code
6878 @item %include <@var{file}>
6879 @cindex %include
6880 Search for @var{file} and insert its text at the current point in the
6881 specs file.
6883 @item %include_noerr <@var{file}>
6884 @cindex %include_noerr
6885 Just like @samp{%include}, but do not generate an error message if the include
6886 file cannot be found.
6888 @item %rename @var{old_name} @var{new_name}
6889 @cindex %rename
6890 Rename the spec string @var{old_name} to @var{new_name}.
6892 @end table
6894 @item *[@var{spec_name}]:
6895 This tells the compiler to create, override or delete the named spec
6896 string.  All lines after this directive up to the next directive or
6897 blank line are considered to be the text for the spec string.  If this
6898 results in an empty string then the spec will be deleted.  (Or, if the
6899 spec did not exist, then nothing will happened.)  Otherwise, if the spec
6900 does not currently exist a new spec will be created.  If the spec does
6901 exist then its contents will be overridden by the text of this
6902 directive, unless the first character of that text is the @samp{+}
6903 character, in which case the text will be appended to the spec.
6905 @item [@var{suffix}]:
6906 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
6907 and up to the next directive or blank line are considered to make up the
6908 spec string for the indicated suffix.  When the compiler encounters an
6909 input file with the named suffix, it will processes the spec string in
6910 order to work out how to compile that file.  For example:
6912 @smallexample
6913 .ZZ:
6914 z-compile -input %i
6915 @end smallexample
6917 This says that any input file whose name ends in @samp{.ZZ} should be
6918 passed to the program @samp{z-compile}, which should be invoked with the
6919 command-line switch @option{-input} and with the result of performing the
6920 @samp{%i} substitution.  (See below.)
6922 As an alternative to providing a spec string, the text that follows a
6923 suffix directive can be one of the following:
6925 @table @code
6926 @item @@@var{language}
6927 This says that the suffix is an alias for a known @var{language}.  This is
6928 similar to using the @option{-x} command-line switch to GCC to specify a
6929 language explicitly.  For example:
6931 @smallexample
6932 .ZZ:
6933 @@c++
6934 @end smallexample
6936 Says that .ZZ files are, in fact, C++ source files.
6938 @item #@var{name}
6939 This causes an error messages saying:
6941 @smallexample
6942 @var{name} compiler not installed on this system.
6943 @end smallexample
6944 @end table
6946 GCC already has an extensive list of suffixes built into it.
6947 This directive will add an entry to the end of the list of suffixes, but
6948 since the list is searched from the end backwards, it is effectively
6949 possible to override earlier entries using this technique.
6951 @end table
6953 GCC has the following spec strings built into it.  Spec files can
6954 override these strings or create their own.  Note that individual
6955 targets can also add their own spec strings to this list.
6957 @smallexample
6958 asm          Options to pass to the assembler
6959 asm_final    Options to pass to the assembler post-processor
6960 cpp          Options to pass to the C preprocessor
6961 cc1          Options to pass to the C compiler
6962 cc1plus      Options to pass to the C++ compiler
6963 endfile      Object files to include at the end of the link
6964 link         Options to pass to the linker
6965 lib          Libraries to include on the command line to the linker
6966 libgcc       Decides which GCC support library to pass to the linker
6967 linker       Sets the name of the linker
6968 predefines   Defines to be passed to the C preprocessor
6969 signed_char  Defines to pass to CPP to say whether @code{char} is signed
6970              by default
6971 startfile    Object files to include at the start of the link
6972 @end smallexample
6974 Here is a small example of a spec file:
6976 @smallexample
6977 %rename lib                 old_lib
6979 *lib:
6980 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
6981 @end smallexample
6983 This example renames the spec called @samp{lib} to @samp{old_lib} and
6984 then overrides the previous definition of @samp{lib} with a new one.
6985 The new definition adds in some extra command-line options before
6986 including the text of the old definition.
6988 @dfn{Spec strings} are a list of command-line options to be passed to their
6989 corresponding program.  In addition, the spec strings can contain
6990 @samp{%}-prefixed sequences to substitute variable text or to
6991 conditionally insert text into the command line.  Using these constructs
6992 it is possible to generate quite complex command lines.
6994 Here is a table of all defined @samp{%}-sequences for spec
6995 strings.  Note that spaces are not generated automatically around the
6996 results of expanding these sequences.  Therefore you can concatenate them
6997 together or combine them with constant text in a single argument.
6999 @table @code
7000 @item %%
7001 Substitute one @samp{%} into the program name or argument.
7003 @item %i
7004 Substitute the name of the input file being processed.
7006 @item %b
7007 Substitute the basename of the input file being processed.
7008 This is the substring up to (and not including) the last period
7009 and not including the directory.
7011 @item %B
7012 This is the same as @samp{%b}, but include the file suffix (text after
7013 the last period).
7015 @item %d
7016 Marks the argument containing or following the @samp{%d} as a
7017 temporary file name, so that that file will be deleted if GCC exits
7018 successfully.  Unlike @samp{%g}, this contributes no text to the
7019 argument.
7021 @item %g@var{suffix}
7022 Substitute a file name that has suffix @var{suffix} and is chosen
7023 once per compilation, and mark the argument in the same way as
7024 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
7025 name is now chosen in a way that is hard to predict even when previously
7026 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
7027 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
7028 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
7029 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
7030 was simply substituted with a file name chosen once per compilation,
7031 without regard to any appended suffix (which was therefore treated
7032 just like ordinary text), making such attacks more likely to succeed.
7034 @item %u@var{suffix}
7035 Like @samp{%g}, but generates a new temporary file name even if
7036 @samp{%u@var{suffix}} was already seen.
7038 @item %U@var{suffix}
7039 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
7040 new one if there is no such last file name.  In the absence of any
7041 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
7042 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
7043 would involve the generation of two distinct file names, one
7044 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7045 simply substituted with a file name chosen for the previous @samp{%u},
7046 without regard to any appended suffix.
7048 @item %j@var{suffix}
7049 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7050 writable, and if save-temps is off; otherwise, substitute the name
7051 of a temporary file, just like @samp{%u}.  This temporary file is not
7052 meant for communication between processes, but rather as a junk
7053 disposal mechanism.
7055 @item %|@var{suffix}
7056 @itemx %m@var{suffix}
7057 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7058 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7059 all.  These are the two most common ways to instruct a program that it
7060 should read from standard input or write to standard output.  If you
7061 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7062 construct: see for example @file{f/lang-specs.h}.
7064 @item %.@var{SUFFIX}
7065 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7066 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7067 terminated by the next space or %.
7069 @item %w
7070 Marks the argument containing or following the @samp{%w} as the
7071 designated output file of this compilation.  This puts the argument
7072 into the sequence of arguments that @samp{%o} will substitute later.
7074 @item %o
7075 Substitutes the names of all the output files, with spaces
7076 automatically placed around them.  You should write spaces
7077 around the @samp{%o} as well or the results are undefined.
7078 @samp{%o} is for use in the specs for running the linker.
7079 Input files whose names have no recognized suffix are not compiled
7080 at all, but they are included among the output files, so they will
7081 be linked.
7083 @item %O
7084 Substitutes the suffix for object files.  Note that this is
7085 handled specially when it immediately follows @samp{%g, %u, or %U},
7086 because of the need for those to form complete file names.  The
7087 handling is such that @samp{%O} is treated exactly as if it had already
7088 been substituted, except that @samp{%g, %u, and %U} do not currently
7089 support additional @var{suffix} characters following @samp{%O} as they would
7090 following, for example, @samp{.o}.
7092 @item %p
7093 Substitutes the standard macro predefinitions for the
7094 current target machine.  Use this when running @code{cpp}.
7096 @item %P
7097 Like @samp{%p}, but puts @samp{__} before and after the name of each
7098 predefined macro, except for macros that start with @samp{__} or with
7099 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7102 @item %I
7103 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7104 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7105 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7106 and @option{-imultilib} as necessary.
7108 @item %s
7109 Current argument is the name of a library or startup file of some sort.
7110 Search for that file in a standard list of directories and substitute
7111 the full name found.
7113 @item %e@var{str}
7114 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7115 Use this when inconsistent options are detected.
7117 @item %(@var{name})
7118 Substitute the contents of spec string @var{name} at this point.
7120 @item %[@var{name}]
7121 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7123 @item %x@{@var{option}@}
7124 Accumulate an option for @samp{%X}.
7126 @item %X
7127 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7128 spec string.
7130 @item %Y
7131 Output the accumulated assembler options specified by @option{-Wa}.
7133 @item %Z
7134 Output the accumulated preprocessor options specified by @option{-Wp}.
7136 @item %a
7137 Process the @code{asm} spec.  This is used to compute the
7138 switches to be passed to the assembler.
7140 @item %A
7141 Process the @code{asm_final} spec.  This is a spec string for
7142 passing switches to an assembler post-processor, if such a program is
7143 needed.
7145 @item %l
7146 Process the @code{link} spec.  This is the spec for computing the
7147 command line passed to the linker.  Typically it will make use of the
7148 @samp{%L %G %S %D and %E} sequences.
7150 @item %D
7151 Dump out a @option{-L} option for each directory that GCC believes might
7152 contain startup files.  If the target supports multilibs then the
7153 current multilib directory will be prepended to each of these paths.
7155 @item %L
7156 Process the @code{lib} spec.  This is a spec string for deciding which
7157 libraries should be included on the command line to the linker.
7159 @item %G
7160 Process the @code{libgcc} spec.  This is a spec string for deciding
7161 which GCC support library should be included on the command line to the linker.
7163 @item %S
7164 Process the @code{startfile} spec.  This is a spec for deciding which
7165 object files should be the first ones passed to the linker.  Typically
7166 this might be a file named @file{crt0.o}.
7168 @item %E
7169 Process the @code{endfile} spec.  This is a spec string that specifies
7170 the last object files that will be passed to the linker.
7172 @item %C
7173 Process the @code{cpp} spec.  This is used to construct the arguments
7174 to be passed to the C preprocessor.
7176 @item %1
7177 Process the @code{cc1} spec.  This is used to construct the options to be
7178 passed to the actual C compiler (@samp{cc1}).
7180 @item %2
7181 Process the @code{cc1plus} spec.  This is used to construct the options to be
7182 passed to the actual C++ compiler (@samp{cc1plus}).
7184 @item %*
7185 Substitute the variable part of a matched option.  See below.
7186 Note that each comma in the substituted string is replaced by
7187 a single space.
7189 @item %<@code{S}
7190 Remove all occurrences of @code{-S} from the command line.  Note---this
7191 command is position dependent.  @samp{%} commands in the spec string
7192 before this one will see @code{-S}, @samp{%} commands in the spec string
7193 after this one will not.
7195 @item %:@var{function}(@var{args})
7196 Call the named function @var{function}, passing it @var{args}.
7197 @var{args} is first processed as a nested spec string, then split
7198 into an argument vector in the usual fashion.  The function returns
7199 a string which is processed as if it had appeared literally as part
7200 of the current spec.
7202 The following built-in spec functions are provided:
7204 @table @code
7205 @item @code{if-exists}
7206 The @code{if-exists} spec function takes one argument, an absolute
7207 pathname to a file.  If the file exists, @code{if-exists} returns the
7208 pathname.  Here is a small example of its usage:
7210 @smallexample
7211 *startfile:
7212 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7213 @end smallexample
7215 @item @code{if-exists-else}
7216 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7217 spec function, except that it takes two arguments.  The first argument is
7218 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7219 returns the pathname.  If it does not exist, it returns the second argument.
7220 This way, @code{if-exists-else} can be used to select one file or another,
7221 based on the existence of the first.  Here is a small example of its usage:
7223 @smallexample
7224 *startfile:
7225 crt0%O%s %:if-exists(crti%O%s) \
7226 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7227 @end smallexample
7229 @item @code{replace-outfile}
7230 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7231 first argument in the outfiles array and replaces it with the second argument.  Here
7232 is a small example of its usage:
7234 @smallexample
7235 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7236 @end smallexample
7238 @end table
7240 @item %@{@code{S}@}
7241 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7242 If that switch was not specified, this substitutes nothing.  Note that
7243 the leading dash is omitted when specifying this option, and it is
7244 automatically inserted if the substitution is performed.  Thus the spec
7245 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7246 and would output the command line option @option{-foo}.
7248 @item %W@{@code{S}@}
7249 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7250 deleted on failure.
7252 @item %@{@code{S}*@}
7253 Substitutes all the switches specified to GCC whose names start
7254 with @code{-S}, but which also take an argument.  This is used for
7255 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7256 GCC considers @option{-o foo} as being
7257 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7258 text, including the space.  Thus two arguments would be generated.
7260 @item %@{@code{S}*&@code{T}*@}
7261 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7262 (the order of @code{S} and @code{T} in the spec is not significant).
7263 There can be any number of ampersand-separated variables; for each the
7264 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7266 @item %@{@code{S}:@code{X}@}
7267 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7269 @item %@{!@code{S}:@code{X}@}
7270 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7272 @item %@{@code{S}*:@code{X}@}
7273 Substitutes @code{X} if one or more switches whose names start with
7274 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7275 once, no matter how many such switches appeared.  However, if @code{%*}
7276 appears somewhere in @code{X}, then @code{X} will be substituted once
7277 for each matching switch, with the @code{%*} replaced by the part of
7278 that switch that matched the @code{*}.
7280 @item %@{.@code{S}:@code{X}@}
7281 Substitutes @code{X}, if processing a file with suffix @code{S}.
7283 @item %@{!.@code{S}:@code{X}@}
7284 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7286 @item %@{@code{S}|@code{P}:@code{X}@}
7287 Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@.
7288 This may be combined with @samp{!}, @samp{.}, and @code{*} sequences as well,
7289 although they have a stronger binding than the @samp{|}.  If @code{%*}
7290 appears in @code{X}, all of the alternatives must be starred, and only
7291 the first matching alternative is substituted.
7293 For example, a spec string like this:
7295 @smallexample
7296 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7297 @end smallexample
7299 will output the following command-line options from the following input
7300 command-line options:
7302 @smallexample
7303 fred.c        -foo -baz
7304 jim.d         -bar -boggle
7305 -d fred.c     -foo -baz -boggle
7306 -d jim.d      -bar -baz -boggle
7307 @end smallexample
7309 @item %@{S:X; T:Y; :D@}
7311 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7312 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7313 be as many clauses as you need.  This may be combined with @code{.},
7314 @code{!}, @code{|}, and @code{*} as needed.
7317 @end table
7319 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7320 construct may contain other nested @samp{%} constructs or spaces, or
7321 even newlines.  They are processed as usual, as described above.
7322 Trailing white space in @code{X} is ignored.  White space may also
7323 appear anywhere on the left side of the colon in these constructs,
7324 except between @code{.} or @code{*} and the corresponding word.
7326 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7327 handled specifically in these constructs.  If another value of
7328 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7329 @option{-W} switch is found later in the command line, the earlier
7330 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7331 just one letter, which passes all matching options.
7333 The character @samp{|} at the beginning of the predicate text is used to
7334 indicate that a command should be piped to the following command, but
7335 only if @option{-pipe} is specified.
7337 It is built into GCC which switches take arguments and which do not.
7338 (You might think it would be useful to generalize this to allow each
7339 compiler's spec to say which switches take arguments.  But this cannot
7340 be done in a consistent fashion.  GCC cannot even decide which input
7341 files have been specified without knowing which switches take arguments,
7342 and it must know which input files to compile in order to tell which
7343 compilers to run).
7345 GCC also knows implicitly that arguments starting in @option{-l} are to be
7346 treated as compiler output files, and passed to the linker in their
7347 proper position among the other output files.
7349 @c man begin OPTIONS
7351 @node Target Options
7352 @section Specifying Target Machine and Compiler Version
7353 @cindex target options
7354 @cindex cross compiling
7355 @cindex specifying machine version
7356 @cindex specifying compiler version and target machine
7357 @cindex compiler version, specifying
7358 @cindex target machine, specifying
7360 The usual way to run GCC is to run the executable called @file{gcc}, or
7361 @file{<machine>-gcc} when cross-compiling, or
7362 @file{<machine>-gcc-<version>} to run a version other than the one that
7363 was installed last.  Sometimes this is inconvenient, so GCC provides
7364 options that will switch to another cross-compiler or version.
7366 @table @gcctabopt
7367 @item -b @var{machine}
7368 @opindex b
7369 The argument @var{machine} specifies the target machine for compilation.
7371 The value to use for @var{machine} is the same as was specified as the
7372 machine type when configuring GCC as a cross-compiler.  For
7373 example, if a cross-compiler was configured with @samp{configure
7374 arm-elf}, meaning to compile for an arm processor with elf binaries,
7375 then you would specify @option{-b arm-elf} to run that cross compiler.
7376 Because there are other options beginning with @option{-b}, the
7377 configuration must contain a hyphen. 
7379 @item -V @var{version}
7380 @opindex V
7381 The argument @var{version} specifies which version of GCC to run.
7382 This is useful when multiple versions are installed.  For example,
7383 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7384 @end table
7386 The @option{-V} and @option{-b} options work by running the
7387 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7388 use them if you can just run that directly.
7390 @node Submodel Options
7391 @section Hardware Models and Configurations
7392 @cindex submodel options
7393 @cindex specifying hardware config
7394 @cindex hardware models and configurations, specifying
7395 @cindex machine dependent options
7397 Earlier we discussed the standard option @option{-b} which chooses among
7398 different installed compilers for completely different target
7399 machines, such as VAX vs.@: 68000 vs.@: 80386.
7401 In addition, each of these target machine types can have its own
7402 special options, starting with @samp{-m}, to choose among various
7403 hardware models or configurations---for example, 68010 vs 68020,
7404 floating coprocessor or none.  A single installed version of the
7405 compiler can compile for any model or configuration, according to the
7406 options specified.
7408 Some configurations of the compiler also support additional special
7409 options, usually for compatibility with other compilers on the same
7410 platform.
7412 @c This list is ordered alphanumerically by subsection name.
7413 @c It should be the same order and spelling as these options are listed
7414 @c in Machine Dependent Options
7416 @menu
7417 * ARC Options::
7418 * ARM Options::
7419 * AVR Options::
7420 * Blackfin Options::
7421 * CRIS Options::
7422 * CRX Options::
7423 * Darwin Options::
7424 * DEC Alpha Options::
7425 * DEC Alpha/VMS Options::
7426 * FRV Options::
7427 * GNU/Linux Options::
7428 * H8/300 Options::
7429 * HPPA Options::
7430 * i386 and x86-64 Options::
7431 * IA-64 Options::
7432 * M32C Options::
7433 * M32R/D Options::
7434 * M680x0 Options::
7435 * M68hc1x Options::
7436 * MCore Options::
7437 * MIPS Options::
7438 * MMIX Options::
7439 * MN10300 Options::
7440 * MT Options::
7441 * PDP-11 Options::
7442 * PowerPC Options::
7443 * RS/6000 and PowerPC Options::
7444 * S/390 and zSeries Options::
7445 * Score Options::
7446 * SH Options::
7447 * SPARC Options::
7448 * SPU Options::
7449 * System V Options::
7450 * TMS320C3x/C4x Options::
7451 * V850 Options::
7452 * VAX Options::
7453 * x86-64 Options::
7454 * Xstormy16 Options::
7455 * Xtensa Options::
7456 * zSeries Options::
7457 @end menu
7459 @node ARC Options
7460 @subsection ARC Options
7461 @cindex ARC Options
7463 These options are defined for ARC implementations:
7465 @table @gcctabopt
7466 @item -EL
7467 @opindex EL
7468 Compile code for little endian mode.  This is the default.
7470 @item -EB
7471 @opindex EB
7472 Compile code for big endian mode.
7474 @item -mmangle-cpu
7475 @opindex mmangle-cpu
7476 Prepend the name of the cpu to all public symbol names.
7477 In multiple-processor systems, there are many ARC variants with different
7478 instruction and register set characteristics.  This flag prevents code
7479 compiled for one cpu to be linked with code compiled for another.
7480 No facility exists for handling variants that are ``almost identical''.
7481 This is an all or nothing option.
7483 @item -mcpu=@var{cpu}
7484 @opindex mcpu
7485 Compile code for ARC variant @var{cpu}.
7486 Which variants are supported depend on the configuration.
7487 All variants support @option{-mcpu=base}, this is the default.
7489 @item -mtext=@var{text-section}
7490 @itemx -mdata=@var{data-section}
7491 @itemx -mrodata=@var{readonly-data-section}
7492 @opindex mtext
7493 @opindex mdata
7494 @opindex mrodata
7495 Put functions, data, and readonly data in @var{text-section},
7496 @var{data-section}, and @var{readonly-data-section} respectively
7497 by default.  This can be overridden with the @code{section} attribute.
7498 @xref{Variable Attributes}.
7500 @end table
7502 @node ARM Options
7503 @subsection ARM Options
7504 @cindex ARM options
7506 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7507 architectures:
7509 @table @gcctabopt
7510 @item -mabi=@var{name}
7511 @opindex mabi
7512 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7513 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
7515 @item -mapcs-frame
7516 @opindex mapcs-frame
7517 Generate a stack frame that is compliant with the ARM Procedure Call
7518 Standard for all functions, even if this is not strictly necessary for
7519 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7520 with this option will cause the stack frames not to be generated for
7521 leaf functions.  The default is @option{-mno-apcs-frame}.
7523 @item -mapcs
7524 @opindex mapcs
7525 This is a synonym for @option{-mapcs-frame}.
7527 @ignore
7528 @c not currently implemented
7529 @item -mapcs-stack-check
7530 @opindex mapcs-stack-check
7531 Generate code to check the amount of stack space available upon entry to
7532 every function (that actually uses some stack space).  If there is
7533 insufficient space available then either the function
7534 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7535 called, depending upon the amount of stack space required.  The run time
7536 system is required to provide these functions.  The default is
7537 @option{-mno-apcs-stack-check}, since this produces smaller code.
7539 @c not currently implemented
7540 @item -mapcs-float
7541 @opindex mapcs-float
7542 Pass floating point arguments using the float point registers.  This is
7543 one of the variants of the APCS@.  This option is recommended if the
7544 target hardware has a floating point unit or if a lot of floating point
7545 arithmetic is going to be performed by the code.  The default is
7546 @option{-mno-apcs-float}, since integer only code is slightly increased in
7547 size if @option{-mapcs-float} is used.
7549 @c not currently implemented
7550 @item -mapcs-reentrant
7551 @opindex mapcs-reentrant
7552 Generate reentrant, position independent code.  The default is
7553 @option{-mno-apcs-reentrant}.
7554 @end ignore
7556 @item -mthumb-interwork
7557 @opindex mthumb-interwork
7558 Generate code which supports calling between the ARM and Thumb
7559 instruction sets.  Without this option the two instruction sets cannot
7560 be reliably used inside one program.  The default is
7561 @option{-mno-thumb-interwork}, since slightly larger code is generated
7562 when @option{-mthumb-interwork} is specified.
7564 @item -mno-sched-prolog
7565 @opindex mno-sched-prolog
7566 Prevent the reordering of instructions in the function prolog, or the
7567 merging of those instruction with the instructions in the function's
7568 body.  This means that all functions will start with a recognizable set
7569 of instructions (or in fact one of a choice from a small set of
7570 different function prologues), and this information can be used to
7571 locate the start if functions inside an executable piece of code.  The
7572 default is @option{-msched-prolog}.
7574 @item -mhard-float
7575 @opindex mhard-float
7576 Generate output containing floating point instructions.  This is the
7577 default.
7579 @item -msoft-float
7580 @opindex msoft-float
7581 Generate output containing library calls for floating point.
7582 @strong{Warning:} the requisite libraries are not available for all ARM
7583 targets.  Normally the facilities of the machine's usual C compiler are
7584 used, but this cannot be done directly in cross-compilation.  You must make
7585 your own arrangements to provide suitable library functions for
7586 cross-compilation.
7588 @option{-msoft-float} changes the calling convention in the output file;
7589 therefore, it is only useful if you compile @emph{all} of a program with
7590 this option.  In particular, you need to compile @file{libgcc.a}, the
7591 library that comes with GCC, with @option{-msoft-float} in order for
7592 this to work.
7594 @item -mfloat-abi=@var{name}
7595 @opindex mfloat-abi
7596 Specifies which ABI to use for floating point values.  Permissible values
7597 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7599 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7600 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7601 of floating point instructions, but still uses the soft-float calling
7602 conventions.
7604 @item -mlittle-endian
7605 @opindex mlittle-endian
7606 Generate code for a processor running in little-endian mode.  This is
7607 the default for all standard configurations.
7609 @item -mbig-endian
7610 @opindex mbig-endian
7611 Generate code for a processor running in big-endian mode; the default is
7612 to compile code for a little-endian processor.
7614 @item -mwords-little-endian
7615 @opindex mwords-little-endian
7616 This option only applies when generating code for big-endian processors.
7617 Generate code for a little-endian word order but a big-endian byte
7618 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7619 option should only be used if you require compatibility with code for
7620 big-endian ARM processors generated by versions of the compiler prior to
7621 2.8.
7623 @item -mcpu=@var{name}
7624 @opindex mcpu
7625 This specifies the name of the target ARM processor.  GCC uses this name
7626 to determine what kind of instructions it can emit when generating
7627 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7628 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7629 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7630 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7631 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7632 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7633 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7634 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7635 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7636 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7637 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7638 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7639 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7640 @samp{arm1176jz-s}, @samp{arm1176jzf-s}, @samp{xscale}, @samp{iwmmxt},
7641 @samp{ep9312}.
7643 @itemx -mtune=@var{name}
7644 @opindex mtune
7645 This option is very similar to the @option{-mcpu=} option, except that
7646 instead of specifying the actual target processor type, and hence
7647 restricting which instructions can be used, it specifies that GCC should
7648 tune the performance of the code as if the target were of the type
7649 specified in this option, but still choosing the instructions that it
7650 will generate based on the cpu specified by a @option{-mcpu=} option.
7651 For some ARM implementations better performance can be obtained by using
7652 this option.
7654 @item -march=@var{name}
7655 @opindex march
7656 This specifies the name of the target ARM architecture.  GCC uses this
7657 name to determine what kind of instructions it can emit when generating
7658 assembly code.  This option can be used in conjunction with or instead
7659 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
7660 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
7661 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
7662 @samp{iwmmxt}, @samp{ep9312}.
7664 @item -mfpu=@var{name}
7665 @itemx -mfpe=@var{number}
7666 @itemx -mfp=@var{number}
7667 @opindex mfpu
7668 @opindex mfpe
7669 @opindex mfp
7670 This specifies what floating point hardware (or hardware emulation) is
7671 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
7672 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
7673 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
7674 with older versions of GCC@.
7676 If @option{-msoft-float} is specified this specifies the format of
7677 floating point values.
7679 @item -mstructure-size-boundary=@var{n}
7680 @opindex mstructure-size-boundary
7681 The size of all structures and unions will be rounded up to a multiple
7682 of the number of bits set by this option.  Permissible values are 8, 32
7683 and 64.  The default value varies for different toolchains.  For the COFF
7684 targeted toolchain the default value is 8.  A value of 64 is only allowed
7685 if the underlying ABI supports it.
7687 Specifying the larger number can produce faster, more efficient code, but
7688 can also increase the size of the program.  Different values are potentially
7689 incompatible.  Code compiled with one value cannot necessarily expect to
7690 work with code or libraries compiled with another value, if they exchange
7691 information using structures or unions.
7693 @item -mabort-on-noreturn
7694 @opindex mabort-on-noreturn
7695 Generate a call to the function @code{abort} at the end of a
7696 @code{noreturn} function.  It will be executed if the function tries to
7697 return.
7699 @item -mlong-calls
7700 @itemx -mno-long-calls
7701 @opindex mlong-calls
7702 @opindex mno-long-calls
7703 Tells the compiler to perform function calls by first loading the
7704 address of the function into a register and then performing a subroutine
7705 call on this register.  This switch is needed if the target function
7706 will lie outside of the 64 megabyte addressing range of the offset based
7707 version of subroutine call instruction.
7709 Even if this switch is enabled, not all function calls will be turned
7710 into long calls.  The heuristic is that static functions, functions
7711 which have the @samp{short-call} attribute, functions that are inside
7712 the scope of a @samp{#pragma no_long_calls} directive and functions whose
7713 definitions have already been compiled within the current compilation
7714 unit, will not be turned into long calls.  The exception to this rule is
7715 that weak function definitions, functions with the @samp{long-call}
7716 attribute or the @samp{section} attribute, and functions that are within
7717 the scope of a @samp{#pragma long_calls} directive, will always be
7718 turned into long calls.
7720 This feature is not enabled by default.  Specifying
7721 @option{-mno-long-calls} will restore the default behavior, as will
7722 placing the function calls within the scope of a @samp{#pragma
7723 long_calls_off} directive.  Note these switches have no effect on how
7724 the compiler generates code to handle function calls via function
7725 pointers.
7727 @item -mnop-fun-dllimport
7728 @opindex mnop-fun-dllimport
7729 Disable support for the @code{dllimport} attribute.
7731 @item -msingle-pic-base
7732 @opindex msingle-pic-base
7733 Treat the register used for PIC addressing as read-only, rather than
7734 loading it in the prologue for each function.  The run-time system is
7735 responsible for initializing this register with an appropriate value
7736 before execution begins.
7738 @item -mpic-register=@var{reg}
7739 @opindex mpic-register
7740 Specify the register to be used for PIC addressing.  The default is R10
7741 unless stack-checking is enabled, when R9 is used.
7743 @item -mcirrus-fix-invalid-insns
7744 @opindex mcirrus-fix-invalid-insns
7745 @opindex mno-cirrus-fix-invalid-insns
7746 Insert NOPs into the instruction stream to in order to work around
7747 problems with invalid Maverick instruction combinations.  This option
7748 is only valid if the @option{-mcpu=ep9312} option has been used to
7749 enable generation of instructions for the Cirrus Maverick floating
7750 point co-processor.  This option is not enabled by default, since the
7751 problem is only present in older Maverick implementations.  The default
7752 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
7753 switch.
7755 @item -mpoke-function-name
7756 @opindex mpoke-function-name
7757 Write the name of each function into the text section, directly
7758 preceding the function prologue.  The generated code is similar to this:
7760 @smallexample
7761      t0
7762          .ascii "arm_poke_function_name", 0
7763          .align
7764      t1
7765          .word 0xff000000 + (t1 - t0)
7766      arm_poke_function_name
7767          mov     ip, sp
7768          stmfd   sp!, @{fp, ip, lr, pc@}
7769          sub     fp, ip, #4
7770 @end smallexample
7772 When performing a stack backtrace, code can inspect the value of
7773 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
7774 location @code{pc - 12} and the top 8 bits are set, then we know that
7775 there is a function name embedded immediately preceding this location
7776 and has length @code{((pc[-3]) & 0xff000000)}.
7778 @item -mthumb
7779 @opindex mthumb
7780 Generate code for the 16-bit Thumb instruction set.  The default is to
7781 use the 32-bit ARM instruction set.
7783 @item -mtpcs-frame
7784 @opindex mtpcs-frame
7785 Generate a stack frame that is compliant with the Thumb Procedure Call
7786 Standard for all non-leaf functions.  (A leaf function is one that does
7787 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
7789 @item -mtpcs-leaf-frame
7790 @opindex mtpcs-leaf-frame
7791 Generate a stack frame that is compliant with the Thumb Procedure Call
7792 Standard for all leaf functions.  (A leaf function is one that does
7793 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
7795 @item -mcallee-super-interworking
7796 @opindex mcallee-super-interworking
7797 Gives all externally visible functions in the file being compiled an ARM
7798 instruction set header which switches to Thumb mode before executing the
7799 rest of the function.  This allows these functions to be called from
7800 non-interworking code.
7802 @item -mcaller-super-interworking
7803 @opindex mcaller-super-interworking
7804 Allows calls via function pointers (including virtual functions) to
7805 execute correctly regardless of whether the target code has been
7806 compiled for interworking or not.  There is a small overhead in the cost
7807 of executing a function pointer if this option is enabled.
7809 @item -mtp=@var{name}
7810 @opindex mtp
7811 Specify the access model for the thread local storage pointer.  The valid
7812 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
7813 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
7814 (supported in the arm6k architecture), and @option{auto}, which uses the
7815 best available method for the selected processor.  The default setting is
7816 @option{auto}.
7818 @end table
7820 @node AVR Options
7821 @subsection AVR Options
7822 @cindex AVR Options
7824 These options are defined for AVR implementations:
7826 @table @gcctabopt
7827 @item -mmcu=@var{mcu}
7828 @opindex mmcu
7829 Specify ATMEL AVR instruction set or MCU type.
7831 Instruction set avr1 is for the minimal AVR core, not supported by the C
7832 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
7833 attiny11, attiny12, attiny15, attiny28).
7835 Instruction set avr2 (default) is for the classic AVR core with up to
7836 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
7837 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
7838 at90c8534, at90s8535).
7840 Instruction set avr3 is for the classic AVR core with up to 128K program
7841 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
7843 Instruction set avr4 is for the enhanced AVR core with up to 8K program
7844 memory space (MCU types: atmega8, atmega83, atmega85).
7846 Instruction set avr5 is for the enhanced AVR core with up to 128K program
7847 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
7848 atmega64, atmega128, at43usb355, at94k).
7850 @item -msize
7851 @opindex msize
7852 Output instruction sizes to the asm file.
7854 @item -minit-stack=@var{N}
7855 @opindex minit-stack
7856 Specify the initial stack address, which may be a symbol or numeric value,
7857 @samp{__stack} is the default.
7859 @item -mno-interrupts
7860 @opindex mno-interrupts
7861 Generated code is not compatible with hardware interrupts.
7862 Code size will be smaller.
7864 @item -mcall-prologues
7865 @opindex mcall-prologues
7866 Functions prologues/epilogues expanded as call to appropriate
7867 subroutines.  Code size will be smaller.
7869 @item -mno-tablejump
7870 @opindex mno-tablejump
7871 Do not generate tablejump insns which sometimes increase code size.
7873 @item -mtiny-stack
7874 @opindex mtiny-stack
7875 Change only the low 8 bits of the stack pointer.
7877 @item -mint8
7878 @opindex mint8
7879 Assume int to be 8 bit integer.  This affects the sizes of all types: A
7880 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
7881 and long long will be 4 bytes.  Please note that this option does not
7882 comply to the C standards, but it will provide you with smaller code
7883 size.
7884 @end table
7886 @node Blackfin Options
7887 @subsection Blackfin Options
7888 @cindex Blackfin Options
7890 @table @gcctabopt
7891 @item -momit-leaf-frame-pointer
7892 @opindex momit-leaf-frame-pointer
7893 Don't keep the frame pointer in a register for leaf functions.  This
7894 avoids the instructions to save, set up and restore frame pointers and
7895 makes an extra register available in leaf functions.  The option
7896 @option{-fomit-frame-pointer} removes the frame pointer for all functions
7897 which might make debugging harder.
7899 @item -mspecld-anomaly
7900 @opindex mspecld-anomaly
7901 When enabled, the compiler will ensure that the generated code does not
7902 contain speculative loads after jump instructions.  This option is enabled
7903 by default.
7905 @item -mno-specld-anomaly
7906 @opindex mno-specld-anomaly
7907 Don't generate extra code to prevent speculative loads from occurring.
7909 @item -mcsync-anomaly
7910 @opindex mcsync-anomaly
7911 When enabled, the compiler will ensure that the generated code does not
7912 contain CSYNC or SSYNC instructions too soon after conditional branches.
7913 This option is enabled by default.
7915 @item -mno-csync-anomaly
7916 @opindex mno-csync-anomaly
7917 Don't generate extra code to prevent CSYNC or SSYNC instructions from
7918 occurring too soon after a conditional branch.
7920 @item -mlow-64k
7921 @opindex mlow-64k
7922 When enabled, the compiler is free to take advantage of the knowledge that
7923 the entire program fits into the low 64k of memory.
7925 @item -mno-low-64k
7926 @opindex mno-low-64k
7927 Assume that the program is arbitrarily large.  This is the default.
7929 @item -mstack-check-l1
7930 @opindex mstack-check-l1
7931 Do stack checking using information placed into L1 scratchpad memory by the
7932 uClinux kernel.
7934 @item -mid-shared-library
7935 @opindex mid-shared-library
7936 Generate code that supports shared libraries via the library ID method.
7937 This allows for execute in place and shared libraries in an environment
7938 without virtual memory management.  This option implies @option{-fPIC}.
7940 @item -mno-id-shared-library
7941 @opindex mno-id-shared-library
7942 Generate code that doesn't assume ID based shared libraries are being used.
7943 This is the default.
7945 @item -mleaf-id-shared-library
7946 @opindex mleaf-id-shared-library
7947 Generate code that supports shared libraries via the library ID method,
7948 but assumes that this library or executable won't link against any other
7949 ID shared libraries.  That allows the compiler to use faster code for jumps
7950 and calls.
7952 @item -mno-leaf-id-shared-library
7953 @opindex mno-leaf-id-shared-library
7954 Do not assume that the code being compiled won't link against any ID shared
7955 libraries.  Slower code will be generated for jump and call insns.
7957 @item -mshared-library-id=n
7958 @opindex mshared-library-id
7959 Specified the identification number of the ID based shared library being
7960 compiled.  Specifying a value of 0 will generate more compact code, specifying
7961 other values will force the allocation of that number to the current
7962 library but is no more space or time efficient than omitting this option.
7964 @item -msep-data
7965 @opindex msep-data
7966 Generate code that allows the data segment to be located in a different
7967 area of memory from the text segment.  This allows for execute in place in
7968 an environment without virtual memory management by eliminating relocations
7969 against the text section.
7971 @item -mno-sep-data
7972 @opindex mno-sep-data
7973 Generate code that assumes that the data segment follows the text segment.
7974 This is the default.
7976 @item -mlong-calls
7977 @itemx -mno-long-calls
7978 @opindex mlong-calls
7979 @opindex mno-long-calls
7980 Tells the compiler to perform function calls by first loading the
7981 address of the function into a register and then performing a subroutine
7982 call on this register.  This switch is needed if the target function
7983 will lie outside of the 24 bit addressing range of the offset based
7984 version of subroutine call instruction.
7986 This feature is not enabled by default.  Specifying
7987 @option{-mno-long-calls} will restore the default behavior.  Note these
7988 switches have no effect on how the compiler generates code to handle
7989 function calls via function pointers.
7990 @end table
7992 @node CRIS Options
7993 @subsection CRIS Options
7994 @cindex CRIS Options
7996 These options are defined specifically for the CRIS ports.
7998 @table @gcctabopt
7999 @item -march=@var{architecture-type}
8000 @itemx -mcpu=@var{architecture-type}
8001 @opindex march
8002 @opindex mcpu
8003 Generate code for the specified architecture.  The choices for
8004 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
8005 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
8006 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
8007 @samp{v10}.
8009 @item -mtune=@var{architecture-type}
8010 @opindex mtune
8011 Tune to @var{architecture-type} everything applicable about the generated
8012 code, except for the ABI and the set of available instructions.  The
8013 choices for @var{architecture-type} are the same as for
8014 @option{-march=@var{architecture-type}}.
8016 @item -mmax-stack-frame=@var{n}
8017 @opindex mmax-stack-frame
8018 Warn when the stack frame of a function exceeds @var{n} bytes.
8020 @item -melinux-stacksize=@var{n}
8021 @opindex melinux-stacksize
8022 Only available with the @samp{cris-axis-aout} target.  Arranges for
8023 indications in the program to the kernel loader that the stack of the
8024 program should be set to @var{n} bytes.
8026 @item -metrax4
8027 @itemx -metrax100
8028 @opindex metrax4
8029 @opindex metrax100
8030 The options @option{-metrax4} and @option{-metrax100} are synonyms for
8031 @option{-march=v3} and @option{-march=v8} respectively.
8033 @item -mmul-bug-workaround
8034 @itemx -mno-mul-bug-workaround
8035 @opindex mmul-bug-workaround
8036 @opindex mno-mul-bug-workaround
8037 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
8038 models where it applies.  This option is active by default.
8040 @item -mpdebug
8041 @opindex mpdebug
8042 Enable CRIS-specific verbose debug-related information in the assembly
8043 code.  This option also has the effect to turn off the @samp{#NO_APP}
8044 formatted-code indicator to the assembler at the beginning of the
8045 assembly file.
8047 @item -mcc-init
8048 @opindex mcc-init
8049 Do not use condition-code results from previous instruction; always emit
8050 compare and test instructions before use of condition codes.
8052 @item -mno-side-effects
8053 @opindex mno-side-effects
8054 Do not emit instructions with side-effects in addressing modes other than
8055 post-increment.
8057 @item -mstack-align
8058 @itemx -mno-stack-align
8059 @itemx -mdata-align
8060 @itemx -mno-data-align
8061 @itemx -mconst-align
8062 @itemx -mno-const-align
8063 @opindex mstack-align
8064 @opindex mno-stack-align
8065 @opindex mdata-align
8066 @opindex mno-data-align
8067 @opindex mconst-align
8068 @opindex mno-const-align
8069 These options (no-options) arranges (eliminate arrangements) for the
8070 stack-frame, individual data and constants to be aligned for the maximum
8071 single data access size for the chosen CPU model.  The default is to
8072 arrange for 32-bit alignment.  ABI details such as structure layout are
8073 not affected by these options.
8075 @item -m32-bit
8076 @itemx -m16-bit
8077 @itemx -m8-bit
8078 @opindex m32-bit
8079 @opindex m16-bit
8080 @opindex m8-bit
8081 Similar to the stack- data- and const-align options above, these options
8082 arrange for stack-frame, writable data and constants to all be 32-bit,
8083 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8085 @item -mno-prologue-epilogue
8086 @itemx -mprologue-epilogue
8087 @opindex mno-prologue-epilogue
8088 @opindex mprologue-epilogue
8089 With @option{-mno-prologue-epilogue}, the normal function prologue and
8090 epilogue that sets up the stack-frame are omitted and no return
8091 instructions or return sequences are generated in the code.  Use this
8092 option only together with visual inspection of the compiled code: no
8093 warnings or errors are generated when call-saved registers must be saved,
8094 or storage for local variable needs to be allocated.
8096 @item -mno-gotplt
8097 @itemx -mgotplt
8098 @opindex mno-gotplt
8099 @opindex mgotplt
8100 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8101 instruction sequences that load addresses for functions from the PLT part
8102 of the GOT rather than (traditional on other architectures) calls to the
8103 PLT@.  The default is @option{-mgotplt}.
8105 @item -maout
8106 @opindex maout
8107 Legacy no-op option only recognized with the cris-axis-aout target.
8109 @item -melf
8110 @opindex melf
8111 Legacy no-op option only recognized with the cris-axis-elf and
8112 cris-axis-linux-gnu targets.
8114 @item -melinux
8115 @opindex melinux
8116 Only recognized with the cris-axis-aout target, where it selects a
8117 GNU/linux-like multilib, include files and instruction set for
8118 @option{-march=v8}.
8120 @item -mlinux
8121 @opindex mlinux
8122 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8124 @item -sim
8125 @opindex sim
8126 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8127 to link with input-output functions from a simulator library.  Code,
8128 initialized data and zero-initialized data are allocated consecutively.
8130 @item -sim2
8131 @opindex sim2
8132 Like @option{-sim}, but pass linker options to locate initialized data at
8133 0x40000000 and zero-initialized data at 0x80000000.
8134 @end table
8136 @node CRX Options
8137 @subsection CRX Options
8138 @cindex CRX Options
8140 These options are defined specifically for the CRX ports.
8142 @table @gcctabopt
8144 @item -mmac
8145 @opindex mmac
8146 Enable the use of multiply-accumulate instructions. Disabled by default.
8148 @item -mpush-args
8149 @opindex mpush-args
8150 Push instructions will be used to pass outgoing arguments when functions
8151 are called. Enabled by default.
8152 @end table
8154 @node Darwin Options
8155 @subsection Darwin Options
8156 @cindex Darwin options
8158 These options are defined for all architectures running the Darwin operating
8159 system.
8161 FSF GCC on Darwin does not create ``fat'' object files; it will create
8162 an object file for the single architecture that it was built to
8163 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8164 @option{-arch} options are used; it does so by running the compiler or
8165 linker multiple times and joining the results together with
8166 @file{lipo}.
8168 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8169 @samp{i686}) is determined by the flags that specify the ISA
8170 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8171 @option{-force_cpusubtype_ALL} option can be used to override this.
8173 The Darwin tools vary in their behavior when presented with an ISA
8174 mismatch.  The assembler, @file{as}, will only permit instructions to
8175 be used that are valid for the subtype of the file it is generating,
8176 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8177 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8178 and print an error if asked to create a shared library with a less
8179 restrictive subtype than its input files (for instance, trying to put
8180 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8181 for executables, @file{ld}, will quietly give the executable the most
8182 restrictive subtype of any of its input files.
8184 @table @gcctabopt
8185 @item -F@var{dir}
8186 @opindex F
8187 Add the framework directory @var{dir} to the head of the list of
8188 directories to be searched for header files.  These directories are
8189 interleaved with those specified by @option{-I} options and are
8190 scanned in a left-to-right order.
8192 A framework directory is a directory with frameworks in it.  A
8193 framework is a directory with a @samp{"Headers"} and/or
8194 @samp{"PrivateHeaders"} directory contained directly in it that ends
8195 in @samp{".framework"}.  The name of a framework is the name of this
8196 directory excluding the @samp{".framework"}.  Headers associated with
8197 the framework are found in one of those two directories, with
8198 @samp{"Headers"} being searched first.  A subframework is a framework
8199 directory that is in a framework's @samp{"Frameworks"} directory.
8200 Includes of subframework headers can only appear in a header of a
8201 framework that contains the subframework, or in a sibling subframework
8202 header.  Two subframeworks are siblings if they occur in the same
8203 framework.  A subframework should not have the same name as a
8204 framework, a warning will be issued if this is violated.  Currently a
8205 subframework cannot have subframeworks, in the future, the mechanism
8206 may be extended to support this.  The standard frameworks can be found
8207 in @samp{"/System/Library/Frameworks"} and
8208 @samp{"/Library/Frameworks"}.  An example include looks like
8209 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8210 the name of the framework and header.h is found in the
8211 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8213 @item -gused
8214 @opindex -gused
8215 Emit debugging information for symbols that are used.  For STABS
8216 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8217 This is by default ON@.
8219 @item -gfull
8220 @opindex -gfull
8221 Emit debugging information for all symbols and types.
8223 @item -mmacosx-version-min=@var{version}
8224 The earliest version of MacOS X that this executable will run on
8225 is @var{version}.  Typical values of @var{version} include @code{10.1},
8226 @code{10.2}, and @code{10.3.9}.
8228 The default for this option is to make choices that seem to be most
8229 useful.  
8231 @item -mkernel
8232 @opindex mkernel
8233 Enable kernel development mode.  The @option{-mkernel} option sets
8234 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8235 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8236 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8237 applicable.  This mode also sets @option{-mno-altivec},
8238 @option{-msoft-float}, @option{-fno-builtin} and
8239 @option{-mlong-branch} for PowerPC targets.
8241 @item -mone-byte-bool
8242 @opindex -mone-byte-bool
8243 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8244 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8245 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8246 option has no effect on x86.
8248 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8249 to generate code that is not binary compatible with code generated
8250 without that switch.  Using this switch may require recompiling all
8251 other modules in a program, including system libraries.  Use this
8252 switch to conform to a non-default data model.
8254 @item -mfix-and-continue
8255 @itemx -ffix-and-continue
8256 @itemx -findirect-data
8257 @opindex mfix-and-continue
8258 @opindex ffix-and-continue
8259 @opindex findirect-data
8260 Generate code suitable for fast turn around development.  Needed to
8261 enable gdb to dynamically load @code{.o} files into already running
8262 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8263 are provided for backwards compatibility.
8265 @item -all_load
8266 @opindex all_load
8267 Loads all members of static archive libraries.
8268 See man ld(1) for more information.
8270 @item -arch_errors_fatal
8271 @opindex arch_errors_fatal
8272 Cause the errors having to do with files that have the wrong architecture
8273 to be fatal.
8275 @item -bind_at_load
8276 @opindex bind_at_load
8277 Causes the output file to be marked such that the dynamic linker will
8278 bind all undefined references when the file is loaded or launched.
8280 @item -bundle
8281 @opindex bundle
8282 Produce a Mach-o bundle format file.
8283 See man ld(1) for more information.
8285 @item -bundle_loader @var{executable}
8286 @opindex bundle_loader
8287 This option specifies the @var{executable} that will be loading the build
8288 output file being linked.  See man ld(1) for more information.
8290 @item -dynamiclib
8291 @opindex -dynamiclib
8292 When passed this option, GCC will produce a dynamic library instead of
8293 an executable when linking, using the Darwin @file{libtool} command.
8295 @item -force_cpusubtype_ALL
8296 @opindex -force_cpusubtype_ALL
8297 This causes GCC's output file to have the @var{ALL} subtype, instead of
8298 one controlled by the @option{-mcpu} or @option{-march} option.
8300 @item -allowable_client  @var{client_name}
8301 @itemx -client_name
8302 @itemx -compatibility_version
8303 @itemx -current_version
8304 @itemx -dead_strip
8305 @itemx -dependency-file
8306 @itemx -dylib_file
8307 @itemx -dylinker_install_name
8308 @itemx -dynamic
8309 @itemx -exported_symbols_list
8310 @itemx -filelist
8311 @itemx -flat_namespace
8312 @itemx -force_flat_namespace
8313 @itemx -headerpad_max_install_names
8314 @itemx -image_base
8315 @itemx -init
8316 @itemx -install_name
8317 @itemx -keep_private_externs
8318 @itemx -multi_module
8319 @itemx -multiply_defined
8320 @itemx -multiply_defined_unused
8321 @itemx -noall_load
8322 @itemx -no_dead_strip_inits_and_terms
8323 @itemx -nofixprebinding
8324 @itemx -nomultidefs
8325 @itemx -noprebind
8326 @itemx -noseglinkedit
8327 @itemx -pagezero_size
8328 @itemx -prebind
8329 @itemx -prebind_all_twolevel_modules
8330 @itemx -private_bundle
8331 @itemx -read_only_relocs
8332 @itemx -sectalign
8333 @itemx -sectobjectsymbols
8334 @itemx -whyload
8335 @itemx -seg1addr
8336 @itemx -sectcreate
8337 @itemx -sectobjectsymbols
8338 @itemx -sectorder
8339 @itemx -segaddr
8340 @itemx -segs_read_only_addr
8341 @itemx -segs_read_write_addr
8342 @itemx -seg_addr_table
8343 @itemx -seg_addr_table_filename
8344 @itemx -seglinkedit
8345 @itemx -segprot
8346 @itemx -segs_read_only_addr
8347 @itemx -segs_read_write_addr
8348 @itemx -single_module
8349 @itemx -static
8350 @itemx -sub_library
8351 @itemx -sub_umbrella
8352 @itemx -twolevel_namespace
8353 @itemx -umbrella
8354 @itemx -undefined
8355 @itemx -unexported_symbols_list
8356 @itemx -weak_reference_mismatches
8357 @itemx -whatsloaded
8359 @opindex allowable_client
8360 @opindex client_name
8361 @opindex compatibility_version
8362 @opindex current_version
8363 @opindex dead_strip
8364 @opindex dependency-file
8365 @opindex dylib_file
8366 @opindex dylinker_install_name
8367 @opindex dynamic
8368 @opindex exported_symbols_list
8369 @opindex filelist
8370 @opindex flat_namespace
8371 @opindex force_flat_namespace
8372 @opindex headerpad_max_install_names
8373 @opindex image_base
8374 @opindex init
8375 @opindex install_name
8376 @opindex keep_private_externs
8377 @opindex multi_module
8378 @opindex multiply_defined
8379 @opindex multiply_defined_unused
8380 @opindex noall_load
8381 @opindex no_dead_strip_inits_and_terms
8382 @opindex nofixprebinding
8383 @opindex nomultidefs
8384 @opindex noprebind
8385 @opindex noseglinkedit
8386 @opindex pagezero_size
8387 @opindex prebind
8388 @opindex prebind_all_twolevel_modules
8389 @opindex private_bundle
8390 @opindex read_only_relocs
8391 @opindex sectalign
8392 @opindex sectobjectsymbols
8393 @opindex whyload
8394 @opindex seg1addr
8395 @opindex sectcreate
8396 @opindex sectobjectsymbols
8397 @opindex sectorder
8398 @opindex segaddr
8399 @opindex segs_read_only_addr
8400 @opindex segs_read_write_addr
8401 @opindex seg_addr_table
8402 @opindex seg_addr_table_filename
8403 @opindex seglinkedit
8404 @opindex segprot
8405 @opindex segs_read_only_addr
8406 @opindex segs_read_write_addr
8407 @opindex single_module
8408 @opindex static
8409 @opindex sub_library
8410 @opindex sub_umbrella
8411 @opindex twolevel_namespace
8412 @opindex umbrella
8413 @opindex undefined
8414 @opindex unexported_symbols_list
8415 @opindex weak_reference_mismatches
8416 @opindex whatsloaded
8418 These options are passed to the Darwin linker.  The Darwin linker man page
8419 describes them in detail.
8420 @end table
8422 @node DEC Alpha Options
8423 @subsection DEC Alpha Options
8425 These @samp{-m} options are defined for the DEC Alpha implementations:
8427 @table @gcctabopt
8428 @item -mno-soft-float
8429 @itemx -msoft-float
8430 @opindex mno-soft-float
8431 @opindex msoft-float
8432 Use (do not use) the hardware floating-point instructions for
8433 floating-point operations.  When @option{-msoft-float} is specified,
8434 functions in @file{libgcc.a} will be used to perform floating-point
8435 operations.  Unless they are replaced by routines that emulate the
8436 floating-point operations, or compiled in such a way as to call such
8437 emulations routines, these routines will issue floating-point
8438 operations.   If you are compiling for an Alpha without floating-point
8439 operations, you must ensure that the library is built so as not to call
8440 them.
8442 Note that Alpha implementations without floating-point operations are
8443 required to have floating-point registers.
8445 @item -mfp-reg
8446 @itemx -mno-fp-regs
8447 @opindex mfp-reg
8448 @opindex mno-fp-regs
8449 Generate code that uses (does not use) the floating-point register set.
8450 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8451 register set is not used, floating point operands are passed in integer
8452 registers as if they were integers and floating-point results are passed
8453 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8454 so any function with a floating-point argument or return value called by code
8455 compiled with @option{-mno-fp-regs} must also be compiled with that
8456 option.
8458 A typical use of this option is building a kernel that does not use,
8459 and hence need not save and restore, any floating-point registers.
8461 @item -mieee
8462 @opindex mieee
8463 The Alpha architecture implements floating-point hardware optimized for
8464 maximum performance.  It is mostly compliant with the IEEE floating
8465 point standard.  However, for full compliance, software assistance is
8466 required.  This option generates code fully IEEE compliant code
8467 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8468 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8469 defined during compilation.  The resulting code is less efficient but is
8470 able to correctly support denormalized numbers and exceptional IEEE
8471 values such as not-a-number and plus/minus infinity.  Other Alpha
8472 compilers call this option @option{-ieee_with_no_inexact}.
8474 @item -mieee-with-inexact
8475 @opindex mieee-with-inexact
8476 This is like @option{-mieee} except the generated code also maintains
8477 the IEEE @var{inexact-flag}.  Turning on this option causes the
8478 generated code to implement fully-compliant IEEE math.  In addition to
8479 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8480 macro.  On some Alpha implementations the resulting code may execute
8481 significantly slower than the code generated by default.  Since there is
8482 very little code that depends on the @var{inexact-flag}, you should
8483 normally not specify this option.  Other Alpha compilers call this
8484 option @option{-ieee_with_inexact}.
8486 @item -mfp-trap-mode=@var{trap-mode}
8487 @opindex mfp-trap-mode
8488 This option controls what floating-point related traps are enabled.
8489 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8490 The trap mode can be set to one of four values:
8492 @table @samp
8493 @item n
8494 This is the default (normal) setting.  The only traps that are enabled
8495 are the ones that cannot be disabled in software (e.g., division by zero
8496 trap).
8498 @item u
8499 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8500 as well.
8502 @item su
8503 Like @samp{u}, but the instructions are marked to be safe for software
8504 completion (see Alpha architecture manual for details).
8506 @item sui
8507 Like @samp{su}, but inexact traps are enabled as well.
8508 @end table
8510 @item -mfp-rounding-mode=@var{rounding-mode}
8511 @opindex mfp-rounding-mode
8512 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8513 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8516 @table @samp
8517 @item n
8518 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8519 the nearest machine number or towards the even machine number in case
8520 of a tie.
8522 @item m
8523 Round towards minus infinity.
8525 @item c
8526 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8528 @item d
8529 Dynamic rounding mode.  A field in the floating point control register
8530 (@var{fpcr}, see Alpha architecture reference manual) controls the
8531 rounding mode in effect.  The C library initializes this register for
8532 rounding towards plus infinity.  Thus, unless your program modifies the
8533 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8534 @end table
8536 @item -mtrap-precision=@var{trap-precision}
8537 @opindex mtrap-precision
8538 In the Alpha architecture, floating point traps are imprecise.  This
8539 means without software assistance it is impossible to recover from a
8540 floating trap and program execution normally needs to be terminated.
8541 GCC can generate code that can assist operating system trap handlers
8542 in determining the exact location that caused a floating point trap.
8543 Depending on the requirements of an application, different levels of
8544 precisions can be selected:
8546 @table @samp
8547 @item p
8548 Program precision.  This option is the default and means a trap handler
8549 can only identify which program caused a floating point exception.
8551 @item f
8552 Function precision.  The trap handler can determine the function that
8553 caused a floating point exception.
8555 @item i
8556 Instruction precision.  The trap handler can determine the exact
8557 instruction that caused a floating point exception.
8558 @end table
8560 Other Alpha compilers provide the equivalent options called
8561 @option{-scope_safe} and @option{-resumption_safe}.
8563 @item -mieee-conformant
8564 @opindex mieee-conformant
8565 This option marks the generated code as IEEE conformant.  You must not
8566 use this option unless you also specify @option{-mtrap-precision=i} and either
8567 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8568 is to emit the line @samp{.eflag 48} in the function prologue of the
8569 generated assembly file.  Under DEC Unix, this has the effect that
8570 IEEE-conformant math library routines will be linked in.
8572 @item -mbuild-constants
8573 @opindex mbuild-constants
8574 Normally GCC examines a 32- or 64-bit integer constant to
8575 see if it can construct it from smaller constants in two or three
8576 instructions.  If it cannot, it will output the constant as a literal and
8577 generate code to load it from the data segment at runtime.
8579 Use this option to require GCC to construct @emph{all} integer constants
8580 using code, even if it takes more instructions (the maximum is six).
8582 You would typically use this option to build a shared library dynamic
8583 loader.  Itself a shared library, it must relocate itself in memory
8584 before it can find the variables and constants in its own data segment.
8586 @item -malpha-as
8587 @itemx -mgas
8588 @opindex malpha-as
8589 @opindex mgas
8590 Select whether to generate code to be assembled by the vendor-supplied
8591 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8593 @item -mbwx
8594 @itemx -mno-bwx
8595 @itemx -mcix
8596 @itemx -mno-cix
8597 @itemx -mfix
8598 @itemx -mno-fix
8599 @itemx -mmax
8600 @itemx -mno-max
8601 @opindex mbwx
8602 @opindex mno-bwx
8603 @opindex mcix
8604 @opindex mno-cix
8605 @opindex mfix
8606 @opindex mno-fix
8607 @opindex mmax
8608 @opindex mno-max
8609 Indicate whether GCC should generate code to use the optional BWX,
8610 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8611 sets supported by the CPU type specified via @option{-mcpu=} option or that
8612 of the CPU on which GCC was built if none was specified.
8614 @item -mfloat-vax
8615 @itemx -mfloat-ieee
8616 @opindex mfloat-vax
8617 @opindex mfloat-ieee
8618 Generate code that uses (does not use) VAX F and G floating point
8619 arithmetic instead of IEEE single and double precision.
8621 @item -mexplicit-relocs
8622 @itemx -mno-explicit-relocs
8623 @opindex mexplicit-relocs
8624 @opindex mno-explicit-relocs
8625 Older Alpha assemblers provided no way to generate symbol relocations
8626 except via assembler macros.  Use of these macros does not allow
8627 optimal instruction scheduling.  GNU binutils as of version 2.12
8628 supports a new syntax that allows the compiler to explicitly mark
8629 which relocations should apply to which instructions.  This option
8630 is mostly useful for debugging, as GCC detects the capabilities of
8631 the assembler when it is built and sets the default accordingly.
8633 @item -msmall-data
8634 @itemx -mlarge-data
8635 @opindex msmall-data
8636 @opindex mlarge-data
8637 When @option{-mexplicit-relocs} is in effect, static data is
8638 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
8639 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
8640 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
8641 16-bit relocations off of the @code{$gp} register.  This limits the
8642 size of the small data area to 64KB, but allows the variables to be
8643 directly accessed via a single instruction.
8645 The default is @option{-mlarge-data}.  With this option the data area
8646 is limited to just below 2GB@.  Programs that require more than 2GB of
8647 data must use @code{malloc} or @code{mmap} to allocate the data in the
8648 heap instead of in the program's data segment.
8650 When generating code for shared libraries, @option{-fpic} implies
8651 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
8653 @item -msmall-text
8654 @itemx -mlarge-text
8655 @opindex msmall-text
8656 @opindex mlarge-text
8657 When @option{-msmall-text} is used, the compiler assumes that the
8658 code of the entire program (or shared library) fits in 4MB, and is
8659 thus reachable with a branch instruction.  When @option{-msmall-data}
8660 is used, the compiler can assume that all local symbols share the
8661 same @code{$gp} value, and thus reduce the number of instructions
8662 required for a function call from 4 to 1.
8664 The default is @option{-mlarge-text}.
8666 @item -mcpu=@var{cpu_type}
8667 @opindex mcpu
8668 Set the instruction set and instruction scheduling parameters for
8669 machine type @var{cpu_type}.  You can specify either the @samp{EV}
8670 style name or the corresponding chip number.  GCC supports scheduling
8671 parameters for the EV4, EV5 and EV6 family of processors and will
8672 choose the default values for the instruction set from the processor
8673 you specify.  If you do not specify a processor type, GCC will default
8674 to the processor on which the compiler was built.
8676 Supported values for @var{cpu_type} are
8678 @table @samp
8679 @item ev4
8680 @itemx ev45
8681 @itemx 21064
8682 Schedules as an EV4 and has no instruction set extensions.
8684 @item ev5
8685 @itemx 21164
8686 Schedules as an EV5 and has no instruction set extensions.
8688 @item ev56
8689 @itemx 21164a
8690 Schedules as an EV5 and supports the BWX extension.
8692 @item pca56
8693 @itemx 21164pc
8694 @itemx 21164PC
8695 Schedules as an EV5 and supports the BWX and MAX extensions.
8697 @item ev6
8698 @itemx 21264
8699 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
8701 @item ev67
8702 @itemx 21264a
8703 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
8704 @end table
8706 @item -mtune=@var{cpu_type}
8707 @opindex mtune
8708 Set only the instruction scheduling parameters for machine type
8709 @var{cpu_type}.  The instruction set is not changed.
8711 @item -mmemory-latency=@var{time}
8712 @opindex mmemory-latency
8713 Sets the latency the scheduler should assume for typical memory
8714 references as seen by the application.  This number is highly
8715 dependent on the memory access patterns used by the application
8716 and the size of the external cache on the machine.
8718 Valid options for @var{time} are
8720 @table @samp
8721 @item @var{number}
8722 A decimal number representing clock cycles.
8724 @item L1
8725 @itemx L2
8726 @itemx L3
8727 @itemx main
8728 The compiler contains estimates of the number of clock cycles for
8729 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
8730 (also called Dcache, Scache, and Bcache), as well as to main memory.
8731 Note that L3 is only valid for EV5.
8733 @end table
8734 @end table
8736 @node DEC Alpha/VMS Options
8737 @subsection DEC Alpha/VMS Options
8739 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
8741 @table @gcctabopt
8742 @item -mvms-return-codes
8743 @opindex mvms-return-codes
8744 Return VMS condition codes from main.  The default is to return POSIX
8745 style condition (e.g.@ error) codes.
8746 @end table
8748 @node FRV Options
8749 @subsection FRV Options
8750 @cindex FRV Options
8752 @table @gcctabopt
8753 @item -mgpr-32
8754 @opindex mgpr-32
8756 Only use the first 32 general purpose registers.
8758 @item -mgpr-64
8759 @opindex mgpr-64
8761 Use all 64 general purpose registers.
8763 @item -mfpr-32
8764 @opindex mfpr-32
8766 Use only the first 32 floating point registers.
8768 @item -mfpr-64
8769 @opindex mfpr-64
8771 Use all 64 floating point registers
8773 @item -mhard-float
8774 @opindex mhard-float
8776 Use hardware instructions for floating point operations.
8778 @item -msoft-float
8779 @opindex msoft-float
8781 Use library routines for floating point operations.
8783 @item -malloc-cc
8784 @opindex malloc-cc
8786 Dynamically allocate condition code registers.
8788 @item -mfixed-cc
8789 @opindex mfixed-cc
8791 Do not try to dynamically allocate condition code registers, only
8792 use @code{icc0} and @code{fcc0}.
8794 @item -mdword
8795 @opindex mdword
8797 Change ABI to use double word insns.
8799 @item -mno-dword
8800 @opindex mno-dword
8802 Do not use double word instructions.
8804 @item -mdouble
8805 @opindex mdouble
8807 Use floating point double instructions.
8809 @item -mno-double
8810 @opindex mno-double
8812 Do not use floating point double instructions.
8814 @item -mmedia
8815 @opindex mmedia
8817 Use media instructions.
8819 @item -mno-media
8820 @opindex mno-media
8822 Do not use media instructions.
8824 @item -mmuladd
8825 @opindex mmuladd
8827 Use multiply and add/subtract instructions.
8829 @item -mno-muladd
8830 @opindex mno-muladd
8832 Do not use multiply and add/subtract instructions.
8834 @item -mfdpic
8835 @opindex mfdpic
8837 Select the FDPIC ABI, that uses function descriptors to represent
8838 pointers to functions.  Without any PIC/PIE-related options, it
8839 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
8840 assumes GOT entries and small data are within a 12-bit range from the
8841 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
8842 are computed with 32 bits.
8844 @item -minline-plt
8845 @opindex minline-plt
8847 Enable inlining of PLT entries in function calls to functions that are
8848 not known to bind locally.  It has no effect without @option{-mfdpic}.
8849 It's enabled by default if optimizing for speed and compiling for
8850 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
8851 optimization option such as @option{-O3} or above is present in the
8852 command line.
8854 @item -mTLS
8855 @opindex TLS
8857 Assume a large TLS segment when generating thread-local code.
8859 @item -mtls
8860 @opindex tls
8862 Do not assume a large TLS segment when generating thread-local code.
8864 @item -mgprel-ro
8865 @opindex mgprel-ro
8867 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
8868 that is known to be in read-only sections.  It's enabled by default,
8869 except for @option{-fpic} or @option{-fpie}: even though it may help
8870 make the global offset table smaller, it trades 1 instruction for 4.
8871 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
8872 one of which may be shared by multiple symbols, and it avoids the need
8873 for a GOT entry for the referenced symbol, so it's more likely to be a
8874 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
8876 @item -multilib-library-pic
8877 @opindex multilib-library-pic
8879 Link with the (library, not FD) pic libraries.  It's implied by
8880 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
8881 @option{-fpic} without @option{-mfdpic}.  You should never have to use
8882 it explicitly.
8884 @item -mlinked-fp
8885 @opindex mlinked-fp
8887 Follow the EABI requirement of always creating a frame pointer whenever
8888 a stack frame is allocated.  This option is enabled by default and can
8889 be disabled with @option{-mno-linked-fp}.
8891 @item -mlong-calls
8892 @opindex mlong-calls
8894 Use indirect addressing to call functions outside the current
8895 compilation unit.  This allows the functions to be placed anywhere
8896 within the 32-bit address space.
8898 @item -malign-labels
8899 @opindex malign-labels
8901 Try to align labels to an 8-byte boundary by inserting nops into the
8902 previous packet.  This option only has an effect when VLIW packing
8903 is enabled.  It doesn't create new packets; it merely adds nops to
8904 existing ones.
8906 @item -mlibrary-pic
8907 @opindex mlibrary-pic
8909 Generate position-independent EABI code.
8911 @item -macc-4
8912 @opindex macc-4
8914 Use only the first four media accumulator registers.
8916 @item -macc-8
8917 @opindex macc-8
8919 Use all eight media accumulator registers.
8921 @item -mpack
8922 @opindex mpack
8924 Pack VLIW instructions.
8926 @item -mno-pack
8927 @opindex mno-pack
8929 Do not pack VLIW instructions.
8931 @item -mno-eflags
8932 @opindex mno-eflags
8934 Do not mark ABI switches in e_flags.
8936 @item -mcond-move
8937 @opindex mcond-move
8939 Enable the use of conditional-move instructions (default).
8941 This switch is mainly for debugging the compiler and will likely be removed
8942 in a future version.
8944 @item -mno-cond-move
8945 @opindex mno-cond-move
8947 Disable the use of conditional-move instructions.
8949 This switch is mainly for debugging the compiler and will likely be removed
8950 in a future version.
8952 @item -mscc
8953 @opindex mscc
8955 Enable the use of conditional set instructions (default).
8957 This switch is mainly for debugging the compiler and will likely be removed
8958 in a future version.
8960 @item -mno-scc
8961 @opindex mno-scc
8963 Disable the use of conditional set instructions.
8965 This switch is mainly for debugging the compiler and will likely be removed
8966 in a future version.
8968 @item -mcond-exec
8969 @opindex mcond-exec
8971 Enable the use of conditional execution (default).
8973 This switch is mainly for debugging the compiler and will likely be removed
8974 in a future version.
8976 @item -mno-cond-exec
8977 @opindex mno-cond-exec
8979 Disable the use of conditional execution.
8981 This switch is mainly for debugging the compiler and will likely be removed
8982 in a future version.
8984 @item -mvliw-branch
8985 @opindex mvliw-branch
8987 Run a pass to pack branches into VLIW instructions (default).
8989 This switch is mainly for debugging the compiler and will likely be removed
8990 in a future version.
8992 @item -mno-vliw-branch
8993 @opindex mno-vliw-branch
8995 Do not run a pass to pack branches into VLIW instructions.
8997 This switch is mainly for debugging the compiler and will likely be removed
8998 in a future version.
9000 @item -mmulti-cond-exec
9001 @opindex mmulti-cond-exec
9003 Enable optimization of @code{&&} and @code{||} in conditional execution
9004 (default).
9006 This switch is mainly for debugging the compiler and will likely be removed
9007 in a future version.
9009 @item -mno-multi-cond-exec
9010 @opindex mno-multi-cond-exec
9012 Disable optimization of @code{&&} and @code{||} in conditional execution.
9014 This switch is mainly for debugging the compiler and will likely be removed
9015 in a future version.
9017 @item -mnested-cond-exec
9018 @opindex mnested-cond-exec
9020 Enable nested conditional execution optimizations (default).
9022 This switch is mainly for debugging the compiler and will likely be removed
9023 in a future version.
9025 @item -mno-nested-cond-exec
9026 @opindex mno-nested-cond-exec
9028 Disable nested conditional execution optimizations.
9030 This switch is mainly for debugging the compiler and will likely be removed
9031 in a future version.
9033 @item -moptimize-membar
9034 @opindex moptimize-membar
9036 This switch removes redundant @code{membar} instructions from the
9037 compiler generated code.  It is enabled by default.
9039 @item -mno-optimize-membar
9040 @opindex mno-optimize-membar
9042 This switch disables the automatic removal of redundant @code{membar}
9043 instructions from the generated code.
9045 @item -mtomcat-stats
9046 @opindex mtomcat-stats
9048 Cause gas to print out tomcat statistics.
9050 @item -mcpu=@var{cpu}
9051 @opindex mcpu
9053 Select the processor type for which to generate code.  Possible values are
9054 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9055 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9057 @end table
9059 @node GNU/Linux Options
9060 @subsection GNU/Linux Options
9062 These @samp{-m} options are defined for GNU/Linux targets:
9064 @table @gcctabopt
9065 @item -mglibc
9066 @opindex mglibc
9067 Use the GNU C library instead of uClibc.  This is the default except
9068 on @samp{*-*-linux-*uclibc*} targets.
9070 @item -muclibc
9071 @opindex muclibc
9072 Use uClibc instead of the GNU C library.  This is the default on
9073 @samp{*-*-linux-*uclibc*} targets.
9074 @end table
9076 @node H8/300 Options
9077 @subsection H8/300 Options
9079 These @samp{-m} options are defined for the H8/300 implementations:
9081 @table @gcctabopt
9082 @item -mrelax
9083 @opindex mrelax
9084 Shorten some address references at link time, when possible; uses the
9085 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9086 ld, Using ld}, for a fuller description.
9088 @item -mh
9089 @opindex mh
9090 Generate code for the H8/300H@.
9092 @item -ms
9093 @opindex ms
9094 Generate code for the H8S@.
9096 @item -mn
9097 @opindex mn
9098 Generate code for the H8S and H8/300H in the normal mode.  This switch
9099 must be used either with @option{-mh} or @option{-ms}.
9101 @item -ms2600
9102 @opindex ms2600
9103 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9105 @item -mint32
9106 @opindex mint32
9107 Make @code{int} data 32 bits by default.
9109 @item -malign-300
9110 @opindex malign-300
9111 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9112 The default for the H8/300H and H8S is to align longs and floats on 4
9113 byte boundaries.
9114 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9115 This option has no effect on the H8/300.
9116 @end table
9118 @node HPPA Options
9119 @subsection HPPA Options
9120 @cindex HPPA Options
9122 These @samp{-m} options are defined for the HPPA family of computers:
9124 @table @gcctabopt
9125 @item -march=@var{architecture-type}
9126 @opindex march
9127 Generate code for the specified architecture.  The choices for
9128 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9129 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9130 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9131 architecture option for your machine.  Code compiled for lower numbered
9132 architectures will run on higher numbered architectures, but not the
9133 other way around.
9135 @item -mpa-risc-1-0
9136 @itemx -mpa-risc-1-1
9137 @itemx -mpa-risc-2-0
9138 @opindex mpa-risc-1-0
9139 @opindex mpa-risc-1-1
9140 @opindex mpa-risc-2-0
9141 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9143 @item -mbig-switch
9144 @opindex mbig-switch
9145 Generate code suitable for big switch tables.  Use this option only if
9146 the assembler/linker complain about out of range branches within a switch
9147 table.
9149 @item -mjump-in-delay
9150 @opindex mjump-in-delay
9151 Fill delay slots of function calls with unconditional jump instructions
9152 by modifying the return pointer for the function call to be the target
9153 of the conditional jump.
9155 @item -mdisable-fpregs
9156 @opindex mdisable-fpregs
9157 Prevent floating point registers from being used in any manner.  This is
9158 necessary for compiling kernels which perform lazy context switching of
9159 floating point registers.  If you use this option and attempt to perform
9160 floating point operations, the compiler will abort.
9162 @item -mdisable-indexing
9163 @opindex mdisable-indexing
9164 Prevent the compiler from using indexing address modes.  This avoids some
9165 rather obscure problems when compiling MIG generated code under MACH@.
9167 @item -mno-space-regs
9168 @opindex mno-space-regs
9169 Generate code that assumes the target has no space registers.  This allows
9170 GCC to generate faster indirect calls and use unscaled index address modes.
9172 Such code is suitable for level 0 PA systems and kernels.
9174 @item -mfast-indirect-calls
9175 @opindex mfast-indirect-calls
9176 Generate code that assumes calls never cross space boundaries.  This
9177 allows GCC to emit code which performs faster indirect calls.
9179 This option will not work in the presence of shared libraries or nested
9180 functions.
9182 @item -mfixed-range=@var{register-range}
9183 @opindex mfixed-range
9184 Generate code treating the given register range as fixed registers.
9185 A fixed register is one that the register allocator can not use.  This is
9186 useful when compiling kernel code.  A register range is specified as
9187 two registers separated by a dash.  Multiple register ranges can be
9188 specified separated by a comma.
9190 @item -mlong-load-store
9191 @opindex mlong-load-store
9192 Generate 3-instruction load and store sequences as sometimes required by
9193 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9194 the HP compilers.
9196 @item -mportable-runtime
9197 @opindex mportable-runtime
9198 Use the portable calling conventions proposed by HP for ELF systems.
9200 @item -mgas
9201 @opindex mgas
9202 Enable the use of assembler directives only GAS understands.
9204 @item -mschedule=@var{cpu-type}
9205 @opindex mschedule
9206 Schedule code according to the constraints for the machine type
9207 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9208 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9209 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9210 proper scheduling option for your machine.  The default scheduling is
9211 @samp{8000}.
9213 @item -mlinker-opt
9214 @opindex mlinker-opt
9215 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9216 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9217 linkers in which they give bogus error messages when linking some programs.
9219 @item -msoft-float
9220 @opindex msoft-float
9221 Generate output containing library calls for floating point.
9222 @strong{Warning:} the requisite libraries are not available for all HPPA
9223 targets.  Normally the facilities of the machine's usual C compiler are
9224 used, but this cannot be done directly in cross-compilation.  You must make
9225 your own arrangements to provide suitable library functions for
9226 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9227 does provide software floating point support.
9229 @option{-msoft-float} changes the calling convention in the output file;
9230 therefore, it is only useful if you compile @emph{all} of a program with
9231 this option.  In particular, you need to compile @file{libgcc.a}, the
9232 library that comes with GCC, with @option{-msoft-float} in order for
9233 this to work.
9235 @item -msio
9236 @opindex msio
9237 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9238 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9239 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9240 options are available under HP-UX and HI-UX@.
9242 @item -mgnu-ld
9243 @opindex gnu-ld
9244 Use GNU ld specific options.  This passes @option{-shared} to ld when
9245 building a shared library.  It is the default when GCC is configured,
9246 explicitly or implicitly, with the GNU linker.  This option does not
9247 have any affect on which ld is called, it only changes what parameters
9248 are passed to that ld.  The ld that is called is determined by the
9249 @option{--with-ld} configure option, GCC's program search path, and
9250 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9251 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9252 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9254 @item -mhp-ld
9255 @opindex hp-ld
9256 Use HP ld specific options.  This passes @option{-b} to ld when building
9257 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9258 links.  It is the default when GCC is configured, explicitly or
9259 implicitly, with the HP linker.  This option does not have any affect on
9260 which ld is called, it only changes what parameters are passed to that
9261 ld.  The ld that is called is determined by the @option{--with-ld}
9262 configure option, GCC's program search path, and finally by the user's
9263 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9264 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9265 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9267 @item -mlong-calls
9268 @opindex mno-long-calls
9269 Generate code that uses long call sequences.  This ensures that a call
9270 is always able to reach linker generated stubs.  The default is to generate
9271 long calls only when the distance from the call site to the beginning
9272 of the function or translation unit, as the case may be, exceeds a
9273 predefined limit set by the branch type being used.  The limits for
9274 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9275 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9276 240,000 bytes.
9278 Distances are measured from the beginning of functions when using the
9279 @option{-ffunction-sections} option, or when using the @option{-mgas}
9280 and @option{-mno-portable-runtime} options together under HP-UX with
9281 the SOM linker.
9283 It is normally not desirable to use this option as it will degrade
9284 performance.  However, it may be useful in large applications,
9285 particularly when partial linking is used to build the application.
9287 The types of long calls used depends on the capabilities of the
9288 assembler and linker, and the type of code being generated.  The
9289 impact on systems that support long absolute calls, and long pic
9290 symbol-difference or pc-relative calls should be relatively small.
9291 However, an indirect call is used on 32-bit ELF systems in pic code
9292 and it is quite long.
9294 @item -munix=@var{unix-std}
9295 @opindex march
9296 Generate compiler predefines and select a startfile for the specified
9297 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9298 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9299 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9300 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9301 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9302 and later.
9304 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9305 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9306 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9307 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9308 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9309 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9311 It is @emph{important} to note that this option changes the interfaces
9312 for various library routines.  It also affects the operational behavior
9313 of the C library.  Thus, @emph{extreme} care is needed in using this
9314 option.
9316 Library code that is intended to operate with more than one UNIX
9317 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9318 as appropriate.  Most GNU software doesn't provide this capability.
9320 @item -nolibdld
9321 @opindex nolibdld
9322 Suppress the generation of link options to search libdld.sl when the
9323 @option{-static} option is specified on HP-UX 10 and later.
9325 @item -static
9326 @opindex static
9327 The HP-UX implementation of setlocale in libc has a dependency on
9328 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9329 when the @option{-static} option is specified, special link options
9330 are needed to resolve this dependency.
9332 On HP-UX 10 and later, the GCC driver adds the necessary options to
9333 link with libdld.sl when the @option{-static} option is specified.
9334 This causes the resulting binary to be dynamic.  On the 64-bit port,
9335 the linkers generate dynamic binaries by default in any case.  The
9336 @option{-nolibdld} option can be used to prevent the GCC driver from
9337 adding these link options.
9339 @item -threads
9340 @opindex threads
9341 Add support for multithreading with the @dfn{dce thread} library
9342 under HP-UX@.  This option sets flags for both the preprocessor and
9343 linker.
9344 @end table
9346 @node i386 and x86-64 Options
9347 @subsection Intel 386 and AMD x86-64 Options
9348 @cindex i386 Options
9349 @cindex x86-64 Options
9350 @cindex Intel 386 Options
9351 @cindex AMD x86-64 Options
9353 These @samp{-m} options are defined for the i386 and x86-64 family of
9354 computers:
9356 @table @gcctabopt
9357 @item -mtune=@var{cpu-type}
9358 @opindex mtune
9359 Tune to @var{cpu-type} everything applicable about the generated code, except
9360 for the ABI and the set of available instructions.  The choices for
9361 @var{cpu-type} are:
9362 @table @emph
9363 @item generic
9364 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9365 If you know the CPU on which your code will run, then you should use
9366 the corresponding @option{-mtune} option instead of
9367 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9368 of your application will have, then you should use this option.
9370 As new processors are deployed in the marketplace, the behavior of this
9371 option will change.  Therefore, if you upgrade to a newer version of
9372 GCC, the code generated option will change to reflect the processors
9373 that were most common when that version of GCC was released.
9375 There is no @option{-march=generic} option because @option{-march}
9376 indicates the instruction set the compiler can use, and there is no
9377 generic instruction set applicable to all processors.  In contrast,
9378 @option{-mtune} indicates the processor (or, in this case, collection of
9379 processors) for which the code is optimized.
9380 @item native
9381 This selects the CPU to tune for at compilation time by determining
9382 the processor type of the compiling machine.  Using @option{-mtune=native}
9383 will produce code optimized for the local machine under the constraints
9384 of the selected instruction set.  Using @option{-march=native} will
9385 enable all instruction subsets supported by the local machine (hence
9386 the result might not run on different machines).
9387 @item i386
9388 Original Intel's i386 CPU@.
9389 @item i486
9390 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9391 @item i586, pentium
9392 Intel Pentium CPU with no MMX support.
9393 @item pentium-mmx
9394 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9395 @item pentiumpro
9396 Intel PentiumPro CPU@.
9397 @item i686
9398 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9399 instruction set will be used, so the code will run on all i686 family chips.
9400 @item pentium2
9401 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9402 @item pentium3, pentium3m
9403 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9404 support.
9405 @item pentium-m
9406 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9407 support.  Used by Centrino notebooks.
9408 @item pentium4, pentium4m
9409 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9410 @item prescott
9411 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9412 set support.
9413 @item nocona
9414 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9415 SSE2 and SSE3 instruction set support.
9416 @item core2
9417 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9418 instruction set support.
9419 @item k6
9420 AMD K6 CPU with MMX instruction set support.
9421 @item k6-2, k6-3
9422 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9423 @item athlon, athlon-tbird
9424 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9425 support.
9426 @item athlon-4, athlon-xp, athlon-mp
9427 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9428 instruction set support.
9429 @item k8, opteron, athlon64, athlon-fx
9430 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9431 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9432 @item winchip-c6
9433 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9434 set support.
9435 @item winchip2
9436 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9437 instruction set support.
9438 @item c3
9439 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9440 implemented for this chip.)
9441 @item c3-2
9442 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9443 implemented for this chip.)
9444 @item geode
9445 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9446 @end table
9448 While picking a specific @var{cpu-type} will schedule things appropriately
9449 for that particular chip, the compiler will not generate any code that
9450 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9451 being used.
9453 @item -march=@var{cpu-type}
9454 @opindex march
9455 Generate instructions for the machine type @var{cpu-type}.  The choices
9456 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9457 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9459 @item -mcpu=@var{cpu-type}
9460 @opindex mcpu
9461 A deprecated synonym for @option{-mtune}.
9463 @item -m386
9464 @itemx -m486
9465 @itemx -mpentium
9466 @itemx -mpentiumpro
9467 @opindex m386
9468 @opindex m486
9469 @opindex mpentium
9470 @opindex mpentiumpro
9471 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9472 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9473 These synonyms are deprecated.
9475 @item -mfpmath=@var{unit}
9476 @opindex march
9477 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9478 for @var{unit} are:
9480 @table @samp
9481 @item 387
9482 Use the standard 387 floating point coprocessor present majority of chips and
9483 emulated otherwise.  Code compiled with this option will run almost everywhere.
9484 The temporary results are computed in 80bit precision instead of precision
9485 specified by the type resulting in slightly different results compared to most
9486 of other chips.  See @option{-ffloat-store} for more detailed description.
9488 This is the default choice for i386 compiler.
9490 @item sse
9491 Use scalar floating point instructions present in the SSE instruction set.
9492 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9493 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9494 instruction set supports only single precision arithmetics, thus the double and
9495 extended precision arithmetics is still done using 387.  Later version, present
9496 only in Pentium4 and the future AMD x86-64 chips supports double precision
9497 arithmetics too.
9499 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9500 or @option{-msse2} switches to enable SSE extensions and make this option
9501 effective.  For the x86-64 compiler, these extensions are enabled by default.
9503 The resulting code should be considerably faster in the majority of cases and avoid
9504 the numerical instability problems of 387 code, but may break some existing
9505 code that expects temporaries to be 80bit.
9507 This is the default choice for the x86-64 compiler.
9509 @item sse,387
9510 Attempt to utilize both instruction sets at once.  This effectively double the
9511 amount of available registers and on chips with separate execution units for
9512 387 and SSE the execution resources too.  Use this option with care, as it is
9513 still experimental, because the GCC register allocator does not model separate
9514 functional units well resulting in instable performance.
9515 @end table
9517 @item -masm=@var{dialect}
9518 @opindex masm=@var{dialect}
9519 Output asm instructions using selected @var{dialect}.  Supported
9520 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9521 not support @samp{intel}.
9523 @item -mieee-fp
9524 @itemx -mno-ieee-fp
9525 @opindex mieee-fp
9526 @opindex mno-ieee-fp
9527 Control whether or not the compiler uses IEEE floating point
9528 comparisons.  These handle correctly the case where the result of a
9529 comparison is unordered.
9531 @item -msoft-float
9532 @opindex msoft-float
9533 Generate output containing library calls for floating point.
9534 @strong{Warning:} the requisite libraries are not part of GCC@.
9535 Normally the facilities of the machine's usual C compiler are used, but
9536 this can't be done directly in cross-compilation.  You must make your
9537 own arrangements to provide suitable library functions for
9538 cross-compilation.
9540 On machines where a function returns floating point results in the 80387
9541 register stack, some floating point opcodes may be emitted even if
9542 @option{-msoft-float} is used.
9544 @item -mno-fp-ret-in-387
9545 @opindex mno-fp-ret-in-387
9546 Do not use the FPU registers for return values of functions.
9548 The usual calling convention has functions return values of types
9549 @code{float} and @code{double} in an FPU register, even if there
9550 is no FPU@.  The idea is that the operating system should emulate
9551 an FPU@.
9553 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9554 in ordinary CPU registers instead.
9556 @item -mno-fancy-math-387
9557 @opindex mno-fancy-math-387
9558 Some 387 emulators do not support the @code{sin}, @code{cos} and
9559 @code{sqrt} instructions for the 387.  Specify this option to avoid
9560 generating those instructions.  This option is the default on FreeBSD,
9561 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9562 indicates that the target cpu will always have an FPU and so the
9563 instruction will not need emulation.  As of revision 2.6.1, these
9564 instructions are not generated unless you also use the
9565 @option{-funsafe-math-optimizations} switch.
9567 @item -malign-double
9568 @itemx -mno-align-double
9569 @opindex malign-double
9570 @opindex mno-align-double
9571 Control whether GCC aligns @code{double}, @code{long double}, and
9572 @code{long long} variables on a two word boundary or a one word
9573 boundary.  Aligning @code{double} variables on a two word boundary will
9574 produce code that runs somewhat faster on a @samp{Pentium} at the
9575 expense of more memory.
9577 On x86-64, @option{-malign-double} is enabled by default.
9579 @strong{Warning:} if you use the @option{-malign-double} switch,
9580 structures containing the above types will be aligned differently than
9581 the published application binary interface specifications for the 386
9582 and will not be binary compatible with structures in code compiled
9583 without that switch.
9585 @item -m96bit-long-double
9586 @itemx -m128bit-long-double
9587 @opindex m96bit-long-double
9588 @opindex m128bit-long-double
9589 These switches control the size of @code{long double} type.  The i386
9590 application binary interface specifies the size to be 96 bits,
9591 so @option{-m96bit-long-double} is the default in 32 bit mode.
9593 Modern architectures (Pentium and newer) would prefer @code{long double}
9594 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9595 conforming to the ABI, this would not be possible.  So specifying a
9596 @option{-m128bit-long-double} will align @code{long double}
9597 to a 16 byte boundary by padding the @code{long double} with an additional
9598 32 bit zero.
9600 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9601 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9603 Notice that neither of these options enable any extra precision over the x87
9604 standard of 80 bits for a @code{long double}.
9606 @strong{Warning:} if you override the default value for your target ABI, the
9607 structures and arrays containing @code{long double} variables will change
9608 their size as well as function calling convention for function taking
9609 @code{long double} will be modified.  Hence they will not be binary
9610 compatible with arrays or structures in code compiled without that switch.
9612 @item -mmlarge-data-threshold=@var{number}
9613 @opindex mlarge-data-threshold=@var{number}
9614 When @option{-mcmodel=medium} is specified, the data greater than
9615 @var{threshold} are placed in large data section.  This value must be the
9616 same across all object linked into the binary and defaults to 65535.
9618 @item -msvr3-shlib
9619 @itemx -mno-svr3-shlib
9620 @opindex msvr3-shlib
9621 @opindex mno-svr3-shlib
9622 Control whether GCC places uninitialized local variables into the
9623 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9624 into @code{bss}.  These options are meaningful only on System V Release 3.
9626 @item -mrtd
9627 @opindex mrtd
9628 Use a different function-calling convention, in which functions that
9629 take a fixed number of arguments return with the @code{ret} @var{num}
9630 instruction, which pops their arguments while returning.  This saves one
9631 instruction in the caller since there is no need to pop the arguments
9632 there.
9634 You can specify that an individual function is called with this calling
9635 sequence with the function attribute @samp{stdcall}.  You can also
9636 override the @option{-mrtd} option by using the function attribute
9637 @samp{cdecl}.  @xref{Function Attributes}.
9639 @strong{Warning:} this calling convention is incompatible with the one
9640 normally used on Unix, so you cannot use it if you need to call
9641 libraries compiled with the Unix compiler.
9643 Also, you must provide function prototypes for all functions that
9644 take variable numbers of arguments (including @code{printf});
9645 otherwise incorrect code will be generated for calls to those
9646 functions.
9648 In addition, seriously incorrect code will result if you call a
9649 function with too many arguments.  (Normally, extra arguments are
9650 harmlessly ignored.)
9652 @item -mregparm=@var{num}
9653 @opindex mregparm
9654 Control how many registers are used to pass integer arguments.  By
9655 default, no registers are used to pass arguments, and at most 3
9656 registers can be used.  You can control this behavior for a specific
9657 function by using the function attribute @samp{regparm}.
9658 @xref{Function Attributes}.
9660 @strong{Warning:} if you use this switch, and
9661 @var{num} is nonzero, then you must build all modules with the same
9662 value, including any libraries.  This includes the system libraries and
9663 startup modules.
9665 @item -msseregparm
9666 @opindex msseregparm
9667 Use SSE register passing conventions for float and double arguments
9668 and return values.  You can control this behavior for a specific
9669 function by using the function attribute @samp{sseregparm}.
9670 @xref{Function Attributes}.
9672 @strong{Warning:} if you use this switch then you must build all
9673 modules with the same value, including any libraries.  This includes
9674 the system libraries and startup modules.
9676 @item -mstackrealign
9677 @opindex mstackrealign
9678 Realign the stack at entry.  On the Intel x86, the
9679 @option{-mstackrealign} option will generate an alternate prologue and
9680 epilogue that realigns the runtime stack.  This supports mixing legacy
9681 codes that keep a 4-byte aligned stack with modern codes that keep a
9682 16-byte stack for SSE compatibility.  The alternate prologue and
9683 epilogue are slower and bigger than the regular ones, and the
9684 alternate prologue requires an extra scratch register; this lowers the
9685 number of registers available if used in conjunction with the
9686 @code{regparm} attribute.  The @option{-mstackrealign} option is
9687 incompatible with the nested function prologue; this is considered a
9688 hard error.  See also the attribute @code{force_align_arg_pointer},
9689 applicable to individual functions.
9691 @item -mpreferred-stack-boundary=@var{num}
9692 @opindex mpreferred-stack-boundary
9693 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
9694 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
9695 the default is 4 (16 bytes or 128 bits).
9697 On Pentium and PentiumPro, @code{double} and @code{long double} values
9698 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
9699 suffer significant run time performance penalties.  On Pentium III, the
9700 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
9701 properly if it is not 16 byte aligned.
9703 To ensure proper alignment of this values on the stack, the stack boundary
9704 must be as aligned as that required by any value stored on the stack.
9705 Further, every function must be generated such that it keeps the stack
9706 aligned.  Thus calling a function compiled with a higher preferred
9707 stack boundary from a function compiled with a lower preferred stack
9708 boundary will most likely misalign the stack.  It is recommended that
9709 libraries that use callbacks always use the default setting.
9711 This extra alignment does consume extra stack space, and generally
9712 increases code size.  Code that is sensitive to stack space usage, such
9713 as embedded systems and operating system kernels, may want to reduce the
9714 preferred alignment to @option{-mpreferred-stack-boundary=2}.
9716 @item -mmmx
9717 @itemx -mno-mmx
9718 @item -msse
9719 @itemx -mno-sse
9720 @item -msse2
9721 @itemx -mno-sse2
9722 @item -msse3
9723 @itemx -mno-sse3
9724 @item -mssse3
9725 @itemx -mno-ssse3
9726 @item -m3dnow
9727 @itemx -mno-3dnow
9728 @opindex mmmx
9729 @opindex mno-mmx
9730 @opindex msse
9731 @opindex mno-sse
9732 @opindex m3dnow
9733 @opindex mno-3dnow
9734 These switches enable or disable the use of instructions in the MMX,
9735 SSE, SSE2, SSE3, SSSE3 or 3DNow! extended instruction sets.
9736 These extensions are also available as built-in functions: see
9737 @ref{X86 Built-in Functions}, for details of the functions enabled and
9738 disabled by these switches.
9740 To have SSE/SSE2 instructions generated automatically from floating-point
9741 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
9743 These options will enable GCC to use these extended instructions in
9744 generated code, even without @option{-mfpmath=sse}.  Applications which
9745 perform runtime CPU detection must compile separate files for each
9746 supported architecture, using the appropriate flags.  In particular,
9747 the file containing the CPU detection code should be compiled without
9748 these options.
9750 @item -mpush-args
9751 @itemx -mno-push-args
9752 @opindex mpush-args
9753 @opindex mno-push-args
9754 Use PUSH operations to store outgoing parameters.  This method is shorter
9755 and usually equally fast as method using SUB/MOV operations and is enabled
9756 by default.  In some cases disabling it may improve performance because of
9757 improved scheduling and reduced dependencies.
9759 @item -maccumulate-outgoing-args
9760 @opindex maccumulate-outgoing-args
9761 If enabled, the maximum amount of space required for outgoing arguments will be
9762 computed in the function prologue.  This is faster on most modern CPUs
9763 because of reduced dependencies, improved scheduling and reduced stack usage
9764 when preferred stack boundary is not equal to 2.  The drawback is a notable
9765 increase in code size.  This switch implies @option{-mno-push-args}.
9767 @item -mthreads
9768 @opindex mthreads
9769 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
9770 on thread-safe exception handling must compile and link all code with the
9771 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
9772 @option{-D_MT}; when linking, it links in a special thread helper library
9773 @option{-lmingwthrd} which cleans up per thread exception handling data.
9775 @item -mno-align-stringops
9776 @opindex mno-align-stringops
9777 Do not align destination of inlined string operations.  This switch reduces
9778 code size and improves performance in case the destination is already aligned,
9779 but GCC doesn't know about it.
9781 @item -minline-all-stringops
9782 @opindex minline-all-stringops
9783 By default GCC inlines string operations only when destination is known to be
9784 aligned at least to 4 byte boundary.  This enables more inlining, increase code
9785 size, but may improve performance of code that depends on fast memcpy, strlen
9786 and memset for short lengths.
9788 @item -minline-stringops-dynamically
9789 @opindex minline-stringops-dynamically
9790 For string operation of unknown size, inline runtime checks so for small
9791 blocks inline code is used, while for large blocks library call is used.
9793 @item -mstringop-strategy=@var{alg}
9794 @opindex mstringop-strategy=@var{alg}
9795 Overwrite internal decision heuristic about particular algorithm to inline
9796 string operation with.  The allowed values are @code{rep_byte},
9797 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
9798 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
9799 expanding inline loop, @code{libcall} for always expanding library call.
9801 @item -momit-leaf-frame-pointer
9802 @opindex momit-leaf-frame-pointer
9803 Don't keep the frame pointer in a register for leaf functions.  This
9804 avoids the instructions to save, set up and restore frame pointers and
9805 makes an extra register available in leaf functions.  The option
9806 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9807 which might make debugging harder.
9809 @item -mtls-direct-seg-refs
9810 @itemx -mno-tls-direct-seg-refs
9811 @opindex mtls-direct-seg-refs
9812 Controls whether TLS variables may be accessed with offsets from the
9813 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
9814 or whether the thread base pointer must be added.  Whether or not this
9815 is legal depends on the operating system, and whether it maps the
9816 segment to cover the entire TLS area.
9818 For systems that use GNU libc, the default is on.
9819 @end table
9821 These @samp{-m} switches are supported in addition to the above
9822 on AMD x86-64 processors in 64-bit environments.
9824 @table @gcctabopt
9825 @item -m32
9826 @itemx -m64
9827 @opindex m32
9828 @opindex m64
9829 Generate code for a 32-bit or 64-bit environment.
9830 The 32-bit environment sets int, long and pointer to 32 bits and
9831 generates code that runs on any i386 system.
9832 The 64-bit environment sets int to 32 bits and long and pointer
9833 to 64 bits and generates code for AMD's x86-64 architecture.
9835 @item -mno-red-zone
9836 @opindex no-red-zone
9837 Do not use a so called red zone for x86-64 code.  The red zone is mandated
9838 by the x86-64 ABI, it is a 128-byte area beyond the location of the
9839 stack pointer that will not be modified by signal or interrupt handlers
9840 and therefore can be used for temporary data without adjusting the stack
9841 pointer.  The flag @option{-mno-red-zone} disables this red zone.
9843 @item -mcmodel=small
9844 @opindex mcmodel=small
9845 Generate code for the small code model: the program and its symbols must
9846 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
9847 Programs can be statically or dynamically linked.  This is the default
9848 code model.
9850 @item -mcmodel=kernel
9851 @opindex mcmodel=kernel
9852 Generate code for the kernel code model.  The kernel runs in the
9853 negative 2 GB of the address space.
9854 This model has to be used for Linux kernel code.
9856 @item -mcmodel=medium
9857 @opindex mcmodel=medium
9858 Generate code for the medium model: The program is linked in the lower 2
9859 GB of the address space but symbols can be located anywhere in the
9860 address space.  Programs can be statically or dynamically linked, but
9861 building of shared libraries are not supported with the medium model.
9863 @item -mcmodel=large
9864 @opindex mcmodel=large
9865 Generate code for the large model: This model makes no assumptions
9866 about addresses and sizes of sections.  Currently GCC does not implement
9867 this model.
9868 @end table
9870 @node IA-64 Options
9871 @subsection IA-64 Options
9872 @cindex IA-64 Options
9874 These are the @samp{-m} options defined for the Intel IA-64 architecture.
9876 @table @gcctabopt
9877 @item -mbig-endian
9878 @opindex mbig-endian
9879 Generate code for a big endian target.  This is the default for HP-UX@.
9881 @item -mlittle-endian
9882 @opindex mlittle-endian
9883 Generate code for a little endian target.  This is the default for AIX5
9884 and GNU/Linux.
9886 @item -mgnu-as
9887 @itemx -mno-gnu-as
9888 @opindex mgnu-as
9889 @opindex mno-gnu-as
9890 Generate (or don't) code for the GNU assembler.  This is the default.
9891 @c Also, this is the default if the configure option @option{--with-gnu-as}
9892 @c is used.
9894 @item -mgnu-ld
9895 @itemx -mno-gnu-ld
9896 @opindex mgnu-ld
9897 @opindex mno-gnu-ld
9898 Generate (or don't) code for the GNU linker.  This is the default.
9899 @c Also, this is the default if the configure option @option{--with-gnu-ld}
9900 @c is used.
9902 @item -mno-pic
9903 @opindex mno-pic
9904 Generate code that does not use a global pointer register.  The result
9905 is not position independent code, and violates the IA-64 ABI@.
9907 @item -mvolatile-asm-stop
9908 @itemx -mno-volatile-asm-stop
9909 @opindex mvolatile-asm-stop
9910 @opindex mno-volatile-asm-stop
9911 Generate (or don't) a stop bit immediately before and after volatile asm
9912 statements.
9914 @item -mregister-names
9915 @itemx -mno-register-names
9916 @opindex mregister-names
9917 @opindex mno-register-names
9918 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
9919 the stacked registers.  This may make assembler output more readable.
9921 @item -mno-sdata
9922 @itemx -msdata
9923 @opindex mno-sdata
9924 @opindex msdata
9925 Disable (or enable) optimizations that use the small data section.  This may
9926 be useful for working around optimizer bugs.
9928 @item -mconstant-gp
9929 @opindex mconstant-gp
9930 Generate code that uses a single constant global pointer value.  This is
9931 useful when compiling kernel code.
9933 @item -mauto-pic
9934 @opindex mauto-pic
9935 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
9936 This is useful when compiling firmware code.
9938 @item -minline-float-divide-min-latency
9939 @opindex minline-float-divide-min-latency
9940 Generate code for inline divides of floating point values
9941 using the minimum latency algorithm.
9943 @item -minline-float-divide-max-throughput
9944 @opindex minline-float-divide-max-throughput
9945 Generate code for inline divides of floating point values
9946 using the maximum throughput algorithm.
9948 @item -minline-int-divide-min-latency
9949 @opindex minline-int-divide-min-latency
9950 Generate code for inline divides of integer values
9951 using the minimum latency algorithm.
9953 @item -minline-int-divide-max-throughput
9954 @opindex minline-int-divide-max-throughput
9955 Generate code for inline divides of integer values
9956 using the maximum throughput algorithm.
9958 @item -minline-sqrt-min-latency
9959 @opindex minline-sqrt-min-latency
9960 Generate code for inline square roots
9961 using the minimum latency algorithm.
9963 @item -minline-sqrt-max-throughput
9964 @opindex minline-sqrt-max-throughput
9965 Generate code for inline square roots
9966 using the maximum throughput algorithm.
9968 @item -mno-dwarf2-asm
9969 @itemx -mdwarf2-asm
9970 @opindex mno-dwarf2-asm
9971 @opindex mdwarf2-asm
9972 Don't (or do) generate assembler code for the DWARF2 line number debugging
9973 info.  This may be useful when not using the GNU assembler.
9975 @item -mearly-stop-bits
9976 @itemx -mno-early-stop-bits
9977 @opindex mearly-stop-bits
9978 @opindex mno-early-stop-bits
9979 Allow stop bits to be placed earlier than immediately preceding the
9980 instruction that triggered the stop bit.  This can improve instruction
9981 scheduling, but does not always do so.
9983 @item -mfixed-range=@var{register-range}
9984 @opindex mfixed-range
9985 Generate code treating the given register range as fixed registers.
9986 A fixed register is one that the register allocator can not use.  This is
9987 useful when compiling kernel code.  A register range is specified as
9988 two registers separated by a dash.  Multiple register ranges can be
9989 specified separated by a comma.
9991 @item -mtls-size=@var{tls-size}
9992 @opindex mtls-size
9993 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
9996 @item -mtune=@var{cpu-type}
9997 @opindex mtune
9998 Tune the instruction scheduling for a particular CPU, Valid values are
9999 itanium, itanium1, merced, itanium2, and mckinley.
10001 @item -mt
10002 @itemx -pthread
10003 @opindex mt
10004 @opindex pthread
10005 Add support for multithreading using the POSIX threads library.  This
10006 option sets flags for both the preprocessor and linker.  It does
10007 not affect the thread safety of object code produced by the compiler or
10008 that of libraries supplied with it.  These are HP-UX specific flags.
10010 @item -milp32
10011 @itemx -mlp64
10012 @opindex milp32
10013 @opindex mlp64
10014 Generate code for a 32-bit or 64-bit environment.
10015 The 32-bit environment sets int, long and pointer to 32 bits.
10016 The 64-bit environment sets int to 32 bits and long and pointer
10017 to 64 bits.  These are HP-UX specific flags.
10019 @item -mno-sched-br-data-spec
10020 @itemx -msched-br-data-spec
10021 @opindex -mno-sched-br-data-spec
10022 @opindex -msched-br-data-spec
10023 (Dis/En)able data speculative scheduling before reload.
10024 This will result in generation of the ld.a instructions and
10025 the corresponding check instructions (ld.c / chk.a).
10026 The default is 'disable'.
10028 @item -msched-ar-data-spec
10029 @itemx -mno-sched-ar-data-spec
10030 @opindex -msched-ar-data-spec
10031 @opindex -mno-sched-ar-data-spec
10032 (En/Dis)able data speculative scheduling after reload.
10033 This will result in generation of the ld.a instructions and
10034 the corresponding check instructions (ld.c / chk.a).
10035 The default is 'enable'.
10037 @item -mno-sched-control-spec
10038 @itemx -msched-control-spec
10039 @opindex -mno-sched-control-spec
10040 @opindex -msched-control-spec
10041 (Dis/En)able control speculative scheduling.  This feature is
10042 available only during region scheduling (i.e. before reload).
10043 This will result in generation of the ld.s instructions and
10044 the corresponding check instructions chk.s .
10045 The default is 'disable'.
10047 @item -msched-br-in-data-spec
10048 @itemx -mno-sched-br-in-data-spec
10049 @opindex -msched-br-in-data-spec
10050 @opindex -mno-sched-br-in-data-spec
10051 (En/Dis)able speculative scheduling of the instructions that
10052 are dependent on the data speculative loads before reload.
10053 This is effective only with @option{-msched-br-data-spec} enabled.
10054 The default is 'enable'.
10056 @item -msched-ar-in-data-spec
10057 @itemx -mno-sched-ar-in-data-spec
10058 @opindex -msched-ar-in-data-spec
10059 @opindex -mno-sched-ar-in-data-spec
10060 (En/Dis)able speculative scheduling of the instructions that
10061 are dependent on the data speculative loads after reload.
10062 This is effective only with @option{-msched-ar-data-spec} enabled.
10063 The default is 'enable'.
10065 @item -msched-in-control-spec
10066 @itemx -mno-sched-in-control-spec
10067 @opindex -msched-in-control-spec
10068 @opindex -mno-sched-in-control-spec
10069 (En/Dis)able speculative scheduling of the instructions that
10070 are dependent on the control speculative loads.
10071 This is effective only with @option{-msched-control-spec} enabled.
10072 The default is 'enable'.
10074 @item -msched-ldc
10075 @itemx -mno-sched-ldc
10076 @opindex -msched-ldc
10077 @opindex -mno-sched-ldc
10078 (En/Dis)able use of simple data speculation checks ld.c .
10079 If disabled, only chk.a instructions will be emitted to check
10080 data speculative loads.
10081 The default is 'enable'.
10083 @item -mno-sched-control-ldc
10084 @itemx -msched-control-ldc
10085 @opindex -mno-sched-control-ldc
10086 @opindex -msched-control-ldc 
10087 (Dis/En)able use of ld.c instructions to check control speculative loads.
10088 If enabled, in case of control speculative load with no speculatively
10089 scheduled dependent instructions this load will be emitted as ld.sa and
10090 ld.c will be used to check it.
10091 The default is 'disable'.
10093 @item -mno-sched-spec-verbose
10094 @itemx -msched-spec-verbose
10095 @opindex -mno-sched-spec-verbose
10096 @opindex -msched-spec-verbose
10097 (Dis/En)able printing of the information about speculative motions.
10099 @item -mno-sched-prefer-non-data-spec-insns
10100 @itemx -msched-prefer-non-data-spec-insns
10101 @opindex -mno-sched-prefer-non-data-spec-insns
10102 @opindex -msched-prefer-non-data-spec-insns
10103 If enabled, data speculative instructions will be chosen for schedule
10104 only if there are no other choices at the moment.  This will make
10105 the use of the data speculation much more conservative.
10106 The default is 'disable'.
10108 @item -mno-sched-prefer-non-control-spec-insns
10109 @itemx -msched-prefer-non-control-spec-insns
10110 @opindex -mno-sched-prefer-non-control-spec-insns
10111 @opindex -msched-prefer-non-control-spec-insns
10112 If enabled, control speculative instructions will be chosen for schedule
10113 only if there are no other choices at the moment.  This will make
10114 the use of the control speculation much more conservative.
10115 The default is 'disable'.
10117 @item -mno-sched-count-spec-in-critical-path
10118 @itemx -msched-count-spec-in-critical-path
10119 @opindex -mno-sched-count-spec-in-critical-path
10120 @opindex -msched-count-spec-in-critical-path
10121 If enabled, speculative dependencies will be considered during
10122 computation of the instructions priorities.  This will make the use of the
10123 speculation a bit more conservative.
10124 The default is 'disable'.
10126 @end table
10128 @node M32C Options
10129 @subsection M32C Options
10130 @cindex M32C options
10132 @table @gcctabopt
10133 @item -mcpu=@var{name}
10134 @opindex mcpu=
10135 Select the CPU for which code is generated.  @var{name} may be one of
10136 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10137 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10138 the M32C/80 series.
10140 @item -msim
10141 @opindex msim
10142 Specifies that the program will be run on the simulator.  This causes
10143 an alternate runtime library to be linked in which supports, for
10144 example, file I/O.  You must not use this option when generating
10145 programs that will run on real hardware; you must provide your own
10146 runtime library for whatever I/O functions are needed.
10148 @item -memregs=@var{number}
10149 @opindex memregs=
10150 Specifies the number of memory-based pseudo-registers GCC will use
10151 during code generation.  These pseudo-registers will be used like real
10152 registers, so there is a tradeoff between GCC's ability to fit the
10153 code into available registers, and the performance penalty of using
10154 memory instead of registers.  Note that all modules in a program must
10155 be compiled with the same value for this option.  Because of that, you
10156 must not use this option with the default runtime libraries gcc
10157 builds.
10159 @end table
10161 @node M32R/D Options
10162 @subsection M32R/D Options
10163 @cindex M32R/D options
10165 These @option{-m} options are defined for Renesas M32R/D architectures:
10167 @table @gcctabopt
10168 @item -m32r2
10169 @opindex m32r2
10170 Generate code for the M32R/2@.
10172 @item -m32rx
10173 @opindex m32rx
10174 Generate code for the M32R/X@.
10176 @item -m32r
10177 @opindex m32r
10178 Generate code for the M32R@.  This is the default.
10180 @item -mmodel=small
10181 @opindex mmodel=small
10182 Assume all objects live in the lower 16MB of memory (so that their addresses
10183 can be loaded with the @code{ld24} instruction), and assume all subroutines
10184 are reachable with the @code{bl} instruction.
10185 This is the default.
10187 The addressability of a particular object can be set with the
10188 @code{model} attribute.
10190 @item -mmodel=medium
10191 @opindex mmodel=medium
10192 Assume objects may be anywhere in the 32-bit address space (the compiler
10193 will generate @code{seth/add3} instructions to load their addresses), and
10194 assume all subroutines are reachable with the @code{bl} instruction.
10196 @item -mmodel=large
10197 @opindex mmodel=large
10198 Assume objects may be anywhere in the 32-bit address space (the compiler
10199 will generate @code{seth/add3} instructions to load their addresses), and
10200 assume subroutines may not be reachable with the @code{bl} instruction
10201 (the compiler will generate the much slower @code{seth/add3/jl}
10202 instruction sequence).
10204 @item -msdata=none
10205 @opindex msdata=none
10206 Disable use of the small data area.  Variables will be put into
10207 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10208 @code{section} attribute has been specified).
10209 This is the default.
10211 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10212 Objects may be explicitly put in the small data area with the
10213 @code{section} attribute using one of these sections.
10215 @item -msdata=sdata
10216 @opindex msdata=sdata
10217 Put small global and static data in the small data area, but do not
10218 generate special code to reference them.
10220 @item -msdata=use
10221 @opindex msdata=use
10222 Put small global and static data in the small data area, and generate
10223 special instructions to reference them.
10225 @item -G @var{num}
10226 @opindex G
10227 @cindex smaller data references
10228 Put global and static objects less than or equal to @var{num} bytes
10229 into the small data or bss sections instead of the normal data or bss
10230 sections.  The default value of @var{num} is 8.
10231 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10232 for this option to have any effect.
10234 All modules should be compiled with the same @option{-G @var{num}} value.
10235 Compiling with different values of @var{num} may or may not work; if it
10236 doesn't the linker will give an error message---incorrect code will not be
10237 generated.
10239 @item -mdebug
10240 @opindex mdebug
10241 Makes the M32R specific code in the compiler display some statistics
10242 that might help in debugging programs.
10244 @item -malign-loops
10245 @opindex malign-loops
10246 Align all loops to a 32-byte boundary.
10248 @item -mno-align-loops
10249 @opindex mno-align-loops
10250 Do not enforce a 32-byte alignment for loops.  This is the default.
10252 @item -missue-rate=@var{number}
10253 @opindex missue-rate=@var{number}
10254 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10255 or 2.
10257 @item -mbranch-cost=@var{number}
10258 @opindex mbranch-cost=@var{number}
10259 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10260 preferred over conditional code, if it is 2, then the opposite will
10261 apply.
10263 @item -mflush-trap=@var{number}
10264 @opindex mflush-trap=@var{number}
10265 Specifies the trap number to use to flush the cache.  The default is
10266 12.  Valid numbers are between 0 and 15 inclusive.
10268 @item -mno-flush-trap
10269 @opindex mno-flush-trap
10270 Specifies that the cache cannot be flushed by using a trap.
10272 @item -mflush-func=@var{name}
10273 @opindex mflush-func=@var{name}
10274 Specifies the name of the operating system function to call to flush
10275 the cache.  The default is @emph{_flush_cache}, but a function call
10276 will only be used if a trap is not available.
10278 @item -mno-flush-func
10279 @opindex mno-flush-func
10280 Indicates that there is no OS function for flushing the cache.
10282 @end table
10284 @node M680x0 Options
10285 @subsection M680x0 Options
10286 @cindex M680x0 options
10288 These are the @samp{-m} options defined for the 68000 series.  The default
10289 values for these options depends on which style of 68000 was selected when
10290 the compiler was configured; the defaults for the most common choices are
10291 given below.
10293 @table @gcctabopt
10294 @item -m68000
10295 @itemx -mc68000
10296 @opindex m68000
10297 @opindex mc68000
10298 Generate output for a 68000.  This is the default
10299 when the compiler is configured for 68000-based systems.
10301 Use this option for microcontrollers with a 68000 or EC000 core,
10302 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10304 @item -m68020
10305 @itemx -mc68020
10306 @opindex m68020
10307 @opindex mc68020
10308 Generate output for a 68020.  This is the default
10309 when the compiler is configured for 68020-based systems.
10311 @item -m68881
10312 @opindex m68881
10313 Generate output containing 68881 instructions for floating point.
10314 This is the default for most 68020 systems unless @option{--nfp} was
10315 specified when the compiler was configured.
10317 @item -m68030
10318 @opindex m68030
10319 Generate output for a 68030.  This is the default when the compiler is
10320 configured for 68030-based systems.
10322 @item -m68040
10323 @opindex m68040
10324 Generate output for a 68040.  This is the default when the compiler is
10325 configured for 68040-based systems.
10327 This option inhibits the use of 68881/68882 instructions that have to be
10328 emulated by software on the 68040.  Use this option if your 68040 does not
10329 have code to emulate those instructions.
10331 @item -m68060
10332 @opindex m68060
10333 Generate output for a 68060.  This is the default when the compiler is
10334 configured for 68060-based systems.
10336 This option inhibits the use of 68020 and 68881/68882 instructions that
10337 have to be emulated by software on the 68060.  Use this option if your 68060
10338 does not have code to emulate those instructions.
10340 @item -mcpu32
10341 @opindex mcpu32
10342 Generate output for a CPU32.  This is the default
10343 when the compiler is configured for CPU32-based systems.
10345 Use this option for microcontrollers with a
10346 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
10347 68336, 68340, 68341, 68349 and 68360.
10349 @item -m5200
10350 @opindex m5200
10351 Generate output for a 520X ``coldfire'' family cpu.  This is the default
10352 when the compiler is configured for 520X-based systems.
10354 Use this option for microcontroller with a 5200 core, including
10355 the MCF5202, MCF5203, MCF5204 and MCF5202.
10357 @item -mcfv4e
10358 @opindex mcfv4e
10359 Generate output for a ColdFire V4e family cpu (e.g.@: 547x/548x).
10360 This includes use of hardware floating point instructions.
10362 @item -m68020-40
10363 @opindex m68020-40
10364 Generate output for a 68040, without using any of the new instructions.
10365 This results in code which can run relatively efficiently on either a
10366 68020/68881 or a 68030 or a 68040.  The generated code does use the
10367 68881 instructions that are emulated on the 68040.
10369 @item -m68020-60
10370 @opindex m68020-60
10371 Generate output for a 68060, without using any of the new instructions.
10372 This results in code which can run relatively efficiently on either a
10373 68020/68881 or a 68030 or a 68040.  The generated code does use the
10374 68881 instructions that are emulated on the 68060.
10376 @item -msoft-float
10377 @opindex msoft-float
10378 Generate output containing library calls for floating point.
10379 @strong{Warning:} the requisite libraries are not available for all m68k
10380 targets.  Normally the facilities of the machine's usual C compiler are
10381 used, but this can't be done directly in cross-compilation.  You must
10382 make your own arrangements to provide suitable library functions for
10383 cross-compilation.  The embedded targets @samp{m68k-*-aout} and
10384 @samp{m68k-*-coff} do provide software floating point support.
10386 @item -mshort
10387 @opindex mshort
10388 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10389 Additionally, parameters passed on the stack are also aligned to a
10390 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10392 @item -mnobitfield
10393 @opindex mnobitfield
10394 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10395 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10397 @item -mbitfield
10398 @opindex mbitfield
10399 Do use the bit-field instructions.  The @option{-m68020} option implies
10400 @option{-mbitfield}.  This is the default if you use a configuration
10401 designed for a 68020.
10403 @item -mrtd
10404 @opindex mrtd
10405 Use a different function-calling convention, in which functions
10406 that take a fixed number of arguments return with the @code{rtd}
10407 instruction, which pops their arguments while returning.  This
10408 saves one instruction in the caller since there is no need to pop
10409 the arguments there.
10411 This calling convention is incompatible with the one normally
10412 used on Unix, so you cannot use it if you need to call libraries
10413 compiled with the Unix compiler.
10415 Also, you must provide function prototypes for all functions that
10416 take variable numbers of arguments (including @code{printf});
10417 otherwise incorrect code will be generated for calls to those
10418 functions.
10420 In addition, seriously incorrect code will result if you call a
10421 function with too many arguments.  (Normally, extra arguments are
10422 harmlessly ignored.)
10424 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10425 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10427 @item -malign-int
10428 @itemx -mno-align-int
10429 @opindex malign-int
10430 @opindex mno-align-int
10431 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10432 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10433 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10434 Aligning variables on 32-bit boundaries produces code that runs somewhat
10435 faster on processors with 32-bit busses at the expense of more memory.
10437 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
10438 align structures containing the above types  differently than
10439 most published application binary interface specifications for the m68k.
10441 @item -mpcrel
10442 @opindex mpcrel
10443 Use the pc-relative addressing mode of the 68000 directly, instead of
10444 using a global offset table.  At present, this option implies @option{-fpic},
10445 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
10446 not presently supported with @option{-mpcrel}, though this could be supported for
10447 68020 and higher processors.
10449 @item -mno-strict-align
10450 @itemx -mstrict-align
10451 @opindex mno-strict-align
10452 @opindex mstrict-align
10453 Do not (do) assume that unaligned memory references will be handled by
10454 the system.
10456 @item -msep-data
10457 Generate code that allows the data segment to be located in a different
10458 area of memory from the text segment.  This allows for execute in place in
10459 an environment without virtual memory management.  This option implies
10460 @option{-fPIC}.
10462 @item -mno-sep-data
10463 Generate code that assumes that the data segment follows the text segment.
10464 This is the default.
10466 @item -mid-shared-library
10467 Generate code that supports shared libraries via the library ID method.
10468 This allows for execute in place and shared libraries in an environment
10469 without virtual memory management.  This option implies @option{-fPIC}.
10471 @item -mno-id-shared-library
10472 Generate code that doesn't assume ID based shared libraries are being used.
10473 This is the default.
10475 @item -mshared-library-id=n
10476 Specified the identification number of the ID based shared library being
10477 compiled.  Specifying a value of 0 will generate more compact code, specifying
10478 other values will force the allocation of that number to the current
10479 library but is no more space or time efficient than omitting this option.
10481 @end table
10483 @node M68hc1x Options
10484 @subsection M68hc1x Options
10485 @cindex M68hc1x options
10487 These are the @samp{-m} options defined for the 68hc11 and 68hc12
10488 microcontrollers.  The default values for these options depends on
10489 which style of microcontroller was selected when the compiler was configured;
10490 the defaults for the most common choices are given below.
10492 @table @gcctabopt
10493 @item -m6811
10494 @itemx -m68hc11
10495 @opindex m6811
10496 @opindex m68hc11
10497 Generate output for a 68HC11.  This is the default
10498 when the compiler is configured for 68HC11-based systems.
10500 @item -m6812
10501 @itemx -m68hc12
10502 @opindex m6812
10503 @opindex m68hc12
10504 Generate output for a 68HC12.  This is the default
10505 when the compiler is configured for 68HC12-based systems.
10507 @item -m68S12
10508 @itemx -m68hcs12
10509 @opindex m68S12
10510 @opindex m68hcs12
10511 Generate output for a 68HCS12.
10513 @item -mauto-incdec
10514 @opindex mauto-incdec
10515 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
10516 addressing modes.
10518 @item -minmax
10519 @itemx -nominmax
10520 @opindex minmax
10521 @opindex mnominmax
10522 Enable the use of 68HC12 min and max instructions.
10524 @item -mlong-calls
10525 @itemx -mno-long-calls
10526 @opindex mlong-calls
10527 @opindex mno-long-calls
10528 Treat all calls as being far away (near).  If calls are assumed to be
10529 far away, the compiler will use the @code{call} instruction to
10530 call a function and the @code{rtc} instruction for returning.
10532 @item -mshort
10533 @opindex mshort
10534 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10536 @item -msoft-reg-count=@var{count}
10537 @opindex msoft-reg-count
10538 Specify the number of pseudo-soft registers which are used for the
10539 code generation.  The maximum number is 32.  Using more pseudo-soft
10540 register may or may not result in better code depending on the program.
10541 The default is 4 for 68HC11 and 2 for 68HC12.
10543 @end table
10545 @node MCore Options
10546 @subsection MCore Options
10547 @cindex MCore options
10549 These are the @samp{-m} options defined for the Motorola M*Core
10550 processors.
10552 @table @gcctabopt
10554 @item -mhardlit
10555 @itemx -mno-hardlit
10556 @opindex mhardlit
10557 @opindex mno-hardlit
10558 Inline constants into the code stream if it can be done in two
10559 instructions or less.
10561 @item -mdiv
10562 @itemx -mno-div
10563 @opindex mdiv
10564 @opindex mno-div
10565 Use the divide instruction.  (Enabled by default).
10567 @item -mrelax-immediate
10568 @itemx -mno-relax-immediate
10569 @opindex mrelax-immediate
10570 @opindex mno-relax-immediate
10571 Allow arbitrary sized immediates in bit operations.
10573 @item -mwide-bitfields
10574 @itemx -mno-wide-bitfields
10575 @opindex mwide-bitfields
10576 @opindex mno-wide-bitfields
10577 Always treat bit-fields as int-sized.
10579 @item -m4byte-functions
10580 @itemx -mno-4byte-functions
10581 @opindex m4byte-functions
10582 @opindex mno-4byte-functions
10583 Force all functions to be aligned to a four byte boundary.
10585 @item -mcallgraph-data
10586 @itemx -mno-callgraph-data
10587 @opindex mcallgraph-data
10588 @opindex mno-callgraph-data
10589 Emit callgraph information.
10591 @item -mslow-bytes
10592 @itemx -mno-slow-bytes
10593 @opindex mslow-bytes
10594 @opindex mno-slow-bytes
10595 Prefer word access when reading byte quantities.
10597 @item -mlittle-endian
10598 @itemx -mbig-endian
10599 @opindex mlittle-endian
10600 @opindex mbig-endian
10601 Generate code for a little endian target.
10603 @item -m210
10604 @itemx -m340
10605 @opindex m210
10606 @opindex m340
10607 Generate code for the 210 processor.
10608 @end table
10610 @node MIPS Options
10611 @subsection MIPS Options
10612 @cindex MIPS options
10614 @table @gcctabopt
10616 @item -EB
10617 @opindex EB
10618 Generate big-endian code.
10620 @item -EL
10621 @opindex EL
10622 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
10623 configurations.
10625 @item -march=@var{arch}
10626 @opindex march
10627 Generate code that will run on @var{arch}, which can be the name of a
10628 generic MIPS ISA, or the name of a particular processor.
10629 The ISA names are:
10630 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
10631 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
10632 The processor names are:
10633 @samp{4kc}, @samp{4km}, @samp{4kp},
10634 @samp{4kec}, @samp{4kem}, @samp{4kep},
10635 @samp{5kc}, @samp{5kf},
10636 @samp{20kc},
10637 @samp{24kc}, @samp{24kf}, @samp{24kx},
10638 @samp{24kec}, @samp{24kef}, @samp{24kex},
10639 @samp{34kc}, @samp{34kf}, @samp{34kx},
10640 @samp{m4k},
10641 @samp{orion},
10642 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
10643 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
10644 @samp{rm7000}, @samp{rm9000},
10645 @samp{sb1},
10646 @samp{sr71000},
10647 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
10648 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
10649 The special value @samp{from-abi} selects the
10650 most compatible architecture for the selected ABI (that is,
10651 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
10653 In processor names, a final @samp{000} can be abbreviated as @samp{k}
10654 (for example, @samp{-march=r2k}).  Prefixes are optional, and
10655 @samp{vr} may be written @samp{r}.
10657 GCC defines two macros based on the value of this option.  The first
10658 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
10659 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
10660 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
10661 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
10662 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
10664 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
10665 above.  In other words, it will have the full prefix and will not
10666 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
10667 the macro names the resolved architecture (either @samp{"mips1"} or
10668 @samp{"mips3"}).  It names the default architecture when no
10669 @option{-march} option is given.
10671 @item -mtune=@var{arch}
10672 @opindex mtune
10673 Optimize for @var{arch}.  Among other things, this option controls
10674 the way instructions are scheduled, and the perceived cost of arithmetic
10675 operations.  The list of @var{arch} values is the same as for
10676 @option{-march}.
10678 When this option is not used, GCC will optimize for the processor
10679 specified by @option{-march}.  By using @option{-march} and
10680 @option{-mtune} together, it is possible to generate code that will
10681 run on a family of processors, but optimize the code for one
10682 particular member of that family.
10684 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
10685 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
10686 @samp{-march} ones described above.
10688 @item -mips1
10689 @opindex mips1
10690 Equivalent to @samp{-march=mips1}.
10692 @item -mips2
10693 @opindex mips2
10694 Equivalent to @samp{-march=mips2}.
10696 @item -mips3
10697 @opindex mips3
10698 Equivalent to @samp{-march=mips3}.
10700 @item -mips4
10701 @opindex mips4
10702 Equivalent to @samp{-march=mips4}.
10704 @item -mips32
10705 @opindex mips32
10706 Equivalent to @samp{-march=mips32}.
10708 @item -mips32r2
10709 @opindex mips32r2
10710 Equivalent to @samp{-march=mips32r2}.
10712 @item -mips64
10713 @opindex mips64
10714 Equivalent to @samp{-march=mips64}.
10716 @item -mips16
10717 @itemx -mno-mips16
10718 @opindex mips16
10719 @opindex mno-mips16
10720 Generate (do not generate) MIPS16 code.  If GCC is targetting a
10721 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
10723 @item -mabi=32
10724 @itemx -mabi=o64
10725 @itemx -mabi=n32
10726 @itemx -mabi=64
10727 @itemx -mabi=eabi
10728 @opindex mabi=32
10729 @opindex mabi=o64
10730 @opindex mabi=n32
10731 @opindex mabi=64
10732 @opindex mabi=eabi
10733 Generate code for the given ABI@.
10735 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
10736 generates 64-bit code when you select a 64-bit architecture, but you
10737 can use @option{-mgp32} to get 32-bit code instead.
10739 For information about the O64 ABI, see
10740 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
10742 GCC supports a variant of the o32 ABI in which floating-point registers
10743 are 64 rather than 32 bits wide.  You can select this combination with
10744 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
10745 and @samp{mfhc1} instructions and is therefore only supported for
10746 MIPS32R2 processors.
10748 The register assignments for arguments and return values remain the
10749 same, but each scalar value is passed in a single 64-bit register
10750 rather than a pair of 32-bit registers.  For example, scalar
10751 floating-point values are returned in @samp{$f0} only, not a
10752 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
10753 remains the same, but all 64 bits are saved.
10755 @item -mabicalls
10756 @itemx -mno-abicalls
10757 @opindex mabicalls
10758 @opindex mno-abicalls
10759 Generate (do not generate) code that is suitable for SVR4-style
10760 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
10761 systems.
10763 @item -mshared
10764 @itemx -mno-shared
10765 Generate (do not generate) code that is fully position-independent,
10766 and that can therefore be linked into shared libraries.  This option
10767 only affects @option{-mabicalls}.
10769 All @option{-mabicalls} code has traditionally been position-independent,
10770 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
10771 as an extension, the GNU toolchain allows executables to use absolute
10772 accesses for locally-binding symbols.  It can also use shorter GP
10773 initialization sequences and generate direct calls to locally-defined
10774 functions.  This mode is selected by @option{-mno-shared}.
10776 @option{-mno-shared} depends on binutils 2.16 or higher and generates
10777 objects that can only be linked by the GNU linker.  However, the option
10778 does not affect the ABI of the final executable; it only affects the ABI
10779 of relocatable objects.  Using @option{-mno-shared} will generally make
10780 executables both smaller and quicker.
10782 @option{-mshared} is the default.
10784 @item -mxgot
10785 @itemx -mno-xgot
10786 @opindex mxgot
10787 @opindex mno-xgot
10788 Lift (do not lift) the usual restrictions on the size of the global
10789 offset table.
10791 GCC normally uses a single instruction to load values from the GOT@.
10792 While this is relatively efficient, it will only work if the GOT
10793 is smaller than about 64k.  Anything larger will cause the linker
10794 to report an error such as:
10796 @cindex relocation truncated to fit (MIPS)
10797 @smallexample
10798 relocation truncated to fit: R_MIPS_GOT16 foobar
10799 @end smallexample
10801 If this happens, you should recompile your code with @option{-mxgot}.
10802 It should then work with very large GOTs, although it will also be
10803 less efficient, since it will take three instructions to fetch the
10804 value of a global symbol.
10806 Note that some linkers can create multiple GOTs.  If you have such a
10807 linker, you should only need to use @option{-mxgot} when a single object
10808 file accesses more than 64k's worth of GOT entries.  Very few do.
10810 These options have no effect unless GCC is generating position
10811 independent code.
10813 @item -mgp32
10814 @opindex mgp32
10815 Assume that general-purpose registers are 32 bits wide.
10817 @item -mgp64
10818 @opindex mgp64
10819 Assume that general-purpose registers are 64 bits wide.
10821 @item -mfp32
10822 @opindex mfp32
10823 Assume that floating-point registers are 32 bits wide.
10825 @item -mfp64
10826 @opindex mfp64
10827 Assume that floating-point registers are 64 bits wide.
10829 @item -mhard-float
10830 @opindex mhard-float
10831 Use floating-point coprocessor instructions.
10833 @item -msoft-float
10834 @opindex msoft-float
10835 Do not use floating-point coprocessor instructions.  Implement
10836 floating-point calculations using library calls instead.
10838 @item -msingle-float
10839 @opindex msingle-float
10840 Assume that the floating-point coprocessor only supports single-precision
10841 operations.
10843 @itemx -mdouble-float
10844 @opindex mdouble-float
10845 Assume that the floating-point coprocessor supports double-precision
10846 operations.  This is the default.
10848 @itemx -mdsp
10849 @itemx -mno-dsp
10850 @opindex mdsp
10851 @opindex mno-dsp
10852 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
10854 @itemx -mpaired-single
10855 @itemx -mno-paired-single
10856 @opindex mpaired-single
10857 @opindex mno-paired-single
10858 Use (do not use) paired-single floating-point instructions.
10859 @xref{MIPS Paired-Single Support}.  This option can only be used
10860 when generating 64-bit code and requires hardware floating-point
10861 support to be enabled.
10863 @itemx -mips3d
10864 @itemx -mno-mips3d
10865 @opindex mips3d
10866 @opindex mno-mips3d
10867 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
10868 The option @option{-mips3d} implies @option{-mpaired-single}.
10870 @item -mlong64
10871 @opindex mlong64
10872 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
10873 an explanation of the default and the way that the pointer size is
10874 determined.
10876 @item -mlong32
10877 @opindex mlong32
10878 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
10880 The default size of @code{int}s, @code{long}s and pointers depends on
10881 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
10882 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
10883 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
10884 or the same size as integer registers, whichever is smaller.
10886 @item -msym32
10887 @itemx -mno-sym32
10888 @opindex msym32
10889 @opindex mno-sym32
10890 Assume (do not assume) that all symbols have 32-bit values, regardless
10891 of the selected ABI@.  This option is useful in combination with
10892 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
10893 to generate shorter and faster references to symbolic addresses.
10895 @item -G @var{num}
10896 @opindex G
10897 @cindex smaller data references (MIPS)
10898 @cindex gp-relative references (MIPS)
10899 Put global and static items less than or equal to @var{num} bytes into
10900 the small data or bss section instead of the normal data or bss section.
10901 This allows the data to be accessed using a single instruction.
10903 All modules should be compiled with the same @option{-G @var{num}}
10904 value.
10906 @item -membedded-data
10907 @itemx -mno-embedded-data
10908 @opindex membedded-data
10909 @opindex mno-embedded-data
10910 Allocate variables to the read-only data section first if possible, then
10911 next in the small data section if possible, otherwise in data.  This gives
10912 slightly slower code than the default, but reduces the amount of RAM required
10913 when executing, and thus may be preferred for some embedded systems.
10915 @item -muninit-const-in-rodata
10916 @itemx -mno-uninit-const-in-rodata
10917 @opindex muninit-const-in-rodata
10918 @opindex mno-uninit-const-in-rodata
10919 Put uninitialized @code{const} variables in the read-only data section.
10920 This option is only meaningful in conjunction with @option{-membedded-data}.
10922 @item -msplit-addresses
10923 @itemx -mno-split-addresses
10924 @opindex msplit-addresses
10925 @opindex mno-split-addresses
10926 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
10927 relocation operators.  This option has been superseded by
10928 @option{-mexplicit-relocs} but is retained for backwards compatibility.
10930 @item -mexplicit-relocs
10931 @itemx -mno-explicit-relocs
10932 @opindex mexplicit-relocs
10933 @opindex mno-explicit-relocs
10934 Use (do not use) assembler relocation operators when dealing with symbolic
10935 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
10936 is to use assembler macros instead.
10938 @option{-mexplicit-relocs} is the default if GCC was configured
10939 to use an assembler that supports relocation operators.
10941 @item -mcheck-zero-division
10942 @itemx -mno-check-zero-division
10943 @opindex mcheck-zero-division
10944 @opindex mno-check-zero-division
10945 Trap (do not trap) on integer division by zero.  The default is
10946 @option{-mcheck-zero-division}.
10948 @item -mdivide-traps
10949 @itemx -mdivide-breaks
10950 @opindex mdivide-traps
10951 @opindex mdivide-breaks
10952 MIPS systems check for division by zero by generating either a
10953 conditional trap or a break instruction.  Using traps results in
10954 smaller code, but is only supported on MIPS II and later.  Also, some
10955 versions of the Linux kernel have a bug that prevents trap from
10956 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
10957 allow conditional traps on architectures that support them and
10958 @option{-mdivide-breaks} to force the use of breaks.
10960 The default is usually @option{-mdivide-traps}, but this can be
10961 overridden at configure time using @option{--with-divide=breaks}.
10962 Divide-by-zero checks can be completely disabled using
10963 @option{-mno-check-zero-division}.
10965 @item -mmemcpy
10966 @itemx -mno-memcpy
10967 @opindex mmemcpy
10968 @opindex mno-memcpy
10969 Force (do not force) the use of @code{memcpy()} for non-trivial block
10970 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
10971 most constant-sized copies.
10973 @item -mlong-calls
10974 @itemx -mno-long-calls
10975 @opindex mlong-calls
10976 @opindex mno-long-calls
10977 Disable (do not disable) use of the @code{jal} instruction.  Calling
10978 functions using @code{jal} is more efficient but requires the caller
10979 and callee to be in the same 256 megabyte segment.
10981 This option has no effect on abicalls code.  The default is
10982 @option{-mno-long-calls}.
10984 @item -mmad
10985 @itemx -mno-mad
10986 @opindex mmad
10987 @opindex mno-mad
10988 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
10989 instructions, as provided by the R4650 ISA@.
10991 @item -mfused-madd
10992 @itemx -mno-fused-madd
10993 @opindex mfused-madd
10994 @opindex mno-fused-madd
10995 Enable (disable) use of the floating point multiply-accumulate
10996 instructions, when they are available.  The default is
10997 @option{-mfused-madd}.
10999 When multiply-accumulate instructions are used, the intermediate
11000 product is calculated to infinite precision and is not subject to
11001 the FCSR Flush to Zero bit.  This may be undesirable in some
11002 circumstances.
11004 @item -nocpp
11005 @opindex nocpp
11006 Tell the MIPS assembler to not run its preprocessor over user
11007 assembler files (with a @samp{.s} suffix) when assembling them.
11009 @item -mfix-r4000
11010 @itemx -mno-fix-r4000
11011 @opindex mfix-r4000
11012 @opindex mno-fix-r4000
11013 Work around certain R4000 CPU errata:
11014 @itemize @minus
11015 @item
11016 A double-word or a variable shift may give an incorrect result if executed
11017 immediately after starting an integer division.
11018 @item
11019 A double-word or a variable shift may give an incorrect result if executed
11020 while an integer multiplication is in progress.
11021 @item
11022 An integer division may give an incorrect result if started in a delay slot
11023 of a taken branch or a jump.
11024 @end itemize
11026 @item -mfix-r4400
11027 @itemx -mno-fix-r4400
11028 @opindex mfix-r4400
11029 @opindex mno-fix-r4400
11030 Work around certain R4400 CPU errata:
11031 @itemize @minus
11032 @item
11033 A double-word or a variable shift may give an incorrect result if executed
11034 immediately after starting an integer division.
11035 @end itemize
11037 @item -mfix-vr4120
11038 @itemx -mno-fix-vr4120
11039 @opindex mfix-vr4120
11040 Work around certain VR4120 errata:
11041 @itemize @minus
11042 @item
11043 @code{dmultu} does not always produce the correct result.
11044 @item
11045 @code{div} and @code{ddiv} do not always produce the correct result if one
11046 of the operands is negative.
11047 @end itemize
11048 The workarounds for the division errata rely on special functions in
11049 @file{libgcc.a}.  At present, these functions are only provided by
11050 the @code{mips64vr*-elf} configurations.
11052 Other VR4120 errata require a nop to be inserted between certain pairs of
11053 instructions.  These errata are handled by the assembler, not by GCC itself.
11055 @item -mfix-vr4130
11056 @opindex mfix-vr4130
11057 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11058 workarounds are implemented by the assembler rather than by GCC,
11059 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11060 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11061 instructions are available instead.
11063 @item -mfix-sb1
11064 @itemx -mno-fix-sb1
11065 @opindex mfix-sb1
11066 Work around certain SB-1 CPU core errata.
11067 (This flag currently works around the SB-1 revision 2
11068 ``F1'' and ``F2'' floating point errata.)
11070 @item -mflush-func=@var{func}
11071 @itemx -mno-flush-func
11072 @opindex mflush-func
11073 Specifies the function to call to flush the I and D caches, or to not
11074 call any such function.  If called, the function must take the same
11075 arguments as the common @code{_flush_func()}, that is, the address of the
11076 memory range for which the cache is being flushed, the size of the
11077 memory range, and the number 3 (to flush both caches).  The default
11078 depends on the target GCC was configured for, but commonly is either
11079 @samp{_flush_func} or @samp{__cpu_flush}.
11081 @item -mbranch-likely
11082 @itemx -mno-branch-likely
11083 @opindex mbranch-likely
11084 @opindex mno-branch-likely
11085 Enable or disable use of Branch Likely instructions, regardless of the
11086 default for the selected architecture.  By default, Branch Likely
11087 instructions may be generated if they are supported by the selected
11088 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11089 and processors which implement those architectures; for those, Branch
11090 Likely instructions will not be generated by default because the MIPS32
11091 and MIPS64 architectures specifically deprecate their use.
11093 @item -mfp-exceptions
11094 @itemx -mno-fp-exceptions
11095 @opindex mfp-exceptions
11096 Specifies whether FP exceptions are enabled.  This affects how we schedule
11097 FP instructions for some processors.  The default is that FP exceptions are
11098 enabled.
11100 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11101 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11102 FP pipe.
11104 @item -mvr4130-align
11105 @itemx -mno-vr4130-align
11106 @opindex mvr4130-align
11107 The VR4130 pipeline is two-way superscalar, but can only issue two
11108 instructions together if the first one is 8-byte aligned.  When this
11109 option is enabled, GCC will align pairs of instructions that it
11110 thinks should execute in parallel.
11112 This option only has an effect when optimizing for the VR4130.
11113 It normally makes code faster, but at the expense of making it bigger.
11114 It is enabled by default at optimization level @option{-O3}.
11115 @end table
11117 @node MMIX Options
11118 @subsection MMIX Options
11119 @cindex MMIX Options
11121 These options are defined for the MMIX:
11123 @table @gcctabopt
11124 @item -mlibfuncs
11125 @itemx -mno-libfuncs
11126 @opindex mlibfuncs
11127 @opindex mno-libfuncs
11128 Specify that intrinsic library functions are being compiled, passing all
11129 values in registers, no matter the size.
11131 @item -mepsilon
11132 @itemx -mno-epsilon
11133 @opindex mepsilon
11134 @opindex mno-epsilon
11135 Generate floating-point comparison instructions that compare with respect
11136 to the @code{rE} epsilon register.
11138 @item -mabi=mmixware
11139 @itemx -mabi=gnu
11140 @opindex mabi-mmixware
11141 @opindex mabi=gnu
11142 Generate code that passes function parameters and return values that (in
11143 the called function) are seen as registers @code{$0} and up, as opposed to
11144 the GNU ABI which uses global registers @code{$231} and up.
11146 @item -mzero-extend
11147 @itemx -mno-zero-extend
11148 @opindex mzero-extend
11149 @opindex mno-zero-extend
11150 When reading data from memory in sizes shorter than 64 bits, use (do not
11151 use) zero-extending load instructions by default, rather than
11152 sign-extending ones.
11154 @item -mknuthdiv
11155 @itemx -mno-knuthdiv
11156 @opindex mknuthdiv
11157 @opindex mno-knuthdiv
11158 Make the result of a division yielding a remainder have the same sign as
11159 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11160 remainder follows the sign of the dividend.  Both methods are
11161 arithmetically valid, the latter being almost exclusively used.
11163 @item -mtoplevel-symbols
11164 @itemx -mno-toplevel-symbols
11165 @opindex mtoplevel-symbols
11166 @opindex mno-toplevel-symbols
11167 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11168 code can be used with the @code{PREFIX} assembly directive.
11170 @item -melf
11171 @opindex melf
11172 Generate an executable in the ELF format, rather than the default
11173 @samp{mmo} format used by the @command{mmix} simulator.
11175 @item -mbranch-predict
11176 @itemx -mno-branch-predict
11177 @opindex mbranch-predict
11178 @opindex mno-branch-predict
11179 Use (do not use) the probable-branch instructions, when static branch
11180 prediction indicates a probable branch.
11182 @item -mbase-addresses
11183 @itemx -mno-base-addresses
11184 @opindex mbase-addresses
11185 @opindex mno-base-addresses
11186 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11187 base address automatically generates a request (handled by the assembler
11188 and the linker) for a constant to be set up in a global register.  The
11189 register is used for one or more base address requests within the range 0
11190 to 255 from the value held in the register.  The generally leads to short
11191 and fast code, but the number of different data items that can be
11192 addressed is limited.  This means that a program that uses lots of static
11193 data may require @option{-mno-base-addresses}.
11195 @item -msingle-exit
11196 @itemx -mno-single-exit
11197 @opindex msingle-exit
11198 @opindex mno-single-exit
11199 Force (do not force) generated code to have a single exit point in each
11200 function.
11201 @end table
11203 @node MN10300 Options
11204 @subsection MN10300 Options
11205 @cindex MN10300 options
11207 These @option{-m} options are defined for Matsushita MN10300 architectures:
11209 @table @gcctabopt
11210 @item -mmult-bug
11211 @opindex mmult-bug
11212 Generate code to avoid bugs in the multiply instructions for the MN10300
11213 processors.  This is the default.
11215 @item -mno-mult-bug
11216 @opindex mno-mult-bug
11217 Do not generate code to avoid bugs in the multiply instructions for the
11218 MN10300 processors.
11220 @item -mam33
11221 @opindex mam33
11222 Generate code which uses features specific to the AM33 processor.
11224 @item -mno-am33
11225 @opindex mno-am33
11226 Do not generate code which uses features specific to the AM33 processor.  This
11227 is the default.
11229 @item -mreturn-pointer-on-d0
11230 @opindex mreturn-pointer-on-d0
11231 When generating a function which returns a pointer, return the pointer
11232 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11233 only in a0, and attempts to call such functions without a prototype
11234 would result in errors.  Note that this option is on by default; use
11235 @option{-mno-return-pointer-on-d0} to disable it.
11237 @item -mno-crt0
11238 @opindex mno-crt0
11239 Do not link in the C run-time initialization object file.
11241 @item -mrelax
11242 @opindex mrelax
11243 Indicate to the linker that it should perform a relaxation optimization pass
11244 to shorten branches, calls and absolute memory addresses.  This option only
11245 has an effect when used on the command line for the final link step.
11247 This option makes symbolic debugging impossible.
11248 @end table
11250 @node MT Options
11251 @subsection MT Options
11252 @cindex MT options
11254 These @option{-m} options are defined for Morpho MT architectures:
11256 @table @gcctabopt
11258 @item -march=@var{cpu-type}
11259 @opindex march
11260 Generate code that will run on @var{cpu-type}, which is the name of a system
11261 representing a certain processor type.  Possible values for
11262 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
11263 @samp{ms1-16-003} and @samp{ms2}.
11265 When this option is not used, the default is @option{-march=ms1-16-002}.
11267 @item -mbacc
11268 @opindex mbacc
11269 Use byte loads and stores when generating code.
11271 @item -mno-bacc
11272 @opindex mno-bacc
11273 Do not use byte loads and stores when generating code.
11275 @item -msim
11276 @opindex msim
11277 Use simulator runtime
11279 @item -mno-crt0
11280 @opindex mno-crt0
11281 Do not link in the C run-time initialization object file
11282 @file{crti.o}.  Other run-time initialization and termination files
11283 such as @file{startup.o} and @file{exit.o} are still included on the
11284 linker command line.
11286 @end table
11288 @node PDP-11 Options
11289 @subsection PDP-11 Options
11290 @cindex PDP-11 Options
11292 These options are defined for the PDP-11:
11294 @table @gcctabopt
11295 @item -mfpu
11296 @opindex mfpu
11297 Use hardware FPP floating point.  This is the default.  (FIS floating
11298 point on the PDP-11/40 is not supported.)
11300 @item -msoft-float
11301 @opindex msoft-float
11302 Do not use hardware floating point.
11304 @item -mac0
11305 @opindex mac0
11306 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
11308 @item -mno-ac0
11309 @opindex mno-ac0
11310 Return floating-point results in memory.  This is the default.
11312 @item -m40
11313 @opindex m40
11314 Generate code for a PDP-11/40.
11316 @item -m45
11317 @opindex m45
11318 Generate code for a PDP-11/45.  This is the default.
11320 @item -m10
11321 @opindex m10
11322 Generate code for a PDP-11/10.
11324 @item -mbcopy-builtin
11325 @opindex bcopy-builtin
11326 Use inline @code{movmemhi} patterns for copying memory.  This is the
11327 default.
11329 @item -mbcopy
11330 @opindex mbcopy
11331 Do not use inline @code{movmemhi} patterns for copying memory.
11333 @item -mint16
11334 @itemx -mno-int32
11335 @opindex mint16
11336 @opindex mno-int32
11337 Use 16-bit @code{int}.  This is the default.
11339 @item -mint32
11340 @itemx -mno-int16
11341 @opindex mint32
11342 @opindex mno-int16
11343 Use 32-bit @code{int}.
11345 @item -mfloat64
11346 @itemx -mno-float32
11347 @opindex mfloat64
11348 @opindex mno-float32
11349 Use 64-bit @code{float}.  This is the default.
11351 @item -mfloat32
11352 @itemx -mno-float64
11353 @opindex mfloat32
11354 @opindex mno-float64
11355 Use 32-bit @code{float}.
11357 @item -mabshi
11358 @opindex mabshi
11359 Use @code{abshi2} pattern.  This is the default.
11361 @item -mno-abshi
11362 @opindex mno-abshi
11363 Do not use @code{abshi2} pattern.
11365 @item -mbranch-expensive
11366 @opindex mbranch-expensive
11367 Pretend that branches are expensive.  This is for experimenting with
11368 code generation only.
11370 @item -mbranch-cheap
11371 @opindex mbranch-cheap
11372 Do not pretend that branches are expensive.  This is the default.
11374 @item -msplit
11375 @opindex msplit
11376 Generate code for a system with split I&D@.
11378 @item -mno-split
11379 @opindex mno-split
11380 Generate code for a system without split I&D@.  This is the default.
11382 @item -munix-asm
11383 @opindex munix-asm
11384 Use Unix assembler syntax.  This is the default when configured for
11385 @samp{pdp11-*-bsd}.
11387 @item -mdec-asm
11388 @opindex mdec-asm
11389 Use DEC assembler syntax.  This is the default when configured for any
11390 PDP-11 target other than @samp{pdp11-*-bsd}.
11391 @end table
11393 @node PowerPC Options
11394 @subsection PowerPC Options
11395 @cindex PowerPC options
11397 These are listed under @xref{RS/6000 and PowerPC Options}.
11399 @node RS/6000 and PowerPC Options
11400 @subsection IBM RS/6000 and PowerPC Options
11401 @cindex RS/6000 and PowerPC Options
11402 @cindex IBM RS/6000 and PowerPC Options
11404 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11405 @table @gcctabopt
11406 @item -mpower
11407 @itemx -mno-power
11408 @itemx -mpower2
11409 @itemx -mno-power2
11410 @itemx -mpowerpc
11411 @itemx -mno-powerpc
11412 @itemx -mpowerpc-gpopt
11413 @itemx -mno-powerpc-gpopt
11414 @itemx -mpowerpc-gfxopt
11415 @itemx -mno-powerpc-gfxopt
11416 @itemx -mpowerpc64
11417 @itemx -mno-powerpc64
11418 @itemx -mmfcrf
11419 @itemx -mno-mfcrf
11420 @itemx -mpopcntb
11421 @itemx -mno-popcntb
11422 @itemx -mfprnd
11423 @itemx -mno-fprnd
11424 @itemx -mmfpgpr
11425 @itemx -mno-mfpgpr
11426 @opindex mpower
11427 @opindex mno-power
11428 @opindex mpower2
11429 @opindex mno-power2
11430 @opindex mpowerpc
11431 @opindex mno-powerpc
11432 @opindex mpowerpc-gpopt
11433 @opindex mno-powerpc-gpopt
11434 @opindex mpowerpc-gfxopt
11435 @opindex mno-powerpc-gfxopt
11436 @opindex mpowerpc64
11437 @opindex mno-powerpc64
11438 @opindex mmfcrf
11439 @opindex mno-mfcrf
11440 @opindex mpopcntb
11441 @opindex mno-popcntb
11442 @opindex mfprnd
11443 @opindex mno-fprnd
11444 @opindex mmfpgpr
11445 @opindex mno-mfpgpr
11446 GCC supports two related instruction set architectures for the
11447 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
11448 instructions supported by the @samp{rios} chip set used in the original
11449 RS/6000 systems and the @dfn{PowerPC} instruction set is the
11450 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
11451 the IBM 4xx, 6xx, and follow-on microprocessors.
11453 Neither architecture is a subset of the other.  However there is a
11454 large common subset of instructions supported by both.  An MQ
11455 register is included in processors supporting the POWER architecture.
11457 You use these options to specify which instructions are available on the
11458 processor you are using.  The default value of these options is
11459 determined when configuring GCC@.  Specifying the
11460 @option{-mcpu=@var{cpu_type}} overrides the specification of these
11461 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
11462 rather than the options listed above.
11464 The @option{-mpower} option allows GCC to generate instructions that
11465 are found only in the POWER architecture and to use the MQ register.
11466 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
11467 to generate instructions that are present in the POWER2 architecture but
11468 not the original POWER architecture.
11470 The @option{-mpowerpc} option allows GCC to generate instructions that
11471 are found only in the 32-bit subset of the PowerPC architecture.
11472 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
11473 GCC to use the optional PowerPC architecture instructions in the
11474 General Purpose group, including floating-point square root.  Specifying
11475 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
11476 use the optional PowerPC architecture instructions in the Graphics
11477 group, including floating-point select.
11479 The @option{-mmfcrf} option allows GCC to generate the move from
11480 condition register field instruction implemented on the POWER4
11481 processor and other processors that support the PowerPC V2.01
11482 architecture.
11483 The @option{-mpopcntb} option allows GCC to generate the popcount and
11484 double precision FP reciprocal estimate instruction implemented on the
11485 POWER5 processor and other processors that support the PowerPC V2.02
11486 architecture.
11487 The @option{-mfprnd} option allows GCC to generate the FP round to
11488 integer instructions implemented on the POWER5+ processor and other
11489 processors that support the PowerPC V2.03 architecture.
11490 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
11491 general purpose register instructions implemented on the POWER6X
11492 processor and other processors that support the extended PowerPC V2.05
11493 architecture.
11495 The @option{-mpowerpc64} option allows GCC to generate the additional
11496 64-bit instructions that are found in the full PowerPC64 architecture
11497 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
11498 @option{-mno-powerpc64}.
11500 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
11501 will use only the instructions in the common subset of both
11502 architectures plus some special AIX common-mode calls, and will not use
11503 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
11504 permits GCC to use any instruction from either architecture and to
11505 allow use of the MQ register; specify this for the Motorola MPC601.
11507 @item -mnew-mnemonics
11508 @itemx -mold-mnemonics
11509 @opindex mnew-mnemonics
11510 @opindex mold-mnemonics
11511 Select which mnemonics to use in the generated assembler code.  With
11512 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
11513 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
11514 assembler mnemonics defined for the POWER architecture.  Instructions
11515 defined in only one architecture have only one mnemonic; GCC uses that
11516 mnemonic irrespective of which of these options is specified.
11518 GCC defaults to the mnemonics appropriate for the architecture in
11519 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
11520 value of these option.  Unless you are building a cross-compiler, you
11521 should normally not specify either @option{-mnew-mnemonics} or
11522 @option{-mold-mnemonics}, but should instead accept the default.
11524 @item -mcpu=@var{cpu_type}
11525 @opindex mcpu
11526 Set architecture type, register usage, choice of mnemonics, and
11527 instruction scheduling parameters for machine type @var{cpu_type}.
11528 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
11529 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
11530 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
11531 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
11532 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
11533 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
11534 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
11535 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
11536 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
11537 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
11539 @option{-mcpu=common} selects a completely generic processor.  Code
11540 generated under this option will run on any POWER or PowerPC processor.
11541 GCC will use only the instructions in the common subset of both
11542 architectures, and will not use the MQ register.  GCC assumes a generic
11543 processor model for scheduling purposes.
11545 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
11546 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
11547 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
11548 types, with an appropriate, generic processor model assumed for
11549 scheduling purposes.
11551 The other options specify a specific processor.  Code generated under
11552 those options will run best on that processor, and may not run at all on
11553 others.
11555 The @option{-mcpu} options automatically enable or disable the
11556 following options: @option{-maltivec}, @option{-mfprnd},
11557 @option{-mhard-float}, @option{-mmfcrf}, @option{-mmultiple},
11558 @option{-mnew-mnemonics}, @option{-mpopcntb}, @option{-mpower},
11559 @option{-mpower2}, @option{-mpowerpc64}, @option{-mpowerpc-gpopt},
11560 @option{-mpowerpc-gfxopt}, @option{-mstring}, @option{-mmulhw},
11561 @option{-mdlmzb}, @option{-mmfpgpr}.
11562 The particular options set for any particular CPU will vary between
11563 compiler versions, depending on what setting seems to produce optimal
11564 code for that CPU; it doesn't necessarily reflect the actual hardware's
11565 capabilities.  If you wish to set an individual option to a particular
11566 value, you may specify it after the @option{-mcpu} option, like
11567 @samp{-mcpu=970 -mno-altivec}.
11569 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
11570 not enabled or disabled by the @option{-mcpu} option at present because
11571 AIX does not have full support for these options.  You may still
11572 enable or disable them individually if you're sure it'll work in your
11573 environment.
11575 @item -mtune=@var{cpu_type}
11576 @opindex mtune
11577 Set the instruction scheduling parameters for machine type
11578 @var{cpu_type}, but do not set the architecture type, register usage, or
11579 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
11580 values for @var{cpu_type} are used for @option{-mtune} as for
11581 @option{-mcpu}.  If both are specified, the code generated will use the
11582 architecture, registers, and mnemonics set by @option{-mcpu}, but the
11583 scheduling parameters set by @option{-mtune}.
11585 @item -mswdiv
11586 @itemx -mno-swdiv
11587 @opindex mswdiv
11588 @opindex mno-swdiv
11589 Generate code to compute division as reciprocal estimate and iterative
11590 refinement, creating opportunities for increased throughput.  This
11591 feature requires: optional PowerPC Graphics instruction set for single
11592 precision and FRE instruction for double precision, assuming divides
11593 cannot generate user-visible traps, and the domain values not include
11594 Infinities, denormals or zero denominator.
11596 @item -maltivec
11597 @itemx -mno-altivec
11598 @opindex maltivec
11599 @opindex mno-altivec
11600 Generate code that uses (does not use) AltiVec instructions, and also
11601 enable the use of built-in functions that allow more direct access to
11602 the AltiVec instruction set.  You may also need to set
11603 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
11604 enhancements.
11606 @item -mvrsave
11607 @item -mno-vrsave
11608 @opindex mvrsave
11609 @opindex mno-vrsave
11610 Generate VRSAVE instructions when generating AltiVec code.
11612 @item -msecure-plt
11613 @opindex msecure-plt
11614 Generate code that allows ld and ld.so to build executables and shared
11615 libraries with non-exec .plt and .got sections.  This is a PowerPC
11616 32-bit SYSV ABI option.
11618 @item -mbss-plt
11619 @opindex mbss-plt
11620 Generate code that uses a BSS .plt section that ld.so fills in, and
11621 requires .plt and .got sections that are both writable and executable.
11622 This is a PowerPC 32-bit SYSV ABI option.
11624 @item -misel
11625 @itemx -mno-isel
11626 @opindex misel
11627 @opindex mno-isel
11628 This switch enables or disables the generation of ISEL instructions.
11630 @item -misel=@var{yes/no}
11631 This switch has been deprecated.  Use @option{-misel} and
11632 @option{-mno-isel} instead.
11634 @item -mspe
11635 @itemx -mno-spe
11636 @opindex mspe
11637 @opindex mno-spe
11638 This switch enables or disables the generation of SPE simd
11639 instructions.
11641 @item -mspe=@var{yes/no}
11642 This option has been deprecated.  Use @option{-mspe} and
11643 @option{-mno-spe} instead.
11645 @item -mfloat-gprs=@var{yes/single/double/no}
11646 @itemx -mfloat-gprs
11647 @opindex mfloat-gprs
11648 This switch enables or disables the generation of floating point
11649 operations on the general purpose registers for architectures that
11650 support it.
11652 The argument @var{yes} or @var{single} enables the use of
11653 single-precision floating point operations.
11655 The argument @var{double} enables the use of single and
11656 double-precision floating point operations.
11658 The argument @var{no} disables floating point operations on the
11659 general purpose registers.
11661 This option is currently only available on the MPC854x.
11663 @item -m32
11664 @itemx -m64
11665 @opindex m32
11666 @opindex m64
11667 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
11668 targets (including GNU/Linux).  The 32-bit environment sets int, long
11669 and pointer to 32 bits and generates code that runs on any PowerPC
11670 variant.  The 64-bit environment sets int to 32 bits and long and
11671 pointer to 64 bits, and generates code for PowerPC64, as for
11672 @option{-mpowerpc64}.
11674 @item -mfull-toc
11675 @itemx -mno-fp-in-toc
11676 @itemx -mno-sum-in-toc
11677 @itemx -mminimal-toc
11678 @opindex mfull-toc
11679 @opindex mno-fp-in-toc
11680 @opindex mno-sum-in-toc
11681 @opindex mminimal-toc
11682 Modify generation of the TOC (Table Of Contents), which is created for
11683 every executable file.  The @option{-mfull-toc} option is selected by
11684 default.  In that case, GCC will allocate at least one TOC entry for
11685 each unique non-automatic variable reference in your program.  GCC
11686 will also place floating-point constants in the TOC@.  However, only
11687 16,384 entries are available in the TOC@.
11689 If you receive a linker error message that saying you have overflowed
11690 the available TOC space, you can reduce the amount of TOC space used
11691 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
11692 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
11693 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
11694 generate code to calculate the sum of an address and a constant at
11695 run-time instead of putting that sum into the TOC@.  You may specify one
11696 or both of these options.  Each causes GCC to produce very slightly
11697 slower and larger code at the expense of conserving TOC space.
11699 If you still run out of space in the TOC even when you specify both of
11700 these options, specify @option{-mminimal-toc} instead.  This option causes
11701 GCC to make only one TOC entry for every file.  When you specify this
11702 option, GCC will produce code that is slower and larger but which
11703 uses extremely little TOC space.  You may wish to use this option
11704 only on files that contain less frequently executed code.
11706 @item -maix64
11707 @itemx -maix32
11708 @opindex maix64
11709 @opindex maix32
11710 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
11711 @code{long} type, and the infrastructure needed to support them.
11712 Specifying @option{-maix64} implies @option{-mpowerpc64} and
11713 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
11714 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
11716 @item -mxl-compat
11717 @itemx -mno-xl-compat
11718 @opindex mxl-compat
11719 @opindex mno-xl-compat
11720 Produce code that conforms more closely to IBM XL compiler semantics
11721 when using AIX-compatible ABI.  Pass floating-point arguments to
11722 prototyped functions beyond the register save area (RSA) on the stack
11723 in addition to argument FPRs.  Do not assume that most significant
11724 double in 128-bit long double value is properly rounded when comparing
11725 values and converting to double.  Use XL symbol names for long double
11726 support routines.
11728 The AIX calling convention was extended but not initially documented to
11729 handle an obscure K&R C case of calling a function that takes the
11730 address of its arguments with fewer arguments than declared.  IBM XL
11731 compilers access floating point arguments which do not fit in the
11732 RSA from the stack when a subroutine is compiled without
11733 optimization.  Because always storing floating-point arguments on the
11734 stack is inefficient and rarely needed, this option is not enabled by
11735 default and only is necessary when calling subroutines compiled by IBM
11736 XL compilers without optimization.
11738 @item -mpe
11739 @opindex mpe
11740 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
11741 application written to use message passing with special startup code to
11742 enable the application to run.  The system must have PE installed in the
11743 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
11744 must be overridden with the @option{-specs=} option to specify the
11745 appropriate directory location.  The Parallel Environment does not
11746 support threads, so the @option{-mpe} option and the @option{-pthread}
11747 option are incompatible.
11749 @item -malign-natural
11750 @itemx -malign-power
11751 @opindex malign-natural
11752 @opindex malign-power
11753 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
11754 @option{-malign-natural} overrides the ABI-defined alignment of larger
11755 types, such as floating-point doubles, on their natural size-based boundary.
11756 The option @option{-malign-power} instructs GCC to follow the ABI-specified
11757 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
11759 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
11760 is not supported.
11762 @item -msoft-float
11763 @itemx -mhard-float
11764 @opindex msoft-float
11765 @opindex mhard-float
11766 Generate code that does not use (uses) the floating-point register set.
11767 Software floating point emulation is provided if you use the
11768 @option{-msoft-float} option, and pass the option to GCC when linking.
11770 @item -mmultiple
11771 @itemx -mno-multiple
11772 @opindex mmultiple
11773 @opindex mno-multiple
11774 Generate code that uses (does not use) the load multiple word
11775 instructions and the store multiple word instructions.  These
11776 instructions are generated by default on POWER systems, and not
11777 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
11778 endian PowerPC systems, since those instructions do not work when the
11779 processor is in little endian mode.  The exceptions are PPC740 and
11780 PPC750 which permit the instructions usage in little endian mode.
11782 @item -mstring
11783 @itemx -mno-string
11784 @opindex mstring
11785 @opindex mno-string
11786 Generate code that uses (does not use) the load string instructions
11787 and the store string word instructions to save multiple registers and
11788 do small block moves.  These instructions are generated by default on
11789 POWER systems, and not generated on PowerPC systems.  Do not use
11790 @option{-mstring} on little endian PowerPC systems, since those
11791 instructions do not work when the processor is in little endian mode.
11792 The exceptions are PPC740 and PPC750 which permit the instructions
11793 usage in little endian mode.
11795 @item -mupdate
11796 @itemx -mno-update
11797 @opindex mupdate
11798 @opindex mno-update
11799 Generate code that uses (does not use) the load or store instructions
11800 that update the base register to the address of the calculated memory
11801 location.  These instructions are generated by default.  If you use
11802 @option{-mno-update}, there is a small window between the time that the
11803 stack pointer is updated and the address of the previous frame is
11804 stored, which means code that walks the stack frame across interrupts or
11805 signals may get corrupted data.
11807 @item -mfused-madd
11808 @itemx -mno-fused-madd
11809 @opindex mfused-madd
11810 @opindex mno-fused-madd
11811 Generate code that uses (does not use) the floating point multiply and
11812 accumulate instructions.  These instructions are generated by default if
11813 hardware floating is used.
11815 @item -mmulhw
11816 @itemx -mno-mulhw
11817 @opindex mmulhw
11818 @opindex mno-mulhw
11819 Generate code that uses (does not use) the half-word multiply and
11820 multiply-accumulate instructions on the IBM 405 and 440 processors.
11821 These instructions are generated by default when targetting those
11822 processors.
11824 @item -mdlmzb
11825 @itemx -mno-dlmzb
11826 @opindex mdlmzb
11827 @opindex mno-dlmzb
11828 Generate code that uses (does not use) the string-search @samp{dlmzb}
11829 instruction on the IBM 405 and 440 processors.  This instruction is
11830 generated by default when targetting those processors.
11832 @item -mno-bit-align
11833 @itemx -mbit-align
11834 @opindex mno-bit-align
11835 @opindex mbit-align
11836 On System V.4 and embedded PowerPC systems do not (do) force structures
11837 and unions that contain bit-fields to be aligned to the base type of the
11838 bit-field.
11840 For example, by default a structure containing nothing but 8
11841 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
11842 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
11843 the structure would be aligned to a 1 byte boundary and be one byte in
11844 size.
11846 @item -mno-strict-align
11847 @itemx -mstrict-align
11848 @opindex mno-strict-align
11849 @opindex mstrict-align
11850 On System V.4 and embedded PowerPC systems do not (do) assume that
11851 unaligned memory references will be handled by the system.
11853 @item -mrelocatable
11854 @itemx -mno-relocatable
11855 @opindex mrelocatable
11856 @opindex mno-relocatable
11857 On embedded PowerPC systems generate code that allows (does not allow)
11858 the program to be relocated to a different address at runtime.  If you
11859 use @option{-mrelocatable} on any module, all objects linked together must
11860 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
11862 @item -mrelocatable-lib
11863 @itemx -mno-relocatable-lib
11864 @opindex mrelocatable-lib
11865 @opindex mno-relocatable-lib
11866 On embedded PowerPC systems generate code that allows (does not allow)
11867 the program to be relocated to a different address at runtime.  Modules
11868 compiled with @option{-mrelocatable-lib} can be linked with either modules
11869 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
11870 with modules compiled with the @option{-mrelocatable} options.
11872 @item -mno-toc
11873 @itemx -mtoc
11874 @opindex mno-toc
11875 @opindex mtoc
11876 On System V.4 and embedded PowerPC systems do not (do) assume that
11877 register 2 contains a pointer to a global area pointing to the addresses
11878 used in the program.
11880 @item -mlittle
11881 @itemx -mlittle-endian
11882 @opindex mlittle
11883 @opindex mlittle-endian
11884 On System V.4 and embedded PowerPC systems compile code for the
11885 processor in little endian mode.  The @option{-mlittle-endian} option is
11886 the same as @option{-mlittle}.
11888 @item -mbig
11889 @itemx -mbig-endian
11890 @opindex mbig
11891 @opindex mbig-endian
11892 On System V.4 and embedded PowerPC systems compile code for the
11893 processor in big endian mode.  The @option{-mbig-endian} option is
11894 the same as @option{-mbig}.
11896 @item -mdynamic-no-pic
11897 @opindex mdynamic-no-pic
11898 On Darwin and Mac OS X systems, compile code so that it is not
11899 relocatable, but that its external references are relocatable.  The
11900 resulting code is suitable for applications, but not shared
11901 libraries.
11903 @item -mprioritize-restricted-insns=@var{priority}
11904 @opindex mprioritize-restricted-insns
11905 This option controls the priority that is assigned to
11906 dispatch-slot restricted instructions during the second scheduling
11907 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
11908 @var{no/highest/second-highest} priority to dispatch slot restricted
11909 instructions.
11911 @item -msched-costly-dep=@var{dependence_type}
11912 @opindex msched-costly-dep
11913 This option controls which dependences are considered costly
11914 by the target during instruction scheduling.  The argument
11915 @var{dependence_type} takes one of the following values:
11916 @var{no}: no dependence is costly,
11917 @var{all}: all dependences are costly,
11918 @var{true_store_to_load}: a true dependence from store to load is costly,
11919 @var{store_to_load}: any dependence from store to load is costly,
11920 @var{number}: any dependence which latency >= @var{number} is costly.
11922 @item -minsert-sched-nops=@var{scheme}
11923 @opindex minsert-sched-nops
11924 This option controls which nop insertion scheme will be used during
11925 the second scheduling pass.  The argument @var{scheme} takes one of the
11926 following values:
11927 @var{no}: Don't insert nops.
11928 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
11929 according to the scheduler's grouping.
11930 @var{regroup_exact}: Insert nops to force costly dependent insns into
11931 separate groups.  Insert exactly as many nops as needed to force an insn
11932 to a new group, according to the estimated processor grouping.
11933 @var{number}: Insert nops to force costly dependent insns into
11934 separate groups.  Insert @var{number} nops to force an insn to a new group.
11936 @item -mcall-sysv
11937 @opindex mcall-sysv
11938 On System V.4 and embedded PowerPC systems compile code using calling
11939 conventions that adheres to the March 1995 draft of the System V
11940 Application Binary Interface, PowerPC processor supplement.  This is the
11941 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
11943 @item -mcall-sysv-eabi
11944 @opindex mcall-sysv-eabi
11945 Specify both @option{-mcall-sysv} and @option{-meabi} options.
11947 @item -mcall-sysv-noeabi
11948 @opindex mcall-sysv-noeabi
11949 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
11951 @item -mcall-solaris
11952 @opindex mcall-solaris
11953 On System V.4 and embedded PowerPC systems compile code for the Solaris
11954 operating system.
11956 @item -mcall-linux
11957 @opindex mcall-linux
11958 On System V.4 and embedded PowerPC systems compile code for the
11959 Linux-based GNU system.
11961 @item -mcall-gnu
11962 @opindex mcall-gnu
11963 On System V.4 and embedded PowerPC systems compile code for the
11964 Hurd-based GNU system.
11966 @item -mcall-netbsd
11967 @opindex mcall-netbsd
11968 On System V.4 and embedded PowerPC systems compile code for the
11969 NetBSD operating system.
11971 @item -maix-struct-return
11972 @opindex maix-struct-return
11973 Return all structures in memory (as specified by the AIX ABI)@.
11975 @item -msvr4-struct-return
11976 @opindex msvr4-struct-return
11977 Return structures smaller than 8 bytes in registers (as specified by the
11978 SVR4 ABI)@.
11980 @item -mabi=@var{abi-type}
11981 @opindex mabi
11982 Extend the current ABI with a particular extension, or remove such extension.
11983 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
11984 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
11986 @item -mabi=spe
11987 @opindex mabi=spe
11988 Extend the current ABI with SPE ABI extensions.  This does not change
11989 the default ABI, instead it adds the SPE ABI extensions to the current
11990 ABI@.
11992 @item -mabi=no-spe
11993 @opindex mabi=no-spe
11994 Disable Booke SPE ABI extensions for the current ABI@.
11996 @item -mabi=ibmlongdouble
11997 @opindex mabi=ibmlongdouble
11998 Change the current ABI to use IBM extended precision long double.
11999 This is a PowerPC 32-bit SYSV ABI option.
12001 @item -mabi=ieeelongdouble
12002 @opindex mabi=ieeelongdouble
12003 Change the current ABI to use IEEE extended precision long double.
12004 This is a PowerPC 32-bit Linux ABI option.
12006 @item -mprototype
12007 @itemx -mno-prototype
12008 @opindex mprototype
12009 @opindex mno-prototype
12010 On System V.4 and embedded PowerPC systems assume that all calls to
12011 variable argument functions are properly prototyped.  Otherwise, the
12012 compiler must insert an instruction before every non prototyped call to
12013 set or clear bit 6 of the condition code register (@var{CR}) to
12014 indicate whether floating point values were passed in the floating point
12015 registers in case the function takes a variable arguments.  With
12016 @option{-mprototype}, only calls to prototyped variable argument functions
12017 will set or clear the bit.
12019 @item -msim
12020 @opindex msim
12021 On embedded PowerPC systems, assume that the startup module is called
12022 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
12023 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
12024 configurations.
12026 @item -mmvme
12027 @opindex mmvme
12028 On embedded PowerPC systems, assume that the startup module is called
12029 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
12030 @file{libc.a}.
12032 @item -mads
12033 @opindex mads
12034 On embedded PowerPC systems, assume that the startup module is called
12035 @file{crt0.o} and the standard C libraries are @file{libads.a} and
12036 @file{libc.a}.
12038 @item -myellowknife
12039 @opindex myellowknife
12040 On embedded PowerPC systems, assume that the startup module is called
12041 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
12042 @file{libc.a}.
12044 @item -mvxworks
12045 @opindex mvxworks
12046 On System V.4 and embedded PowerPC systems, specify that you are
12047 compiling for a VxWorks system.
12049 @item -mwindiss
12050 @opindex mwindiss
12051 Specify that you are compiling for the WindISS simulation environment.
12053 @item -memb
12054 @opindex memb
12055 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12056 header to indicate that @samp{eabi} extended relocations are used.
12058 @item -meabi
12059 @itemx -mno-eabi
12060 @opindex meabi
12061 @opindex mno-eabi
12062 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12063 Embedded Applications Binary Interface (eabi) which is a set of
12064 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12065 means that the stack is aligned to an 8 byte boundary, a function
12066 @code{__eabi} is called to from @code{main} to set up the eabi
12067 environment, and the @option{-msdata} option can use both @code{r2} and
12068 @code{r13} to point to two separate small data areas.  Selecting
12069 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12070 do not call an initialization function from @code{main}, and the
12071 @option{-msdata} option will only use @code{r13} to point to a single
12072 small data area.  The @option{-meabi} option is on by default if you
12073 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12075 @item -msdata=eabi
12076 @opindex msdata=eabi
12077 On System V.4 and embedded PowerPC systems, put small initialized
12078 @code{const} global and static data in the @samp{.sdata2} section, which
12079 is pointed to by register @code{r2}.  Put small initialized
12080 non-@code{const} global and static data in the @samp{.sdata} section,
12081 which is pointed to by register @code{r13}.  Put small uninitialized
12082 global and static data in the @samp{.sbss} section, which is adjacent to
12083 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12084 incompatible with the @option{-mrelocatable} option.  The
12085 @option{-msdata=eabi} option also sets the @option{-memb} option.
12087 @item -msdata=sysv
12088 @opindex msdata=sysv
12089 On System V.4 and embedded PowerPC systems, put small global and static
12090 data in the @samp{.sdata} section, which is pointed to by register
12091 @code{r13}.  Put small uninitialized global and static data in the
12092 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12093 The @option{-msdata=sysv} option is incompatible with the
12094 @option{-mrelocatable} option.
12096 @item -msdata=default
12097 @itemx -msdata
12098 @opindex msdata=default
12099 @opindex msdata
12100 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12101 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12102 same as @option{-msdata=sysv}.
12104 @item -msdata-data
12105 @opindex msdata-data
12106 On System V.4 and embedded PowerPC systems, put small global
12107 data in the @samp{.sdata} section.  Put small uninitialized global
12108 data in the @samp{.sbss} section.  Do not use register @code{r13}
12109 to address small data however.  This is the default behavior unless
12110 other @option{-msdata} options are used.
12112 @item -msdata=none
12113 @itemx -mno-sdata
12114 @opindex msdata=none
12115 @opindex mno-sdata
12116 On embedded PowerPC systems, put all initialized global and static data
12117 in the @samp{.data} section, and all uninitialized data in the
12118 @samp{.bss} section.
12120 @item -G @var{num}
12121 @opindex G
12122 @cindex smaller data references (PowerPC)
12123 @cindex .sdata/.sdata2 references (PowerPC)
12124 On embedded PowerPC systems, put global and static items less than or
12125 equal to @var{num} bytes into the small data or bss sections instead of
12126 the normal data or bss section.  By default, @var{num} is 8.  The
12127 @option{-G @var{num}} switch is also passed to the linker.
12128 All modules should be compiled with the same @option{-G @var{num}} value.
12130 @item -mregnames
12131 @itemx -mno-regnames
12132 @opindex mregnames
12133 @opindex mno-regnames
12134 On System V.4 and embedded PowerPC systems do (do not) emit register
12135 names in the assembly language output using symbolic forms.
12137 @item -mlongcall
12138 @itemx -mno-longcall
12139 @opindex mlongcall
12140 @opindex mno-longcall
12141 By default assume that all calls are far away so that a longer more
12142 expensive calling sequence is required.  This is required for calls
12143 further than 32 megabytes (33,554,432 bytes) from the current location.
12144 A short call will be generated if the compiler knows
12145 the call cannot be that far away.  This setting can be overridden by
12146 the @code{shortcall} function attribute, or by @code{#pragma
12147 longcall(0)}.
12149 Some linkers are capable of detecting out-of-range calls and generating
12150 glue code on the fly.  On these systems, long calls are unnecessary and
12151 generate slower code.  As of this writing, the AIX linker can do this,
12152 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12153 to the GNU linker for 32-bit PowerPC systems as well.
12155 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12156 callee, L42'', plus a ``branch island'' (glue code).  The two target
12157 addresses represent the callee and the ``branch island''.  The
12158 Darwin/PPC linker will prefer the first address and generate a ``bl
12159 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12160 otherwise, the linker will generate ``bl L42'' to call the ``branch
12161 island''.  The ``branch island'' is appended to the body of the
12162 calling function; it computes the full 32-bit address of the callee
12163 and jumps to it.
12165 On Mach-O (Darwin) systems, this option directs the compiler emit to
12166 the glue for every direct call, and the Darwin linker decides whether
12167 to use or discard it.
12169 In the future, we may cause GCC to ignore all longcall specifications
12170 when the linker is known to generate glue.
12172 @item -pthread
12173 @opindex pthread
12174 Adds support for multithreading with the @dfn{pthreads} library.
12175 This option sets flags for both the preprocessor and linker.
12177 @end table
12179 @node S/390 and zSeries Options
12180 @subsection S/390 and zSeries Options
12181 @cindex S/390 and zSeries Options
12183 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12185 @table @gcctabopt
12186 @item -mhard-float
12187 @itemx -msoft-float
12188 @opindex mhard-float
12189 @opindex msoft-float
12190 Use (do not use) the hardware floating-point instructions and registers
12191 for floating-point operations.  When @option{-msoft-float} is specified,
12192 functions in @file{libgcc.a} will be used to perform floating-point
12193 operations.  When @option{-mhard-float} is specified, the compiler
12194 generates IEEE floating-point instructions.  This is the default.
12196 @item -mlong-double-64
12197 @itemx -mlong-double-128
12198 @opindex mlong-double-64
12199 @opindex mlong-double-128
12200 These switches control the size of @code{long double} type. A size
12201 of 64bit makes the @code{long double} type equivalent to the @code{double}
12202 type. This is the default.
12204 @item -mbackchain
12205 @itemx -mno-backchain
12206 @opindex mbackchain
12207 @opindex mno-backchain
12208 Store (do not store) the address of the caller's frame as backchain pointer
12209 into the callee's stack frame.
12210 A backchain may be needed to allow debugging using tools that do not understand
12211 DWARF-2 call frame information.
12212 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12213 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12214 the backchain is placed into the topmost word of the 96/160 byte register
12215 save area.
12217 In general, code compiled with @option{-mbackchain} is call-compatible with
12218 code compiled with @option{-mmo-backchain}; however, use of the backchain
12219 for debugging purposes usually requires that the whole binary is built with
12220 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12221 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12222 to build a linux kernel use @option{-msoft-float}.
12224 The default is to not maintain the backchain.
12226 @item -mpacked-stack
12227 @item -mno-packed-stack
12228 @opindex mpacked-stack
12229 @opindex mno-packed-stack
12230 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12231 specified, the compiler uses the all fields of the 96/160 byte register save
12232 area only for their default purpose; unused fields still take up stack space.
12233 When @option{-mpacked-stack} is specified, register save slots are densely
12234 packed at the top of the register save area; unused space is reused for other
12235 purposes, allowing for more efficient use of the available stack space.
12236 However, when @option{-mbackchain} is also in effect, the topmost word of
12237 the save area is always used to store the backchain, and the return address
12238 register is always saved two words below the backchain.
12240 As long as the stack frame backchain is not used, code generated with
12241 @option{-mpacked-stack} is call-compatible with code generated with
12242 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
12243 S/390 or zSeries generated code that uses the stack frame backchain at run
12244 time, not just for debugging purposes.  Such code is not call-compatible
12245 with code compiled with @option{-mpacked-stack}.  Also, note that the
12246 combination of @option{-mbackchain},
12247 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12248 to build a linux kernel use @option{-msoft-float}.
12250 The default is to not use the packed stack layout.
12252 @item -msmall-exec
12253 @itemx -mno-small-exec
12254 @opindex msmall-exec
12255 @opindex mno-small-exec
12256 Generate (or do not generate) code using the @code{bras} instruction
12257 to do subroutine calls.
12258 This only works reliably if the total executable size does not
12259 exceed 64k.  The default is to use the @code{basr} instruction instead,
12260 which does not have this limitation.
12262 @item -m64
12263 @itemx -m31
12264 @opindex m64
12265 @opindex m31
12266 When @option{-m31} is specified, generate code compliant to the
12267 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
12268 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
12269 particular to generate 64-bit instructions.  For the @samp{s390}
12270 targets, the default is @option{-m31}, while the @samp{s390x}
12271 targets default to @option{-m64}.
12273 @item -mzarch
12274 @itemx -mesa
12275 @opindex mzarch
12276 @opindex mesa
12277 When @option{-mzarch} is specified, generate code using the
12278 instructions available on z/Architecture.
12279 When @option{-mesa} is specified, generate code using the
12280 instructions available on ESA/390.  Note that @option{-mesa} is
12281 not possible with @option{-m64}.
12282 When generating code compliant to the GNU/Linux for S/390 ABI,
12283 the default is @option{-mesa}.  When generating code compliant
12284 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
12286 @item -mmvcle
12287 @itemx -mno-mvcle
12288 @opindex mmvcle
12289 @opindex mno-mvcle
12290 Generate (or do not generate) code using the @code{mvcle} instruction
12291 to perform block moves.  When @option{-mno-mvcle} is specified,
12292 use a @code{mvc} loop instead.  This is the default unless optimizing for
12293 size.
12295 @item -mdebug
12296 @itemx -mno-debug
12297 @opindex mdebug
12298 @opindex mno-debug
12299 Print (or do not print) additional debug information when compiling.
12300 The default is to not print debug information.
12302 @item -march=@var{cpu-type}
12303 @opindex march
12304 Generate code that will run on @var{cpu-type}, which is the name of a system
12305 representing a certain processor type.  Possible values for
12306 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
12307 When generating code using the instructions available on z/Architecture,
12308 the default is @option{-march=z900}.  Otherwise, the default is
12309 @option{-march=g5}.
12311 @item -mtune=@var{cpu-type}
12312 @opindex mtune
12313 Tune to @var{cpu-type} everything applicable about the generated code,
12314 except for the ABI and the set of available instructions.
12315 The list of @var{cpu-type} values is the same as for @option{-march}.
12316 The default is the value used for @option{-march}.
12318 @item -mtpf-trace
12319 @itemx -mno-tpf-trace
12320 @opindex mtpf-trace
12321 @opindex mno-tpf-trace
12322 Generate code that adds (does not add) in TPF OS specific branches to trace
12323 routines in the operating system.  This option is off by default, even
12324 when compiling for the TPF OS@.
12326 @item -mfused-madd
12327 @itemx -mno-fused-madd
12328 @opindex mfused-madd
12329 @opindex mno-fused-madd
12330 Generate code that uses (does not use) the floating point multiply and
12331 accumulate instructions.  These instructions are generated by default if
12332 hardware floating point is used.
12334 @item -mwarn-framesize=@var{framesize}
12335 @opindex mwarn-framesize
12336 Emit a warning if the current function exceeds the given frame size.  Because
12337 this is a compile time check it doesn't need to be a real problem when the program
12338 runs.  It is intended to identify functions which most probably cause
12339 a stack overflow.  It is useful to be used in an environment with limited stack
12340 size e.g.@: the linux kernel.
12342 @item -mwarn-dynamicstack
12343 @opindex mwarn-dynamicstack
12344 Emit a warning if the function calls alloca or uses dynamically
12345 sized arrays.  This is generally a bad idea with a limited stack size.
12347 @item -mstack-guard=@var{stack-guard}
12348 @item -mstack-size=@var{stack-size}
12349 @opindex mstack-guard
12350 @opindex mstack-size
12351 These arguments always have to be used in conjunction.  If they are present the s390
12352 back end emits additional instructions in the function prologue which trigger a trap
12353 if the stack size is @var{stack-guard} bytes above the @var{stack-size}
12354 (remember that the stack on s390 grows downward).  These options are intended to
12355 be used to help debugging stack overflow problems.  The additionally emitted code
12356 causes only little overhead and hence can also be used in production like systems
12357 without greater performance degradation.  The given values have to be exact
12358 powers of 2 and @var{stack-size} has to be greater than @var{stack-guard} without
12359 exceeding 64k.
12360 In order to be efficient the extra code makes the assumption that the stack starts
12361 at an address aligned to the value given by @var{stack-size}.
12362 @end table
12364 @node Score Options
12365 @subsection Score Options
12366 @cindex Score Options
12368 These options are defined for Score implementations:
12370 @table @gcctabopt
12371 @item -mel
12372 @opindex -mel
12373 Compile code for little endian mode. 
12375 @item -meb
12376 @opindex meb
12377 Compile code for big endian mode.  This is the default.
12379 @item -mmac
12380 @opindex mmac
12381 Enable the use of multiply-accumulate instructions. Disabled by default. 
12383 @item -mscore5u
12384 @opindex mscore5u
12385 Specify the SCORE5U of the target architecture.
12387 @item -mscore7
12388 @opindex mscore7
12389 Specify the SCORE7 of the target architecture. This is the default.
12390 @end table
12392 @node SH Options
12393 @subsection SH Options
12395 These @samp{-m} options are defined for the SH implementations:
12397 @table @gcctabopt
12398 @item -m1
12399 @opindex m1
12400 Generate code for the SH1.
12402 @item -m2
12403 @opindex m2
12404 Generate code for the SH2.
12406 @item -m2e
12407 Generate code for the SH2e.
12409 @item -m3
12410 @opindex m3
12411 Generate code for the SH3.
12413 @item -m3e
12414 @opindex m3e
12415 Generate code for the SH3e.
12417 @item -m4-nofpu
12418 @opindex m4-nofpu
12419 Generate code for the SH4 without a floating-point unit.
12421 @item -m4-single-only
12422 @opindex m4-single-only
12423 Generate code for the SH4 with a floating-point unit that only
12424 supports single-precision arithmetic.
12426 @item -m4-single
12427 @opindex m4-single
12428 Generate code for the SH4 assuming the floating-point unit is in
12429 single-precision mode by default.
12431 @item -m4
12432 @opindex m4
12433 Generate code for the SH4.
12435 @item -m4a-nofpu
12436 @opindex m4a-nofpu
12437 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
12438 floating-point unit is not used.
12440 @item -m4a-single-only
12441 @opindex m4a-single-only
12442 Generate code for the SH4a, in such a way that no double-precision
12443 floating point operations are used.
12445 @item -m4a-single
12446 @opindex m4a-single
12447 Generate code for the SH4a assuming the floating-point unit is in
12448 single-precision mode by default.
12450 @item -m4a
12451 @opindex m4a
12452 Generate code for the SH4a.
12454 @item -m4al
12455 @opindex m4al
12456 Same as @option{-m4a-nofpu}, except that it implicitly passes
12457 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
12458 instructions at the moment.
12460 @item -mb
12461 @opindex mb
12462 Compile code for the processor in big endian mode.
12464 @item -ml
12465 @opindex ml
12466 Compile code for the processor in little endian mode.
12468 @item -mdalign
12469 @opindex mdalign
12470 Align doubles at 64-bit boundaries.  Note that this changes the calling
12471 conventions, and thus some functions from the standard C library will
12472 not work unless you recompile it first with @option{-mdalign}.
12474 @item -mrelax
12475 @opindex mrelax
12476 Shorten some address references at link time, when possible; uses the
12477 linker option @option{-relax}.
12479 @item -mbigtable
12480 @opindex mbigtable
12481 Use 32-bit offsets in @code{switch} tables.  The default is to use
12482 16-bit offsets.
12484 @item -mfmovd
12485 @opindex mfmovd
12486 Enable the use of the instruction @code{fmovd}.
12488 @item -mhitachi
12489 @opindex mhitachi
12490 Comply with the calling conventions defined by Renesas.
12492 @item -mrenesas
12493 @opindex mhitachi
12494 Comply with the calling conventions defined by Renesas.
12496 @item -mno-renesas
12497 @opindex mhitachi
12498 Comply with the calling conventions defined for GCC before the Renesas
12499 conventions were available.  This option is the default for all
12500 targets of the SH toolchain except for @samp{sh-symbianelf}.
12502 @item -mnomacsave
12503 @opindex mnomacsave
12504 Mark the @code{MAC} register as call-clobbered, even if
12505 @option{-mhitachi} is given.
12507 @item -mieee
12508 @opindex mieee
12509 Increase IEEE-compliance of floating-point code.
12510 At the moment, this is equivalent to @option{-fno-finite-math-only}.
12511 When generating 16 bit SH opcodes, getting IEEE-conforming results for
12512 comparisons of NANs / infinities incurs extra overhead in every
12513 floating point comparison, therefore the default is set to
12514 @option{-ffinite-math-only}.
12516 @item -minline-ic_invalidate
12517 @opindex minline-ic_invalidate
12518 Inline code to invalidate instruction cache entries after setting up
12519 nested function trampolines.
12520 This option has no effect if -musermode is in effect and the selected
12521 code generation option (e.g. -m4) does not allow the use of the icbi
12522 instruction.
12523 If the selected code generation option does not allow the use of the icbi
12524 instruction, and -musermode is not in effect, the inlined code will
12525 manipulate the instruction cache address array directly with an associative
12526 write.  This not only requires privileged mode, but it will also
12527 fail if the cache line had been mapped via the TLB and has become unmapped.
12529 @item -misize
12530 @opindex misize
12531 Dump instruction size and location in the assembly code.
12533 @item -mpadstruct
12534 @opindex mpadstruct
12535 This option is deprecated.  It pads structures to multiple of 4 bytes,
12536 which is incompatible with the SH ABI@.
12538 @item -mspace
12539 @opindex mspace
12540 Optimize for space instead of speed.  Implied by @option{-Os}.
12542 @item -mprefergot
12543 @opindex mprefergot
12544 When generating position-independent code, emit function calls using
12545 the Global Offset Table instead of the Procedure Linkage Table.
12547 @item -musermode
12548 @opindex musermode
12549 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
12550 if the inlined code would not work in user mode.
12551 This is the default when the target is @code{sh-*-linux*}.
12553 @item -multcost=@var{number}
12554 @opindex multcost=@var{number}
12555 Set the cost to assume for a multiply insn.
12557 @item -mdiv=@var{strategy}
12558 @opindex mdiv=@var{strategy}
12559 Set the division strategy to use for SHmedia code.  @var{strategy} must be
12560 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
12561 inv:call2, inv:fp .
12562 "fp" performs the operation in floating point.  This has a very high latency,
12563 but needs only a few instructions, so it might be a good choice if
12564 your code has enough easily exploitable ILP to allow the compiler to
12565 schedule the floating point instructions together with other instructions.
12566 Division by zero causes a floating point exception.
12567 "inv" uses integer operations to calculate the inverse of the divisor,
12568 and then multiplies the dividend with the inverse.  This strategy allows
12569 cse and hoisting of the inverse calculation.  Division by zero calculates
12570 an unspecified result, but does not trap.
12571 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
12572 have been found, or if the entire operation has been hoisted to the same
12573 place, the last stages of the inverse calculation are intertwined with the
12574 final multiply to reduce the overall latency, at the expense of using a few
12575 more instructions, and thus offering fewer scheduling opportunities with
12576 other code.
12577 "call" calls a library function that usually implements the inv:minlat
12578 strategy.
12579 This gives high code density for m5-*media-nofpu compilations.
12580 "call2" uses a different entry point of the same library function, where it
12581 assumes that a pointer to a lookup table has already been set up, which
12582 exposes the pointer load to cse / code hoisting optimizations.
12583 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
12584 code generation, but if the code stays unoptimized, revert to the "call",
12585 "call2", or "fp" strategies, respectively.  Note that the
12586 potentially-trapping side effect of division by zero is carried by a
12587 separate instruction, so it is possible that all the integer instructions
12588 are hoisted out, but the marker for the side effect stays where it is.
12589 A recombination to fp operations or a call is not possible in that case.
12590 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
12591 that the inverse calculation was nor separated from the multiply, they speed
12592 up division where the dividend fits into 20 bits (plus sign where applicable),
12593 by inserting a test to skip a number of operations in this case; this test
12594 slows down the case of larger dividends.  inv20u assumes the case of a such
12595 a small dividend to be unlikely, and inv20l assumes it to be likely.
12597 @item -mdivsi3_libfunc=@var{name}
12598 @opindex mdivsi3_libfunc=@var{name}
12599 Set the name of the library function used for 32 bit signed division to
12600 @var{name}.  This only affect the name used in the call and inv:call
12601 division strategies, and the compiler will still expect the same
12602 sets of input/output/clobbered registers as if this option was not present.
12604 @item -madjust-unroll
12605 @opindex madjust-unroll
12606 Throttle unrolling to avoid thrashing target registers.
12607 This option only has an effect if the gcc code base supports the
12608 TARGET_ADJUST_UNROLL_MAX target hook.
12610 @item -mindexed-addressing
12611 @opindex mindexed-addressing
12612 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
12613 This is only safe if the hardware and/or OS implement 32 bit wrap-around
12614 semantics for the indexed addressing mode.  The architecture allows the
12615 implementation of processors with 64 bit MMU, which the OS could use to
12616 get 32 bit addressing, but since no current hardware implementation supports
12617 this or any other way to make the indexed addressing mode safe to use in
12618 the 32 bit ABI, the default is -mno-indexed-addressing.
12620 @item -mgettrcost=@var{number}
12621 @opindex mgettrcost=@var{number}
12622 Set the cost assumed for the gettr instruction to @var{number}.
12623 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
12625 @item -mpt-fixed
12626 @opindex mpt-fixed
12627 Assume pt* instructions won't trap.  This will generally generate better
12628 scheduled code, but is unsafe on current hardware.  The current architecture
12629 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
12630 This has the unintentional effect of making it unsafe to schedule ptabs /
12631 ptrel before a branch, or hoist it out of a loop.  For example,
12632 __do_global_ctors, a part of libgcc that runs constructors at program
12633 startup, calls functions in a list which is delimited by -1.  With the
12634 -mpt-fixed option, the ptabs will be done before testing against -1.
12635 That means that all the constructors will be run a bit quicker, but when
12636 the loop comes to the end of the list, the program crashes because ptabs
12637 loads -1 into a target register.  Since this option is unsafe for any
12638 hardware implementing the current architecture specification, the default
12639 is -mno-pt-fixed.  Unless the user specifies a specific cost with
12640 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
12641 this deters register allocation using target registers for storing
12642 ordinary integers.
12644 @item -minvalid-symbols
12645 @opindex minvalid-symbols
12646 Assume symbols might be invalid.  Ordinary function symbols generated by
12647 the compiler will always be valid to load with movi/shori/ptabs or
12648 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
12649 to generate symbols that will cause ptabs / ptrel to trap.
12650 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
12651 It will then prevent cross-basic-block cse, hoisting and most scheduling
12652 of symbol loads.  The default is @option{-mno-invalid-symbols}.
12653 @end table
12655 @node SPARC Options
12656 @subsection SPARC Options
12657 @cindex SPARC options
12659 These @samp{-m} options are supported on the SPARC:
12661 @table @gcctabopt
12662 @item -mno-app-regs
12663 @itemx -mapp-regs
12664 @opindex mno-app-regs
12665 @opindex mapp-regs
12666 Specify @option{-mapp-regs} to generate output using the global registers
12667 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
12668 is the default.
12670 To be fully SVR4 ABI compliant at the cost of some performance loss,
12671 specify @option{-mno-app-regs}.  You should compile libraries and system
12672 software with this option.
12674 @item -mfpu
12675 @itemx -mhard-float
12676 @opindex mfpu
12677 @opindex mhard-float
12678 Generate output containing floating point instructions.  This is the
12679 default.
12681 @item -mno-fpu
12682 @itemx -msoft-float
12683 @opindex mno-fpu
12684 @opindex msoft-float
12685 Generate output containing library calls for floating point.
12686 @strong{Warning:} the requisite libraries are not available for all SPARC
12687 targets.  Normally the facilities of the machine's usual C compiler are
12688 used, but this cannot be done directly in cross-compilation.  You must make
12689 your own arrangements to provide suitable library functions for
12690 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
12691 @samp{sparclite-*-*} do provide software floating point support.
12693 @option{-msoft-float} changes the calling convention in the output file;
12694 therefore, it is only useful if you compile @emph{all} of a program with
12695 this option.  In particular, you need to compile @file{libgcc.a}, the
12696 library that comes with GCC, with @option{-msoft-float} in order for
12697 this to work.
12699 @item -mhard-quad-float
12700 @opindex mhard-quad-float
12701 Generate output containing quad-word (long double) floating point
12702 instructions.
12704 @item -msoft-quad-float
12705 @opindex msoft-quad-float
12706 Generate output containing library calls for quad-word (long double)
12707 floating point instructions.  The functions called are those specified
12708 in the SPARC ABI@.  This is the default.
12710 As of this writing, there are no SPARC implementations that have hardware
12711 support for the quad-word floating point instructions.  They all invoke
12712 a trap handler for one of these instructions, and then the trap handler
12713 emulates the effect of the instruction.  Because of the trap handler overhead,
12714 this is much slower than calling the ABI library routines.  Thus the
12715 @option{-msoft-quad-float} option is the default.
12717 @item -mno-unaligned-doubles
12718 @itemx -munaligned-doubles
12719 @opindex mno-unaligned-doubles
12720 @opindex munaligned-doubles
12721 Assume that doubles have 8 byte alignment.  This is the default.
12723 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
12724 alignment only if they are contained in another type, or if they have an
12725 absolute address.  Otherwise, it assumes they have 4 byte alignment.
12726 Specifying this option avoids some rare compatibility problems with code
12727 generated by other compilers.  It is not the default because it results
12728 in a performance loss, especially for floating point code.
12730 @item -mno-faster-structs
12731 @itemx -mfaster-structs
12732 @opindex mno-faster-structs
12733 @opindex mfaster-structs
12734 With @option{-mfaster-structs}, the compiler assumes that structures
12735 should have 8 byte alignment.  This enables the use of pairs of
12736 @code{ldd} and @code{std} instructions for copies in structure
12737 assignment, in place of twice as many @code{ld} and @code{st} pairs.
12738 However, the use of this changed alignment directly violates the SPARC
12739 ABI@.  Thus, it's intended only for use on targets where the developer
12740 acknowledges that their resulting code will not be directly in line with
12741 the rules of the ABI@.
12743 @item -mimpure-text
12744 @opindex mimpure-text
12745 @option{-mimpure-text}, used in addition to @option{-shared}, tells
12746 the compiler to not pass @option{-z text} to the linker when linking a
12747 shared object.  Using this option, you can link position-dependent
12748 code into a shared object.
12750 @option{-mimpure-text} suppresses the ``relocations remain against
12751 allocatable but non-writable sections'' linker error message.
12752 However, the necessary relocations will trigger copy-on-write, and the
12753 shared object is not actually shared across processes.  Instead of
12754 using @option{-mimpure-text}, you should compile all source code with
12755 @option{-fpic} or @option{-fPIC}.
12757 This option is only available on SunOS and Solaris.
12759 @item -mcpu=@var{cpu_type}
12760 @opindex mcpu
12761 Set the instruction set, register set, and instruction scheduling parameters
12762 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
12763 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
12764 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
12765 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
12766 @samp{ultrasparc3}, and @samp{niagara}.
12768 Default instruction scheduling parameters are used for values that select
12769 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
12770 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
12772 Here is a list of each supported architecture and their supported
12773 implementations.
12775 @smallexample
12776     v7:             cypress
12777     v8:             supersparc, hypersparc
12778     sparclite:      f930, f934, sparclite86x
12779     sparclet:       tsc701
12780     v9:             ultrasparc, ultrasparc3, niagara
12781 @end smallexample
12783 By default (unless configured otherwise), GCC generates code for the V7
12784 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
12785 additionally optimizes it for the Cypress CY7C602 chip, as used in the
12786 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
12787 SPARCStation 1, 2, IPX etc.
12789 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
12790 architecture.  The only difference from V7 code is that the compiler emits
12791 the integer multiply and integer divide instructions which exist in SPARC-V8
12792 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
12793 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
12794 2000 series.
12796 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
12797 the SPARC architecture.  This adds the integer multiply, integer divide step
12798 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
12799 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
12800 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
12801 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
12802 MB86934 chip, which is the more recent SPARClite with FPU@.
12804 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
12805 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
12806 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
12807 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
12808 optimizes it for the TEMIC SPARClet chip.
12810 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
12811 architecture.  This adds 64-bit integer and floating-point move instructions,
12812 3 additional floating-point condition code registers and conditional move
12813 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
12814 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
12815 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
12816 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
12817 @option{-mcpu=niagara}, the compiler additionally optimizes it for
12818 Sun UltraSPARC T1 chips.
12820 @item -mtune=@var{cpu_type}
12821 @opindex mtune
12822 Set the instruction scheduling parameters for machine type
12823 @var{cpu_type}, but do not set the instruction set or register set that the
12824 option @option{-mcpu=@var{cpu_type}} would.
12826 The same values for @option{-mcpu=@var{cpu_type}} can be used for
12827 @option{-mtune=@var{cpu_type}}, but the only useful values are those
12828 that select a particular cpu implementation.  Those are @samp{cypress},
12829 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
12830 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
12831 @samp{ultrasparc3}, and @samp{niagara}.
12833 @item -mv8plus
12834 @itemx -mno-v8plus
12835 @opindex mv8plus
12836 @opindex mno-v8plus
12837 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
12838 difference from the V8 ABI is that the global and out registers are
12839 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
12840 mode for all SPARC-V9 processors.
12842 @item -mvis
12843 @itemx -mno-vis
12844 @opindex mvis
12845 @opindex mno-vis
12846 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
12847 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
12848 @end table
12850 These @samp{-m} options are supported in addition to the above
12851 on SPARC-V9 processors in 64-bit environments:
12853 @table @gcctabopt
12854 @item -mlittle-endian
12855 @opindex mlittle-endian
12856 Generate code for a processor running in little-endian mode.  It is only
12857 available for a few configurations and most notably not on Solaris and Linux.
12859 @item -m32
12860 @itemx -m64
12861 @opindex m32
12862 @opindex m64
12863 Generate code for a 32-bit or 64-bit environment.
12864 The 32-bit environment sets int, long and pointer to 32 bits.
12865 The 64-bit environment sets int to 32 bits and long and pointer
12866 to 64 bits.
12868 @item -mcmodel=medlow
12869 @opindex mcmodel=medlow
12870 Generate code for the Medium/Low code model: 64-bit addresses, programs
12871 must be linked in the low 32 bits of memory.  Programs can be statically
12872 or dynamically linked.
12874 @item -mcmodel=medmid
12875 @opindex mcmodel=medmid
12876 Generate code for the Medium/Middle code model: 64-bit addresses, programs
12877 must be linked in the low 44 bits of memory, the text and data segments must
12878 be less than 2GB in size and the data segment must be located within 2GB of
12879 the text segment.
12881 @item -mcmodel=medany
12882 @opindex mcmodel=medany
12883 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
12884 may be linked anywhere in memory, the text and data segments must be less
12885 than 2GB in size and the data segment must be located within 2GB of the
12886 text segment.
12888 @item -mcmodel=embmedany
12889 @opindex mcmodel=embmedany
12890 Generate code for the Medium/Anywhere code model for embedded systems:
12891 64-bit addresses, the text and data segments must be less than 2GB in
12892 size, both starting anywhere in memory (determined at link time).  The
12893 global register %g4 points to the base of the data segment.  Programs
12894 are statically linked and PIC is not supported.
12896 @item -mstack-bias
12897 @itemx -mno-stack-bias
12898 @opindex mstack-bias
12899 @opindex mno-stack-bias
12900 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
12901 frame pointer if present, are offset by @minus{}2047 which must be added back
12902 when making stack frame references.  This is the default in 64-bit mode.
12903 Otherwise, assume no such offset is present.
12904 @end table
12906 These switches are supported in addition to the above on Solaris:
12908 @table @gcctabopt
12909 @item -threads
12910 @opindex threads
12911 Add support for multithreading using the Solaris threads library.  This
12912 option sets flags for both the preprocessor and linker.  This option does
12913 not affect the thread safety of object code produced by the compiler or
12914 that of libraries supplied with it.
12916 @item -pthreads
12917 @opindex pthreads
12918 Add support for multithreading using the POSIX threads library.  This
12919 option sets flags for both the preprocessor and linker.  This option does
12920 not affect the thread safety of object code produced  by the compiler or
12921 that of libraries supplied with it.
12923 @item -pthread
12924 @opindex pthread
12925 This is a synonym for @option{-pthreads}.
12926 @end table
12928 @node SPU Options
12929 @subsection SPU Options
12930 @cindex SPU options
12932 These @samp{-m} options are supported on the SPU:
12934 @table @gcctabopt
12935 @item -mwarn-reloc
12936 @itemx -merror-reloc
12937 @opindex mwarn-reloc
12938 @opindex merror-reloc
12940 The loader for SPU does not handle dynamic relocations.  By default, GCC
12941 will give an error when it generates code that requires a dynamic
12942 relocation.  @option{-mno-error-reloc} disables the error,
12943 @option{-mwarn-reloc} will generate a warning instead.
12945 @item -msafe-dma
12946 @itemx -munsafe-dma
12947 @opindex msafe-dma
12948 @opindex munsafe-dma
12950 Instructions which initiate or test completion of DMA must not be
12951 reordered with respect to loads and stores of the memory which is being
12952 accessed.  Users typically address this problem using the volatile
12953 keyword, but that can lead to inefficient code in places where the
12954 memory is known to not change.  Rather than mark the memory as volatile
12955 we treat the DMA instructions as potentially effecting all memory.  With
12956 @option{-munsafe-dma} users must use the volatile keyword to protect
12957 memory accesses.
12959 @item -mbranch-hints
12960 @opindex mbranch-hints
12962 By default, GCC will generate a branch hint instruction to avoid
12963 pipeline stalls for always taken or probably taken branches.  A hint
12964 will not be generated closer than 8 instructions away from its branch.
12965 There is little reason to disable them, except for debugging purposes,
12966 or to make an object a little bit smaller.
12968 @item -msmall-mem
12969 @itemx -mlarge-mem
12970 @opindex msmall-mem
12971 @opindex mlarge-mem
12973 By default, GCC generates code assuming that addresses are never larger
12974 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
12975 a full 32 bit address.
12977 @item -mstdmain
12978 @opindex mstdmain
12980 By default, GCC links against startup code that assumes the SPU-style
12981 main function interface (which has an unconventional parameter list).
12982 With @option{-mstdmain}, GCC will link your program against startup
12983 code that assumes a C99-style interface to @code{main}, including a
12984 local copy of @code{argv} strings.
12986 @item -mfixed-range=@var{register-range}
12987 @opindex mfixed-range
12988 Generate code treating the given register range as fixed registers.
12989 A fixed register is one that the register allocator can not use.  This is
12990 useful when compiling kernel code.  A register range is specified as
12991 two registers separated by a dash.  Multiple register ranges can be
12992 specified separated by a comma.
12994 @end table
12996 @node System V Options
12997 @subsection Options for System V
12999 These additional options are available on System V Release 4 for
13000 compatibility with other compilers on those systems:
13002 @table @gcctabopt
13003 @item -G
13004 @opindex G
13005 Create a shared object.
13006 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
13008 @item -Qy
13009 @opindex Qy
13010 Identify the versions of each tool used by the compiler, in a
13011 @code{.ident} assembler directive in the output.
13013 @item -Qn
13014 @opindex Qn
13015 Refrain from adding @code{.ident} directives to the output file (this is
13016 the default).
13018 @item -YP,@var{dirs}
13019 @opindex YP
13020 Search the directories @var{dirs}, and no others, for libraries
13021 specified with @option{-l}.
13023 @item -Ym,@var{dir}
13024 @opindex Ym
13025 Look in the directory @var{dir} to find the M4 preprocessor.
13026 The assembler uses this option.
13027 @c This is supposed to go with a -Yd for predefined M4 macro files, but
13028 @c the generic assembler that comes with Solaris takes just -Ym.
13029 @end table
13031 @node TMS320C3x/C4x Options
13032 @subsection TMS320C3x/C4x Options
13033 @cindex TMS320C3x/C4x Options
13035 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
13037 @table @gcctabopt
13039 @item -mcpu=@var{cpu_type}
13040 @opindex mcpu
13041 Set the instruction set, register set, and instruction scheduling
13042 parameters for machine type @var{cpu_type}.  Supported values for
13043 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
13044 @samp{c44}.  The default is @samp{c40} to generate code for the
13045 TMS320C40.
13047 @item -mbig-memory
13048 @itemx -mbig
13049 @itemx -msmall-memory
13050 @itemx -msmall
13051 @opindex mbig-memory
13052 @opindex mbig
13053 @opindex msmall-memory
13054 @opindex msmall
13055 Generates code for the big or small memory model.  The small memory
13056 model assumed that all data fits into one 64K word page.  At run-time
13057 the data page (DP) register must be set to point to the 64K page
13058 containing the .bss and .data program sections.  The big memory model is
13059 the default and requires reloading of the DP register for every direct
13060 memory access.
13062 @item -mbk
13063 @itemx -mno-bk
13064 @opindex mbk
13065 @opindex mno-bk
13066 Allow (disallow) allocation of general integer operands into the block
13067 count register BK@.
13069 @item -mdb
13070 @itemx -mno-db
13071 @opindex mdb
13072 @opindex mno-db
13073 Enable (disable) generation of code using decrement and branch,
13074 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13075 on the safe side, this is disabled for the C3x, since the maximum
13076 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13077 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13078 that it can utilize the decrement and branch instruction, but will give
13079 up if there is more than one memory reference in the loop.  Thus a loop
13080 where the loop counter is decremented can generate slightly more
13081 efficient code, in cases where the RPTB instruction cannot be utilized.
13083 @item -mdp-isr-reload
13084 @itemx -mparanoid
13085 @opindex mdp-isr-reload
13086 @opindex mparanoid
13087 Force the DP register to be saved on entry to an interrupt service
13088 routine (ISR), reloaded to point to the data section, and restored on
13089 exit from the ISR@.  This should not be required unless someone has
13090 violated the small memory model by modifying the DP register, say within
13091 an object library.
13093 @item -mmpyi
13094 @itemx -mno-mpyi
13095 @opindex mmpyi
13096 @opindex mno-mpyi
13097 For the C3x use the 24-bit MPYI instruction for integer multiplies
13098 instead of a library call to guarantee 32-bit results.  Note that if one
13099 of the operands is a constant, then the multiplication will be performed
13100 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13101 then squaring operations are performed inline instead of a library call.
13103 @item -mfast-fix
13104 @itemx -mno-fast-fix
13105 @opindex mfast-fix
13106 @opindex mno-fast-fix
13107 The C3x/C4x FIX instruction to convert a floating point value to an
13108 integer value chooses the nearest integer less than or equal to the
13109 floating point value rather than to the nearest integer.  Thus if the
13110 floating point number is negative, the result will be incorrectly
13111 truncated an additional code is necessary to detect and correct this
13112 case.  This option can be used to disable generation of the additional
13113 code required to correct the result.
13115 @item -mrptb
13116 @itemx -mno-rptb
13117 @opindex mrptb
13118 @opindex mno-rptb
13119 Enable (disable) generation of repeat block sequences using the RPTB
13120 instruction for zero overhead looping.  The RPTB construct is only used
13121 for innermost loops that do not call functions or jump across the loop
13122 boundaries.  There is no advantage having nested RPTB loops due to the
13123 overhead required to save and restore the RC, RS, and RE registers.
13124 This is enabled by default with @option{-O2}.
13126 @item -mrpts=@var{count}
13127 @itemx -mno-rpts
13128 @opindex mrpts
13129 @opindex mno-rpts
13130 Enable (disable) the use of the single instruction repeat instruction
13131 RPTS@.  If a repeat block contains a single instruction, and the loop
13132 count can be guaranteed to be less than the value @var{count}, GCC will
13133 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13134 then a RPTS will be emitted even if the loop count cannot be determined
13135 at compile time.  Note that the repeated instruction following RPTS does
13136 not have to be reloaded from memory each iteration, thus freeing up the
13137 CPU buses for operands.  However, since interrupts are blocked by this
13138 instruction, it is disabled by default.
13140 @item -mloop-unsigned
13141 @itemx -mno-loop-unsigned
13142 @opindex mloop-unsigned
13143 @opindex mno-loop-unsigned
13144 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13145 is @math{2^{31} + 1} since these instructions test if the iteration count is
13146 negative to terminate the loop.  If the iteration count is unsigned
13147 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13148 exceeded.  This switch allows an unsigned iteration count.
13150 @item -mti
13151 @opindex mti
13152 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13153 with.  This also enforces compatibility with the API employed by the TI
13154 C3x C compiler.  For example, long doubles are passed as structures
13155 rather than in floating point registers.
13157 @item -mregparm
13158 @itemx -mmemparm
13159 @opindex mregparm
13160 @opindex mmemparm
13161 Generate code that uses registers (stack) for passing arguments to functions.
13162 By default, arguments are passed in registers where possible rather
13163 than by pushing arguments on to the stack.
13165 @item -mparallel-insns
13166 @itemx -mno-parallel-insns
13167 @opindex mparallel-insns
13168 @opindex mno-parallel-insns
13169 Allow the generation of parallel instructions.  This is enabled by
13170 default with @option{-O2}.
13172 @item -mparallel-mpy
13173 @itemx -mno-parallel-mpy
13174 @opindex mparallel-mpy
13175 @opindex mno-parallel-mpy
13176 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13177 provided @option{-mparallel-insns} is also specified.  These instructions have
13178 tight register constraints which can pessimize the code generation
13179 of large functions.
13181 @end table
13183 @node V850 Options
13184 @subsection V850 Options
13185 @cindex V850 Options
13187 These @samp{-m} options are defined for V850 implementations:
13189 @table @gcctabopt
13190 @item -mlong-calls
13191 @itemx -mno-long-calls
13192 @opindex mlong-calls
13193 @opindex mno-long-calls
13194 Treat all calls as being far away (near).  If calls are assumed to be
13195 far away, the compiler will always load the functions address up into a
13196 register, and call indirect through the pointer.
13198 @item -mno-ep
13199 @itemx -mep
13200 @opindex mno-ep
13201 @opindex mep
13202 Do not optimize (do optimize) basic blocks that use the same index
13203 pointer 4 or more times to copy pointer into the @code{ep} register, and
13204 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13205 option is on by default if you optimize.
13207 @item -mno-prolog-function
13208 @itemx -mprolog-function
13209 @opindex mno-prolog-function
13210 @opindex mprolog-function
13211 Do not use (do use) external functions to save and restore registers
13212 at the prologue and epilogue of a function.  The external functions
13213 are slower, but use less code space if more than one function saves
13214 the same number of registers.  The @option{-mprolog-function} option
13215 is on by default if you optimize.
13217 @item -mspace
13218 @opindex mspace
13219 Try to make the code as small as possible.  At present, this just turns
13220 on the @option{-mep} and @option{-mprolog-function} options.
13222 @item -mtda=@var{n}
13223 @opindex mtda
13224 Put static or global variables whose size is @var{n} bytes or less into
13225 the tiny data area that register @code{ep} points to.  The tiny data
13226 area can hold up to 256 bytes in total (128 bytes for byte references).
13228 @item -msda=@var{n}
13229 @opindex msda
13230 Put static or global variables whose size is @var{n} bytes or less into
13231 the small data area that register @code{gp} points to.  The small data
13232 area can hold up to 64 kilobytes.
13234 @item -mzda=@var{n}
13235 @opindex mzda
13236 Put static or global variables whose size is @var{n} bytes or less into
13237 the first 32 kilobytes of memory.
13239 @item -mv850
13240 @opindex mv850
13241 Specify that the target processor is the V850.
13243 @item -mbig-switch
13244 @opindex mbig-switch
13245 Generate code suitable for big switch tables.  Use this option only if
13246 the assembler/linker complain about out of range branches within a switch
13247 table.
13249 @item -mapp-regs
13250 @opindex mapp-regs
13251 This option will cause r2 and r5 to be used in the code generated by
13252 the compiler.  This setting is the default.
13254 @item -mno-app-regs
13255 @opindex mno-app-regs
13256 This option will cause r2 and r5 to be treated as fixed registers.
13258 @item -mv850e1
13259 @opindex mv850e1
13260 Specify that the target processor is the V850E1.  The preprocessor
13261 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
13262 this option is used.
13264 @item -mv850e
13265 @opindex mv850e
13266 Specify that the target processor is the V850E@.  The preprocessor
13267 constant @samp{__v850e__} will be defined if this option is used.
13269 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
13270 are defined then a default target processor will be chosen and the
13271 relevant @samp{__v850*__} preprocessor constant will be defined.
13273 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
13274 defined, regardless of which processor variant is the target.
13276 @item -mdisable-callt
13277 @opindex mdisable-callt
13278 This option will suppress generation of the CALLT instruction for the
13279 v850e and v850e1 flavors of the v850 architecture.  The default is
13280 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
13282 @end table
13284 @node VAX Options
13285 @subsection VAX Options
13286 @cindex VAX options
13288 These @samp{-m} options are defined for the VAX:
13290 @table @gcctabopt
13291 @item -munix
13292 @opindex munix
13293 Do not output certain jump instructions (@code{aobleq} and so on)
13294 that the Unix assembler for the VAX cannot handle across long
13295 ranges.
13297 @item -mgnu
13298 @opindex mgnu
13299 Do output those jump instructions, on the assumption that you
13300 will assemble with the GNU assembler.
13302 @item -mg
13303 @opindex mg
13304 Output code for g-format floating point numbers instead of d-format.
13305 @end table
13307 @node x86-64 Options
13308 @subsection x86-64 Options
13309 @cindex x86-64 options
13311 These are listed under @xref{i386 and x86-64 Options}.
13313 @node Xstormy16 Options
13314 @subsection Xstormy16 Options
13315 @cindex Xstormy16 Options
13317 These options are defined for Xstormy16:
13319 @table @gcctabopt
13320 @item -msim
13321 @opindex msim
13322 Choose startup files and linker script suitable for the simulator.
13323 @end table
13325 @node Xtensa Options
13326 @subsection Xtensa Options
13327 @cindex Xtensa Options
13329 These options are supported for Xtensa targets:
13331 @table @gcctabopt
13332 @item -mconst16
13333 @itemx -mno-const16
13334 @opindex mconst16
13335 @opindex mno-const16
13336 Enable or disable use of @code{CONST16} instructions for loading
13337 constant values.  The @code{CONST16} instruction is currently not a
13338 standard option from Tensilica.  When enabled, @code{CONST16}
13339 instructions are always used in place of the standard @code{L32R}
13340 instructions.  The use of @code{CONST16} is enabled by default only if
13341 the @code{L32R} instruction is not available.
13343 @item -mfused-madd
13344 @itemx -mno-fused-madd
13345 @opindex mfused-madd
13346 @opindex mno-fused-madd
13347 Enable or disable use of fused multiply/add and multiply/subtract
13348 instructions in the floating-point option.  This has no effect if the
13349 floating-point option is not also enabled.  Disabling fused multiply/add
13350 and multiply/subtract instructions forces the compiler to use separate
13351 instructions for the multiply and add/subtract operations.  This may be
13352 desirable in some cases where strict IEEE 754-compliant results are
13353 required: the fused multiply add/subtract instructions do not round the
13354 intermediate result, thereby producing results with @emph{more} bits of
13355 precision than specified by the IEEE standard.  Disabling fused multiply
13356 add/subtract instructions also ensures that the program output is not
13357 sensitive to the compiler's ability to combine multiply and add/subtract
13358 operations.
13360 @item -mtext-section-literals
13361 @itemx -mno-text-section-literals
13362 @opindex mtext-section-literals
13363 @opindex mno-text-section-literals
13364 Control the treatment of literal pools.  The default is
13365 @option{-mno-text-section-literals}, which places literals in a separate
13366 section in the output file.  This allows the literal pool to be placed
13367 in a data RAM/ROM, and it also allows the linker to combine literal
13368 pools from separate object files to remove redundant literals and
13369 improve code size.  With @option{-mtext-section-literals}, the literals
13370 are interspersed in the text section in order to keep them as close as
13371 possible to their references.  This may be necessary for large assembly
13372 files.
13374 @item -mtarget-align
13375 @itemx -mno-target-align
13376 @opindex mtarget-align
13377 @opindex mno-target-align
13378 When this option is enabled, GCC instructs the assembler to
13379 automatically align instructions to reduce branch penalties at the
13380 expense of some code density.  The assembler attempts to widen density
13381 instructions to align branch targets and the instructions following call
13382 instructions.  If there are not enough preceding safe density
13383 instructions to align a target, no widening will be performed.  The
13384 default is @option{-mtarget-align}.  These options do not affect the
13385 treatment of auto-aligned instructions like @code{LOOP}, which the
13386 assembler will always align, either by widening density instructions or
13387 by inserting no-op instructions.
13389 @item -mlongcalls
13390 @itemx -mno-longcalls
13391 @opindex mlongcalls
13392 @opindex mno-longcalls
13393 When this option is enabled, GCC instructs the assembler to translate
13394 direct calls to indirect calls unless it can determine that the target
13395 of a direct call is in the range allowed by the call instruction.  This
13396 translation typically occurs for calls to functions in other source
13397 files.  Specifically, the assembler translates a direct @code{CALL}
13398 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
13399 The default is @option{-mno-longcalls}.  This option should be used in
13400 programs where the call target can potentially be out of range.  This
13401 option is implemented in the assembler, not the compiler, so the
13402 assembly code generated by GCC will still show direct call
13403 instructions---look at the disassembled object code to see the actual
13404 instructions.  Note that the assembler will use an indirect call for
13405 every cross-file call, not just those that really will be out of range.
13406 @end table
13408 @node zSeries Options
13409 @subsection zSeries Options
13410 @cindex zSeries options
13412 These are listed under @xref{S/390 and zSeries Options}.
13414 @node Code Gen Options
13415 @section Options for Code Generation Conventions
13416 @cindex code generation conventions
13417 @cindex options, code generation
13418 @cindex run-time options
13420 These machine-independent options control the interface conventions
13421 used in code generation.
13423 Most of them have both positive and negative forms; the negative form
13424 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
13425 one of the forms is listed---the one which is not the default.  You
13426 can figure out the other form by either removing @samp{no-} or adding
13429 @table @gcctabopt
13430 @item -fbounds-check
13431 @opindex fbounds-check
13432 For front-ends that support it, generate additional code to check that
13433 indices used to access arrays are within the declared range.  This is
13434 currently only supported by the Java and Fortran front-ends, where
13435 this option defaults to true and false respectively.
13437 @item -ftrapv
13438 @opindex ftrapv
13439 This option generates traps for signed overflow on addition, subtraction,
13440 multiplication operations.
13442 @item -fwrapv
13443 @opindex fwrapv
13444 This option instructs the compiler to assume that signed arithmetic
13445 overflow of addition, subtraction and multiplication wraps around
13446 using twos-complement representation.  This flag enables some optimizations
13447 and disables others.  This option is enabled by default for the Java
13448 front-end, as required by the Java language specification.
13450 @item -fexceptions
13451 @opindex fexceptions
13452 Enable exception handling.  Generates extra code needed to propagate
13453 exceptions.  For some targets, this implies GCC will generate frame
13454 unwind information for all functions, which can produce significant data
13455 size overhead, although it does not affect execution.  If you do not
13456 specify this option, GCC will enable it by default for languages like
13457 C++ which normally require exception handling, and disable it for
13458 languages like C that do not normally require it.  However, you may need
13459 to enable this option when compiling C code that needs to interoperate
13460 properly with exception handlers written in C++.  You may also wish to
13461 disable this option if you are compiling older C++ programs that don't
13462 use exception handling.
13464 @item -fnon-call-exceptions
13465 @opindex fnon-call-exceptions
13466 Generate code that allows trapping instructions to throw exceptions.
13467 Note that this requires platform-specific runtime support that does
13468 not exist everywhere.  Moreover, it only allows @emph{trapping}
13469 instructions to throw exceptions, i.e.@: memory references or floating
13470 point instructions.  It does not allow exceptions to be thrown from
13471 arbitrary signal handlers such as @code{SIGALRM}.
13473 @item -funwind-tables
13474 @opindex funwind-tables
13475 Similar to @option{-fexceptions}, except that it will just generate any needed
13476 static data, but will not affect the generated code in any other way.
13477 You will normally not enable this option; instead, a language processor
13478 that needs this handling would enable it on your behalf.
13480 @item -fasynchronous-unwind-tables
13481 @opindex fasynchronous-unwind-tables
13482 Generate unwind table in dwarf2 format, if supported by target machine.  The
13483 table is exact at each instruction boundary, so it can be used for stack
13484 unwinding from asynchronous events (such as debugger or garbage collector).
13486 @item -fpcc-struct-return
13487 @opindex fpcc-struct-return
13488 Return ``short'' @code{struct} and @code{union} values in memory like
13489 longer ones, rather than in registers.  This convention is less
13490 efficient, but it has the advantage of allowing intercallability between
13491 GCC-compiled files and files compiled with other compilers, particularly
13492 the Portable C Compiler (pcc).
13494 The precise convention for returning structures in memory depends
13495 on the target configuration macros.
13497 Short structures and unions are those whose size and alignment match
13498 that of some integer type.
13500 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13501 switch is not binary compatible with code compiled with the
13502 @option{-freg-struct-return} switch.
13503 Use it to conform to a non-default application binary interface.
13505 @item -freg-struct-return
13506 @opindex freg-struct-return
13507 Return @code{struct} and @code{union} values in registers when possible.
13508 This is more efficient for small structures than
13509 @option{-fpcc-struct-return}.
13511 If you specify neither @option{-fpcc-struct-return} nor
13512 @option{-freg-struct-return}, GCC defaults to whichever convention is
13513 standard for the target.  If there is no standard convention, GCC
13514 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
13515 the principal compiler.  In those cases, we can choose the standard, and
13516 we chose the more efficient register return alternative.
13518 @strong{Warning:} code compiled with the @option{-freg-struct-return}
13519 switch is not binary compatible with code compiled with the
13520 @option{-fpcc-struct-return} switch.
13521 Use it to conform to a non-default application binary interface.
13523 @item -fshort-enums
13524 @opindex fshort-enums
13525 Allocate to an @code{enum} type only as many bytes as it needs for the
13526 declared range of possible values.  Specifically, the @code{enum} type
13527 will be equivalent to the smallest integer type which has enough room.
13529 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
13530 code that is not binary compatible with code generated without that switch.
13531 Use it to conform to a non-default application binary interface.
13533 @item -fshort-double
13534 @opindex fshort-double
13535 Use the same size for @code{double} as for @code{float}.
13537 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
13538 code that is not binary compatible with code generated without that switch.
13539 Use it to conform to a non-default application binary interface.
13541 @item -fshort-wchar
13542 @opindex fshort-wchar
13543 Override the underlying type for @samp{wchar_t} to be @samp{short
13544 unsigned int} instead of the default for the target.  This option is
13545 useful for building programs to run under WINE@.
13547 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
13548 code that is not binary compatible with code generated without that switch.
13549 Use it to conform to a non-default application binary interface.
13551 @item -fno-common
13552 @opindex fno-common
13553 In C, allocate even uninitialized global variables in the data section of the
13554 object file, rather than generating them as common blocks.  This has the
13555 effect that if the same variable is declared (without @code{extern}) in
13556 two different compilations, you will get an error when you link them.
13557 The only reason this might be useful is if you wish to verify that the
13558 program will work on other systems which always work this way.
13560 @item -fno-ident
13561 @opindex fno-ident
13562 Ignore the @samp{#ident} directive.
13564 @item -finhibit-size-directive
13565 @opindex finhibit-size-directive
13566 Don't output a @code{.size} assembler directive, or anything else that
13567 would cause trouble if the function is split in the middle, and the
13568 two halves are placed at locations far apart in memory.  This option is
13569 used when compiling @file{crtstuff.c}; you should not need to use it
13570 for anything else.
13572 @item -fverbose-asm
13573 @opindex fverbose-asm
13574 Put extra commentary information in the generated assembly code to
13575 make it more readable.  This option is generally only of use to those
13576 who actually need to read the generated assembly code (perhaps while
13577 debugging the compiler itself).
13579 @option{-fno-verbose-asm}, the default, causes the
13580 extra information to be omitted and is useful when comparing two assembler
13581 files.
13583 @item -frecord-gcc-switches
13584 @opindex frecord-gcc-switches
13585 This switch causes the command line that was used to invoke the
13586 compiler to be recorded into the object file that is being created.
13587 This switch is only implemented on some targets and the exact format
13588 of the recording is target and binary file format dependent, but it
13589 usually takes the form of a section containing ASCII text.  This
13590 switch is related to the @option{-fverbose-asm} switch, but that
13591 switch only records information in the assembler output file as
13592 comments, so it never reaches the object file.
13594 @item -fpic
13595 @opindex fpic
13596 @cindex global offset table
13597 @cindex PIC
13598 Generate position-independent code (PIC) suitable for use in a shared
13599 library, if supported for the target machine.  Such code accesses all
13600 constant addresses through a global offset table (GOT)@.  The dynamic
13601 loader resolves the GOT entries when the program starts (the dynamic
13602 loader is not part of GCC; it is part of the operating system).  If
13603 the GOT size for the linked executable exceeds a machine-specific
13604 maximum size, you get an error message from the linker indicating that
13605 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
13606 instead.  (These maximums are 8k on the SPARC and 32k
13607 on the m68k and RS/6000.  The 386 has no such limit.)
13609 Position-independent code requires special support, and therefore works
13610 only on certain machines.  For the 386, GCC supports PIC for System V
13611 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
13612 position-independent.
13614 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13615 are defined to 1.
13617 @item -fPIC
13618 @opindex fPIC
13619 If supported for the target machine, emit position-independent code,
13620 suitable for dynamic linking and avoiding any limit on the size of the
13621 global offset table.  This option makes a difference on the m68k,
13622 PowerPC and SPARC@.
13624 Position-independent code requires special support, and therefore works
13625 only on certain machines.
13627 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13628 are defined to 2.
13630 @item -fpie
13631 @itemx -fPIE
13632 @opindex fpie
13633 @opindex fPIE
13634 These options are similar to @option{-fpic} and @option{-fPIC}, but
13635 generated position independent code can be only linked into executables.
13636 Usually these options are used when @option{-pie} GCC option will be
13637 used during linking.
13639 @item -fno-jump-tables
13640 @opindex fno-jump-tables
13641 Do not use jump tables for switch statements even where it would be
13642 more efficient than other code generation strategies.  This option is
13643 of use in conjunction with @option{-fpic} or @option{-fPIC} for
13644 building code which forms part of a dynamic linker and cannot
13645 reference the address of a jump table.  On some targets, jump tables
13646 do not require a GOT and this option is not needed.
13648 @item -ffixed-@var{reg}
13649 @opindex ffixed
13650 Treat the register named @var{reg} as a fixed register; generated code
13651 should never refer to it (except perhaps as a stack pointer, frame
13652 pointer or in some other fixed role).
13654 @var{reg} must be the name of a register.  The register names accepted
13655 are machine-specific and are defined in the @code{REGISTER_NAMES}
13656 macro in the machine description macro file.
13658 This flag does not have a negative form, because it specifies a
13659 three-way choice.
13661 @item -fcall-used-@var{reg}
13662 @opindex fcall-used
13663 Treat the register named @var{reg} as an allocable register that is
13664 clobbered by function calls.  It may be allocated for temporaries or
13665 variables that do not live across a call.  Functions compiled this way
13666 will not save and restore the register @var{reg}.
13668 It is an error to used this flag with the frame pointer or stack pointer.
13669 Use of this flag for other registers that have fixed pervasive roles in
13670 the machine's execution model will produce disastrous results.
13672 This flag does not have a negative form, because it specifies a
13673 three-way choice.
13675 @item -fcall-saved-@var{reg}
13676 @opindex fcall-saved
13677 Treat the register named @var{reg} as an allocable register saved by
13678 functions.  It may be allocated even for temporaries or variables that
13679 live across a call.  Functions compiled this way will save and restore
13680 the register @var{reg} if they use it.
13682 It is an error to used this flag with the frame pointer or stack pointer.
13683 Use of this flag for other registers that have fixed pervasive roles in
13684 the machine's execution model will produce disastrous results.
13686 A different sort of disaster will result from the use of this flag for
13687 a register in which function values may be returned.
13689 This flag does not have a negative form, because it specifies a
13690 three-way choice.
13692 @item -fpack-struct[=@var{n}]
13693 @opindex fpack-struct
13694 Without a value specified, pack all structure members together without
13695 holes.  When a value is specified (which must be a small power of two), pack
13696 structure members according to this value, representing the maximum
13697 alignment (that is, objects with default alignment requirements larger than
13698 this will be output potentially unaligned at the next fitting location.
13700 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
13701 code that is not binary compatible with code generated without that switch.
13702 Additionally, it makes the code suboptimal.
13703 Use it to conform to a non-default application binary interface.
13705 @item -finstrument-functions
13706 @opindex finstrument-functions
13707 Generate instrumentation calls for entry and exit to functions.  Just
13708 after function entry and just before function exit, the following
13709 profiling functions will be called with the address of the current
13710 function and its call site.  (On some platforms,
13711 @code{__builtin_return_address} does not work beyond the current
13712 function, so the call site information may not be available to the
13713 profiling functions otherwise.)
13715 @smallexample
13716 void __cyg_profile_func_enter (void *this_fn,
13717                                void *call_site);
13718 void __cyg_profile_func_exit  (void *this_fn,
13719                                void *call_site);
13720 @end smallexample
13722 The first argument is the address of the start of the current function,
13723 which may be looked up exactly in the symbol table.
13725 This instrumentation is also done for functions expanded inline in other
13726 functions.  The profiling calls will indicate where, conceptually, the
13727 inline function is entered and exited.  This means that addressable
13728 versions of such functions must be available.  If all your uses of a
13729 function are expanded inline, this may mean an additional expansion of
13730 code size.  If you use @samp{extern inline} in your C code, an
13731 addressable version of such functions must be provided.  (This is
13732 normally the case anyways, but if you get lucky and the optimizer always
13733 expands the functions inline, you might have gotten away without
13734 providing static copies.)
13736 A function may be given the attribute @code{no_instrument_function}, in
13737 which case this instrumentation will not be done.  This can be used, for
13738 example, for the profiling functions listed above, high-priority
13739 interrupt routines, and any functions from which the profiling functions
13740 cannot safely be called (perhaps signal handlers, if the profiling
13741 routines generate output or allocate memory).
13743 @item -fstack-check
13744 @opindex fstack-check
13745 Generate code to verify that you do not go beyond the boundary of the
13746 stack.  You should specify this flag if you are running in an
13747 environment with multiple threads, but only rarely need to specify it in
13748 a single-threaded environment since stack overflow is automatically
13749 detected on nearly all systems if there is only one stack.
13751 Note that this switch does not actually cause checking to be done; the
13752 operating system must do that.  The switch causes generation of code
13753 to ensure that the operating system sees the stack being extended.
13755 @item -fstack-limit-register=@var{reg}
13756 @itemx -fstack-limit-symbol=@var{sym}
13757 @itemx -fno-stack-limit
13758 @opindex fstack-limit-register
13759 @opindex fstack-limit-symbol
13760 @opindex fno-stack-limit
13761 Generate code to ensure that the stack does not grow beyond a certain value,
13762 either the value of a register or the address of a symbol.  If the stack
13763 would grow beyond the value, a signal is raised.  For most targets,
13764 the signal is raised before the stack overruns the boundary, so
13765 it is possible to catch the signal without taking special precautions.
13767 For instance, if the stack starts at absolute address @samp{0x80000000}
13768 and grows downwards, you can use the flags
13769 @option{-fstack-limit-symbol=__stack_limit} and
13770 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
13771 of 128KB@.  Note that this may only work with the GNU linker.
13773 @cindex aliasing of parameters
13774 @cindex parameters, aliased
13775 @item -fargument-alias
13776 @itemx -fargument-noalias
13777 @itemx -fargument-noalias-global
13778 @itemx -fargument-noalias-anything
13779 @opindex fargument-alias
13780 @opindex fargument-noalias
13781 @opindex fargument-noalias-global
13782 @opindex fargument-noalias-anything
13783 Specify the possible relationships among parameters and between
13784 parameters and global data.
13786 @option{-fargument-alias} specifies that arguments (parameters) may
13787 alias each other and may alias global storage.@*
13788 @option{-fargument-noalias} specifies that arguments do not alias
13789 each other, but may alias global storage.@*
13790 @option{-fargument-noalias-global} specifies that arguments do not
13791 alias each other and do not alias global storage.
13792 @option{-fargument-noalias-anything} specifies that arguments do not
13793 alias any other storage.
13795 Each language will automatically use whatever option is required by
13796 the language standard.  You should not need to use these options yourself.
13798 @item -fleading-underscore
13799 @opindex fleading-underscore
13800 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
13801 change the way C symbols are represented in the object file.  One use
13802 is to help link with legacy assembly code.
13804 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
13805 generate code that is not binary compatible with code generated without that
13806 switch.  Use it to conform to a non-default application binary interface.
13807 Not all targets provide complete support for this switch.
13809 @item -ftls-model=@var{model}
13810 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
13811 The @var{model} argument should be one of @code{global-dynamic},
13812 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
13814 The default without @option{-fpic} is @code{initial-exec}; with
13815 @option{-fpic} the default is @code{global-dynamic}.
13817 @item -fvisibility=@var{default|internal|hidden|protected}
13818 @opindex fvisibility
13819 Set the default ELF image symbol visibility to the specified option---all
13820 symbols will be marked with this unless overridden within the code.
13821 Using this feature can very substantially improve linking and
13822 load times of shared object libraries, produce more optimized
13823 code, provide near-perfect API export and prevent symbol clashes.
13824 It is @strong{strongly} recommended that you use this in any shared objects
13825 you distribute.
13827 Despite the nomenclature, @code{default} always means public ie;
13828 available to be linked against from outside the shared object.
13829 @code{protected} and @code{internal} are pretty useless in real-world
13830 usage so the only other commonly used option will be @code{hidden}.
13831 The default if @option{-fvisibility} isn't specified is
13832 @code{default}, i.e., make every
13833 symbol public---this causes the same behavior as previous versions of
13834 GCC@.
13836 A good explanation of the benefits offered by ensuring ELF
13837 symbols have the correct visibility is given by ``How To Write
13838 Shared Libraries'' by Ulrich Drepper (which can be found at
13839 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
13840 solution made possible by this option to marking things hidden when
13841 the default is public is to make the default hidden and mark things
13842 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
13843 and @code{__attribute__ ((visibility("default")))} instead of
13844 @code{__declspec(dllexport)} you get almost identical semantics with
13845 identical syntax.  This is a great boon to those working with
13846 cross-platform projects.
13848 For those adding visibility support to existing code, you may find
13849 @samp{#pragma GCC visibility} of use.  This works by you enclosing
13850 the declarations you wish to set visibility for with (for example)
13851 @samp{#pragma GCC visibility push(hidden)} and
13852 @samp{#pragma GCC visibility pop}.
13853 Bear in mind that symbol visibility should be viewed @strong{as
13854 part of the API interface contract} and thus all new code should
13855 always specify visibility when it is not the default ie; declarations
13856 only for use within the local DSO should @strong{always} be marked explicitly
13857 as hidden as so to avoid PLT indirection overheads---making this
13858 abundantly clear also aids readability and self-documentation of the code.
13859 Note that due to ISO C++ specification requirements, operator new and
13860 operator delete must always be of default visibility.
13862 Be aware that headers from outside your project, in particular system
13863 headers and headers from any other library you use, may not be
13864 expecting to be compiled with visibility other than the default.  You
13865 may need to explicitly say @samp{#pragma GCC visibility push(default)}
13866 before including any such headers.
13868 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
13869 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
13870 no modifications.  However, this means that calls to @samp{extern}
13871 functions with no explicit visibility will use the PLT, so it is more
13872 effective to use @samp{__attribute ((visibility))} and/or
13873 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
13874 declarations should be treated as hidden.
13876 Note that @samp{-fvisibility} does affect C++ vague linkage
13877 entities. This means that, for instance, an exception class that will
13878 be thrown between DSOs must be explicitly marked with default
13879 visibility so that the @samp{type_info} nodes will be unified between
13880 the DSOs.
13882 An overview of these techniques, their benefits and how to use them
13883 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
13885 @end table
13887 @c man end
13889 @node Environment Variables
13890 @section Environment Variables Affecting GCC
13891 @cindex environment variables
13893 @c man begin ENVIRONMENT
13894 This section describes several environment variables that affect how GCC
13895 operates.  Some of them work by specifying directories or prefixes to use
13896 when searching for various kinds of files.  Some are used to specify other
13897 aspects of the compilation environment.
13899 Note that you can also specify places to search using options such as
13900 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
13901 take precedence over places specified using environment variables, which
13902 in turn take precedence over those specified by the configuration of GCC@.
13903 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
13904 GNU Compiler Collection (GCC) Internals}.
13906 @table @env
13907 @item LANG
13908 @itemx LC_CTYPE
13909 @c @itemx LC_COLLATE
13910 @itemx LC_MESSAGES
13911 @c @itemx LC_MONETARY
13912 @c @itemx LC_NUMERIC
13913 @c @itemx LC_TIME
13914 @itemx LC_ALL
13915 @findex LANG
13916 @findex LC_CTYPE
13917 @c @findex LC_COLLATE
13918 @findex LC_MESSAGES
13919 @c @findex LC_MONETARY
13920 @c @findex LC_NUMERIC
13921 @c @findex LC_TIME
13922 @findex LC_ALL
13923 @cindex locale
13924 These environment variables control the way that GCC uses
13925 localization information that allow GCC to work with different
13926 national conventions.  GCC inspects the locale categories
13927 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
13928 so.  These locale categories can be set to any value supported by your
13929 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
13930 Kingdom encoded in UTF-8.
13932 The @env{LC_CTYPE} environment variable specifies character
13933 classification.  GCC uses it to determine the character boundaries in
13934 a string; this is needed for some multibyte encodings that contain quote
13935 and escape characters that would otherwise be interpreted as a string
13936 end or escape.
13938 The @env{LC_MESSAGES} environment variable specifies the language to
13939 use in diagnostic messages.
13941 If the @env{LC_ALL} environment variable is set, it overrides the value
13942 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
13943 and @env{LC_MESSAGES} default to the value of the @env{LANG}
13944 environment variable.  If none of these variables are set, GCC
13945 defaults to traditional C English behavior.
13947 @item TMPDIR
13948 @findex TMPDIR
13949 If @env{TMPDIR} is set, it specifies the directory to use for temporary
13950 files.  GCC uses temporary files to hold the output of one stage of
13951 compilation which is to be used as input to the next stage: for example,
13952 the output of the preprocessor, which is the input to the compiler
13953 proper.
13955 @item GCC_EXEC_PREFIX
13956 @findex GCC_EXEC_PREFIX
13957 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
13958 names of the subprograms executed by the compiler.  No slash is added
13959 when this prefix is combined with the name of a subprogram, but you can
13960 specify a prefix that ends with a slash if you wish.
13962 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
13963 an appropriate prefix to use based on the pathname it was invoked with.
13965 If GCC cannot find the subprogram using the specified prefix, it
13966 tries looking in the usual places for the subprogram.
13968 The default value of @env{GCC_EXEC_PREFIX} is
13969 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the value
13970 of @code{prefix} when you ran the @file{configure} script.
13972 Other prefixes specified with @option{-B} take precedence over this prefix.
13974 This prefix is also used for finding files such as @file{crt0.o} that are
13975 used for linking.
13977 In addition, the prefix is used in an unusual way in finding the
13978 directories to search for header files.  For each of the standard
13979 directories whose name normally begins with @samp{/usr/local/lib/gcc}
13980 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
13981 replacing that beginning with the specified prefix to produce an
13982 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
13983 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
13984 These alternate directories are searched first; the standard directories
13985 come next.
13987 @item COMPILER_PATH
13988 @findex COMPILER_PATH
13989 The value of @env{COMPILER_PATH} is a colon-separated list of
13990 directories, much like @env{PATH}.  GCC tries the directories thus
13991 specified when searching for subprograms, if it can't find the
13992 subprograms using @env{GCC_EXEC_PREFIX}.
13994 @item LIBRARY_PATH
13995 @findex LIBRARY_PATH
13996 The value of @env{LIBRARY_PATH} is a colon-separated list of
13997 directories, much like @env{PATH}.  When configured as a native compiler,
13998 GCC tries the directories thus specified when searching for special
13999 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
14000 using GCC also uses these directories when searching for ordinary
14001 libraries for the @option{-l} option (but directories specified with
14002 @option{-L} come first).
14004 @item LANG
14005 @findex LANG
14006 @cindex locale definition
14007 This variable is used to pass locale information to the compiler.  One way in
14008 which this information is used is to determine the character set to be used
14009 when character literals, string literals and comments are parsed in C and C++.
14010 When the compiler is configured to allow multibyte characters,
14011 the following values for @env{LANG} are recognized:
14013 @table @samp
14014 @item C-JIS
14015 Recognize JIS characters.
14016 @item C-SJIS
14017 Recognize SJIS characters.
14018 @item C-EUCJP
14019 Recognize EUCJP characters.
14020 @end table
14022 If @env{LANG} is not defined, or if it has some other value, then the
14023 compiler will use mblen and mbtowc as defined by the default locale to
14024 recognize and translate multibyte characters.
14025 @end table
14027 @noindent
14028 Some additional environments variables affect the behavior of the
14029 preprocessor.
14031 @include cppenv.texi
14033 @c man end
14035 @node Precompiled Headers
14036 @section Using Precompiled Headers
14037 @cindex precompiled headers
14038 @cindex speed of compilation
14040 Often large projects have many header files that are included in every
14041 source file.  The time the compiler takes to process these header files
14042 over and over again can account for nearly all of the time required to
14043 build the project.  To make builds faster, GCC allows users to
14044 `precompile' a header file; then, if builds can use the precompiled
14045 header file they will be much faster.
14047 To create a precompiled header file, simply compile it as you would any
14048 other file, if necessary using the @option{-x} option to make the driver
14049 treat it as a C or C++ header file.  You will probably want to use a
14050 tool like @command{make} to keep the precompiled header up-to-date when
14051 the headers it contains change.
14053 A precompiled header file will be searched for when @code{#include} is
14054 seen in the compilation.  As it searches for the included file
14055 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
14056 compiler looks for a precompiled header in each directory just before it
14057 looks for the include file in that directory.  The name searched for is
14058 the name specified in the @code{#include} with @samp{.gch} appended.  If
14059 the precompiled header file can't be used, it is ignored.
14061 For instance, if you have @code{#include "all.h"}, and you have
14062 @file{all.h.gch} in the same directory as @file{all.h}, then the
14063 precompiled header file will be used if possible, and the original
14064 header will be used otherwise.
14066 Alternatively, you might decide to put the precompiled header file in a
14067 directory and use @option{-I} to ensure that directory is searched
14068 before (or instead of) the directory containing the original header.
14069 Then, if you want to check that the precompiled header file is always
14070 used, you can put a file of the same name as the original header in this
14071 directory containing an @code{#error} command.
14073 This also works with @option{-include}.  So yet another way to use
14074 precompiled headers, good for projects not designed with precompiled
14075 header files in mind, is to simply take most of the header files used by
14076 a project, include them from another header file, precompile that header
14077 file, and @option{-include} the precompiled header.  If the header files
14078 have guards against multiple inclusion, they will be skipped because
14079 they've already been included (in the precompiled header).
14081 If you need to precompile the same header file for different
14082 languages, targets, or compiler options, you can instead make a
14083 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14084 header in the directory, perhaps using @option{-o}.  It doesn't matter
14085 what you call the files in the directory, every precompiled header in
14086 the directory will be considered.  The first precompiled header
14087 encountered in the directory that is valid for this compilation will
14088 be used; they're searched in no particular order.
14090 There are many other possibilities, limited only by your imagination,
14091 good sense, and the constraints of your build system.
14093 A precompiled header file can be used only when these conditions apply:
14095 @itemize
14096 @item
14097 Only one precompiled header can be used in a particular compilation.
14099 @item
14100 A precompiled header can't be used once the first C token is seen.  You
14101 can have preprocessor directives before a precompiled header; you can
14102 even include a precompiled header from inside another header, so long as
14103 there are no C tokens before the @code{#include}.
14105 @item
14106 The precompiled header file must be produced for the same language as
14107 the current compilation.  You can't use a C precompiled header for a C++
14108 compilation.
14110 @item
14111 The precompiled header file must have been produced by the same compiler
14112 binary as the current compilation is using.
14114 @item
14115 Any macros defined before the precompiled header is included must
14116 either be defined in the same way as when the precompiled header was
14117 generated, or must not affect the precompiled header, which usually
14118 means that they don't appear in the precompiled header at all.
14120 The @option{-D} option is one way to define a macro before a
14121 precompiled header is included; using a @code{#define} can also do it.
14122 There are also some options that define macros implicitly, like
14123 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14124 defined this way.
14126 @item If debugging information is output when using the precompiled
14127 header, using @option{-g} or similar, the same kind of debugging information
14128 must have been output when building the precompiled header.  However,
14129 a precompiled header built using @option{-g} can be used in a compilation
14130 when no debugging information is being output.
14132 @item The same @option{-m} options must generally be used when building
14133 and using the precompiled header.  @xref{Submodel Options},
14134 for any cases where this rule is relaxed.
14136 @item Each of the following options must be the same when building and using
14137 the precompiled header:
14139 @gccoptlist{-fexceptions -funit-at-a-time}
14141 @item
14142 Some other command-line options starting with @option{-f},
14143 @option{-p}, or @option{-O} must be defined in the same way as when
14144 the precompiled header was generated.  At present, it's not clear
14145 which options are safe to change and which are not; the safest choice
14146 is to use exactly the same options when generating and using the
14147 precompiled header.  The following are known to be safe:
14149 @gccoptlist{-fmessage-length= -fpreprocessed
14150 -fsched-interblock -fsched-spec -fsched-spec-load -fsched-spec-load-dangerous
14151 -fsched-verbose=<number> -fschedule-insns -fvisibility=
14152 -pedantic-errors}
14154 @end itemize
14156 For all of these except the last, the compiler will automatically
14157 ignore the precompiled header if the conditions aren't met.  If you
14158 find an option combination that doesn't work and doesn't cause the
14159 precompiled header to be ignored, please consider filing a bug report,
14160 see @ref{Bugs}.
14162 If you do use differing options when generating and using the
14163 precompiled header, the actual behavior will be a mixture of the
14164 behavior for the options.  For instance, if you use @option{-g} to
14165 generate the precompiled header but not when using it, you may or may
14166 not get debugging information for routines in the precompiled header.
14168 @node Running Protoize
14169 @section Running Protoize
14171 The program @code{protoize} is an optional part of GCC@.  You can use
14172 it to add prototypes to a program, thus converting the program to ISO
14173 C in one respect.  The companion program @code{unprotoize} does the
14174 reverse: it removes argument types from any prototypes that are found.
14176 When you run these programs, you must specify a set of source files as
14177 command line arguments.  The conversion programs start out by compiling
14178 these files to see what functions they define.  The information gathered
14179 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
14181 After scanning comes actual conversion.  The specified files are all
14182 eligible to be converted; any files they include (whether sources or
14183 just headers) are eligible as well.
14185 But not all the eligible files are converted.  By default,
14186 @code{protoize} and @code{unprotoize} convert only source and header
14187 files in the current directory.  You can specify additional directories
14188 whose files should be converted with the @option{-d @var{directory}}
14189 option.  You can also specify particular files to exclude with the
14190 @option{-x @var{file}} option.  A file is converted if it is eligible, its
14191 directory name matches one of the specified directory names, and its
14192 name within the directory has not been excluded.
14194 Basic conversion with @code{protoize} consists of rewriting most
14195 function definitions and function declarations to specify the types of
14196 the arguments.  The only ones not rewritten are those for varargs
14197 functions.
14199 @code{protoize} optionally inserts prototype declarations at the
14200 beginning of the source file, to make them available for any calls that
14201 precede the function's definition.  Or it can insert prototype
14202 declarations with block scope in the blocks where undeclared functions
14203 are called.
14205 Basic conversion with @code{unprotoize} consists of rewriting most
14206 function declarations to remove any argument types, and rewriting
14207 function definitions to the old-style pre-ISO form.
14209 Both conversion programs print a warning for any function declaration or
14210 definition that they can't convert.  You can suppress these warnings
14211 with @option{-q}.
14213 The output from @code{protoize} or @code{unprotoize} replaces the
14214 original source file.  The original file is renamed to a name ending
14215 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
14216 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
14217 for DOS) file already exists, then the source file is simply discarded.
14219 @code{protoize} and @code{unprotoize} both depend on GCC itself to
14220 scan the program and collect information about the functions it uses.
14221 So neither of these programs will work until GCC is installed.
14223 Here is a table of the options you can use with @code{protoize} and
14224 @code{unprotoize}.  Each option works with both programs unless
14225 otherwise stated.
14227 @table @code
14228 @item -B @var{directory}
14229 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
14230 usual directory (normally @file{/usr/local/lib}).  This file contains
14231 prototype information about standard system functions.  This option
14232 applies only to @code{protoize}.
14234 @item -c @var{compilation-options}
14235 Use @var{compilation-options} as the options when running @command{gcc} to
14236 produce the @samp{.X} files.  The special option @option{-aux-info} is
14237 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
14239 Note that the compilation options must be given as a single argument to
14240 @code{protoize} or @code{unprotoize}.  If you want to specify several
14241 @command{gcc} options, you must quote the entire set of compilation options
14242 to make them a single word in the shell.
14244 There are certain @command{gcc} arguments that you cannot use, because they
14245 would produce the wrong kind of output.  These include @option{-g},
14246 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
14247 the @var{compilation-options}, they are ignored.
14249 @item -C
14250 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
14251 systems) instead of @samp{.c}.  This is convenient if you are converting
14252 a C program to C++.  This option applies only to @code{protoize}.
14254 @item -g
14255 Add explicit global declarations.  This means inserting explicit
14256 declarations at the beginning of each source file for each function
14257 that is called in the file and was not declared.  These declarations
14258 precede the first function definition that contains a call to an
14259 undeclared function.  This option applies only to @code{protoize}.
14261 @item -i @var{string}
14262 Indent old-style parameter declarations with the string @var{string}.
14263 This option applies only to @code{protoize}.
14265 @code{unprotoize} converts prototyped function definitions to old-style
14266 function definitions, where the arguments are declared between the
14267 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
14268 uses five spaces as the indentation.  If you want to indent with just
14269 one space instead, use @option{-i " "}.
14271 @item -k
14272 Keep the @samp{.X} files.  Normally, they are deleted after conversion
14273 is finished.
14275 @item -l
14276 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
14277 a prototype declaration for each function in each block which calls the
14278 function without any declaration.  This option applies only to
14279 @code{protoize}.
14281 @item -n
14282 Make no real changes.  This mode just prints information about the conversions
14283 that would have been done without @option{-n}.
14285 @item -N
14286 Make no @samp{.save} files.  The original files are simply deleted.
14287 Use this option with caution.
14289 @item -p @var{program}
14290 Use the program @var{program} as the compiler.  Normally, the name
14291 @file{gcc} is used.
14293 @item -q
14294 Work quietly.  Most warnings are suppressed.
14296 @item -v
14297 Print the version number, just like @option{-v} for @command{gcc}.
14298 @end table
14300 If you need special compiler options to compile one of your program's
14301 source files, then you should generate that file's @samp{.X} file
14302 specially, by running @command{gcc} on that source file with the
14303 appropriate options and the option @option{-aux-info}.  Then run
14304 @code{protoize} on the entire set of files.  @code{protoize} will use
14305 the existing @samp{.X} file because it is newer than the source file.
14306 For example:
14308 @smallexample
14309 gcc -Dfoo=bar file1.c -aux-info file1.X
14310 protoize *.c
14311 @end smallexample
14313 @noindent
14314 You need to include the special files along with the rest in the
14315 @code{protoize} command, even though their @samp{.X} files already
14316 exist, because otherwise they won't get converted.
14318 @xref{Protoize Caveats}, for more information on how to use
14319 @code{protoize} successfully.