2007-01-19 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / doc / invoke.texi
blob72da102177f3f45e39aa73fe3fef775f0c4603fc
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} -fipra -fira -fira-alogirthm=@var{algorithm} @gol
317 -fira-biased-coloring -fkeep-inline-functions @gol
318 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
319 -fmodulo-sched -fno-branch-count-reg @gol
320 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
321 -fno-function-cse  -fno-guess-branch-probability @gol
322 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
323 -funsafe-math-optimizations  -funsafe-loop-optimizations  -ffinite-math-only @gol
324 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
325 -fomit-frame-pointer  -foptimize-register-move @gol
326 -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
327 -fprofile-generate -fprofile-use @gol
328 -fregmove  -frename-registers @gol
329 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
330 -frerun-cse-after-loop @gol
331 -frounding-math -frtl-abstract-sequences @gol
332 -fschedule-insns  -fschedule-insns2 @gol
333 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
334 -fsched-spec-load-dangerous  @gol
335 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
336 -fsched2-use-superblocks @gol
337 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
338 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
339 -fstack-protector  -fstack-protector-all @gol
340 -fstrict-aliasing  -ftracer  -fthread-jumps @gol
341 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
342 -fsplit-ivs-in-unroller -funswitch-loops @gol
343 -fvariable-expansion-in-unroller @gol
344 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
345 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
346 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
347 -ftree-ch -ftree-sra -ftree-ter -ftree-lrs -ftree-fre -ftree-vectorize @gol
348 -ftree-vect-loop-version -ftree-salias -fipa-pta -fweb @gol
349 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
350 --param @var{name}=@var{value}
351 -O  -O0  -O1  -O2  -O3  -Os}
353 @item Preprocessor Options
354 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
355 @gccoptlist{-A@var{question}=@var{answer} @gol
356 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
357 -C  -dD  -dI  -dM  -dN @gol
358 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
359 -idirafter @var{dir} @gol
360 -include @var{file}  -imacros @var{file} @gol
361 -iprefix @var{file}  -iwithprefix @var{dir} @gol
362 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
363 -imultilib @var{dir} -isysroot @var{dir} @gol
364 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
365 -P  -fworking-directory  -remap @gol
366 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
367 -Xpreprocessor @var{option}}
369 @item Assembler Option
370 @xref{Assembler Options,,Passing Options to the Assembler}.
371 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
373 @item Linker Options
374 @xref{Link Options,,Options for Linking}.
375 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
376 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
377 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
378 -Wl,@var{option}  -Xlinker @var{option} @gol
379 -u @var{symbol}}
381 @item Directory Options
382 @xref{Directory Options,,Options for Directory Search}.
383 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
384 -specs=@var{file}  -I- --sysroot=@var{dir}}
386 @item Target Options
387 @c I wrote this xref this way to avoid overfull hbox. -- rms
388 @xref{Target Options}.
389 @gccoptlist{-V @var{version}  -b @var{machine}}
391 @item Machine Dependent Options
392 @xref{Submodel Options,,Hardware Models and Configurations}.
393 @c This list is ordered alphanumerically by subsection name.
394 @c Try and put the significant identifier (CPU or system) first,
395 @c so users have a clue at guessing where the ones they want will be.
397 @emph{ARC Options}
398 @gccoptlist{-EB  -EL @gol
399 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
400 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
402 @emph{ARM Options}
403 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
404 -mabi=@var{name} @gol
405 -mapcs-stack-check  -mno-apcs-stack-check @gol
406 -mapcs-float  -mno-apcs-float @gol
407 -mapcs-reentrant  -mno-apcs-reentrant @gol
408 -msched-prolog  -mno-sched-prolog @gol
409 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
410 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
411 -mthumb-interwork  -mno-thumb-interwork @gol
412 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
413 -mstructure-size-boundary=@var{n} @gol
414 -mabort-on-noreturn @gol
415 -mlong-calls  -mno-long-calls @gol
416 -msingle-pic-base  -mno-single-pic-base @gol
417 -mpic-register=@var{reg} @gol
418 -mnop-fun-dllimport @gol
419 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
420 -mpoke-function-name @gol
421 -mthumb  -marm @gol
422 -mtpcs-frame  -mtpcs-leaf-frame @gol
423 -mcaller-super-interworking  -mcallee-super-interworking @gol
424 -mtp=@var{name}}
426 @emph{AVR Options}
427 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
428 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
430 @emph{Blackfin Options}
431 @gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol
432 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly @gol
433 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
434 -mno-id-shared-library -mshared-library-id=@var{n} @gol
435 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
436 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls}
438 @emph{CRIS Options}
439 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
440 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
441 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
442 -mstack-align  -mdata-align  -mconst-align @gol
443 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
444 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
445 -mmul-bug-workaround  -mno-mul-bug-workaround}
447 @emph{CRX Options}
448 @gccoptlist{-mmac -mpush-args}
450 @emph{Darwin Options}
451 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
452 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
453 -client_name  -compatibility_version  -current_version @gol
454 -dead_strip @gol
455 -dependency-file  -dylib_file  -dylinker_install_name @gol
456 -dynamic  -dynamiclib  -exported_symbols_list @gol
457 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
458 -force_flat_namespace  -headerpad_max_install_names @gol
459 -image_base  -init  -install_name  -keep_private_externs @gol
460 -multi_module  -multiply_defined  -multiply_defined_unused @gol
461 -noall_load   -no_dead_strip_inits_and_terms @gol
462 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
463 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
464 -private_bundle  -read_only_relocs  -sectalign @gol
465 -sectobjectsymbols  -whyload  -seg1addr @gol
466 -sectcreate  -sectobjectsymbols  -sectorder @gol
467 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
468 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
469 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
470 -single_module  -static  -sub_library  -sub_umbrella @gol
471 -twolevel_namespace  -umbrella  -undefined @gol
472 -unexported_symbols_list  -weak_reference_mismatches @gol
473 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
474 -mkernel -mone-byte-bool}
476 @emph{DEC Alpha Options}
477 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
478 -mieee  -mieee-with-inexact  -mieee-conformant @gol
479 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
480 -mtrap-precision=@var{mode}  -mbuild-constants @gol
481 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
482 -mbwx  -mmax  -mfix  -mcix @gol
483 -mfloat-vax  -mfloat-ieee @gol
484 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
485 -msmall-text  -mlarge-text @gol
486 -mmemory-latency=@var{time}}
488 @emph{DEC Alpha/VMS Options}
489 @gccoptlist{-mvms-return-codes}
491 @emph{FRV Options}
492 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
493 -mhard-float  -msoft-float @gol
494 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
495 -mdouble  -mno-double @gol
496 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
497 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
498 -mlinked-fp  -mlong-calls  -malign-labels @gol
499 -mlibrary-pic  -macc-4  -macc-8 @gol
500 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
501 -moptimize-membar -mno-optimize-membar @gol
502 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
503 -mvliw-branch  -mno-vliw-branch @gol
504 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
505 -mno-nested-cond-exec  -mtomcat-stats @gol
506 -mTLS -mtls @gol
507 -mcpu=@var{cpu}}
509 @emph{GNU/Linux Options}
510 @gccoptlist{-muclibc}
512 @emph{H8/300 Options}
513 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
515 @emph{HPPA Options}
516 @gccoptlist{-march=@var{architecture-type} @gol
517 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
518 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
519 -mfixed-range=@var{register-range} @gol
520 -mjump-in-delay -mlinker-opt -mlong-calls @gol
521 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
522 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
523 -mno-jump-in-delay  -mno-long-load-store @gol
524 -mno-portable-runtime  -mno-soft-float @gol
525 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
526 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
527 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
528 -munix=@var{unix-std}  -nolibdld  -static  -threads}
530 @emph{i386 and x86-64 Options}
531 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
532 -mfpmath=@var{unit} @gol
533 -masm=@var{dialect}  -mno-fancy-math-387 @gol
534 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
535 -mno-wide-multiply  -mrtd  -malign-double @gol
536 -mpreferred-stack-boundary=@var{num} @gol
537 -mmmx  -msse  -msse2 -msse3 -mssse3 -m3dnow @gol
538 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
539 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
540 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
541 -mstackrealign @gol
542 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
543 -mcmodel=@var{code-model} @gol
544 -m32  -m64 -mlarge-data-threshold=@var{num}}
546 @emph{IA-64 Options}
547 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
548 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
549 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
550 -minline-float-divide-max-throughput @gol
551 -minline-int-divide-min-latency @gol
552 -minline-int-divide-max-throughput  @gol
553 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
554 -mno-dwarf2-asm -mearly-stop-bits @gol
555 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
556 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
557 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
558 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
559 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
560 -mno-sched-prefer-non-data-spec-insns @gol
561 -mno-sched-prefer-non-control-spec-insns @gol
562 -mno-sched-count-spec-in-critical-path}
564 @emph{M32R/D Options}
565 @gccoptlist{-m32r2 -m32rx -m32r @gol
566 -mdebug @gol
567 -malign-loops -mno-align-loops @gol
568 -missue-rate=@var{number} @gol
569 -mbranch-cost=@var{number} @gol
570 -mmodel=@var{code-size-model-type} @gol
571 -msdata=@var{sdata-type} @gol
572 -mno-flush-func -mflush-func=@var{name} @gol
573 -mno-flush-trap -mflush-trap=@var{number} @gol
574 -G @var{num}}
576 @emph{M32C Options}
577 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
579 @emph{M680x0 Options}
580 @gccoptlist{-m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
581 -m68060  -mcpu32  -m5200  -mcfv4e -m68881  -mbitfield  @gol
582 -mc68000  -mc68020   @gol
583 -mnobitfield  -mrtd  -mshort  -msoft-float  -mpcrel @gol
584 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
585 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
587 @emph{M68hc1x Options}
588 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
589 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
590 -msoft-reg-count=@var{count}}
592 @emph{MCore Options}
593 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
594 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
595 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
596 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
597 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
599 @emph{MIPS Options}
600 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
601 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
602 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
603 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64  @gol
604 -mfp32  -mfp64  -mhard-float  -msoft-float  @gol
605 -msingle-float  -mdouble-float  -mdsp  -mpaired-single  -mips3d @gol
606 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
607 -G@var{num}  -membedded-data  -mno-embedded-data @gol
608 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
609 -msplit-addresses  -mno-split-addresses  @gol
610 -mexplicit-relocs  -mno-explicit-relocs  @gol
611 -mcheck-zero-division  -mno-check-zero-division @gol
612 -mdivide-traps  -mdivide-breaks @gol
613 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
614 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
615 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
616 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130 @gol
617 -mfix-sb1  -mno-fix-sb1 @gol
618 -mflush-func=@var{func}  -mno-flush-func @gol
619 -mbranch-likely  -mno-branch-likely @gol
620 -mfp-exceptions -mno-fp-exceptions @gol
621 -mvr4130-align -mno-vr4130-align}
623 @emph{MMIX Options}
624 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
625 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
626 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
627 -mno-base-addresses  -msingle-exit  -mno-single-exit}
629 @emph{MN10300 Options}
630 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
631 -mam33  -mno-am33 @gol
632 -mam33-2  -mno-am33-2 @gol
633 -mreturn-pointer-on-d0 @gol
634 -mno-crt0  -mrelax}
636 @emph{MT Options}
637 @gccoptlist{-mno-crt0 -mbacc -msim @gol
638 -march=@var{cpu-type} }
640 @emph{PDP-11 Options}
641 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
642 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
643 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
644 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
645 -mbranch-expensive  -mbranch-cheap @gol
646 -msplit  -mno-split  -munix-asm  -mdec-asm}
648 @emph{PowerPC Options}
649 See RS/6000 and PowerPC Options.
651 @emph{RS/6000 and PowerPC Options}
652 @gccoptlist{-mcpu=@var{cpu-type} @gol
653 -mtune=@var{cpu-type} @gol
654 -mpower  -mno-power  -mpower2  -mno-power2 @gol
655 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
656 -maltivec  -mno-altivec @gol
657 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
658 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
659 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
660 -mmfpgpr -mno-mfpgpr @gol
661 -mnew-mnemonics  -mold-mnemonics @gol
662 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
663 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
664 -malign-power  -malign-natural @gol
665 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
666 -mstring  -mno-string  -mupdate  -mno-update @gol
667 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
668 -mstrict-align  -mno-strict-align  -mrelocatable @gol
669 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
670 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
671 -mdynamic-no-pic  -maltivec  -mswdiv @gol
672 -mprioritize-restricted-insns=@var{priority} @gol
673 -msched-costly-dep=@var{dependence_type} @gol
674 -minsert-sched-nops=@var{scheme} @gol
675 -mcall-sysv  -mcall-netbsd @gol
676 -maix-struct-return  -msvr4-struct-return @gol
677 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
678 -misel -mno-isel @gol
679 -misel=yes  -misel=no @gol
680 -mspe -mno-spe @gol
681 -mspe=yes  -mspe=no @gol
682 -mvrsave -mno-vrsave @gol
683 -mmulhw -mno-mulhw @gol
684 -mdlmzb -mno-dlmzb @gol
685 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
686 -mprototype  -mno-prototype @gol
687 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
688 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
690 @emph{S/390 and zSeries Options}
691 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
692 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
693 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
694 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
695 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
696 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
697 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
699 @emph{Score Options}
700 @gccoptlist{-mel -mel @gol
701 -mmac @gol
702 -mscore5u -mscore7}
704 @emph{SH Options}
705 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
706 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
707 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
708 -m5-64media  -m5-64media-nofpu @gol
709 -m5-32media  -m5-32media-nofpu @gol
710 -m5-compact  -m5-compact-nofpu @gol
711 -mb  -ml  -mdalign  -mrelax @gol
712 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
713 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
714 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
715 -mdivsi3_libfunc=@var{name}  @gol
716 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
717  -minvalid-symbols}
719 @emph{SPARC Options}
720 @gccoptlist{-mcpu=@var{cpu-type} @gol
721 -mtune=@var{cpu-type} @gol
722 -mcmodel=@var{code-model} @gol
723 -m32  -m64  -mapp-regs  -mno-app-regs @gol
724 -mfaster-structs  -mno-faster-structs @gol
725 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
726 -mhard-quad-float  -msoft-quad-float @gol
727 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
728 -mstack-bias  -mno-stack-bias @gol
729 -munaligned-doubles  -mno-unaligned-doubles @gol
730 -mv8plus  -mno-v8plus  -mvis  -mno-vis
731 -threads -pthreads -pthread}
733 @emph{SPU Options}
734 @gccoptlist{-mwarn-reloc -merror-reloc @gol
735 -msafe-dma -munsafe-dma @gol
736 -mbranch-hints @gol
737 -msmall-mem -mlarge-mem -mstdmain @gol
738 -mfixed-range=@var{register-range}}
740 @emph{System V Options}
741 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
743 @emph{TMS320C3x/C4x Options}
744 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
745 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
746 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
747 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
749 @emph{V850 Options}
750 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
751 -mprolog-function  -mno-prolog-function  -mspace @gol
752 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
753 -mapp-regs  -mno-app-regs @gol
754 -mdisable-callt  -mno-disable-callt @gol
755 -mv850e1 @gol
756 -mv850e @gol
757 -mv850  -mbig-switch}
759 @emph{VAX Options}
760 @gccoptlist{-mg  -mgnu  -munix}
762 @emph{x86-64 Options}
763 See i386 and x86-64 Options.
765 @emph{Xstormy16 Options}
766 @gccoptlist{-msim}
768 @emph{Xtensa Options}
769 @gccoptlist{-mconst16 -mno-const16 @gol
770 -mfused-madd  -mno-fused-madd @gol
771 -mtext-section-literals  -mno-text-section-literals @gol
772 -mtarget-align  -mno-target-align @gol
773 -mlongcalls  -mno-longcalls}
775 @emph{zSeries Options}
776 See S/390 and zSeries Options.
778 @item Code Generation Options
779 @xref{Code Gen Options,,Options for Code Generation Conventions}.
780 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
781 -ffixed-@var{reg}  -fexceptions @gol
782 -fnon-call-exceptions  -funwind-tables @gol
783 -fasynchronous-unwind-tables @gol
784 -finhibit-size-directive  -finstrument-functions @gol
785 -fno-common  -fno-ident @gol
786 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
787 -fno-jump-tables @gol
788 -frecord-gcc-switches @gol
789 -freg-struct-return  -fshort-enums @gol
790 -fshort-double  -fshort-wchar @gol
791 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
792 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
793 -fargument-alias  -fargument-noalias @gol
794 -fargument-noalias-global  -fargument-noalias-anything
795 -fleading-underscore  -ftls-model=@var{model} @gol
796 -ftrapv  -fwrapv  -fbounds-check @gol
797 -fvisibility}
798 @end table
800 @menu
801 * Overall Options::     Controlling the kind of output:
802                         an executable, object files, assembler files,
803                         or preprocessed source.
804 * C Dialect Options::   Controlling the variant of C language compiled.
805 * C++ Dialect Options:: Variations on C++.
806 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
807                         and Objective-C++.
808 * Language Independent Options:: Controlling how diagnostics should be
809                         formatted.
810 * Warning Options::     How picky should the compiler be?
811 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
812 * Optimize Options::    How much optimization?
813 * Preprocessor Options:: Controlling header files and macro definitions.
814                          Also, getting dependency information for Make.
815 * Assembler Options::   Passing options to the assembler.
816 * Link Options::        Specifying libraries and so on.
817 * Directory Options::   Where to find header files and libraries.
818                         Where to find the compiler executable files.
819 * Spec Files::          How to pass switches to sub-processes.
820 * Target Options::      Running a cross-compiler, or an old version of GCC.
821 @end menu
823 @node Overall Options
824 @section Options Controlling the Kind of Output
826 Compilation can involve up to four stages: preprocessing, compilation
827 proper, assembly and linking, always in that order.  GCC is capable of
828 preprocessing and compiling several files either into several
829 assembler input files, or into one assembler input file; then each
830 assembler input file produces an object file, and linking combines all
831 the object files (those newly compiled, and those specified as input)
832 into an executable file.
834 @cindex file name suffix
835 For any given input file, the file name suffix determines what kind of
836 compilation is done:
838 @table @gcctabopt
839 @item @var{file}.c
840 C source code which must be preprocessed.
842 @item @var{file}.i
843 C source code which should not be preprocessed.
845 @item @var{file}.ii
846 C++ source code which should not be preprocessed.
848 @item @var{file}.m
849 Objective-C source code.  Note that you must link with the @file{libobjc}
850 library to make an Objective-C program work.
852 @item @var{file}.mi
853 Objective-C source code which should not be preprocessed.
855 @item @var{file}.mm
856 @itemx @var{file}.M
857 Objective-C++ source code.  Note that you must link with the @file{libobjc}
858 library to make an Objective-C++ program work.  Note that @samp{.M} refers
859 to a literal capital M@.
861 @item @var{file}.mii
862 Objective-C++ source code which should not be preprocessed.
864 @item @var{file}.h
865 C, C++, Objective-C or Objective-C++ header file to be turned into a
866 precompiled header.
868 @item @var{file}.cc
869 @itemx @var{file}.cp
870 @itemx @var{file}.cxx
871 @itemx @var{file}.cpp
872 @itemx @var{file}.CPP
873 @itemx @var{file}.c++
874 @itemx @var{file}.C
875 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
876 the last two letters must both be literally @samp{x}.  Likewise,
877 @samp{.C} refers to a literal capital C@.
879 @item @var{file}.mm
880 @itemx @var{file}.M
881 Objective-C++ source code which must be preprocessed.
883 @item @var{file}.mii
884 Objective-C++ source code which should not be preprocessed.
886 @item @var{file}.hh
887 @itemx @var{file}.H
888 C++ header file to be turned into a precompiled header.
890 @item @var{file}.f
891 @itemx @var{file}.for
892 @itemx @var{file}.FOR
893 Fixed form Fortran source code which should not be preprocessed.
895 @item @var{file}.F
896 @itemx @var{file}.fpp
897 @itemx @var{file}.FPP
898 Fixed form Fortran source code which must be preprocessed (with the traditional
899 preprocessor).
901 @item @var{file}.f90
902 @itemx @var{file}.f95
903 Free form Fortran source code which should not be preprocessed.
905 @item @var{file}.F90
906 @itemx @var{file}.F95
907 Free form Fortran source code which must be preprocessed (with the
908 traditional preprocessor).
910 @c FIXME: Descriptions of Java file types.
911 @c @var{file}.java
912 @c @var{file}.class
913 @c @var{file}.zip
914 @c @var{file}.jar
916 @item @var{file}.ads
917 Ada source code file which contains a library unit declaration (a
918 declaration of a package, subprogram, or generic, or a generic
919 instantiation), or a library unit renaming declaration (a package,
920 generic, or subprogram renaming declaration).  Such files are also
921 called @dfn{specs}.
923 @itemx @var{file}.adb
924 Ada source code file containing a library unit body (a subprogram or
925 package body).  Such files are also called @dfn{bodies}.
927 @c GCC also knows about some suffixes for languages not yet included:
928 @c Pascal:
929 @c @var{file}.p
930 @c @var{file}.pas
931 @c Ratfor:
932 @c @var{file}.r
934 @item @var{file}.s
935 Assembler code.
937 @item @var{file}.S
938 Assembler code which must be preprocessed.
940 @item @var{other}
941 An object file to be fed straight into linking.
942 Any file name with no recognized suffix is treated this way.
943 @end table
945 @opindex x
946 You can specify the input language explicitly with the @option{-x} option:
948 @table @gcctabopt
949 @item -x @var{language}
950 Specify explicitly the @var{language} for the following input files
951 (rather than letting the compiler choose a default based on the file
952 name suffix).  This option applies to all following input files until
953 the next @option{-x} option.  Possible values for @var{language} are:
954 @smallexample
955 c  c-header  c-cpp-output
956 c++  c++-header  c++-cpp-output
957 objective-c  objective-c-header  objective-c-cpp-output
958 objective-c++ objective-c++-header objective-c++-cpp-output
959 assembler  assembler-with-cpp
961 f95  f95-cpp-input
962 java
963 treelang
964 @end smallexample
966 @item -x none
967 Turn off any specification of a language, so that subsequent files are
968 handled according to their file name suffixes (as they are if @option{-x}
969 has not been used at all).
971 @item -pass-exit-codes
972 @opindex pass-exit-codes
973 Normally the @command{gcc} program will exit with the code of 1 if any
974 phase of the compiler returns a non-success return code.  If you specify
975 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
976 numerically highest error produced by any phase that returned an error
977 indication.  The C, C++, and Fortran frontends return 4, if an internal
978 compiler error is encountered.
979 @end table
981 If you only want some of the stages of compilation, you can use
982 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
983 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
984 @command{gcc} is to stop.  Note that some combinations (for example,
985 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
987 @table @gcctabopt
988 @item -c
989 @opindex c
990 Compile or assemble the source files, but do not link.  The linking
991 stage simply is not done.  The ultimate output is in the form of an
992 object file for each source file.
994 By default, the object file name for a source file is made by replacing
995 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
997 Unrecognized input files, not requiring compilation or assembly, are
998 ignored.
1000 @item -S
1001 @opindex S
1002 Stop after the stage of compilation proper; do not assemble.  The output
1003 is in the form of an assembler code file for each non-assembler input
1004 file specified.
1006 By default, the assembler file name for a source file is made by
1007 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1009 Input files that don't require compilation are ignored.
1011 @item -E
1012 @opindex E
1013 Stop after the preprocessing stage; do not run the compiler proper.  The
1014 output is in the form of preprocessed source code, which is sent to the
1015 standard output.
1017 Input files which don't require preprocessing are ignored.
1019 @cindex output file option
1020 @item -o @var{file}
1021 @opindex o
1022 Place output in file @var{file}.  This applies regardless to whatever
1023 sort of output is being produced, whether it be an executable file,
1024 an object file, an assembler file or preprocessed C code.
1026 If @option{-o} is not specified, the default is to put an executable
1027 file in @file{a.out}, the object file for
1028 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1029 assembler file in @file{@var{source}.s}, a precompiled header file in
1030 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1031 standard output.
1033 @item -v
1034 @opindex v
1035 Print (on standard error output) the commands executed to run the stages
1036 of compilation.  Also print the version number of the compiler driver
1037 program and of the preprocessor and the compiler proper.
1039 @item -###
1040 @opindex ###
1041 Like @option{-v} except the commands are not executed and all command
1042 arguments are quoted.  This is useful for shell scripts to capture the
1043 driver-generated command lines.
1045 @item -pipe
1046 @opindex pipe
1047 Use pipes rather than temporary files for communication between the
1048 various stages of compilation.  This fails to work on some systems where
1049 the assembler is unable to read from a pipe; but the GNU assembler has
1050 no trouble.
1052 @item -combine
1053 @opindex combine
1054 If you are compiling multiple source files, this option tells the driver
1055 to pass all the source files to the compiler at once (for those
1056 languages for which the compiler can handle this).  This will allow
1057 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1058 language for which this is supported is C@.  If you pass source files for
1059 multiple languages to the driver, using this option, the driver will invoke
1060 the compiler(s) that support IMA once each, passing each compiler all the
1061 source files appropriate for it.  For those languages that do not support
1062 IMA this option will be ignored, and the compiler will be invoked once for
1063 each source file in that language.  If you use this option in conjunction
1064 with @option{-save-temps}, the compiler will generate multiple
1065 pre-processed files
1066 (one for each source file), but only one (combined) @file{.o} or
1067 @file{.s} file.
1069 @item --help
1070 @opindex help
1071 Print (on the standard output) a description of the command line options
1072 understood by @command{gcc}.  If the @option{-v} option is also specified
1073 then @option{--help} will also be passed on to the various processes
1074 invoked by @command{gcc}, so that they can display the command line options
1075 they accept.  If the @option{-Wextra} option is also specified then command
1076 line options which have no documentation associated with them will also
1077 be displayed.
1079 @item --target-help
1080 @opindex target-help
1081 Print (on the standard output) a description of target specific command
1082 line options for each tool.
1084 @item --version
1085 @opindex version
1086 Display the version number and copyrights of the invoked GCC@.
1088 @include @value{srcdir}/../libiberty/at-file.texi
1089 @end table
1091 @node Invoking G++
1092 @section Compiling C++ Programs
1094 @cindex suffixes for C++ source
1095 @cindex C++ source file suffixes
1096 C++ source files conventionally use one of the suffixes @samp{.C},
1097 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1098 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1099 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1100 files with these names and compiles them as C++ programs even if you
1101 call the compiler the same way as for compiling C programs (usually
1102 with the name @command{gcc}).
1104 @findex g++
1105 @findex c++
1106 However, the use of @command{gcc} does not add the C++ library.
1107 @command{g++} is a program that calls GCC and treats @samp{.c},
1108 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1109 files unless @option{-x} is used, and automatically specifies linking
1110 against the C++ library.  This program is also useful when
1111 precompiling a C header file with a @samp{.h} extension for use in C++
1112 compilations.  On many systems, @command{g++} is also installed with
1113 the name @command{c++}.
1115 @cindex invoking @command{g++}
1116 When you compile C++ programs, you may specify many of the same
1117 command-line options that you use for compiling programs in any
1118 language; or command-line options meaningful for C and related
1119 languages; or options that are meaningful only for C++ programs.
1120 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1121 explanations of options for languages related to C@.
1122 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1123 explanations of options that are meaningful only for C++ programs.
1125 @node C Dialect Options
1126 @section Options Controlling C Dialect
1127 @cindex dialect options
1128 @cindex language dialect options
1129 @cindex options, dialect
1131 The following options control the dialect of C (or languages derived
1132 from C, such as C++, Objective-C and Objective-C++) that the compiler
1133 accepts:
1135 @table @gcctabopt
1136 @cindex ANSI support
1137 @cindex ISO support
1138 @item -ansi
1139 @opindex ansi
1140 In C mode, support all ISO C90 programs.  In C++ mode,
1141 remove GNU extensions that conflict with ISO C++.
1143 This turns off certain features of GCC that are incompatible with ISO
1144 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1145 such as the @code{asm} and @code{typeof} keywords, and
1146 predefined macros such as @code{unix} and @code{vax} that identify the
1147 type of system you are using.  It also enables the undesirable and
1148 rarely used ISO trigraph feature.  For the C compiler,
1149 it disables recognition of C++ style @samp{//} comments as well as
1150 the @code{inline} keyword.
1152 The alternate keywords @code{__asm__}, @code{__extension__},
1153 @code{__inline__} and @code{__typeof__} continue to work despite
1154 @option{-ansi}.  You would not want to use them in an ISO C program, of
1155 course, but it is useful to put them in header files that might be included
1156 in compilations done with @option{-ansi}.  Alternate predefined macros
1157 such as @code{__unix__} and @code{__vax__} are also available, with or
1158 without @option{-ansi}.
1160 The @option{-ansi} option does not cause non-ISO programs to be
1161 rejected gratuitously.  For that, @option{-pedantic} is required in
1162 addition to @option{-ansi}.  @xref{Warning Options}.
1164 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1165 option is used.  Some header files may notice this macro and refrain
1166 from declaring certain functions or defining certain macros that the
1167 ISO standard doesn't call for; this is to avoid interfering with any
1168 programs that might use these names for other things.
1170 Functions which would normally be built in but do not have semantics
1171 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1172 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1173 built-in functions provided by GCC}, for details of the functions
1174 affected.
1176 @item -std=
1177 @opindex std
1178 Determine the language standard.  This option is currently only
1179 supported when compiling C or C++.  A value for this option must be
1180 provided; possible values are
1182 @table @samp
1183 @item c89
1184 @itemx iso9899:1990
1185 ISO C90 (same as @option{-ansi}).
1187 @item iso9899:199409
1188 ISO C90 as modified in amendment 1.
1190 @item c99
1191 @itemx c9x
1192 @itemx iso9899:1999
1193 @itemx iso9899:199x
1194 ISO C99.  Note that this standard is not yet fully supported; see
1195 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1196 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1198 @item gnu89
1199 Default, ISO C90 plus GNU extensions (including some C99 features).
1201 @item gnu99
1202 @itemx gnu9x
1203 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1204 this will become the default.  The name @samp{gnu9x} is deprecated.
1206 @item c++98
1207 The 1998 ISO C++ standard plus amendments.
1209 @item gnu++98
1210 The same as @option{-std=c++98} plus GNU extensions.  This is the
1211 default for C++ code.
1213 @item c++0x
1214 The working draft of the upcoming ISO C++0x standard. This option
1215 enables experimental features that are likely to be included in
1216 C++0x. The working draft is constantly changing, and any feature that is
1217 enabled by this flag may be removed from future versions of GCC if it is
1218 not part of the C++0x standard.
1220 @item gnu++0x
1221 The same as @option{-std=c++0x} plus GNU extensions. As with
1222 @option{-std=c++0x}, this option enables experimental features that may
1223 be removed in future versions of GCC.
1224 @end table
1226 Even when this option is not specified, you can still use some of the
1227 features of newer standards in so far as they do not conflict with
1228 previous C standards.  For example, you may use @code{__restrict__} even
1229 when @option{-std=c99} is not specified.
1231 The @option{-std} options specifying some version of ISO C have the same
1232 effects as @option{-ansi}, except that features that were not in ISO C90
1233 but are in the specified version (for example, @samp{//} comments and
1234 the @code{inline} keyword in ISO C99) are not disabled.
1236 @xref{Standards,,Language Standards Supported by GCC}, for details of
1237 these standard versions.
1239 @item -aux-info @var{filename}
1240 @opindex aux-info
1241 Output to the given filename prototyped declarations for all functions
1242 declared and/or defined in a translation unit, including those in header
1243 files.  This option is silently ignored in any language other than C@.
1245 Besides declarations, the file indicates, in comments, the origin of
1246 each declaration (source file and line), whether the declaration was
1247 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1248 @samp{O} for old, respectively, in the first character after the line
1249 number and the colon), and whether it came from a declaration or a
1250 definition (@samp{C} or @samp{F}, respectively, in the following
1251 character).  In the case of function definitions, a K&R-style list of
1252 arguments followed by their declarations is also provided, inside
1253 comments, after the declaration.
1255 @item -fno-asm
1256 @opindex fno-asm
1257 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1258 keyword, so that code can use these words as identifiers.  You can use
1259 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1260 instead.  @option{-ansi} implies @option{-fno-asm}.
1262 In C++, this switch only affects the @code{typeof} keyword, since
1263 @code{asm} and @code{inline} are standard keywords.  You may want to
1264 use the @option{-fno-gnu-keywords} flag instead, which has the same
1265 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1266 switch only affects the @code{asm} and @code{typeof} keywords, since
1267 @code{inline} is a standard keyword in ISO C99.
1269 @item -fno-builtin
1270 @itemx -fno-builtin-@var{function}
1271 @opindex fno-builtin
1272 @cindex built-in functions
1273 Don't recognize built-in functions that do not begin with
1274 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1275 functions provided by GCC}, for details of the functions affected,
1276 including those which are not built-in functions when @option{-ansi} or
1277 @option{-std} options for strict ISO C conformance are used because they
1278 do not have an ISO standard meaning.
1280 GCC normally generates special code to handle certain built-in functions
1281 more efficiently; for instance, calls to @code{alloca} may become single
1282 instructions that adjust the stack directly, and calls to @code{memcpy}
1283 may become inline copy loops.  The resulting code is often both smaller
1284 and faster, but since the function calls no longer appear as such, you
1285 cannot set a breakpoint on those calls, nor can you change the behavior
1286 of the functions by linking with a different library.  In addition,
1287 when a function is recognized as a built-in function, GCC may use
1288 information about that function to warn about problems with calls to
1289 that function, or to generate more efficient code, even if the
1290 resulting code still contains calls to that function.  For example,
1291 warnings are given with @option{-Wformat} for bad calls to
1292 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1293 known not to modify global memory.
1295 With the @option{-fno-builtin-@var{function}} option
1296 only the built-in function @var{function} is
1297 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1298 function is named this is not built-in in this version of GCC, this
1299 option is ignored.  There is no corresponding
1300 @option{-fbuiltin-@var{function}} option; if you wish to enable
1301 built-in functions selectively when using @option{-fno-builtin} or
1302 @option{-ffreestanding}, you may define macros such as:
1304 @smallexample
1305 #define abs(n)          __builtin_abs ((n))
1306 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1307 @end smallexample
1309 @item -fhosted
1310 @opindex fhosted
1311 @cindex hosted environment
1313 Assert that compilation takes place in a hosted environment.  This implies
1314 @option{-fbuiltin}.  A hosted environment is one in which the
1315 entire standard library is available, and in which @code{main} has a return
1316 type of @code{int}.  Examples are nearly everything except a kernel.
1317 This is equivalent to @option{-fno-freestanding}.
1319 @item -ffreestanding
1320 @opindex ffreestanding
1321 @cindex hosted environment
1323 Assert that compilation takes place in a freestanding environment.  This
1324 implies @option{-fno-builtin}.  A freestanding environment
1325 is one in which the standard library may not exist, and program startup may
1326 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1327 This is equivalent to @option{-fno-hosted}.
1329 @xref{Standards,,Language Standards Supported by GCC}, for details of
1330 freestanding and hosted environments.
1332 @item -fopenmp
1333 @opindex fopenmp
1334 @cindex openmp parallel
1335 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1336 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1337 compiler generates parallel code according to the OpenMP Application
1338 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1340 @item -fms-extensions
1341 @opindex fms-extensions
1342 Accept some non-standard constructs used in Microsoft header files.
1344 Some cases of unnamed fields in structures and unions are only
1345 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1346 fields within structs/unions}, for details.
1348 @item -trigraphs
1349 @opindex trigraphs
1350 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1351 options for strict ISO C conformance) implies @option{-trigraphs}.
1353 @item -no-integrated-cpp
1354 @opindex no-integrated-cpp
1355 Performs a compilation in two passes: preprocessing and compiling.  This
1356 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1357 @option{-B} option.  The user supplied compilation step can then add in
1358 an additional preprocessing step after normal preprocessing but before
1359 compiling.  The default is to use the integrated cpp (internal cpp)
1361 The semantics of this option will change if "cc1", "cc1plus", and
1362 "cc1obj" are merged.
1364 @cindex traditional C language
1365 @cindex C language, traditional
1366 @item -traditional
1367 @itemx -traditional-cpp
1368 @opindex traditional-cpp
1369 @opindex traditional
1370 Formerly, these options caused GCC to attempt to emulate a pre-standard
1371 C compiler.  They are now only supported with the @option{-E} switch.
1372 The preprocessor continues to support a pre-standard mode.  See the GNU
1373 CPP manual for details.
1375 @item -fcond-mismatch
1376 @opindex fcond-mismatch
1377 Allow conditional expressions with mismatched types in the second and
1378 third arguments.  The value of such an expression is void.  This option
1379 is not supported for C++.
1381 @item -funsigned-char
1382 @opindex funsigned-char
1383 Let the type @code{char} be unsigned, like @code{unsigned char}.
1385 Each kind of machine has a default for what @code{char} should
1386 be.  It is either like @code{unsigned char} by default or like
1387 @code{signed char} by default.
1389 Ideally, a portable program should always use @code{signed char} or
1390 @code{unsigned char} when it depends on the signedness of an object.
1391 But many programs have been written to use plain @code{char} and
1392 expect it to be signed, or expect it to be unsigned, depending on the
1393 machines they were written for.  This option, and its inverse, let you
1394 make such a program work with the opposite default.
1396 The type @code{char} is always a distinct type from each of
1397 @code{signed char} or @code{unsigned char}, even though its behavior
1398 is always just like one of those two.
1400 @item -fsigned-char
1401 @opindex fsigned-char
1402 Let the type @code{char} be signed, like @code{signed char}.
1404 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1405 the negative form of @option{-funsigned-char}.  Likewise, the option
1406 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1408 @item -fsigned-bitfields
1409 @itemx -funsigned-bitfields
1410 @itemx -fno-signed-bitfields
1411 @itemx -fno-unsigned-bitfields
1412 @opindex fsigned-bitfields
1413 @opindex funsigned-bitfields
1414 @opindex fno-signed-bitfields
1415 @opindex fno-unsigned-bitfields
1416 These options control whether a bit-field is signed or unsigned, when the
1417 declaration does not use either @code{signed} or @code{unsigned}.  By
1418 default, such a bit-field is signed, because this is consistent: the
1419 basic integer types such as @code{int} are signed types.
1420 @end table
1422 @node C++ Dialect Options
1423 @section Options Controlling C++ Dialect
1425 @cindex compiler options, C++
1426 @cindex C++ options, command line
1427 @cindex options, C++
1428 This section describes the command-line options that are only meaningful
1429 for C++ programs; but you can also use most of the GNU compiler options
1430 regardless of what language your program is in.  For example, you
1431 might compile a file @code{firstClass.C} like this:
1433 @smallexample
1434 g++ -g -frepo -O -c firstClass.C
1435 @end smallexample
1437 @noindent
1438 In this example, only @option{-frepo} is an option meant
1439 only for C++ programs; you can use the other options with any
1440 language supported by GCC@.
1442 Here is a list of options that are @emph{only} for compiling C++ programs:
1444 @table @gcctabopt
1446 @item -fabi-version=@var{n}
1447 @opindex fabi-version
1448 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1449 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1450 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1451 the version that conforms most closely to the C++ ABI specification.
1452 Therefore, the ABI obtained using version 0 will change as ABI bugs
1453 are fixed.
1455 The default is version 2.
1457 @item -fno-access-control
1458 @opindex fno-access-control
1459 Turn off all access checking.  This switch is mainly useful for working
1460 around bugs in the access control code.
1462 @item -fcheck-new
1463 @opindex fcheck-new
1464 Check that the pointer returned by @code{operator new} is non-null
1465 before attempting to modify the storage allocated.  This check is
1466 normally unnecessary because the C++ standard specifies that
1467 @code{operator new} will only return @code{0} if it is declared
1468 @samp{throw()}, in which case the compiler will always check the
1469 return value even without this option.  In all other cases, when
1470 @code{operator new} has a non-empty exception specification, memory
1471 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1472 @samp{new (nothrow)}.
1474 @item -fconserve-space
1475 @opindex fconserve-space
1476 Put uninitialized or runtime-initialized global variables into the
1477 common segment, as C does.  This saves space in the executable at the
1478 cost of not diagnosing duplicate definitions.  If you compile with this
1479 flag and your program mysteriously crashes after @code{main()} has
1480 completed, you may have an object that is being destroyed twice because
1481 two definitions were merged.
1483 This option is no longer useful on most targets, now that support has
1484 been added for putting variables into BSS without making them common.
1486 @item -ffriend-injection
1487 @opindex ffriend-injection
1488 Inject friend functions into the enclosing namespace, so that they are
1489 visible outside the scope of the class in which they are declared.
1490 Friend functions were documented to work this way in the old Annotated
1491 C++ Reference Manual, and versions of G++ before 4.1 always worked
1492 that way.  However, in ISO C++ a friend function which is not declared
1493 in an enclosing scope can only be found using argument dependent
1494 lookup.  This option causes friends to be injected as they were in
1495 earlier releases.
1497 This option is for compatibility, and may be removed in a future
1498 release of G++.
1500 @item -fno-elide-constructors
1501 @opindex fno-elide-constructors
1502 The C++ standard allows an implementation to omit creating a temporary
1503 which is only used to initialize another object of the same type.
1504 Specifying this option disables that optimization, and forces G++ to
1505 call the copy constructor in all cases.
1507 @item -fno-enforce-eh-specs
1508 @opindex fno-enforce-eh-specs
1509 Don't generate code to check for violation of exception specifications
1510 at runtime.  This option violates the C++ standard, but may be useful
1511 for reducing code size in production builds, much like defining
1512 @samp{NDEBUG}.  This does not give user code permission to throw
1513 exceptions in violation of the exception specifications; the compiler
1514 will still optimize based on the specifications, so throwing an
1515 unexpected exception will result in undefined behavior.
1517 @item -ffor-scope
1518 @itemx -fno-for-scope
1519 @opindex ffor-scope
1520 @opindex fno-for-scope
1521 If @option{-ffor-scope} is specified, the scope of variables declared in
1522 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1523 as specified by the C++ standard.
1524 If @option{-fno-for-scope} is specified, the scope of variables declared in
1525 a @i{for-init-statement} extends to the end of the enclosing scope,
1526 as was the case in old versions of G++, and other (traditional)
1527 implementations of C++.
1529 The default if neither flag is given to follow the standard,
1530 but to allow and give a warning for old-style code that would
1531 otherwise be invalid, or have different behavior.
1533 @item -fno-gnu-keywords
1534 @opindex fno-gnu-keywords
1535 Do not recognize @code{typeof} as a keyword, so that code can use this
1536 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1537 @option{-ansi} implies @option{-fno-gnu-keywords}.
1539 @item -fno-implicit-templates
1540 @opindex fno-implicit-templates
1541 Never emit code for non-inline templates which are instantiated
1542 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1543 @xref{Template Instantiation}, for more information.
1545 @item -fno-implicit-inline-templates
1546 @opindex fno-implicit-inline-templates
1547 Don't emit code for implicit instantiations of inline templates, either.
1548 The default is to handle inlines differently so that compiles with and
1549 without optimization will need the same set of explicit instantiations.
1551 @item -fno-implement-inlines
1552 @opindex fno-implement-inlines
1553 To save space, do not emit out-of-line copies of inline functions
1554 controlled by @samp{#pragma implementation}.  This will cause linker
1555 errors if these functions are not inlined everywhere they are called.
1557 @item -fms-extensions
1558 @opindex fms-extensions
1559 Disable pedantic warnings about constructs used in MFC, such as implicit
1560 int and getting a pointer to member function via non-standard syntax.
1562 @item -fno-nonansi-builtins
1563 @opindex fno-nonansi-builtins
1564 Disable built-in declarations of functions that are not mandated by
1565 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1566 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1568 @item -fno-operator-names
1569 @opindex fno-operator-names
1570 Do not treat the operator name keywords @code{and}, @code{bitand},
1571 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1572 synonyms as keywords.
1574 @item -fno-optional-diags
1575 @opindex fno-optional-diags
1576 Disable diagnostics that the standard says a compiler does not need to
1577 issue.  Currently, the only such diagnostic issued by G++ is the one for
1578 a name having multiple meanings within a class.
1580 @item -fpermissive
1581 @opindex fpermissive
1582 Downgrade some diagnostics about nonconformant code from errors to
1583 warnings.  Thus, using @option{-fpermissive} will allow some
1584 nonconforming code to compile.
1586 @item -frepo
1587 @opindex frepo
1588 Enable automatic template instantiation at link time.  This option also
1589 implies @option{-fno-implicit-templates}.  @xref{Template
1590 Instantiation}, for more information.
1592 @item -fno-rtti
1593 @opindex fno-rtti
1594 Disable generation of information about every class with virtual
1595 functions for use by the C++ runtime type identification features
1596 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1597 of the language, you can save some space by using this flag.  Note that
1598 exception handling uses the same information, but it will generate it as
1599 needed. The @samp{dynamic_cast} operator can still be used for casts that
1600 do not require runtime type information, i.e. casts to @code{void *} or to
1601 unambiguous base classes.
1603 @item -fstats
1604 @opindex fstats
1605 Emit statistics about front-end processing at the end of the compilation.
1606 This information is generally only useful to the G++ development team.
1608 @item -ftemplate-depth-@var{n}
1609 @opindex ftemplate-depth
1610 Set the maximum instantiation depth for template classes to @var{n}.
1611 A limit on the template instantiation depth is needed to detect
1612 endless recursions during template class instantiation.  ANSI/ISO C++
1613 conforming programs must not rely on a maximum depth greater than 17.
1615 @item -fno-threadsafe-statics
1616 @opindex fno-threadsafe-statics
1617 Do not emit the extra code to use the routines specified in the C++
1618 ABI for thread-safe initialization of local statics.  You can use this
1619 option to reduce code size slightly in code that doesn't need to be
1620 thread-safe.
1622 @item -fuse-cxa-atexit
1623 @opindex fuse-cxa-atexit
1624 Register destructors for objects with static storage duration with the
1625 @code{__cxa_atexit} function rather than the @code{atexit} function.
1626 This option is required for fully standards-compliant handling of static
1627 destructors, but will only work if your C library supports
1628 @code{__cxa_atexit}.
1630 @item -fno-use-cxa-get-exception-ptr
1631 @opindex fno-use-cxa-get-exception-ptr
1632 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1633 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1634 if the runtime routine is not available.
1636 @item -fvisibility-inlines-hidden
1637 @opindex fvisibility-inlines-hidden
1638 This switch declares that the user does not attempt to compare
1639 pointers to inline methods where the addresses of the two functions
1640 were taken in different shared objects.
1642 The effect of this is that GCC may, effectively, mark inline methods with
1643 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1644 appear in the export table of a DSO and do not require a PLT indirection
1645 when used within the DSO@.  Enabling this option can have a dramatic effect
1646 on load and link times of a DSO as it massively reduces the size of the
1647 dynamic export table when the library makes heavy use of templates.
1649 The behaviour of this switch is not quite the same as marking the
1650 methods as hidden directly, because it does not affect static variables
1651 local to the function or cause the compiler to deduce that
1652 the function is defined in only one shared object.
1654 You may mark a method as having a visibility explicitly to negate the
1655 effect of the switch for that method.  For example, if you do want to
1656 compare pointers to a particular inline method, you might mark it as
1657 having default visibility.  Marking the enclosing class with explicit
1658 visibility will have no effect.
1660 Explicitly instantiated inline methods are unaffected by this option
1661 as their linkage might otherwise cross a shared library boundary.
1662 @xref{Template Instantiation}.
1664 @item -fno-weak
1665 @opindex fno-weak
1666 Do not use weak symbol support, even if it is provided by the linker.
1667 By default, G++ will use weak symbols if they are available.  This
1668 option exists only for testing, and should not be used by end-users;
1669 it will result in inferior code and has no benefits.  This option may
1670 be removed in a future release of G++.
1672 @item -nostdinc++
1673 @opindex nostdinc++
1674 Do not search for header files in the standard directories specific to
1675 C++, but do still search the other standard directories.  (This option
1676 is used when building the C++ library.)
1677 @end table
1679 In addition, these optimization, warning, and code generation options
1680 have meanings only for C++ programs:
1682 @table @gcctabopt
1683 @item -fno-default-inline
1684 @opindex fno-default-inline
1685 Do not assume @samp{inline} for functions defined inside a class scope.
1686 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1687 functions will have linkage like inline functions; they just won't be
1688 inlined by default.
1690 @item -Wabi @r{(C++ only)}
1691 @opindex Wabi
1692 Warn when G++ generates code that is probably not compatible with the
1693 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1694 all such cases, there are probably some cases that are not warned about,
1695 even though G++ is generating incompatible code.  There may also be
1696 cases where warnings are emitted even though the code that is generated
1697 will be compatible.
1699 You should rewrite your code to avoid these warnings if you are
1700 concerned about the fact that code generated by G++ may not be binary
1701 compatible with code generated by other compilers.
1703 The known incompatibilities at this point include:
1705 @itemize @bullet
1707 @item
1708 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1709 pack data into the same byte as a base class.  For example:
1711 @smallexample
1712 struct A @{ virtual void f(); int f1 : 1; @};
1713 struct B : public A @{ int f2 : 1; @};
1714 @end smallexample
1716 @noindent
1717 In this case, G++ will place @code{B::f2} into the same byte
1718 as@code{A::f1}; other compilers will not.  You can avoid this problem
1719 by explicitly padding @code{A} so that its size is a multiple of the
1720 byte size on your platform; that will cause G++ and other compilers to
1721 layout @code{B} identically.
1723 @item
1724 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1725 tail padding when laying out virtual bases.  For example:
1727 @smallexample
1728 struct A @{ virtual void f(); char c1; @};
1729 struct B @{ B(); char c2; @};
1730 struct C : public A, public virtual B @{@};
1731 @end smallexample
1733 @noindent
1734 In this case, G++ will not place @code{B} into the tail-padding for
1735 @code{A}; other compilers will.  You can avoid this problem by
1736 explicitly padding @code{A} so that its size is a multiple of its
1737 alignment (ignoring virtual base classes); that will cause G++ and other
1738 compilers to layout @code{C} identically.
1740 @item
1741 Incorrect handling of bit-fields with declared widths greater than that
1742 of their underlying types, when the bit-fields appear in a union.  For
1743 example:
1745 @smallexample
1746 union U @{ int i : 4096; @};
1747 @end smallexample
1749 @noindent
1750 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1751 union too small by the number of bits in an @code{int}.
1753 @item
1754 Empty classes can be placed at incorrect offsets.  For example:
1756 @smallexample
1757 struct A @{@};
1759 struct B @{
1760   A a;
1761   virtual void f ();
1764 struct C : public B, public A @{@};
1765 @end smallexample
1767 @noindent
1768 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1769 it should be placed at offset zero.  G++ mistakenly believes that the
1770 @code{A} data member of @code{B} is already at offset zero.
1772 @item
1773 Names of template functions whose types involve @code{typename} or
1774 template template parameters can be mangled incorrectly.
1776 @smallexample
1777 template <typename Q>
1778 void f(typename Q::X) @{@}
1780 template <template <typename> class Q>
1781 void f(typename Q<int>::X) @{@}
1782 @end smallexample
1784 @noindent
1785 Instantiations of these templates may be mangled incorrectly.
1787 @end itemize
1789 @item -Wctor-dtor-privacy @r{(C++ only)}
1790 @opindex Wctor-dtor-privacy
1791 Warn when a class seems unusable because all the constructors or
1792 destructors in that class are private, and it has neither friends nor
1793 public static member functions.
1795 @item -Wnon-virtual-dtor @r{(C++ only)}
1796 @opindex Wnon-virtual-dtor
1797 Warn when a class appears to be polymorphic, thereby requiring a virtual
1798 destructor, yet it declares a non-virtual one.  This warning is also
1799 enabled if -Weffc++ is specified.
1801 @item -Wreorder @r{(C++ only)}
1802 @opindex Wreorder
1803 @cindex reordering, warning
1804 @cindex warning for reordering of member initializers
1805 Warn when the order of member initializers given in the code does not
1806 match the order in which they must be executed.  For instance:
1808 @smallexample
1809 struct A @{
1810   int i;
1811   int j;
1812   A(): j (0), i (1) @{ @}
1814 @end smallexample
1816 The compiler will rearrange the member initializers for @samp{i}
1817 and @samp{j} to match the declaration order of the members, emitting
1818 a warning to that effect.  This warning is enabled by @option{-Wall}.
1819 @end table
1821 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1823 @table @gcctabopt
1824 @item -Weffc++ @r{(C++ only)}
1825 @opindex Weffc++
1826 Warn about violations of the following style guidelines from Scott Meyers'
1827 @cite{Effective C++} book:
1829 @itemize @bullet
1830 @item
1831 Item 11:  Define a copy constructor and an assignment operator for classes
1832 with dynamically allocated memory.
1834 @item
1835 Item 12:  Prefer initialization to assignment in constructors.
1837 @item
1838 Item 14:  Make destructors virtual in base classes.
1840 @item
1841 Item 15:  Have @code{operator=} return a reference to @code{*this}.
1843 @item
1844 Item 23:  Don't try to return a reference when you must return an object.
1846 @end itemize
1848 Also warn about violations of the following style guidelines from
1849 Scott Meyers' @cite{More Effective C++} book:
1851 @itemize @bullet
1852 @item
1853 Item 6:  Distinguish between prefix and postfix forms of increment and
1854 decrement operators.
1856 @item
1857 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
1859 @end itemize
1861 When selecting this option, be aware that the standard library
1862 headers do not obey all of these guidelines; use @samp{grep -v}
1863 to filter out those warnings.
1865 @item -Wno-deprecated @r{(C++ only)}
1866 @opindex Wno-deprecated
1867 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
1869 @item -Wstrict-null-sentinel @r{(C++ only)}
1870 @opindex Wstrict-null-sentinel
1871 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
1872 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
1873 to @code{__null}.  Although it is a null pointer constant not a null pointer,
1874 it is guaranteed to of the same size as a pointer.  But this use is
1875 not portable across different compilers.
1877 @item -Wno-non-template-friend @r{(C++ only)}
1878 @opindex Wno-non-template-friend
1879 Disable warnings when non-templatized friend functions are declared
1880 within a template.  Since the advent of explicit template specification
1881 support in G++, if the name of the friend is an unqualified-id (i.e.,
1882 @samp{friend foo(int)}), the C++ language specification demands that the
1883 friend declare or define an ordinary, nontemplate function.  (Section
1884 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
1885 could be interpreted as a particular specialization of a templatized
1886 function.  Because this non-conforming behavior is no longer the default
1887 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
1888 check existing code for potential trouble spots and is on by default.
1889 This new compiler behavior can be turned off with
1890 @option{-Wno-non-template-friend} which keeps the conformant compiler code
1891 but disables the helpful warning.
1893 @item -Wold-style-cast @r{(C++ only)}
1894 @opindex Wold-style-cast
1895 Warn if an old-style (C-style) cast to a non-void type is used within
1896 a C++ program.  The new-style casts (@samp{dynamic_cast},
1897 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
1898 less vulnerable to unintended effects and much easier to search for.
1900 @item -Woverloaded-virtual @r{(C++ only)}
1901 @opindex Woverloaded-virtual
1902 @cindex overloaded virtual fn, warning
1903 @cindex warning for overloaded virtual fn
1904 Warn when a function declaration hides virtual functions from a
1905 base class.  For example, in:
1907 @smallexample
1908 struct A @{
1909   virtual void f();
1912 struct B: public A @{
1913   void f(int);
1915 @end smallexample
1917 the @code{A} class version of @code{f} is hidden in @code{B}, and code
1918 like:
1920 @smallexample
1921 B* b;
1922 b->f();
1923 @end smallexample
1925 will fail to compile.
1927 @item -Wno-pmf-conversions @r{(C++ only)}
1928 @opindex Wno-pmf-conversions
1929 Disable the diagnostic for converting a bound pointer to member function
1930 to a plain pointer.
1932 @item -Wsign-promo @r{(C++ only)}
1933 @opindex Wsign-promo
1934 Warn when overload resolution chooses a promotion from unsigned or
1935 enumerated type to a signed type, over a conversion to an unsigned type of
1936 the same size.  Previous versions of G++ would try to preserve
1937 unsignedness, but the standard mandates the current behavior.
1939 @smallexample
1940 struct A @{
1941   operator int ();
1942   A& operator = (int);
1945 main ()
1947   A a,b;
1948   a = b;
1950 @end smallexample
1952 In this example, G++ will synthesize a default @samp{A& operator =
1953 (const A&);}, while cfront will use the user-defined @samp{operator =}.
1954 @end table
1956 @node Objective-C and Objective-C++ Dialect Options
1957 @section Options Controlling Objective-C and Objective-C++ Dialects
1959 @cindex compiler options, Objective-C and Objective-C++
1960 @cindex Objective-C and Objective-C++ options, command line
1961 @cindex options, Objective-C and Objective-C++
1962 (NOTE: This manual does not describe the Objective-C and Objective-C++
1963 languages themselves.  See @xref{Standards,,Language Standards
1964 Supported by GCC}, for references.)
1966 This section describes the command-line options that are only meaningful
1967 for Objective-C and Objective-C++ programs, but you can also use most of
1968 the language-independent GNU compiler options.
1969 For example, you might compile a file @code{some_class.m} like this:
1971 @smallexample
1972 gcc -g -fgnu-runtime -O -c some_class.m
1973 @end smallexample
1975 @noindent
1976 In this example, @option{-fgnu-runtime} is an option meant only for
1977 Objective-C and Objective-C++ programs; you can use the other options with
1978 any language supported by GCC@.
1980 Note that since Objective-C is an extension of the C language, Objective-C
1981 compilations may also use options specific to the C front-end (e.g.,
1982 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
1983 C++-specific options (e.g., @option{-Wabi}).
1985 Here is a list of options that are @emph{only} for compiling Objective-C
1986 and Objective-C++ programs:
1988 @table @gcctabopt
1989 @item -fconstant-string-class=@var{class-name}
1990 @opindex fconstant-string-class
1991 Use @var{class-name} as the name of the class to instantiate for each
1992 literal string specified with the syntax @code{@@"@dots{}"}.  The default
1993 class name is @code{NXConstantString} if the GNU runtime is being used, and
1994 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
1995 @option{-fconstant-cfstrings} option, if also present, will override the
1996 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
1997 to be laid out as constant CoreFoundation strings.
1999 @item -fgnu-runtime
2000 @opindex fgnu-runtime
2001 Generate object code compatible with the standard GNU Objective-C
2002 runtime.  This is the default for most types of systems.
2004 @item -fnext-runtime
2005 @opindex fnext-runtime
2006 Generate output compatible with the NeXT runtime.  This is the default
2007 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2008 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2009 used.
2011 @item -fno-nil-receivers
2012 @opindex fno-nil-receivers
2013 Assume that all Objective-C message dispatches (e.g.,
2014 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2015 is not @code{nil}.  This allows for more efficient entry points in the runtime
2016 to be used.  Currently, this option is only available in conjunction with
2017 the NeXT runtime on Mac OS X 10.3 and later.
2019 @item -fobjc-call-cxx-cdtors
2020 @opindex fobjc-call-cxx-cdtors
2021 For each Objective-C class, check if any of its instance variables is a
2022 C++ object with a non-trivial default constructor.  If so, synthesize a
2023 special @code{- (id) .cxx_construct} instance method that will run
2024 non-trivial default constructors on any such instance variables, in order,
2025 and then return @code{self}.  Similarly, check if any instance variable
2026 is a C++ object with a non-trivial destructor, and if so, synthesize a
2027 special @code{- (void) .cxx_destruct} method that will run
2028 all such default destructors, in reverse order.
2030 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2031 thusly generated will only operate on instance variables declared in the
2032 current Objective-C class, and not those inherited from superclasses.  It
2033 is the responsibility of the Objective-C runtime to invoke all such methods
2034 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2035 will be invoked by the runtime immediately after a new object
2036 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2037 be invoked immediately before the runtime deallocates an object instance.
2039 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2040 support for invoking the @code{- (id) .cxx_construct} and
2041 @code{- (void) .cxx_destruct} methods.
2043 @item -fobjc-direct-dispatch
2044 @opindex fobjc-direct-dispatch
2045 Allow fast jumps to the message dispatcher.  On Darwin this is
2046 accomplished via the comm page.
2048 @item -fobjc-exceptions
2049 @opindex fobjc-exceptions
2050 Enable syntactic support for structured exception handling in Objective-C,
2051 similar to what is offered by C++ and Java.  This option is
2052 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2053 earlier.
2055 @smallexample
2056   @@try @{
2057     @dots{}
2058        @@throw expr;
2059     @dots{}
2060   @}
2061   @@catch (AnObjCClass *exc) @{
2062     @dots{}
2063       @@throw expr;
2064     @dots{}
2065       @@throw;
2066     @dots{}
2067   @}
2068   @@catch (AnotherClass *exc) @{
2069     @dots{}
2070   @}
2071   @@catch (id allOthers) @{
2072     @dots{}
2073   @}
2074   @@finally @{
2075     @dots{}
2076       @@throw expr;
2077     @dots{}
2078   @}
2079 @end smallexample
2081 The @code{@@throw} statement may appear anywhere in an Objective-C or
2082 Objective-C++ program; when used inside of a @code{@@catch} block, the
2083 @code{@@throw} may appear without an argument (as shown above), in which case
2084 the object caught by the @code{@@catch} will be rethrown.
2086 Note that only (pointers to) Objective-C objects may be thrown and
2087 caught using this scheme.  When an object is thrown, it will be caught
2088 by the nearest @code{@@catch} clause capable of handling objects of that type,
2089 analogously to how @code{catch} blocks work in C++ and Java.  A
2090 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2091 any and all Objective-C exceptions not caught by previous @code{@@catch}
2092 clauses (if any).
2094 The @code{@@finally} clause, if present, will be executed upon exit from the
2095 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2096 regardless of whether any exceptions are thrown, caught or rethrown
2097 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2098 of the @code{finally} clause in Java.
2100 There are several caveats to using the new exception mechanism:
2102 @itemize @bullet
2103 @item
2104 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2105 idioms provided by the @code{NSException} class, the new
2106 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2107 systems, due to additional functionality needed in the (NeXT) Objective-C
2108 runtime.
2110 @item
2111 As mentioned above, the new exceptions do not support handling
2112 types other than Objective-C objects.   Furthermore, when used from
2113 Objective-C++, the Objective-C exception model does not interoperate with C++
2114 exceptions at this time.  This means you cannot @code{@@throw} an exception
2115 from Objective-C and @code{catch} it in C++, or vice versa
2116 (i.e., @code{throw @dots{} @@catch}).
2117 @end itemize
2119 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2120 blocks for thread-safe execution:
2122 @smallexample
2123   @@synchronized (ObjCClass *guard) @{
2124     @dots{}
2125   @}
2126 @end smallexample
2128 Upon entering the @code{@@synchronized} block, a thread of execution shall
2129 first check whether a lock has been placed on the corresponding @code{guard}
2130 object by another thread.  If it has, the current thread shall wait until
2131 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2132 the current thread will place its own lock on it, execute the code contained in
2133 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2134 making @code{guard} available to other threads).
2136 Unlike Java, Objective-C does not allow for entire methods to be marked
2137 @code{@@synchronized}.  Note that throwing exceptions out of
2138 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2139 to be unlocked properly.
2141 @item -fobjc-gc
2142 @opindex fobjc-gc
2143 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2145 @item -freplace-objc-classes
2146 @opindex freplace-objc-classes
2147 Emit a special marker instructing @command{ld(1)} not to statically link in
2148 the resulting object file, and allow @command{dyld(1)} to load it in at
2149 run time instead.  This is used in conjunction with the Fix-and-Continue
2150 debugging mode, where the object file in question may be recompiled and
2151 dynamically reloaded in the course of program execution, without the need
2152 to restart the program itself.  Currently, Fix-and-Continue functionality
2153 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2154 and later.
2156 @item -fzero-link
2157 @opindex fzero-link
2158 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2159 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2160 compile time) with static class references that get initialized at load time,
2161 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2162 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2163 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2164 for individual class implementations to be modified during program execution.
2166 @item -gen-decls
2167 @opindex gen-decls
2168 Dump interface declarations for all classes seen in the source file to a
2169 file named @file{@var{sourcename}.decl}.
2171 @item -Wassign-intercept
2172 @opindex Wassign-intercept
2173 Warn whenever an Objective-C assignment is being intercepted by the
2174 garbage collector.
2176 @item -Wno-protocol
2177 @opindex Wno-protocol
2178 If a class is declared to implement a protocol, a warning is issued for
2179 every method in the protocol that is not implemented by the class.  The
2180 default behavior is to issue a warning for every method not explicitly
2181 implemented in the class, even if a method implementation is inherited
2182 from the superclass.  If you use the @option{-Wno-protocol} option, then
2183 methods inherited from the superclass are considered to be implemented,
2184 and no warning is issued for them.
2186 @item -Wselector
2187 @opindex Wselector
2188 Warn if multiple methods of different types for the same selector are
2189 found during compilation.  The check is performed on the list of methods
2190 in the final stage of compilation.  Additionally, a check is performed
2191 for each selector appearing in a @code{@@selector(@dots{})}
2192 expression, and a corresponding method for that selector has been found
2193 during compilation.  Because these checks scan the method table only at
2194 the end of compilation, these warnings are not produced if the final
2195 stage of compilation is not reached, for example because an error is
2196 found during compilation, or because the @option{-fsyntax-only} option is
2197 being used.
2199 @item -Wstrict-selector-match
2200 @opindex Wstrict-selector-match
2201 Warn if multiple methods with differing argument and/or return types are
2202 found for a given selector when attempting to send a message using this
2203 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2204 is off (which is the default behavior), the compiler will omit such warnings
2205 if any differences found are confined to types which share the same size
2206 and alignment.
2208 @item -Wundeclared-selector
2209 @opindex Wundeclared-selector
2210 Warn if a @code{@@selector(@dots{})} expression referring to an
2211 undeclared selector is found.  A selector is considered undeclared if no
2212 method with that name has been declared before the
2213 @code{@@selector(@dots{})} expression, either explicitly in an
2214 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2215 an @code{@@implementation} section.  This option always performs its
2216 checks as soon as a @code{@@selector(@dots{})} expression is found,
2217 while @option{-Wselector} only performs its checks in the final stage of
2218 compilation.  This also enforces the coding style convention
2219 that methods and selectors must be declared before being used.
2221 @item -print-objc-runtime-info
2222 @opindex print-objc-runtime-info
2223 Generate C header describing the largest structure that is passed by
2224 value, if any.
2226 @end table
2228 @node Language Independent Options
2229 @section Options to Control Diagnostic Messages Formatting
2230 @cindex options to control diagnostics formatting
2231 @cindex diagnostic messages
2232 @cindex message formatting
2234 Traditionally, diagnostic messages have been formatted irrespective of
2235 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2236 below can be used to control the diagnostic messages formatting
2237 algorithm, e.g.@: how many characters per line, how often source location
2238 information should be reported.  Right now, only the C++ front end can
2239 honor these options.  However it is expected, in the near future, that
2240 the remaining front ends would be able to digest them correctly.
2242 @table @gcctabopt
2243 @item -fmessage-length=@var{n}
2244 @opindex fmessage-length
2245 Try to format error messages so that they fit on lines of about @var{n}
2246 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2247 the front ends supported by GCC@.  If @var{n} is zero, then no
2248 line-wrapping will be done; each error message will appear on a single
2249 line.
2251 @opindex fdiagnostics-show-location
2252 @item -fdiagnostics-show-location=once
2253 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2254 reporter to emit @emph{once} source location information; that is, in
2255 case the message is too long to fit on a single physical line and has to
2256 be wrapped, the source location won't be emitted (as prefix) again,
2257 over and over, in subsequent continuation lines.  This is the default
2258 behavior.
2260 @item -fdiagnostics-show-location=every-line
2261 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2262 messages reporter to emit the same source location information (as
2263 prefix) for physical lines that result from the process of breaking
2264 a message which is too long to fit on a single line.
2266 @item -fdiagnostics-show-option
2267 @opindex fdiagnostics-show-option
2268 This option instructs the diagnostic machinery to add text to each
2269 diagnostic emitted, which indicates which command line option directly
2270 controls that diagnostic, when such an option is known to the
2271 diagnostic machinery.
2273 @end table
2275 @node Warning Options
2276 @section Options to Request or Suppress Warnings
2277 @cindex options to control warnings
2278 @cindex warning messages
2279 @cindex messages, warning
2280 @cindex suppressing warnings
2282 Warnings are diagnostic messages that report constructions which
2283 are not inherently erroneous but which are risky or suggest there
2284 may have been an error.
2286 You can request many specific warnings with options beginning @samp{-W},
2287 for example @option{-Wimplicit} to request warnings on implicit
2288 declarations.  Each of these specific warning options also has a
2289 negative form beginning @samp{-Wno-} to turn off warnings;
2290 for example, @option{-Wno-implicit}.  This manual lists only one of the
2291 two forms, whichever is not the default.
2293 The following options control the amount and kinds of warnings produced
2294 by GCC; for further, language-specific options also refer to
2295 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2296 Options}.
2298 @table @gcctabopt
2299 @cindex syntax checking
2300 @item -fsyntax-only
2301 @opindex fsyntax-only
2302 Check the code for syntax errors, but don't do anything beyond that.
2304 @item -pedantic
2305 @opindex pedantic
2306 Issue all the warnings demanded by strict ISO C and ISO C++;
2307 reject all programs that use forbidden extensions, and some other
2308 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2309 version of the ISO C standard specified by any @option{-std} option used.
2311 Valid ISO C and ISO C++ programs should compile properly with or without
2312 this option (though a rare few will require @option{-ansi} or a
2313 @option{-std} option specifying the required version of ISO C)@.  However,
2314 without this option, certain GNU extensions and traditional C and C++
2315 features are supported as well.  With this option, they are rejected.
2317 @option{-pedantic} does not cause warning messages for use of the
2318 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2319 warnings are also disabled in the expression that follows
2320 @code{__extension__}.  However, only system header files should use
2321 these escape routes; application programs should avoid them.
2322 @xref{Alternate Keywords}.
2324 Some users try to use @option{-pedantic} to check programs for strict ISO
2325 C conformance.  They soon find that it does not do quite what they want:
2326 it finds some non-ISO practices, but not all---only those for which
2327 ISO C @emph{requires} a diagnostic, and some others for which
2328 diagnostics have been added.
2330 A feature to report any failure to conform to ISO C might be useful in
2331 some instances, but would require considerable additional work and would
2332 be quite different from @option{-pedantic}.  We don't have plans to
2333 support such a feature in the near future.
2335 Where the standard specified with @option{-std} represents a GNU
2336 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2337 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2338 extended dialect is based.  Warnings from @option{-pedantic} are given
2339 where they are required by the base standard.  (It would not make sense
2340 for such warnings to be given only for features not in the specified GNU
2341 C dialect, since by definition the GNU dialects of C include all
2342 features the compiler supports with the given option, and there would be
2343 nothing to warn about.)
2345 @item -pedantic-errors
2346 @opindex pedantic-errors
2347 Like @option{-pedantic}, except that errors are produced rather than
2348 warnings.
2350 @item -w
2351 @opindex w
2352 Inhibit all warning messages.
2354 @item -Wno-import
2355 @opindex Wno-import
2356 Inhibit warning messages about the use of @samp{#import}.
2358 @item -Wchar-subscripts
2359 @opindex Wchar-subscripts
2360 Warn if an array subscript has type @code{char}.  This is a common cause
2361 of error, as programmers often forget that this type is signed on some
2362 machines.
2363 This warning is enabled by @option{-Wall}.
2365 @item -Wcomment
2366 @opindex Wcomment
2367 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2368 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2369 This warning is enabled by @option{-Wall}.
2371 @item -Wfatal-errors
2372 @opindex Wfatal-errors
2373 This option causes the compiler to abort compilation on the first error
2374 occurred rather than trying to keep going and printing further error
2375 messages.
2377 @item -Wformat
2378 @opindex Wformat
2379 @opindex ffreestanding
2380 @opindex fno-builtin
2381 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2382 the arguments supplied have types appropriate to the format string
2383 specified, and that the conversions specified in the format string make
2384 sense.  This includes standard functions, and others specified by format
2385 attributes (@pxref{Function Attributes}), in the @code{printf},
2386 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2387 not in the C standard) families (or other target-specific families).
2388 Which functions are checked without format attributes having been
2389 specified depends on the standard version selected, and such checks of
2390 functions without the attribute specified are disabled by
2391 @option{-ffreestanding} or @option{-fno-builtin}.
2393 The formats are checked against the format features supported by GNU
2394 libc version 2.2.  These include all ISO C90 and C99 features, as well
2395 as features from the Single Unix Specification and some BSD and GNU
2396 extensions.  Other library implementations may not support all these
2397 features; GCC does not support warning about features that go beyond a
2398 particular library's limitations.  However, if @option{-pedantic} is used
2399 with @option{-Wformat}, warnings will be given about format features not
2400 in the selected standard version (but not for @code{strfmon} formats,
2401 since those are not in any version of the C standard).  @xref{C Dialect
2402 Options,,Options Controlling C Dialect}.
2404 Since @option{-Wformat} also checks for null format arguments for
2405 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2407 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2408 aspects of format checking, the options @option{-Wformat-y2k},
2409 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2410 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2411 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2413 @item -Wformat-y2k
2414 @opindex Wformat-y2k
2415 If @option{-Wformat} is specified, also warn about @code{strftime}
2416 formats which may yield only a two-digit year.
2418 @item -Wno-format-extra-args
2419 @opindex Wno-format-extra-args
2420 If @option{-Wformat} is specified, do not warn about excess arguments to a
2421 @code{printf} or @code{scanf} format function.  The C standard specifies
2422 that such arguments are ignored.
2424 Where the unused arguments lie between used arguments that are
2425 specified with @samp{$} operand number specifications, normally
2426 warnings are still given, since the implementation could not know what
2427 type to pass to @code{va_arg} to skip the unused arguments.  However,
2428 in the case of @code{scanf} formats, this option will suppress the
2429 warning if the unused arguments are all pointers, since the Single
2430 Unix Specification says that such unused arguments are allowed.
2432 @item -Wno-format-zero-length
2433 @opindex Wno-format-zero-length
2434 If @option{-Wformat} is specified, do not warn about zero-length formats.
2435 The C standard specifies that zero-length formats are allowed.
2437 @item -Wformat-nonliteral
2438 @opindex Wformat-nonliteral
2439 If @option{-Wformat} is specified, also warn if the format string is not a
2440 string literal and so cannot be checked, unless the format function
2441 takes its format arguments as a @code{va_list}.
2443 @item -Wformat-security
2444 @opindex Wformat-security
2445 If @option{-Wformat} is specified, also warn about uses of format
2446 functions that represent possible security problems.  At present, this
2447 warns about calls to @code{printf} and @code{scanf} functions where the
2448 format string is not a string literal and there are no format arguments,
2449 as in @code{printf (foo);}.  This may be a security hole if the format
2450 string came from untrusted input and contains @samp{%n}.  (This is
2451 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2452 in future warnings may be added to @option{-Wformat-security} that are not
2453 included in @option{-Wformat-nonliteral}.)
2455 @item -Wformat=2
2456 @opindex Wformat=2
2457 Enable @option{-Wformat} plus format checks not included in
2458 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2459 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2461 @item -Wnonnull
2462 @opindex Wnonnull
2463 Warn about passing a null pointer for arguments marked as
2464 requiring a non-null value by the @code{nonnull} function attribute.
2466 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2467 can be disabled with the @option{-Wno-nonnull} option.
2469 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2470 @opindex Winit-self
2471 Warn about uninitialized variables which are initialized with themselves.
2472 Note this option can only be used with the @option{-Wuninitialized} option,
2473 which in turn only works with @option{-O1} and above.
2475 For example, GCC will warn about @code{i} being uninitialized in the
2476 following snippet only when @option{-Winit-self} has been specified:
2477 @smallexample
2478 @group
2479 int f()
2481   int i = i;
2482   return i;
2484 @end group
2485 @end smallexample
2487 @item -Wimplicit-int
2488 @opindex Wimplicit-int
2489 Warn when a declaration does not specify a type.
2490 This warning is enabled by @option{-Wall}.
2492 @item -Wimplicit-function-declaration
2493 @itemx -Werror-implicit-function-declaration
2494 @opindex Wimplicit-function-declaration
2495 @opindex Werror-implicit-function-declaration
2496 Give a warning (or error) whenever a function is used before being
2497 declared.  The form @option{-Wno-error-implicit-function-declaration}
2498 is not supported.
2499 This warning is enabled by @option{-Wall} (as a warning, not an error).
2501 @item -Wimplicit
2502 @opindex Wimplicit
2503 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2504 This warning is enabled by @option{-Wall}.
2506 @item -Wmain
2507 @opindex Wmain
2508 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2509 function with external linkage, returning int, taking either zero
2510 arguments, two, or three arguments of appropriate types.
2511 This warning is enabled by @option{-Wall}.
2513 @item -Wmissing-braces
2514 @opindex Wmissing-braces
2515 Warn if an aggregate or union initializer is not fully bracketed.  In
2516 the following example, the initializer for @samp{a} is not fully
2517 bracketed, but that for @samp{b} is fully bracketed.
2519 @smallexample
2520 int a[2][2] = @{ 0, 1, 2, 3 @};
2521 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2522 @end smallexample
2524 This warning is enabled by @option{-Wall}.
2526 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2527 @opindex Wmissing-include-dirs
2528 Warn if a user-supplied include directory does not exist.
2530 @item -Wparentheses
2531 @opindex Wparentheses
2532 Warn if parentheses are omitted in certain contexts, such
2533 as when there is an assignment in a context where a truth value
2534 is expected, or when operators are nested whose precedence people
2535 often get confused about.
2537 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2538 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2539 interpretation from that of ordinary mathematical notation.
2541 Also warn about constructions where there may be confusion to which
2542 @code{if} statement an @code{else} branch belongs.  Here is an example of
2543 such a case:
2545 @smallexample
2546 @group
2548   if (a)
2549     if (b)
2550       foo ();
2551   else
2552     bar ();
2554 @end group
2555 @end smallexample
2557 In C/C++, every @code{else} branch belongs to the innermost possible
2558 @code{if} statement, which in this example is @code{if (b)}.  This is
2559 often not what the programmer expected, as illustrated in the above
2560 example by indentation the programmer chose.  When there is the
2561 potential for this confusion, GCC will issue a warning when this flag
2562 is specified.  To eliminate the warning, add explicit braces around
2563 the innermost @code{if} statement so there is no way the @code{else}
2564 could belong to the enclosing @code{if}.  The resulting code would
2565 look like this:
2567 @smallexample
2568 @group
2570   if (a)
2571     @{
2572       if (b)
2573         foo ();
2574       else
2575         bar ();
2576     @}
2578 @end group
2579 @end smallexample
2581 This warning is enabled by @option{-Wall}.
2583 @item -Wsequence-point
2584 @opindex Wsequence-point
2585 Warn about code that may have undefined semantics because of violations
2586 of sequence point rules in the C and C++ standards.
2588 The C and C++ standards defines the order in which expressions in a C/C++
2589 program are evaluated in terms of @dfn{sequence points}, which represent
2590 a partial ordering between the execution of parts of the program: those
2591 executed before the sequence point, and those executed after it.  These
2592 occur after the evaluation of a full expression (one which is not part
2593 of a larger expression), after the evaluation of the first operand of a
2594 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2595 function is called (but after the evaluation of its arguments and the
2596 expression denoting the called function), and in certain other places.
2597 Other than as expressed by the sequence point rules, the order of
2598 evaluation of subexpressions of an expression is not specified.  All
2599 these rules describe only a partial order rather than a total order,
2600 since, for example, if two functions are called within one expression
2601 with no sequence point between them, the order in which the functions
2602 are called is not specified.  However, the standards committee have
2603 ruled that function calls do not overlap.
2605 It is not specified when between sequence points modifications to the
2606 values of objects take effect.  Programs whose behavior depends on this
2607 have undefined behavior; the C and C++ standards specify that ``Between
2608 the previous and next sequence point an object shall have its stored
2609 value modified at most once by the evaluation of an expression.  
2610 Furthermore, the prior value shall be read only to determine the value
2611 to be stored.''.  If a program breaks these rules, the results on any
2612 particular implementation are entirely unpredictable.
2614 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2615 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2616 diagnosed by this option, and it may give an occasional false positive
2617 result, but in general it has been found fairly effective at detecting
2618 this sort of problem in programs.
2620 The standard is worded confusingly, therefore there is some debate
2621 over the precise meaning of the sequence point rules in subtle cases.
2622 Links to discussions of the problem, including proposed formal
2623 definitions, may be found on the GCC readings page, at
2624 @w{@uref{http://gcc.gnu.org/readings.html}}.
2626 This warning is enabled by @option{-Wall} for C and C++.
2628 @item -Wreturn-type
2629 @opindex Wreturn-type
2630 Warn whenever a function is defined with a return-type that defaults to
2631 @code{int}.  Also warn about any @code{return} statement with no
2632 return-value in a function whose return-type is not @code{void}.
2634 For C, also warn if the return type of a function has a type qualifier
2635 such as @code{const}.  Such a type qualifier has no effect, since the
2636 value returned by a function is not an lvalue.  ISO C prohibits
2637 qualified @code{void} return types on function definitions, so such
2638 return types always receive a warning even without this option.
2640 For C++, a function without return type always produces a diagnostic
2641 message, even when @option{-Wno-return-type} is specified.  The only
2642 exceptions are @samp{main} and functions defined in system headers.
2644 This warning is enabled by @option{-Wall}.
2646 @item -Wswitch
2647 @opindex Wswitch
2648 Warn whenever a @code{switch} statement has an index of enumerated type
2649 and lacks a @code{case} for one or more of the named codes of that
2650 enumeration.  (The presence of a @code{default} label prevents this
2651 warning.)  @code{case} labels outside the enumeration range also
2652 provoke warnings when this option is used.
2653 This warning is enabled by @option{-Wall}.
2655 @item -Wswitch-default
2656 @opindex Wswitch-switch
2657 Warn whenever a @code{switch} statement does not have a @code{default}
2658 case.
2660 @item -Wswitch-enum
2661 @opindex Wswitch-enum
2662 Warn whenever a @code{switch} statement has an index of enumerated type
2663 and lacks a @code{case} for one or more of the named codes of that
2664 enumeration.  @code{case} labels outside the enumeration range also
2665 provoke warnings when this option is used.
2667 @item -Wtrigraphs
2668 @opindex Wtrigraphs
2669 Warn if any trigraphs are encountered that might change the meaning of
2670 the program (trigraphs within comments are not warned about).
2671 This warning is enabled by @option{-Wall}.
2673 @item -Wunused-function
2674 @opindex Wunused-function
2675 Warn whenever a static function is declared but not defined or a
2676 non-inline static function is unused.
2677 This warning is enabled by @option{-Wall}.
2679 @item -Wunused-label
2680 @opindex Wunused-label
2681 Warn whenever a label is declared but not used.
2682 This warning is enabled by @option{-Wall}.
2684 To suppress this warning use the @samp{unused} attribute
2685 (@pxref{Variable Attributes}).
2687 @item -Wunused-parameter
2688 @opindex Wunused-parameter
2689 Warn whenever a function parameter is unused aside from its declaration.
2691 To suppress this warning use the @samp{unused} attribute
2692 (@pxref{Variable Attributes}).
2694 @item -Wunused-variable
2695 @opindex Wunused-variable
2696 Warn whenever a local variable or non-constant static variable is unused
2697 aside from its declaration.
2698 This warning is enabled by @option{-Wall}.
2700 To suppress this warning use the @samp{unused} attribute
2701 (@pxref{Variable Attributes}).
2703 @item -Wunused-value
2704 @opindex Wunused-value
2705 Warn whenever a statement computes a result that is explicitly not used.
2706 This warning is enabled by @option{-Wall}.
2708 To suppress this warning cast the expression to @samp{void}.
2710 @item -Wunused
2711 @opindex Wunused
2712 All the above @option{-Wunused} options combined.
2714 In order to get a warning about an unused function parameter, you must
2715 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2716 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2718 @item -Wuninitialized
2719 @opindex Wuninitialized
2720 Warn if an automatic variable is used without first being initialized or
2721 if a variable may be clobbered by a @code{setjmp} call.
2723 These warnings are possible only in optimizing compilation,
2724 because they require data flow information that is computed only
2725 when optimizing.  If you do not specify @option{-O}, you will not get 
2726 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2727 requiring @option{-O}.
2729 If you want to warn about code which uses the uninitialized value of the
2730 variable in its own initializer, use the @option{-Winit-self} option.
2732 These warnings occur for individual uninitialized or clobbered
2733 elements of structure, union or array variables as well as for
2734 variables which are uninitialized or clobbered as a whole.  They do
2735 not occur for variables or elements declared @code{volatile}.  Because
2736 these warnings depend on optimization, the exact variables or elements
2737 for which there are warnings will depend on the precise optimization
2738 options and version of GCC used.
2740 Note that there may be no warning about a variable that is used only
2741 to compute a value that itself is never used, because such
2742 computations may be deleted by data flow analysis before the warnings
2743 are printed.
2745 These warnings are made optional because GCC is not smart
2746 enough to see all the reasons why the code might be correct
2747 despite appearing to have an error.  Here is one example of how
2748 this can happen:
2750 @smallexample
2751 @group
2753   int x;
2754   switch (y)
2755     @{
2756     case 1: x = 1;
2757       break;
2758     case 2: x = 4;
2759       break;
2760     case 3: x = 5;
2761     @}
2762   foo (x);
2764 @end group
2765 @end smallexample
2767 @noindent
2768 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2769 always initialized, but GCC doesn't know this.  Here is
2770 another common case:
2772 @smallexample
2774   int save_y;
2775   if (change_y) save_y = y, y = new_y;
2776   @dots{}
2777   if (change_y) y = save_y;
2779 @end smallexample
2781 @noindent
2782 This has no bug because @code{save_y} is used only if it is set.
2784 @cindex @code{longjmp} warnings
2785 This option also warns when a non-volatile automatic variable might be
2786 changed by a call to @code{longjmp}.  These warnings as well are possible
2787 only in optimizing compilation.
2789 The compiler sees only the calls to @code{setjmp}.  It cannot know
2790 where @code{longjmp} will be called; in fact, a signal handler could
2791 call it at any point in the code.  As a result, you may get a warning
2792 even when there is in fact no problem because @code{longjmp} cannot
2793 in fact be called at the place which would cause a problem.
2795 Some spurious warnings can be avoided if you declare all the functions
2796 you use that never return as @code{noreturn}.  @xref{Function
2797 Attributes}.
2799 This warning is enabled by @option{-Wall}.
2801 @item -Wunknown-pragmas
2802 @opindex Wunknown-pragmas
2803 @cindex warning for unknown pragmas
2804 @cindex unknown pragmas, warning
2805 @cindex pragmas, warning of unknown
2806 Warn when a #pragma directive is encountered which is not understood by
2807 GCC@.  If this command line option is used, warnings will even be issued
2808 for unknown pragmas in system header files.  This is not the case if
2809 the warnings were only enabled by the @option{-Wall} command line option.
2811 @item -Wno-pragmas
2812 @opindex Wno-pragmas
2813 @opindex Wpragmas
2814 Do not warn about misuses of pragmas, such as incorrect parameters,
2815 invalid syntax, or conflicts between pragmas.  See also
2816 @samp{-Wunknown-pragmas}.
2818 @item -Wstrict-aliasing
2819 @opindex Wstrict-aliasing
2820 This option is only active when @option{-fstrict-aliasing} is active.
2821 It warns about code which might break the strict aliasing rules that the
2822 compiler is using for optimization.  The warning does not catch all
2823 cases, but does attempt to catch the more common pitfalls.  It is
2824 included in @option{-Wall}.
2826 @item -Wstrict-aliasing=2
2827 @opindex Wstrict-aliasing=2
2828 This option is only active when @option{-fstrict-aliasing} is active.
2829 It warns about code which might break the strict aliasing rules that the
2830 compiler is using for optimization.  This warning catches more cases than
2831 @option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
2832 cases that are safe.
2834 @item -Wall
2835 @opindex Wall
2836 All of the above @samp{-W} options combined.  This enables all the
2837 warnings about constructions that some users consider questionable, and
2838 that are easy to avoid (or modify to prevent the warning), even in
2839 conjunction with macros.  This also enables some language-specific
2840 warnings described in @ref{C++ Dialect Options} and
2841 @ref{Objective-C and Objective-C++ Dialect Options}.
2842 @end table
2844 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
2845 Some of them warn about constructions that users generally do not
2846 consider questionable, but which occasionally you might wish to check
2847 for; others warn about constructions that are necessary or hard to avoid
2848 in some cases, and there is no simple way to modify the code to suppress
2849 the warning.
2851 @table @gcctabopt
2852 @item -Wextra
2853 @opindex W
2854 @opindex Wextra
2855 (This option used to be called @option{-W}.  The older name is still
2856 supported, but the newer name is more descriptive.)  Print extra warning
2857 messages for these events:
2859 @itemize @bullet
2860 @item
2861 A function can return either with or without a value.  (Falling
2862 off the end of the function body is considered returning without
2863 a value.)  For example, this function would evoke such a
2864 warning:
2866 @smallexample
2867 @group
2868 foo (a)
2870   if (a > 0)
2871     return a;
2873 @end group
2874 @end smallexample
2876 @item
2877 An expression-statement or the left-hand side of a comma expression
2878 contains no side effects.
2879 To suppress the warning, cast the unused expression to void.
2880 For example, an expression such as @samp{x[i,j]} will cause a warning,
2881 but @samp{x[(void)i,j]} will not.
2883 @item
2884 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
2886 @item
2887 Storage-class specifiers like @code{static} are not the first things in
2888 a declaration.  According to the C Standard, this usage is obsolescent.
2890 @item
2891 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
2892 arguments.
2894 @item
2895 A comparison between signed and unsigned values could produce an
2896 incorrect result when the signed value is converted to unsigned.
2897 (But don't warn if @option{-Wno-sign-compare} is also specified.)
2899 @item
2900 An aggregate has an initializer which does not initialize all members.
2901 This warning can be independently controlled by
2902 @option{-Wmissing-field-initializers}.
2904 @item
2905 An initialized field without side effects is overridden when using
2906 designated initializers (@pxref{Designated Inits, , Designated
2907 Initializers}).  This warning can be independently controlled by
2908 @option{-Woverride-init}.
2910 @item
2911 A function parameter is declared without a type specifier in K&R-style
2912 functions:
2914 @smallexample
2915 void foo(bar) @{ @}
2916 @end smallexample
2918 @item
2919 An empty body occurs in an @samp{if} or @samp{else} statement.
2921 @item
2922 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2923 @samp{>}, or @samp{>=}.
2925 @item
2926 A variable might be changed by @samp{longjmp} or @samp{vfork}.
2928 @item
2929 Any of several floating-point events that often indicate errors, such as
2930 overflow, underflow, loss of precision, etc.
2932 @item @r{(C++ only)}
2933 An enumerator and a non-enumerator both appear in a conditional expression.
2935 @item @r{(C++ only)}
2936 A non-static reference or non-static @samp{const} member appears in a
2937 class without constructors.
2939 @item @r{(C++ only)}
2940 Ambiguous virtual bases.
2942 @item @r{(C++ only)}
2943 Subscripting an array which has been declared @samp{register}.
2945 @item @r{(C++ only)}
2946 Taking the address of a variable which has been declared @samp{register}.
2948 @item @r{(C++ only)}
2949 A base class is not initialized in a derived class' copy constructor.
2950 @end itemize
2952 @item -Wno-div-by-zero
2953 @opindex Wno-div-by-zero
2954 @opindex Wdiv-by-zero
2955 Do not warn about compile-time integer division by zero.  Floating point
2956 division by zero is not warned about, as it can be a legitimate way of
2957 obtaining infinities and NaNs.
2959 @item -Wsystem-headers
2960 @opindex Wsystem-headers
2961 @cindex warnings from system headers
2962 @cindex system headers, warnings from
2963 Print warning messages for constructs found in system header files.
2964 Warnings from system headers are normally suppressed, on the assumption
2965 that they usually do not indicate real problems and would only make the
2966 compiler output harder to read.  Using this command line option tells
2967 GCC to emit warnings from system headers as if they occurred in user
2968 code.  However, note that using @option{-Wall} in conjunction with this
2969 option will @emph{not} warn about unknown pragmas in system
2970 headers---for that, @option{-Wunknown-pragmas} must also be used.
2972 @item -Wfloat-equal
2973 @opindex Wfloat-equal
2974 Warn if floating point values are used in equality comparisons.
2976 The idea behind this is that sometimes it is convenient (for the
2977 programmer) to consider floating-point values as approximations to
2978 infinitely precise real numbers.  If you are doing this, then you need
2979 to compute (by analyzing the code, or in some other way) the maximum or
2980 likely maximum error that the computation introduces, and allow for it
2981 when performing comparisons (and when producing output, but that's a
2982 different problem).  In particular, instead of testing for equality, you
2983 would check to see whether the two values have ranges that overlap; and
2984 this is done with the relational operators, so equality comparisons are
2985 probably mistaken.
2987 @item -Wtraditional @r{(C only)}
2988 @opindex Wtraditional
2989 Warn about certain constructs that behave differently in traditional and
2990 ISO C@.  Also warn about ISO C constructs that have no traditional C
2991 equivalent, and/or problematic constructs which should be avoided.
2993 @itemize @bullet
2994 @item
2995 Macro parameters that appear within string literals in the macro body.
2996 In traditional C macro replacement takes place within string literals,
2997 but does not in ISO C@.
2999 @item
3000 In traditional C, some preprocessor directives did not exist.
3001 Traditional preprocessors would only consider a line to be a directive
3002 if the @samp{#} appeared in column 1 on the line.  Therefore
3003 @option{-Wtraditional} warns about directives that traditional C
3004 understands but would ignore because the @samp{#} does not appear as the
3005 first character on the line.  It also suggests you hide directives like
3006 @samp{#pragma} not understood by traditional C by indenting them.  Some
3007 traditional implementations would not recognize @samp{#elif}, so it
3008 suggests avoiding it altogether.
3010 @item
3011 A function-like macro that appears without arguments.
3013 @item
3014 The unary plus operator.
3016 @item
3017 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3018 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3019 constants.)  Note, these suffixes appear in macros defined in the system
3020 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3021 Use of these macros in user code might normally lead to spurious
3022 warnings, however GCC's integrated preprocessor has enough context to
3023 avoid warning in these cases.
3025 @item
3026 A function declared external in one block and then used after the end of
3027 the block.
3029 @item
3030 A @code{switch} statement has an operand of type @code{long}.
3032 @item
3033 A non-@code{static} function declaration follows a @code{static} one.
3034 This construct is not accepted by some traditional C compilers.
3036 @item
3037 The ISO type of an integer constant has a different width or
3038 signedness from its traditional type.  This warning is only issued if
3039 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3040 typically represent bit patterns, are not warned about.
3042 @item
3043 Usage of ISO string concatenation is detected.
3045 @item
3046 Initialization of automatic aggregates.
3048 @item
3049 Identifier conflicts with labels.  Traditional C lacks a separate
3050 namespace for labels.
3052 @item
3053 Initialization of unions.  If the initializer is zero, the warning is
3054 omitted.  This is done under the assumption that the zero initializer in
3055 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3056 initializer warnings and relies on default initialization to zero in the
3057 traditional C case.
3059 @item
3060 Conversions by prototypes between fixed/floating point values and vice
3061 versa.  The absence of these prototypes when compiling with traditional
3062 C would cause serious problems.  This is a subset of the possible
3063 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3065 @item
3066 Use of ISO C style function definitions.  This warning intentionally is
3067 @emph{not} issued for prototype declarations or variadic functions
3068 because these ISO C features will appear in your code when using
3069 libiberty's traditional C compatibility macros, @code{PARAMS} and
3070 @code{VPARAMS}.  This warning is also bypassed for nested functions
3071 because that feature is already a GCC extension and thus not relevant to
3072 traditional C compatibility.
3073 @end itemize
3075 @item -Wtraditional-conversion @r{(C only)}
3076 @opindex Wtraditional-conversion
3077 Warn if a prototype causes a type conversion that is different from what
3078 would happen to the same argument in the absence of a prototype.  This
3079 includes conversions of fixed point to floating and vice versa, and
3080 conversions changing the width or signedness of a fixed point argument
3081 except when the same as the default promotion.
3083 @item -Wdeclaration-after-statement @r{(C only)}
3084 @opindex Wdeclaration-after-statement
3085 Warn when a declaration is found after a statement in a block.  This
3086 construct, known from C++, was introduced with ISO C99 and is by default
3087 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3088 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3090 @item -Wundef
3091 @opindex Wundef
3092 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3094 @item -Wno-endif-labels
3095 @opindex Wno-endif-labels
3096 @opindex Wendif-labels
3097 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3099 @item -Wshadow
3100 @opindex Wshadow
3101 Warn whenever a local variable shadows another local variable, parameter or
3102 global variable or whenever a built-in function is shadowed.
3104 @item -Wlarger-than-@var{len}
3105 @opindex Wlarger-than
3106 Warn whenever an object of larger than @var{len} bytes is defined.
3108 @item -Wunsafe-loop-optimizations
3109 @opindex Wunsafe-loop-optimizations
3110 Warn if the loop cannot be optimized because the compiler could not
3111 assume anything on the bounds of the loop indices.  With
3112 @option{-funsafe-loop-optimizations} warn if the compiler made
3113 such assumptions.
3115 @item -Wpointer-arith
3116 @opindex Wpointer-arith
3117 Warn about anything that depends on the ``size of'' a function type or
3118 of @code{void}.  GNU C assigns these types a size of 1, for
3119 convenience in calculations with @code{void *} pointers and pointers
3120 to functions.
3122 @item -Wbad-function-cast @r{(C only)}
3123 @opindex Wbad-function-cast
3124 Warn whenever a function call is cast to a non-matching type.
3125 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3127 @item -Wc++-compat
3128 Warn about ISO C constructs that are outside of the common subset of
3129 ISO C and ISO C++, e.g.@: request for implicit conversion from
3130 @code{void *} to a pointer to non-@code{void} type.
3132 @item -Wcast-qual
3133 @opindex Wcast-qual
3134 Warn whenever a pointer is cast so as to remove a type qualifier from
3135 the target type.  For example, warn if a @code{const char *} is cast
3136 to an ordinary @code{char *}.
3138 @item -Wcast-align
3139 @opindex Wcast-align
3140 Warn whenever a pointer is cast such that the required alignment of the
3141 target is increased.  For example, warn if a @code{char *} is cast to
3142 an @code{int *} on machines where integers can only be accessed at
3143 two- or four-byte boundaries.
3145 @item -Wwrite-strings
3146 @opindex Wwrite-strings
3147 When compiling C, give string constants the type @code{const
3148 char[@var{length}]} so that
3149 copying the address of one into a non-@code{const} @code{char *}
3150 pointer will get a warning; when compiling C++, warn about the
3151 deprecated conversion from string literals to @code{char *}.  This
3152 warning, by default, is enabled for C++ programs.
3153 These warnings will help you find at
3154 compile time code that can try to write into a string constant, but
3155 only if you have been very careful about using @code{const} in
3156 declarations and prototypes.  Otherwise, it will just be a nuisance;
3157 this is why we did not make @option{-Wall} request these warnings.
3159 @item -Wconversion
3160 @opindex Wconversion
3161 Warn for implicit conversions that may alter a value. This includes
3162 conversions between real and integer, like @code{abs (x)} when
3163 @code{x} is @code{double}; conversions between signed and unsigned,
3164 like @code{unsigned ui = -1}; and conversions to smaller types, like
3165 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3166 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3167 changed by the conversion like in @code{abs (2.0)}.
3169 @item -Wsign-compare
3170 @opindex Wsign-compare
3171 @cindex warning for comparison of signed and unsigned values
3172 @cindex comparison of signed and unsigned values, warning
3173 @cindex signed and unsigned values, comparison warning
3174 Warn when a comparison between signed and unsigned values could produce
3175 an incorrect result when the signed value is converted to unsigned.
3176 This warning is also enabled by @option{-Wextra}; to get the other warnings
3177 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3179 @item -Waggregate-return
3180 @opindex Waggregate-return
3181 Warn if any functions that return structures or unions are defined or
3182 called.  (In languages where you can return an array, this also elicits
3183 a warning.)
3185 @item -Walways-true
3186 @opindex Walways-true
3187 Warn about comparisons which are always true such as testing if
3188 unsigned values are greater than or equal to zero.  This warning is
3189 enabled by @option{-Wall}.
3191 @item -Wno-attributes
3192 @opindex Wno-attributes
3193 @opindex Wattributes
3194 Do not warn if an unexpected @code{__attribute__} is used, such as
3195 unrecognized attributes, function attributes applied to variables,
3196 etc.  This will not stop errors for incorrect use of supported
3197 attributes.
3199 @item -Wstrict-prototypes @r{(C only)}
3200 @opindex Wstrict-prototypes
3201 Warn if a function is declared or defined without specifying the
3202 argument types.  (An old-style function definition is permitted without
3203 a warning if preceded by a declaration which specifies the argument
3204 types.)
3206 @item -Wold-style-definition @r{(C only)}
3207 @opindex Wold-style-definition
3208 Warn if an old-style function definition is used.  A warning is given
3209 even if there is a previous prototype.
3211 @item -Wmissing-prototypes @r{(C only)}
3212 @opindex Wmissing-prototypes
3213 Warn if a global function is defined without a previous prototype
3214 declaration.  This warning is issued even if the definition itself
3215 provides a prototype.  The aim is to detect global functions that fail
3216 to be declared in header files.
3218 @item -Wmissing-declarations @r{(C only)}
3219 @opindex Wmissing-declarations
3220 Warn if a global function is defined without a previous declaration.
3221 Do so even if the definition itself provides a prototype.
3222 Use this option to detect global functions that are not declared in
3223 header files.
3225 @item -Wmissing-field-initializers
3226 @opindex Wmissing-field-initializers
3227 @opindex W
3228 @opindex Wextra
3229 Warn if a structure's initializer has some fields missing.  For
3230 example, the following code would cause such a warning, because
3231 @code{x.h} is implicitly zero:
3233 @smallexample
3234 struct s @{ int f, g, h; @};
3235 struct s x = @{ 3, 4 @};
3236 @end smallexample
3238 This option does not warn about designated initializers, so the following
3239 modification would not trigger a warning:
3241 @smallexample
3242 struct s @{ int f, g, h; @};
3243 struct s x = @{ .f = 3, .g = 4 @};
3244 @end smallexample
3246 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3247 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3249 @item -Wmissing-noreturn
3250 @opindex Wmissing-noreturn
3251 Warn about functions which might be candidates for attribute @code{noreturn}.
3252 Note these are only possible candidates, not absolute ones.  Care should
3253 be taken to manually verify functions actually do not ever return before
3254 adding the @code{noreturn} attribute, otherwise subtle code generation
3255 bugs could be introduced.  You will not get a warning for @code{main} in
3256 hosted C environments.
3258 @item -Wmissing-format-attribute
3259 @opindex Wmissing-format-attribute
3260 @opindex Wformat
3261 Warn about function pointers which might be candidates for @code{format}
3262 attributes.  Note these are only possible candidates, not absolute ones.
3263 GCC will guess that function pointers with @code{format} attributes that
3264 are used in assignment, initialization, parameter passing or return
3265 statements should have a corresponding @code{format} attribute in the
3266 resulting type.  I.e.@: the left-hand side of the assignment or
3267 initialization, the type of the parameter variable, or the return type
3268 of the containing function respectively should also have a @code{format}
3269 attribute to avoid the warning.
3271 GCC will also warn about function definitions which might be
3272 candidates for @code{format} attributes.  Again, these are only
3273 possible candidates.  GCC will guess that @code{format} attributes
3274 might be appropriate for any function that calls a function like
3275 @code{vprintf} or @code{vscanf}, but this might not always be the
3276 case, and some functions for which @code{format} attributes are
3277 appropriate may not be detected.
3279 @item -Wno-multichar
3280 @opindex Wno-multichar
3281 @opindex Wmultichar
3282 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3283 Usually they indicate a typo in the user's code, as they have
3284 implementation-defined values, and should not be used in portable code.
3286 @item -Wnormalized=<none|id|nfc|nfkc>
3287 @opindex Wnormalized
3288 @cindex NFC
3289 @cindex NFKC
3290 @cindex character set, input normalization
3291 In ISO C and ISO C++, two identifiers are different if they are
3292 different sequences of characters.  However, sometimes when characters
3293 outside the basic ASCII character set are used, you can have two
3294 different character sequences that look the same.  To avoid confusion,
3295 the ISO 10646 standard sets out some @dfn{normalization rules} which
3296 when applied ensure that two sequences that look the same are turned into
3297 the same sequence.  GCC can warn you if you are using identifiers which
3298 have not been normalized; this option controls that warning.
3300 There are four levels of warning that GCC supports.  The default is
3301 @option{-Wnormalized=nfc}, which warns about any identifier which is
3302 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3303 recommended form for most uses.
3305 Unfortunately, there are some characters which ISO C and ISO C++ allow
3306 in identifiers that when turned into NFC aren't allowable as
3307 identifiers.  That is, there's no way to use these symbols in portable
3308 ISO C or C++ and have all your identifiers in NFC.
3309 @option{-Wnormalized=id} suppresses the warning for these characters.
3310 It is hoped that future versions of the standards involved will correct
3311 this, which is why this option is not the default.
3313 You can switch the warning off for all characters by writing
3314 @option{-Wnormalized=none}.  You would only want to do this if you
3315 were using some other normalization scheme (like ``D''), because
3316 otherwise you can easily create bugs that are literally impossible to see.
3318 Some characters in ISO 10646 have distinct meanings but look identical
3319 in some fonts or display methodologies, especially once formatting has
3320 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3321 LETTER N'', will display just like a regular @code{n} which has been
3322 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3323 normalization scheme to convert all these into a standard form as
3324 well, and GCC will warn if your code is not in NFKC if you use
3325 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3326 about every identifier that contains the letter O because it might be
3327 confused with the digit 0, and so is not the default, but may be
3328 useful as a local coding convention if the programming environment is
3329 unable to be fixed to display these characters distinctly.
3331 @item -Wno-deprecated-declarations
3332 @opindex Wno-deprecated-declarations
3333 Do not warn about uses of functions (@pxref{Function Attributes}),
3334 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3335 Attributes}) marked as deprecated by using the @code{deprecated}
3336 attribute.
3338 @item -Wno-overflow
3339 @opindex Wno-overflow
3340 Do not warn about compile-time overflow in constant expressions.
3342 @item -Woverride-init
3343 @opindex Woverride-init
3344 @opindex W
3345 @opindex Wextra
3346 Warn if an initialized field without side effects is overridden when
3347 using designated initializers (@pxref{Designated Inits, , Designated
3348 Initializers}).
3350 This warning is included in @option{-Wextra}.  To get other
3351 @option{-Wextra} warnings without this one, use @samp{-Wextra
3352 -Wno-override-init}.
3354 @item -Wpacked
3355 @opindex Wpacked
3356 Warn if a structure is given the packed attribute, but the packed
3357 attribute has no effect on the layout or size of the structure.
3358 Such structures may be mis-aligned for little benefit.  For
3359 instance, in this code, the variable @code{f.x} in @code{struct bar}
3360 will be misaligned even though @code{struct bar} does not itself
3361 have the packed attribute:
3363 @smallexample
3364 @group
3365 struct foo @{
3366   int x;
3367   char a, b, c, d;
3368 @} __attribute__((packed));
3369 struct bar @{
3370   char z;
3371   struct foo f;
3373 @end group
3374 @end smallexample
3376 @item -Wpadded
3377 @opindex Wpadded
3378 Warn if padding is included in a structure, either to align an element
3379 of the structure or to align the whole structure.  Sometimes when this
3380 happens it is possible to rearrange the fields of the structure to
3381 reduce the padding and so make the structure smaller.
3383 @item -Wredundant-decls
3384 @opindex Wredundant-decls
3385 Warn if anything is declared more than once in the same scope, even in
3386 cases where multiple declaration is valid and changes nothing.
3388 @item -Wnested-externs @r{(C only)}
3389 @opindex Wnested-externs
3390 Warn if an @code{extern} declaration is encountered within a function.
3392 @item -Wunreachable-code
3393 @opindex Wunreachable-code
3394 Warn if the compiler detects that code will never be executed.
3396 This option is intended to warn when the compiler detects that at
3397 least a whole line of source code will never be executed, because
3398 some condition is never satisfied or because it is after a
3399 procedure that never returns.
3401 It is possible for this option to produce a warning even though there
3402 are circumstances under which part of the affected line can be executed,
3403 so care should be taken when removing apparently-unreachable code.
3405 For instance, when a function is inlined, a warning may mean that the
3406 line is unreachable in only one inlined copy of the function.
3408 This option is not made part of @option{-Wall} because in a debugging
3409 version of a program there is often substantial code which checks
3410 correct functioning of the program and is, hopefully, unreachable
3411 because the program does work.  Another common use of unreachable
3412 code is to provide behavior which is selectable at compile-time.
3414 @item -Winline
3415 @opindex Winline
3416 Warn if a function can not be inlined and it was declared as inline.
3417 Even with this option, the compiler will not warn about failures to
3418 inline functions declared in system headers.
3420 The compiler uses a variety of heuristics to determine whether or not
3421 to inline a function.  For example, the compiler takes into account
3422 the size of the function being inlined and the amount of inlining
3423 that has already been done in the current function.  Therefore,
3424 seemingly insignificant changes in the source program can cause the
3425 warnings produced by @option{-Winline} to appear or disappear.
3427 @item -Wno-invalid-offsetof @r{(C++ only)}
3428 @opindex Wno-invalid-offsetof
3429 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3430 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3431 to a non-POD type is undefined.  In existing C++ implementations,
3432 however, @samp{offsetof} typically gives meaningful results even when
3433 applied to certain kinds of non-POD types. (Such as a simple
3434 @samp{struct} that fails to be a POD type only by virtue of having a
3435 constructor.)  This flag is for users who are aware that they are
3436 writing nonportable code and who have deliberately chosen to ignore the
3437 warning about it.
3439 The restrictions on @samp{offsetof} may be relaxed in a future version
3440 of the C++ standard.
3442 @item -Wno-int-to-pointer-cast @r{(C only)}
3443 @opindex Wno-int-to-pointer-cast
3444 Suppress warnings from casts to pointer type of an integer of a
3445 different size.
3447 @item -Wno-pointer-to-int-cast @r{(C only)}
3448 @opindex Wno-pointer-to-int-cast
3449 Suppress warnings from casts from a pointer to an integer type of a
3450 different size.
3452 @item -Winvalid-pch
3453 @opindex Winvalid-pch
3454 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3455 the search path but can't be used.
3457 @item -Wlong-long
3458 @opindex Wlong-long
3459 @opindex Wno-long-long
3460 Warn if @samp{long long} type is used.  This is default.  To inhibit
3461 the warning messages, use @option{-Wno-long-long}.  Flags
3462 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3463 only when @option{-pedantic} flag is used.
3465 @item -Wvariadic-macros
3466 @opindex Wvariadic-macros
3467 @opindex Wno-variadic-macros
3468 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3469 alternate syntax when in pedantic ISO C99 mode.  This is default.
3470 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3472 @item -Wvolatile-register-var
3473 @opindex Wvolatile-register-var
3474 @opindex Wno-volatile-register-var
3475 Warn if a register variable is declared volatile.  The volatile
3476 modifier does not inhibit all optimizations that may eliminate reads
3477 and/or writes to register variables.
3479 @item -Wdisabled-optimization
3480 @opindex Wdisabled-optimization
3481 Warn if a requested optimization pass is disabled.  This warning does
3482 not generally indicate that there is anything wrong with your code; it
3483 merely indicates that GCC's optimizers were unable to handle the code
3484 effectively.  Often, the problem is that your code is too big or too
3485 complex; GCC will refuse to optimize programs when the optimization
3486 itself is likely to take inordinate amounts of time.
3488 @item -Wpointer-sign
3489 @opindex Wpointer-sign
3490 @opindex Wno-pointer-sign
3491 Warn for pointer argument passing or assignment with different signedness.
3492 This option is only supported for C and Objective-C@.  It is implied by
3493 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3494 @option{-Wno-pointer-sign}.
3496 @item -Werror
3497 @opindex Werror
3498 Make all warnings into errors.
3500 @item -Werror=
3501 @opindex Werror=
3502 Make the specified warning into an errors.  The specifier for a
3503 warning is appended, for example @option{-Werror=switch} turns the
3504 warnings controlled by @option{-Wswitch} into errors.  This switch
3505 takes a negative form, to be used to negate @option{-Werror} for
3506 specific warnings, for example @option{-Wno-error=switch} makes
3507 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3508 is in effect.  You can use the @option{-fdiagnostics-show-option}
3509 option to have each controllable warning amended with the option which
3510 controls it, to determine what to use with this option.
3512 Note that specifying @option{-Werror=}@var{foo} automatically implies
3513 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3514 imply anything.
3516 @item -Wstack-protector
3517 @opindex Wstack-protector
3518 This option is only active when @option{-fstack-protector} is active.  It
3519 warns about functions that will not be protected against stack smashing.
3521 @item -Wstring-literal-comparison
3522 @opindex Wstring-literal-comparison
3523 Warn about suspicious comparisons to string literal constants.  In C,
3524 direct comparisons against the memory address of a string literal, such
3525 as @code{if (x == "abc")}, typically indicate a programmer error, and
3526 even when intentional, result in unspecified behavior and are not portable.
3527 Usually these warnings alert that the programmer intended to use
3528 @code{strcmp}.  This warning is enabled by @option{-Wall}.
3530 @item -Woverlength-strings
3531 @opindex Woverlength-strings
3532 Warn about string constants which are longer than the ``minimum
3533 maximum'' length specified in the C standard.  Modern compilers
3534 generally allow string constants which are much longer than the
3535 standard's minimum limit, but very portable programs should avoid
3536 using longer strings.
3538 The limit applies @emph{after} string constant concatenation, and does
3539 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3540 C99, it was raised to 4095.  C++98 does not specify a normative
3541 minimum maximum, so we do not diagnose overlength strings in C++@.
3543 This option is implied by @option{-pedantic}, and can be disabled with
3544 @option{-Wno-overlength-strings}.
3545 @end table
3547 @node Debugging Options
3548 @section Options for Debugging Your Program or GCC
3549 @cindex options, debugging
3550 @cindex debugging information options
3552 GCC has various special options that are used for debugging
3553 either your program or GCC:
3555 @table @gcctabopt
3556 @item -g
3557 @opindex g
3558 Produce debugging information in the operating system's native format
3559 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3560 information.
3562 On most systems that use stabs format, @option{-g} enables use of extra
3563 debugging information that only GDB can use; this extra information
3564 makes debugging work better in GDB but will probably make other debuggers
3565 crash or
3566 refuse to read the program.  If you want to control for certain whether
3567 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3568 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3570 GCC allows you to use @option{-g} with
3571 @option{-O}.  The shortcuts taken by optimized code may occasionally
3572 produce surprising results: some variables you declared may not exist
3573 at all; flow of control may briefly move where you did not expect it;
3574 some statements may not be executed because they compute constant
3575 results or their values were already at hand; some statements may
3576 execute in different places because they were moved out of loops.
3578 Nevertheless it proves possible to debug optimized output.  This makes
3579 it reasonable to use the optimizer for programs that might have bugs.
3581 The following options are useful when GCC is generated with the
3582 capability for more than one debugging format.
3584 @item -ggdb
3585 @opindex ggdb
3586 Produce debugging information for use by GDB@.  This means to use the
3587 most expressive format available (DWARF 2, stabs, or the native format
3588 if neither of those are supported), including GDB extensions if at all
3589 possible.
3591 @item -gstabs
3592 @opindex gstabs
3593 Produce debugging information in stabs format (if that is supported),
3594 without GDB extensions.  This is the format used by DBX on most BSD
3595 systems.  On MIPS, Alpha and System V Release 4 systems this option
3596 produces stabs debugging output which is not understood by DBX or SDB@.
3597 On System V Release 4 systems this option requires the GNU assembler.
3599 @item -feliminate-unused-debug-symbols
3600 @opindex feliminate-unused-debug-symbols
3601 Produce debugging information in stabs format (if that is supported),
3602 for only symbols that are actually used.
3604 @item -femit-class-debug-always
3605 Instead of emitting debugging information for a C++ class in only one
3606 object file, emit it in all object files using the class.  This option
3607 should be used only with debuggers that are unable to handle the way GCC
3608 normally emits debugging information for classes because using this
3609 option will increase the size of debugging information by as much as a
3610 factor of two.
3612 @item -gstabs+
3613 @opindex gstabs+
3614 Produce debugging information in stabs format (if that is supported),
3615 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3616 use of these extensions is likely to make other debuggers crash or
3617 refuse to read the program.
3619 @item -gcoff
3620 @opindex gcoff
3621 Produce debugging information in COFF format (if that is supported).
3622 This is the format used by SDB on most System V systems prior to
3623 System V Release 4.
3625 @item -gxcoff
3626 @opindex gxcoff
3627 Produce debugging information in XCOFF format (if that is supported).
3628 This is the format used by the DBX debugger on IBM RS/6000 systems.
3630 @item -gxcoff+
3631 @opindex gxcoff+
3632 Produce debugging information in XCOFF format (if that is supported),
3633 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3634 use of these extensions is likely to make other debuggers crash or
3635 refuse to read the program, and may cause assemblers other than the GNU
3636 assembler (GAS) to fail with an error.
3638 @item -gdwarf-2
3639 @opindex gdwarf-2
3640 Produce debugging information in DWARF version 2 format (if that is
3641 supported).  This is the format used by DBX on IRIX 6.  With this
3642 option, GCC uses features of DWARF version 3 when they are useful;
3643 version 3 is upward compatible with version 2, but may still cause
3644 problems for older debuggers.
3646 @item -gvms
3647 @opindex gvms
3648 Produce debugging information in VMS debug format (if that is
3649 supported).  This is the format used by DEBUG on VMS systems.
3651 @item -g@var{level}
3652 @itemx -ggdb@var{level}
3653 @itemx -gstabs@var{level}
3654 @itemx -gcoff@var{level}
3655 @itemx -gxcoff@var{level}
3656 @itemx -gvms@var{level}
3657 Request debugging information and also use @var{level} to specify how
3658 much information.  The default level is 2.
3660 Level 1 produces minimal information, enough for making backtraces in
3661 parts of the program that you don't plan to debug.  This includes
3662 descriptions of functions and external variables, but no information
3663 about local variables and no line numbers.
3665 Level 3 includes extra information, such as all the macro definitions
3666 present in the program.  Some debuggers support macro expansion when
3667 you use @option{-g3}.
3669 @option{-gdwarf-2} does not accept a concatenated debug level, because
3670 GCC used to support an option @option{-gdwarf} that meant to generate
3671 debug information in version 1 of the DWARF format (which is very
3672 different from version 2), and it would have been too confusing.  That
3673 debug format is long obsolete, but the option cannot be changed now.
3674 Instead use an additional @option{-g@var{level}} option to change the
3675 debug level for DWARF2.
3677 @item -feliminate-dwarf2-dups
3678 @opindex feliminate-dwarf2-dups
3679 Compress DWARF2 debugging information by eliminating duplicated
3680 information about each symbol.  This option only makes sense when
3681 generating DWARF2 debugging information with @option{-gdwarf-2}.
3683 @cindex @command{prof}
3684 @item -p
3685 @opindex p
3686 Generate extra code to write profile information suitable for the
3687 analysis program @command{prof}.  You must use this option when compiling
3688 the source files you want data about, and you must also use it when
3689 linking.
3691 @cindex @command{gprof}
3692 @item -pg
3693 @opindex pg
3694 Generate extra code to write profile information suitable for the
3695 analysis program @command{gprof}.  You must use this option when compiling
3696 the source files you want data about, and you must also use it when
3697 linking.
3699 @item -Q
3700 @opindex Q
3701 Makes the compiler print out each function name as it is compiled, and
3702 print some statistics about each pass when it finishes.
3704 @item -ftime-report
3705 @opindex ftime-report
3706 Makes the compiler print some statistics about the time consumed by each
3707 pass when it finishes.
3709 @item -fmem-report
3710 @opindex fmem-report
3711 Makes the compiler print some statistics about permanent memory
3712 allocation when it finishes.
3714 @item -fprofile-arcs
3715 @opindex fprofile-arcs
3716 Add code so that program flow @dfn{arcs} are instrumented.  During
3717 execution the program records how many times each branch and call is
3718 executed and how many times it is taken or returns.  When the compiled
3719 program exits it saves this data to a file called
3720 @file{@var{auxname}.gcda} for each source file.  The data may be used for
3721 profile-directed optimizations (@option{-fbranch-probabilities}), or for
3722 test coverage analysis (@option{-ftest-coverage}).  Each object file's
3723 @var{auxname} is generated from the name of the output file, if
3724 explicitly specified and it is not the final executable, otherwise it is
3725 the basename of the source file.  In both cases any suffix is removed
3726 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
3727 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
3728 @xref{Cross-profiling}.
3730 @cindex @command{gcov}
3731 @item --coverage
3732 @opindex coverage
3734 This option is used to compile and link code instrumented for coverage
3735 analysis.  The option is a synonym for @option{-fprofile-arcs}
3736 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
3737 linking).  See the documentation for those options for more details.
3739 @itemize
3741 @item
3742 Compile the source files with @option{-fprofile-arcs} plus optimization
3743 and code generation options.  For test coverage analysis, use the
3744 additional @option{-ftest-coverage} option.  You do not need to profile
3745 every source file in a program.
3747 @item
3748 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
3749 (the latter implies the former).
3751 @item
3752 Run the program on a representative workload to generate the arc profile
3753 information.  This may be repeated any number of times.  You can run
3754 concurrent instances of your program, and provided that the file system
3755 supports locking, the data files will be correctly updated.  Also
3756 @code{fork} calls are detected and correctly handled (double counting
3757 will not happen).
3759 @item
3760 For profile-directed optimizations, compile the source files again with
3761 the same optimization and code generation options plus
3762 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
3763 Control Optimization}).
3765 @item
3766 For test coverage analysis, use @command{gcov} to produce human readable
3767 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
3768 @command{gcov} documentation for further information.
3770 @end itemize
3772 With @option{-fprofile-arcs}, for each function of your program GCC
3773 creates a program flow graph, then finds a spanning tree for the graph.
3774 Only arcs that are not on the spanning tree have to be instrumented: the
3775 compiler adds code to count the number of times that these arcs are
3776 executed.  When an arc is the only exit or only entrance to a block, the
3777 instrumentation code can be added to the block; otherwise, a new basic
3778 block must be created to hold the instrumentation code.
3780 @need 2000
3781 @item -ftest-coverage
3782 @opindex ftest-coverage
3783 Produce a notes file that the @command{gcov} code-coverage utility
3784 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
3785 show program coverage.  Each source file's note file is called
3786 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
3787 above for a description of @var{auxname} and instructions on how to
3788 generate test coverage data.  Coverage data will match the source files
3789 more closely, if you do not optimize.
3791 @item -d@var{letters}
3792 @item -fdump-rtl-@var{pass}
3793 @opindex d
3794 Says to make debugging dumps during compilation at times specified by
3795 @var{letters}.    This is used for debugging the RTL-based passes of the
3796 compiler.  The file names for most of the dumps are made by appending a
3797 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
3798 from the name of the output file, if explicitly specified and it is not
3799 an executable, otherwise it is the basename of the source file.
3801 Most debug dumps can be enabled either passing a letter to the @option{-d}
3802 option, or with a long @option{-fdump-rtl} switch; here are the possible
3803 letters for use in @var{letters} and @var{pass}, and their meanings:
3805 @table @gcctabopt
3806 @item -dA
3807 @opindex dA
3808 Annotate the assembler output with miscellaneous debugging information.
3810 @item -dB
3811 @itemx -fdump-rtl-bbro
3812 @opindex dB
3813 @opindex fdump-rtl-bbro
3814 Dump after block reordering, to @file{@var{file}.148r.bbro}.
3816 @item -dc
3817 @itemx -fdump-rtl-combine
3818 @opindex dc
3819 @opindex fdump-rtl-combine
3820 Dump after instruction combination, to the file @file{@var{file}.129r.combine}.
3822 @item -dC
3823 @itemx -fdump-rtl-ce1
3824 @itemx -fdump-rtl-ce2
3825 @opindex dC
3826 @opindex fdump-rtl-ce1
3827 @opindex fdump-rtl-ce2
3828 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
3829 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
3830 and @option{-fdump-rtl-ce2} enable dumping after the second if
3831 conversion, to the file @file{@var{file}.130r.ce2}.
3833 @item -dd
3834 @itemx -fdump-rtl-btl
3835 @itemx -fdump-rtl-dbr
3836 @opindex dd
3837 @opindex fdump-rtl-btl
3838 @opindex fdump-rtl-dbr
3839 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
3840 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
3841 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
3842 scheduling, to @file{@var{file}.36.dbr}.
3844 @item -dD
3845 @opindex dD
3846 Dump all macro definitions, at the end of preprocessing, in addition to
3847 normal output.
3849 @item -dE
3850 @itemx -fdump-rtl-ce3
3851 @opindex dE
3852 @opindex fdump-rtl-ce3
3853 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
3855 @item -df
3856 @itemx -fdump-rtl-cfg
3857 @itemx -fdump-rtl-life
3858 @opindex df
3859 @opindex fdump-rtl-cfg
3860 @opindex fdump-rtl-life
3861 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
3862 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
3863 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
3864 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
3866 @item -dg
3867 @itemx -fdump-rtl-greg
3868 @opindex dg
3869 @opindex fdump-rtl-greg
3870 Dump after global register allocation, to @file{@var{file}.139r.greg}.
3872 @item -dG
3873 @itemx -fdump-rtl-gcse
3874 @itemx -fdump-rtl-bypass
3875 @opindex dG
3876 @opindex fdump-rtl-gcse
3877 @opindex fdump-rtl-bypass
3878 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
3879 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
3880 enable dumping after jump bypassing and control flow optimizations, to
3881 @file{@var{file}.115r.bypass}.
3883 @item -dh
3884 @itemx -fdump-rtl-eh
3885 @opindex dh
3886 @opindex fdump-rtl-eh
3887 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
3889 @item -di
3890 @itemx -fdump-rtl-sibling
3891 @opindex di
3892 @opindex fdump-rtl-sibling
3893 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
3895 @item -dj
3896 @itemx -fdump-rtl-jump
3897 @opindex dj
3898 @opindex fdump-rtl-jump
3899 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
3901 @item -dk
3902 @itemx -fdump-rtl-stack
3903 @opindex dk
3904 @opindex fdump-rtl-stack
3905 Dump after conversion from registers to stack, to @file{@var{file}.152r.stack}.
3907 @item -dl
3908 @itemx -fdump-rtl-lreg
3909 @opindex dl
3910 @opindex fdump-rtl-lreg
3911 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
3913 @item -dL
3914 @itemx -fdump-rtl-loop2
3915 @opindex dL
3916 @opindex fdump-rtl-loop2
3917 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
3918 loop optimization pass, to @file{@var{file}.119r.loop2},
3919 @file{@var{file}.120r.loop2_init},
3920 @file{@var{file}.121r.loop2_invariant}, and
3921 @file{@var{file}.125r.loop2_done}.
3923 @item -dm
3924 @itemx -fdump-rtl-sms
3925 @opindex dm
3926 @opindex fdump-rtl-sms
3927 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
3929 @item -dM
3930 @itemx -fdump-rtl-mach
3931 @opindex dM
3932 @opindex fdump-rtl-mach
3933 Dump after performing the machine dependent reorganization pass, to
3934 @file{@var{file}.155r.mach}.
3936 @item -dn
3937 @itemx -fdump-rtl-rnreg
3938 @opindex dn
3939 @opindex fdump-rtl-rnreg
3940 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
3942 @item -dN
3943 @itemx -fdump-rtl-regmove
3944 @opindex dN
3945 @opindex fdump-rtl-regmove
3946 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
3948 @item -do
3949 @itemx -fdump-rtl-postreload
3950 @opindex do
3951 @opindex fdump-rtl-postreload
3952 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
3954 @item -dr
3955 @itemx -fdump-rtl-expand
3956 @opindex dr
3957 @opindex fdump-rtl-expand
3958 Dump after RTL generation, to @file{@var{file}.104r.expand}.
3960 @item -dR
3961 @itemx -fdump-rtl-sched2
3962 @opindex dR
3963 @opindex fdump-rtl-sched2
3964 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
3966 @item -ds
3967 @itemx -fdump-rtl-cse
3968 @opindex ds
3969 @opindex fdump-rtl-cse
3970 Dump after CSE (including the jump optimization that sometimes follows
3971 CSE), to @file{@var{file}.113r.cse}.
3973 @item -dS
3974 @itemx -fdump-rtl-sched1
3975 @opindex dS
3976 @opindex fdump-rtl-sched1
3977 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
3979 @item -dt
3980 @itemx -fdump-rtl-cse2
3981 @opindex dt
3982 @opindex fdump-rtl-cse2
3983 Dump after the second CSE pass (including the jump optimization that
3984 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
3986 @item -dT
3987 @itemx -fdump-rtl-tracer
3988 @opindex dT
3989 @opindex fdump-rtl-tracer
3990 Dump after running tracer, to @file{@var{file}.118r.tracer}.
3992 @item -dV
3993 @itemx -fdump-rtl-vpt
3994 @itemx -fdump-rtl-vartrack
3995 @opindex dV
3996 @opindex fdump-rtl-vpt
3997 @opindex fdump-rtl-vartrack
3998 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
3999 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4000 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4001 to @file{@var{file}.154r.vartrack}.
4003 @item -dw
4004 @itemx -fdump-rtl-flow2
4005 @opindex dw
4006 @opindex fdump-rtl-flow2
4007 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4009 @item -dz
4010 @itemx -fdump-rtl-peephole2
4011 @opindex dz
4012 @opindex fdump-rtl-peephole2
4013 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4015 @item -dZ
4016 @itemx -fdump-rtl-web
4017 @opindex dZ
4018 @opindex fdump-rtl-web
4019 Dump after live range splitting, to @file{@var{file}.126r.web}.
4021 @item -da
4022 @itemx -fdump-rtl-all
4023 @opindex da
4024 @opindex fdump-rtl-all
4025 Produce all the dumps listed above.
4027 @item -dH
4028 @opindex dH
4029 Produce a core dump whenever an error occurs.
4031 @item -dm
4032 @opindex dm
4033 Print statistics on memory usage, at the end of the run, to
4034 standard error.
4036 @item -dp
4037 @opindex dp
4038 Annotate the assembler output with a comment indicating which
4039 pattern and alternative was used.  The length of each instruction is
4040 also printed.
4042 @item -dP
4043 @opindex dP
4044 Dump the RTL in the assembler output as a comment before each instruction.
4045 Also turns on @option{-dp} annotation.
4047 @item -dv
4048 @opindex dv
4049 For each of the other indicated dump files (either with @option{-d} or
4050 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4051 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4053 @item -dx
4054 @opindex dx
4055 Just generate RTL for a function instead of compiling it.  Usually used
4056 with @samp{r} (@option{-fdump-rtl-expand}).
4058 @item -dy
4059 @opindex dy
4060 Dump debugging information during parsing, to standard error.
4061 @end table
4063 @item -fdump-noaddr
4064 @opindex fdump-noaddr
4065 When doing debugging dumps (see @option{-d} option above), suppress
4066 address output.  This makes it more feasible to use diff on debugging
4067 dumps for compiler invocations with different compiler binaries and/or
4068 different text / bss / data / heap / stack / dso start locations.
4070 @item -fdump-unnumbered
4071 @opindex fdump-unnumbered
4072 When doing debugging dumps (see @option{-d} option above), suppress instruction
4073 numbers, line number note and address output.  This makes it more feasible to
4074 use diff on debugging dumps for compiler invocations with different
4075 options, in particular with and without @option{-g}.
4077 @item -fdump-translation-unit @r{(C++ only)}
4078 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4079 @opindex fdump-translation-unit
4080 Dump a representation of the tree structure for the entire translation
4081 unit to a file.  The file name is made by appending @file{.tu} to the
4082 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4083 controls the details of the dump as described for the
4084 @option{-fdump-tree} options.
4086 @item -fdump-class-hierarchy @r{(C++ only)}
4087 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4088 @opindex fdump-class-hierarchy
4089 Dump a representation of each class's hierarchy and virtual function
4090 table layout to a file.  The file name is made by appending @file{.class}
4091 to the source file name.  If the @samp{-@var{options}} form is used,
4092 @var{options} controls the details of the dump as described for the
4093 @option{-fdump-tree} options.
4095 @item -fdump-ipa-@var{switch}
4096 @opindex fdump-ipa
4097 Control the dumping at various stages of inter-procedural analysis
4098 language tree to a file.  The file name is generated by appending a switch
4099 specific suffix to the source file name.  The following dumps are possible:
4101 @table @samp
4102 @item all
4103 Enables all inter-procedural analysis dumps; currently the only produced
4104 dump is the @samp{cgraph} dump.
4106 @item cgraph
4107 Dumps information about call-graph optimization, unused function removal,
4108 and inlining decisions.
4109 @end table
4111 @item -fdump-tree-@var{switch}
4112 @itemx -fdump-tree-@var{switch}-@var{options}
4113 @opindex fdump-tree
4114 Control the dumping at various stages of processing the intermediate
4115 language tree to a file.  The file name is generated by appending a switch
4116 specific suffix to the source file name.  If the @samp{-@var{options}}
4117 form is used, @var{options} is a list of @samp{-} separated options that
4118 control the details of the dump.  Not all options are applicable to all
4119 dumps, those which are not meaningful will be ignored.  The following
4120 options are available
4122 @table @samp
4123 @item address
4124 Print the address of each node.  Usually this is not meaningful as it
4125 changes according to the environment and source file.  Its primary use
4126 is for tying up a dump file with a debug environment.
4127 @item slim
4128 Inhibit dumping of members of a scope or body of a function merely
4129 because that scope has been reached.  Only dump such items when they
4130 are directly reachable by some other path.  When dumping pretty-printed
4131 trees, this option inhibits dumping the bodies of control structures.
4132 @item raw
4133 Print a raw representation of the tree.  By default, trees are
4134 pretty-printed into a C-like representation.
4135 @item details
4136 Enable more detailed dumps (not honored by every dump option).
4137 @item stats
4138 Enable dumping various statistics about the pass (not honored by every dump
4139 option).
4140 @item blocks
4141 Enable showing basic block boundaries (disabled in raw dumps).
4142 @item vops
4143 Enable showing virtual operands for every statement.
4144 @item lineno
4145 Enable showing line numbers for statements.
4146 @item uid
4147 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4148 @item all
4149 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4150 @end table
4152 The following tree dumps are possible:
4153 @table @samp
4155 @item original
4156 Dump before any tree based optimization, to @file{@var{file}.original}.
4158 @item optimized
4159 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4161 @item inlined
4162 Dump after function inlining, to @file{@var{file}.inlined}.
4164 @item gimple
4165 @opindex fdump-tree-gimple
4166 Dump each function before and after the gimplification pass to a file.  The
4167 file name is made by appending @file{.gimple} to the source file name.
4169 @item cfg
4170 @opindex fdump-tree-cfg
4171 Dump the control flow graph of each function to a file.  The file name is
4172 made by appending @file{.cfg} to the source file name.
4174 @item vcg
4175 @opindex fdump-tree-vcg
4176 Dump the control flow graph of each function to a file in VCG format.  The
4177 file name is made by appending @file{.vcg} to the source file name.  Note
4178 that if the file contains more than one function, the generated file cannot
4179 be used directly by VCG@.  You will need to cut and paste each function's
4180 graph into its own separate file first.
4182 @item ch
4183 @opindex fdump-tree-ch
4184 Dump each function after copying loop headers.  The file name is made by
4185 appending @file{.ch} to the source file name.
4187 @item ssa
4188 @opindex fdump-tree-ssa
4189 Dump SSA related information to a file.  The file name is made by appending
4190 @file{.ssa} to the source file name.
4192 @item salias
4193 @opindex fdump-tree-salias
4194 Dump structure aliasing variable information to a file.  This file name
4195 is made by appending @file{.salias} to the source file name.
4197 @item alias
4198 @opindex fdump-tree-alias
4199 Dump aliasing information for each function.  The file name is made by
4200 appending @file{.alias} to the source file name.
4202 @item ccp
4203 @opindex fdump-tree-ccp
4204 Dump each function after CCP@.  The file name is made by appending
4205 @file{.ccp} to the source file name.
4207 @item storeccp
4208 @opindex fdump-tree-storeccp
4209 Dump each function after STORE-CCP.  The file name is made by appending
4210 @file{.storeccp} to the source file name.
4212 @item pre
4213 @opindex fdump-tree-pre
4214 Dump trees after partial redundancy elimination.  The file name is made
4215 by appending @file{.pre} to the source file name.
4217 @item fre
4218 @opindex fdump-tree-fre
4219 Dump trees after full redundancy elimination.  The file name is made
4220 by appending @file{.fre} to the source file name.
4222 @item copyprop
4223 @opindex fdump-tree-copyprop
4224 Dump trees after copy propagation.  The file name is made
4225 by appending @file{.copyprop} to the source file name.
4227 @item store_copyprop
4228 @opindex fdump-tree-store_copyprop
4229 Dump trees after store copy-propagation.  The file name is made
4230 by appending @file{.store_copyprop} to the source file name.
4232 @item dce
4233 @opindex fdump-tree-dce
4234 Dump each function after dead code elimination.  The file name is made by
4235 appending @file{.dce} to the source file name.
4237 @item mudflap
4238 @opindex fdump-tree-mudflap
4239 Dump each function after adding mudflap instrumentation.  The file name is
4240 made by appending @file{.mudflap} to the source file name.
4242 @item sra
4243 @opindex fdump-tree-sra
4244 Dump each function after performing scalar replacement of aggregates.  The
4245 file name is made by appending @file{.sra} to the source file name.
4247 @item sink
4248 @opindex fdump-tree-sink
4249 Dump each function after performing code sinking.  The file name is made
4250 by appending @file{.sink} to the source file name. 
4252 @item dom
4253 @opindex fdump-tree-dom
4254 Dump each function after applying dominator tree optimizations.  The file
4255 name is made by appending @file{.dom} to the source file name.
4257 @item dse
4258 @opindex fdump-tree-dse
4259 Dump each function after applying dead store elimination.  The file
4260 name is made by appending @file{.dse} to the source file name.
4262 @item phiopt
4263 @opindex fdump-tree-phiopt
4264 Dump each function after optimizing PHI nodes into straightline code.  The file
4265 name is made by appending @file{.phiopt} to the source file name.
4267 @item forwprop
4268 @opindex fdump-tree-forwprop
4269 Dump each function after forward propagating single use variables.  The file
4270 name is made by appending @file{.forwprop} to the source file name.
4272 @item copyrename
4273 @opindex fdump-tree-copyrename
4274 Dump each function after applying the copy rename optimization.  The file
4275 name is made by appending @file{.copyrename} to the source file name.
4277 @item nrv
4278 @opindex fdump-tree-nrv
4279 Dump each function after applying the named return value optimization on
4280 generic trees.  The file name is made by appending @file{.nrv} to the source
4281 file name.
4283 @item vect
4284 @opindex fdump-tree-vect
4285 Dump each function after applying vectorization of loops.  The file name is
4286 made by appending @file{.vect} to the source file name.
4288 @item vrp
4289 @opindex fdump-tree-vrp
4290 Dump each function after Value Range Propagation (VRP).  The file name
4291 is made by appending @file{.vrp} to the source file name.
4293 @item all
4294 @opindex fdump-tree-all
4295 Enable all the available tree dumps with the flags provided in this option.
4296 @end table
4298 @item -ftree-vectorizer-verbose=@var{n}
4299 @opindex ftree-vectorizer-verbose
4300 This option controls the amount of debugging output the vectorizer prints.
4301 This information is written to standard error, unless 
4302 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified, 
4303 in which case it is output to the usual dump listing file, @file{.vect}.
4304 For @var{n}=0 no diagnostic information is reported.
4305 If @var{n}=1 the vectorizer reports each loop that got vectorized, 
4306 and the total number of loops that got vectorized.
4307 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed 
4308 the first analysis phase (vect_analyze_loop_form) - i.e. countable, 
4309 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity 
4310 level that @option{-fdump-tree-vect-stats} uses.
4311 Higher verbosity levels mean either more information dumped for each 
4312 reported loop, or same amount of information reported for more loops:
4313 If @var{n}=3, alignment related information is added to the reports.
4314 If @var{n}=4, data-references related information (e.g. memory dependences, 
4315 memory access-patterns) is added to the reports.
4316 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops 
4317 that did not pass the first analysis phase (i.e. may not be countable, or 
4318 may have complicated control-flow).
4319 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4320 For @var{n}=7, all the information the vectorizer generates during its 
4321 analysis and transformation is reported.  This is the same verbosity level
4322 that @option{-fdump-tree-vect-details} uses.
4324 @item -frandom-seed=@var{string}
4325 @opindex frandom-string
4326 This option provides a seed that GCC uses when it would otherwise use
4327 random numbers.  It is used to generate certain symbol names
4328 that have to be different in every compiled file.  It is also used to
4329 place unique stamps in coverage data files and the object files that
4330 produce them.  You can use the @option{-frandom-seed} option to produce
4331 reproducibly identical object files.
4333 The @var{string} should be different for every file you compile.
4335 @item -fsched-verbose=@var{n}
4336 @opindex fsched-verbose
4337 On targets that use instruction scheduling, this option controls the
4338 amount of debugging output the scheduler prints.  This information is
4339 written to standard error, unless @option{-dS} or @option{-dR} is
4340 specified, in which case it is output to the usual dump
4341 listing file, @file{.sched} or @file{.sched2} respectively.  However
4342 for @var{n} greater than nine, the output is always printed to standard
4343 error.
4345 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4346 same information as @option{-dRS}.  For @var{n} greater than one, it
4347 also output basic block probabilities, detailed ready list information
4348 and unit/insn info.  For @var{n} greater than two, it includes RTL
4349 at abort point, control-flow and regions info.  And for @var{n} over
4350 four, @option{-fsched-verbose} also includes dependence info.
4352 @item -save-temps
4353 @opindex save-temps
4354 Store the usual ``temporary'' intermediate files permanently; place them
4355 in the current directory and name them based on the source file.  Thus,
4356 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4357 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4358 preprocessed @file{foo.i} output file even though the compiler now
4359 normally uses an integrated preprocessor.
4361 When used in combination with the @option{-x} command line option,
4362 @option{-save-temps} is sensible enough to avoid over writing an
4363 input source file with the same extension as an intermediate file.
4364 The corresponding intermediate file may be obtained by renaming the
4365 source file before using @option{-save-temps}.
4367 @item -time
4368 @opindex time
4369 Report the CPU time taken by each subprocess in the compilation
4370 sequence.  For C source files, this is the compiler proper and assembler
4371 (plus the linker if linking is done).  The output looks like this:
4373 @smallexample
4374 # cc1 0.12 0.01
4375 # as 0.00 0.01
4376 @end smallexample
4378 The first number on each line is the ``user time'', that is time spent
4379 executing the program itself.  The second number is ``system time'',
4380 time spent executing operating system routines on behalf of the program.
4381 Both numbers are in seconds.
4383 @item -fvar-tracking
4384 @opindex fvar-tracking
4385 Run variable tracking pass.  It computes where variables are stored at each
4386 position in code.  Better debugging information is then generated
4387 (if the debugging information format supports this information).
4389 It is enabled by default when compiling with optimization (@option{-Os},
4390 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4391 the debug info format supports it.
4393 @item -print-file-name=@var{library}
4394 @opindex print-file-name
4395 Print the full absolute name of the library file @var{library} that
4396 would be used when linking---and don't do anything else.  With this
4397 option, GCC does not compile or link anything; it just prints the
4398 file name.
4400 @item -print-multi-directory
4401 @opindex print-multi-directory
4402 Print the directory name corresponding to the multilib selected by any
4403 other switches present in the command line.  This directory is supposed
4404 to exist in @env{GCC_EXEC_PREFIX}.
4406 @item -print-multi-lib
4407 @opindex print-multi-lib
4408 Print the mapping from multilib directory names to compiler switches
4409 that enable them.  The directory name is separated from the switches by
4410 @samp{;}, and each switch starts with an @samp{@@} instead of the
4411 @samp{-}, without spaces between multiple switches.  This is supposed to
4412 ease shell-processing.
4414 @item -print-prog-name=@var{program}
4415 @opindex print-prog-name
4416 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4418 @item -print-libgcc-file-name
4419 @opindex print-libgcc-file-name
4420 Same as @option{-print-file-name=libgcc.a}.
4422 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4423 but you do want to link with @file{libgcc.a}.  You can do
4425 @smallexample
4426 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4427 @end smallexample
4429 @item -print-search-dirs
4430 @opindex print-search-dirs
4431 Print the name of the configured installation directory and a list of
4432 program and library directories @command{gcc} will search---and don't do anything else.
4434 This is useful when @command{gcc} prints the error message
4435 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4436 To resolve this you either need to put @file{cpp0} and the other compiler
4437 components where @command{gcc} expects to find them, or you can set the environment
4438 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4439 Don't forget the trailing @samp{/}.
4440 @xref{Environment Variables}.
4442 @item -dumpmachine
4443 @opindex dumpmachine
4444 Print the compiler's target machine (for example,
4445 @samp{i686-pc-linux-gnu})---and don't do anything else.
4447 @item -dumpversion
4448 @opindex dumpversion
4449 Print the compiler version (for example, @samp{3.0})---and don't do
4450 anything else.
4452 @item -dumpspecs
4453 @opindex dumpspecs
4454 Print the compiler's built-in specs---and don't do anything else.  (This
4455 is used when GCC itself is being built.)  @xref{Spec Files}.
4457 @item -feliminate-unused-debug-types
4458 @opindex feliminate-unused-debug-types
4459 Normally, when producing DWARF2 output, GCC will emit debugging
4460 information for all types declared in a compilation
4461 unit, regardless of whether or not they are actually used
4462 in that compilation unit.  Sometimes this is useful, such as
4463 if, in the debugger, you want to cast a value to a type that is
4464 not actually used in your program (but is declared).  More often,
4465 however, this results in a significant amount of wasted space.
4466 With this option, GCC will avoid producing debug symbol output
4467 for types that are nowhere used in the source file being compiled.
4468 @end table
4470 @node Optimize Options
4471 @section Options That Control Optimization
4472 @cindex optimize options
4473 @cindex options, optimization
4475 These options control various sorts of optimizations.
4477 Without any optimization option, the compiler's goal is to reduce the
4478 cost of compilation and to make debugging produce the expected
4479 results.  Statements are independent: if you stop the program with a
4480 breakpoint between statements, you can then assign a new value to any
4481 variable or change the program counter to any other statement in the
4482 function and get exactly the results you would expect from the source
4483 code.
4485 Turning on optimization flags makes the compiler attempt to improve
4486 the performance and/or code size at the expense of compilation time
4487 and possibly the ability to debug the program.
4489 The compiler performs optimization based on the knowledge it has of
4490 the program.  Optimization levels @option{-O} and above, in
4491 particular, enable @emph{unit-at-a-time} mode, which allows the
4492 compiler to consider information gained from later functions in
4493 the file when compiling a function.  Compiling multiple files at
4494 once to a single output file in @emph{unit-at-a-time} mode allows
4495 the compiler to use information gained from all of the files when
4496 compiling each of them.
4498 Not all optimizations are controlled directly by a flag.  Only
4499 optimizations that have a flag are listed.
4501 @table @gcctabopt
4502 @item -O
4503 @itemx -O1
4504 @opindex O
4505 @opindex O1
4506 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4507 more memory for a large function.
4509 With @option{-O}, the compiler tries to reduce code size and execution
4510 time, without performing any optimizations that take a great deal of
4511 compilation time.
4513 @option{-O} turns on the following optimization flags:
4514 @gccoptlist{-fdefer-pop @gol
4515 -fdelayed-branch @gol
4516 -fguess-branch-probability @gol
4517 -fcprop-registers @gol
4518 -fif-conversion @gol
4519 -fif-conversion2 @gol
4520 -ftree-ccp @gol
4521 -ftree-dce @gol
4522 -ftree-dominator-opts @gol
4523 -ftree-dse @gol
4524 -ftree-ter @gol
4525 -ftree-lrs @gol
4526 -ftree-sra @gol
4527 -ftree-copyrename @gol
4528 -ftree-fre @gol
4529 -ftree-ch @gol
4530 -funit-at-a-time @gol
4531 -fmerge-constants}
4533 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4534 where doing so does not interfere with debugging.
4536 @item -O2
4537 @opindex O2
4538 Optimize even more.  GCC performs nearly all supported optimizations
4539 that do not involve a space-speed tradeoff.  The compiler does not
4540 perform loop unrolling or function inlining when you specify @option{-O2}.
4541 As compared to @option{-O}, this option increases both compilation time
4542 and the performance of the generated code.
4544 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4545 also turns on the following optimization flags:
4546 @gccoptlist{-fthread-jumps @gol
4547 -fcrossjumping @gol
4548 -foptimize-sibling-calls @gol
4549 -fcse-follow-jumps  -fcse-skip-blocks @gol
4550 -fgcse  -fgcse-lm  @gol
4551 -fexpensive-optimizations @gol
4552 -frerun-cse-after-loop  @gol
4553 -fcaller-saves @gol
4554 -fpeephole2 @gol
4555 -fschedule-insns  -fschedule-insns2 @gol
4556 -fsched-interblock  -fsched-spec @gol
4557 -fregmove @gol
4558 -fstrict-aliasing @gol
4559 -fdelete-null-pointer-checks @gol
4560 -freorder-blocks  -freorder-functions @gol
4561 -falign-functions  -falign-jumps @gol
4562 -falign-loops  -falign-labels @gol
4563 -ftree-vrp @gol
4564 -ftree-pre}
4566 Please note the warning under @option{-fgcse} about
4567 invoking @option{-O2} on programs that use computed gotos.
4569 @item -O3
4570 @opindex O3
4571 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4572 @option{-O2} and also turns on the @option{-finline-functions},
4573 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4575 @item -O0
4576 @opindex O0
4577 Do not optimize.  This is the default.
4579 @item -Os
4580 @opindex Os
4581 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4582 do not typically increase code size.  It also performs further
4583 optimizations designed to reduce code size.
4585 @option{-Os} disables the following optimization flags:
4586 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4587 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
4588 -fprefetch-loop-arrays  -ftree-vect-loop-version}
4590 If you use multiple @option{-O} options, with or without level numbers,
4591 the last such option is the one that is effective.
4592 @end table
4594 Options of the form @option{-f@var{flag}} specify machine-independent
4595 flags.  Most flags have both positive and negative forms; the negative
4596 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4597 below, only one of the forms is listed---the one you typically will
4598 use.  You can figure out the other form by either removing @samp{no-}
4599 or adding it.
4601 The following options control specific optimizations.  They are either
4602 activated by @option{-O} options or are related to ones that are.  You
4603 can use the following flags in the rare cases when ``fine-tuning'' of
4604 optimizations to be performed is desired.
4606 @table @gcctabopt
4607 @item -fno-default-inline
4608 @opindex fno-default-inline
4609 Do not make member functions inline by default merely because they are
4610 defined inside the class scope (C++ only).  Otherwise, when you specify
4611 @w{@option{-O}}, member functions defined inside class scope are compiled
4612 inline by default; i.e., you don't need to add @samp{inline} in front of
4613 the member function name.
4615 @item -fno-defer-pop
4616 @opindex fno-defer-pop
4617 Always pop the arguments to each function call as soon as that function
4618 returns.  For machines which must pop arguments after a function call,
4619 the compiler normally lets arguments accumulate on the stack for several
4620 function calls and pops them all at once.
4622 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4624 @item -fforce-mem
4625 @opindex fforce-mem
4626 Force memory operands to be copied into registers before doing
4627 arithmetic on them.  This produces better code by making all memory
4628 references potential common subexpressions.  When they are not common
4629 subexpressions, instruction combination should eliminate the separate
4630 register-load. This option is now a nop and will be removed in 4.2.
4632 @item -fforce-addr
4633 @opindex fforce-addr
4634 Force memory address constants to be copied into registers before
4635 doing arithmetic on them.
4637 @item -fforward-propagate
4638 @opindex fforward-propagate
4639 Perform a forward propagation pass on RTL.  The pass tries to combine two
4640 instructions and checks if the result can be simplified.  If loop unrolling
4641 is active, two passes are performed and the second is scheduled after
4642 loop unrolling.
4644 This option is enabled by default at optimization levels @option{-O2},
4645 @option{-O3}, @option{-Os}.
4647 @item -fomit-frame-pointer
4648 @opindex fomit-frame-pointer
4649 Don't keep the frame pointer in a register for functions that
4650 don't need one.  This avoids the instructions to save, set up and
4651 restore frame pointers; it also makes an extra register available
4652 in many functions.  @strong{It also makes debugging impossible on
4653 some machines.}
4655 On some machines, such as the VAX, this flag has no effect, because
4656 the standard calling sequence automatically handles the frame pointer
4657 and nothing is saved by pretending it doesn't exist.  The
4658 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4659 whether a target machine supports this flag.  @xref{Registers,,Register
4660 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4662 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4664 @item -foptimize-sibling-calls
4665 @opindex foptimize-sibling-calls
4666 Optimize sibling and tail recursive calls.
4668 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4670 @item -fno-inline
4671 @opindex fno-inline
4672 Don't pay attention to the @code{inline} keyword.  Normally this option
4673 is used to keep the compiler from expanding any functions inline.
4674 Note that if you are not optimizing, no functions can be expanded inline.
4676 @item -finline-functions
4677 @opindex finline-functions
4678 Integrate all simple functions into their callers.  The compiler
4679 heuristically decides which functions are simple enough to be worth
4680 integrating in this way.
4682 If all calls to a given function are integrated, and the function is
4683 declared @code{static}, then the function is normally not output as
4684 assembler code in its own right.
4686 Enabled at level @option{-O3}.
4688 @item -finline-functions-called-once
4689 @opindex finline-functions-called-once
4690 Consider all @code{static} functions called once for inlining into their
4691 caller even if they are not marked @code{inline}.  If a call to a given
4692 function is integrated, then the function is not output as assembler code
4693 in its own right.
4695 Enabled if @option{-funit-at-a-time} is enabled.
4697 @item -fearly-inlining
4698 @opindex fearly-inlining
4699 Inline functions marked by @code{always_inline} and functions whose body seems
4700 smaller than the function call overhead early before doing
4701 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4702 makes profiling significantly cheaper and usually inlining faster on programs
4703 having large chains of nested wrapper functions.
4705 Enabled by default.
4707 @item -finline-limit=@var{n}
4708 @opindex finline-limit
4709 By default, GCC limits the size of functions that can be inlined.  This flag
4710 allows the control of this limit for functions that are explicitly marked as
4711 inline (i.e., marked with the inline keyword or defined within the class
4712 definition in c++).  @var{n} is the size of functions that can be inlined in
4713 number of pseudo instructions (not counting parameter handling).  The default
4714 value of @var{n} is 600.
4715 Increasing this value can result in more inlined code at
4716 the cost of compilation time and memory consumption.  Decreasing usually makes
4717 the compilation faster and less code will be inlined (which presumably
4718 means slower programs).  This option is particularly useful for programs that
4719 use inlining heavily such as those based on recursive templates with C++.
4721 Inlining is actually controlled by a number of parameters, which may be
4722 specified individually by using @option{--param @var{name}=@var{value}}.
4723 The @option{-finline-limit=@var{n}} option sets some of these parameters
4724 as follows:
4726 @table @gcctabopt
4727 @item max-inline-insns-single
4728  is set to @var{n}/2.
4729 @item max-inline-insns-auto
4730  is set to @var{n}/2.
4731 @item min-inline-insns
4732  is set to 130 or @var{n}/4, whichever is smaller.
4733 @item max-inline-insns-rtl
4734  is set to @var{n}.
4735 @end table
4737 See below for a documentation of the individual
4738 parameters controlling inlining.
4740 @emph{Note:} pseudo instruction represents, in this particular context, an
4741 abstract measurement of function's size.  In no way does it represent a count
4742 of assembly instructions and as such its exact meaning might change from one
4743 release to an another.
4745 @item -fkeep-inline-functions
4746 @opindex fkeep-inline-functions
4747 In C, emit @code{static} functions that are declared @code{inline}
4748 into the object file, even if the function has been inlined into all
4749 of its callers.  This switch does not affect functions using the
4750 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
4751 inline functions into the object file.
4753 @item -fkeep-static-consts
4754 @opindex fkeep-static-consts
4755 Emit variables declared @code{static const} when optimization isn't turned
4756 on, even if the variables aren't referenced.
4758 GCC enables this option by default.  If you want to force the compiler to
4759 check if the variable was referenced, regardless of whether or not
4760 optimization is turned on, use the @option{-fno-keep-static-consts} option.
4762 @item -fmerge-constants
4763 Attempt to merge identical constants (string constants and floating point
4764 constants) across compilation units.
4766 This option is the default for optimized compilation if the assembler and
4767 linker support it.  Use @option{-fno-merge-constants} to inhibit this
4768 behavior.
4770 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4772 @item -fmerge-all-constants
4773 Attempt to merge identical constants and identical variables.
4775 This option implies @option{-fmerge-constants}.  In addition to
4776 @option{-fmerge-constants} this considers e.g.@: even constant initialized
4777 arrays or initialized constant variables with integral or floating point
4778 types.  Languages like C or C++ require each non-automatic variable to
4779 have distinct location, so using this option will result in non-conforming
4780 behavior.
4782 @item -fmodulo-sched
4783 @opindex fmodulo-sched
4784 Perform swing modulo scheduling immediately before the first scheduling
4785 pass.  This pass looks at innermost loops and reorders their
4786 instructions by overlapping different iterations.
4788 @item -fno-branch-count-reg
4789 @opindex fno-branch-count-reg
4790 Do not use ``decrement and branch'' instructions on a count register,
4791 but instead generate a sequence of instructions that decrement a
4792 register, compare it against zero, then branch based upon the result.
4793 This option is only meaningful on architectures that support such
4794 instructions, which include x86, PowerPC, IA-64 and S/390.
4796 The default is @option{-fbranch-count-reg}.
4798 @item -fno-function-cse
4799 @opindex fno-function-cse
4800 Do not put function addresses in registers; make each instruction that
4801 calls a constant function contain the function's address explicitly.
4803 This option results in less efficient code, but some strange hacks
4804 that alter the assembler output may be confused by the optimizations
4805 performed when this option is not used.
4807 The default is @option{-ffunction-cse}
4809 @item -fno-zero-initialized-in-bss
4810 @opindex fno-zero-initialized-in-bss
4811 If the target supports a BSS section, GCC by default puts variables that
4812 are initialized to zero into BSS@.  This can save space in the resulting
4813 code.
4815 This option turns off this behavior because some programs explicitly
4816 rely on variables going to the data section.  E.g., so that the
4817 resulting executable can find the beginning of that section and/or make
4818 assumptions based on that.
4820 The default is @option{-fzero-initialized-in-bss}.
4822 @item -fbounds-check
4823 @opindex fbounds-check
4824 For front-ends that support it, generate additional code to check that
4825 indices used to access arrays are within the declared range.  This is
4826 currently only supported by the Java and Fortran front-ends, where
4827 this option defaults to true and false respectively.
4829 @item -fmudflap -fmudflapth -fmudflapir
4830 @opindex fmudflap
4831 @opindex fmudflapth
4832 @opindex fmudflapir
4833 @cindex bounds checking
4834 @cindex mudflap
4835 For front-ends that support it (C and C++), instrument all risky
4836 pointer/array dereferencing operations, some standard library
4837 string/heap functions, and some other associated constructs with
4838 range/validity tests.  Modules so instrumented should be immune to
4839 buffer overflows, invalid heap use, and some other classes of C/C++
4840 programming errors.  The instrumentation relies on a separate runtime
4841 library (@file{libmudflap}), which will be linked into a program if
4842 @option{-fmudflap} is given at link time.  Run-time behavior of the
4843 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
4844 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
4845 for its options.
4847 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
4848 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
4849 addition to @option{-fmudflap} or @option{-fmudflapth}, if
4850 instrumentation should ignore pointer reads.  This produces less
4851 instrumentation (and therefore faster execution) and still provides
4852 some protection against outright memory corrupting writes, but allows
4853 erroneously read data to propagate within a program.
4855 @item -fthread-jumps
4856 @opindex fthread-jumps
4857 Perform optimizations where we check to see if a jump branches to a
4858 location where another comparison subsumed by the first is found.  If
4859 so, the first branch is redirected to either the destination of the
4860 second branch or a point immediately following it, depending on whether
4861 the condition is known to be true or false.
4863 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4865 @item -fcse-follow-jumps
4866 @opindex fcse-follow-jumps
4867 In common subexpression elimination, scan through jump instructions
4868 when the target of the jump is not reached by any other path.  For
4869 example, when CSE encounters an @code{if} statement with an
4870 @code{else} clause, CSE will follow the jump when the condition
4871 tested is false.
4873 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4875 @item -fcse-skip-blocks
4876 @opindex fcse-skip-blocks
4877 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
4878 follow jumps which conditionally skip over blocks.  When CSE
4879 encounters a simple @code{if} statement with no else clause,
4880 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
4881 body of the @code{if}.
4883 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4885 @item -frerun-cse-after-loop
4886 @opindex frerun-cse-after-loop
4887 Re-run common subexpression elimination after loop optimizations has been
4888 performed.
4890 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4892 @item -fgcse
4893 @opindex fgcse
4894 Perform a global common subexpression elimination pass.
4895 This pass also performs global constant and copy propagation.
4897 @emph{Note:} When compiling a program using computed gotos, a GCC
4898 extension, you may get better runtime performance if you disable
4899 the global common subexpression elimination pass by adding
4900 @option{-fno-gcse} to the command line.
4902 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4904 @item -fgcse-lm
4905 @opindex fgcse-lm
4906 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
4907 attempt to move loads which are only killed by stores into themselves.  This
4908 allows a loop containing a load/store sequence to be changed to a load outside
4909 the loop, and a copy/store within the loop.
4911 Enabled by default when gcse is enabled.
4913 @item -fgcse-sm
4914 @opindex fgcse-sm
4915 When @option{-fgcse-sm} is enabled, a store motion pass is run after
4916 global common subexpression elimination.  This pass will attempt to move
4917 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
4918 loops containing a load/store sequence can be changed to a load before
4919 the loop and a store after the loop.
4921 Not enabled at any optimization level.
4923 @item -fgcse-las
4924 @opindex fgcse-las
4925 When @option{-fgcse-las} is enabled, the global common subexpression
4926 elimination pass eliminates redundant loads that come after stores to the
4927 same memory location (both partial and full redundancies).
4929 Not enabled at any optimization level.
4931 @item -fgcse-after-reload
4932 @opindex fgcse-after-reload
4933 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
4934 pass is performed after reload.  The purpose of this pass is to cleanup
4935 redundant spilling.
4937 @item -funsafe-loop-optimizations
4938 @opindex funsafe-loop-optimizations
4939 If given, the loop optimizer will assume that loop indices do not
4940 overflow, and that the loops with nontrivial exit condition are not
4941 infinite.  This enables a wider range of loop optimizations even if
4942 the loop optimizer itself cannot prove that these assumptions are valid.
4943 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
4944 if it finds this kind of loop.
4946 @item -fcrossjumping
4947 @opindex crossjumping
4948 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
4949 resulting code may or may not perform better than without cross-jumping.
4951 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4953 @item -fif-conversion
4954 @opindex if-conversion
4955 Attempt to transform conditional jumps into branch-less equivalents.  This
4956 include use of conditional moves, min, max, set flags and abs instructions, and
4957 some tricks doable by standard arithmetics.  The use of conditional execution
4958 on chips where it is available is controlled by @code{if-conversion2}.
4960 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4962 @item -fif-conversion2
4963 @opindex if-conversion2
4964 Use conditional execution (where available) to transform conditional jumps into
4965 branch-less equivalents.
4967 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4969 @item -fdelete-null-pointer-checks
4970 @opindex fdelete-null-pointer-checks
4971 Use global dataflow analysis to identify and eliminate useless checks
4972 for null pointers.  The compiler assumes that dereferencing a null
4973 pointer would have halted the program.  If a pointer is checked after
4974 it has already been dereferenced, it cannot be null.
4976 In some environments, this assumption is not true, and programs can
4977 safely dereference null pointers.  Use
4978 @option{-fno-delete-null-pointer-checks} to disable this optimization
4979 for programs which depend on that behavior.
4981 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4983 @item -fexpensive-optimizations
4984 @opindex fexpensive-optimizations
4985 Perform a number of minor optimizations that are relatively expensive.
4987 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4989 @item -foptimize-register-move
4990 @itemx -fregmove
4991 @opindex foptimize-register-move
4992 @opindex fregmove
4993 Attempt to reassign register numbers in move instructions and as
4994 operands of other simple instructions in order to maximize the amount of
4995 register tying.  This is especially helpful on machines with two-operand
4996 instructions.
4998 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
4999 optimization.
5001 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5003 @item -fira
5004 @opindex fira
5005 If supported for the target machine, use the integrated register
5006 allocator (@acronym{IRA}) for the register allocation.
5008 @item -fira-biased-coloring
5009 @opindex fira-biased-coloring
5010 Use biased coloring for the integrated register allocator for possible
5011 improvement of the generated code.  It makes register allocator
5012 slower.
5014 @item -fira-algorithm=@var{algorithm}
5015 Use specified algorithm for the integrated register allocator.  The
5016 @var{algorithm} argument should be one of @code{regional}, @code{CB},
5017 or @code{priority}.  The second algorithm specifies Chaitin-Briggs
5018 coloring, the third one specifies Chow's priority based coloring, and
5019 the third one which is the default specifies regional coloring based
5020 on Chaitin-Briggs coloring.  The first algorithm is the best for the
5021 generated code quality especially for machines with small or moderate
5022 size register set, the second one is faster and generates decent code
5023 and the smallest size code, and the priority-based one is the fastest
5024 one.
5026 @item -fipra
5027 @opindex fipra
5028 Switch on a simple form of inter-procedural register allocation when
5029 the integrated register allocator (@acronym{IRA}) is used.
5031 @item -fdelayed-branch
5032 @opindex fdelayed-branch
5033 If supported for the target machine, attempt to reorder instructions
5034 to exploit instruction slots available after delayed branch
5035 instructions.
5037 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5039 @item -fschedule-insns
5040 @opindex fschedule-insns
5041 If supported for the target machine, attempt to reorder instructions to
5042 eliminate execution stalls due to required data being unavailable.  This
5043 helps machines that have slow floating point or memory load instructions
5044 by allowing other instructions to be issued until the result of the load
5045 or floating point instruction is required.
5047 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5049 @item -fschedule-insns2
5050 @opindex fschedule-insns2
5051 Similar to @option{-fschedule-insns}, but requests an additional pass of
5052 instruction scheduling after register allocation has been done.  This is
5053 especially useful on machines with a relatively small number of
5054 registers and where memory load instructions take more than one cycle.
5056 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5058 @item -fno-sched-interblock
5059 @opindex fno-sched-interblock
5060 Don't schedule instructions across basic blocks.  This is normally
5061 enabled by default when scheduling before register allocation, i.e.@:
5062 with @option{-fschedule-insns} or at @option{-O2} or higher.
5064 @item -fno-sched-spec
5065 @opindex fno-sched-spec
5066 Don't allow speculative motion of non-load instructions.  This is normally
5067 enabled by default when scheduling before register allocation, i.e.@:
5068 with @option{-fschedule-insns} or at @option{-O2} or higher.
5070 @item -fsched-spec-load
5071 @opindex fsched-spec-load
5072 Allow speculative motion of some load instructions.  This only makes
5073 sense when scheduling before register allocation, i.e.@: with
5074 @option{-fschedule-insns} or at @option{-O2} or higher.
5076 @item -fsched-spec-load-dangerous
5077 @opindex fsched-spec-load-dangerous
5078 Allow speculative motion of more load instructions.  This only makes
5079 sense when scheduling before register allocation, i.e.@: with
5080 @option{-fschedule-insns} or at @option{-O2} or higher.
5082 @item -fsched-stalled-insns=@var{n}
5083 @opindex fsched-stalled-insns
5084 Define how many insns (if any) can be moved prematurely from the queue
5085 of stalled insns into the ready list, during the second scheduling pass.
5087 @item -fsched-stalled-insns-dep=@var{n}
5088 @opindex fsched-stalled-insns-dep
5089 Define how many insn groups (cycles) will be examined for a dependency
5090 on a stalled insn that is candidate for premature removal from the queue
5091 of stalled insns.  Has an effect only during the second scheduling pass,
5092 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5094 @item -fsched2-use-superblocks
5095 @opindex fsched2-use-superblocks
5096 When scheduling after register allocation, do use superblock scheduling
5097 algorithm.  Superblock scheduling allows motion across basic block boundaries
5098 resulting on faster schedules.  This option is experimental, as not all machine
5099 descriptions used by GCC model the CPU closely enough to avoid unreliable
5100 results from the algorithm.
5102 This only makes sense when scheduling after register allocation, i.e.@: with
5103 @option{-fschedule-insns2} or at @option{-O2} or higher.
5105 @item -fsched2-use-traces
5106 @opindex fsched2-use-traces
5107 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5108 allocation and additionally perform code duplication in order to increase the
5109 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5110 trace formation.
5112 This mode should produce faster but significantly longer programs.  Also
5113 without @option{-fbranch-probabilities} the traces constructed may not
5114 match the reality and hurt the performance.  This only makes
5115 sense when scheduling after register allocation, i.e.@: with
5116 @option{-fschedule-insns2} or at @option{-O2} or higher.
5118 @item -fsee
5119 @opindex fsee
5120 Eliminates redundant extension instructions and move the non redundant
5121 ones to optimal placement using LCM.
5123 @item -freschedule-modulo-scheduled-loops
5124 @opindex fscheduling-in-modulo-scheduled-loops
5125 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5126 we may want to prevent the later scheduling passes from changing its schedule, we use this
5127 option to control that.
5129 @item -fcaller-saves
5130 @opindex fcaller-saves
5131 Enable values to be allocated in registers that will be clobbered by
5132 function calls, by emitting extra instructions to save and restore the
5133 registers around such calls.  Such allocation is done only when it
5134 seems to result in better code than would otherwise be produced.
5136 This option is always enabled by default on certain machines, usually
5137 those which have no call-preserved registers to use instead.
5139 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5141 @item -ftree-pre
5142 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5143 enabled by default at @option{-O2} and @option{-O3}.
5145 @item -ftree-fre
5146 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5147 between FRE and PRE is that FRE only considers expressions
5148 that are computed on all paths leading to the redundant computation.
5149 This analysis faster than PRE, though it exposes fewer redundancies.
5150 This flag is enabled by default at @option{-O} and higher.
5152 @item -ftree-copy-prop
5153 Perform copy propagation on trees.  This pass eliminates unnecessary
5154 copy operations.  This flag is enabled by default at @option{-O} and
5155 higher.
5157 @item -ftree-store-copy-prop
5158 Perform copy propagation of memory loads and stores.  This pass
5159 eliminates unnecessary copy operations in memory references
5160 (structures, global variables, arrays, etc).  This flag is enabled by
5161 default at @option{-O2} and higher.
5163 @item -ftree-salias
5164 Perform structural alias analysis on trees.  This flag
5165 is enabled by default at @option{-O} and higher.
5167 @item -fipa-pta
5168 Perform interprocedural pointer analysis.
5170 @item -ftree-sink
5171 Perform forward store motion  on trees.  This flag is
5172 enabled by default at @option{-O} and higher.
5174 @item -ftree-ccp
5175 Perform sparse conditional constant propagation (CCP) on trees.  This
5176 pass only operates on local scalar variables and is enabled by default
5177 at @option{-O} and higher.
5179 @item -ftree-store-ccp
5180 Perform sparse conditional constant propagation (CCP) on trees.  This
5181 pass operates on both local scalar variables and memory stores and
5182 loads (global variables, structures, arrays, etc).  This flag is
5183 enabled by default at @option{-O2} and higher.
5185 @item -ftree-dce
5186 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5187 default at @option{-O} and higher.
5189 @item -ftree-dominator-opts
5190 Perform a variety of simple scalar cleanups (constant/copy
5191 propagation, redundancy elimination, range propagation and expression
5192 simplification) based on a dominator tree traversal.  This also
5193 performs jump threading (to reduce jumps to jumps). This flag is
5194 enabled by default at @option{-O} and higher.
5196 @item -ftree-ch
5197 Perform loop header copying on trees.  This is beneficial since it increases
5198 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5199 is enabled by default at @option{-O} and higher.  It is not enabled
5200 for @option{-Os}, since it usually increases code size.
5202 @item -ftree-loop-optimize
5203 Perform loop optimizations on trees.  This flag is enabled by default
5204 at @option{-O} and higher.
5206 @item -ftree-loop-linear
5207 Perform linear loop transformations on tree.  This flag can improve cache
5208 performance and allow further loop optimizations to take place.
5210 @item -ftree-loop-im
5211 Perform loop invariant motion on trees.  This pass moves only invariants that
5212 would be hard to handle at RTL level (function calls, operations that expand to
5213 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5214 operands of conditions that are invariant out of the loop, so that we can use
5215 just trivial invariantness analysis in loop unswitching.  The pass also includes
5216 store motion.
5218 @item -ftree-loop-ivcanon
5219 Create a canonical counter for number of iterations in the loop for that
5220 determining number of iterations requires complicated analysis.  Later
5221 optimizations then may determine the number easily.  Useful especially
5222 in connection with unrolling.
5224 @item -fivopts
5225 Perform induction variable optimizations (strength reduction, induction
5226 variable merging and induction variable elimination) on trees.
5228 @item -ftree-sra
5229 Perform scalar replacement of aggregates.  This pass replaces structure
5230 references with scalars to prevent committing structures to memory too
5231 early.  This flag is enabled by default at @option{-O} and higher.
5233 @item -ftree-copyrename
5234 Perform copy renaming on trees.  This pass attempts to rename compiler
5235 temporaries to other variables at copy locations, usually resulting in
5236 variable names which more closely resemble the original variables.  This flag
5237 is enabled by default at @option{-O} and higher.
5239 @item -ftree-ter
5240 Perform temporary expression replacement during the SSA->normal phase.  Single
5241 use/single def temporaries are replaced at their use location with their
5242 defining expression.  This results in non-GIMPLE code, but gives the expanders
5243 much more complex trees to work on resulting in better RTL generation.  This is
5244 enabled by default at @option{-O} and higher.
5246 @item -ftree-lrs
5247 Perform live range splitting during the SSA->normal phase.  Distinct live
5248 ranges of a variable are split into unique variables, allowing for better
5249 optimization later.  This is enabled by default at @option{-O} and higher.
5251 @item -ftree-vectorize
5252 Perform loop vectorization on trees.
5254 @item -ftree-vect-loop-version
5255 @opindex ftree-vect-loop-version
5256 Perform loop versioning when doing loop vectorization on trees.  When a loop
5257 appears to be vectorizable except that data alignment or data dependence cannot
5258 be determined at compile time then vectorized and non-vectorized versions of
5259 the loop are generated along with runtime checks for alignment or dependence
5260 to control which version is executed.  This option is enabled by default
5261 except at level @option{-Os} where it is disabled.
5263 @item -ftree-vrp
5264 Perform Value Range Propagation on trees.  This is similar to the
5265 constant propagation pass, but instead of values, ranges of values are
5266 propagated.  This allows the optimizers to remove unnecessary range
5267 checks like array bound checks and null pointer checks.  This is
5268 enabled by default at @option{-O2} and higher.  Null pointer check
5269 elimination is only done if @option{-fdelete-null-pointer-checks} is
5270 enabled.
5272 @item -ftracer
5273 @opindex ftracer
5274 Perform tail duplication to enlarge superblock size.  This transformation
5275 simplifies the control flow of the function allowing other optimizations to do
5276 better job.
5278 @item -funroll-loops
5279 @opindex funroll-loops
5280 Unroll loops whose number of iterations can be determined at compile
5281 time or upon entry to the loop.  @option{-funroll-loops} implies
5282 @option{-frerun-cse-after-loop}.  This option makes code larger,
5283 and may or may not make it run faster.
5285 @item -funroll-all-loops
5286 @opindex funroll-all-loops
5287 Unroll all loops, even if their number of iterations is uncertain when
5288 the loop is entered.  This usually makes programs run more slowly.
5289 @option{-funroll-all-loops} implies the same options as
5290 @option{-funroll-loops},
5292 @item -fsplit-ivs-in-unroller
5293 @opindex -fsplit-ivs-in-unroller
5294 Enables expressing of values of induction variables in later iterations
5295 of the unrolled loop using the value in the first iteration.  This breaks
5296 long dependency chains, thus improving efficiency of the scheduling passes.
5298 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5299 same effect.  However in cases the loop body is more complicated than
5300 a single basic block, this is not reliable.  It also does not work at all
5301 on some of the architectures due to restrictions in the CSE pass.
5303 This optimization is enabled by default.
5305 @item -fvariable-expansion-in-unroller
5306 @opindex -fvariable-expansion-in-unroller
5307 With this option, the compiler will create multiple copies of some
5308 local variables when unrolling a loop which can result in superior code.
5310 @item -fprefetch-loop-arrays
5311 @opindex fprefetch-loop-arrays
5312 If supported by the target machine, generate instructions to prefetch
5313 memory to improve the performance of loops that access large arrays.
5315 This option may generate better or worse code; results are highly
5316 dependent on the structure of loops within the source code.
5318 Disabled at level @option{-Os}.
5320 @item -fno-peephole
5321 @itemx -fno-peephole2
5322 @opindex fno-peephole
5323 @opindex fno-peephole2
5324 Disable any machine-specific peephole optimizations.  The difference
5325 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5326 are implemented in the compiler; some targets use one, some use the
5327 other, a few use both.
5329 @option{-fpeephole} is enabled by default.
5330 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5332 @item -fno-guess-branch-probability
5333 @opindex fno-guess-branch-probability
5334 Do not guess branch probabilities using heuristics.
5336 GCC will use heuristics to guess branch probabilities if they are
5337 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5338 heuristics are based on the control flow graph.  If some branch probabilities
5339 are specified by @samp{__builtin_expect}, then the heuristics will be
5340 used to guess branch probabilities for the rest of the control flow graph,
5341 taking the @samp{__builtin_expect} info into account.  The interactions
5342 between the heuristics and @samp{__builtin_expect} can be complex, and in
5343 some cases, it may be useful to disable the heuristics so that the effects
5344 of @samp{__builtin_expect} are easier to understand.
5346 The default is @option{-fguess-branch-probability} at levels
5347 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5349 @item -freorder-blocks
5350 @opindex freorder-blocks
5351 Reorder basic blocks in the compiled function in order to reduce number of
5352 taken branches and improve code locality.
5354 Enabled at levels @option{-O2}, @option{-O3}.
5356 @item -freorder-blocks-and-partition
5357 @opindex freorder-blocks-and-partition
5358 In addition to reordering basic blocks in the compiled function, in order
5359 to reduce number of taken branches, partitions hot and cold basic blocks
5360 into separate sections of the assembly and .o files, to improve
5361 paging and cache locality performance.
5363 This optimization is automatically turned off in the presence of
5364 exception handling, for linkonce sections, for functions with a user-defined
5365 section attribute and on any architecture that does not support named
5366 sections.
5368 @item -freorder-functions
5369 @opindex freorder-functions
5370 Reorder functions in the object file in order to
5371 improve code locality.  This is implemented by using special
5372 subsections @code{.text.hot} for most frequently executed functions and
5373 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5374 the linker so object file format must support named sections and linker must
5375 place them in a reasonable way.
5377 Also profile feedback must be available in to make this option effective.  See
5378 @option{-fprofile-arcs} for details.
5380 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5382 @item -fstrict-aliasing
5383 @opindex fstrict-aliasing
5384 Allows the compiler to assume the strictest aliasing rules applicable to
5385 the language being compiled.  For C (and C++), this activates
5386 optimizations based on the type of expressions.  In particular, an
5387 object of one type is assumed never to reside at the same address as an
5388 object of a different type, unless the types are almost the same.  For
5389 example, an @code{unsigned int} can alias an @code{int}, but not a
5390 @code{void*} or a @code{double}.  A character type may alias any other
5391 type.
5393 Pay special attention to code like this:
5394 @smallexample
5395 union a_union @{
5396   int i;
5397   double d;
5400 int f() @{
5401   a_union t;
5402   t.d = 3.0;
5403   return t.i;
5405 @end smallexample
5406 The practice of reading from a different union member than the one most
5407 recently written to (called ``type-punning'') is common.  Even with
5408 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5409 is accessed through the union type.  So, the code above will work as
5410 expected.  However, this code might not:
5411 @smallexample
5412 int f() @{
5413   a_union t;
5414   int* ip;
5415   t.d = 3.0;
5416   ip = &t.i;
5417   return *ip;
5419 @end smallexample
5421 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5423 @item -falign-functions
5424 @itemx -falign-functions=@var{n}
5425 @opindex falign-functions
5426 Align the start of functions to the next power-of-two greater than
5427 @var{n}, skipping up to @var{n} bytes.  For instance,
5428 @option{-falign-functions=32} aligns functions to the next 32-byte
5429 boundary, but @option{-falign-functions=24} would align to the next
5430 32-byte boundary only if this can be done by skipping 23 bytes or less.
5432 @option{-fno-align-functions} and @option{-falign-functions=1} are
5433 equivalent and mean that functions will not be aligned.
5435 Some assemblers only support this flag when @var{n} is a power of two;
5436 in that case, it is rounded up.
5438 If @var{n} is not specified or is zero, use a machine-dependent default.
5440 Enabled at levels @option{-O2}, @option{-O3}.
5442 @item -falign-labels
5443 @itemx -falign-labels=@var{n}
5444 @opindex falign-labels
5445 Align all branch targets to a power-of-two boundary, skipping up to
5446 @var{n} bytes like @option{-falign-functions}.  This option can easily
5447 make code slower, because it must insert dummy operations for when the
5448 branch target is reached in the usual flow of the code.
5450 @option{-fno-align-labels} and @option{-falign-labels=1} are
5451 equivalent and mean that labels will not be aligned.
5453 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5454 are greater than this value, then their values are used instead.
5456 If @var{n} is not specified or is zero, use a machine-dependent default
5457 which is very likely to be @samp{1}, meaning no alignment.
5459 Enabled at levels @option{-O2}, @option{-O3}.
5461 @item -falign-loops
5462 @itemx -falign-loops=@var{n}
5463 @opindex falign-loops
5464 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5465 like @option{-falign-functions}.  The hope is that the loop will be
5466 executed many times, which will make up for any execution of the dummy
5467 operations.
5469 @option{-fno-align-loops} and @option{-falign-loops=1} are
5470 equivalent and mean that loops will not be aligned.
5472 If @var{n} is not specified or is zero, use a machine-dependent default.
5474 Enabled at levels @option{-O2}, @option{-O3}.
5476 @item -falign-jumps
5477 @itemx -falign-jumps=@var{n}
5478 @opindex falign-jumps
5479 Align branch targets to a power-of-two boundary, for branch targets
5480 where the targets can only be reached by jumping, skipping up to @var{n}
5481 bytes like @option{-falign-functions}.  In this case, no dummy operations
5482 need be executed.
5484 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5485 equivalent and mean that loops will not be aligned.
5487 If @var{n} is not specified or is zero, use a machine-dependent default.
5489 Enabled at levels @option{-O2}, @option{-O3}.
5491 @item -funit-at-a-time
5492 @opindex funit-at-a-time
5493 Parse the whole compilation unit before starting to produce code.
5494 This allows some extra optimizations to take place but consumes
5495 more memory (in general).  There are some compatibility issues
5496 with @emph{unit-at-a-time} mode:
5497 @itemize @bullet
5498 @item
5499 enabling @emph{unit-at-a-time} mode may change the order
5500 in which functions, variables, and top-level @code{asm} statements
5501 are emitted, and will likely break code relying on some particular
5502 ordering.  The majority of such top-level @code{asm} statements,
5503 though, can be replaced by @code{section} attributes.  The
5504 @option{fno-toplevel-reorder} option may be used to keep the ordering
5505 used in the input file, at the cost of some optimizations.
5507 @item
5508 @emph{unit-at-a-time} mode removes unreferenced static variables
5509 and functions.  This may result in undefined references
5510 when an @code{asm} statement refers directly to variables or functions
5511 that are otherwise unused.  In that case either the variable/function
5512 shall be listed as an operand of the @code{asm} statement operand or,
5513 in the case of top-level @code{asm} statements the attribute @code{used}
5514 shall be used on the declaration.
5516 @item
5517 Static functions now can use non-standard passing conventions that
5518 may break @code{asm} statements calling functions directly.  Again,
5519 attribute @code{used} will prevent this behavior.
5520 @end itemize
5522 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5523 but this scheme may not be supported by future releases of GCC@.
5525 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5527 @item -fno-toplevel-reorder
5528 Do not reorder top-level functions, variables, and @code{asm}
5529 statements.  Output them in the same order that they appear in the
5530 input file.  When this option is used, unreferenced static variables
5531 will not be removed.  This option is intended to support existing code
5532 which relies on a particular ordering.  For new code, it is better to
5533 use attributes.
5535 @item -fweb
5536 @opindex fweb
5537 Constructs webs as commonly used for register allocation purposes and assign
5538 each web individual pseudo register.  This allows the register allocation pass
5539 to operate on pseudos directly, but also strengthens several other optimization
5540 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5541 however, make debugging impossible, since variables will no longer stay in a
5542 ``home register''.
5544 Enabled by default with @option{-funroll-loops}.
5546 @item -fwhole-program
5547 @opindex fwhole-program
5548 Assume that the current compilation unit represents whole program being
5549 compiled.  All public functions and variables with the exception of @code{main}
5550 and those merged by attribute @code{externally_visible} become static functions
5551 and in a affect gets more aggressively optimized by interprocedural optimizers.
5552 While this option is equivalent to proper use of @code{static} keyword for
5553 programs consisting of single file, in combination with option
5554 @option{--combine} this flag can be used to compile most of smaller scale C
5555 programs since the functions and variables become local for the whole combined
5556 compilation unit, not for the single source file itself.
5559 @item -fno-cprop-registers
5560 @opindex fno-cprop-registers
5561 After register allocation and post-register allocation instruction splitting,
5562 we perform a copy-propagation pass to try to reduce scheduling dependencies
5563 and occasionally eliminate the copy.
5565 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5567 @item -fprofile-generate
5568 @opindex fprofile-generate
5570 Enable options usually used for instrumenting application to produce
5571 profile useful for later recompilation with profile feedback based
5572 optimization.  You must use @option{-fprofile-generate} both when
5573 compiling and when linking your program.
5575 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5577 @item -fprofile-use
5578 @opindex fprofile-use
5579 Enable profile feedback directed optimizations, and optimizations
5580 generally profitable only with profile feedback available.
5582 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5583 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
5585 @end table
5587 The following options control compiler behavior regarding floating
5588 point arithmetic.  These options trade off between speed and
5589 correctness.  All must be specifically enabled.
5591 @table @gcctabopt
5592 @item -ffloat-store
5593 @opindex ffloat-store
5594 Do not store floating point variables in registers, and inhibit other
5595 options that might change whether a floating point value is taken from a
5596 register or memory.
5598 @cindex floating point precision
5599 This option prevents undesirable excess precision on machines such as
5600 the 68000 where the floating registers (of the 68881) keep more
5601 precision than a @code{double} is supposed to have.  Similarly for the
5602 x86 architecture.  For most programs, the excess precision does only
5603 good, but a few programs rely on the precise definition of IEEE floating
5604 point.  Use @option{-ffloat-store} for such programs, after modifying
5605 them to store all pertinent intermediate computations into variables.
5607 @item -ffast-math
5608 @opindex ffast-math
5609 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5610 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5611 @option{-fno-rounding-math}, @option{-fno-signaling-nans}
5612 and @option{fcx-limited-range}.
5614 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5616 This option should never be turned on by any @option{-O} option since
5617 it can result in incorrect output for programs which depend on
5618 an exact implementation of IEEE or ISO rules/specifications for
5619 math functions.
5621 @item -fno-math-errno
5622 @opindex fno-math-errno
5623 Do not set ERRNO after calling math functions that are executed
5624 with a single instruction, e.g., sqrt.  A program that relies on
5625 IEEE exceptions for math error handling may want to use this flag
5626 for speed while maintaining IEEE arithmetic compatibility.
5628 This option should never be turned on by any @option{-O} option since
5629 it can result in incorrect output for programs which depend on
5630 an exact implementation of IEEE or ISO rules/specifications for
5631 math functions.
5633 The default is @option{-fmath-errno}.
5635 On Darwin systems, the math library never sets @code{errno}.  There is therefore
5636 no reason for the compiler to consider the possibility that it might,
5637 and @option{-fno-math-errno} is the default.
5639 @item -funsafe-math-optimizations
5640 @opindex funsafe-math-optimizations
5641 Allow optimizations for floating-point arithmetic that (a) assume
5642 that arguments and results are valid and (b) may violate IEEE or
5643 ANSI standards.  When used at link-time, it may include libraries
5644 or startup files that change the default FPU control word or other
5645 similar optimizations.
5647 This option should never be turned on by any @option{-O} option since
5648 it can result in incorrect output for programs which depend on
5649 an exact implementation of IEEE or ISO rules/specifications for
5650 math functions.
5652 The default is @option{-fno-unsafe-math-optimizations}.
5654 @item -ffinite-math-only
5655 @opindex ffinite-math-only
5656 Allow optimizations for floating-point arithmetic that assume
5657 that arguments and results are not NaNs or +-Infs.
5659 This option should never be turned on by any @option{-O} option since
5660 it can result in incorrect output for programs which depend on
5661 an exact implementation of IEEE or ISO rules/specifications.
5663 The default is @option{-fno-finite-math-only}.
5665 @item -fno-trapping-math
5666 @opindex fno-trapping-math
5667 Compile code assuming that floating-point operations cannot generate
5668 user-visible traps.  These traps include division by zero, overflow,
5669 underflow, inexact result and invalid operation.  This option implies
5670 @option{-fno-signaling-nans}.  Setting this option may allow faster
5671 code if one relies on ``non-stop'' IEEE arithmetic, for example.
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{-ftrapping-math}.
5680 @item -frounding-math
5681 @opindex frounding-math
5682 Disable transformations and optimizations that assume default floating
5683 point rounding behavior.  This is round-to-zero for all floating point
5684 to integer conversions, and round-to-nearest for all other arithmetic
5685 truncations.  This option should be specified for programs that change
5686 the FP rounding mode dynamically, or that may be executed with a
5687 non-default rounding mode.  This option disables constant folding of
5688 floating point expressions at compile-time (which may be affected by
5689 rounding mode) and arithmetic transformations that are unsafe in the
5690 presence of sign-dependent rounding modes.
5692 The default is @option{-fno-rounding-math}.
5694 This option is experimental and does not currently guarantee to
5695 disable all GCC optimizations that are affected by rounding mode.
5696 Future versions of GCC may provide finer control of this setting
5697 using C99's @code{FENV_ACCESS} pragma.  This command line option
5698 will be used to specify the default state for @code{FENV_ACCESS}.
5700 @item -frtl-abstract-sequences
5701 @opindex frtl-abstract-sequences
5702 It is a size optimization method. This option is to find identical
5703 sequences of code, which can be turned into pseudo-procedures  and
5704 then  replace  all  occurrences with  calls to  the  newly created
5705 subroutine. It is kind of an opposite of @option{-finline-functions}.
5706 This optimization runs at RTL level.
5708 @item -fsignaling-nans
5709 @opindex fsignaling-nans
5710 Compile code assuming that IEEE signaling NaNs may generate user-visible
5711 traps during floating-point operations.  Setting this option disables
5712 optimizations that may change the number of exceptions visible with
5713 signaling NaNs.  This option implies @option{-ftrapping-math}.
5715 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
5716 be defined.
5718 The default is @option{-fno-signaling-nans}.
5720 This option is experimental and does not currently guarantee to
5721 disable all GCC optimizations that affect signaling NaN behavior.
5723 @item -fsingle-precision-constant
5724 @opindex fsingle-precision-constant
5725 Treat floating point constant as single precision constant instead of
5726 implicitly converting it to double precision constant.
5728 @item -fcx-limited-range
5729 @itemx -fno-cx-limited-range
5730 @opindex fcx-limited-range
5731 @opindex fno-cx-limited-range
5732 When enabled, this option states that a range reduction step is not
5733 needed when performing complex division.  The default is
5734 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
5736 This option controls the default setting of the ISO C99 
5737 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
5738 all languages.
5740 @end table
5742 The following options control optimizations that may improve
5743 performance, but are not enabled by any @option{-O} options.  This
5744 section includes experimental options that may produce broken code.
5746 @table @gcctabopt
5747 @item -fbranch-probabilities
5748 @opindex fbranch-probabilities
5749 After running a program compiled with @option{-fprofile-arcs}
5750 (@pxref{Debugging Options,, Options for Debugging Your Program or
5751 @command{gcc}}), you can compile it a second time using
5752 @option{-fbranch-probabilities}, to improve optimizations based on
5753 the number of times each branch was taken.  When the program
5754 compiled with @option{-fprofile-arcs} exits it saves arc execution
5755 counts to a file called @file{@var{sourcename}.gcda} for each source
5756 file  The information in this data file is very dependent on the
5757 structure of the generated code, so you must use the same source code
5758 and the same optimization options for both compilations.
5760 With @option{-fbranch-probabilities}, GCC puts a
5761 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
5762 These can be used to improve optimization.  Currently, they are only
5763 used in one place: in @file{reorg.c}, instead of guessing which path a
5764 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
5765 exactly determine which path is taken more often.
5767 @item -fprofile-values
5768 @opindex fprofile-values
5769 If combined with @option{-fprofile-arcs}, it adds code so that some
5770 data about values of expressions in the program is gathered.
5772 With @option{-fbranch-probabilities}, it reads back the data gathered
5773 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
5774 notes to instructions for their later usage in optimizations.
5776 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
5778 @item -fvpt
5779 @opindex fvpt
5780 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
5781 a code to gather information about values of expressions.
5783 With @option{-fbranch-probabilities}, it reads back the data gathered
5784 and actually performs the optimizations based on them.
5785 Currently the optimizations include specialization of division operation
5786 using the knowledge about the value of the denominator.
5788 @item -frename-registers
5789 @opindex frename-registers
5790 Attempt to avoid false dependencies in scheduled code by making use
5791 of registers left over after register allocation.  This optimization
5792 will most benefit processors with lots of registers.  Depending on the
5793 debug information format adopted by the target, however, it can
5794 make debugging impossible, since variables will no longer stay in
5795 a ``home register''.
5797 Enabled by default with @option{-funroll-loops}.
5799 @item -ftracer
5800 @opindex ftracer
5801 Perform tail duplication to enlarge superblock size.  This transformation
5802 simplifies the control flow of the function allowing other optimizations to do
5803 better job.
5805 Enabled with @option{-fprofile-use}.
5807 @item -funroll-loops
5808 @opindex funroll-loops
5809 Unroll loops whose number of iterations can be determined at compile time or
5810 upon entry to the loop.  @option{-funroll-loops} implies
5811 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}. 
5812 It also turns on complete loop peeling (i.e.@: complete removal of loops with
5813 small constant number of iterations).  This option makes code larger, and may
5814 or may not make it run faster.
5816 Enabled with @option{-fprofile-use}.
5818 @item -funroll-all-loops
5819 @opindex funroll-all-loops
5820 Unroll all loops, even if their number of iterations is uncertain when
5821 the loop is entered.  This usually makes programs run more slowly.
5822 @option{-funroll-all-loops} implies the same options as
5823 @option{-funroll-loops}.
5825 @item -fpeel-loops
5826 @opindex fpeel-loops
5827 Peels the loops for that there is enough information that they do not
5828 roll much (from profile feedback).  It also turns on complete loop peeling
5829 (i.e.@: complete removal of loops with small constant number of iterations).
5831 Enabled with @option{-fprofile-use}.
5833 @item -fmove-loop-invariants
5834 @opindex fmove-loop-invariants
5835 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
5836 at level @option{-O1}
5838 @item -funswitch-loops
5839 @opindex funswitch-loops
5840 Move branches with loop invariant conditions out of the loop, with duplicates
5841 of the loop on both branches (modified according to result of the condition).
5843 @item -ffunction-sections
5844 @itemx -fdata-sections
5845 @opindex ffunction-sections
5846 @opindex fdata-sections
5847 Place each function or data item into its own section in the output
5848 file if the target supports arbitrary sections.  The name of the
5849 function or the name of the data item determines the section's name
5850 in the output file.
5852 Use these options on systems where the linker can perform optimizations
5853 to improve locality of reference in the instruction space.  Most systems
5854 using the ELF object format and SPARC processors running Solaris 2 have
5855 linkers with such optimizations.  AIX may have these optimizations in
5856 the future.
5858 Only use these options when there are significant benefits from doing
5859 so.  When you specify these options, the assembler and linker will
5860 create larger object and executable files and will also be slower.
5861 You will not be able to use @code{gprof} on all systems if you
5862 specify this option and you may have problems with debugging if
5863 you specify both this option and @option{-g}.
5865 @item -fbranch-target-load-optimize
5866 @opindex fbranch-target-load-optimize
5867 Perform branch target register load optimization before prologue / epilogue
5868 threading.
5869 The use of target registers can typically be exposed only during reload,
5870 thus hoisting loads out of loops and doing inter-block scheduling needs
5871 a separate optimization pass.
5873 @item -fbranch-target-load-optimize2
5874 @opindex fbranch-target-load-optimize2
5875 Perform branch target register load optimization after prologue / epilogue
5876 threading.
5878 @item -fbtr-bb-exclusive
5879 @opindex fbtr-bb-exclusive
5880 When performing branch target register load optimization, don't reuse
5881 branch target registers in within any basic block.
5883 @item -fstack-protector
5884 Emit extra code to check for buffer overflows, such as stack smashing
5885 attacks.  This is done by adding a guard variable to functions with
5886 vulnerable objects.  This includes functions that call alloca, and
5887 functions with buffers larger than 8 bytes.  The guards are initialized
5888 when a function is entered and then checked when the function exits.
5889 If a guard check fails, an error message is printed and the program exits.
5891 @item -fstack-protector-all
5892 Like @option{-fstack-protector} except that all functions are protected.
5894 @item -fsection-anchors
5895 @opindex fsection-anchors
5896 Try to reduce the number of symbolic address calculations by using
5897 shared ``anchor'' symbols to address nearby objects.  This transformation
5898 can help to reduce the number of GOT entries and GOT accesses on some
5899 targets.
5901 For example, the implementation of the following function @code{foo}:
5903 @smallexample
5904 static int a, b, c;
5905 int foo (void) @{ return a + b + c; @}
5906 @end smallexample
5908 would usually calculate the addresses of all three variables, but if you
5909 compile it with @option{-fsection-anchors}, it will access the variables
5910 from a common anchor point instead.  The effect is similar to the
5911 following pseudocode (which isn't valid C):
5913 @smallexample
5914 int foo (void)
5916   register int *xr = &x;
5917   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
5919 @end smallexample
5921 Not all targets support this option.
5923 @item --param @var{name}=@var{value}
5924 @opindex param
5925 In some places, GCC uses various constants to control the amount of
5926 optimization that is done.  For example, GCC will not inline functions
5927 that contain more that a certain number of instructions.  You can
5928 control some of these constants on the command-line using the
5929 @option{--param} option.
5931 The names of specific parameters, and the meaning of the values, are
5932 tied to the internals of the compiler, and are subject to change
5933 without notice in future releases.
5935 In each case, the @var{value} is an integer.  The allowable choices for
5936 @var{name} are given in the following table:
5938 @table @gcctabopt
5939 @item salias-max-implicit-fields
5940 The maximum number of fields in a variable without direct
5941 structure accesses for which structure aliasing will consider trying 
5942 to track each field.  The default is 5
5944 @item salias-max-array-elements
5945 The maximum number of elements an array can have and its elements
5946 still be tracked individually by structure aliasing. The default is 4
5948 @item sra-max-structure-size
5949 The maximum structure size, in bytes, at which the scalar replacement
5950 of aggregates (SRA) optimization will perform block copies.  The
5951 default value, 0, implies that GCC will select the most appropriate
5952 size itself.
5954 @item sra-field-structure-ratio
5955 The threshold ratio (as a percentage) between instantiated fields and
5956 the complete structure size.  We say that if the ratio of the number
5957 of bytes in instantiated fields to the number of bytes in the complete
5958 structure exceeds this parameter, then block copies are not used.  The
5959 default is 75.
5961 @item max-crossjump-edges
5962 The maximum number of incoming edges to consider for crossjumping.
5963 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
5964 the number of edges incoming to each block.  Increasing values mean
5965 more aggressive optimization, making the compile time increase with
5966 probably small improvement in executable size.
5968 @item min-crossjump-insns
5969 The minimum number of instructions which must be matched at the end
5970 of two blocks before crossjumping will be performed on them.  This
5971 value is ignored in the case where all instructions in the block being
5972 crossjumped from are matched.  The default value is 5.
5974 @item max-grow-copy-bb-insns
5975 The maximum code size expansion factor when copying basic blocks
5976 instead of jumping.  The expansion is relative to a jump instruction.
5977 The default value is 8.
5979 @item max-goto-duplication-insns
5980 The maximum number of instructions to duplicate to a block that jumps
5981 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
5982 passes, GCC factors computed gotos early in the compilation process,
5983 and unfactors them as late as possible.  Only computed jumps at the
5984 end of a basic blocks with no more than max-goto-duplication-insns are
5985 unfactored.  The default value is 8.
5987 @item max-delay-slot-insn-search
5988 The maximum number of instructions to consider when looking for an
5989 instruction to fill a delay slot.  If more than this arbitrary number of
5990 instructions is searched, the time savings from filling the delay slot
5991 will be minimal so stop searching.  Increasing values mean more
5992 aggressive optimization, making the compile time increase with probably
5993 small improvement in executable run time.
5995 @item max-delay-slot-live-search
5996 When trying to fill delay slots, the maximum number of instructions to
5997 consider when searching for a block with valid live register
5998 information.  Increasing this arbitrarily chosen value means more
5999 aggressive optimization, increasing the compile time.  This parameter
6000 should be removed when the delay slot code is rewritten to maintain the
6001 control-flow graph.
6003 @item max-gcse-memory
6004 The approximate maximum amount of memory that will be allocated in
6005 order to perform the global common subexpression elimination
6006 optimization.  If more memory than specified is required, the
6007 optimization will not be done.
6009 @item max-gcse-passes
6010 The maximum number of passes of GCSE to run.  The default is 1.
6012 @item max-pending-list-length
6013 The maximum number of pending dependencies scheduling will allow
6014 before flushing the current state and starting over.  Large functions
6015 with few branches or calls can create excessively large lists which
6016 needlessly consume memory and resources.
6018 @item max-inline-insns-single
6019 Several parameters control the tree inliner used in gcc.
6020 This number sets the maximum number of instructions (counted in GCC's
6021 internal representation) in a single function that the tree inliner
6022 will consider for inlining.  This only affects functions declared
6023 inline and methods implemented in a class declaration (C++).
6024 The default value is 450.
6026 @item max-inline-insns-auto
6027 When you use @option{-finline-functions} (included in @option{-O3}),
6028 a lot of functions that would otherwise not be considered for inlining
6029 by the compiler will be investigated.  To those functions, a different
6030 (more restrictive) limit compared to functions declared inline can
6031 be applied.
6032 The default value is 90.
6034 @item large-function-insns
6035 The limit specifying really large functions.  For functions larger than this
6036 limit after inlining inlining is constrained by
6037 @option{--param large-function-growth}.  This parameter is useful primarily
6038 to avoid extreme compilation time caused by non-linear algorithms used by the
6039 backend.
6040 This parameter is ignored when @option{-funit-at-a-time} is not used.
6041 The default value is 2700.
6043 @item large-function-growth
6044 Specifies maximal growth of large function caused by inlining in percents.
6045 This parameter is ignored when @option{-funit-at-a-time} is not used.
6046 The default value is 100 which limits large function growth to 2.0 times
6047 the original size.
6049 @item large-unit-insns
6050 The limit specifying large translation unit.  Growth caused by inlining of
6051 units larger than this limit is limited by @option{--param inline-unit-growth}.
6052 For small units this might be too tight (consider unit consisting of function A
6053 that is inline and B that just calls A three time.  If B is small relative to
6054 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6055 large units consisting of small inlininable functions however the overall unit
6056 growth limit is needed to avoid exponential explosion of code size.  Thus for
6057 smaller units, the size is increased to @option{--param large-unit-insns}
6058 before applying @option{--param inline-unit-growth}.  The default is 10000
6060 @item inline-unit-growth
6061 Specifies maximal overall growth of the compilation unit caused by inlining.
6062 This parameter is ignored when @option{-funit-at-a-time} is not used.
6063 The default value is 50 which limits unit growth to 1.5 times the original
6064 size.
6066 @item large-stack-frame
6067 The limit specifying large stack frames.  While inlining the algorithm is trying
6068 to not grow past this limit too much.  Default value is 256 bytes.
6070 @item large-stack-frame-growth
6071 Specifies maximal growth of large stack frames caused by inlining in percents.
6072 The default value is 1000 which limits large stack frame growth to 11 times
6073 the original size.
6075 @item max-inline-insns-recursive
6076 @itemx max-inline-insns-recursive-auto
6077 Specifies maximum number of instructions out-of-line copy of self recursive inline
6078 function can grow into by performing recursive inlining.
6080 For functions declared inline @option{--param max-inline-insns-recursive} is
6081 taken into account.  For function not declared inline, recursive inlining
6082 happens only when @option{-finline-functions} (included in @option{-O3}) is
6083 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6084 default value is 450.
6086 @item max-inline-recursive-depth
6087 @itemx max-inline-recursive-depth-auto
6088 Specifies maximum recursion depth used by the recursive inlining.
6090 For functions declared inline @option{--param max-inline-recursive-depth} is
6091 taken into account.  For function not declared inline, recursive inlining
6092 happens only when @option{-finline-functions} (included in @option{-O3}) is
6093 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6094 default value is 450.
6096 @item min-inline-recursive-probability
6097 Recursive inlining is profitable only for function having deep recursion
6098 in average and can hurt for function having little recursion depth by
6099 increasing the prologue size or complexity of function body to other
6100 optimizers.
6102 When profile feedback is available (see @option{-fprofile-generate}) the actual
6103 recursion depth can be guessed from probability that function will recurse via
6104 given call expression.  This parameter limits inlining only to call expression
6105 whose probability exceeds given threshold (in percents).  The default value is
6108 @item inline-call-cost
6109 Specify cost of call instruction relative to simple arithmetics operations
6110 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6111 functions and at the same time increases size of leaf function that is believed to
6112 reduce function size by being inlined.  In effect it increases amount of
6113 inlining for code having large abstraction penalty (many functions that just
6114 pass the arguments to other functions) and decrease inlining for code with low
6115 abstraction penalty.  The default value is 16.
6117 @item max-unrolled-insns
6118 The maximum number of instructions that a loop should have if that loop
6119 is unrolled, and if the loop is unrolled, it determines how many times
6120 the loop code is unrolled.
6122 @item max-average-unrolled-insns
6123 The maximum number of instructions biased by probabilities of their execution
6124 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6125 it determines how many times the loop code is unrolled.
6127 @item max-unroll-times
6128 The maximum number of unrollings of a single loop.
6130 @item max-peeled-insns
6131 The maximum number of instructions that a loop should have if that loop
6132 is peeled, and if the loop is peeled, it determines how many times
6133 the loop code is peeled.
6135 @item max-peel-times
6136 The maximum number of peelings of a single loop.
6138 @item max-completely-peeled-insns
6139 The maximum number of insns of a completely peeled loop.
6141 @item max-completely-peel-times
6142 The maximum number of iterations of a loop to be suitable for complete peeling.
6144 @item max-unswitch-insns
6145 The maximum number of insns of an unswitched loop.
6147 @item max-unswitch-level
6148 The maximum number of branches unswitched in a single loop.
6150 @item lim-expensive
6151 The minimum cost of an expensive expression in the loop invariant motion.
6153 @item iv-consider-all-candidates-bound
6154 Bound on number of candidates for induction variables below that
6155 all candidates are considered for each use in induction variable
6156 optimizations.  Only the most relevant candidates are considered
6157 if there are more candidates, to avoid quadratic time complexity.
6159 @item iv-max-considered-uses
6160 The induction variable optimizations give up on loops that contain more
6161 induction variable uses.
6163 @item iv-always-prune-cand-set-bound
6164 If number of candidates in the set is smaller than this value,
6165 we always try to remove unnecessary ivs from the set during its
6166 optimization when a new iv is added to the set.
6168 @item scev-max-expr-size
6169 Bound on size of expressions used in the scalar evolutions analyzer.
6170 Large expressions slow the analyzer.
6172 @item vect-max-version-checks
6173 The maximum number of runtime checks that can be performed when doing
6174 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6175 for more information.
6177 @item max-iterations-to-track
6179 The maximum number of iterations of a loop the brute force algorithm
6180 for analysis of # of iterations of the loop tries to evaluate.
6182 @item hot-bb-count-fraction
6183 Select fraction of the maximal count of repetitions of basic block in program
6184 given basic block needs to have to be considered hot.
6186 @item hot-bb-frequency-fraction
6187 Select fraction of the maximal frequency of executions of basic block in
6188 function given basic block needs to have to be considered hot
6190 @item max-predicted-iterations
6191 The maximum number of loop iterations we predict statically.  This is useful
6192 in cases where function contain single loop with known bound and other loop
6193 with unknown.  We predict the known number of iterations correctly, while
6194 the unknown number of iterations average to roughly 10.  This means that the
6195 loop without bounds would appear artificially cold relative to the other one.
6197 @item tracer-dynamic-coverage
6198 @itemx tracer-dynamic-coverage-feedback
6200 This value is used to limit superblock formation once the given percentage of
6201 executed instructions is covered.  This limits unnecessary code size
6202 expansion.
6204 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6205 feedback is available.  The real profiles (as opposed to statically estimated
6206 ones) are much less balanced allowing the threshold to be larger value.
6208 @item tracer-max-code-growth
6209 Stop tail duplication once code growth has reached given percentage.  This is
6210 rather hokey argument, as most of the duplicates will be eliminated later in
6211 cross jumping, so it may be set to much higher values than is the desired code
6212 growth.
6214 @item tracer-min-branch-ratio
6216 Stop reverse growth when the reverse probability of best edge is less than this
6217 threshold (in percent).
6219 @item tracer-min-branch-ratio
6220 @itemx tracer-min-branch-ratio-feedback
6222 Stop forward growth if the best edge do have probability lower than this
6223 threshold.
6225 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6226 compilation for profile feedback and one for compilation without.  The value
6227 for compilation with profile feedback needs to be more conservative (higher) in
6228 order to make tracer effective.
6230 @item max-cse-path-length
6232 Maximum number of basic blocks on path that cse considers.  The default is 10.
6234 @item max-cse-insns
6235 The maximum instructions CSE process before flushing. The default is 1000.
6237 @item max-aliased-vops
6239 Maximum number of virtual operands per statement allowed to represent
6240 aliases before triggering the alias grouping heuristic.  Alias
6241 grouping reduces compile times and memory consumption needed for
6242 aliasing at the expense of precision loss in alias information.
6244 @item ggc-min-expand
6246 GCC uses a garbage collector to manage its own memory allocation.  This
6247 parameter specifies the minimum percentage by which the garbage
6248 collector's heap should be allowed to expand between collections.
6249 Tuning this may improve compilation speed; it has no effect on code
6250 generation.
6252 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6253 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6254 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6255 GCC is not able to calculate RAM on a particular platform, the lower
6256 bound of 30% is used.  Setting this parameter and
6257 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6258 every opportunity.  This is extremely slow, but can be useful for
6259 debugging.
6261 @item ggc-min-heapsize
6263 Minimum size of the garbage collector's heap before it begins bothering
6264 to collect garbage.  The first collection occurs after the heap expands
6265 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6266 tuning this may improve compilation speed, and has no effect on code
6267 generation.
6269 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6270 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6271 with a lower bound of 4096 (four megabytes) and an upper bound of
6272 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6273 particular platform, the lower bound is used.  Setting this parameter
6274 very large effectively disables garbage collection.  Setting this
6275 parameter and @option{ggc-min-expand} to zero causes a full collection
6276 to occur at every opportunity.
6278 @item max-reload-search-insns
6279 The maximum number of instruction reload should look backward for equivalent
6280 register.  Increasing values mean more aggressive optimization, making the
6281 compile time increase with probably slightly better performance.  The default
6282 value is 100.
6284 @item max-cselib-memory-locations
6285 The maximum number of memory locations cselib should take into account.
6286 Increasing values mean more aggressive optimization, making the compile time
6287 increase with probably slightly better performance.  The default value is 500.
6289 @item max-flow-memory-locations
6290 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6291 The default value is 100.
6293 @item reorder-blocks-duplicate
6294 @itemx reorder-blocks-duplicate-feedback
6296 Used by basic block reordering pass to decide whether to use unconditional
6297 branch or duplicate the code on its destination.  Code is duplicated when its
6298 estimated size is smaller than this value multiplied by the estimated size of
6299 unconditional jump in the hot spots of the program.
6301 The @option{reorder-block-duplicate-feedback} is used only when profile
6302 feedback is available and may be set to higher values than
6303 @option{reorder-block-duplicate} since information about the hot spots is more
6304 accurate.
6306 @item max-sched-ready-insns
6307 The maximum number of instructions ready to be issued the scheduler should
6308 consider at any given time during the first scheduling pass.  Increasing
6309 values mean more thorough searches, making the compilation time increase
6310 with probably little benefit.  The default value is 100.
6312 @item max-sched-region-blocks
6313 The maximum number of blocks in a region to be considered for
6314 interblock scheduling.  The default value is 10.
6316 @item max-sched-region-insns
6317 The maximum number of insns in a region to be considered for
6318 interblock scheduling.  The default value is 100.
6320 @item min-spec-prob
6321 The minimum probability (in percents) of reaching a source block
6322 for interblock speculative scheduling.  The default value is 40.
6324 @item max-sched-extend-regions-iters
6325 The maximum number of iterations through CFG to extend regions.
6326 0 - disable region extension,
6327 N - do at most N iterations.
6328 The default value is 0.
6330 @item max-sched-insn-conflict-delay
6331 The maximum conflict delay for an insn to be considered for speculative motion.
6332 The default value is 3.
6334 @item sched-spec-prob-cutoff
6335 The minimal probability of speculation success (in percents), so that
6336 speculative insn will be scheduled.
6337 The default value is 40.
6339 @item max-last-value-rtl
6341 The maximum size measured as number of RTLs that can be recorded in an expression
6342 in combiner for a pseudo register as last known value of that register.  The default
6343 is 10000.
6345 @item integer-share-limit
6346 Small integer constants can use a shared data structure, reducing the
6347 compiler's memory usage and increasing its speed.  This sets the maximum
6348 value of a shared integer constant's.  The default value is 256.
6350 @item min-virtual-mappings
6351 Specifies the minimum number of virtual mappings in the incremental
6352 SSA updater that should be registered to trigger the virtual mappings
6353 heuristic defined by virtual-mappings-ratio.  The default value is
6354 100.
6356 @item virtual-mappings-ratio
6357 If the number of virtual mappings is virtual-mappings-ratio bigger
6358 than the number of virtual symbols to be updated, then the incremental
6359 SSA updater switches to a full update for those symbols.  The default
6360 ratio is 3.
6362 @item ssp-buffer-size
6363 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6364 protection when @option{-fstack-protection} is used.
6366 @item max-jump-thread-duplication-stmts
6367 Maximum number of statements allowed in a block that needs to be
6368 duplicated when threading jumps.
6370 @item max-fields-for-field-sensitive
6371 Maximum number of fields in a structure we will treat in
6372 a field sensitive manner during pointer analysis.
6374 @item prefetch-latency
6375 Estimate on average number of instructions that are executed before
6376 prefetch finishes.  The distance we prefetch ahead is proportional
6377 to this constant.  Increasing this number may also lead to less
6378 streams being prefetched (see @option{simultaneous-prefetches}).
6380 @item simultaneous-prefetches
6381 Maximum number of prefetches that can run at the same time.
6383 @item l1-cache-line-size
6384 The size of cache line in L1 cache, in bytes.
6386 @item l1-cache-size
6387 The number of cache lines in L1 cache.
6389 @end table
6390 @end table
6392 @node Preprocessor Options
6393 @section Options Controlling the Preprocessor
6394 @cindex preprocessor options
6395 @cindex options, preprocessor
6397 These options control the C preprocessor, which is run on each C source
6398 file before actual compilation.
6400 If you use the @option{-E} option, nothing is done except preprocessing.
6401 Some of these options make sense only together with @option{-E} because
6402 they cause the preprocessor output to be unsuitable for actual
6403 compilation.
6405 @table @gcctabopt
6406 @opindex Wp
6407 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6408 and pass @var{option} directly through to the preprocessor.  If
6409 @var{option} contains commas, it is split into multiple options at the
6410 commas.  However, many options are modified, translated or interpreted
6411 by the compiler driver before being passed to the preprocessor, and
6412 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6413 interface is undocumented and subject to change, so whenever possible
6414 you should avoid using @option{-Wp} and let the driver handle the
6415 options instead.
6417 @item -Xpreprocessor @var{option}
6418 @opindex preprocessor
6419 Pass @var{option} as an option to the preprocessor.  You can use this to
6420 supply system-specific preprocessor options which GCC does not know how to
6421 recognize.
6423 If you want to pass an option that takes an argument, you must use
6424 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6425 @end table
6427 @include cppopts.texi
6429 @node Assembler Options
6430 @section Passing Options to the Assembler
6432 @c prevent bad page break with this line
6433 You can pass options to the assembler.
6435 @table @gcctabopt
6436 @item -Wa,@var{option}
6437 @opindex Wa
6438 Pass @var{option} as an option to the assembler.  If @var{option}
6439 contains commas, it is split into multiple options at the commas.
6441 @item -Xassembler @var{option}
6442 @opindex Xassembler
6443 Pass @var{option} as an option to the assembler.  You can use this to
6444 supply system-specific assembler options which GCC does not know how to
6445 recognize.
6447 If you want to pass an option that takes an argument, you must use
6448 @option{-Xassembler} twice, once for the option and once for the argument.
6450 @end table
6452 @node Link Options
6453 @section Options for Linking
6454 @cindex link options
6455 @cindex options, linking
6457 These options come into play when the compiler links object files into
6458 an executable output file.  They are meaningless if the compiler is
6459 not doing a link step.
6461 @table @gcctabopt
6462 @cindex file names
6463 @item @var{object-file-name}
6464 A file name that does not end in a special recognized suffix is
6465 considered to name an object file or library.  (Object files are
6466 distinguished from libraries by the linker according to the file
6467 contents.)  If linking is done, these object files are used as input
6468 to the linker.
6470 @item -c
6471 @itemx -S
6472 @itemx -E
6473 @opindex c
6474 @opindex S
6475 @opindex E
6476 If any of these options is used, then the linker is not run, and
6477 object file names should not be used as arguments.  @xref{Overall
6478 Options}.
6480 @cindex Libraries
6481 @item -l@var{library}
6482 @itemx -l @var{library}
6483 @opindex l
6484 Search the library named @var{library} when linking.  (The second
6485 alternative with the library as a separate argument is only for
6486 POSIX compliance and is not recommended.)
6488 It makes a difference where in the command you write this option; the
6489 linker searches and processes libraries and object files in the order they
6490 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6491 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6492 to functions in @samp{z}, those functions may not be loaded.
6494 The linker searches a standard list of directories for the library,
6495 which is actually a file named @file{lib@var{library}.a}.  The linker
6496 then uses this file as if it had been specified precisely by name.
6498 The directories searched include several standard system directories
6499 plus any that you specify with @option{-L}.
6501 Normally the files found this way are library files---archive files
6502 whose members are object files.  The linker handles an archive file by
6503 scanning through it for members which define symbols that have so far
6504 been referenced but not defined.  But if the file that is found is an
6505 ordinary object file, it is linked in the usual fashion.  The only
6506 difference between using an @option{-l} option and specifying a file name
6507 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6508 and searches several directories.
6510 @item -lobjc
6511 @opindex lobjc
6512 You need this special case of the @option{-l} option in order to
6513 link an Objective-C or Objective-C++ program.
6515 @item -nostartfiles
6516 @opindex nostartfiles
6517 Do not use the standard system startup files when linking.
6518 The standard system libraries are used normally, unless @option{-nostdlib}
6519 or @option{-nodefaultlibs} is used.
6521 @item -nodefaultlibs
6522 @opindex nodefaultlibs
6523 Do not use the standard system libraries when linking.
6524 Only the libraries you specify will be passed to the linker.
6525 The standard startup files are used normally, unless @option{-nostartfiles}
6526 is used.  The compiler may generate calls to @code{memcmp},
6527 @code{memset}, @code{memcpy} and @code{memmove}.
6528 These entries are usually resolved by entries in
6529 libc.  These entry points should be supplied through some other
6530 mechanism when this option is specified.
6532 @item -nostdlib
6533 @opindex nostdlib
6534 Do not use the standard system startup files or libraries when linking.
6535 No startup files and only the libraries you specify will be passed to
6536 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6537 @code{memcpy} and @code{memmove}.
6538 These entries are usually resolved by entries in
6539 libc.  These entry points should be supplied through some other
6540 mechanism when this option is specified.
6542 @cindex @option{-lgcc}, use with @option{-nostdlib}
6543 @cindex @option{-nostdlib} and unresolved references
6544 @cindex unresolved references and @option{-nostdlib}
6545 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6546 @cindex @option{-nodefaultlibs} and unresolved references
6547 @cindex unresolved references and @option{-nodefaultlibs}
6548 One of the standard libraries bypassed by @option{-nostdlib} and
6549 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6550 that GCC uses to overcome shortcomings of particular machines, or special
6551 needs for some languages.
6552 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6553 Collection (GCC) Internals},
6554 for more discussion of @file{libgcc.a}.)
6555 In most cases, you need @file{libgcc.a} even when you want to avoid
6556 other standard libraries.  In other words, when you specify @option{-nostdlib}
6557 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6558 This ensures that you have no unresolved references to internal GCC
6559 library subroutines.  (For example, @samp{__main}, used to ensure C++
6560 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6561 GNU Compiler Collection (GCC) Internals}.)
6563 @item -pie
6564 @opindex pie
6565 Produce a position independent executable on targets which support it.
6566 For predictable results, you must also specify the same set of options
6567 that were used to generate code (@option{-fpie}, @option{-fPIE},
6568 or model suboptions) when you specify this option.
6570 @item -rdynamic
6571 @opindex rdynamic
6572 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6573 that support it. This instructs the linker to add all symbols, not
6574 only used ones, to the dynamic symbol table. This option is needed
6575 for some uses of @code{dlopen} or to allow obtaining backtraces
6576 from within a program.
6578 @item -s
6579 @opindex s
6580 Remove all symbol table and relocation information from the executable.
6582 @item -static
6583 @opindex static
6584 On systems that support dynamic linking, this prevents linking with the shared
6585 libraries.  On other systems, this option has no effect.
6587 @item -shared
6588 @opindex shared
6589 Produce a shared object which can then be linked with other objects to
6590 form an executable.  Not all systems support this option.  For predictable
6591 results, you must also specify the same set of options that were used to
6592 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6593 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6594 needs to build supplementary stub code for constructors to work.  On
6595 multi-libbed systems, @samp{gcc -shared} must select the correct support
6596 libraries to link against.  Failing to supply the correct flags may lead
6597 to subtle defects.  Supplying them in cases where they are not necessary
6598 is innocuous.}
6600 @item -shared-libgcc
6601 @itemx -static-libgcc
6602 @opindex shared-libgcc
6603 @opindex static-libgcc
6604 On systems that provide @file{libgcc} as a shared library, these options
6605 force the use of either the shared or static version respectively.
6606 If no shared version of @file{libgcc} was built when the compiler was
6607 configured, these options have no effect.
6609 There are several situations in which an application should use the
6610 shared @file{libgcc} instead of the static version.  The most common
6611 of these is when the application wishes to throw and catch exceptions
6612 across different shared libraries.  In that case, each of the libraries
6613 as well as the application itself should use the shared @file{libgcc}.
6615 Therefore, the G++ and GCJ drivers automatically add
6616 @option{-shared-libgcc} whenever you build a shared library or a main
6617 executable, because C++ and Java programs typically use exceptions, so
6618 this is the right thing to do.
6620 If, instead, you use the GCC driver to create shared libraries, you may
6621 find that they will not always be linked with the shared @file{libgcc}.
6622 If GCC finds, at its configuration time, that you have a non-GNU linker
6623 or a GNU linker that does not support option @option{--eh-frame-hdr},
6624 it will link the shared version of @file{libgcc} into shared libraries
6625 by default.  Otherwise, it will take advantage of the linker and optimize
6626 away the linking with the shared version of @file{libgcc}, linking with
6627 the static version of libgcc by default.  This allows exceptions to
6628 propagate through such shared libraries, without incurring relocation
6629 costs at library load time.
6631 However, if a library or main executable is supposed to throw or catch
6632 exceptions, you must link it using the G++ or GCJ driver, as appropriate
6633 for the languages used in the program, or using the option
6634 @option{-shared-libgcc}, such that it is linked with the shared
6635 @file{libgcc}.
6637 @item -symbolic
6638 @opindex symbolic
6639 Bind references to global symbols when building a shared object.  Warn
6640 about any unresolved references (unless overridden by the link editor
6641 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
6642 this option.
6644 @item -Xlinker @var{option}
6645 @opindex Xlinker
6646 Pass @var{option} as an option to the linker.  You can use this to
6647 supply system-specific linker options which GCC does not know how to
6648 recognize.
6650 If you want to pass an option that takes an argument, you must use
6651 @option{-Xlinker} twice, once for the option and once for the argument.
6652 For example, to pass @option{-assert definitions}, you must write
6653 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
6654 @option{-Xlinker "-assert definitions"}, because this passes the entire
6655 string as a single argument, which is not what the linker expects.
6657 @item -Wl,@var{option}
6658 @opindex Wl
6659 Pass @var{option} as an option to the linker.  If @var{option} contains
6660 commas, it is split into multiple options at the commas.
6662 @item -u @var{symbol}
6663 @opindex u
6664 Pretend the symbol @var{symbol} is undefined, to force linking of
6665 library modules to define it.  You can use @option{-u} multiple times with
6666 different symbols to force loading of additional library modules.
6667 @end table
6669 @node Directory Options
6670 @section Options for Directory Search
6671 @cindex directory options
6672 @cindex options, directory search
6673 @cindex search path
6675 These options specify directories to search for header files, for
6676 libraries and for parts of the compiler:
6678 @table @gcctabopt
6679 @item -I@var{dir}
6680 @opindex I
6681 Add the directory @var{dir} to the head of the list of directories to be
6682 searched for header files.  This can be used to override a system header
6683 file, substituting your own version, since these directories are
6684 searched before the system header file directories.  However, you should
6685 not use this option to add directories that contain vendor-supplied
6686 system header files (use @option{-isystem} for that).  If you use more than
6687 one @option{-I} option, the directories are scanned in left-to-right
6688 order; the standard system directories come after.
6690 If a standard system include directory, or a directory specified with
6691 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
6692 option will be ignored.  The directory will still be searched but as a
6693 system directory at its normal position in the system include chain.
6694 This is to ensure that GCC's procedure to fix buggy system headers and
6695 the ordering for the include_next directive are not inadvertently changed.
6696 If you really need to change the search order for system directories,
6697 use the @option{-nostdinc} and/or @option{-isystem} options.
6699 @item -iquote@var{dir}
6700 @opindex iquote
6701 Add the directory @var{dir} to the head of the list of directories to
6702 be searched for header files only for the case of @samp{#include
6703 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
6704 otherwise just like @option{-I}.
6706 @item -L@var{dir}
6707 @opindex L
6708 Add directory @var{dir} to the list of directories to be searched
6709 for @option{-l}.
6711 @item -B@var{prefix}
6712 @opindex B
6713 This option specifies where to find the executables, libraries,
6714 include files, and data files of the compiler itself.
6716 The compiler driver program runs one or more of the subprograms
6717 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
6718 @var{prefix} as a prefix for each program it tries to run, both with and
6719 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
6721 For each subprogram to be run, the compiler driver first tries the
6722 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
6723 was not specified, the driver tries two standard prefixes, which are
6724 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
6725 those results in a file name that is found, the unmodified program
6726 name is searched for using the directories specified in your
6727 @env{PATH} environment variable.
6729 The compiler will check to see if the path provided by the @option{-B}
6730 refers to a directory, and if necessary it will add a directory
6731 separator character at the end of the path.
6733 @option{-B} prefixes that effectively specify directory names also apply
6734 to libraries in the linker, because the compiler translates these
6735 options into @option{-L} options for the linker.  They also apply to
6736 includes files in the preprocessor, because the compiler translates these
6737 options into @option{-isystem} options for the preprocessor.  In this case,
6738 the compiler appends @samp{include} to the prefix.
6740 The run-time support file @file{libgcc.a} can also be searched for using
6741 the @option{-B} prefix, if needed.  If it is not found there, the two
6742 standard prefixes above are tried, and that is all.  The file is left
6743 out of the link if it is not found by those means.
6745 Another way to specify a prefix much like the @option{-B} prefix is to use
6746 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
6747 Variables}.
6749 As a special kludge, if the path provided by @option{-B} is
6750 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
6751 9, then it will be replaced by @file{[dir/]include}.  This is to help
6752 with boot-strapping the compiler.
6754 @item -specs=@var{file}
6755 @opindex specs
6756 Process @var{file} after the compiler reads in the standard @file{specs}
6757 file, in order to override the defaults that the @file{gcc} driver
6758 program uses when determining what switches to pass to @file{cc1},
6759 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
6760 @option{-specs=@var{file}} can be specified on the command line, and they
6761 are processed in order, from left to right.
6763 @item --sysroot=@var{dir}
6764 @opindex sysroot
6765 Use @var{dir} as the logical root directory for headers and libraries.
6766 For example, if the compiler would normally search for headers in
6767 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
6768 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.  
6770 If you use both this option and the @option{-isysroot} option, then
6771 the @option{--sysroot} option will apply to libraries, but the
6772 @option{-isysroot} option will apply to header files.
6774 The GNU linker (beginning with version 2.16) has the necessary support
6775 for this option.  If your linker does not support this option, the
6776 header file aspect of @option{--sysroot} will still work, but the
6777 library aspect will not.
6779 @item -I-
6780 @opindex I-
6781 This option has been deprecated.  Please use @option{-iquote} instead for
6782 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
6783 Any directories you specify with @option{-I} options before the @option{-I-}
6784 option are searched only for the case of @samp{#include "@var{file}"};
6785 they are not searched for @samp{#include <@var{file}>}.
6787 If additional directories are specified with @option{-I} options after
6788 the @option{-I-}, these directories are searched for all @samp{#include}
6789 directives.  (Ordinarily @emph{all} @option{-I} directories are used
6790 this way.)
6792 In addition, the @option{-I-} option inhibits the use of the current
6793 directory (where the current input file came from) as the first search
6794 directory for @samp{#include "@var{file}"}.  There is no way to
6795 override this effect of @option{-I-}.  With @option{-I.} you can specify
6796 searching the directory which was current when the compiler was
6797 invoked.  That is not exactly the same as what the preprocessor does
6798 by default, but it is often satisfactory.
6800 @option{-I-} does not inhibit the use of the standard system directories
6801 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
6802 independent.
6803 @end table
6805 @c man end
6807 @node Spec Files
6808 @section Specifying subprocesses and the switches to pass to them
6809 @cindex Spec Files
6811 @command{gcc} is a driver program.  It performs its job by invoking a
6812 sequence of other programs to do the work of compiling, assembling and
6813 linking.  GCC interprets its command-line parameters and uses these to
6814 deduce which programs it should invoke, and which command-line options
6815 it ought to place on their command lines.  This behavior is controlled
6816 by @dfn{spec strings}.  In most cases there is one spec string for each
6817 program that GCC can invoke, but a few programs have multiple spec
6818 strings to control their behavior.  The spec strings built into GCC can
6819 be overridden by using the @option{-specs=} command-line switch to specify
6820 a spec file.
6822 @dfn{Spec files} are plaintext files that are used to construct spec
6823 strings.  They consist of a sequence of directives separated by blank
6824 lines.  The type of directive is determined by the first non-whitespace
6825 character on the line and it can be one of the following:
6827 @table @code
6828 @item %@var{command}
6829 Issues a @var{command} to the spec file processor.  The commands that can
6830 appear here are:
6832 @table @code
6833 @item %include <@var{file}>
6834 @cindex %include
6835 Search for @var{file} and insert its text at the current point in the
6836 specs file.
6838 @item %include_noerr <@var{file}>
6839 @cindex %include_noerr
6840 Just like @samp{%include}, but do not generate an error message if the include
6841 file cannot be found.
6843 @item %rename @var{old_name} @var{new_name}
6844 @cindex %rename
6845 Rename the spec string @var{old_name} to @var{new_name}.
6847 @end table
6849 @item *[@var{spec_name}]:
6850 This tells the compiler to create, override or delete the named spec
6851 string.  All lines after this directive up to the next directive or
6852 blank line are considered to be the text for the spec string.  If this
6853 results in an empty string then the spec will be deleted.  (Or, if the
6854 spec did not exist, then nothing will happened.)  Otherwise, if the spec
6855 does not currently exist a new spec will be created.  If the spec does
6856 exist then its contents will be overridden by the text of this
6857 directive, unless the first character of that text is the @samp{+}
6858 character, in which case the text will be appended to the spec.
6860 @item [@var{suffix}]:
6861 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
6862 and up to the next directive or blank line are considered to make up the
6863 spec string for the indicated suffix.  When the compiler encounters an
6864 input file with the named suffix, it will processes the spec string in
6865 order to work out how to compile that file.  For example:
6867 @smallexample
6868 .ZZ:
6869 z-compile -input %i
6870 @end smallexample
6872 This says that any input file whose name ends in @samp{.ZZ} should be
6873 passed to the program @samp{z-compile}, which should be invoked with the
6874 command-line switch @option{-input} and with the result of performing the
6875 @samp{%i} substitution.  (See below.)
6877 As an alternative to providing a spec string, the text that follows a
6878 suffix directive can be one of the following:
6880 @table @code
6881 @item @@@var{language}
6882 This says that the suffix is an alias for a known @var{language}.  This is
6883 similar to using the @option{-x} command-line switch to GCC to specify a
6884 language explicitly.  For example:
6886 @smallexample
6887 .ZZ:
6888 @@c++
6889 @end smallexample
6891 Says that .ZZ files are, in fact, C++ source files.
6893 @item #@var{name}
6894 This causes an error messages saying:
6896 @smallexample
6897 @var{name} compiler not installed on this system.
6898 @end smallexample
6899 @end table
6901 GCC already has an extensive list of suffixes built into it.
6902 This directive will add an entry to the end of the list of suffixes, but
6903 since the list is searched from the end backwards, it is effectively
6904 possible to override earlier entries using this technique.
6906 @end table
6908 GCC has the following spec strings built into it.  Spec files can
6909 override these strings or create their own.  Note that individual
6910 targets can also add their own spec strings to this list.
6912 @smallexample
6913 asm          Options to pass to the assembler
6914 asm_final    Options to pass to the assembler post-processor
6915 cpp          Options to pass to the C preprocessor
6916 cc1          Options to pass to the C compiler
6917 cc1plus      Options to pass to the C++ compiler
6918 endfile      Object files to include at the end of the link
6919 link         Options to pass to the linker
6920 lib          Libraries to include on the command line to the linker
6921 libgcc       Decides which GCC support library to pass to the linker
6922 linker       Sets the name of the linker
6923 predefines   Defines to be passed to the C preprocessor
6924 signed_char  Defines to pass to CPP to say whether @code{char} is signed
6925              by default
6926 startfile    Object files to include at the start of the link
6927 @end smallexample
6929 Here is a small example of a spec file:
6931 @smallexample
6932 %rename lib                 old_lib
6934 *lib:
6935 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
6936 @end smallexample
6938 This example renames the spec called @samp{lib} to @samp{old_lib} and
6939 then overrides the previous definition of @samp{lib} with a new one.
6940 The new definition adds in some extra command-line options before
6941 including the text of the old definition.
6943 @dfn{Spec strings} are a list of command-line options to be passed to their
6944 corresponding program.  In addition, the spec strings can contain
6945 @samp{%}-prefixed sequences to substitute variable text or to
6946 conditionally insert text into the command line.  Using these constructs
6947 it is possible to generate quite complex command lines.
6949 Here is a table of all defined @samp{%}-sequences for spec
6950 strings.  Note that spaces are not generated automatically around the
6951 results of expanding these sequences.  Therefore you can concatenate them
6952 together or combine them with constant text in a single argument.
6954 @table @code
6955 @item %%
6956 Substitute one @samp{%} into the program name or argument.
6958 @item %i
6959 Substitute the name of the input file being processed.
6961 @item %b
6962 Substitute the basename of the input file being processed.
6963 This is the substring up to (and not including) the last period
6964 and not including the directory.
6966 @item %B
6967 This is the same as @samp{%b}, but include the file suffix (text after
6968 the last period).
6970 @item %d
6971 Marks the argument containing or following the @samp{%d} as a
6972 temporary file name, so that that file will be deleted if GCC exits
6973 successfully.  Unlike @samp{%g}, this contributes no text to the
6974 argument.
6976 @item %g@var{suffix}
6977 Substitute a file name that has suffix @var{suffix} and is chosen
6978 once per compilation, and mark the argument in the same way as
6979 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
6980 name is now chosen in a way that is hard to predict even when previously
6981 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
6982 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
6983 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
6984 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
6985 was simply substituted with a file name chosen once per compilation,
6986 without regard to any appended suffix (which was therefore treated
6987 just like ordinary text), making such attacks more likely to succeed.
6989 @item %u@var{suffix}
6990 Like @samp{%g}, but generates a new temporary file name even if
6991 @samp{%u@var{suffix}} was already seen.
6993 @item %U@var{suffix}
6994 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
6995 new one if there is no such last file name.  In the absence of any
6996 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
6997 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
6998 would involve the generation of two distinct file names, one
6999 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
7000 simply substituted with a file name chosen for the previous @samp{%u},
7001 without regard to any appended suffix.
7003 @item %j@var{suffix}
7004 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7005 writable, and if save-temps is off; otherwise, substitute the name
7006 of a temporary file, just like @samp{%u}.  This temporary file is not
7007 meant for communication between processes, but rather as a junk
7008 disposal mechanism.
7010 @item %|@var{suffix}
7011 @itemx %m@var{suffix}
7012 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7013 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7014 all.  These are the two most common ways to instruct a program that it
7015 should read from standard input or write to standard output.  If you
7016 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7017 construct: see for example @file{f/lang-specs.h}.
7019 @item %.@var{SUFFIX}
7020 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7021 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7022 terminated by the next space or %.
7024 @item %w
7025 Marks the argument containing or following the @samp{%w} as the
7026 designated output file of this compilation.  This puts the argument
7027 into the sequence of arguments that @samp{%o} will substitute later.
7029 @item %o
7030 Substitutes the names of all the output files, with spaces
7031 automatically placed around them.  You should write spaces
7032 around the @samp{%o} as well or the results are undefined.
7033 @samp{%o} is for use in the specs for running the linker.
7034 Input files whose names have no recognized suffix are not compiled
7035 at all, but they are included among the output files, so they will
7036 be linked.
7038 @item %O
7039 Substitutes the suffix for object files.  Note that this is
7040 handled specially when it immediately follows @samp{%g, %u, or %U},
7041 because of the need for those to form complete file names.  The
7042 handling is such that @samp{%O} is treated exactly as if it had already
7043 been substituted, except that @samp{%g, %u, and %U} do not currently
7044 support additional @var{suffix} characters following @samp{%O} as they would
7045 following, for example, @samp{.o}.
7047 @item %p
7048 Substitutes the standard macro predefinitions for the
7049 current target machine.  Use this when running @code{cpp}.
7051 @item %P
7052 Like @samp{%p}, but puts @samp{__} before and after the name of each
7053 predefined macro, except for macros that start with @samp{__} or with
7054 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7057 @item %I
7058 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7059 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7060 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7061 and @option{-imultilib} as necessary.
7063 @item %s
7064 Current argument is the name of a library or startup file of some sort.
7065 Search for that file in a standard list of directories and substitute
7066 the full name found.
7068 @item %e@var{str}
7069 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7070 Use this when inconsistent options are detected.
7072 @item %(@var{name})
7073 Substitute the contents of spec string @var{name} at this point.
7075 @item %[@var{name}]
7076 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7078 @item %x@{@var{option}@}
7079 Accumulate an option for @samp{%X}.
7081 @item %X
7082 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7083 spec string.
7085 @item %Y
7086 Output the accumulated assembler options specified by @option{-Wa}.
7088 @item %Z
7089 Output the accumulated preprocessor options specified by @option{-Wp}.
7091 @item %a
7092 Process the @code{asm} spec.  This is used to compute the
7093 switches to be passed to the assembler.
7095 @item %A
7096 Process the @code{asm_final} spec.  This is a spec string for
7097 passing switches to an assembler post-processor, if such a program is
7098 needed.
7100 @item %l
7101 Process the @code{link} spec.  This is the spec for computing the
7102 command line passed to the linker.  Typically it will make use of the
7103 @samp{%L %G %S %D and %E} sequences.
7105 @item %D
7106 Dump out a @option{-L} option for each directory that GCC believes might
7107 contain startup files.  If the target supports multilibs then the
7108 current multilib directory will be prepended to each of these paths.
7110 @item %L
7111 Process the @code{lib} spec.  This is a spec string for deciding which
7112 libraries should be included on the command line to the linker.
7114 @item %G
7115 Process the @code{libgcc} spec.  This is a spec string for deciding
7116 which GCC support library should be included on the command line to the linker.
7118 @item %S
7119 Process the @code{startfile} spec.  This is a spec for deciding which
7120 object files should be the first ones passed to the linker.  Typically
7121 this might be a file named @file{crt0.o}.
7123 @item %E
7124 Process the @code{endfile} spec.  This is a spec string that specifies
7125 the last object files that will be passed to the linker.
7127 @item %C
7128 Process the @code{cpp} spec.  This is used to construct the arguments
7129 to be passed to the C preprocessor.
7131 @item %1
7132 Process the @code{cc1} spec.  This is used to construct the options to be
7133 passed to the actual C compiler (@samp{cc1}).
7135 @item %2
7136 Process the @code{cc1plus} spec.  This is used to construct the options to be
7137 passed to the actual C++ compiler (@samp{cc1plus}).
7139 @item %*
7140 Substitute the variable part of a matched option.  See below.
7141 Note that each comma in the substituted string is replaced by
7142 a single space.
7144 @item %<@code{S}
7145 Remove all occurrences of @code{-S} from the command line.  Note---this
7146 command is position dependent.  @samp{%} commands in the spec string
7147 before this one will see @code{-S}, @samp{%} commands in the spec string
7148 after this one will not.
7150 @item %:@var{function}(@var{args})
7151 Call the named function @var{function}, passing it @var{args}.
7152 @var{args} is first processed as a nested spec string, then split
7153 into an argument vector in the usual fashion.  The function returns
7154 a string which is processed as if it had appeared literally as part
7155 of the current spec.
7157 The following built-in spec functions are provided:
7159 @table @code
7160 @item @code{if-exists}
7161 The @code{if-exists} spec function takes one argument, an absolute
7162 pathname to a file.  If the file exists, @code{if-exists} returns the
7163 pathname.  Here is a small example of its usage:
7165 @smallexample
7166 *startfile:
7167 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7168 @end smallexample
7170 @item @code{if-exists-else}
7171 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7172 spec function, except that it takes two arguments.  The first argument is
7173 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7174 returns the pathname.  If it does not exist, it returns the second argument.
7175 This way, @code{if-exists-else} can be used to select one file or another,
7176 based on the existence of the first.  Here is a small example of its usage:
7178 @smallexample
7179 *startfile:
7180 crt0%O%s %:if-exists(crti%O%s) \
7181 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7182 @end smallexample
7184 @item @code{replace-outfile}
7185 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7186 first argument in the outfiles array and replaces it with the second argument.  Here
7187 is a small example of its usage:
7189 @smallexample
7190 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7191 @end smallexample
7193 @end table
7195 @item %@{@code{S}@}
7196 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7197 If that switch was not specified, this substitutes nothing.  Note that
7198 the leading dash is omitted when specifying this option, and it is
7199 automatically inserted if the substitution is performed.  Thus the spec
7200 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7201 and would output the command line option @option{-foo}.
7203 @item %W@{@code{S}@}
7204 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7205 deleted on failure.
7207 @item %@{@code{S}*@}
7208 Substitutes all the switches specified to GCC whose names start
7209 with @code{-S}, but which also take an argument.  This is used for
7210 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7211 GCC considers @option{-o foo} as being
7212 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7213 text, including the space.  Thus two arguments would be generated.
7215 @item %@{@code{S}*&@code{T}*@}
7216 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7217 (the order of @code{S} and @code{T} in the spec is not significant).
7218 There can be any number of ampersand-separated variables; for each the
7219 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7221 @item %@{@code{S}:@code{X}@}
7222 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7224 @item %@{!@code{S}:@code{X}@}
7225 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7227 @item %@{@code{S}*:@code{X}@}
7228 Substitutes @code{X} if one or more switches whose names start with
7229 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7230 once, no matter how many such switches appeared.  However, if @code{%*}
7231 appears somewhere in @code{X}, then @code{X} will be substituted once
7232 for each matching switch, with the @code{%*} replaced by the part of
7233 that switch that matched the @code{*}.
7235 @item %@{.@code{S}:@code{X}@}
7236 Substitutes @code{X}, if processing a file with suffix @code{S}.
7238 @item %@{!.@code{S}:@code{X}@}
7239 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7241 @item %@{@code{S}|@code{P}:@code{X}@}
7242 Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@.
7243 This may be combined with @samp{!}, @samp{.}, and @code{*} sequences as well,
7244 although they have a stronger binding than the @samp{|}.  If @code{%*}
7245 appears in @code{X}, all of the alternatives must be starred, and only
7246 the first matching alternative is substituted.
7248 For example, a spec string like this:
7250 @smallexample
7251 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7252 @end smallexample
7254 will output the following command-line options from the following input
7255 command-line options:
7257 @smallexample
7258 fred.c        -foo -baz
7259 jim.d         -bar -boggle
7260 -d fred.c     -foo -baz -boggle
7261 -d jim.d      -bar -baz -boggle
7262 @end smallexample
7264 @item %@{S:X; T:Y; :D@}
7266 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7267 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7268 be as many clauses as you need.  This may be combined with @code{.},
7269 @code{!}, @code{|}, and @code{*} as needed.
7272 @end table
7274 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7275 construct may contain other nested @samp{%} constructs or spaces, or
7276 even newlines.  They are processed as usual, as described above.
7277 Trailing white space in @code{X} is ignored.  White space may also
7278 appear anywhere on the left side of the colon in these constructs,
7279 except between @code{.} or @code{*} and the corresponding word.
7281 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7282 handled specifically in these constructs.  If another value of
7283 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7284 @option{-W} switch is found later in the command line, the earlier
7285 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7286 just one letter, which passes all matching options.
7288 The character @samp{|} at the beginning of the predicate text is used to
7289 indicate that a command should be piped to the following command, but
7290 only if @option{-pipe} is specified.
7292 It is built into GCC which switches take arguments and which do not.
7293 (You might think it would be useful to generalize this to allow each
7294 compiler's spec to say which switches take arguments.  But this cannot
7295 be done in a consistent fashion.  GCC cannot even decide which input
7296 files have been specified without knowing which switches take arguments,
7297 and it must know which input files to compile in order to tell which
7298 compilers to run).
7300 GCC also knows implicitly that arguments starting in @option{-l} are to be
7301 treated as compiler output files, and passed to the linker in their
7302 proper position among the other output files.
7304 @c man begin OPTIONS
7306 @node Target Options
7307 @section Specifying Target Machine and Compiler Version
7308 @cindex target options
7309 @cindex cross compiling
7310 @cindex specifying machine version
7311 @cindex specifying compiler version and target machine
7312 @cindex compiler version, specifying
7313 @cindex target machine, specifying
7315 The usual way to run GCC is to run the executable called @file{gcc}, or
7316 @file{<machine>-gcc} when cross-compiling, or
7317 @file{<machine>-gcc-<version>} to run a version other than the one that
7318 was installed last.  Sometimes this is inconvenient, so GCC provides
7319 options that will switch to another cross-compiler or version.
7321 @table @gcctabopt
7322 @item -b @var{machine}
7323 @opindex b
7324 The argument @var{machine} specifies the target machine for compilation.
7326 The value to use for @var{machine} is the same as was specified as the
7327 machine type when configuring GCC as a cross-compiler.  For
7328 example, if a cross-compiler was configured with @samp{configure
7329 arm-elf}, meaning to compile for an arm processor with elf binaries,
7330 then you would specify @option{-b arm-elf} to run that cross compiler.
7331 Because there are other options beginning with @option{-b}, the
7332 configuration must contain a hyphen. 
7334 @item -V @var{version}
7335 @opindex V
7336 The argument @var{version} specifies which version of GCC to run.
7337 This is useful when multiple versions are installed.  For example,
7338 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7339 @end table
7341 The @option{-V} and @option{-b} options work by running the
7342 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7343 use them if you can just run that directly.
7345 @node Submodel Options
7346 @section Hardware Models and Configurations
7347 @cindex submodel options
7348 @cindex specifying hardware config
7349 @cindex hardware models and configurations, specifying
7350 @cindex machine dependent options
7352 Earlier we discussed the standard option @option{-b} which chooses among
7353 different installed compilers for completely different target
7354 machines, such as VAX vs.@: 68000 vs.@: 80386.
7356 In addition, each of these target machine types can have its own
7357 special options, starting with @samp{-m}, to choose among various
7358 hardware models or configurations---for example, 68010 vs 68020,
7359 floating coprocessor or none.  A single installed version of the
7360 compiler can compile for any model or configuration, according to the
7361 options specified.
7363 Some configurations of the compiler also support additional special
7364 options, usually for compatibility with other compilers on the same
7365 platform.
7367 @c This list is ordered alphanumerically by subsection name.
7368 @c It should be the same order and spelling as these options are listed
7369 @c in Machine Dependent Options
7371 @menu
7372 * ARC Options::
7373 * ARM Options::
7374 * AVR Options::
7375 * Blackfin Options::
7376 * CRIS Options::
7377 * CRX Options::
7378 * Darwin Options::
7379 * DEC Alpha Options::
7380 * DEC Alpha/VMS Options::
7381 * FRV Options::
7382 * GNU/Linux Options::
7383 * H8/300 Options::
7384 * HPPA Options::
7385 * i386 and x86-64 Options::
7386 * IA-64 Options::
7387 * M32C Options::
7388 * M32R/D Options::
7389 * M680x0 Options::
7390 * M68hc1x Options::
7391 * MCore Options::
7392 * MIPS Options::
7393 * MMIX Options::
7394 * MN10300 Options::
7395 * MT Options::
7396 * PDP-11 Options::
7397 * PowerPC Options::
7398 * RS/6000 and PowerPC Options::
7399 * S/390 and zSeries Options::
7400 * Score Options::
7401 * SH Options::
7402 * SPARC Options::
7403 * SPU Options::
7404 * System V Options::
7405 * TMS320C3x/C4x Options::
7406 * V850 Options::
7407 * VAX Options::
7408 * x86-64 Options::
7409 * Xstormy16 Options::
7410 * Xtensa Options::
7411 * zSeries Options::
7412 @end menu
7414 @node ARC Options
7415 @subsection ARC Options
7416 @cindex ARC Options
7418 These options are defined for ARC implementations:
7420 @table @gcctabopt
7421 @item -EL
7422 @opindex EL
7423 Compile code for little endian mode.  This is the default.
7425 @item -EB
7426 @opindex EB
7427 Compile code for big endian mode.
7429 @item -mmangle-cpu
7430 @opindex mmangle-cpu
7431 Prepend the name of the cpu to all public symbol names.
7432 In multiple-processor systems, there are many ARC variants with different
7433 instruction and register set characteristics.  This flag prevents code
7434 compiled for one cpu to be linked with code compiled for another.
7435 No facility exists for handling variants that are ``almost identical''.
7436 This is an all or nothing option.
7438 @item -mcpu=@var{cpu}
7439 @opindex mcpu
7440 Compile code for ARC variant @var{cpu}.
7441 Which variants are supported depend on the configuration.
7442 All variants support @option{-mcpu=base}, this is the default.
7444 @item -mtext=@var{text-section}
7445 @itemx -mdata=@var{data-section}
7446 @itemx -mrodata=@var{readonly-data-section}
7447 @opindex mtext
7448 @opindex mdata
7449 @opindex mrodata
7450 Put functions, data, and readonly data in @var{text-section},
7451 @var{data-section}, and @var{readonly-data-section} respectively
7452 by default.  This can be overridden with the @code{section} attribute.
7453 @xref{Variable Attributes}.
7455 @end table
7457 @node ARM Options
7458 @subsection ARM Options
7459 @cindex ARM options
7461 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7462 architectures:
7464 @table @gcctabopt
7465 @item -mabi=@var{name}
7466 @opindex mabi
7467 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7468 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
7470 @item -mapcs-frame
7471 @opindex mapcs-frame
7472 Generate a stack frame that is compliant with the ARM Procedure Call
7473 Standard for all functions, even if this is not strictly necessary for
7474 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7475 with this option will cause the stack frames not to be generated for
7476 leaf functions.  The default is @option{-mno-apcs-frame}.
7478 @item -mapcs
7479 @opindex mapcs
7480 This is a synonym for @option{-mapcs-frame}.
7482 @ignore
7483 @c not currently implemented
7484 @item -mapcs-stack-check
7485 @opindex mapcs-stack-check
7486 Generate code to check the amount of stack space available upon entry to
7487 every function (that actually uses some stack space).  If there is
7488 insufficient space available then either the function
7489 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7490 called, depending upon the amount of stack space required.  The run time
7491 system is required to provide these functions.  The default is
7492 @option{-mno-apcs-stack-check}, since this produces smaller code.
7494 @c not currently implemented
7495 @item -mapcs-float
7496 @opindex mapcs-float
7497 Pass floating point arguments using the float point registers.  This is
7498 one of the variants of the APCS@.  This option is recommended if the
7499 target hardware has a floating point unit or if a lot of floating point
7500 arithmetic is going to be performed by the code.  The default is
7501 @option{-mno-apcs-float}, since integer only code is slightly increased in
7502 size if @option{-mapcs-float} is used.
7504 @c not currently implemented
7505 @item -mapcs-reentrant
7506 @opindex mapcs-reentrant
7507 Generate reentrant, position independent code.  The default is
7508 @option{-mno-apcs-reentrant}.
7509 @end ignore
7511 @item -mthumb-interwork
7512 @opindex mthumb-interwork
7513 Generate code which supports calling between the ARM and Thumb
7514 instruction sets.  Without this option the two instruction sets cannot
7515 be reliably used inside one program.  The default is
7516 @option{-mno-thumb-interwork}, since slightly larger code is generated
7517 when @option{-mthumb-interwork} is specified.
7519 @item -mno-sched-prolog
7520 @opindex mno-sched-prolog
7521 Prevent the reordering of instructions in the function prolog, or the
7522 merging of those instruction with the instructions in the function's
7523 body.  This means that all functions will start with a recognizable set
7524 of instructions (or in fact one of a choice from a small set of
7525 different function prologues), and this information can be used to
7526 locate the start if functions inside an executable piece of code.  The
7527 default is @option{-msched-prolog}.
7529 @item -mhard-float
7530 @opindex mhard-float
7531 Generate output containing floating point instructions.  This is the
7532 default.
7534 @item -msoft-float
7535 @opindex msoft-float
7536 Generate output containing library calls for floating point.
7537 @strong{Warning:} the requisite libraries are not available for all ARM
7538 targets.  Normally the facilities of the machine's usual C compiler are
7539 used, but this cannot be done directly in cross-compilation.  You must make
7540 your own arrangements to provide suitable library functions for
7541 cross-compilation.
7543 @option{-msoft-float} changes the calling convention in the output file;
7544 therefore, it is only useful if you compile @emph{all} of a program with
7545 this option.  In particular, you need to compile @file{libgcc.a}, the
7546 library that comes with GCC, with @option{-msoft-float} in order for
7547 this to work.
7549 @item -mfloat-abi=@var{name}
7550 @opindex mfloat-abi
7551 Specifies which ABI to use for floating point values.  Permissible values
7552 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7554 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7555 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7556 of floating point instructions, but still uses the soft-float calling
7557 conventions.
7559 @item -mlittle-endian
7560 @opindex mlittle-endian
7561 Generate code for a processor running in little-endian mode.  This is
7562 the default for all standard configurations.
7564 @item -mbig-endian
7565 @opindex mbig-endian
7566 Generate code for a processor running in big-endian mode; the default is
7567 to compile code for a little-endian processor.
7569 @item -mwords-little-endian
7570 @opindex mwords-little-endian
7571 This option only applies when generating code for big-endian processors.
7572 Generate code for a little-endian word order but a big-endian byte
7573 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7574 option should only be used if you require compatibility with code for
7575 big-endian ARM processors generated by versions of the compiler prior to
7576 2.8.
7578 @item -mcpu=@var{name}
7579 @opindex mcpu
7580 This specifies the name of the target ARM processor.  GCC uses this name
7581 to determine what kind of instructions it can emit when generating
7582 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7583 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7584 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7585 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7586 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7587 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7588 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7589 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7590 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7591 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7592 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7593 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7594 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7595 @samp{arm1176jz-s}, @samp{arm1176jzf-s}, @samp{xscale}, @samp{iwmmxt},
7596 @samp{ep9312}.
7598 @itemx -mtune=@var{name}
7599 @opindex mtune
7600 This option is very similar to the @option{-mcpu=} option, except that
7601 instead of specifying the actual target processor type, and hence
7602 restricting which instructions can be used, it specifies that GCC should
7603 tune the performance of the code as if the target were of the type
7604 specified in this option, but still choosing the instructions that it
7605 will generate based on the cpu specified by a @option{-mcpu=} option.
7606 For some ARM implementations better performance can be obtained by using
7607 this option.
7609 @item -march=@var{name}
7610 @opindex march
7611 This specifies the name of the target ARM architecture.  GCC uses this
7612 name to determine what kind of instructions it can emit when generating
7613 assembly code.  This option can be used in conjunction with or instead
7614 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
7615 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
7616 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
7617 @samp{iwmmxt}, @samp{ep9312}.
7619 @item -mfpu=@var{name}
7620 @itemx -mfpe=@var{number}
7621 @itemx -mfp=@var{number}
7622 @opindex mfpu
7623 @opindex mfpe
7624 @opindex mfp
7625 This specifies what floating point hardware (or hardware emulation) is
7626 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
7627 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
7628 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
7629 with older versions of GCC@.
7631 If @option{-msoft-float} is specified this specifies the format of
7632 floating point values.
7634 @item -mstructure-size-boundary=@var{n}
7635 @opindex mstructure-size-boundary
7636 The size of all structures and unions will be rounded up to a multiple
7637 of the number of bits set by this option.  Permissible values are 8, 32
7638 and 64.  The default value varies for different toolchains.  For the COFF
7639 targeted toolchain the default value is 8.  A value of 64 is only allowed
7640 if the underlying ABI supports it.
7642 Specifying the larger number can produce faster, more efficient code, but
7643 can also increase the size of the program.  Different values are potentially
7644 incompatible.  Code compiled with one value cannot necessarily expect to
7645 work with code or libraries compiled with another value, if they exchange
7646 information using structures or unions.
7648 @item -mabort-on-noreturn
7649 @opindex mabort-on-noreturn
7650 Generate a call to the function @code{abort} at the end of a
7651 @code{noreturn} function.  It will be executed if the function tries to
7652 return.
7654 @item -mlong-calls
7655 @itemx -mno-long-calls
7656 @opindex mlong-calls
7657 @opindex mno-long-calls
7658 Tells the compiler to perform function calls by first loading the
7659 address of the function into a register and then performing a subroutine
7660 call on this register.  This switch is needed if the target function
7661 will lie outside of the 64 megabyte addressing range of the offset based
7662 version of subroutine call instruction.
7664 Even if this switch is enabled, not all function calls will be turned
7665 into long calls.  The heuristic is that static functions, functions
7666 which have the @samp{short-call} attribute, functions that are inside
7667 the scope of a @samp{#pragma no_long_calls} directive and functions whose
7668 definitions have already been compiled within the current compilation
7669 unit, will not be turned into long calls.  The exception to this rule is
7670 that weak function definitions, functions with the @samp{long-call}
7671 attribute or the @samp{section} attribute, and functions that are within
7672 the scope of a @samp{#pragma long_calls} directive, will always be
7673 turned into long calls.
7675 This feature is not enabled by default.  Specifying
7676 @option{-mno-long-calls} will restore the default behavior, as will
7677 placing the function calls within the scope of a @samp{#pragma
7678 long_calls_off} directive.  Note these switches have no effect on how
7679 the compiler generates code to handle function calls via function
7680 pointers.
7682 @item -mnop-fun-dllimport
7683 @opindex mnop-fun-dllimport
7684 Disable support for the @code{dllimport} attribute.
7686 @item -msingle-pic-base
7687 @opindex msingle-pic-base
7688 Treat the register used for PIC addressing as read-only, rather than
7689 loading it in the prologue for each function.  The run-time system is
7690 responsible for initializing this register with an appropriate value
7691 before execution begins.
7693 @item -mpic-register=@var{reg}
7694 @opindex mpic-register
7695 Specify the register to be used for PIC addressing.  The default is R10
7696 unless stack-checking is enabled, when R9 is used.
7698 @item -mcirrus-fix-invalid-insns
7699 @opindex mcirrus-fix-invalid-insns
7700 @opindex mno-cirrus-fix-invalid-insns
7701 Insert NOPs into the instruction stream to in order to work around
7702 problems with invalid Maverick instruction combinations.  This option
7703 is only valid if the @option{-mcpu=ep9312} option has been used to
7704 enable generation of instructions for the Cirrus Maverick floating
7705 point co-processor.  This option is not enabled by default, since the
7706 problem is only present in older Maverick implementations.  The default
7707 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
7708 switch.
7710 @item -mpoke-function-name
7711 @opindex mpoke-function-name
7712 Write the name of each function into the text section, directly
7713 preceding the function prologue.  The generated code is similar to this:
7715 @smallexample
7716      t0
7717          .ascii "arm_poke_function_name", 0
7718          .align
7719      t1
7720          .word 0xff000000 + (t1 - t0)
7721      arm_poke_function_name
7722          mov     ip, sp
7723          stmfd   sp!, @{fp, ip, lr, pc@}
7724          sub     fp, ip, #4
7725 @end smallexample
7727 When performing a stack backtrace, code can inspect the value of
7728 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
7729 location @code{pc - 12} and the top 8 bits are set, then we know that
7730 there is a function name embedded immediately preceding this location
7731 and has length @code{((pc[-3]) & 0xff000000)}.
7733 @item -mthumb
7734 @opindex mthumb
7735 Generate code for the 16-bit Thumb instruction set.  The default is to
7736 use the 32-bit ARM instruction set.
7738 @item -mtpcs-frame
7739 @opindex mtpcs-frame
7740 Generate a stack frame that is compliant with the Thumb Procedure Call
7741 Standard for all non-leaf functions.  (A leaf function is one that does
7742 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
7744 @item -mtpcs-leaf-frame
7745 @opindex mtpcs-leaf-frame
7746 Generate a stack frame that is compliant with the Thumb Procedure Call
7747 Standard for all leaf functions.  (A leaf function is one that does
7748 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
7750 @item -mcallee-super-interworking
7751 @opindex mcallee-super-interworking
7752 Gives all externally visible functions in the file being compiled an ARM
7753 instruction set header which switches to Thumb mode before executing the
7754 rest of the function.  This allows these functions to be called from
7755 non-interworking code.
7757 @item -mcaller-super-interworking
7758 @opindex mcaller-super-interworking
7759 Allows calls via function pointers (including virtual functions) to
7760 execute correctly regardless of whether the target code has been
7761 compiled for interworking or not.  There is a small overhead in the cost
7762 of executing a function pointer if this option is enabled.
7764 @item -mtp=@var{name}
7765 @opindex mtp
7766 Specify the access model for the thread local storage pointer.  The valid
7767 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
7768 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
7769 (supported in the arm6k architecture), and @option{auto}, which uses the
7770 best available method for the selected processor.  The default setting is
7771 @option{auto}.
7773 @end table
7775 @node AVR Options
7776 @subsection AVR Options
7777 @cindex AVR Options
7779 These options are defined for AVR implementations:
7781 @table @gcctabopt
7782 @item -mmcu=@var{mcu}
7783 @opindex mmcu
7784 Specify ATMEL AVR instruction set or MCU type.
7786 Instruction set avr1 is for the minimal AVR core, not supported by the C
7787 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
7788 attiny11, attiny12, attiny15, attiny28).
7790 Instruction set avr2 (default) is for the classic AVR core with up to
7791 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
7792 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
7793 at90c8534, at90s8535).
7795 Instruction set avr3 is for the classic AVR core with up to 128K program
7796 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
7798 Instruction set avr4 is for the enhanced AVR core with up to 8K program
7799 memory space (MCU types: atmega8, atmega83, atmega85).
7801 Instruction set avr5 is for the enhanced AVR core with up to 128K program
7802 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
7803 atmega64, atmega128, at43usb355, at94k).
7805 @item -msize
7806 @opindex msize
7807 Output instruction sizes to the asm file.
7809 @item -minit-stack=@var{N}
7810 @opindex minit-stack
7811 Specify the initial stack address, which may be a symbol or numeric value,
7812 @samp{__stack} is the default.
7814 @item -mno-interrupts
7815 @opindex mno-interrupts
7816 Generated code is not compatible with hardware interrupts.
7817 Code size will be smaller.
7819 @item -mcall-prologues
7820 @opindex mcall-prologues
7821 Functions prologues/epilogues expanded as call to appropriate
7822 subroutines.  Code size will be smaller.
7824 @item -mno-tablejump
7825 @opindex mno-tablejump
7826 Do not generate tablejump insns which sometimes increase code size.
7828 @item -mtiny-stack
7829 @opindex mtiny-stack
7830 Change only the low 8 bits of the stack pointer.
7832 @item -mint8
7833 @opindex mint8
7834 Assume int to be 8 bit integer.  This affects the sizes of all types: A
7835 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
7836 and long long will be 4 bytes.  Please note that this option does not
7837 comply to the C standards, but it will provide you with smaller code
7838 size.
7839 @end table
7841 @node Blackfin Options
7842 @subsection Blackfin Options
7843 @cindex Blackfin Options
7845 @table @gcctabopt
7846 @item -momit-leaf-frame-pointer
7847 @opindex momit-leaf-frame-pointer
7848 Don't keep the frame pointer in a register for leaf functions.  This
7849 avoids the instructions to save, set up and restore frame pointers and
7850 makes an extra register available in leaf functions.  The option
7851 @option{-fomit-frame-pointer} removes the frame pointer for all functions
7852 which might make debugging harder.
7854 @item -mspecld-anomaly
7855 @opindex mspecld-anomaly
7856 When enabled, the compiler will ensure that the generated code does not
7857 contain speculative loads after jump instructions.  This option is enabled
7858 by default.
7860 @item -mno-specld-anomaly
7861 @opindex mno-specld-anomaly
7862 Don't generate extra code to prevent speculative loads from occurring.
7864 @item -mcsync-anomaly
7865 @opindex mcsync-anomaly
7866 When enabled, the compiler will ensure that the generated code does not
7867 contain CSYNC or SSYNC instructions too soon after conditional branches.
7868 This option is enabled by default.
7870 @item -mno-csync-anomaly
7871 @opindex mno-csync-anomaly
7872 Don't generate extra code to prevent CSYNC or SSYNC instructions from
7873 occurring too soon after a conditional branch.
7875 @item -mlow-64k
7876 @opindex mlow-64k
7877 When enabled, the compiler is free to take advantage of the knowledge that
7878 the entire program fits into the low 64k of memory.
7880 @item -mno-low-64k
7881 @opindex mno-low-64k
7882 Assume that the program is arbitrarily large.  This is the default.
7884 @item -mstack-check-l1
7885 @opindex mstack-check-l1
7886 Do stack checking using information placed into L1 scratchpad memory by the
7887 uClinux kernel.
7889 @item -mid-shared-library
7890 @opindex mid-shared-library
7891 Generate code that supports shared libraries via the library ID method.
7892 This allows for execute in place and shared libraries in an environment
7893 without virtual memory management.  This option implies @option{-fPIC}.
7895 @item -mno-id-shared-library
7896 @opindex mno-id-shared-library
7897 Generate code that doesn't assume ID based shared libraries are being used.
7898 This is the default.
7900 @item -mleaf-id-shared-library
7901 @opindex mleaf-id-shared-library
7902 Generate code that supports shared libraries via the library ID method,
7903 but assumes that this library or executable won't link against any other
7904 ID shared libraries.  That allows the compiler to use faster code for jumps
7905 and calls.
7907 @item -mno-leaf-id-shared-library
7908 @opindex mno-leaf-id-shared-library
7909 Do not assume that the code being compiled won't link against any ID shared
7910 libraries.  Slower code will be generated for jump and call insns.
7912 @item -mshared-library-id=n
7913 @opindex mshared-library-id
7914 Specified the identification number of the ID based shared library being
7915 compiled.  Specifying a value of 0 will generate more compact code, specifying
7916 other values will force the allocation of that number to the current
7917 library but is no more space or time efficient than omitting this option.
7919 @item -msep-data
7920 @opindex msep-data
7921 Generate code that allows the data segment to be located in a different
7922 area of memory from the text segment.  This allows for execute in place in
7923 an environment without virtual memory management by eliminating relocations
7924 against the text section.
7926 @item -mno-sep-data
7927 @opindex mno-sep-data
7928 Generate code that assumes that the data segment follows the text segment.
7929 This is the default.
7931 @item -mlong-calls
7932 @itemx -mno-long-calls
7933 @opindex mlong-calls
7934 @opindex mno-long-calls
7935 Tells the compiler to perform function calls by first loading the
7936 address of the function into a register and then performing a subroutine
7937 call on this register.  This switch is needed if the target function
7938 will lie outside of the 24 bit addressing range of the offset based
7939 version of subroutine call instruction.
7941 This feature is not enabled by default.  Specifying
7942 @option{-mno-long-calls} will restore the default behavior.  Note these
7943 switches have no effect on how the compiler generates code to handle
7944 function calls via function pointers.
7945 @end table
7947 @node CRIS Options
7948 @subsection CRIS Options
7949 @cindex CRIS Options
7951 These options are defined specifically for the CRIS ports.
7953 @table @gcctabopt
7954 @item -march=@var{architecture-type}
7955 @itemx -mcpu=@var{architecture-type}
7956 @opindex march
7957 @opindex mcpu
7958 Generate code for the specified architecture.  The choices for
7959 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
7960 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
7961 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
7962 @samp{v10}.
7964 @item -mtune=@var{architecture-type}
7965 @opindex mtune
7966 Tune to @var{architecture-type} everything applicable about the generated
7967 code, except for the ABI and the set of available instructions.  The
7968 choices for @var{architecture-type} are the same as for
7969 @option{-march=@var{architecture-type}}.
7971 @item -mmax-stack-frame=@var{n}
7972 @opindex mmax-stack-frame
7973 Warn when the stack frame of a function exceeds @var{n} bytes.
7975 @item -melinux-stacksize=@var{n}
7976 @opindex melinux-stacksize
7977 Only available with the @samp{cris-axis-aout} target.  Arranges for
7978 indications in the program to the kernel loader that the stack of the
7979 program should be set to @var{n} bytes.
7981 @item -metrax4
7982 @itemx -metrax100
7983 @opindex metrax4
7984 @opindex metrax100
7985 The options @option{-metrax4} and @option{-metrax100} are synonyms for
7986 @option{-march=v3} and @option{-march=v8} respectively.
7988 @item -mmul-bug-workaround
7989 @itemx -mno-mul-bug-workaround
7990 @opindex mmul-bug-workaround
7991 @opindex mno-mul-bug-workaround
7992 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
7993 models where it applies.  This option is active by default.
7995 @item -mpdebug
7996 @opindex mpdebug
7997 Enable CRIS-specific verbose debug-related information in the assembly
7998 code.  This option also has the effect to turn off the @samp{#NO_APP}
7999 formatted-code indicator to the assembler at the beginning of the
8000 assembly file.
8002 @item -mcc-init
8003 @opindex mcc-init
8004 Do not use condition-code results from previous instruction; always emit
8005 compare and test instructions before use of condition codes.
8007 @item -mno-side-effects
8008 @opindex mno-side-effects
8009 Do not emit instructions with side-effects in addressing modes other than
8010 post-increment.
8012 @item -mstack-align
8013 @itemx -mno-stack-align
8014 @itemx -mdata-align
8015 @itemx -mno-data-align
8016 @itemx -mconst-align
8017 @itemx -mno-const-align
8018 @opindex mstack-align
8019 @opindex mno-stack-align
8020 @opindex mdata-align
8021 @opindex mno-data-align
8022 @opindex mconst-align
8023 @opindex mno-const-align
8024 These options (no-options) arranges (eliminate arrangements) for the
8025 stack-frame, individual data and constants to be aligned for the maximum
8026 single data access size for the chosen CPU model.  The default is to
8027 arrange for 32-bit alignment.  ABI details such as structure layout are
8028 not affected by these options.
8030 @item -m32-bit
8031 @itemx -m16-bit
8032 @itemx -m8-bit
8033 @opindex m32-bit
8034 @opindex m16-bit
8035 @opindex m8-bit
8036 Similar to the stack- data- and const-align options above, these options
8037 arrange for stack-frame, writable data and constants to all be 32-bit,
8038 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8040 @item -mno-prologue-epilogue
8041 @itemx -mprologue-epilogue
8042 @opindex mno-prologue-epilogue
8043 @opindex mprologue-epilogue
8044 With @option{-mno-prologue-epilogue}, the normal function prologue and
8045 epilogue that sets up the stack-frame are omitted and no return
8046 instructions or return sequences are generated in the code.  Use this
8047 option only together with visual inspection of the compiled code: no
8048 warnings or errors are generated when call-saved registers must be saved,
8049 or storage for local variable needs to be allocated.
8051 @item -mno-gotplt
8052 @itemx -mgotplt
8053 @opindex mno-gotplt
8054 @opindex mgotplt
8055 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8056 instruction sequences that load addresses for functions from the PLT part
8057 of the GOT rather than (traditional on other architectures) calls to the
8058 PLT@.  The default is @option{-mgotplt}.
8060 @item -maout
8061 @opindex maout
8062 Legacy no-op option only recognized with the cris-axis-aout target.
8064 @item -melf
8065 @opindex melf
8066 Legacy no-op option only recognized with the cris-axis-elf and
8067 cris-axis-linux-gnu targets.
8069 @item -melinux
8070 @opindex melinux
8071 Only recognized with the cris-axis-aout target, where it selects a
8072 GNU/linux-like multilib, include files and instruction set for
8073 @option{-march=v8}.
8075 @item -mlinux
8076 @opindex mlinux
8077 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8079 @item -sim
8080 @opindex sim
8081 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8082 to link with input-output functions from a simulator library.  Code,
8083 initialized data and zero-initialized data are allocated consecutively.
8085 @item -sim2
8086 @opindex sim2
8087 Like @option{-sim}, but pass linker options to locate initialized data at
8088 0x40000000 and zero-initialized data at 0x80000000.
8089 @end table
8091 @node CRX Options
8092 @subsection CRX Options
8093 @cindex CRX Options
8095 These options are defined specifically for the CRX ports.
8097 @table @gcctabopt
8099 @item -mmac
8100 @opindex mmac
8101 Enable the use of multiply-accumulate instructions. Disabled by default.
8103 @item -mpush-args
8104 @opindex mpush-args
8105 Push instructions will be used to pass outgoing arguments when functions
8106 are called. Enabled by default.
8107 @end table
8109 @node Darwin Options
8110 @subsection Darwin Options
8111 @cindex Darwin options
8113 These options are defined for all architectures running the Darwin operating
8114 system.
8116 FSF GCC on Darwin does not create ``fat'' object files; it will create
8117 an object file for the single architecture that it was built to
8118 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8119 @option{-arch} options are used; it does so by running the compiler or
8120 linker multiple times and joining the results together with
8121 @file{lipo}.
8123 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8124 @samp{i686}) is determined by the flags that specify the ISA
8125 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8126 @option{-force_cpusubtype_ALL} option can be used to override this.
8128 The Darwin tools vary in their behavior when presented with an ISA
8129 mismatch.  The assembler, @file{as}, will only permit instructions to
8130 be used that are valid for the subtype of the file it is generating,
8131 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8132 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8133 and print an error if asked to create a shared library with a less
8134 restrictive subtype than its input files (for instance, trying to put
8135 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8136 for executables, @file{ld}, will quietly give the executable the most
8137 restrictive subtype of any of its input files.
8139 @table @gcctabopt
8140 @item -F@var{dir}
8141 @opindex F
8142 Add the framework directory @var{dir} to the head of the list of
8143 directories to be searched for header files.  These directories are
8144 interleaved with those specified by @option{-I} options and are
8145 scanned in a left-to-right order.
8147 A framework directory is a directory with frameworks in it.  A
8148 framework is a directory with a @samp{"Headers"} and/or
8149 @samp{"PrivateHeaders"} directory contained directly in it that ends
8150 in @samp{".framework"}.  The name of a framework is the name of this
8151 directory excluding the @samp{".framework"}.  Headers associated with
8152 the framework are found in one of those two directories, with
8153 @samp{"Headers"} being searched first.  A subframework is a framework
8154 directory that is in a framework's @samp{"Frameworks"} directory.
8155 Includes of subframework headers can only appear in a header of a
8156 framework that contains the subframework, or in a sibling subframework
8157 header.  Two subframeworks are siblings if they occur in the same
8158 framework.  A subframework should not have the same name as a
8159 framework, a warning will be issued if this is violated.  Currently a
8160 subframework cannot have subframeworks, in the future, the mechanism
8161 may be extended to support this.  The standard frameworks can be found
8162 in @samp{"/System/Library/Frameworks"} and
8163 @samp{"/Library/Frameworks"}.  An example include looks like
8164 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8165 the name of the framework and header.h is found in the
8166 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8168 @item -gused
8169 @opindex -gused
8170 Emit debugging information for symbols that are used.  For STABS
8171 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8172 This is by default ON@.
8174 @item -gfull
8175 @opindex -gfull
8176 Emit debugging information for all symbols and types.
8178 @item -mmacosx-version-min=@var{version}
8179 The earliest version of MacOS X that this executable will run on
8180 is @var{version}.  Typical values of @var{version} include @code{10.1},
8181 @code{10.2}, and @code{10.3.9}.
8183 The default for this option is to make choices that seem to be most
8184 useful.  
8186 @item -mkernel
8187 @opindex mkernel
8188 Enable kernel development mode.  The @option{-mkernel} option sets
8189 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8190 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8191 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8192 applicable.  This mode also sets @option{-mno-altivec},
8193 @option{-msoft-float}, @option{-fno-builtin} and
8194 @option{-mlong-branch} for PowerPC targets.
8196 @item -mone-byte-bool
8197 @opindex -mone-byte-bool
8198 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8199 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8200 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8201 option has no effect on x86.
8203 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8204 to generate code that is not binary compatible with code generated
8205 without that switch.  Using this switch may require recompiling all
8206 other modules in a program, including system libraries.  Use this
8207 switch to conform to a non-default data model.
8209 @item -mfix-and-continue
8210 @itemx -ffix-and-continue
8211 @itemx -findirect-data
8212 @opindex mfix-and-continue
8213 @opindex ffix-and-continue
8214 @opindex findirect-data
8215 Generate code suitable for fast turn around development.  Needed to
8216 enable gdb to dynamically load @code{.o} files into already running
8217 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8218 are provided for backwards compatibility.
8220 @item -all_load
8221 @opindex all_load
8222 Loads all members of static archive libraries.
8223 See man ld(1) for more information.
8225 @item -arch_errors_fatal
8226 @opindex arch_errors_fatal
8227 Cause the errors having to do with files that have the wrong architecture
8228 to be fatal.
8230 @item -bind_at_load
8231 @opindex bind_at_load
8232 Causes the output file to be marked such that the dynamic linker will
8233 bind all undefined references when the file is loaded or launched.
8235 @item -bundle
8236 @opindex bundle
8237 Produce a Mach-o bundle format file.
8238 See man ld(1) for more information.
8240 @item -bundle_loader @var{executable}
8241 @opindex bundle_loader
8242 This option specifies the @var{executable} that will be loading the build
8243 output file being linked.  See man ld(1) for more information.
8245 @item -dynamiclib
8246 @opindex -dynamiclib
8247 When passed this option, GCC will produce a dynamic library instead of
8248 an executable when linking, using the Darwin @file{libtool} command.
8250 @item -force_cpusubtype_ALL
8251 @opindex -force_cpusubtype_ALL
8252 This causes GCC's output file to have the @var{ALL} subtype, instead of
8253 one controlled by the @option{-mcpu} or @option{-march} option.
8255 @item -allowable_client  @var{client_name}
8256 @itemx -client_name
8257 @itemx -compatibility_version
8258 @itemx -current_version
8259 @itemx -dead_strip
8260 @itemx -dependency-file
8261 @itemx -dylib_file
8262 @itemx -dylinker_install_name
8263 @itemx -dynamic
8264 @itemx -exported_symbols_list
8265 @itemx -filelist
8266 @itemx -flat_namespace
8267 @itemx -force_flat_namespace
8268 @itemx -headerpad_max_install_names
8269 @itemx -image_base
8270 @itemx -init
8271 @itemx -install_name
8272 @itemx -keep_private_externs
8273 @itemx -multi_module
8274 @itemx -multiply_defined
8275 @itemx -multiply_defined_unused
8276 @itemx -noall_load
8277 @itemx -no_dead_strip_inits_and_terms
8278 @itemx -nofixprebinding
8279 @itemx -nomultidefs
8280 @itemx -noprebind
8281 @itemx -noseglinkedit
8282 @itemx -pagezero_size
8283 @itemx -prebind
8284 @itemx -prebind_all_twolevel_modules
8285 @itemx -private_bundle
8286 @itemx -read_only_relocs
8287 @itemx -sectalign
8288 @itemx -sectobjectsymbols
8289 @itemx -whyload
8290 @itemx -seg1addr
8291 @itemx -sectcreate
8292 @itemx -sectobjectsymbols
8293 @itemx -sectorder
8294 @itemx -segaddr
8295 @itemx -segs_read_only_addr
8296 @itemx -segs_read_write_addr
8297 @itemx -seg_addr_table
8298 @itemx -seg_addr_table_filename
8299 @itemx -seglinkedit
8300 @itemx -segprot
8301 @itemx -segs_read_only_addr
8302 @itemx -segs_read_write_addr
8303 @itemx -single_module
8304 @itemx -static
8305 @itemx -sub_library
8306 @itemx -sub_umbrella
8307 @itemx -twolevel_namespace
8308 @itemx -umbrella
8309 @itemx -undefined
8310 @itemx -unexported_symbols_list
8311 @itemx -weak_reference_mismatches
8312 @itemx -whatsloaded
8314 @opindex allowable_client
8315 @opindex client_name
8316 @opindex compatibility_version
8317 @opindex current_version
8318 @opindex dead_strip
8319 @opindex dependency-file
8320 @opindex dylib_file
8321 @opindex dylinker_install_name
8322 @opindex dynamic
8323 @opindex exported_symbols_list
8324 @opindex filelist
8325 @opindex flat_namespace
8326 @opindex force_flat_namespace
8327 @opindex headerpad_max_install_names
8328 @opindex image_base
8329 @opindex init
8330 @opindex install_name
8331 @opindex keep_private_externs
8332 @opindex multi_module
8333 @opindex multiply_defined
8334 @opindex multiply_defined_unused
8335 @opindex noall_load
8336 @opindex no_dead_strip_inits_and_terms
8337 @opindex nofixprebinding
8338 @opindex nomultidefs
8339 @opindex noprebind
8340 @opindex noseglinkedit
8341 @opindex pagezero_size
8342 @opindex prebind
8343 @opindex prebind_all_twolevel_modules
8344 @opindex private_bundle
8345 @opindex read_only_relocs
8346 @opindex sectalign
8347 @opindex sectobjectsymbols
8348 @opindex whyload
8349 @opindex seg1addr
8350 @opindex sectcreate
8351 @opindex sectobjectsymbols
8352 @opindex sectorder
8353 @opindex segaddr
8354 @opindex segs_read_only_addr
8355 @opindex segs_read_write_addr
8356 @opindex seg_addr_table
8357 @opindex seg_addr_table_filename
8358 @opindex seglinkedit
8359 @opindex segprot
8360 @opindex segs_read_only_addr
8361 @opindex segs_read_write_addr
8362 @opindex single_module
8363 @opindex static
8364 @opindex sub_library
8365 @opindex sub_umbrella
8366 @opindex twolevel_namespace
8367 @opindex umbrella
8368 @opindex undefined
8369 @opindex unexported_symbols_list
8370 @opindex weak_reference_mismatches
8371 @opindex whatsloaded
8373 These options are passed to the Darwin linker.  The Darwin linker man page
8374 describes them in detail.
8375 @end table
8377 @node DEC Alpha Options
8378 @subsection DEC Alpha Options
8380 These @samp{-m} options are defined for the DEC Alpha implementations:
8382 @table @gcctabopt
8383 @item -mno-soft-float
8384 @itemx -msoft-float
8385 @opindex mno-soft-float
8386 @opindex msoft-float
8387 Use (do not use) the hardware floating-point instructions for
8388 floating-point operations.  When @option{-msoft-float} is specified,
8389 functions in @file{libgcc.a} will be used to perform floating-point
8390 operations.  Unless they are replaced by routines that emulate the
8391 floating-point operations, or compiled in such a way as to call such
8392 emulations routines, these routines will issue floating-point
8393 operations.   If you are compiling for an Alpha without floating-point
8394 operations, you must ensure that the library is built so as not to call
8395 them.
8397 Note that Alpha implementations without floating-point operations are
8398 required to have floating-point registers.
8400 @item -mfp-reg
8401 @itemx -mno-fp-regs
8402 @opindex mfp-reg
8403 @opindex mno-fp-regs
8404 Generate code that uses (does not use) the floating-point register set.
8405 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8406 register set is not used, floating point operands are passed in integer
8407 registers as if they were integers and floating-point results are passed
8408 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8409 so any function with a floating-point argument or return value called by code
8410 compiled with @option{-mno-fp-regs} must also be compiled with that
8411 option.
8413 A typical use of this option is building a kernel that does not use,
8414 and hence need not save and restore, any floating-point registers.
8416 @item -mieee
8417 @opindex mieee
8418 The Alpha architecture implements floating-point hardware optimized for
8419 maximum performance.  It is mostly compliant with the IEEE floating
8420 point standard.  However, for full compliance, software assistance is
8421 required.  This option generates code fully IEEE compliant code
8422 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8423 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8424 defined during compilation.  The resulting code is less efficient but is
8425 able to correctly support denormalized numbers and exceptional IEEE
8426 values such as not-a-number and plus/minus infinity.  Other Alpha
8427 compilers call this option @option{-ieee_with_no_inexact}.
8429 @item -mieee-with-inexact
8430 @opindex mieee-with-inexact
8431 This is like @option{-mieee} except the generated code also maintains
8432 the IEEE @var{inexact-flag}.  Turning on this option causes the
8433 generated code to implement fully-compliant IEEE math.  In addition to
8434 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8435 macro.  On some Alpha implementations the resulting code may execute
8436 significantly slower than the code generated by default.  Since there is
8437 very little code that depends on the @var{inexact-flag}, you should
8438 normally not specify this option.  Other Alpha compilers call this
8439 option @option{-ieee_with_inexact}.
8441 @item -mfp-trap-mode=@var{trap-mode}
8442 @opindex mfp-trap-mode
8443 This option controls what floating-point related traps are enabled.
8444 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8445 The trap mode can be set to one of four values:
8447 @table @samp
8448 @item n
8449 This is the default (normal) setting.  The only traps that are enabled
8450 are the ones that cannot be disabled in software (e.g., division by zero
8451 trap).
8453 @item u
8454 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8455 as well.
8457 @item su
8458 Like @samp{u}, but the instructions are marked to be safe for software
8459 completion (see Alpha architecture manual for details).
8461 @item sui
8462 Like @samp{su}, but inexact traps are enabled as well.
8463 @end table
8465 @item -mfp-rounding-mode=@var{rounding-mode}
8466 @opindex mfp-rounding-mode
8467 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8468 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8471 @table @samp
8472 @item n
8473 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8474 the nearest machine number or towards the even machine number in case
8475 of a tie.
8477 @item m
8478 Round towards minus infinity.
8480 @item c
8481 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8483 @item d
8484 Dynamic rounding mode.  A field in the floating point control register
8485 (@var{fpcr}, see Alpha architecture reference manual) controls the
8486 rounding mode in effect.  The C library initializes this register for
8487 rounding towards plus infinity.  Thus, unless your program modifies the
8488 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8489 @end table
8491 @item -mtrap-precision=@var{trap-precision}
8492 @opindex mtrap-precision
8493 In the Alpha architecture, floating point traps are imprecise.  This
8494 means without software assistance it is impossible to recover from a
8495 floating trap and program execution normally needs to be terminated.
8496 GCC can generate code that can assist operating system trap handlers
8497 in determining the exact location that caused a floating point trap.
8498 Depending on the requirements of an application, different levels of
8499 precisions can be selected:
8501 @table @samp
8502 @item p
8503 Program precision.  This option is the default and means a trap handler
8504 can only identify which program caused a floating point exception.
8506 @item f
8507 Function precision.  The trap handler can determine the function that
8508 caused a floating point exception.
8510 @item i
8511 Instruction precision.  The trap handler can determine the exact
8512 instruction that caused a floating point exception.
8513 @end table
8515 Other Alpha compilers provide the equivalent options called
8516 @option{-scope_safe} and @option{-resumption_safe}.
8518 @item -mieee-conformant
8519 @opindex mieee-conformant
8520 This option marks the generated code as IEEE conformant.  You must not
8521 use this option unless you also specify @option{-mtrap-precision=i} and either
8522 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8523 is to emit the line @samp{.eflag 48} in the function prologue of the
8524 generated assembly file.  Under DEC Unix, this has the effect that
8525 IEEE-conformant math library routines will be linked in.
8527 @item -mbuild-constants
8528 @opindex mbuild-constants
8529 Normally GCC examines a 32- or 64-bit integer constant to
8530 see if it can construct it from smaller constants in two or three
8531 instructions.  If it cannot, it will output the constant as a literal and
8532 generate code to load it from the data segment at runtime.
8534 Use this option to require GCC to construct @emph{all} integer constants
8535 using code, even if it takes more instructions (the maximum is six).
8537 You would typically use this option to build a shared library dynamic
8538 loader.  Itself a shared library, it must relocate itself in memory
8539 before it can find the variables and constants in its own data segment.
8541 @item -malpha-as
8542 @itemx -mgas
8543 @opindex malpha-as
8544 @opindex mgas
8545 Select whether to generate code to be assembled by the vendor-supplied
8546 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8548 @item -mbwx
8549 @itemx -mno-bwx
8550 @itemx -mcix
8551 @itemx -mno-cix
8552 @itemx -mfix
8553 @itemx -mno-fix
8554 @itemx -mmax
8555 @itemx -mno-max
8556 @opindex mbwx
8557 @opindex mno-bwx
8558 @opindex mcix
8559 @opindex mno-cix
8560 @opindex mfix
8561 @opindex mno-fix
8562 @opindex mmax
8563 @opindex mno-max
8564 Indicate whether GCC should generate code to use the optional BWX,
8565 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8566 sets supported by the CPU type specified via @option{-mcpu=} option or that
8567 of the CPU on which GCC was built if none was specified.
8569 @item -mfloat-vax
8570 @itemx -mfloat-ieee
8571 @opindex mfloat-vax
8572 @opindex mfloat-ieee
8573 Generate code that uses (does not use) VAX F and G floating point
8574 arithmetic instead of IEEE single and double precision.
8576 @item -mexplicit-relocs
8577 @itemx -mno-explicit-relocs
8578 @opindex mexplicit-relocs
8579 @opindex mno-explicit-relocs
8580 Older Alpha assemblers provided no way to generate symbol relocations
8581 except via assembler macros.  Use of these macros does not allow
8582 optimal instruction scheduling.  GNU binutils as of version 2.12
8583 supports a new syntax that allows the compiler to explicitly mark
8584 which relocations should apply to which instructions.  This option
8585 is mostly useful for debugging, as GCC detects the capabilities of
8586 the assembler when it is built and sets the default accordingly.
8588 @item -msmall-data
8589 @itemx -mlarge-data
8590 @opindex msmall-data
8591 @opindex mlarge-data
8592 When @option{-mexplicit-relocs} is in effect, static data is
8593 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
8594 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
8595 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
8596 16-bit relocations off of the @code{$gp} register.  This limits the
8597 size of the small data area to 64KB, but allows the variables to be
8598 directly accessed via a single instruction.
8600 The default is @option{-mlarge-data}.  With this option the data area
8601 is limited to just below 2GB@.  Programs that require more than 2GB of
8602 data must use @code{malloc} or @code{mmap} to allocate the data in the
8603 heap instead of in the program's data segment.
8605 When generating code for shared libraries, @option{-fpic} implies
8606 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
8608 @item -msmall-text
8609 @itemx -mlarge-text
8610 @opindex msmall-text
8611 @opindex mlarge-text
8612 When @option{-msmall-text} is used, the compiler assumes that the
8613 code of the entire program (or shared library) fits in 4MB, and is
8614 thus reachable with a branch instruction.  When @option{-msmall-data}
8615 is used, the compiler can assume that all local symbols share the
8616 same @code{$gp} value, and thus reduce the number of instructions
8617 required for a function call from 4 to 1.
8619 The default is @option{-mlarge-text}.
8621 @item -mcpu=@var{cpu_type}
8622 @opindex mcpu
8623 Set the instruction set and instruction scheduling parameters for
8624 machine type @var{cpu_type}.  You can specify either the @samp{EV}
8625 style name or the corresponding chip number.  GCC supports scheduling
8626 parameters for the EV4, EV5 and EV6 family of processors and will
8627 choose the default values for the instruction set from the processor
8628 you specify.  If you do not specify a processor type, GCC will default
8629 to the processor on which the compiler was built.
8631 Supported values for @var{cpu_type} are
8633 @table @samp
8634 @item ev4
8635 @itemx ev45
8636 @itemx 21064
8637 Schedules as an EV4 and has no instruction set extensions.
8639 @item ev5
8640 @itemx 21164
8641 Schedules as an EV5 and has no instruction set extensions.
8643 @item ev56
8644 @itemx 21164a
8645 Schedules as an EV5 and supports the BWX extension.
8647 @item pca56
8648 @itemx 21164pc
8649 @itemx 21164PC
8650 Schedules as an EV5 and supports the BWX and MAX extensions.
8652 @item ev6
8653 @itemx 21264
8654 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
8656 @item ev67
8657 @itemx 21264a
8658 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
8659 @end table
8661 @item -mtune=@var{cpu_type}
8662 @opindex mtune
8663 Set only the instruction scheduling parameters for machine type
8664 @var{cpu_type}.  The instruction set is not changed.
8666 @item -mmemory-latency=@var{time}
8667 @opindex mmemory-latency
8668 Sets the latency the scheduler should assume for typical memory
8669 references as seen by the application.  This number is highly
8670 dependent on the memory access patterns used by the application
8671 and the size of the external cache on the machine.
8673 Valid options for @var{time} are
8675 @table @samp
8676 @item @var{number}
8677 A decimal number representing clock cycles.
8679 @item L1
8680 @itemx L2
8681 @itemx L3
8682 @itemx main
8683 The compiler contains estimates of the number of clock cycles for
8684 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
8685 (also called Dcache, Scache, and Bcache), as well as to main memory.
8686 Note that L3 is only valid for EV5.
8688 @end table
8689 @end table
8691 @node DEC Alpha/VMS Options
8692 @subsection DEC Alpha/VMS Options
8694 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
8696 @table @gcctabopt
8697 @item -mvms-return-codes
8698 @opindex mvms-return-codes
8699 Return VMS condition codes from main.  The default is to return POSIX
8700 style condition (e.g.@ error) codes.
8701 @end table
8703 @node FRV Options
8704 @subsection FRV Options
8705 @cindex FRV Options
8707 @table @gcctabopt
8708 @item -mgpr-32
8709 @opindex mgpr-32
8711 Only use the first 32 general purpose registers.
8713 @item -mgpr-64
8714 @opindex mgpr-64
8716 Use all 64 general purpose registers.
8718 @item -mfpr-32
8719 @opindex mfpr-32
8721 Use only the first 32 floating point registers.
8723 @item -mfpr-64
8724 @opindex mfpr-64
8726 Use all 64 floating point registers
8728 @item -mhard-float
8729 @opindex mhard-float
8731 Use hardware instructions for floating point operations.
8733 @item -msoft-float
8734 @opindex msoft-float
8736 Use library routines for floating point operations.
8738 @item -malloc-cc
8739 @opindex malloc-cc
8741 Dynamically allocate condition code registers.
8743 @item -mfixed-cc
8744 @opindex mfixed-cc
8746 Do not try to dynamically allocate condition code registers, only
8747 use @code{icc0} and @code{fcc0}.
8749 @item -mdword
8750 @opindex mdword
8752 Change ABI to use double word insns.
8754 @item -mno-dword
8755 @opindex mno-dword
8757 Do not use double word instructions.
8759 @item -mdouble
8760 @opindex mdouble
8762 Use floating point double instructions.
8764 @item -mno-double
8765 @opindex mno-double
8767 Do not use floating point double instructions.
8769 @item -mmedia
8770 @opindex mmedia
8772 Use media instructions.
8774 @item -mno-media
8775 @opindex mno-media
8777 Do not use media instructions.
8779 @item -mmuladd
8780 @opindex mmuladd
8782 Use multiply and add/subtract instructions.
8784 @item -mno-muladd
8785 @opindex mno-muladd
8787 Do not use multiply and add/subtract instructions.
8789 @item -mfdpic
8790 @opindex mfdpic
8792 Select the FDPIC ABI, that uses function descriptors to represent
8793 pointers to functions.  Without any PIC/PIE-related options, it
8794 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
8795 assumes GOT entries and small data are within a 12-bit range from the
8796 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
8797 are computed with 32 bits.
8799 @item -minline-plt
8800 @opindex minline-plt
8802 Enable inlining of PLT entries in function calls to functions that are
8803 not known to bind locally.  It has no effect without @option{-mfdpic}.
8804 It's enabled by default if optimizing for speed and compiling for
8805 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
8806 optimization option such as @option{-O3} or above is present in the
8807 command line.
8809 @item -mTLS
8810 @opindex TLS
8812 Assume a large TLS segment when generating thread-local code.
8814 @item -mtls
8815 @opindex tls
8817 Do not assume a large TLS segment when generating thread-local code.
8819 @item -mgprel-ro
8820 @opindex mgprel-ro
8822 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
8823 that is known to be in read-only sections.  It's enabled by default,
8824 except for @option{-fpic} or @option{-fpie}: even though it may help
8825 make the global offset table smaller, it trades 1 instruction for 4.
8826 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
8827 one of which may be shared by multiple symbols, and it avoids the need
8828 for a GOT entry for the referenced symbol, so it's more likely to be a
8829 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
8831 @item -multilib-library-pic
8832 @opindex multilib-library-pic
8834 Link with the (library, not FD) pic libraries.  It's implied by
8835 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
8836 @option{-fpic} without @option{-mfdpic}.  You should never have to use
8837 it explicitly.
8839 @item -mlinked-fp
8840 @opindex mlinked-fp
8842 Follow the EABI requirement of always creating a frame pointer whenever
8843 a stack frame is allocated.  This option is enabled by default and can
8844 be disabled with @option{-mno-linked-fp}.
8846 @item -mlong-calls
8847 @opindex mlong-calls
8849 Use indirect addressing to call functions outside the current
8850 compilation unit.  This allows the functions to be placed anywhere
8851 within the 32-bit address space.
8853 @item -malign-labels
8854 @opindex malign-labels
8856 Try to align labels to an 8-byte boundary by inserting nops into the
8857 previous packet.  This option only has an effect when VLIW packing
8858 is enabled.  It doesn't create new packets; it merely adds nops to
8859 existing ones.
8861 @item -mlibrary-pic
8862 @opindex mlibrary-pic
8864 Generate position-independent EABI code.
8866 @item -macc-4
8867 @opindex macc-4
8869 Use only the first four media accumulator registers.
8871 @item -macc-8
8872 @opindex macc-8
8874 Use all eight media accumulator registers.
8876 @item -mpack
8877 @opindex mpack
8879 Pack VLIW instructions.
8881 @item -mno-pack
8882 @opindex mno-pack
8884 Do not pack VLIW instructions.
8886 @item -mno-eflags
8887 @opindex mno-eflags
8889 Do not mark ABI switches in e_flags.
8891 @item -mcond-move
8892 @opindex mcond-move
8894 Enable the use of conditional-move instructions (default).
8896 This switch is mainly for debugging the compiler and will likely be removed
8897 in a future version.
8899 @item -mno-cond-move
8900 @opindex mno-cond-move
8902 Disable the use of conditional-move instructions.
8904 This switch is mainly for debugging the compiler and will likely be removed
8905 in a future version.
8907 @item -mscc
8908 @opindex mscc
8910 Enable the use of conditional set instructions (default).
8912 This switch is mainly for debugging the compiler and will likely be removed
8913 in a future version.
8915 @item -mno-scc
8916 @opindex mno-scc
8918 Disable the use of conditional set instructions.
8920 This switch is mainly for debugging the compiler and will likely be removed
8921 in a future version.
8923 @item -mcond-exec
8924 @opindex mcond-exec
8926 Enable the use of conditional execution (default).
8928 This switch is mainly for debugging the compiler and will likely be removed
8929 in a future version.
8931 @item -mno-cond-exec
8932 @opindex mno-cond-exec
8934 Disable the use of conditional execution.
8936 This switch is mainly for debugging the compiler and will likely be removed
8937 in a future version.
8939 @item -mvliw-branch
8940 @opindex mvliw-branch
8942 Run a pass to pack branches into VLIW instructions (default).
8944 This switch is mainly for debugging the compiler and will likely be removed
8945 in a future version.
8947 @item -mno-vliw-branch
8948 @opindex mno-vliw-branch
8950 Do not run a pass to pack branches into VLIW instructions.
8952 This switch is mainly for debugging the compiler and will likely be removed
8953 in a future version.
8955 @item -mmulti-cond-exec
8956 @opindex mmulti-cond-exec
8958 Enable optimization of @code{&&} and @code{||} in conditional execution
8959 (default).
8961 This switch is mainly for debugging the compiler and will likely be removed
8962 in a future version.
8964 @item -mno-multi-cond-exec
8965 @opindex mno-multi-cond-exec
8967 Disable optimization of @code{&&} and @code{||} in conditional execution.
8969 This switch is mainly for debugging the compiler and will likely be removed
8970 in a future version.
8972 @item -mnested-cond-exec
8973 @opindex mnested-cond-exec
8975 Enable nested conditional execution optimizations (default).
8977 This switch is mainly for debugging the compiler and will likely be removed
8978 in a future version.
8980 @item -mno-nested-cond-exec
8981 @opindex mno-nested-cond-exec
8983 Disable nested conditional execution optimizations.
8985 This switch is mainly for debugging the compiler and will likely be removed
8986 in a future version.
8988 @item -moptimize-membar
8989 @opindex moptimize-membar
8991 This switch removes redundant @code{membar} instructions from the
8992 compiler generated code.  It is enabled by default.
8994 @item -mno-optimize-membar
8995 @opindex mno-optimize-membar
8997 This switch disables the automatic removal of redundant @code{membar}
8998 instructions from the generated code.
9000 @item -mtomcat-stats
9001 @opindex mtomcat-stats
9003 Cause gas to print out tomcat statistics.
9005 @item -mcpu=@var{cpu}
9006 @opindex mcpu
9008 Select the processor type for which to generate code.  Possible values are
9009 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9010 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9012 @end table
9014 @node GNU/Linux Options
9015 @subsection GNU/Linux Options
9017 These @samp{-m} options are defined for GNU/Linux targets:
9019 @table @gcctabopt
9020 @item -mglibc
9021 @opindex mglibc
9022 Use the GNU C library instead of uClibc.  This is the default except
9023 on @samp{*-*-linux-*uclibc*} targets.
9025 @item -muclibc
9026 @opindex muclibc
9027 Use uClibc instead of the GNU C library.  This is the default on
9028 @samp{*-*-linux-*uclibc*} targets.
9029 @end table
9031 @node H8/300 Options
9032 @subsection H8/300 Options
9034 These @samp{-m} options are defined for the H8/300 implementations:
9036 @table @gcctabopt
9037 @item -mrelax
9038 @opindex mrelax
9039 Shorten some address references at link time, when possible; uses the
9040 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9041 ld, Using ld}, for a fuller description.
9043 @item -mh
9044 @opindex mh
9045 Generate code for the H8/300H@.
9047 @item -ms
9048 @opindex ms
9049 Generate code for the H8S@.
9051 @item -mn
9052 @opindex mn
9053 Generate code for the H8S and H8/300H in the normal mode.  This switch
9054 must be used either with @option{-mh} or @option{-ms}.
9056 @item -ms2600
9057 @opindex ms2600
9058 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9060 @item -mint32
9061 @opindex mint32
9062 Make @code{int} data 32 bits by default.
9064 @item -malign-300
9065 @opindex malign-300
9066 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9067 The default for the H8/300H and H8S is to align longs and floats on 4
9068 byte boundaries.
9069 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9070 This option has no effect on the H8/300.
9071 @end table
9073 @node HPPA Options
9074 @subsection HPPA Options
9075 @cindex HPPA Options
9077 These @samp{-m} options are defined for the HPPA family of computers:
9079 @table @gcctabopt
9080 @item -march=@var{architecture-type}
9081 @opindex march
9082 Generate code for the specified architecture.  The choices for
9083 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9084 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9085 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9086 architecture option for your machine.  Code compiled for lower numbered
9087 architectures will run on higher numbered architectures, but not the
9088 other way around.
9090 @item -mpa-risc-1-0
9091 @itemx -mpa-risc-1-1
9092 @itemx -mpa-risc-2-0
9093 @opindex mpa-risc-1-0
9094 @opindex mpa-risc-1-1
9095 @opindex mpa-risc-2-0
9096 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9098 @item -mbig-switch
9099 @opindex mbig-switch
9100 Generate code suitable for big switch tables.  Use this option only if
9101 the assembler/linker complain about out of range branches within a switch
9102 table.
9104 @item -mjump-in-delay
9105 @opindex mjump-in-delay
9106 Fill delay slots of function calls with unconditional jump instructions
9107 by modifying the return pointer for the function call to be the target
9108 of the conditional jump.
9110 @item -mdisable-fpregs
9111 @opindex mdisable-fpregs
9112 Prevent floating point registers from being used in any manner.  This is
9113 necessary for compiling kernels which perform lazy context switching of
9114 floating point registers.  If you use this option and attempt to perform
9115 floating point operations, the compiler will abort.
9117 @item -mdisable-indexing
9118 @opindex mdisable-indexing
9119 Prevent the compiler from using indexing address modes.  This avoids some
9120 rather obscure problems when compiling MIG generated code under MACH@.
9122 @item -mno-space-regs
9123 @opindex mno-space-regs
9124 Generate code that assumes the target has no space registers.  This allows
9125 GCC to generate faster indirect calls and use unscaled index address modes.
9127 Such code is suitable for level 0 PA systems and kernels.
9129 @item -mfast-indirect-calls
9130 @opindex mfast-indirect-calls
9131 Generate code that assumes calls never cross space boundaries.  This
9132 allows GCC to emit code which performs faster indirect calls.
9134 This option will not work in the presence of shared libraries or nested
9135 functions.
9137 @item -mfixed-range=@var{register-range}
9138 @opindex mfixed-range
9139 Generate code treating the given register range as fixed registers.
9140 A fixed register is one that the register allocator can not use.  This is
9141 useful when compiling kernel code.  A register range is specified as
9142 two registers separated by a dash.  Multiple register ranges can be
9143 specified separated by a comma.
9145 @item -mlong-load-store
9146 @opindex mlong-load-store
9147 Generate 3-instruction load and store sequences as sometimes required by
9148 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9149 the HP compilers.
9151 @item -mportable-runtime
9152 @opindex mportable-runtime
9153 Use the portable calling conventions proposed by HP for ELF systems.
9155 @item -mgas
9156 @opindex mgas
9157 Enable the use of assembler directives only GAS understands.
9159 @item -mschedule=@var{cpu-type}
9160 @opindex mschedule
9161 Schedule code according to the constraints for the machine type
9162 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9163 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9164 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9165 proper scheduling option for your machine.  The default scheduling is
9166 @samp{8000}.
9168 @item -mlinker-opt
9169 @opindex mlinker-opt
9170 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9171 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9172 linkers in which they give bogus error messages when linking some programs.
9174 @item -msoft-float
9175 @opindex msoft-float
9176 Generate output containing library calls for floating point.
9177 @strong{Warning:} the requisite libraries are not available for all HPPA
9178 targets.  Normally the facilities of the machine's usual C compiler are
9179 used, but this cannot be done directly in cross-compilation.  You must make
9180 your own arrangements to provide suitable library functions for
9181 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9182 does provide software floating point support.
9184 @option{-msoft-float} changes the calling convention in the output file;
9185 therefore, it is only useful if you compile @emph{all} of a program with
9186 this option.  In particular, you need to compile @file{libgcc.a}, the
9187 library that comes with GCC, with @option{-msoft-float} in order for
9188 this to work.
9190 @item -msio
9191 @opindex msio
9192 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9193 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9194 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9195 options are available under HP-UX and HI-UX@.
9197 @item -mgnu-ld
9198 @opindex gnu-ld
9199 Use GNU ld specific options.  This passes @option{-shared} to ld when
9200 building a shared library.  It is the default when GCC is configured,
9201 explicitly or implicitly, with the GNU linker.  This option does not
9202 have any affect on which ld is called, it only changes what parameters
9203 are passed to that ld.  The ld that is called is determined by the
9204 @option{--with-ld} configure option, GCC's program search path, and
9205 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9206 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9207 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9209 @item -mhp-ld
9210 @opindex hp-ld
9211 Use HP ld specific options.  This passes @option{-b} to ld when building
9212 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9213 links.  It is the default when GCC is configured, explicitly or
9214 implicitly, with the HP linker.  This option does not have any affect on
9215 which ld is called, it only changes what parameters are passed to that
9216 ld.  The ld that is called is determined by the @option{--with-ld}
9217 configure option, GCC's program search path, and finally by the user's
9218 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9219 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9220 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9222 @item -mlong-calls
9223 @opindex mno-long-calls
9224 Generate code that uses long call sequences.  This ensures that a call
9225 is always able to reach linker generated stubs.  The default is to generate
9226 long calls only when the distance from the call site to the beginning
9227 of the function or translation unit, as the case may be, exceeds a
9228 predefined limit set by the branch type being used.  The limits for
9229 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9230 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9231 240,000 bytes.
9233 Distances are measured from the beginning of functions when using the
9234 @option{-ffunction-sections} option, or when using the @option{-mgas}
9235 and @option{-mno-portable-runtime} options together under HP-UX with
9236 the SOM linker.
9238 It is normally not desirable to use this option as it will degrade
9239 performance.  However, it may be useful in large applications,
9240 particularly when partial linking is used to build the application.
9242 The types of long calls used depends on the capabilities of the
9243 assembler and linker, and the type of code being generated.  The
9244 impact on systems that support long absolute calls, and long pic
9245 symbol-difference or pc-relative calls should be relatively small.
9246 However, an indirect call is used on 32-bit ELF systems in pic code
9247 and it is quite long.
9249 @item -munix=@var{unix-std}
9250 @opindex march
9251 Generate compiler predefines and select a startfile for the specified
9252 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9253 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9254 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9255 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9256 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9257 and later.
9259 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9260 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9261 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9262 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9263 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9264 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9266 It is @emph{important} to note that this option changes the interfaces
9267 for various library routines.  It also affects the operational behavior
9268 of the C library.  Thus, @emph{extreme} care is needed in using this
9269 option.
9271 Library code that is intended to operate with more than one UNIX
9272 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9273 as appropriate.  Most GNU software doesn't provide this capability.
9275 @item -nolibdld
9276 @opindex nolibdld
9277 Suppress the generation of link options to search libdld.sl when the
9278 @option{-static} option is specified on HP-UX 10 and later.
9280 @item -static
9281 @opindex static
9282 The HP-UX implementation of setlocale in libc has a dependency on
9283 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9284 when the @option{-static} option is specified, special link options
9285 are needed to resolve this dependency.
9287 On HP-UX 10 and later, the GCC driver adds the necessary options to
9288 link with libdld.sl when the @option{-static} option is specified.
9289 This causes the resulting binary to be dynamic.  On the 64-bit port,
9290 the linkers generate dynamic binaries by default in any case.  The
9291 @option{-nolibdld} option can be used to prevent the GCC driver from
9292 adding these link options.
9294 @item -threads
9295 @opindex threads
9296 Add support for multithreading with the @dfn{dce thread} library
9297 under HP-UX@.  This option sets flags for both the preprocessor and
9298 linker.
9299 @end table
9301 @node i386 and x86-64 Options
9302 @subsection Intel 386 and AMD x86-64 Options
9303 @cindex i386 Options
9304 @cindex x86-64 Options
9305 @cindex Intel 386 Options
9306 @cindex AMD x86-64 Options
9308 These @samp{-m} options are defined for the i386 and x86-64 family of
9309 computers:
9311 @table @gcctabopt
9312 @item -mtune=@var{cpu-type}
9313 @opindex mtune
9314 Tune to @var{cpu-type} everything applicable about the generated code, except
9315 for the ABI and the set of available instructions.  The choices for
9316 @var{cpu-type} are:
9317 @table @emph
9318 @item generic
9319 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9320 If you know the CPU on which your code will run, then you should use
9321 the corresponding @option{-mtune} option instead of
9322 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9323 of your application will have, then you should use this option.
9325 As new processors are deployed in the marketplace, the behavior of this
9326 option will change.  Therefore, if you upgrade to a newer version of
9327 GCC, the code generated option will change to reflect the processors
9328 that were most common when that version of GCC was released.
9330 There is no @option{-march=generic} option because @option{-march}
9331 indicates the instruction set the compiler can use, and there is no
9332 generic instruction set applicable to all processors.  In contrast,
9333 @option{-mtune} indicates the processor (or, in this case, collection of
9334 processors) for which the code is optimized.
9335 @item native
9336 This selects the CPU to tune for at compilation time by determining
9337 the processor type of the compiling machine.  Using @option{-mtune=native}
9338 will produce code optimized for the local machine under the constraints
9339 of the selected instruction set.  Using @option{-march=native} will
9340 enable all instruction subsets supported by the local machine (hence
9341 the result might not run on different machines).
9342 @item i386
9343 Original Intel's i386 CPU@.
9344 @item i486
9345 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9346 @item i586, pentium
9347 Intel Pentium CPU with no MMX support.
9348 @item pentium-mmx
9349 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9350 @item pentiumpro
9351 Intel PentiumPro CPU@.
9352 @item i686
9353 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9354 instruction set will be used, so the code will run on all i686 family chips.
9355 @item pentium2
9356 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9357 @item pentium3, pentium3m
9358 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9359 support.
9360 @item pentium-m
9361 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9362 support.  Used by Centrino notebooks.
9363 @item pentium4, pentium4m
9364 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9365 @item prescott
9366 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9367 set support.
9368 @item nocona
9369 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9370 SSE2 and SSE3 instruction set support.
9371 @item core2
9372 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9373 instruction set support.
9374 @item k6
9375 AMD K6 CPU with MMX instruction set support.
9376 @item k6-2, k6-3
9377 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9378 @item athlon, athlon-tbird
9379 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9380 support.
9381 @item athlon-4, athlon-xp, athlon-mp
9382 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9383 instruction set support.
9384 @item k8, opteron, athlon64, athlon-fx
9385 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9386 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9387 @item winchip-c6
9388 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9389 set support.
9390 @item winchip2
9391 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9392 instruction set support.
9393 @item c3
9394 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9395 implemented for this chip.)
9396 @item c3-2
9397 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9398 implemented for this chip.)
9399 @item geode
9400 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9401 @end table
9403 While picking a specific @var{cpu-type} will schedule things appropriately
9404 for that particular chip, the compiler will not generate any code that
9405 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9406 being used.
9408 @item -march=@var{cpu-type}
9409 @opindex march
9410 Generate instructions for the machine type @var{cpu-type}.  The choices
9411 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9412 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9414 @item -mcpu=@var{cpu-type}
9415 @opindex mcpu
9416 A deprecated synonym for @option{-mtune}.
9418 @item -m386
9419 @itemx -m486
9420 @itemx -mpentium
9421 @itemx -mpentiumpro
9422 @opindex m386
9423 @opindex m486
9424 @opindex mpentium
9425 @opindex mpentiumpro
9426 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9427 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9428 These synonyms are deprecated.
9430 @item -mfpmath=@var{unit}
9431 @opindex march
9432 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9433 for @var{unit} are:
9435 @table @samp
9436 @item 387
9437 Use the standard 387 floating point coprocessor present majority of chips and
9438 emulated otherwise.  Code compiled with this option will run almost everywhere.
9439 The temporary results are computed in 80bit precision instead of precision
9440 specified by the type resulting in slightly different results compared to most
9441 of other chips.  See @option{-ffloat-store} for more detailed description.
9443 This is the default choice for i386 compiler.
9445 @item sse
9446 Use scalar floating point instructions present in the SSE instruction set.
9447 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9448 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9449 instruction set supports only single precision arithmetics, thus the double and
9450 extended precision arithmetics is still done using 387.  Later version, present
9451 only in Pentium4 and the future AMD x86-64 chips supports double precision
9452 arithmetics too.
9454 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9455 or @option{-msse2} switches to enable SSE extensions and make this option
9456 effective.  For the x86-64 compiler, these extensions are enabled by default.
9458 The resulting code should be considerably faster in the majority of cases and avoid
9459 the numerical instability problems of 387 code, but may break some existing
9460 code that expects temporaries to be 80bit.
9462 This is the default choice for the x86-64 compiler.
9464 @item sse,387
9465 Attempt to utilize both instruction sets at once.  This effectively double the
9466 amount of available registers and on chips with separate execution units for
9467 387 and SSE the execution resources too.  Use this option with care, as it is
9468 still experimental, because the GCC register allocator does not model separate
9469 functional units well resulting in instable performance.
9470 @end table
9472 @item -masm=@var{dialect}
9473 @opindex masm=@var{dialect}
9474 Output asm instructions using selected @var{dialect}.  Supported
9475 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9476 not support @samp{intel}.
9478 @item -mieee-fp
9479 @itemx -mno-ieee-fp
9480 @opindex mieee-fp
9481 @opindex mno-ieee-fp
9482 Control whether or not the compiler uses IEEE floating point
9483 comparisons.  These handle correctly the case where the result of a
9484 comparison is unordered.
9486 @item -msoft-float
9487 @opindex msoft-float
9488 Generate output containing library calls for floating point.
9489 @strong{Warning:} the requisite libraries are not part of GCC@.
9490 Normally the facilities of the machine's usual C compiler are used, but
9491 this can't be done directly in cross-compilation.  You must make your
9492 own arrangements to provide suitable library functions for
9493 cross-compilation.
9495 On machines where a function returns floating point results in the 80387
9496 register stack, some floating point opcodes may be emitted even if
9497 @option{-msoft-float} is used.
9499 @item -mno-fp-ret-in-387
9500 @opindex mno-fp-ret-in-387
9501 Do not use the FPU registers for return values of functions.
9503 The usual calling convention has functions return values of types
9504 @code{float} and @code{double} in an FPU register, even if there
9505 is no FPU@.  The idea is that the operating system should emulate
9506 an FPU@.
9508 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9509 in ordinary CPU registers instead.
9511 @item -mno-fancy-math-387
9512 @opindex mno-fancy-math-387
9513 Some 387 emulators do not support the @code{sin}, @code{cos} and
9514 @code{sqrt} instructions for the 387.  Specify this option to avoid
9515 generating those instructions.  This option is the default on FreeBSD,
9516 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9517 indicates that the target cpu will always have an FPU and so the
9518 instruction will not need emulation.  As of revision 2.6.1, these
9519 instructions are not generated unless you also use the
9520 @option{-funsafe-math-optimizations} switch.
9522 @item -malign-double
9523 @itemx -mno-align-double
9524 @opindex malign-double
9525 @opindex mno-align-double
9526 Control whether GCC aligns @code{double}, @code{long double}, and
9527 @code{long long} variables on a two word boundary or a one word
9528 boundary.  Aligning @code{double} variables on a two word boundary will
9529 produce code that runs somewhat faster on a @samp{Pentium} at the
9530 expense of more memory.
9532 On x86-64, @option{-malign-double} is enabled by default.
9534 @strong{Warning:} if you use the @option{-malign-double} switch,
9535 structures containing the above types will be aligned differently than
9536 the published application binary interface specifications for the 386
9537 and will not be binary compatible with structures in code compiled
9538 without that switch.
9540 @item -m96bit-long-double
9541 @itemx -m128bit-long-double
9542 @opindex m96bit-long-double
9543 @opindex m128bit-long-double
9544 These switches control the size of @code{long double} type.  The i386
9545 application binary interface specifies the size to be 96 bits,
9546 so @option{-m96bit-long-double} is the default in 32 bit mode.
9548 Modern architectures (Pentium and newer) would prefer @code{long double}
9549 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9550 conforming to the ABI, this would not be possible.  So specifying a
9551 @option{-m128bit-long-double} will align @code{long double}
9552 to a 16 byte boundary by padding the @code{long double} with an additional
9553 32 bit zero.
9555 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9556 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9558 Notice that neither of these options enable any extra precision over the x87
9559 standard of 80 bits for a @code{long double}.
9561 @strong{Warning:} if you override the default value for your target ABI, the
9562 structures and arrays containing @code{long double} variables will change
9563 their size as well as function calling convention for function taking
9564 @code{long double} will be modified.  Hence they will not be binary
9565 compatible with arrays or structures in code compiled without that switch.
9567 @item -mmlarge-data-threshold=@var{number}
9568 @opindex mlarge-data-threshold=@var{number}
9569 When @option{-mcmodel=medium} is specified, the data greater than
9570 @var{threshold} are placed in large data section.  This value must be the
9571 same across all object linked into the binary and defaults to 65535.
9573 @item -msvr3-shlib
9574 @itemx -mno-svr3-shlib
9575 @opindex msvr3-shlib
9576 @opindex mno-svr3-shlib
9577 Control whether GCC places uninitialized local variables into the
9578 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9579 into @code{bss}.  These options are meaningful only on System V Release 3.
9581 @item -mrtd
9582 @opindex mrtd
9583 Use a different function-calling convention, in which functions that
9584 take a fixed number of arguments return with the @code{ret} @var{num}
9585 instruction, which pops their arguments while returning.  This saves one
9586 instruction in the caller since there is no need to pop the arguments
9587 there.
9589 You can specify that an individual function is called with this calling
9590 sequence with the function attribute @samp{stdcall}.  You can also
9591 override the @option{-mrtd} option by using the function attribute
9592 @samp{cdecl}.  @xref{Function Attributes}.
9594 @strong{Warning:} this calling convention is incompatible with the one
9595 normally used on Unix, so you cannot use it if you need to call
9596 libraries compiled with the Unix compiler.
9598 Also, you must provide function prototypes for all functions that
9599 take variable numbers of arguments (including @code{printf});
9600 otherwise incorrect code will be generated for calls to those
9601 functions.
9603 In addition, seriously incorrect code will result if you call a
9604 function with too many arguments.  (Normally, extra arguments are
9605 harmlessly ignored.)
9607 @item -mregparm=@var{num}
9608 @opindex mregparm
9609 Control how many registers are used to pass integer arguments.  By
9610 default, no registers are used to pass arguments, and at most 3
9611 registers can be used.  You can control this behavior for a specific
9612 function by using the function attribute @samp{regparm}.
9613 @xref{Function Attributes}.
9615 @strong{Warning:} if you use this switch, and
9616 @var{num} is nonzero, then you must build all modules with the same
9617 value, including any libraries.  This includes the system libraries and
9618 startup modules.
9620 @item -msseregparm
9621 @opindex msseregparm
9622 Use SSE register passing conventions for float and double arguments
9623 and return values.  You can control this behavior for a specific
9624 function by using the function attribute @samp{sseregparm}.
9625 @xref{Function Attributes}.
9627 @strong{Warning:} if you use this switch then you must build all
9628 modules with the same value, including any libraries.  This includes
9629 the system libraries and startup modules.
9631 @item -mstackrealign
9632 @opindex mstackrealign
9633 Realign the stack at entry.  On the Intel x86, the
9634 @option{-mstackrealign} option will generate an alternate prologue and
9635 epilogue that realigns the runtime stack.  This supports mixing legacy
9636 codes that keep a 4-byte aligned stack with modern codes that keep a
9637 16-byte stack for SSE compatibility.  The alternate prologue and
9638 epilogue are slower and bigger than the regular ones, and the
9639 alternate prologue requires an extra scratch register; this lowers the
9640 number of registers available if used in conjunction with the
9641 @code{regparm} attribute.  The @option{-mstackrealign} option is
9642 incompatible with the nested function prologue; this is considered a
9643 hard error.  See also the attribute @code{force_align_arg_pointer},
9644 applicable to individual functions.
9646 @item -mpreferred-stack-boundary=@var{num}
9647 @opindex mpreferred-stack-boundary
9648 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
9649 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
9650 the default is 4 (16 bytes or 128 bits).
9652 On Pentium and PentiumPro, @code{double} and @code{long double} values
9653 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
9654 suffer significant run time performance penalties.  On Pentium III, the
9655 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
9656 properly if it is not 16 byte aligned.
9658 To ensure proper alignment of this values on the stack, the stack boundary
9659 must be as aligned as that required by any value stored on the stack.
9660 Further, every function must be generated such that it keeps the stack
9661 aligned.  Thus calling a function compiled with a higher preferred
9662 stack boundary from a function compiled with a lower preferred stack
9663 boundary will most likely misalign the stack.  It is recommended that
9664 libraries that use callbacks always use the default setting.
9666 This extra alignment does consume extra stack space, and generally
9667 increases code size.  Code that is sensitive to stack space usage, such
9668 as embedded systems and operating system kernels, may want to reduce the
9669 preferred alignment to @option{-mpreferred-stack-boundary=2}.
9671 @item -mmmx
9672 @itemx -mno-mmx
9673 @item -msse
9674 @itemx -mno-sse
9675 @item -msse2
9676 @itemx -mno-sse2
9677 @item -msse3
9678 @itemx -mno-sse3
9679 @item -mssse3
9680 @itemx -mno-ssse3
9681 @item -m3dnow
9682 @itemx -mno-3dnow
9683 @opindex mmmx
9684 @opindex mno-mmx
9685 @opindex msse
9686 @opindex mno-sse
9687 @opindex m3dnow
9688 @opindex mno-3dnow
9689 These switches enable or disable the use of instructions in the MMX,
9690 SSE, SSE2, SSE3, SSSE3 or 3DNow! extended instruction sets.
9691 These extensions are also available as built-in functions: see
9692 @ref{X86 Built-in Functions}, for details of the functions enabled and
9693 disabled by these switches.
9695 To have SSE/SSE2 instructions generated automatically from floating-point
9696 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
9698 These options will enable GCC to use these extended instructions in
9699 generated code, even without @option{-mfpmath=sse}.  Applications which
9700 perform runtime CPU detection must compile separate files for each
9701 supported architecture, using the appropriate flags.  In particular,
9702 the file containing the CPU detection code should be compiled without
9703 these options.
9705 @item -mpush-args
9706 @itemx -mno-push-args
9707 @opindex mpush-args
9708 @opindex mno-push-args
9709 Use PUSH operations to store outgoing parameters.  This method is shorter
9710 and usually equally fast as method using SUB/MOV operations and is enabled
9711 by default.  In some cases disabling it may improve performance because of
9712 improved scheduling and reduced dependencies.
9714 @item -maccumulate-outgoing-args
9715 @opindex maccumulate-outgoing-args
9716 If enabled, the maximum amount of space required for outgoing arguments will be
9717 computed in the function prologue.  This is faster on most modern CPUs
9718 because of reduced dependencies, improved scheduling and reduced stack usage
9719 when preferred stack boundary is not equal to 2.  The drawback is a notable
9720 increase in code size.  This switch implies @option{-mno-push-args}.
9722 @item -mthreads
9723 @opindex mthreads
9724 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
9725 on thread-safe exception handling must compile and link all code with the
9726 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
9727 @option{-D_MT}; when linking, it links in a special thread helper library
9728 @option{-lmingwthrd} which cleans up per thread exception handling data.
9730 @item -mno-align-stringops
9731 @opindex mno-align-stringops
9732 Do not align destination of inlined string operations.  This switch reduces
9733 code size and improves performance in case the destination is already aligned,
9734 but GCC doesn't know about it.
9736 @item -minline-all-stringops
9737 @opindex minline-all-stringops
9738 By default GCC inlines string operations only when destination is known to be
9739 aligned at least to 4 byte boundary.  This enables more inlining, increase code
9740 size, but may improve performance of code that depends on fast memcpy, strlen
9741 and memset for short lengths.
9743 @item -minline-stringops-dynamically
9744 @opindex minline-stringops-dynamically
9745 For string operation of unknown size, inline runtime checks so for small
9746 blocks inline code is used, while for large blocks library call is used.
9748 @item -mstringop-strategy=@var{alg}
9749 @opindex mstringop-strategy=@var{alg}
9750 Overwrite internal decision heuristic about particular algorithm to inline
9751 string operation with.  The allowed values are @code{rep_byte},
9752 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
9753 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
9754 expanding inline loop, @code{libcall} for always expanding library call.
9756 @item -momit-leaf-frame-pointer
9757 @opindex momit-leaf-frame-pointer
9758 Don't keep the frame pointer in a register for leaf functions.  This
9759 avoids the instructions to save, set up and restore frame pointers and
9760 makes an extra register available in leaf functions.  The option
9761 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9762 which might make debugging harder.
9764 @item -mtls-direct-seg-refs
9765 @itemx -mno-tls-direct-seg-refs
9766 @opindex mtls-direct-seg-refs
9767 Controls whether TLS variables may be accessed with offsets from the
9768 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
9769 or whether the thread base pointer must be added.  Whether or not this
9770 is legal depends on the operating system, and whether it maps the
9771 segment to cover the entire TLS area.
9773 For systems that use GNU libc, the default is on.
9774 @end table
9776 These @samp{-m} switches are supported in addition to the above
9777 on AMD x86-64 processors in 64-bit environments.
9779 @table @gcctabopt
9780 @item -m32
9781 @itemx -m64
9782 @opindex m32
9783 @opindex m64
9784 Generate code for a 32-bit or 64-bit environment.
9785 The 32-bit environment sets int, long and pointer to 32 bits and
9786 generates code that runs on any i386 system.
9787 The 64-bit environment sets int to 32 bits and long and pointer
9788 to 64 bits and generates code for AMD's x86-64 architecture.
9790 @item -mno-red-zone
9791 @opindex no-red-zone
9792 Do not use a so called red zone for x86-64 code.  The red zone is mandated
9793 by the x86-64 ABI, it is a 128-byte area beyond the location of the
9794 stack pointer that will not be modified by signal or interrupt handlers
9795 and therefore can be used for temporary data without adjusting the stack
9796 pointer.  The flag @option{-mno-red-zone} disables this red zone.
9798 @item -mcmodel=small
9799 @opindex mcmodel=small
9800 Generate code for the small code model: the program and its symbols must
9801 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
9802 Programs can be statically or dynamically linked.  This is the default
9803 code model.
9805 @item -mcmodel=kernel
9806 @opindex mcmodel=kernel
9807 Generate code for the kernel code model.  The kernel runs in the
9808 negative 2 GB of the address space.
9809 This model has to be used for Linux kernel code.
9811 @item -mcmodel=medium
9812 @opindex mcmodel=medium
9813 Generate code for the medium model: The program is linked in the lower 2
9814 GB of the address space but symbols can be located anywhere in the
9815 address space.  Programs can be statically or dynamically linked, but
9816 building of shared libraries are not supported with the medium model.
9818 @item -mcmodel=large
9819 @opindex mcmodel=large
9820 Generate code for the large model: This model makes no assumptions
9821 about addresses and sizes of sections.  Currently GCC does not implement
9822 this model.
9823 @end table
9825 @node IA-64 Options
9826 @subsection IA-64 Options
9827 @cindex IA-64 Options
9829 These are the @samp{-m} options defined for the Intel IA-64 architecture.
9831 @table @gcctabopt
9832 @item -mbig-endian
9833 @opindex mbig-endian
9834 Generate code for a big endian target.  This is the default for HP-UX@.
9836 @item -mlittle-endian
9837 @opindex mlittle-endian
9838 Generate code for a little endian target.  This is the default for AIX5
9839 and GNU/Linux.
9841 @item -mgnu-as
9842 @itemx -mno-gnu-as
9843 @opindex mgnu-as
9844 @opindex mno-gnu-as
9845 Generate (or don't) code for the GNU assembler.  This is the default.
9846 @c Also, this is the default if the configure option @option{--with-gnu-as}
9847 @c is used.
9849 @item -mgnu-ld
9850 @itemx -mno-gnu-ld
9851 @opindex mgnu-ld
9852 @opindex mno-gnu-ld
9853 Generate (or don't) code for the GNU linker.  This is the default.
9854 @c Also, this is the default if the configure option @option{--with-gnu-ld}
9855 @c is used.
9857 @item -mno-pic
9858 @opindex mno-pic
9859 Generate code that does not use a global pointer register.  The result
9860 is not position independent code, and violates the IA-64 ABI@.
9862 @item -mvolatile-asm-stop
9863 @itemx -mno-volatile-asm-stop
9864 @opindex mvolatile-asm-stop
9865 @opindex mno-volatile-asm-stop
9866 Generate (or don't) a stop bit immediately before and after volatile asm
9867 statements.
9869 @item -mregister-names
9870 @itemx -mno-register-names
9871 @opindex mregister-names
9872 @opindex mno-register-names
9873 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
9874 the stacked registers.  This may make assembler output more readable.
9876 @item -mno-sdata
9877 @itemx -msdata
9878 @opindex mno-sdata
9879 @opindex msdata
9880 Disable (or enable) optimizations that use the small data section.  This may
9881 be useful for working around optimizer bugs.
9883 @item -mconstant-gp
9884 @opindex mconstant-gp
9885 Generate code that uses a single constant global pointer value.  This is
9886 useful when compiling kernel code.
9888 @item -mauto-pic
9889 @opindex mauto-pic
9890 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
9891 This is useful when compiling firmware code.
9893 @item -minline-float-divide-min-latency
9894 @opindex minline-float-divide-min-latency
9895 Generate code for inline divides of floating point values
9896 using the minimum latency algorithm.
9898 @item -minline-float-divide-max-throughput
9899 @opindex minline-float-divide-max-throughput
9900 Generate code for inline divides of floating point values
9901 using the maximum throughput algorithm.
9903 @item -minline-int-divide-min-latency
9904 @opindex minline-int-divide-min-latency
9905 Generate code for inline divides of integer values
9906 using the minimum latency algorithm.
9908 @item -minline-int-divide-max-throughput
9909 @opindex minline-int-divide-max-throughput
9910 Generate code for inline divides of integer values
9911 using the maximum throughput algorithm.
9913 @item -minline-sqrt-min-latency
9914 @opindex minline-sqrt-min-latency
9915 Generate code for inline square roots
9916 using the minimum latency algorithm.
9918 @item -minline-sqrt-max-throughput
9919 @opindex minline-sqrt-max-throughput
9920 Generate code for inline square roots
9921 using the maximum throughput algorithm.
9923 @item -mno-dwarf2-asm
9924 @itemx -mdwarf2-asm
9925 @opindex mno-dwarf2-asm
9926 @opindex mdwarf2-asm
9927 Don't (or do) generate assembler code for the DWARF2 line number debugging
9928 info.  This may be useful when not using the GNU assembler.
9930 @item -mearly-stop-bits
9931 @itemx -mno-early-stop-bits
9932 @opindex mearly-stop-bits
9933 @opindex mno-early-stop-bits
9934 Allow stop bits to be placed earlier than immediately preceding the
9935 instruction that triggered the stop bit.  This can improve instruction
9936 scheduling, but does not always do so.
9938 @item -mfixed-range=@var{register-range}
9939 @opindex mfixed-range
9940 Generate code treating the given register range as fixed registers.
9941 A fixed register is one that the register allocator can not use.  This is
9942 useful when compiling kernel code.  A register range is specified as
9943 two registers separated by a dash.  Multiple register ranges can be
9944 specified separated by a comma.
9946 @item -mtls-size=@var{tls-size}
9947 @opindex mtls-size
9948 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
9951 @item -mtune=@var{cpu-type}
9952 @opindex mtune
9953 Tune the instruction scheduling for a particular CPU, Valid values are
9954 itanium, itanium1, merced, itanium2, and mckinley.
9956 @item -mt
9957 @itemx -pthread
9958 @opindex mt
9959 @opindex pthread
9960 Add support for multithreading using the POSIX threads library.  This
9961 option sets flags for both the preprocessor and linker.  It does
9962 not affect the thread safety of object code produced by the compiler or
9963 that of libraries supplied with it.  These are HP-UX specific flags.
9965 @item -milp32
9966 @itemx -mlp64
9967 @opindex milp32
9968 @opindex mlp64
9969 Generate code for a 32-bit or 64-bit environment.
9970 The 32-bit environment sets int, long and pointer to 32 bits.
9971 The 64-bit environment sets int to 32 bits and long and pointer
9972 to 64 bits.  These are HP-UX specific flags.
9974 @item -mno-sched-br-data-spec
9975 @itemx -msched-br-data-spec
9976 @opindex -mno-sched-br-data-spec
9977 @opindex -msched-br-data-spec
9978 (Dis/En)able data speculative scheduling before reload.
9979 This will result in generation of the ld.a instructions and
9980 the corresponding check instructions (ld.c / chk.a).
9981 The default is 'disable'.
9983 @item -msched-ar-data-spec
9984 @itemx -mno-sched-ar-data-spec
9985 @opindex -msched-ar-data-spec
9986 @opindex -mno-sched-ar-data-spec
9987 (En/Dis)able data speculative scheduling after reload.
9988 This will result in generation of the ld.a instructions and
9989 the corresponding check instructions (ld.c / chk.a).
9990 The default is 'enable'.
9992 @item -mno-sched-control-spec
9993 @itemx -msched-control-spec
9994 @opindex -mno-sched-control-spec
9995 @opindex -msched-control-spec
9996 (Dis/En)able control speculative scheduling.  This feature is
9997 available only during region scheduling (i.e. before reload).
9998 This will result in generation of the ld.s instructions and
9999 the corresponding check instructions chk.s .
10000 The default is 'disable'.
10002 @item -msched-br-in-data-spec
10003 @itemx -mno-sched-br-in-data-spec
10004 @opindex -msched-br-in-data-spec
10005 @opindex -mno-sched-br-in-data-spec
10006 (En/Dis)able speculative scheduling of the instructions that
10007 are dependent on the data speculative loads before reload.
10008 This is effective only with @option{-msched-br-data-spec} enabled.
10009 The default is 'enable'.
10011 @item -msched-ar-in-data-spec
10012 @itemx -mno-sched-ar-in-data-spec
10013 @opindex -msched-ar-in-data-spec
10014 @opindex -mno-sched-ar-in-data-spec
10015 (En/Dis)able speculative scheduling of the instructions that
10016 are dependent on the data speculative loads after reload.
10017 This is effective only with @option{-msched-ar-data-spec} enabled.
10018 The default is 'enable'.
10020 @item -msched-in-control-spec
10021 @itemx -mno-sched-in-control-spec
10022 @opindex -msched-in-control-spec
10023 @opindex -mno-sched-in-control-spec
10024 (En/Dis)able speculative scheduling of the instructions that
10025 are dependent on the control speculative loads.
10026 This is effective only with @option{-msched-control-spec} enabled.
10027 The default is 'enable'.
10029 @item -msched-ldc
10030 @itemx -mno-sched-ldc
10031 @opindex -msched-ldc
10032 @opindex -mno-sched-ldc
10033 (En/Dis)able use of simple data speculation checks ld.c .
10034 If disabled, only chk.a instructions will be emitted to check
10035 data speculative loads.
10036 The default is 'enable'.
10038 @item -mno-sched-control-ldc
10039 @itemx -msched-control-ldc
10040 @opindex -mno-sched-control-ldc
10041 @opindex -msched-control-ldc 
10042 (Dis/En)able use of ld.c instructions to check control speculative loads.
10043 If enabled, in case of control speculative load with no speculatively
10044 scheduled dependent instructions this load will be emitted as ld.sa and
10045 ld.c will be used to check it.
10046 The default is 'disable'.
10048 @item -mno-sched-spec-verbose
10049 @itemx -msched-spec-verbose
10050 @opindex -mno-sched-spec-verbose
10051 @opindex -msched-spec-verbose
10052 (Dis/En)able printing of the information about speculative motions.
10054 @item -mno-sched-prefer-non-data-spec-insns
10055 @itemx -msched-prefer-non-data-spec-insns
10056 @opindex -mno-sched-prefer-non-data-spec-insns
10057 @opindex -msched-prefer-non-data-spec-insns
10058 If enabled, data speculative instructions will be chosen for schedule
10059 only if there are no other choices at the moment.  This will make
10060 the use of the data speculation much more conservative.
10061 The default is 'disable'.
10063 @item -mno-sched-prefer-non-control-spec-insns
10064 @itemx -msched-prefer-non-control-spec-insns
10065 @opindex -mno-sched-prefer-non-control-spec-insns
10066 @opindex -msched-prefer-non-control-spec-insns
10067 If enabled, control speculative instructions will be chosen for schedule
10068 only if there are no other choices at the moment.  This will make
10069 the use of the control speculation much more conservative.
10070 The default is 'disable'.
10072 @item -mno-sched-count-spec-in-critical-path
10073 @itemx -msched-count-spec-in-critical-path
10074 @opindex -mno-sched-count-spec-in-critical-path
10075 @opindex -msched-count-spec-in-critical-path
10076 If enabled, speculative dependencies will be considered during
10077 computation of the instructions priorities.  This will make the use of the
10078 speculation a bit more conservative.
10079 The default is 'disable'.
10081 @end table
10083 @node M32C Options
10084 @subsection M32C Options
10085 @cindex M32C options
10087 @table @gcctabopt
10088 @item -mcpu=@var{name}
10089 @opindex mcpu=
10090 Select the CPU for which code is generated.  @var{name} may be one of
10091 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10092 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10093 the M32C/80 series.
10095 @item -msim
10096 @opindex msim
10097 Specifies that the program will be run on the simulator.  This causes
10098 an alternate runtime library to be linked in which supports, for
10099 example, file I/O.  You must not use this option when generating
10100 programs that will run on real hardware; you must provide your own
10101 runtime library for whatever I/O functions are needed.
10103 @item -memregs=@var{number}
10104 @opindex memregs=
10105 Specifies the number of memory-based pseudo-registers GCC will use
10106 during code generation.  These pseudo-registers will be used like real
10107 registers, so there is a tradeoff between GCC's ability to fit the
10108 code into available registers, and the performance penalty of using
10109 memory instead of registers.  Note that all modules in a program must
10110 be compiled with the same value for this option.  Because of that, you
10111 must not use this option with the default runtime libraries gcc
10112 builds.
10114 @end table
10116 @node M32R/D Options
10117 @subsection M32R/D Options
10118 @cindex M32R/D options
10120 These @option{-m} options are defined for Renesas M32R/D architectures:
10122 @table @gcctabopt
10123 @item -m32r2
10124 @opindex m32r2
10125 Generate code for the M32R/2@.
10127 @item -m32rx
10128 @opindex m32rx
10129 Generate code for the M32R/X@.
10131 @item -m32r
10132 @opindex m32r
10133 Generate code for the M32R@.  This is the default.
10135 @item -mmodel=small
10136 @opindex mmodel=small
10137 Assume all objects live in the lower 16MB of memory (so that their addresses
10138 can be loaded with the @code{ld24} instruction), and assume all subroutines
10139 are reachable with the @code{bl} instruction.
10140 This is the default.
10142 The addressability of a particular object can be set with the
10143 @code{model} attribute.
10145 @item -mmodel=medium
10146 @opindex mmodel=medium
10147 Assume objects may be anywhere in the 32-bit address space (the compiler
10148 will generate @code{seth/add3} instructions to load their addresses), and
10149 assume all subroutines are reachable with the @code{bl} instruction.
10151 @item -mmodel=large
10152 @opindex mmodel=large
10153 Assume objects may be anywhere in the 32-bit address space (the compiler
10154 will generate @code{seth/add3} instructions to load their addresses), and
10155 assume subroutines may not be reachable with the @code{bl} instruction
10156 (the compiler will generate the much slower @code{seth/add3/jl}
10157 instruction sequence).
10159 @item -msdata=none
10160 @opindex msdata=none
10161 Disable use of the small data area.  Variables will be put into
10162 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10163 @code{section} attribute has been specified).
10164 This is the default.
10166 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10167 Objects may be explicitly put in the small data area with the
10168 @code{section} attribute using one of these sections.
10170 @item -msdata=sdata
10171 @opindex msdata=sdata
10172 Put small global and static data in the small data area, but do not
10173 generate special code to reference them.
10175 @item -msdata=use
10176 @opindex msdata=use
10177 Put small global and static data in the small data area, and generate
10178 special instructions to reference them.
10180 @item -G @var{num}
10181 @opindex G
10182 @cindex smaller data references
10183 Put global and static objects less than or equal to @var{num} bytes
10184 into the small data or bss sections instead of the normal data or bss
10185 sections.  The default value of @var{num} is 8.
10186 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10187 for this option to have any effect.
10189 All modules should be compiled with the same @option{-G @var{num}} value.
10190 Compiling with different values of @var{num} may or may not work; if it
10191 doesn't the linker will give an error message---incorrect code will not be
10192 generated.
10194 @item -mdebug
10195 @opindex mdebug
10196 Makes the M32R specific code in the compiler display some statistics
10197 that might help in debugging programs.
10199 @item -malign-loops
10200 @opindex malign-loops
10201 Align all loops to a 32-byte boundary.
10203 @item -mno-align-loops
10204 @opindex mno-align-loops
10205 Do not enforce a 32-byte alignment for loops.  This is the default.
10207 @item -missue-rate=@var{number}
10208 @opindex missue-rate=@var{number}
10209 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10210 or 2.
10212 @item -mbranch-cost=@var{number}
10213 @opindex mbranch-cost=@var{number}
10214 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10215 preferred over conditional code, if it is 2, then the opposite will
10216 apply.
10218 @item -mflush-trap=@var{number}
10219 @opindex mflush-trap=@var{number}
10220 Specifies the trap number to use to flush the cache.  The default is
10221 12.  Valid numbers are between 0 and 15 inclusive.
10223 @item -mno-flush-trap
10224 @opindex mno-flush-trap
10225 Specifies that the cache cannot be flushed by using a trap.
10227 @item -mflush-func=@var{name}
10228 @opindex mflush-func=@var{name}
10229 Specifies the name of the operating system function to call to flush
10230 the cache.  The default is @emph{_flush_cache}, but a function call
10231 will only be used if a trap is not available.
10233 @item -mno-flush-func
10234 @opindex mno-flush-func
10235 Indicates that there is no OS function for flushing the cache.
10237 @end table
10239 @node M680x0 Options
10240 @subsection M680x0 Options
10241 @cindex M680x0 options
10243 These are the @samp{-m} options defined for the 68000 series.  The default
10244 values for these options depends on which style of 68000 was selected when
10245 the compiler was configured; the defaults for the most common choices are
10246 given below.
10248 @table @gcctabopt
10249 @item -m68000
10250 @itemx -mc68000
10251 @opindex m68000
10252 @opindex mc68000
10253 Generate output for a 68000.  This is the default
10254 when the compiler is configured for 68000-based systems.
10256 Use this option for microcontrollers with a 68000 or EC000 core,
10257 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10259 @item -m68020
10260 @itemx -mc68020
10261 @opindex m68020
10262 @opindex mc68020
10263 Generate output for a 68020.  This is the default
10264 when the compiler is configured for 68020-based systems.
10266 @item -m68881
10267 @opindex m68881
10268 Generate output containing 68881 instructions for floating point.
10269 This is the default for most 68020 systems unless @option{--nfp} was
10270 specified when the compiler was configured.
10272 @item -m68030
10273 @opindex m68030
10274 Generate output for a 68030.  This is the default when the compiler is
10275 configured for 68030-based systems.
10277 @item -m68040
10278 @opindex m68040
10279 Generate output for a 68040.  This is the default when the compiler is
10280 configured for 68040-based systems.
10282 This option inhibits the use of 68881/68882 instructions that have to be
10283 emulated by software on the 68040.  Use this option if your 68040 does not
10284 have code to emulate those instructions.
10286 @item -m68060
10287 @opindex m68060
10288 Generate output for a 68060.  This is the default when the compiler is
10289 configured for 68060-based systems.
10291 This option inhibits the use of 68020 and 68881/68882 instructions that
10292 have to be emulated by software on the 68060.  Use this option if your 68060
10293 does not have code to emulate those instructions.
10295 @item -mcpu32
10296 @opindex mcpu32
10297 Generate output for a CPU32.  This is the default
10298 when the compiler is configured for CPU32-based systems.
10300 Use this option for microcontrollers with a
10301 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
10302 68336, 68340, 68341, 68349 and 68360.
10304 @item -m5200
10305 @opindex m5200
10306 Generate output for a 520X ``coldfire'' family cpu.  This is the default
10307 when the compiler is configured for 520X-based systems.
10309 Use this option for microcontroller with a 5200 core, including
10310 the MCF5202, MCF5203, MCF5204 and MCF5202.
10312 @item -mcfv4e
10313 @opindex mcfv4e
10314 Generate output for a ColdFire V4e family cpu (e.g.@: 547x/548x).
10315 This includes use of hardware floating point instructions.
10317 @item -m68020-40
10318 @opindex m68020-40
10319 Generate output for a 68040, without using any of the new instructions.
10320 This results in code which can run relatively efficiently on either a
10321 68020/68881 or a 68030 or a 68040.  The generated code does use the
10322 68881 instructions that are emulated on the 68040.
10324 @item -m68020-60
10325 @opindex m68020-60
10326 Generate output for a 68060, without using any of the new instructions.
10327 This results in code which can run relatively efficiently on either a
10328 68020/68881 or a 68030 or a 68040.  The generated code does use the
10329 68881 instructions that are emulated on the 68060.
10331 @item -msoft-float
10332 @opindex msoft-float
10333 Generate output containing library calls for floating point.
10334 @strong{Warning:} the requisite libraries are not available for all m68k
10335 targets.  Normally the facilities of the machine's usual C compiler are
10336 used, but this can't be done directly in cross-compilation.  You must
10337 make your own arrangements to provide suitable library functions for
10338 cross-compilation.  The embedded targets @samp{m68k-*-aout} and
10339 @samp{m68k-*-coff} do provide software floating point support.
10341 @item -mshort
10342 @opindex mshort
10343 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10344 Additionally, parameters passed on the stack are also aligned to a
10345 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10347 @item -mnobitfield
10348 @opindex mnobitfield
10349 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10350 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10352 @item -mbitfield
10353 @opindex mbitfield
10354 Do use the bit-field instructions.  The @option{-m68020} option implies
10355 @option{-mbitfield}.  This is the default if you use a configuration
10356 designed for a 68020.
10358 @item -mrtd
10359 @opindex mrtd
10360 Use a different function-calling convention, in which functions
10361 that take a fixed number of arguments return with the @code{rtd}
10362 instruction, which pops their arguments while returning.  This
10363 saves one instruction in the caller since there is no need to pop
10364 the arguments there.
10366 This calling convention is incompatible with the one normally
10367 used on Unix, so you cannot use it if you need to call libraries
10368 compiled with the Unix compiler.
10370 Also, you must provide function prototypes for all functions that
10371 take variable numbers of arguments (including @code{printf});
10372 otherwise incorrect code will be generated for calls to those
10373 functions.
10375 In addition, seriously incorrect code will result if you call a
10376 function with too many arguments.  (Normally, extra arguments are
10377 harmlessly ignored.)
10379 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10380 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10382 @item -malign-int
10383 @itemx -mno-align-int
10384 @opindex malign-int
10385 @opindex mno-align-int
10386 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10387 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10388 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10389 Aligning variables on 32-bit boundaries produces code that runs somewhat
10390 faster on processors with 32-bit busses at the expense of more memory.
10392 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
10393 align structures containing the above types  differently than
10394 most published application binary interface specifications for the m68k.
10396 @item -mpcrel
10397 @opindex mpcrel
10398 Use the pc-relative addressing mode of the 68000 directly, instead of
10399 using a global offset table.  At present, this option implies @option{-fpic},
10400 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
10401 not presently supported with @option{-mpcrel}, though this could be supported for
10402 68020 and higher processors.
10404 @item -mno-strict-align
10405 @itemx -mstrict-align
10406 @opindex mno-strict-align
10407 @opindex mstrict-align
10408 Do not (do) assume that unaligned memory references will be handled by
10409 the system.
10411 @item -msep-data
10412 Generate code that allows the data segment to be located in a different
10413 area of memory from the text segment.  This allows for execute in place in
10414 an environment without virtual memory management.  This option implies
10415 @option{-fPIC}.
10417 @item -mno-sep-data
10418 Generate code that assumes that the data segment follows the text segment.
10419 This is the default.
10421 @item -mid-shared-library
10422 Generate code that supports shared libraries via the library ID method.
10423 This allows for execute in place and shared libraries in an environment
10424 without virtual memory management.  This option implies @option{-fPIC}.
10426 @item -mno-id-shared-library
10427 Generate code that doesn't assume ID based shared libraries are being used.
10428 This is the default.
10430 @item -mshared-library-id=n
10431 Specified the identification number of the ID based shared library being
10432 compiled.  Specifying a value of 0 will generate more compact code, specifying
10433 other values will force the allocation of that number to the current
10434 library but is no more space or time efficient than omitting this option.
10436 @end table
10438 @node M68hc1x Options
10439 @subsection M68hc1x Options
10440 @cindex M68hc1x options
10442 These are the @samp{-m} options defined for the 68hc11 and 68hc12
10443 microcontrollers.  The default values for these options depends on
10444 which style of microcontroller was selected when the compiler was configured;
10445 the defaults for the most common choices are given below.
10447 @table @gcctabopt
10448 @item -m6811
10449 @itemx -m68hc11
10450 @opindex m6811
10451 @opindex m68hc11
10452 Generate output for a 68HC11.  This is the default
10453 when the compiler is configured for 68HC11-based systems.
10455 @item -m6812
10456 @itemx -m68hc12
10457 @opindex m6812
10458 @opindex m68hc12
10459 Generate output for a 68HC12.  This is the default
10460 when the compiler is configured for 68HC12-based systems.
10462 @item -m68S12
10463 @itemx -m68hcs12
10464 @opindex m68S12
10465 @opindex m68hcs12
10466 Generate output for a 68HCS12.
10468 @item -mauto-incdec
10469 @opindex mauto-incdec
10470 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
10471 addressing modes.
10473 @item -minmax
10474 @itemx -nominmax
10475 @opindex minmax
10476 @opindex mnominmax
10477 Enable the use of 68HC12 min and max instructions.
10479 @item -mlong-calls
10480 @itemx -mno-long-calls
10481 @opindex mlong-calls
10482 @opindex mno-long-calls
10483 Treat all calls as being far away (near).  If calls are assumed to be
10484 far away, the compiler will use the @code{call} instruction to
10485 call a function and the @code{rtc} instruction for returning.
10487 @item -mshort
10488 @opindex mshort
10489 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10491 @item -msoft-reg-count=@var{count}
10492 @opindex msoft-reg-count
10493 Specify the number of pseudo-soft registers which are used for the
10494 code generation.  The maximum number is 32.  Using more pseudo-soft
10495 register may or may not result in better code depending on the program.
10496 The default is 4 for 68HC11 and 2 for 68HC12.
10498 @end table
10500 @node MCore Options
10501 @subsection MCore Options
10502 @cindex MCore options
10504 These are the @samp{-m} options defined for the Motorola M*Core
10505 processors.
10507 @table @gcctabopt
10509 @item -mhardlit
10510 @itemx -mno-hardlit
10511 @opindex mhardlit
10512 @opindex mno-hardlit
10513 Inline constants into the code stream if it can be done in two
10514 instructions or less.
10516 @item -mdiv
10517 @itemx -mno-div
10518 @opindex mdiv
10519 @opindex mno-div
10520 Use the divide instruction.  (Enabled by default).
10522 @item -mrelax-immediate
10523 @itemx -mno-relax-immediate
10524 @opindex mrelax-immediate
10525 @opindex mno-relax-immediate
10526 Allow arbitrary sized immediates in bit operations.
10528 @item -mwide-bitfields
10529 @itemx -mno-wide-bitfields
10530 @opindex mwide-bitfields
10531 @opindex mno-wide-bitfields
10532 Always treat bit-fields as int-sized.
10534 @item -m4byte-functions
10535 @itemx -mno-4byte-functions
10536 @opindex m4byte-functions
10537 @opindex mno-4byte-functions
10538 Force all functions to be aligned to a four byte boundary.
10540 @item -mcallgraph-data
10541 @itemx -mno-callgraph-data
10542 @opindex mcallgraph-data
10543 @opindex mno-callgraph-data
10544 Emit callgraph information.
10546 @item -mslow-bytes
10547 @itemx -mno-slow-bytes
10548 @opindex mslow-bytes
10549 @opindex mno-slow-bytes
10550 Prefer word access when reading byte quantities.
10552 @item -mlittle-endian
10553 @itemx -mbig-endian
10554 @opindex mlittle-endian
10555 @opindex mbig-endian
10556 Generate code for a little endian target.
10558 @item -m210
10559 @itemx -m340
10560 @opindex m210
10561 @opindex m340
10562 Generate code for the 210 processor.
10563 @end table
10565 @node MIPS Options
10566 @subsection MIPS Options
10567 @cindex MIPS options
10569 @table @gcctabopt
10571 @item -EB
10572 @opindex EB
10573 Generate big-endian code.
10575 @item -EL
10576 @opindex EL
10577 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
10578 configurations.
10580 @item -march=@var{arch}
10581 @opindex march
10582 Generate code that will run on @var{arch}, which can be the name of a
10583 generic MIPS ISA, or the name of a particular processor.
10584 The ISA names are:
10585 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
10586 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
10587 The processor names are:
10588 @samp{4kc}, @samp{4km}, @samp{4kp},
10589 @samp{4kec}, @samp{4kem}, @samp{4kep},
10590 @samp{5kc}, @samp{5kf},
10591 @samp{20kc},
10592 @samp{24kc}, @samp{24kf}, @samp{24kx},
10593 @samp{24kec}, @samp{24kef}, @samp{24kex},
10594 @samp{34kc}, @samp{34kf}, @samp{34kx},
10595 @samp{m4k},
10596 @samp{orion},
10597 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
10598 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
10599 @samp{rm7000}, @samp{rm9000},
10600 @samp{sb1},
10601 @samp{sr71000},
10602 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
10603 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
10604 The special value @samp{from-abi} selects the
10605 most compatible architecture for the selected ABI (that is,
10606 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
10608 In processor names, a final @samp{000} can be abbreviated as @samp{k}
10609 (for example, @samp{-march=r2k}).  Prefixes are optional, and
10610 @samp{vr} may be written @samp{r}.
10612 GCC defines two macros based on the value of this option.  The first
10613 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
10614 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
10615 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
10616 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
10617 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
10619 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
10620 above.  In other words, it will have the full prefix and will not
10621 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
10622 the macro names the resolved architecture (either @samp{"mips1"} or
10623 @samp{"mips3"}).  It names the default architecture when no
10624 @option{-march} option is given.
10626 @item -mtune=@var{arch}
10627 @opindex mtune
10628 Optimize for @var{arch}.  Among other things, this option controls
10629 the way instructions are scheduled, and the perceived cost of arithmetic
10630 operations.  The list of @var{arch} values is the same as for
10631 @option{-march}.
10633 When this option is not used, GCC will optimize for the processor
10634 specified by @option{-march}.  By using @option{-march} and
10635 @option{-mtune} together, it is possible to generate code that will
10636 run on a family of processors, but optimize the code for one
10637 particular member of that family.
10639 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
10640 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
10641 @samp{-march} ones described above.
10643 @item -mips1
10644 @opindex mips1
10645 Equivalent to @samp{-march=mips1}.
10647 @item -mips2
10648 @opindex mips2
10649 Equivalent to @samp{-march=mips2}.
10651 @item -mips3
10652 @opindex mips3
10653 Equivalent to @samp{-march=mips3}.
10655 @item -mips4
10656 @opindex mips4
10657 Equivalent to @samp{-march=mips4}.
10659 @item -mips32
10660 @opindex mips32
10661 Equivalent to @samp{-march=mips32}.
10663 @item -mips32r2
10664 @opindex mips32r2
10665 Equivalent to @samp{-march=mips32r2}.
10667 @item -mips64
10668 @opindex mips64
10669 Equivalent to @samp{-march=mips64}.
10671 @item -mips16
10672 @itemx -mno-mips16
10673 @opindex mips16
10674 @opindex mno-mips16
10675 Generate (do not generate) MIPS16 code.  If GCC is targetting a
10676 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
10678 @item -mabi=32
10679 @itemx -mabi=o64
10680 @itemx -mabi=n32
10681 @itemx -mabi=64
10682 @itemx -mabi=eabi
10683 @opindex mabi=32
10684 @opindex mabi=o64
10685 @opindex mabi=n32
10686 @opindex mabi=64
10687 @opindex mabi=eabi
10688 Generate code for the given ABI@.
10690 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
10691 generates 64-bit code when you select a 64-bit architecture, but you
10692 can use @option{-mgp32} to get 32-bit code instead.
10694 For information about the O64 ABI, see
10695 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
10697 GCC supports a variant of the o32 ABI in which floating-point registers
10698 are 64 rather than 32 bits wide.  You can select this combination with
10699 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
10700 and @samp{mfhc1} instructions and is therefore only supported for
10701 MIPS32R2 processors.
10703 The register assignments for arguments and return values remain the
10704 same, but each scalar value is passed in a single 64-bit register
10705 rather than a pair of 32-bit registers.  For example, scalar
10706 floating-point values are returned in @samp{$f0} only, not a
10707 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
10708 remains the same, but all 64 bits are saved.
10710 @item -mabicalls
10711 @itemx -mno-abicalls
10712 @opindex mabicalls
10713 @opindex mno-abicalls
10714 Generate (do not generate) code that is suitable for SVR4-style
10715 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
10716 systems.
10718 @item -mshared
10719 @itemx -mno-shared
10720 Generate (do not generate) code that is fully position-independent,
10721 and that can therefore be linked into shared libraries.  This option
10722 only affects @option{-mabicalls}.
10724 All @option{-mabicalls} code has traditionally been position-independent,
10725 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
10726 as an extension, the GNU toolchain allows executables to use absolute
10727 accesses for locally-binding symbols.  It can also use shorter GP
10728 initialization sequences and generate direct calls to locally-defined
10729 functions.  This mode is selected by @option{-mno-shared}.
10731 @option{-mno-shared} depends on binutils 2.16 or higher and generates
10732 objects that can only be linked by the GNU linker.  However, the option
10733 does not affect the ABI of the final executable; it only affects the ABI
10734 of relocatable objects.  Using @option{-mno-shared} will generally make
10735 executables both smaller and quicker.
10737 @option{-mshared} is the default.
10739 @item -mxgot
10740 @itemx -mno-xgot
10741 @opindex mxgot
10742 @opindex mno-xgot
10743 Lift (do not lift) the usual restrictions on the size of the global
10744 offset table.
10746 GCC normally uses a single instruction to load values from the GOT@.
10747 While this is relatively efficient, it will only work if the GOT
10748 is smaller than about 64k.  Anything larger will cause the linker
10749 to report an error such as:
10751 @cindex relocation truncated to fit (MIPS)
10752 @smallexample
10753 relocation truncated to fit: R_MIPS_GOT16 foobar
10754 @end smallexample
10756 If this happens, you should recompile your code with @option{-mxgot}.
10757 It should then work with very large GOTs, although it will also be
10758 less efficient, since it will take three instructions to fetch the
10759 value of a global symbol.
10761 Note that some linkers can create multiple GOTs.  If you have such a
10762 linker, you should only need to use @option{-mxgot} when a single object
10763 file accesses more than 64k's worth of GOT entries.  Very few do.
10765 These options have no effect unless GCC is generating position
10766 independent code.
10768 @item -mgp32
10769 @opindex mgp32
10770 Assume that general-purpose registers are 32 bits wide.
10772 @item -mgp64
10773 @opindex mgp64
10774 Assume that general-purpose registers are 64 bits wide.
10776 @item -mfp32
10777 @opindex mfp32
10778 Assume that floating-point registers are 32 bits wide.
10780 @item -mfp64
10781 @opindex mfp64
10782 Assume that floating-point registers are 64 bits wide.
10784 @item -mhard-float
10785 @opindex mhard-float
10786 Use floating-point coprocessor instructions.
10788 @item -msoft-float
10789 @opindex msoft-float
10790 Do not use floating-point coprocessor instructions.  Implement
10791 floating-point calculations using library calls instead.
10793 @item -msingle-float
10794 @opindex msingle-float
10795 Assume that the floating-point coprocessor only supports single-precision
10796 operations.
10798 @itemx -mdouble-float
10799 @opindex mdouble-float
10800 Assume that the floating-point coprocessor supports double-precision
10801 operations.  This is the default.
10803 @itemx -mdsp
10804 @itemx -mno-dsp
10805 @opindex mdsp
10806 @opindex mno-dsp
10807 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
10809 @itemx -mpaired-single
10810 @itemx -mno-paired-single
10811 @opindex mpaired-single
10812 @opindex mno-paired-single
10813 Use (do not use) paired-single floating-point instructions.
10814 @xref{MIPS Paired-Single Support}.  This option can only be used
10815 when generating 64-bit code and requires hardware floating-point
10816 support to be enabled.
10818 @itemx -mips3d
10819 @itemx -mno-mips3d
10820 @opindex mips3d
10821 @opindex mno-mips3d
10822 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
10823 The option @option{-mips3d} implies @option{-mpaired-single}.
10825 @item -mlong64
10826 @opindex mlong64
10827 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
10828 an explanation of the default and the way that the pointer size is
10829 determined.
10831 @item -mlong32
10832 @opindex mlong32
10833 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
10835 The default size of @code{int}s, @code{long}s and pointers depends on
10836 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
10837 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
10838 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
10839 or the same size as integer registers, whichever is smaller.
10841 @item -msym32
10842 @itemx -mno-sym32
10843 @opindex msym32
10844 @opindex mno-sym32
10845 Assume (do not assume) that all symbols have 32-bit values, regardless
10846 of the selected ABI@.  This option is useful in combination with
10847 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
10848 to generate shorter and faster references to symbolic addresses.
10850 @item -G @var{num}
10851 @opindex G
10852 @cindex smaller data references (MIPS)
10853 @cindex gp-relative references (MIPS)
10854 Put global and static items less than or equal to @var{num} bytes into
10855 the small data or bss section instead of the normal data or bss section.
10856 This allows the data to be accessed using a single instruction.
10858 All modules should be compiled with the same @option{-G @var{num}}
10859 value.
10861 @item -membedded-data
10862 @itemx -mno-embedded-data
10863 @opindex membedded-data
10864 @opindex mno-embedded-data
10865 Allocate variables to the read-only data section first if possible, then
10866 next in the small data section if possible, otherwise in data.  This gives
10867 slightly slower code than the default, but reduces the amount of RAM required
10868 when executing, and thus may be preferred for some embedded systems.
10870 @item -muninit-const-in-rodata
10871 @itemx -mno-uninit-const-in-rodata
10872 @opindex muninit-const-in-rodata
10873 @opindex mno-uninit-const-in-rodata
10874 Put uninitialized @code{const} variables in the read-only data section.
10875 This option is only meaningful in conjunction with @option{-membedded-data}.
10877 @item -msplit-addresses
10878 @itemx -mno-split-addresses
10879 @opindex msplit-addresses
10880 @opindex mno-split-addresses
10881 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
10882 relocation operators.  This option has been superseded by
10883 @option{-mexplicit-relocs} but is retained for backwards compatibility.
10885 @item -mexplicit-relocs
10886 @itemx -mno-explicit-relocs
10887 @opindex mexplicit-relocs
10888 @opindex mno-explicit-relocs
10889 Use (do not use) assembler relocation operators when dealing with symbolic
10890 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
10891 is to use assembler macros instead.
10893 @option{-mexplicit-relocs} is the default if GCC was configured
10894 to use an assembler that supports relocation operators.
10896 @item -mcheck-zero-division
10897 @itemx -mno-check-zero-division
10898 @opindex mcheck-zero-division
10899 @opindex mno-check-zero-division
10900 Trap (do not trap) on integer division by zero.  The default is
10901 @option{-mcheck-zero-division}.
10903 @item -mdivide-traps
10904 @itemx -mdivide-breaks
10905 @opindex mdivide-traps
10906 @opindex mdivide-breaks
10907 MIPS systems check for division by zero by generating either a
10908 conditional trap or a break instruction.  Using traps results in
10909 smaller code, but is only supported on MIPS II and later.  Also, some
10910 versions of the Linux kernel have a bug that prevents trap from
10911 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
10912 allow conditional traps on architectures that support them and
10913 @option{-mdivide-breaks} to force the use of breaks.
10915 The default is usually @option{-mdivide-traps}, but this can be
10916 overridden at configure time using @option{--with-divide=breaks}.
10917 Divide-by-zero checks can be completely disabled using
10918 @option{-mno-check-zero-division}.
10920 @item -mmemcpy
10921 @itemx -mno-memcpy
10922 @opindex mmemcpy
10923 @opindex mno-memcpy
10924 Force (do not force) the use of @code{memcpy()} for non-trivial block
10925 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
10926 most constant-sized copies.
10928 @item -mlong-calls
10929 @itemx -mno-long-calls
10930 @opindex mlong-calls
10931 @opindex mno-long-calls
10932 Disable (do not disable) use of the @code{jal} instruction.  Calling
10933 functions using @code{jal} is more efficient but requires the caller
10934 and callee to be in the same 256 megabyte segment.
10936 This option has no effect on abicalls code.  The default is
10937 @option{-mno-long-calls}.
10939 @item -mmad
10940 @itemx -mno-mad
10941 @opindex mmad
10942 @opindex mno-mad
10943 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
10944 instructions, as provided by the R4650 ISA@.
10946 @item -mfused-madd
10947 @itemx -mno-fused-madd
10948 @opindex mfused-madd
10949 @opindex mno-fused-madd
10950 Enable (disable) use of the floating point multiply-accumulate
10951 instructions, when they are available.  The default is
10952 @option{-mfused-madd}.
10954 When multiply-accumulate instructions are used, the intermediate
10955 product is calculated to infinite precision and is not subject to
10956 the FCSR Flush to Zero bit.  This may be undesirable in some
10957 circumstances.
10959 @item -nocpp
10960 @opindex nocpp
10961 Tell the MIPS assembler to not run its preprocessor over user
10962 assembler files (with a @samp{.s} suffix) when assembling them.
10964 @item -mfix-r4000
10965 @itemx -mno-fix-r4000
10966 @opindex mfix-r4000
10967 @opindex mno-fix-r4000
10968 Work around certain R4000 CPU errata:
10969 @itemize @minus
10970 @item
10971 A double-word or a variable shift may give an incorrect result if executed
10972 immediately after starting an integer division.
10973 @item
10974 A double-word or a variable shift may give an incorrect result if executed
10975 while an integer multiplication is in progress.
10976 @item
10977 An integer division may give an incorrect result if started in a delay slot
10978 of a taken branch or a jump.
10979 @end itemize
10981 @item -mfix-r4400
10982 @itemx -mno-fix-r4400
10983 @opindex mfix-r4400
10984 @opindex mno-fix-r4400
10985 Work around certain R4400 CPU errata:
10986 @itemize @minus
10987 @item
10988 A double-word or a variable shift may give an incorrect result if executed
10989 immediately after starting an integer division.
10990 @end itemize
10992 @item -mfix-vr4120
10993 @itemx -mno-fix-vr4120
10994 @opindex mfix-vr4120
10995 Work around certain VR4120 errata:
10996 @itemize @minus
10997 @item
10998 @code{dmultu} does not always produce the correct result.
10999 @item
11000 @code{div} and @code{ddiv} do not always produce the correct result if one
11001 of the operands is negative.
11002 @end itemize
11003 The workarounds for the division errata rely on special functions in
11004 @file{libgcc.a}.  At present, these functions are only provided by
11005 the @code{mips64vr*-elf} configurations.
11007 Other VR4120 errata require a nop to be inserted between certain pairs of
11008 instructions.  These errata are handled by the assembler, not by GCC itself.
11010 @item -mfix-vr4130
11011 @opindex mfix-vr4130
11012 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11013 workarounds are implemented by the assembler rather than by GCC,
11014 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11015 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11016 instructions are available instead.
11018 @item -mfix-sb1
11019 @itemx -mno-fix-sb1
11020 @opindex mfix-sb1
11021 Work around certain SB-1 CPU core errata.
11022 (This flag currently works around the SB-1 revision 2
11023 ``F1'' and ``F2'' floating point errata.)
11025 @item -mflush-func=@var{func}
11026 @itemx -mno-flush-func
11027 @opindex mflush-func
11028 Specifies the function to call to flush the I and D caches, or to not
11029 call any such function.  If called, the function must take the same
11030 arguments as the common @code{_flush_func()}, that is, the address of the
11031 memory range for which the cache is being flushed, the size of the
11032 memory range, and the number 3 (to flush both caches).  The default
11033 depends on the target GCC was configured for, but commonly is either
11034 @samp{_flush_func} or @samp{__cpu_flush}.
11036 @item -mbranch-likely
11037 @itemx -mno-branch-likely
11038 @opindex mbranch-likely
11039 @opindex mno-branch-likely
11040 Enable or disable use of Branch Likely instructions, regardless of the
11041 default for the selected architecture.  By default, Branch Likely
11042 instructions may be generated if they are supported by the selected
11043 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11044 and processors which implement those architectures; for those, Branch
11045 Likely instructions will not be generated by default because the MIPS32
11046 and MIPS64 architectures specifically deprecate their use.
11048 @item -mfp-exceptions
11049 @itemx -mno-fp-exceptions
11050 @opindex mfp-exceptions
11051 Specifies whether FP exceptions are enabled.  This affects how we schedule
11052 FP instructions for some processors.  The default is that FP exceptions are
11053 enabled.
11055 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11056 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11057 FP pipe.
11059 @item -mvr4130-align
11060 @itemx -mno-vr4130-align
11061 @opindex mvr4130-align
11062 The VR4130 pipeline is two-way superscalar, but can only issue two
11063 instructions together if the first one is 8-byte aligned.  When this
11064 option is enabled, GCC will align pairs of instructions that it
11065 thinks should execute in parallel.
11067 This option only has an effect when optimizing for the VR4130.
11068 It normally makes code faster, but at the expense of making it bigger.
11069 It is enabled by default at optimization level @option{-O3}.
11070 @end table
11072 @node MMIX Options
11073 @subsection MMIX Options
11074 @cindex MMIX Options
11076 These options are defined for the MMIX:
11078 @table @gcctabopt
11079 @item -mlibfuncs
11080 @itemx -mno-libfuncs
11081 @opindex mlibfuncs
11082 @opindex mno-libfuncs
11083 Specify that intrinsic library functions are being compiled, passing all
11084 values in registers, no matter the size.
11086 @item -mepsilon
11087 @itemx -mno-epsilon
11088 @opindex mepsilon
11089 @opindex mno-epsilon
11090 Generate floating-point comparison instructions that compare with respect
11091 to the @code{rE} epsilon register.
11093 @item -mabi=mmixware
11094 @itemx -mabi=gnu
11095 @opindex mabi-mmixware
11096 @opindex mabi=gnu
11097 Generate code that passes function parameters and return values that (in
11098 the called function) are seen as registers @code{$0} and up, as opposed to
11099 the GNU ABI which uses global registers @code{$231} and up.
11101 @item -mzero-extend
11102 @itemx -mno-zero-extend
11103 @opindex mzero-extend
11104 @opindex mno-zero-extend
11105 When reading data from memory in sizes shorter than 64 bits, use (do not
11106 use) zero-extending load instructions by default, rather than
11107 sign-extending ones.
11109 @item -mknuthdiv
11110 @itemx -mno-knuthdiv
11111 @opindex mknuthdiv
11112 @opindex mno-knuthdiv
11113 Make the result of a division yielding a remainder have the same sign as
11114 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11115 remainder follows the sign of the dividend.  Both methods are
11116 arithmetically valid, the latter being almost exclusively used.
11118 @item -mtoplevel-symbols
11119 @itemx -mno-toplevel-symbols
11120 @opindex mtoplevel-symbols
11121 @opindex mno-toplevel-symbols
11122 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11123 code can be used with the @code{PREFIX} assembly directive.
11125 @item -melf
11126 @opindex melf
11127 Generate an executable in the ELF format, rather than the default
11128 @samp{mmo} format used by the @command{mmix} simulator.
11130 @item -mbranch-predict
11131 @itemx -mno-branch-predict
11132 @opindex mbranch-predict
11133 @opindex mno-branch-predict
11134 Use (do not use) the probable-branch instructions, when static branch
11135 prediction indicates a probable branch.
11137 @item -mbase-addresses
11138 @itemx -mno-base-addresses
11139 @opindex mbase-addresses
11140 @opindex mno-base-addresses
11141 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11142 base address automatically generates a request (handled by the assembler
11143 and the linker) for a constant to be set up in a global register.  The
11144 register is used for one or more base address requests within the range 0
11145 to 255 from the value held in the register.  The generally leads to short
11146 and fast code, but the number of different data items that can be
11147 addressed is limited.  This means that a program that uses lots of static
11148 data may require @option{-mno-base-addresses}.
11150 @item -msingle-exit
11151 @itemx -mno-single-exit
11152 @opindex msingle-exit
11153 @opindex mno-single-exit
11154 Force (do not force) generated code to have a single exit point in each
11155 function.
11156 @end table
11158 @node MN10300 Options
11159 @subsection MN10300 Options
11160 @cindex MN10300 options
11162 These @option{-m} options are defined for Matsushita MN10300 architectures:
11164 @table @gcctabopt
11165 @item -mmult-bug
11166 @opindex mmult-bug
11167 Generate code to avoid bugs in the multiply instructions for the MN10300
11168 processors.  This is the default.
11170 @item -mno-mult-bug
11171 @opindex mno-mult-bug
11172 Do not generate code to avoid bugs in the multiply instructions for the
11173 MN10300 processors.
11175 @item -mam33
11176 @opindex mam33
11177 Generate code which uses features specific to the AM33 processor.
11179 @item -mno-am33
11180 @opindex mno-am33
11181 Do not generate code which uses features specific to the AM33 processor.  This
11182 is the default.
11184 @item -mreturn-pointer-on-d0
11185 @opindex mreturn-pointer-on-d0
11186 When generating a function which returns a pointer, return the pointer
11187 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11188 only in a0, and attempts to call such functions without a prototype
11189 would result in errors.  Note that this option is on by default; use
11190 @option{-mno-return-pointer-on-d0} to disable it.
11192 @item -mno-crt0
11193 @opindex mno-crt0
11194 Do not link in the C run-time initialization object file.
11196 @item -mrelax
11197 @opindex mrelax
11198 Indicate to the linker that it should perform a relaxation optimization pass
11199 to shorten branches, calls and absolute memory addresses.  This option only
11200 has an effect when used on the command line for the final link step.
11202 This option makes symbolic debugging impossible.
11203 @end table
11205 @node MT Options
11206 @subsection MT Options
11207 @cindex MT options
11209 These @option{-m} options are defined for Morpho MT architectures:
11211 @table @gcctabopt
11213 @item -march=@var{cpu-type}
11214 @opindex march
11215 Generate code that will run on @var{cpu-type}, which is the name of a system
11216 representing a certain processor type.  Possible values for
11217 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
11218 @samp{ms1-16-003} and @samp{ms2}.
11220 When this option is not used, the default is @option{-march=ms1-16-002}.
11222 @item -mbacc
11223 @opindex mbacc
11224 Use byte loads and stores when generating code.
11226 @item -mno-bacc
11227 @opindex mno-bacc
11228 Do not use byte loads and stores when generating code.
11230 @item -msim
11231 @opindex msim
11232 Use simulator runtime
11234 @item -mno-crt0
11235 @opindex mno-crt0
11236 Do not link in the C run-time initialization object file
11237 @file{crti.o}.  Other run-time initialization and termination files
11238 such as @file{startup.o} and @file{exit.o} are still included on the
11239 linker command line.
11241 @end table
11243 @node PDP-11 Options
11244 @subsection PDP-11 Options
11245 @cindex PDP-11 Options
11247 These options are defined for the PDP-11:
11249 @table @gcctabopt
11250 @item -mfpu
11251 @opindex mfpu
11252 Use hardware FPP floating point.  This is the default.  (FIS floating
11253 point on the PDP-11/40 is not supported.)
11255 @item -msoft-float
11256 @opindex msoft-float
11257 Do not use hardware floating point.
11259 @item -mac0
11260 @opindex mac0
11261 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
11263 @item -mno-ac0
11264 @opindex mno-ac0
11265 Return floating-point results in memory.  This is the default.
11267 @item -m40
11268 @opindex m40
11269 Generate code for a PDP-11/40.
11271 @item -m45
11272 @opindex m45
11273 Generate code for a PDP-11/45.  This is the default.
11275 @item -m10
11276 @opindex m10
11277 Generate code for a PDP-11/10.
11279 @item -mbcopy-builtin
11280 @opindex bcopy-builtin
11281 Use inline @code{movmemhi} patterns for copying memory.  This is the
11282 default.
11284 @item -mbcopy
11285 @opindex mbcopy
11286 Do not use inline @code{movmemhi} patterns for copying memory.
11288 @item -mint16
11289 @itemx -mno-int32
11290 @opindex mint16
11291 @opindex mno-int32
11292 Use 16-bit @code{int}.  This is the default.
11294 @item -mint32
11295 @itemx -mno-int16
11296 @opindex mint32
11297 @opindex mno-int16
11298 Use 32-bit @code{int}.
11300 @item -mfloat64
11301 @itemx -mno-float32
11302 @opindex mfloat64
11303 @opindex mno-float32
11304 Use 64-bit @code{float}.  This is the default.
11306 @item -mfloat32
11307 @itemx -mno-float64
11308 @opindex mfloat32
11309 @opindex mno-float64
11310 Use 32-bit @code{float}.
11312 @item -mabshi
11313 @opindex mabshi
11314 Use @code{abshi2} pattern.  This is the default.
11316 @item -mno-abshi
11317 @opindex mno-abshi
11318 Do not use @code{abshi2} pattern.
11320 @item -mbranch-expensive
11321 @opindex mbranch-expensive
11322 Pretend that branches are expensive.  This is for experimenting with
11323 code generation only.
11325 @item -mbranch-cheap
11326 @opindex mbranch-cheap
11327 Do not pretend that branches are expensive.  This is the default.
11329 @item -msplit
11330 @opindex msplit
11331 Generate code for a system with split I&D@.
11333 @item -mno-split
11334 @opindex mno-split
11335 Generate code for a system without split I&D@.  This is the default.
11337 @item -munix-asm
11338 @opindex munix-asm
11339 Use Unix assembler syntax.  This is the default when configured for
11340 @samp{pdp11-*-bsd}.
11342 @item -mdec-asm
11343 @opindex mdec-asm
11344 Use DEC assembler syntax.  This is the default when configured for any
11345 PDP-11 target other than @samp{pdp11-*-bsd}.
11346 @end table
11348 @node PowerPC Options
11349 @subsection PowerPC Options
11350 @cindex PowerPC options
11352 These are listed under @xref{RS/6000 and PowerPC Options}.
11354 @node RS/6000 and PowerPC Options
11355 @subsection IBM RS/6000 and PowerPC Options
11356 @cindex RS/6000 and PowerPC Options
11357 @cindex IBM RS/6000 and PowerPC Options
11359 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11360 @table @gcctabopt
11361 @item -mpower
11362 @itemx -mno-power
11363 @itemx -mpower2
11364 @itemx -mno-power2
11365 @itemx -mpowerpc
11366 @itemx -mno-powerpc
11367 @itemx -mpowerpc-gpopt
11368 @itemx -mno-powerpc-gpopt
11369 @itemx -mpowerpc-gfxopt
11370 @itemx -mno-powerpc-gfxopt
11371 @itemx -mpowerpc64
11372 @itemx -mno-powerpc64
11373 @itemx -mmfcrf
11374 @itemx -mno-mfcrf
11375 @itemx -mpopcntb
11376 @itemx -mno-popcntb
11377 @itemx -mfprnd
11378 @itemx -mno-fprnd
11379 @itemx -mmfpgpr
11380 @itemx -mno-mfpgpr
11381 @opindex mpower
11382 @opindex mno-power
11383 @opindex mpower2
11384 @opindex mno-power2
11385 @opindex mpowerpc
11386 @opindex mno-powerpc
11387 @opindex mpowerpc-gpopt
11388 @opindex mno-powerpc-gpopt
11389 @opindex mpowerpc-gfxopt
11390 @opindex mno-powerpc-gfxopt
11391 @opindex mpowerpc64
11392 @opindex mno-powerpc64
11393 @opindex mmfcrf
11394 @opindex mno-mfcrf
11395 @opindex mpopcntb
11396 @opindex mno-popcntb
11397 @opindex mfprnd
11398 @opindex mno-fprnd
11399 @opindex mmfpgpr
11400 @opindex mno-mfpgpr
11401 GCC supports two related instruction set architectures for the
11402 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
11403 instructions supported by the @samp{rios} chip set used in the original
11404 RS/6000 systems and the @dfn{PowerPC} instruction set is the
11405 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
11406 the IBM 4xx, 6xx, and follow-on microprocessors.
11408 Neither architecture is a subset of the other.  However there is a
11409 large common subset of instructions supported by both.  An MQ
11410 register is included in processors supporting the POWER architecture.
11412 You use these options to specify which instructions are available on the
11413 processor you are using.  The default value of these options is
11414 determined when configuring GCC@.  Specifying the
11415 @option{-mcpu=@var{cpu_type}} overrides the specification of these
11416 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
11417 rather than the options listed above.
11419 The @option{-mpower} option allows GCC to generate instructions that
11420 are found only in the POWER architecture and to use the MQ register.
11421 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
11422 to generate instructions that are present in the POWER2 architecture but
11423 not the original POWER architecture.
11425 The @option{-mpowerpc} option allows GCC to generate instructions that
11426 are found only in the 32-bit subset of the PowerPC architecture.
11427 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
11428 GCC to use the optional PowerPC architecture instructions in the
11429 General Purpose group, including floating-point square root.  Specifying
11430 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
11431 use the optional PowerPC architecture instructions in the Graphics
11432 group, including floating-point select.
11434 The @option{-mmfcrf} option allows GCC to generate the move from
11435 condition register field instruction implemented on the POWER4
11436 processor and other processors that support the PowerPC V2.01
11437 architecture.
11438 The @option{-mpopcntb} option allows GCC to generate the popcount and
11439 double precision FP reciprocal estimate instruction implemented on the
11440 POWER5 processor and other processors that support the PowerPC V2.02
11441 architecture.
11442 The @option{-mfprnd} option allows GCC to generate the FP round to
11443 integer instructions implemented on the POWER5+ processor and other
11444 processors that support the PowerPC V2.03 architecture.
11445 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
11446 general purpose register instructions implemented on the POWER6X
11447 processor and other processors that support the extended PowerPC V2.05
11448 architecture.
11450 The @option{-mpowerpc64} option allows GCC to generate the additional
11451 64-bit instructions that are found in the full PowerPC64 architecture
11452 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
11453 @option{-mno-powerpc64}.
11455 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
11456 will use only the instructions in the common subset of both
11457 architectures plus some special AIX common-mode calls, and will not use
11458 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
11459 permits GCC to use any instruction from either architecture and to
11460 allow use of the MQ register; specify this for the Motorola MPC601.
11462 @item -mnew-mnemonics
11463 @itemx -mold-mnemonics
11464 @opindex mnew-mnemonics
11465 @opindex mold-mnemonics
11466 Select which mnemonics to use in the generated assembler code.  With
11467 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
11468 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
11469 assembler mnemonics defined for the POWER architecture.  Instructions
11470 defined in only one architecture have only one mnemonic; GCC uses that
11471 mnemonic irrespective of which of these options is specified.
11473 GCC defaults to the mnemonics appropriate for the architecture in
11474 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
11475 value of these option.  Unless you are building a cross-compiler, you
11476 should normally not specify either @option{-mnew-mnemonics} or
11477 @option{-mold-mnemonics}, but should instead accept the default.
11479 @item -mcpu=@var{cpu_type}
11480 @opindex mcpu
11481 Set architecture type, register usage, choice of mnemonics, and
11482 instruction scheduling parameters for machine type @var{cpu_type}.
11483 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
11484 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
11485 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
11486 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
11487 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
11488 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
11489 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
11490 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
11491 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
11492 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
11494 @option{-mcpu=common} selects a completely generic processor.  Code
11495 generated under this option will run on any POWER or PowerPC processor.
11496 GCC will use only the instructions in the common subset of both
11497 architectures, and will not use the MQ register.  GCC assumes a generic
11498 processor model for scheduling purposes.
11500 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
11501 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
11502 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
11503 types, with an appropriate, generic processor model assumed for
11504 scheduling purposes.
11506 The other options specify a specific processor.  Code generated under
11507 those options will run best on that processor, and may not run at all on
11508 others.
11510 The @option{-mcpu} options automatically enable or disable the
11511 following options: @option{-maltivec}, @option{-mfprnd},
11512 @option{-mhard-float}, @option{-mmfcrf}, @option{-mmultiple},
11513 @option{-mnew-mnemonics}, @option{-mpopcntb}, @option{-mpower},
11514 @option{-mpower2}, @option{-mpowerpc64}, @option{-mpowerpc-gpopt},
11515 @option{-mpowerpc-gfxopt}, @option{-mstring}, @option{-mmulhw},
11516 @option{-mdlmzb}, @option{-mmfpgpr}.
11517 The particular options set for any particular CPU will vary between
11518 compiler versions, depending on what setting seems to produce optimal
11519 code for that CPU; it doesn't necessarily reflect the actual hardware's
11520 capabilities.  If you wish to set an individual option to a particular
11521 value, you may specify it after the @option{-mcpu} option, like
11522 @samp{-mcpu=970 -mno-altivec}.
11524 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
11525 not enabled or disabled by the @option{-mcpu} option at present because
11526 AIX does not have full support for these options.  You may still
11527 enable or disable them individually if you're sure it'll work in your
11528 environment.
11530 @item -mtune=@var{cpu_type}
11531 @opindex mtune
11532 Set the instruction scheduling parameters for machine type
11533 @var{cpu_type}, but do not set the architecture type, register usage, or
11534 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
11535 values for @var{cpu_type} are used for @option{-mtune} as for
11536 @option{-mcpu}.  If both are specified, the code generated will use the
11537 architecture, registers, and mnemonics set by @option{-mcpu}, but the
11538 scheduling parameters set by @option{-mtune}.
11540 @item -mswdiv
11541 @itemx -mno-swdiv
11542 @opindex mswdiv
11543 @opindex mno-swdiv
11544 Generate code to compute division as reciprocal estimate and iterative
11545 refinement, creating opportunities for increased throughput.  This
11546 feature requires: optional PowerPC Graphics instruction set for single
11547 precision and FRE instruction for double precision, assuming divides
11548 cannot generate user-visible traps, and the domain values not include
11549 Infinities, denormals or zero denominator.
11551 @item -maltivec
11552 @itemx -mno-altivec
11553 @opindex maltivec
11554 @opindex mno-altivec
11555 Generate code that uses (does not use) AltiVec instructions, and also
11556 enable the use of built-in functions that allow more direct access to
11557 the AltiVec instruction set.  You may also need to set
11558 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
11559 enhancements.
11561 @item -mvrsave
11562 @item -mno-vrsave
11563 @opindex mvrsave
11564 @opindex mno-vrsave
11565 Generate VRSAVE instructions when generating AltiVec code.
11567 @item -msecure-plt
11568 @opindex msecure-plt
11569 Generate code that allows ld and ld.so to build executables and shared
11570 libraries with non-exec .plt and .got sections.  This is a PowerPC
11571 32-bit SYSV ABI option.
11573 @item -mbss-plt
11574 @opindex mbss-plt
11575 Generate code that uses a BSS .plt section that ld.so fills in, and
11576 requires .plt and .got sections that are both writable and executable.
11577 This is a PowerPC 32-bit SYSV ABI option.
11579 @item -misel
11580 @itemx -mno-isel
11581 @opindex misel
11582 @opindex mno-isel
11583 This switch enables or disables the generation of ISEL instructions.
11585 @item -misel=@var{yes/no}
11586 This switch has been deprecated.  Use @option{-misel} and
11587 @option{-mno-isel} instead.
11589 @item -mspe
11590 @itemx -mno-spe
11591 @opindex mspe
11592 @opindex mno-spe
11593 This switch enables or disables the generation of SPE simd
11594 instructions.
11596 @item -mspe=@var{yes/no}
11597 This option has been deprecated.  Use @option{-mspe} and
11598 @option{-mno-spe} instead.
11600 @item -mfloat-gprs=@var{yes/single/double/no}
11601 @itemx -mfloat-gprs
11602 @opindex mfloat-gprs
11603 This switch enables or disables the generation of floating point
11604 operations on the general purpose registers for architectures that
11605 support it.
11607 The argument @var{yes} or @var{single} enables the use of
11608 single-precision floating point operations.
11610 The argument @var{double} enables the use of single and
11611 double-precision floating point operations.
11613 The argument @var{no} disables floating point operations on the
11614 general purpose registers.
11616 This option is currently only available on the MPC854x.
11618 @item -m32
11619 @itemx -m64
11620 @opindex m32
11621 @opindex m64
11622 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
11623 targets (including GNU/Linux).  The 32-bit environment sets int, long
11624 and pointer to 32 bits and generates code that runs on any PowerPC
11625 variant.  The 64-bit environment sets int to 32 bits and long and
11626 pointer to 64 bits, and generates code for PowerPC64, as for
11627 @option{-mpowerpc64}.
11629 @item -mfull-toc
11630 @itemx -mno-fp-in-toc
11631 @itemx -mno-sum-in-toc
11632 @itemx -mminimal-toc
11633 @opindex mfull-toc
11634 @opindex mno-fp-in-toc
11635 @opindex mno-sum-in-toc
11636 @opindex mminimal-toc
11637 Modify generation of the TOC (Table Of Contents), which is created for
11638 every executable file.  The @option{-mfull-toc} option is selected by
11639 default.  In that case, GCC will allocate at least one TOC entry for
11640 each unique non-automatic variable reference in your program.  GCC
11641 will also place floating-point constants in the TOC@.  However, only
11642 16,384 entries are available in the TOC@.
11644 If you receive a linker error message that saying you have overflowed
11645 the available TOC space, you can reduce the amount of TOC space used
11646 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
11647 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
11648 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
11649 generate code to calculate the sum of an address and a constant at
11650 run-time instead of putting that sum into the TOC@.  You may specify one
11651 or both of these options.  Each causes GCC to produce very slightly
11652 slower and larger code at the expense of conserving TOC space.
11654 If you still run out of space in the TOC even when you specify both of
11655 these options, specify @option{-mminimal-toc} instead.  This option causes
11656 GCC to make only one TOC entry for every file.  When you specify this
11657 option, GCC will produce code that is slower and larger but which
11658 uses extremely little TOC space.  You may wish to use this option
11659 only on files that contain less frequently executed code.
11661 @item -maix64
11662 @itemx -maix32
11663 @opindex maix64
11664 @opindex maix32
11665 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
11666 @code{long} type, and the infrastructure needed to support them.
11667 Specifying @option{-maix64} implies @option{-mpowerpc64} and
11668 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
11669 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
11671 @item -mxl-compat
11672 @itemx -mno-xl-compat
11673 @opindex mxl-compat
11674 @opindex mno-xl-compat
11675 Produce code that conforms more closely to IBM XL compiler semantics
11676 when using AIX-compatible ABI.  Pass floating-point arguments to
11677 prototyped functions beyond the register save area (RSA) on the stack
11678 in addition to argument FPRs.  Do not assume that most significant
11679 double in 128-bit long double value is properly rounded when comparing
11680 values and converting to double.  Use XL symbol names for long double
11681 support routines.
11683 The AIX calling convention was extended but not initially documented to
11684 handle an obscure K&R C case of calling a function that takes the
11685 address of its arguments with fewer arguments than declared.  IBM XL
11686 compilers access floating point arguments which do not fit in the
11687 RSA from the stack when a subroutine is compiled without
11688 optimization.  Because always storing floating-point arguments on the
11689 stack is inefficient and rarely needed, this option is not enabled by
11690 default and only is necessary when calling subroutines compiled by IBM
11691 XL compilers without optimization.
11693 @item -mpe
11694 @opindex mpe
11695 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
11696 application written to use message passing with special startup code to
11697 enable the application to run.  The system must have PE installed in the
11698 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
11699 must be overridden with the @option{-specs=} option to specify the
11700 appropriate directory location.  The Parallel Environment does not
11701 support threads, so the @option{-mpe} option and the @option{-pthread}
11702 option are incompatible.
11704 @item -malign-natural
11705 @itemx -malign-power
11706 @opindex malign-natural
11707 @opindex malign-power
11708 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
11709 @option{-malign-natural} overrides the ABI-defined alignment of larger
11710 types, such as floating-point doubles, on their natural size-based boundary.
11711 The option @option{-malign-power} instructs GCC to follow the ABI-specified
11712 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
11714 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
11715 is not supported.
11717 @item -msoft-float
11718 @itemx -mhard-float
11719 @opindex msoft-float
11720 @opindex mhard-float
11721 Generate code that does not use (uses) the floating-point register set.
11722 Software floating point emulation is provided if you use the
11723 @option{-msoft-float} option, and pass the option to GCC when linking.
11725 @item -mmultiple
11726 @itemx -mno-multiple
11727 @opindex mmultiple
11728 @opindex mno-multiple
11729 Generate code that uses (does not use) the load multiple word
11730 instructions and the store multiple word instructions.  These
11731 instructions are generated by default on POWER systems, and not
11732 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
11733 endian PowerPC systems, since those instructions do not work when the
11734 processor is in little endian mode.  The exceptions are PPC740 and
11735 PPC750 which permit the instructions usage in little endian mode.
11737 @item -mstring
11738 @itemx -mno-string
11739 @opindex mstring
11740 @opindex mno-string
11741 Generate code that uses (does not use) the load string instructions
11742 and the store string word instructions to save multiple registers and
11743 do small block moves.  These instructions are generated by default on
11744 POWER systems, and not generated on PowerPC systems.  Do not use
11745 @option{-mstring} on little endian PowerPC systems, since those
11746 instructions do not work when the processor is in little endian mode.
11747 The exceptions are PPC740 and PPC750 which permit the instructions
11748 usage in little endian mode.
11750 @item -mupdate
11751 @itemx -mno-update
11752 @opindex mupdate
11753 @opindex mno-update
11754 Generate code that uses (does not use) the load or store instructions
11755 that update the base register to the address of the calculated memory
11756 location.  These instructions are generated by default.  If you use
11757 @option{-mno-update}, there is a small window between the time that the
11758 stack pointer is updated and the address of the previous frame is
11759 stored, which means code that walks the stack frame across interrupts or
11760 signals may get corrupted data.
11762 @item -mfused-madd
11763 @itemx -mno-fused-madd
11764 @opindex mfused-madd
11765 @opindex mno-fused-madd
11766 Generate code that uses (does not use) the floating point multiply and
11767 accumulate instructions.  These instructions are generated by default if
11768 hardware floating is used.
11770 @item -mmulhw
11771 @itemx -mno-mulhw
11772 @opindex mmulhw
11773 @opindex mno-mulhw
11774 Generate code that uses (does not use) the half-word multiply and
11775 multiply-accumulate instructions on the IBM 405 and 440 processors.
11776 These instructions are generated by default when targetting those
11777 processors.
11779 @item -mdlmzb
11780 @itemx -mno-dlmzb
11781 @opindex mdlmzb
11782 @opindex mno-dlmzb
11783 Generate code that uses (does not use) the string-search @samp{dlmzb}
11784 instruction on the IBM 405 and 440 processors.  This instruction is
11785 generated by default when targetting those processors.
11787 @item -mno-bit-align
11788 @itemx -mbit-align
11789 @opindex mno-bit-align
11790 @opindex mbit-align
11791 On System V.4 and embedded PowerPC systems do not (do) force structures
11792 and unions that contain bit-fields to be aligned to the base type of the
11793 bit-field.
11795 For example, by default a structure containing nothing but 8
11796 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
11797 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
11798 the structure would be aligned to a 1 byte boundary and be one byte in
11799 size.
11801 @item -mno-strict-align
11802 @itemx -mstrict-align
11803 @opindex mno-strict-align
11804 @opindex mstrict-align
11805 On System V.4 and embedded PowerPC systems do not (do) assume that
11806 unaligned memory references will be handled by the system.
11808 @item -mrelocatable
11809 @itemx -mno-relocatable
11810 @opindex mrelocatable
11811 @opindex mno-relocatable
11812 On embedded PowerPC systems generate code that allows (does not allow)
11813 the program to be relocated to a different address at runtime.  If you
11814 use @option{-mrelocatable} on any module, all objects linked together must
11815 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
11817 @item -mrelocatable-lib
11818 @itemx -mno-relocatable-lib
11819 @opindex mrelocatable-lib
11820 @opindex mno-relocatable-lib
11821 On embedded PowerPC systems generate code that allows (does not allow)
11822 the program to be relocated to a different address at runtime.  Modules
11823 compiled with @option{-mrelocatable-lib} can be linked with either modules
11824 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
11825 with modules compiled with the @option{-mrelocatable} options.
11827 @item -mno-toc
11828 @itemx -mtoc
11829 @opindex mno-toc
11830 @opindex mtoc
11831 On System V.4 and embedded PowerPC systems do not (do) assume that
11832 register 2 contains a pointer to a global area pointing to the addresses
11833 used in the program.
11835 @item -mlittle
11836 @itemx -mlittle-endian
11837 @opindex mlittle
11838 @opindex mlittle-endian
11839 On System V.4 and embedded PowerPC systems compile code for the
11840 processor in little endian mode.  The @option{-mlittle-endian} option is
11841 the same as @option{-mlittle}.
11843 @item -mbig
11844 @itemx -mbig-endian
11845 @opindex mbig
11846 @opindex mbig-endian
11847 On System V.4 and embedded PowerPC systems compile code for the
11848 processor in big endian mode.  The @option{-mbig-endian} option is
11849 the same as @option{-mbig}.
11851 @item -mdynamic-no-pic
11852 @opindex mdynamic-no-pic
11853 On Darwin and Mac OS X systems, compile code so that it is not
11854 relocatable, but that its external references are relocatable.  The
11855 resulting code is suitable for applications, but not shared
11856 libraries.
11858 @item -mprioritize-restricted-insns=@var{priority}
11859 @opindex mprioritize-restricted-insns
11860 This option controls the priority that is assigned to
11861 dispatch-slot restricted instructions during the second scheduling
11862 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
11863 @var{no/highest/second-highest} priority to dispatch slot restricted
11864 instructions.
11866 @item -msched-costly-dep=@var{dependence_type}
11867 @opindex msched-costly-dep
11868 This option controls which dependences are considered costly
11869 by the target during instruction scheduling.  The argument
11870 @var{dependence_type} takes one of the following values:
11871 @var{no}: no dependence is costly,
11872 @var{all}: all dependences are costly,
11873 @var{true_store_to_load}: a true dependence from store to load is costly,
11874 @var{store_to_load}: any dependence from store to load is costly,
11875 @var{number}: any dependence which latency >= @var{number} is costly.
11877 @item -minsert-sched-nops=@var{scheme}
11878 @opindex minsert-sched-nops
11879 This option controls which nop insertion scheme will be used during
11880 the second scheduling pass.  The argument @var{scheme} takes one of the
11881 following values:
11882 @var{no}: Don't insert nops.
11883 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
11884 according to the scheduler's grouping.
11885 @var{regroup_exact}: Insert nops to force costly dependent insns into
11886 separate groups.  Insert exactly as many nops as needed to force an insn
11887 to a new group, according to the estimated processor grouping.
11888 @var{number}: Insert nops to force costly dependent insns into
11889 separate groups.  Insert @var{number} nops to force an insn to a new group.
11891 @item -mcall-sysv
11892 @opindex mcall-sysv
11893 On System V.4 and embedded PowerPC systems compile code using calling
11894 conventions that adheres to the March 1995 draft of the System V
11895 Application Binary Interface, PowerPC processor supplement.  This is the
11896 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
11898 @item -mcall-sysv-eabi
11899 @opindex mcall-sysv-eabi
11900 Specify both @option{-mcall-sysv} and @option{-meabi} options.
11902 @item -mcall-sysv-noeabi
11903 @opindex mcall-sysv-noeabi
11904 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
11906 @item -mcall-solaris
11907 @opindex mcall-solaris
11908 On System V.4 and embedded PowerPC systems compile code for the Solaris
11909 operating system.
11911 @item -mcall-linux
11912 @opindex mcall-linux
11913 On System V.4 and embedded PowerPC systems compile code for the
11914 Linux-based GNU system.
11916 @item -mcall-gnu
11917 @opindex mcall-gnu
11918 On System V.4 and embedded PowerPC systems compile code for the
11919 Hurd-based GNU system.
11921 @item -mcall-netbsd
11922 @opindex mcall-netbsd
11923 On System V.4 and embedded PowerPC systems compile code for the
11924 NetBSD operating system.
11926 @item -maix-struct-return
11927 @opindex maix-struct-return
11928 Return all structures in memory (as specified by the AIX ABI)@.
11930 @item -msvr4-struct-return
11931 @opindex msvr4-struct-return
11932 Return structures smaller than 8 bytes in registers (as specified by the
11933 SVR4 ABI)@.
11935 @item -mabi=@var{abi-type}
11936 @opindex mabi
11937 Extend the current ABI with a particular extension, or remove such extension.
11938 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
11939 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
11941 @item -mabi=spe
11942 @opindex mabi=spe
11943 Extend the current ABI with SPE ABI extensions.  This does not change
11944 the default ABI, instead it adds the SPE ABI extensions to the current
11945 ABI@.
11947 @item -mabi=no-spe
11948 @opindex mabi=no-spe
11949 Disable Booke SPE ABI extensions for the current ABI@.
11951 @item -mabi=ibmlongdouble
11952 @opindex mabi=ibmlongdouble
11953 Change the current ABI to use IBM extended precision long double.
11954 This is a PowerPC 32-bit SYSV ABI option.
11956 @item -mabi=ieeelongdouble
11957 @opindex mabi=ieeelongdouble
11958 Change the current ABI to use IEEE extended precision long double.
11959 This is a PowerPC 32-bit Linux ABI option.
11961 @item -mprototype
11962 @itemx -mno-prototype
11963 @opindex mprototype
11964 @opindex mno-prototype
11965 On System V.4 and embedded PowerPC systems assume that all calls to
11966 variable argument functions are properly prototyped.  Otherwise, the
11967 compiler must insert an instruction before every non prototyped call to
11968 set or clear bit 6 of the condition code register (@var{CR}) to
11969 indicate whether floating point values were passed in the floating point
11970 registers in case the function takes a variable arguments.  With
11971 @option{-mprototype}, only calls to prototyped variable argument functions
11972 will set or clear the bit.
11974 @item -msim
11975 @opindex msim
11976 On embedded PowerPC systems, assume that the startup module is called
11977 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
11978 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
11979 configurations.
11981 @item -mmvme
11982 @opindex mmvme
11983 On embedded PowerPC systems, assume that the startup module is called
11984 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
11985 @file{libc.a}.
11987 @item -mads
11988 @opindex mads
11989 On embedded PowerPC systems, assume that the startup module is called
11990 @file{crt0.o} and the standard C libraries are @file{libads.a} and
11991 @file{libc.a}.
11993 @item -myellowknife
11994 @opindex myellowknife
11995 On embedded PowerPC systems, assume that the startup module is called
11996 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
11997 @file{libc.a}.
11999 @item -mvxworks
12000 @opindex mvxworks
12001 On System V.4 and embedded PowerPC systems, specify that you are
12002 compiling for a VxWorks system.
12004 @item -mwindiss
12005 @opindex mwindiss
12006 Specify that you are compiling for the WindISS simulation environment.
12008 @item -memb
12009 @opindex memb
12010 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12011 header to indicate that @samp{eabi} extended relocations are used.
12013 @item -meabi
12014 @itemx -mno-eabi
12015 @opindex meabi
12016 @opindex mno-eabi
12017 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12018 Embedded Applications Binary Interface (eabi) which is a set of
12019 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12020 means that the stack is aligned to an 8 byte boundary, a function
12021 @code{__eabi} is called to from @code{main} to set up the eabi
12022 environment, and the @option{-msdata} option can use both @code{r2} and
12023 @code{r13} to point to two separate small data areas.  Selecting
12024 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12025 do not call an initialization function from @code{main}, and the
12026 @option{-msdata} option will only use @code{r13} to point to a single
12027 small data area.  The @option{-meabi} option is on by default if you
12028 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12030 @item -msdata=eabi
12031 @opindex msdata=eabi
12032 On System V.4 and embedded PowerPC systems, put small initialized
12033 @code{const} global and static data in the @samp{.sdata2} section, which
12034 is pointed to by register @code{r2}.  Put small initialized
12035 non-@code{const} global and static data in the @samp{.sdata} section,
12036 which is pointed to by register @code{r13}.  Put small uninitialized
12037 global and static data in the @samp{.sbss} section, which is adjacent to
12038 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12039 incompatible with the @option{-mrelocatable} option.  The
12040 @option{-msdata=eabi} option also sets the @option{-memb} option.
12042 @item -msdata=sysv
12043 @opindex msdata=sysv
12044 On System V.4 and embedded PowerPC systems, put small global and static
12045 data in the @samp{.sdata} section, which is pointed to by register
12046 @code{r13}.  Put small uninitialized global and static data in the
12047 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12048 The @option{-msdata=sysv} option is incompatible with the
12049 @option{-mrelocatable} option.
12051 @item -msdata=default
12052 @itemx -msdata
12053 @opindex msdata=default
12054 @opindex msdata
12055 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12056 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12057 same as @option{-msdata=sysv}.
12059 @item -msdata-data
12060 @opindex msdata-data
12061 On System V.4 and embedded PowerPC systems, put small global
12062 data in the @samp{.sdata} section.  Put small uninitialized global
12063 data in the @samp{.sbss} section.  Do not use register @code{r13}
12064 to address small data however.  This is the default behavior unless
12065 other @option{-msdata} options are used.
12067 @item -msdata=none
12068 @itemx -mno-sdata
12069 @opindex msdata=none
12070 @opindex mno-sdata
12071 On embedded PowerPC systems, put all initialized global and static data
12072 in the @samp{.data} section, and all uninitialized data in the
12073 @samp{.bss} section.
12075 @item -G @var{num}
12076 @opindex G
12077 @cindex smaller data references (PowerPC)
12078 @cindex .sdata/.sdata2 references (PowerPC)
12079 On embedded PowerPC systems, put global and static items less than or
12080 equal to @var{num} bytes into the small data or bss sections instead of
12081 the normal data or bss section.  By default, @var{num} is 8.  The
12082 @option{-G @var{num}} switch is also passed to the linker.
12083 All modules should be compiled with the same @option{-G @var{num}} value.
12085 @item -mregnames
12086 @itemx -mno-regnames
12087 @opindex mregnames
12088 @opindex mno-regnames
12089 On System V.4 and embedded PowerPC systems do (do not) emit register
12090 names in the assembly language output using symbolic forms.
12092 @item -mlongcall
12093 @itemx -mno-longcall
12094 @opindex mlongcall
12095 @opindex mno-longcall
12096 By default assume that all calls are far away so that a longer more
12097 expensive calling sequence is required.  This is required for calls
12098 further than 32 megabytes (33,554,432 bytes) from the current location.
12099 A short call will be generated if the compiler knows
12100 the call cannot be that far away.  This setting can be overridden by
12101 the @code{shortcall} function attribute, or by @code{#pragma
12102 longcall(0)}.
12104 Some linkers are capable of detecting out-of-range calls and generating
12105 glue code on the fly.  On these systems, long calls are unnecessary and
12106 generate slower code.  As of this writing, the AIX linker can do this,
12107 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12108 to the GNU linker for 32-bit PowerPC systems as well.
12110 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12111 callee, L42'', plus a ``branch island'' (glue code).  The two target
12112 addresses represent the callee and the ``branch island''.  The
12113 Darwin/PPC linker will prefer the first address and generate a ``bl
12114 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12115 otherwise, the linker will generate ``bl L42'' to call the ``branch
12116 island''.  The ``branch island'' is appended to the body of the
12117 calling function; it computes the full 32-bit address of the callee
12118 and jumps to it.
12120 On Mach-O (Darwin) systems, this option directs the compiler emit to
12121 the glue for every direct call, and the Darwin linker decides whether
12122 to use or discard it.
12124 In the future, we may cause GCC to ignore all longcall specifications
12125 when the linker is known to generate glue.
12127 @item -pthread
12128 @opindex pthread
12129 Adds support for multithreading with the @dfn{pthreads} library.
12130 This option sets flags for both the preprocessor and linker.
12132 @end table
12134 @node S/390 and zSeries Options
12135 @subsection S/390 and zSeries Options
12136 @cindex S/390 and zSeries Options
12138 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12140 @table @gcctabopt
12141 @item -mhard-float
12142 @itemx -msoft-float
12143 @opindex mhard-float
12144 @opindex msoft-float
12145 Use (do not use) the hardware floating-point instructions and registers
12146 for floating-point operations.  When @option{-msoft-float} is specified,
12147 functions in @file{libgcc.a} will be used to perform floating-point
12148 operations.  When @option{-mhard-float} is specified, the compiler
12149 generates IEEE floating-point instructions.  This is the default.
12151 @item -mlong-double-64
12152 @itemx -mlong-double-128
12153 @opindex mlong-double-64
12154 @opindex mlong-double-128
12155 These switches control the size of @code{long double} type. A size
12156 of 64bit makes the @code{long double} type equivalent to the @code{double}
12157 type. This is the default.
12159 @item -mbackchain
12160 @itemx -mno-backchain
12161 @opindex mbackchain
12162 @opindex mno-backchain
12163 Store (do not store) the address of the caller's frame as backchain pointer
12164 into the callee's stack frame.
12165 A backchain may be needed to allow debugging using tools that do not understand
12166 DWARF-2 call frame information.
12167 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12168 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12169 the backchain is placed into the topmost word of the 96/160 byte register
12170 save area.
12172 In general, code compiled with @option{-mbackchain} is call-compatible with
12173 code compiled with @option{-mmo-backchain}; however, use of the backchain
12174 for debugging purposes usually requires that the whole binary is built with
12175 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12176 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12177 to build a linux kernel use @option{-msoft-float}.
12179 The default is to not maintain the backchain.
12181 @item -mpacked-stack
12182 @item -mno-packed-stack
12183 @opindex mpacked-stack
12184 @opindex mno-packed-stack
12185 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12186 specified, the compiler uses the all fields of the 96/160 byte register save
12187 area only for their default purpose; unused fields still take up stack space.
12188 When @option{-mpacked-stack} is specified, register save slots are densely
12189 packed at the top of the register save area; unused space is reused for other
12190 purposes, allowing for more efficient use of the available stack space.
12191 However, when @option{-mbackchain} is also in effect, the topmost word of
12192 the save area is always used to store the backchain, and the return address
12193 register is always saved two words below the backchain.
12195 As long as the stack frame backchain is not used, code generated with
12196 @option{-mpacked-stack} is call-compatible with code generated with
12197 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
12198 S/390 or zSeries generated code that uses the stack frame backchain at run
12199 time, not just for debugging purposes.  Such code is not call-compatible
12200 with code compiled with @option{-mpacked-stack}.  Also, note that the
12201 combination of @option{-mbackchain},
12202 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12203 to build a linux kernel use @option{-msoft-float}.
12205 The default is to not use the packed stack layout.
12207 @item -msmall-exec
12208 @itemx -mno-small-exec
12209 @opindex msmall-exec
12210 @opindex mno-small-exec
12211 Generate (or do not generate) code using the @code{bras} instruction
12212 to do subroutine calls.
12213 This only works reliably if the total executable size does not
12214 exceed 64k.  The default is to use the @code{basr} instruction instead,
12215 which does not have this limitation.
12217 @item -m64
12218 @itemx -m31
12219 @opindex m64
12220 @opindex m31
12221 When @option{-m31} is specified, generate code compliant to the
12222 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
12223 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
12224 particular to generate 64-bit instructions.  For the @samp{s390}
12225 targets, the default is @option{-m31}, while the @samp{s390x}
12226 targets default to @option{-m64}.
12228 @item -mzarch
12229 @itemx -mesa
12230 @opindex mzarch
12231 @opindex mesa
12232 When @option{-mzarch} is specified, generate code using the
12233 instructions available on z/Architecture.
12234 When @option{-mesa} is specified, generate code using the
12235 instructions available on ESA/390.  Note that @option{-mesa} is
12236 not possible with @option{-m64}.
12237 When generating code compliant to the GNU/Linux for S/390 ABI,
12238 the default is @option{-mesa}.  When generating code compliant
12239 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
12241 @item -mmvcle
12242 @itemx -mno-mvcle
12243 @opindex mmvcle
12244 @opindex mno-mvcle
12245 Generate (or do not generate) code using the @code{mvcle} instruction
12246 to perform block moves.  When @option{-mno-mvcle} is specified,
12247 use a @code{mvc} loop instead.  This is the default unless optimizing for
12248 size.
12250 @item -mdebug
12251 @itemx -mno-debug
12252 @opindex mdebug
12253 @opindex mno-debug
12254 Print (or do not print) additional debug information when compiling.
12255 The default is to not print debug information.
12257 @item -march=@var{cpu-type}
12258 @opindex march
12259 Generate code that will run on @var{cpu-type}, which is the name of a system
12260 representing a certain processor type.  Possible values for
12261 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
12262 When generating code using the instructions available on z/Architecture,
12263 the default is @option{-march=z900}.  Otherwise, the default is
12264 @option{-march=g5}.
12266 @item -mtune=@var{cpu-type}
12267 @opindex mtune
12268 Tune to @var{cpu-type} everything applicable about the generated code,
12269 except for the ABI and the set of available instructions.
12270 The list of @var{cpu-type} values is the same as for @option{-march}.
12271 The default is the value used for @option{-march}.
12273 @item -mtpf-trace
12274 @itemx -mno-tpf-trace
12275 @opindex mtpf-trace
12276 @opindex mno-tpf-trace
12277 Generate code that adds (does not add) in TPF OS specific branches to trace
12278 routines in the operating system.  This option is off by default, even
12279 when compiling for the TPF OS@.
12281 @item -mfused-madd
12282 @itemx -mno-fused-madd
12283 @opindex mfused-madd
12284 @opindex mno-fused-madd
12285 Generate code that uses (does not use) the floating point multiply and
12286 accumulate instructions.  These instructions are generated by default if
12287 hardware floating point is used.
12289 @item -mwarn-framesize=@var{framesize}
12290 @opindex mwarn-framesize
12291 Emit a warning if the current function exceeds the given frame size.  Because
12292 this is a compile time check it doesn't need to be a real problem when the program
12293 runs.  It is intended to identify functions which most probably cause
12294 a stack overflow.  It is useful to be used in an environment with limited stack
12295 size e.g.@: the linux kernel.
12297 @item -mwarn-dynamicstack
12298 @opindex mwarn-dynamicstack
12299 Emit a warning if the function calls alloca or uses dynamically
12300 sized arrays.  This is generally a bad idea with a limited stack size.
12302 @item -mstack-guard=@var{stack-guard}
12303 @item -mstack-size=@var{stack-size}
12304 @opindex mstack-guard
12305 @opindex mstack-size
12306 These arguments always have to be used in conjunction.  If they are present the s390
12307 back end emits additional instructions in the function prologue which trigger a trap
12308 if the stack size is @var{stack-guard} bytes above the @var{stack-size}
12309 (remember that the stack on s390 grows downward).  These options are intended to
12310 be used to help debugging stack overflow problems.  The additionally emitted code
12311 causes only little overhead and hence can also be used in production like systems
12312 without greater performance degradation.  The given values have to be exact
12313 powers of 2 and @var{stack-size} has to be greater than @var{stack-guard} without
12314 exceeding 64k.
12315 In order to be efficient the extra code makes the assumption that the stack starts
12316 at an address aligned to the value given by @var{stack-size}.
12317 @end table
12319 @node Score Options
12320 @subsection Score Options
12321 @cindex Score Options
12323 These options are defined for Score implementations:
12325 @table @gcctabopt
12326 @item -mel
12327 @opindex -mel
12328 Compile code for little endian mode. 
12330 @item -meb
12331 @opindex meb
12332 Compile code for big endian mode.  This is the default.
12334 @item -mmac
12335 @opindex mmac
12336 Enable the use of multiply-accumulate instructions. Disabled by default. 
12338 @item -mscore5u
12339 @opindex mscore5u
12340 Specify the SCORE5U of the target architecture.
12342 @item -mscore7
12343 @opindex mscore7
12344 Specify the SCORE7 of the target architecture. This is the default.
12345 @end table
12347 @node SH Options
12348 @subsection SH Options
12350 These @samp{-m} options are defined for the SH implementations:
12352 @table @gcctabopt
12353 @item -m1
12354 @opindex m1
12355 Generate code for the SH1.
12357 @item -m2
12358 @opindex m2
12359 Generate code for the SH2.
12361 @item -m2e
12362 Generate code for the SH2e.
12364 @item -m3
12365 @opindex m3
12366 Generate code for the SH3.
12368 @item -m3e
12369 @opindex m3e
12370 Generate code for the SH3e.
12372 @item -m4-nofpu
12373 @opindex m4-nofpu
12374 Generate code for the SH4 without a floating-point unit.
12376 @item -m4-single-only
12377 @opindex m4-single-only
12378 Generate code for the SH4 with a floating-point unit that only
12379 supports single-precision arithmetic.
12381 @item -m4-single
12382 @opindex m4-single
12383 Generate code for the SH4 assuming the floating-point unit is in
12384 single-precision mode by default.
12386 @item -m4
12387 @opindex m4
12388 Generate code for the SH4.
12390 @item -m4a-nofpu
12391 @opindex m4a-nofpu
12392 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
12393 floating-point unit is not used.
12395 @item -m4a-single-only
12396 @opindex m4a-single-only
12397 Generate code for the SH4a, in such a way that no double-precision
12398 floating point operations are used.
12400 @item -m4a-single
12401 @opindex m4a-single
12402 Generate code for the SH4a assuming the floating-point unit is in
12403 single-precision mode by default.
12405 @item -m4a
12406 @opindex m4a
12407 Generate code for the SH4a.
12409 @item -m4al
12410 @opindex m4al
12411 Same as @option{-m4a-nofpu}, except that it implicitly passes
12412 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
12413 instructions at the moment.
12415 @item -mb
12416 @opindex mb
12417 Compile code for the processor in big endian mode.
12419 @item -ml
12420 @opindex ml
12421 Compile code for the processor in little endian mode.
12423 @item -mdalign
12424 @opindex mdalign
12425 Align doubles at 64-bit boundaries.  Note that this changes the calling
12426 conventions, and thus some functions from the standard C library will
12427 not work unless you recompile it first with @option{-mdalign}.
12429 @item -mrelax
12430 @opindex mrelax
12431 Shorten some address references at link time, when possible; uses the
12432 linker option @option{-relax}.
12434 @item -mbigtable
12435 @opindex mbigtable
12436 Use 32-bit offsets in @code{switch} tables.  The default is to use
12437 16-bit offsets.
12439 @item -mfmovd
12440 @opindex mfmovd
12441 Enable the use of the instruction @code{fmovd}.
12443 @item -mhitachi
12444 @opindex mhitachi
12445 Comply with the calling conventions defined by Renesas.
12447 @item -mrenesas
12448 @opindex mhitachi
12449 Comply with the calling conventions defined by Renesas.
12451 @item -mno-renesas
12452 @opindex mhitachi
12453 Comply with the calling conventions defined for GCC before the Renesas
12454 conventions were available.  This option is the default for all
12455 targets of the SH toolchain except for @samp{sh-symbianelf}.
12457 @item -mnomacsave
12458 @opindex mnomacsave
12459 Mark the @code{MAC} register as call-clobbered, even if
12460 @option{-mhitachi} is given.
12462 @item -mieee
12463 @opindex mieee
12464 Increase IEEE-compliance of floating-point code.
12465 At the moment, this is equivalent to @option{-fno-finite-math-only}.
12466 When generating 16 bit SH opcodes, getting IEEE-conforming results for
12467 comparisons of NANs / infinities incurs extra overhead in every
12468 floating point comparison, therefore the default is set to
12469 @option{-ffinite-math-only}.
12471 @item -minline-ic_invalidate
12472 @opindex minline-ic_invalidate
12473 Inline code to invalidate instruction cache entries after setting up
12474 nested function trampolines.
12475 This option has no effect if -musermode is in effect and the selected
12476 code generation option (e.g. -m4) does not allow the use of the icbi
12477 instruction.
12478 If the selected code generation option does not allow the use of the icbi
12479 instruction, and -musermode is not in effect, the inlined code will
12480 manipulate the instruction cache address array directly with an associative
12481 write.  This not only requires privileged mode, but it will also
12482 fail if the cache line had been mapped via the TLB and has become unmapped.
12484 @item -misize
12485 @opindex misize
12486 Dump instruction size and location in the assembly code.
12488 @item -mpadstruct
12489 @opindex mpadstruct
12490 This option is deprecated.  It pads structures to multiple of 4 bytes,
12491 which is incompatible with the SH ABI@.
12493 @item -mspace
12494 @opindex mspace
12495 Optimize for space instead of speed.  Implied by @option{-Os}.
12497 @item -mprefergot
12498 @opindex mprefergot
12499 When generating position-independent code, emit function calls using
12500 the Global Offset Table instead of the Procedure Linkage Table.
12502 @item -musermode
12503 @opindex musermode
12504 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
12505 if the inlined code would not work in user mode.
12506 This is the default when the target is @code{sh-*-linux*}.
12508 @item -multcost=@var{number}
12509 @opindex multcost=@var{number}
12510 Set the cost to assume for a multiply insn.
12512 @item -mdiv=@var{strategy}
12513 @opindex mdiv=@var{strategy}
12514 Set the division strategy to use for SHmedia code.  @var{strategy} must be
12515 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
12516 inv:call2, inv:fp .
12517 "fp" performs the operation in floating point.  This has a very high latency,
12518 but needs only a few instructions, so it might be a good choice if
12519 your code has enough easily exploitable ILP to allow the compiler to
12520 schedule the floating point instructions together with other instructions.
12521 Division by zero causes a floating point exception.
12522 "inv" uses integer operations to calculate the inverse of the divisor,
12523 and then multiplies the dividend with the inverse.  This strategy allows
12524 cse and hoisting of the inverse calculation.  Division by zero calculates
12525 an unspecified result, but does not trap.
12526 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
12527 have been found, or if the entire operation has been hoisted to the same
12528 place, the last stages of the inverse calculation are intertwined with the
12529 final multiply to reduce the overall latency, at the expense of using a few
12530 more instructions, and thus offering fewer scheduling opportunities with
12531 other code.
12532 "call" calls a library function that usually implements the inv:minlat
12533 strategy.
12534 This gives high code density for m5-*media-nofpu compilations.
12535 "call2" uses a different entry point of the same library function, where it
12536 assumes that a pointer to a lookup table has already been set up, which
12537 exposes the pointer load to cse / code hoisting optimizations.
12538 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
12539 code generation, but if the code stays unoptimized, revert to the "call",
12540 "call2", or "fp" strategies, respectively.  Note that the
12541 potentially-trapping side effect of division by zero is carried by a
12542 separate instruction, so it is possible that all the integer instructions
12543 are hoisted out, but the marker for the side effect stays where it is.
12544 A recombination to fp operations or a call is not possible in that case.
12545 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
12546 that the inverse calculation was nor separated from the multiply, they speed
12547 up division where the dividend fits into 20 bits (plus sign where applicable),
12548 by inserting a test to skip a number of operations in this case; this test
12549 slows down the case of larger dividends.  inv20u assumes the case of a such
12550 a small dividend to be unlikely, and inv20l assumes it to be likely.
12552 @item -mdivsi3_libfunc=@var{name}
12553 @opindex mdivsi3_libfunc=@var{name}
12554 Set the name of the library function used for 32 bit signed division to
12555 @var{name}.  This only affect the name used in the call and inv:call
12556 division strategies, and the compiler will still expect the same
12557 sets of input/output/clobbered registers as if this option was not present.
12559 @item -madjust-unroll
12560 @opindex madjust-unroll
12561 Throttle unrolling to avoid thrashing target registers.
12562 This option only has an effect if the gcc code base supports the
12563 TARGET_ADJUST_UNROLL_MAX target hook.
12565 @item -mindexed-addressing
12566 @opindex mindexed-addressing
12567 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
12568 This is only safe if the hardware and/or OS implement 32 bit wrap-around
12569 semantics for the indexed addressing mode.  The architecture allows the
12570 implementation of processors with 64 bit MMU, which the OS could use to
12571 get 32 bit addressing, but since no current hardware implementation supports
12572 this or any other way to make the indexed addressing mode safe to use in
12573 the 32 bit ABI, the default is -mno-indexed-addressing.
12575 @item -mgettrcost=@var{number}
12576 @opindex mgettrcost=@var{number}
12577 Set the cost assumed for the gettr instruction to @var{number}.
12578 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
12580 @item -mpt-fixed
12581 @opindex mpt-fixed
12582 Assume pt* instructions won't trap.  This will generally generate better
12583 scheduled code, but is unsafe on current hardware.  The current architecture
12584 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
12585 This has the unintentional effect of making it unsafe to schedule ptabs /
12586 ptrel before a branch, or hoist it out of a loop.  For example,
12587 __do_global_ctors, a part of libgcc that runs constructors at program
12588 startup, calls functions in a list which is delimited by -1.  With the
12589 -mpt-fixed option, the ptabs will be done before testing against -1.
12590 That means that all the constructors will be run a bit quicker, but when
12591 the loop comes to the end of the list, the program crashes because ptabs
12592 loads -1 into a target register.  Since this option is unsafe for any
12593 hardware implementing the current architecture specification, the default
12594 is -mno-pt-fixed.  Unless the user specifies a specific cost with
12595 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
12596 this deters register allocation using target registers for storing
12597 ordinary integers.
12599 @item -minvalid-symbols
12600 @opindex minvalid-symbols
12601 Assume symbols might be invalid.  Ordinary function symbols generated by
12602 the compiler will always be valid to load with movi/shori/ptabs or
12603 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
12604 to generate symbols that will cause ptabs / ptrel to trap.
12605 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
12606 It will then prevent cross-basic-block cse, hoisting and most scheduling
12607 of symbol loads.  The default is @option{-mno-invalid-symbols}.
12608 @end table
12610 @node SPARC Options
12611 @subsection SPARC Options
12612 @cindex SPARC options
12614 These @samp{-m} options are supported on the SPARC:
12616 @table @gcctabopt
12617 @item -mno-app-regs
12618 @itemx -mapp-regs
12619 @opindex mno-app-regs
12620 @opindex mapp-regs
12621 Specify @option{-mapp-regs} to generate output using the global registers
12622 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
12623 is the default.
12625 To be fully SVR4 ABI compliant at the cost of some performance loss,
12626 specify @option{-mno-app-regs}.  You should compile libraries and system
12627 software with this option.
12629 @item -mfpu
12630 @itemx -mhard-float
12631 @opindex mfpu
12632 @opindex mhard-float
12633 Generate output containing floating point instructions.  This is the
12634 default.
12636 @item -mno-fpu
12637 @itemx -msoft-float
12638 @opindex mno-fpu
12639 @opindex msoft-float
12640 Generate output containing library calls for floating point.
12641 @strong{Warning:} the requisite libraries are not available for all SPARC
12642 targets.  Normally the facilities of the machine's usual C compiler are
12643 used, but this cannot be done directly in cross-compilation.  You must make
12644 your own arrangements to provide suitable library functions for
12645 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
12646 @samp{sparclite-*-*} do provide software floating point support.
12648 @option{-msoft-float} changes the calling convention in the output file;
12649 therefore, it is only useful if you compile @emph{all} of a program with
12650 this option.  In particular, you need to compile @file{libgcc.a}, the
12651 library that comes with GCC, with @option{-msoft-float} in order for
12652 this to work.
12654 @item -mhard-quad-float
12655 @opindex mhard-quad-float
12656 Generate output containing quad-word (long double) floating point
12657 instructions.
12659 @item -msoft-quad-float
12660 @opindex msoft-quad-float
12661 Generate output containing library calls for quad-word (long double)
12662 floating point instructions.  The functions called are those specified
12663 in the SPARC ABI@.  This is the default.
12665 As of this writing, there are no SPARC implementations that have hardware
12666 support for the quad-word floating point instructions.  They all invoke
12667 a trap handler for one of these instructions, and then the trap handler
12668 emulates the effect of the instruction.  Because of the trap handler overhead,
12669 this is much slower than calling the ABI library routines.  Thus the
12670 @option{-msoft-quad-float} option is the default.
12672 @item -mno-unaligned-doubles
12673 @itemx -munaligned-doubles
12674 @opindex mno-unaligned-doubles
12675 @opindex munaligned-doubles
12676 Assume that doubles have 8 byte alignment.  This is the default.
12678 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
12679 alignment only if they are contained in another type, or if they have an
12680 absolute address.  Otherwise, it assumes they have 4 byte alignment.
12681 Specifying this option avoids some rare compatibility problems with code
12682 generated by other compilers.  It is not the default because it results
12683 in a performance loss, especially for floating point code.
12685 @item -mno-faster-structs
12686 @itemx -mfaster-structs
12687 @opindex mno-faster-structs
12688 @opindex mfaster-structs
12689 With @option{-mfaster-structs}, the compiler assumes that structures
12690 should have 8 byte alignment.  This enables the use of pairs of
12691 @code{ldd} and @code{std} instructions for copies in structure
12692 assignment, in place of twice as many @code{ld} and @code{st} pairs.
12693 However, the use of this changed alignment directly violates the SPARC
12694 ABI@.  Thus, it's intended only for use on targets where the developer
12695 acknowledges that their resulting code will not be directly in line with
12696 the rules of the ABI@.
12698 @item -mimpure-text
12699 @opindex mimpure-text
12700 @option{-mimpure-text}, used in addition to @option{-shared}, tells
12701 the compiler to not pass @option{-z text} to the linker when linking a
12702 shared object.  Using this option, you can link position-dependent
12703 code into a shared object.
12705 @option{-mimpure-text} suppresses the ``relocations remain against
12706 allocatable but non-writable sections'' linker error message.
12707 However, the necessary relocations will trigger copy-on-write, and the
12708 shared object is not actually shared across processes.  Instead of
12709 using @option{-mimpure-text}, you should compile all source code with
12710 @option{-fpic} or @option{-fPIC}.
12712 This option is only available on SunOS and Solaris.
12714 @item -mcpu=@var{cpu_type}
12715 @opindex mcpu
12716 Set the instruction set, register set, and instruction scheduling parameters
12717 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
12718 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
12719 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
12720 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
12721 @samp{ultrasparc3}, and @samp{niagara}.
12723 Default instruction scheduling parameters are used for values that select
12724 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
12725 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
12727 Here is a list of each supported architecture and their supported
12728 implementations.
12730 @smallexample
12731     v7:             cypress
12732     v8:             supersparc, hypersparc
12733     sparclite:      f930, f934, sparclite86x
12734     sparclet:       tsc701
12735     v9:             ultrasparc, ultrasparc3, niagara
12736 @end smallexample
12738 By default (unless configured otherwise), GCC generates code for the V7
12739 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
12740 additionally optimizes it for the Cypress CY7C602 chip, as used in the
12741 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
12742 SPARCStation 1, 2, IPX etc.
12744 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
12745 architecture.  The only difference from V7 code is that the compiler emits
12746 the integer multiply and integer divide instructions which exist in SPARC-V8
12747 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
12748 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
12749 2000 series.
12751 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
12752 the SPARC architecture.  This adds the integer multiply, integer divide step
12753 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
12754 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
12755 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
12756 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
12757 MB86934 chip, which is the more recent SPARClite with FPU@.
12759 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
12760 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
12761 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
12762 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
12763 optimizes it for the TEMIC SPARClet chip.
12765 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
12766 architecture.  This adds 64-bit integer and floating-point move instructions,
12767 3 additional floating-point condition code registers and conditional move
12768 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
12769 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
12770 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
12771 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
12772 @option{-mcpu=niagara}, the compiler additionally optimizes it for
12773 Sun UltraSPARC T1 chips.
12775 @item -mtune=@var{cpu_type}
12776 @opindex mtune
12777 Set the instruction scheduling parameters for machine type
12778 @var{cpu_type}, but do not set the instruction set or register set that the
12779 option @option{-mcpu=@var{cpu_type}} would.
12781 The same values for @option{-mcpu=@var{cpu_type}} can be used for
12782 @option{-mtune=@var{cpu_type}}, but the only useful values are those
12783 that select a particular cpu implementation.  Those are @samp{cypress},
12784 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
12785 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
12786 @samp{ultrasparc3}, and @samp{niagara}.
12788 @item -mv8plus
12789 @itemx -mno-v8plus
12790 @opindex mv8plus
12791 @opindex mno-v8plus
12792 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
12793 difference from the V8 ABI is that the global and out registers are
12794 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
12795 mode for all SPARC-V9 processors.
12797 @item -mvis
12798 @itemx -mno-vis
12799 @opindex mvis
12800 @opindex mno-vis
12801 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
12802 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
12803 @end table
12805 These @samp{-m} options are supported in addition to the above
12806 on SPARC-V9 processors in 64-bit environments:
12808 @table @gcctabopt
12809 @item -mlittle-endian
12810 @opindex mlittle-endian
12811 Generate code for a processor running in little-endian mode.  It is only
12812 available for a few configurations and most notably not on Solaris and Linux.
12814 @item -m32
12815 @itemx -m64
12816 @opindex m32
12817 @opindex m64
12818 Generate code for a 32-bit or 64-bit environment.
12819 The 32-bit environment sets int, long and pointer to 32 bits.
12820 The 64-bit environment sets int to 32 bits and long and pointer
12821 to 64 bits.
12823 @item -mcmodel=medlow
12824 @opindex mcmodel=medlow
12825 Generate code for the Medium/Low code model: 64-bit addresses, programs
12826 must be linked in the low 32 bits of memory.  Programs can be statically
12827 or dynamically linked.
12829 @item -mcmodel=medmid
12830 @opindex mcmodel=medmid
12831 Generate code for the Medium/Middle code model: 64-bit addresses, programs
12832 must be linked in the low 44 bits of memory, the text and data segments must
12833 be less than 2GB in size and the data segment must be located within 2GB of
12834 the text segment.
12836 @item -mcmodel=medany
12837 @opindex mcmodel=medany
12838 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
12839 may be linked anywhere in memory, the text and data segments must be less
12840 than 2GB in size and the data segment must be located within 2GB of the
12841 text segment.
12843 @item -mcmodel=embmedany
12844 @opindex mcmodel=embmedany
12845 Generate code for the Medium/Anywhere code model for embedded systems:
12846 64-bit addresses, the text and data segments must be less than 2GB in
12847 size, both starting anywhere in memory (determined at link time).  The
12848 global register %g4 points to the base of the data segment.  Programs
12849 are statically linked and PIC is not supported.
12851 @item -mstack-bias
12852 @itemx -mno-stack-bias
12853 @opindex mstack-bias
12854 @opindex mno-stack-bias
12855 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
12856 frame pointer if present, are offset by @minus{}2047 which must be added back
12857 when making stack frame references.  This is the default in 64-bit mode.
12858 Otherwise, assume no such offset is present.
12859 @end table
12861 These switches are supported in addition to the above on Solaris:
12863 @table @gcctabopt
12864 @item -threads
12865 @opindex threads
12866 Add support for multithreading using the Solaris threads library.  This
12867 option sets flags for both the preprocessor and linker.  This option does
12868 not affect the thread safety of object code produced by the compiler or
12869 that of libraries supplied with it.
12871 @item -pthreads
12872 @opindex pthreads
12873 Add support for multithreading using the POSIX threads library.  This
12874 option sets flags for both the preprocessor and linker.  This option does
12875 not affect the thread safety of object code produced  by the compiler or
12876 that of libraries supplied with it.
12878 @item -pthread
12879 @opindex pthread
12880 This is a synonym for @option{-pthreads}.
12881 @end table
12883 @node SPU Options
12884 @subsection SPU Options
12885 @cindex SPU options
12887 These @samp{-m} options are supported on the SPU:
12889 @table @gcctabopt
12890 @item -mwarn-reloc
12891 @itemx -merror-reloc
12892 @opindex mwarn-reloc
12893 @opindex merror-reloc
12895 The loader for SPU does not handle dynamic relocations.  By default, GCC
12896 will give an error when it generates code that requires a dynamic
12897 relocation.  @option{-mno-error-reloc} disables the error,
12898 @option{-mwarn-reloc} will generate a warning instead.
12900 @item -msafe-dma
12901 @itemx -munsafe-dma
12902 @opindex msafe-dma
12903 @opindex munsafe-dma
12905 Instructions which initiate or test completion of DMA must not be
12906 reordered with respect to loads and stores of the memory which is being
12907 accessed.  Users typically address this problem using the volatile
12908 keyword, but that can lead to inefficient code in places where the
12909 memory is known to not change.  Rather than mark the memory as volatile
12910 we treat the DMA instructions as potentially effecting all memory.  With
12911 @option{-munsafe-dma} users must use the volatile keyword to protect
12912 memory accesses.
12914 @item -mbranch-hints
12915 @opindex mbranch-hints
12917 By default, GCC will generate a branch hint instruction to avoid
12918 pipeline stalls for always taken or probably taken branches.  A hint
12919 will not be generated closer than 8 instructions away from its branch.
12920 There is little reason to disable them, except for debugging purposes,
12921 or to make an object a little bit smaller.
12923 @item -msmall-mem
12924 @itemx -mlarge-mem
12925 @opindex msmall-mem
12926 @opindex mlarge-mem
12928 By default, GCC generates code assuming that addresses are never larger
12929 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
12930 a full 32 bit address.
12932 @item -mstdmain
12933 @opindex mstdmain
12935 By default, GCC links against startup code that assumes the SPU-style
12936 main function interface (which has an unconventional parameter list).
12937 With @option{-mstdmain}, GCC will link your program against startup
12938 code that assumes a C99-style interface to @code{main}, including a
12939 local copy of @code{argv} strings.
12941 @item -mfixed-range=@var{register-range}
12942 @opindex mfixed-range
12943 Generate code treating the given register range as fixed registers.
12944 A fixed register is one that the register allocator can not use.  This is
12945 useful when compiling kernel code.  A register range is specified as
12946 two registers separated by a dash.  Multiple register ranges can be
12947 specified separated by a comma.
12949 @end table
12951 @node System V Options
12952 @subsection Options for System V
12954 These additional options are available on System V Release 4 for
12955 compatibility with other compilers on those systems:
12957 @table @gcctabopt
12958 @item -G
12959 @opindex G
12960 Create a shared object.
12961 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
12963 @item -Qy
12964 @opindex Qy
12965 Identify the versions of each tool used by the compiler, in a
12966 @code{.ident} assembler directive in the output.
12968 @item -Qn
12969 @opindex Qn
12970 Refrain from adding @code{.ident} directives to the output file (this is
12971 the default).
12973 @item -YP,@var{dirs}
12974 @opindex YP
12975 Search the directories @var{dirs}, and no others, for libraries
12976 specified with @option{-l}.
12978 @item -Ym,@var{dir}
12979 @opindex Ym
12980 Look in the directory @var{dir} to find the M4 preprocessor.
12981 The assembler uses this option.
12982 @c This is supposed to go with a -Yd for predefined M4 macro files, but
12983 @c the generic assembler that comes with Solaris takes just -Ym.
12984 @end table
12986 @node TMS320C3x/C4x Options
12987 @subsection TMS320C3x/C4x Options
12988 @cindex TMS320C3x/C4x Options
12990 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
12992 @table @gcctabopt
12994 @item -mcpu=@var{cpu_type}
12995 @opindex mcpu
12996 Set the instruction set, register set, and instruction scheduling
12997 parameters for machine type @var{cpu_type}.  Supported values for
12998 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
12999 @samp{c44}.  The default is @samp{c40} to generate code for the
13000 TMS320C40.
13002 @item -mbig-memory
13003 @itemx -mbig
13004 @itemx -msmall-memory
13005 @itemx -msmall
13006 @opindex mbig-memory
13007 @opindex mbig
13008 @opindex msmall-memory
13009 @opindex msmall
13010 Generates code for the big or small memory model.  The small memory
13011 model assumed that all data fits into one 64K word page.  At run-time
13012 the data page (DP) register must be set to point to the 64K page
13013 containing the .bss and .data program sections.  The big memory model is
13014 the default and requires reloading of the DP register for every direct
13015 memory access.
13017 @item -mbk
13018 @itemx -mno-bk
13019 @opindex mbk
13020 @opindex mno-bk
13021 Allow (disallow) allocation of general integer operands into the block
13022 count register BK@.
13024 @item -mdb
13025 @itemx -mno-db
13026 @opindex mdb
13027 @opindex mno-db
13028 Enable (disable) generation of code using decrement and branch,
13029 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13030 on the safe side, this is disabled for the C3x, since the maximum
13031 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13032 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13033 that it can utilize the decrement and branch instruction, but will give
13034 up if there is more than one memory reference in the loop.  Thus a loop
13035 where the loop counter is decremented can generate slightly more
13036 efficient code, in cases where the RPTB instruction cannot be utilized.
13038 @item -mdp-isr-reload
13039 @itemx -mparanoid
13040 @opindex mdp-isr-reload
13041 @opindex mparanoid
13042 Force the DP register to be saved on entry to an interrupt service
13043 routine (ISR), reloaded to point to the data section, and restored on
13044 exit from the ISR@.  This should not be required unless someone has
13045 violated the small memory model by modifying the DP register, say within
13046 an object library.
13048 @item -mmpyi
13049 @itemx -mno-mpyi
13050 @opindex mmpyi
13051 @opindex mno-mpyi
13052 For the C3x use the 24-bit MPYI instruction for integer multiplies
13053 instead of a library call to guarantee 32-bit results.  Note that if one
13054 of the operands is a constant, then the multiplication will be performed
13055 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13056 then squaring operations are performed inline instead of a library call.
13058 @item -mfast-fix
13059 @itemx -mno-fast-fix
13060 @opindex mfast-fix
13061 @opindex mno-fast-fix
13062 The C3x/C4x FIX instruction to convert a floating point value to an
13063 integer value chooses the nearest integer less than or equal to the
13064 floating point value rather than to the nearest integer.  Thus if the
13065 floating point number is negative, the result will be incorrectly
13066 truncated an additional code is necessary to detect and correct this
13067 case.  This option can be used to disable generation of the additional
13068 code required to correct the result.
13070 @item -mrptb
13071 @itemx -mno-rptb
13072 @opindex mrptb
13073 @opindex mno-rptb
13074 Enable (disable) generation of repeat block sequences using the RPTB
13075 instruction for zero overhead looping.  The RPTB construct is only used
13076 for innermost loops that do not call functions or jump across the loop
13077 boundaries.  There is no advantage having nested RPTB loops due to the
13078 overhead required to save and restore the RC, RS, and RE registers.
13079 This is enabled by default with @option{-O2}.
13081 @item -mrpts=@var{count}
13082 @itemx -mno-rpts
13083 @opindex mrpts
13084 @opindex mno-rpts
13085 Enable (disable) the use of the single instruction repeat instruction
13086 RPTS@.  If a repeat block contains a single instruction, and the loop
13087 count can be guaranteed to be less than the value @var{count}, GCC will
13088 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13089 then a RPTS will be emitted even if the loop count cannot be determined
13090 at compile time.  Note that the repeated instruction following RPTS does
13091 not have to be reloaded from memory each iteration, thus freeing up the
13092 CPU buses for operands.  However, since interrupts are blocked by this
13093 instruction, it is disabled by default.
13095 @item -mloop-unsigned
13096 @itemx -mno-loop-unsigned
13097 @opindex mloop-unsigned
13098 @opindex mno-loop-unsigned
13099 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13100 is @math{2^{31} + 1} since these instructions test if the iteration count is
13101 negative to terminate the loop.  If the iteration count is unsigned
13102 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13103 exceeded.  This switch allows an unsigned iteration count.
13105 @item -mti
13106 @opindex mti
13107 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13108 with.  This also enforces compatibility with the API employed by the TI
13109 C3x C compiler.  For example, long doubles are passed as structures
13110 rather than in floating point registers.
13112 @item -mregparm
13113 @itemx -mmemparm
13114 @opindex mregparm
13115 @opindex mmemparm
13116 Generate code that uses registers (stack) for passing arguments to functions.
13117 By default, arguments are passed in registers where possible rather
13118 than by pushing arguments on to the stack.
13120 @item -mparallel-insns
13121 @itemx -mno-parallel-insns
13122 @opindex mparallel-insns
13123 @opindex mno-parallel-insns
13124 Allow the generation of parallel instructions.  This is enabled by
13125 default with @option{-O2}.
13127 @item -mparallel-mpy
13128 @itemx -mno-parallel-mpy
13129 @opindex mparallel-mpy
13130 @opindex mno-parallel-mpy
13131 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13132 provided @option{-mparallel-insns} is also specified.  These instructions have
13133 tight register constraints which can pessimize the code generation
13134 of large functions.
13136 @end table
13138 @node V850 Options
13139 @subsection V850 Options
13140 @cindex V850 Options
13142 These @samp{-m} options are defined for V850 implementations:
13144 @table @gcctabopt
13145 @item -mlong-calls
13146 @itemx -mno-long-calls
13147 @opindex mlong-calls
13148 @opindex mno-long-calls
13149 Treat all calls as being far away (near).  If calls are assumed to be
13150 far away, the compiler will always load the functions address up into a
13151 register, and call indirect through the pointer.
13153 @item -mno-ep
13154 @itemx -mep
13155 @opindex mno-ep
13156 @opindex mep
13157 Do not optimize (do optimize) basic blocks that use the same index
13158 pointer 4 or more times to copy pointer into the @code{ep} register, and
13159 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13160 option is on by default if you optimize.
13162 @item -mno-prolog-function
13163 @itemx -mprolog-function
13164 @opindex mno-prolog-function
13165 @opindex mprolog-function
13166 Do not use (do use) external functions to save and restore registers
13167 at the prologue and epilogue of a function.  The external functions
13168 are slower, but use less code space if more than one function saves
13169 the same number of registers.  The @option{-mprolog-function} option
13170 is on by default if you optimize.
13172 @item -mspace
13173 @opindex mspace
13174 Try to make the code as small as possible.  At present, this just turns
13175 on the @option{-mep} and @option{-mprolog-function} options.
13177 @item -mtda=@var{n}
13178 @opindex mtda
13179 Put static or global variables whose size is @var{n} bytes or less into
13180 the tiny data area that register @code{ep} points to.  The tiny data
13181 area can hold up to 256 bytes in total (128 bytes for byte references).
13183 @item -msda=@var{n}
13184 @opindex msda
13185 Put static or global variables whose size is @var{n} bytes or less into
13186 the small data area that register @code{gp} points to.  The small data
13187 area can hold up to 64 kilobytes.
13189 @item -mzda=@var{n}
13190 @opindex mzda
13191 Put static or global variables whose size is @var{n} bytes or less into
13192 the first 32 kilobytes of memory.
13194 @item -mv850
13195 @opindex mv850
13196 Specify that the target processor is the V850.
13198 @item -mbig-switch
13199 @opindex mbig-switch
13200 Generate code suitable for big switch tables.  Use this option only if
13201 the assembler/linker complain about out of range branches within a switch
13202 table.
13204 @item -mapp-regs
13205 @opindex mapp-regs
13206 This option will cause r2 and r5 to be used in the code generated by
13207 the compiler.  This setting is the default.
13209 @item -mno-app-regs
13210 @opindex mno-app-regs
13211 This option will cause r2 and r5 to be treated as fixed registers.
13213 @item -mv850e1
13214 @opindex mv850e1
13215 Specify that the target processor is the V850E1.  The preprocessor
13216 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
13217 this option is used.
13219 @item -mv850e
13220 @opindex mv850e
13221 Specify that the target processor is the V850E@.  The preprocessor
13222 constant @samp{__v850e__} will be defined if this option is used.
13224 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
13225 are defined then a default target processor will be chosen and the
13226 relevant @samp{__v850*__} preprocessor constant will be defined.
13228 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
13229 defined, regardless of which processor variant is the target.
13231 @item -mdisable-callt
13232 @opindex mdisable-callt
13233 This option will suppress generation of the CALLT instruction for the
13234 v850e and v850e1 flavors of the v850 architecture.  The default is
13235 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
13237 @end table
13239 @node VAX Options
13240 @subsection VAX Options
13241 @cindex VAX options
13243 These @samp{-m} options are defined for the VAX:
13245 @table @gcctabopt
13246 @item -munix
13247 @opindex munix
13248 Do not output certain jump instructions (@code{aobleq} and so on)
13249 that the Unix assembler for the VAX cannot handle across long
13250 ranges.
13252 @item -mgnu
13253 @opindex mgnu
13254 Do output those jump instructions, on the assumption that you
13255 will assemble with the GNU assembler.
13257 @item -mg
13258 @opindex mg
13259 Output code for g-format floating point numbers instead of d-format.
13260 @end table
13262 @node x86-64 Options
13263 @subsection x86-64 Options
13264 @cindex x86-64 options
13266 These are listed under @xref{i386 and x86-64 Options}.
13268 @node Xstormy16 Options
13269 @subsection Xstormy16 Options
13270 @cindex Xstormy16 Options
13272 These options are defined for Xstormy16:
13274 @table @gcctabopt
13275 @item -msim
13276 @opindex msim
13277 Choose startup files and linker script suitable for the simulator.
13278 @end table
13280 @node Xtensa Options
13281 @subsection Xtensa Options
13282 @cindex Xtensa Options
13284 These options are supported for Xtensa targets:
13286 @table @gcctabopt
13287 @item -mconst16
13288 @itemx -mno-const16
13289 @opindex mconst16
13290 @opindex mno-const16
13291 Enable or disable use of @code{CONST16} instructions for loading
13292 constant values.  The @code{CONST16} instruction is currently not a
13293 standard option from Tensilica.  When enabled, @code{CONST16}
13294 instructions are always used in place of the standard @code{L32R}
13295 instructions.  The use of @code{CONST16} is enabled by default only if
13296 the @code{L32R} instruction is not available.
13298 @item -mfused-madd
13299 @itemx -mno-fused-madd
13300 @opindex mfused-madd
13301 @opindex mno-fused-madd
13302 Enable or disable use of fused multiply/add and multiply/subtract
13303 instructions in the floating-point option.  This has no effect if the
13304 floating-point option is not also enabled.  Disabling fused multiply/add
13305 and multiply/subtract instructions forces the compiler to use separate
13306 instructions for the multiply and add/subtract operations.  This may be
13307 desirable in some cases where strict IEEE 754-compliant results are
13308 required: the fused multiply add/subtract instructions do not round the
13309 intermediate result, thereby producing results with @emph{more} bits of
13310 precision than specified by the IEEE standard.  Disabling fused multiply
13311 add/subtract instructions also ensures that the program output is not
13312 sensitive to the compiler's ability to combine multiply and add/subtract
13313 operations.
13315 @item -mtext-section-literals
13316 @itemx -mno-text-section-literals
13317 @opindex mtext-section-literals
13318 @opindex mno-text-section-literals
13319 Control the treatment of literal pools.  The default is
13320 @option{-mno-text-section-literals}, which places literals in a separate
13321 section in the output file.  This allows the literal pool to be placed
13322 in a data RAM/ROM, and it also allows the linker to combine literal
13323 pools from separate object files to remove redundant literals and
13324 improve code size.  With @option{-mtext-section-literals}, the literals
13325 are interspersed in the text section in order to keep them as close as
13326 possible to their references.  This may be necessary for large assembly
13327 files.
13329 @item -mtarget-align
13330 @itemx -mno-target-align
13331 @opindex mtarget-align
13332 @opindex mno-target-align
13333 When this option is enabled, GCC instructs the assembler to
13334 automatically align instructions to reduce branch penalties at the
13335 expense of some code density.  The assembler attempts to widen density
13336 instructions to align branch targets and the instructions following call
13337 instructions.  If there are not enough preceding safe density
13338 instructions to align a target, no widening will be performed.  The
13339 default is @option{-mtarget-align}.  These options do not affect the
13340 treatment of auto-aligned instructions like @code{LOOP}, which the
13341 assembler will always align, either by widening density instructions or
13342 by inserting no-op instructions.
13344 @item -mlongcalls
13345 @itemx -mno-longcalls
13346 @opindex mlongcalls
13347 @opindex mno-longcalls
13348 When this option is enabled, GCC instructs the assembler to translate
13349 direct calls to indirect calls unless it can determine that the target
13350 of a direct call is in the range allowed by the call instruction.  This
13351 translation typically occurs for calls to functions in other source
13352 files.  Specifically, the assembler translates a direct @code{CALL}
13353 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
13354 The default is @option{-mno-longcalls}.  This option should be used in
13355 programs where the call target can potentially be out of range.  This
13356 option is implemented in the assembler, not the compiler, so the
13357 assembly code generated by GCC will still show direct call
13358 instructions---look at the disassembled object code to see the actual
13359 instructions.  Note that the assembler will use an indirect call for
13360 every cross-file call, not just those that really will be out of range.
13361 @end table
13363 @node zSeries Options
13364 @subsection zSeries Options
13365 @cindex zSeries options
13367 These are listed under @xref{S/390 and zSeries Options}.
13369 @node Code Gen Options
13370 @section Options for Code Generation Conventions
13371 @cindex code generation conventions
13372 @cindex options, code generation
13373 @cindex run-time options
13375 These machine-independent options control the interface conventions
13376 used in code generation.
13378 Most of them have both positive and negative forms; the negative form
13379 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
13380 one of the forms is listed---the one which is not the default.  You
13381 can figure out the other form by either removing @samp{no-} or adding
13384 @table @gcctabopt
13385 @item -fbounds-check
13386 @opindex fbounds-check
13387 For front-ends that support it, generate additional code to check that
13388 indices used to access arrays are within the declared range.  This is
13389 currently only supported by the Java and Fortran front-ends, where
13390 this option defaults to true and false respectively.
13392 @item -ftrapv
13393 @opindex ftrapv
13394 This option generates traps for signed overflow on addition, subtraction,
13395 multiplication operations.
13397 @item -fwrapv
13398 @opindex fwrapv
13399 This option instructs the compiler to assume that signed arithmetic
13400 overflow of addition, subtraction and multiplication wraps around
13401 using twos-complement representation.  This flag enables some optimizations
13402 and disables others.  This option is enabled by default for the Java
13403 front-end, as required by the Java language specification.
13405 @item -fexceptions
13406 @opindex fexceptions
13407 Enable exception handling.  Generates extra code needed to propagate
13408 exceptions.  For some targets, this implies GCC will generate frame
13409 unwind information for all functions, which can produce significant data
13410 size overhead, although it does not affect execution.  If you do not
13411 specify this option, GCC will enable it by default for languages like
13412 C++ which normally require exception handling, and disable it for
13413 languages like C that do not normally require it.  However, you may need
13414 to enable this option when compiling C code that needs to interoperate
13415 properly with exception handlers written in C++.  You may also wish to
13416 disable this option if you are compiling older C++ programs that don't
13417 use exception handling.
13419 @item -fnon-call-exceptions
13420 @opindex fnon-call-exceptions
13421 Generate code that allows trapping instructions to throw exceptions.
13422 Note that this requires platform-specific runtime support that does
13423 not exist everywhere.  Moreover, it only allows @emph{trapping}
13424 instructions to throw exceptions, i.e.@: memory references or floating
13425 point instructions.  It does not allow exceptions to be thrown from
13426 arbitrary signal handlers such as @code{SIGALRM}.
13428 @item -funwind-tables
13429 @opindex funwind-tables
13430 Similar to @option{-fexceptions}, except that it will just generate any needed
13431 static data, but will not affect the generated code in any other way.
13432 You will normally not enable this option; instead, a language processor
13433 that needs this handling would enable it on your behalf.
13435 @item -fasynchronous-unwind-tables
13436 @opindex fasynchronous-unwind-tables
13437 Generate unwind table in dwarf2 format, if supported by target machine.  The
13438 table is exact at each instruction boundary, so it can be used for stack
13439 unwinding from asynchronous events (such as debugger or garbage collector).
13441 @item -fpcc-struct-return
13442 @opindex fpcc-struct-return
13443 Return ``short'' @code{struct} and @code{union} values in memory like
13444 longer ones, rather than in registers.  This convention is less
13445 efficient, but it has the advantage of allowing intercallability between
13446 GCC-compiled files and files compiled with other compilers, particularly
13447 the Portable C Compiler (pcc).
13449 The precise convention for returning structures in memory depends
13450 on the target configuration macros.
13452 Short structures and unions are those whose size and alignment match
13453 that of some integer type.
13455 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13456 switch is not binary compatible with code compiled with the
13457 @option{-freg-struct-return} switch.
13458 Use it to conform to a non-default application binary interface.
13460 @item -freg-struct-return
13461 @opindex freg-struct-return
13462 Return @code{struct} and @code{union} values in registers when possible.
13463 This is more efficient for small structures than
13464 @option{-fpcc-struct-return}.
13466 If you specify neither @option{-fpcc-struct-return} nor
13467 @option{-freg-struct-return}, GCC defaults to whichever convention is
13468 standard for the target.  If there is no standard convention, GCC
13469 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
13470 the principal compiler.  In those cases, we can choose the standard, and
13471 we chose the more efficient register return alternative.
13473 @strong{Warning:} code compiled with the @option{-freg-struct-return}
13474 switch is not binary compatible with code compiled with the
13475 @option{-fpcc-struct-return} switch.
13476 Use it to conform to a non-default application binary interface.
13478 @item -fshort-enums
13479 @opindex fshort-enums
13480 Allocate to an @code{enum} type only as many bytes as it needs for the
13481 declared range of possible values.  Specifically, the @code{enum} type
13482 will be equivalent to the smallest integer type which has enough room.
13484 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
13485 code that is not binary compatible with code generated without that switch.
13486 Use it to conform to a non-default application binary interface.
13488 @item -fshort-double
13489 @opindex fshort-double
13490 Use the same size for @code{double} as for @code{float}.
13492 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
13493 code that is not binary compatible with code generated without that switch.
13494 Use it to conform to a non-default application binary interface.
13496 @item -fshort-wchar
13497 @opindex fshort-wchar
13498 Override the underlying type for @samp{wchar_t} to be @samp{short
13499 unsigned int} instead of the default for the target.  This option is
13500 useful for building programs to run under WINE@.
13502 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
13503 code that is not binary compatible with code generated without that switch.
13504 Use it to conform to a non-default application binary interface.
13506 @item -fno-common
13507 @opindex fno-common
13508 In C, allocate even uninitialized global variables in the data section of the
13509 object file, rather than generating them as common blocks.  This has the
13510 effect that if the same variable is declared (without @code{extern}) in
13511 two different compilations, you will get an error when you link them.
13512 The only reason this might be useful is if you wish to verify that the
13513 program will work on other systems which always work this way.
13515 @item -fno-ident
13516 @opindex fno-ident
13517 Ignore the @samp{#ident} directive.
13519 @item -finhibit-size-directive
13520 @opindex finhibit-size-directive
13521 Don't output a @code{.size} assembler directive, or anything else that
13522 would cause trouble if the function is split in the middle, and the
13523 two halves are placed at locations far apart in memory.  This option is
13524 used when compiling @file{crtstuff.c}; you should not need to use it
13525 for anything else.
13527 @item -fverbose-asm
13528 @opindex fverbose-asm
13529 Put extra commentary information in the generated assembly code to
13530 make it more readable.  This option is generally only of use to those
13531 who actually need to read the generated assembly code (perhaps while
13532 debugging the compiler itself).
13534 @option{-fno-verbose-asm}, the default, causes the
13535 extra information to be omitted and is useful when comparing two assembler
13536 files.
13538 @item -frecord-gcc-switches
13539 @opindex frecord-gcc-switches
13540 This switch causes the command line that was used to invoke the
13541 compiler to be recorded into the object file that is being created.
13542 This switch is only implemented on some targets and the exact format
13543 of the recording is target and binary file format dependent, but it
13544 usually takes the form of a section containing ASCII text.  This
13545 switch is related to the @option{-fverbose-asm} switch, but that
13546 switch only records information in the assembler output file as
13547 comments, so it never reaches the object file.
13549 @item -fpic
13550 @opindex fpic
13551 @cindex global offset table
13552 @cindex PIC
13553 Generate position-independent code (PIC) suitable for use in a shared
13554 library, if supported for the target machine.  Such code accesses all
13555 constant addresses through a global offset table (GOT)@.  The dynamic
13556 loader resolves the GOT entries when the program starts (the dynamic
13557 loader is not part of GCC; it is part of the operating system).  If
13558 the GOT size for the linked executable exceeds a machine-specific
13559 maximum size, you get an error message from the linker indicating that
13560 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
13561 instead.  (These maximums are 8k on the SPARC and 32k
13562 on the m68k and RS/6000.  The 386 has no such limit.)
13564 Position-independent code requires special support, and therefore works
13565 only on certain machines.  For the 386, GCC supports PIC for System V
13566 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
13567 position-independent.
13569 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13570 are defined to 1.
13572 @item -fPIC
13573 @opindex fPIC
13574 If supported for the target machine, emit position-independent code,
13575 suitable for dynamic linking and avoiding any limit on the size of the
13576 global offset table.  This option makes a difference on the m68k,
13577 PowerPC and SPARC@.
13579 Position-independent code requires special support, and therefore works
13580 only on certain machines.
13582 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13583 are defined to 2.
13585 @item -fpie
13586 @itemx -fPIE
13587 @opindex fpie
13588 @opindex fPIE
13589 These options are similar to @option{-fpic} and @option{-fPIC}, but
13590 generated position independent code can be only linked into executables.
13591 Usually these options are used when @option{-pie} GCC option will be
13592 used during linking.
13594 @item -fno-jump-tables
13595 @opindex fno-jump-tables
13596 Do not use jump tables for switch statements even where it would be
13597 more efficient than other code generation strategies.  This option is
13598 of use in conjunction with @option{-fpic} or @option{-fPIC} for
13599 building code which forms part of a dynamic linker and cannot
13600 reference the address of a jump table.  On some targets, jump tables
13601 do not require a GOT and this option is not needed.
13603 @item -ffixed-@var{reg}
13604 @opindex ffixed
13605 Treat the register named @var{reg} as a fixed register; generated code
13606 should never refer to it (except perhaps as a stack pointer, frame
13607 pointer or in some other fixed role).
13609 @var{reg} must be the name of a register.  The register names accepted
13610 are machine-specific and are defined in the @code{REGISTER_NAMES}
13611 macro in the machine description macro file.
13613 This flag does not have a negative form, because it specifies a
13614 three-way choice.
13616 @item -fcall-used-@var{reg}
13617 @opindex fcall-used
13618 Treat the register named @var{reg} as an allocable register that is
13619 clobbered by function calls.  It may be allocated for temporaries or
13620 variables that do not live across a call.  Functions compiled this way
13621 will not save and restore the register @var{reg}.
13623 It is an error to used this flag with the frame pointer or stack pointer.
13624 Use of this flag for other registers that have fixed pervasive roles in
13625 the machine's execution model will produce disastrous results.
13627 This flag does not have a negative form, because it specifies a
13628 three-way choice.
13630 @item -fcall-saved-@var{reg}
13631 @opindex fcall-saved
13632 Treat the register named @var{reg} as an allocable register saved by
13633 functions.  It may be allocated even for temporaries or variables that
13634 live across a call.  Functions compiled this way will save and restore
13635 the register @var{reg} if they use it.
13637 It is an error to used this flag with the frame pointer or stack pointer.
13638 Use of this flag for other registers that have fixed pervasive roles in
13639 the machine's execution model will produce disastrous results.
13641 A different sort of disaster will result from the use of this flag for
13642 a register in which function values may be returned.
13644 This flag does not have a negative form, because it specifies a
13645 three-way choice.
13647 @item -fpack-struct[=@var{n}]
13648 @opindex fpack-struct
13649 Without a value specified, pack all structure members together without
13650 holes.  When a value is specified (which must be a small power of two), pack
13651 structure members according to this value, representing the maximum
13652 alignment (that is, objects with default alignment requirements larger than
13653 this will be output potentially unaligned at the next fitting location.
13655 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
13656 code that is not binary compatible with code generated without that switch.
13657 Additionally, it makes the code suboptimal.
13658 Use it to conform to a non-default application binary interface.
13660 @item -finstrument-functions
13661 @opindex finstrument-functions
13662 Generate instrumentation calls for entry and exit to functions.  Just
13663 after function entry and just before function exit, the following
13664 profiling functions will be called with the address of the current
13665 function and its call site.  (On some platforms,
13666 @code{__builtin_return_address} does not work beyond the current
13667 function, so the call site information may not be available to the
13668 profiling functions otherwise.)
13670 @smallexample
13671 void __cyg_profile_func_enter (void *this_fn,
13672                                void *call_site);
13673 void __cyg_profile_func_exit  (void *this_fn,
13674                                void *call_site);
13675 @end smallexample
13677 The first argument is the address of the start of the current function,
13678 which may be looked up exactly in the symbol table.
13680 This instrumentation is also done for functions expanded inline in other
13681 functions.  The profiling calls will indicate where, conceptually, the
13682 inline function is entered and exited.  This means that addressable
13683 versions of such functions must be available.  If all your uses of a
13684 function are expanded inline, this may mean an additional expansion of
13685 code size.  If you use @samp{extern inline} in your C code, an
13686 addressable version of such functions must be provided.  (This is
13687 normally the case anyways, but if you get lucky and the optimizer always
13688 expands the functions inline, you might have gotten away without
13689 providing static copies.)
13691 A function may be given the attribute @code{no_instrument_function}, in
13692 which case this instrumentation will not be done.  This can be used, for
13693 example, for the profiling functions listed above, high-priority
13694 interrupt routines, and any functions from which the profiling functions
13695 cannot safely be called (perhaps signal handlers, if the profiling
13696 routines generate output or allocate memory).
13698 @item -fstack-check
13699 @opindex fstack-check
13700 Generate code to verify that you do not go beyond the boundary of the
13701 stack.  You should specify this flag if you are running in an
13702 environment with multiple threads, but only rarely need to specify it in
13703 a single-threaded environment since stack overflow is automatically
13704 detected on nearly all systems if there is only one stack.
13706 Note that this switch does not actually cause checking to be done; the
13707 operating system must do that.  The switch causes generation of code
13708 to ensure that the operating system sees the stack being extended.
13710 @item -fstack-limit-register=@var{reg}
13711 @itemx -fstack-limit-symbol=@var{sym}
13712 @itemx -fno-stack-limit
13713 @opindex fstack-limit-register
13714 @opindex fstack-limit-symbol
13715 @opindex fno-stack-limit
13716 Generate code to ensure that the stack does not grow beyond a certain value,
13717 either the value of a register or the address of a symbol.  If the stack
13718 would grow beyond the value, a signal is raised.  For most targets,
13719 the signal is raised before the stack overruns the boundary, so
13720 it is possible to catch the signal without taking special precautions.
13722 For instance, if the stack starts at absolute address @samp{0x80000000}
13723 and grows downwards, you can use the flags
13724 @option{-fstack-limit-symbol=__stack_limit} and
13725 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
13726 of 128KB@.  Note that this may only work with the GNU linker.
13728 @cindex aliasing of parameters
13729 @cindex parameters, aliased
13730 @item -fargument-alias
13731 @itemx -fargument-noalias
13732 @itemx -fargument-noalias-global
13733 @itemx -fargument-noalias-anything
13734 @opindex fargument-alias
13735 @opindex fargument-noalias
13736 @opindex fargument-noalias-global
13737 @opindex fargument-noalias-anything
13738 Specify the possible relationships among parameters and between
13739 parameters and global data.
13741 @option{-fargument-alias} specifies that arguments (parameters) may
13742 alias each other and may alias global storage.@*
13743 @option{-fargument-noalias} specifies that arguments do not alias
13744 each other, but may alias global storage.@*
13745 @option{-fargument-noalias-global} specifies that arguments do not
13746 alias each other and do not alias global storage.
13747 @option{-fargument-noalias-anything} specifies that arguments do not
13748 alias any other storage.
13750 Each language will automatically use whatever option is required by
13751 the language standard.  You should not need to use these options yourself.
13753 @item -fleading-underscore
13754 @opindex fleading-underscore
13755 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
13756 change the way C symbols are represented in the object file.  One use
13757 is to help link with legacy assembly code.
13759 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
13760 generate code that is not binary compatible with code generated without that
13761 switch.  Use it to conform to a non-default application binary interface.
13762 Not all targets provide complete support for this switch.
13764 @item -ftls-model=@var{model}
13765 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
13766 The @var{model} argument should be one of @code{global-dynamic},
13767 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
13769 The default without @option{-fpic} is @code{initial-exec}; with
13770 @option{-fpic} the default is @code{global-dynamic}.
13772 @item -fvisibility=@var{default|internal|hidden|protected}
13773 @opindex fvisibility
13774 Set the default ELF image symbol visibility to the specified option---all
13775 symbols will be marked with this unless overridden within the code.
13776 Using this feature can very substantially improve linking and
13777 load times of shared object libraries, produce more optimized
13778 code, provide near-perfect API export and prevent symbol clashes.
13779 It is @strong{strongly} recommended that you use this in any shared objects
13780 you distribute.
13782 Despite the nomenclature, @code{default} always means public ie;
13783 available to be linked against from outside the shared object.
13784 @code{protected} and @code{internal} are pretty useless in real-world
13785 usage so the only other commonly used option will be @code{hidden}.
13786 The default if @option{-fvisibility} isn't specified is
13787 @code{default}, i.e., make every
13788 symbol public---this causes the same behavior as previous versions of
13789 GCC@.
13791 A good explanation of the benefits offered by ensuring ELF
13792 symbols have the correct visibility is given by ``How To Write
13793 Shared Libraries'' by Ulrich Drepper (which can be found at
13794 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
13795 solution made possible by this option to marking things hidden when
13796 the default is public is to make the default hidden and mark things
13797 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
13798 and @code{__attribute__ ((visibility("default")))} instead of
13799 @code{__declspec(dllexport)} you get almost identical semantics with
13800 identical syntax.  This is a great boon to those working with
13801 cross-platform projects.
13803 For those adding visibility support to existing code, you may find
13804 @samp{#pragma GCC visibility} of use.  This works by you enclosing
13805 the declarations you wish to set visibility for with (for example)
13806 @samp{#pragma GCC visibility push(hidden)} and
13807 @samp{#pragma GCC visibility pop}.
13808 Bear in mind that symbol visibility should be viewed @strong{as
13809 part of the API interface contract} and thus all new code should
13810 always specify visibility when it is not the default ie; declarations
13811 only for use within the local DSO should @strong{always} be marked explicitly
13812 as hidden as so to avoid PLT indirection overheads---making this
13813 abundantly clear also aids readability and self-documentation of the code.
13814 Note that due to ISO C++ specification requirements, operator new and
13815 operator delete must always be of default visibility.
13817 Be aware that headers from outside your project, in particular system
13818 headers and headers from any other library you use, may not be
13819 expecting to be compiled with visibility other than the default.  You
13820 may need to explicitly say @samp{#pragma GCC visibility push(default)}
13821 before including any such headers.
13823 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
13824 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
13825 no modifications.  However, this means that calls to @samp{extern}
13826 functions with no explicit visibility will use the PLT, so it is more
13827 effective to use @samp{__attribute ((visibility))} and/or
13828 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
13829 declarations should be treated as hidden.
13831 Note that @samp{-fvisibility} does affect C++ vague linkage
13832 entities. This means that, for instance, an exception class that will
13833 be thrown between DSOs must be explicitly marked with default
13834 visibility so that the @samp{type_info} nodes will be unified between
13835 the DSOs.
13837 An overview of these techniques, their benefits and how to use them
13838 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
13840 @end table
13842 @c man end
13844 @node Environment Variables
13845 @section Environment Variables Affecting GCC
13846 @cindex environment variables
13848 @c man begin ENVIRONMENT
13849 This section describes several environment variables that affect how GCC
13850 operates.  Some of them work by specifying directories or prefixes to use
13851 when searching for various kinds of files.  Some are used to specify other
13852 aspects of the compilation environment.
13854 Note that you can also specify places to search using options such as
13855 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
13856 take precedence over places specified using environment variables, which
13857 in turn take precedence over those specified by the configuration of GCC@.
13858 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
13859 GNU Compiler Collection (GCC) Internals}.
13861 @table @env
13862 @item LANG
13863 @itemx LC_CTYPE
13864 @c @itemx LC_COLLATE
13865 @itemx LC_MESSAGES
13866 @c @itemx LC_MONETARY
13867 @c @itemx LC_NUMERIC
13868 @c @itemx LC_TIME
13869 @itemx LC_ALL
13870 @findex LANG
13871 @findex LC_CTYPE
13872 @c @findex LC_COLLATE
13873 @findex LC_MESSAGES
13874 @c @findex LC_MONETARY
13875 @c @findex LC_NUMERIC
13876 @c @findex LC_TIME
13877 @findex LC_ALL
13878 @cindex locale
13879 These environment variables control the way that GCC uses
13880 localization information that allow GCC to work with different
13881 national conventions.  GCC inspects the locale categories
13882 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
13883 so.  These locale categories can be set to any value supported by your
13884 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
13885 Kingdom encoded in UTF-8.
13887 The @env{LC_CTYPE} environment variable specifies character
13888 classification.  GCC uses it to determine the character boundaries in
13889 a string; this is needed for some multibyte encodings that contain quote
13890 and escape characters that would otherwise be interpreted as a string
13891 end or escape.
13893 The @env{LC_MESSAGES} environment variable specifies the language to
13894 use in diagnostic messages.
13896 If the @env{LC_ALL} environment variable is set, it overrides the value
13897 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
13898 and @env{LC_MESSAGES} default to the value of the @env{LANG}
13899 environment variable.  If none of these variables are set, GCC
13900 defaults to traditional C English behavior.
13902 @item TMPDIR
13903 @findex TMPDIR
13904 If @env{TMPDIR} is set, it specifies the directory to use for temporary
13905 files.  GCC uses temporary files to hold the output of one stage of
13906 compilation which is to be used as input to the next stage: for example,
13907 the output of the preprocessor, which is the input to the compiler
13908 proper.
13910 @item GCC_EXEC_PREFIX
13911 @findex GCC_EXEC_PREFIX
13912 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
13913 names of the subprograms executed by the compiler.  No slash is added
13914 when this prefix is combined with the name of a subprogram, but you can
13915 specify a prefix that ends with a slash if you wish.
13917 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
13918 an appropriate prefix to use based on the pathname it was invoked with.
13920 If GCC cannot find the subprogram using the specified prefix, it
13921 tries looking in the usual places for the subprogram.
13923 The default value of @env{GCC_EXEC_PREFIX} is
13924 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the value
13925 of @code{prefix} when you ran the @file{configure} script.
13927 Other prefixes specified with @option{-B} take precedence over this prefix.
13929 This prefix is also used for finding files such as @file{crt0.o} that are
13930 used for linking.
13932 In addition, the prefix is used in an unusual way in finding the
13933 directories to search for header files.  For each of the standard
13934 directories whose name normally begins with @samp{/usr/local/lib/gcc}
13935 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
13936 replacing that beginning with the specified prefix to produce an
13937 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
13938 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
13939 These alternate directories are searched first; the standard directories
13940 come next.
13942 @item COMPILER_PATH
13943 @findex COMPILER_PATH
13944 The value of @env{COMPILER_PATH} is a colon-separated list of
13945 directories, much like @env{PATH}.  GCC tries the directories thus
13946 specified when searching for subprograms, if it can't find the
13947 subprograms using @env{GCC_EXEC_PREFIX}.
13949 @item LIBRARY_PATH
13950 @findex LIBRARY_PATH
13951 The value of @env{LIBRARY_PATH} is a colon-separated list of
13952 directories, much like @env{PATH}.  When configured as a native compiler,
13953 GCC tries the directories thus specified when searching for special
13954 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
13955 using GCC also uses these directories when searching for ordinary
13956 libraries for the @option{-l} option (but directories specified with
13957 @option{-L} come first).
13959 @item LANG
13960 @findex LANG
13961 @cindex locale definition
13962 This variable is used to pass locale information to the compiler.  One way in
13963 which this information is used is to determine the character set to be used
13964 when character literals, string literals and comments are parsed in C and C++.
13965 When the compiler is configured to allow multibyte characters,
13966 the following values for @env{LANG} are recognized:
13968 @table @samp
13969 @item C-JIS
13970 Recognize JIS characters.
13971 @item C-SJIS
13972 Recognize SJIS characters.
13973 @item C-EUCJP
13974 Recognize EUCJP characters.
13975 @end table
13977 If @env{LANG} is not defined, or if it has some other value, then the
13978 compiler will use mblen and mbtowc as defined by the default locale to
13979 recognize and translate multibyte characters.
13980 @end table
13982 @noindent
13983 Some additional environments variables affect the behavior of the
13984 preprocessor.
13986 @include cppenv.texi
13988 @c man end
13990 @node Precompiled Headers
13991 @section Using Precompiled Headers
13992 @cindex precompiled headers
13993 @cindex speed of compilation
13995 Often large projects have many header files that are included in every
13996 source file.  The time the compiler takes to process these header files
13997 over and over again can account for nearly all of the time required to
13998 build the project.  To make builds faster, GCC allows users to
13999 `precompile' a header file; then, if builds can use the precompiled
14000 header file they will be much faster.
14002 To create a precompiled header file, simply compile it as you would any
14003 other file, if necessary using the @option{-x} option to make the driver
14004 treat it as a C or C++ header file.  You will probably want to use a
14005 tool like @command{make} to keep the precompiled header up-to-date when
14006 the headers it contains change.
14008 A precompiled header file will be searched for when @code{#include} is
14009 seen in the compilation.  As it searches for the included file
14010 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
14011 compiler looks for a precompiled header in each directory just before it
14012 looks for the include file in that directory.  The name searched for is
14013 the name specified in the @code{#include} with @samp{.gch} appended.  If
14014 the precompiled header file can't be used, it is ignored.
14016 For instance, if you have @code{#include "all.h"}, and you have
14017 @file{all.h.gch} in the same directory as @file{all.h}, then the
14018 precompiled header file will be used if possible, and the original
14019 header will be used otherwise.
14021 Alternatively, you might decide to put the precompiled header file in a
14022 directory and use @option{-I} to ensure that directory is searched
14023 before (or instead of) the directory containing the original header.
14024 Then, if you want to check that the precompiled header file is always
14025 used, you can put a file of the same name as the original header in this
14026 directory containing an @code{#error} command.
14028 This also works with @option{-include}.  So yet another way to use
14029 precompiled headers, good for projects not designed with precompiled
14030 header files in mind, is to simply take most of the header files used by
14031 a project, include them from another header file, precompile that header
14032 file, and @option{-include} the precompiled header.  If the header files
14033 have guards against multiple inclusion, they will be skipped because
14034 they've already been included (in the precompiled header).
14036 If you need to precompile the same header file for different
14037 languages, targets, or compiler options, you can instead make a
14038 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14039 header in the directory, perhaps using @option{-o}.  It doesn't matter
14040 what you call the files in the directory, every precompiled header in
14041 the directory will be considered.  The first precompiled header
14042 encountered in the directory that is valid for this compilation will
14043 be used; they're searched in no particular order.
14045 There are many other possibilities, limited only by your imagination,
14046 good sense, and the constraints of your build system.
14048 A precompiled header file can be used only when these conditions apply:
14050 @itemize
14051 @item
14052 Only one precompiled header can be used in a particular compilation.
14054 @item
14055 A precompiled header can't be used once the first C token is seen.  You
14056 can have preprocessor directives before a precompiled header; you can
14057 even include a precompiled header from inside another header, so long as
14058 there are no C tokens before the @code{#include}.
14060 @item
14061 The precompiled header file must be produced for the same language as
14062 the current compilation.  You can't use a C precompiled header for a C++
14063 compilation.
14065 @item
14066 The precompiled header file must have been produced by the same compiler
14067 binary as the current compilation is using.
14069 @item
14070 Any macros defined before the precompiled header is included must
14071 either be defined in the same way as when the precompiled header was
14072 generated, or must not affect the precompiled header, which usually
14073 means that they don't appear in the precompiled header at all.
14075 The @option{-D} option is one way to define a macro before a
14076 precompiled header is included; using a @code{#define} can also do it.
14077 There are also some options that define macros implicitly, like
14078 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14079 defined this way.
14081 @item If debugging information is output when using the precompiled
14082 header, using @option{-g} or similar, the same kind of debugging information
14083 must have been output when building the precompiled header.  However,
14084 a precompiled header built using @option{-g} can be used in a compilation
14085 when no debugging information is being output.
14087 @item The same @option{-m} options must generally be used when building
14088 and using the precompiled header.  @xref{Submodel Options},
14089 for any cases where this rule is relaxed.
14091 @item Each of the following options must be the same when building and using
14092 the precompiled header:
14094 @gccoptlist{-fexceptions -funit-at-a-time}
14096 @item
14097 Some other command-line options starting with @option{-f},
14098 @option{-p}, or @option{-O} must be defined in the same way as when
14099 the precompiled header was generated.  At present, it's not clear
14100 which options are safe to change and which are not; the safest choice
14101 is to use exactly the same options when generating and using the
14102 precompiled header.  The following are known to be safe:
14104 @gccoptlist{-fmessage-length= -fpreprocessed
14105 -fsched-interblock -fsched-spec -fsched-spec-load -fsched-spec-load-dangerous
14106 -fsched-verbose=<number> -fschedule-insns -fvisibility=
14107 -pedantic-errors}
14109 @end itemize
14111 For all of these except the last, the compiler will automatically
14112 ignore the precompiled header if the conditions aren't met.  If you
14113 find an option combination that doesn't work and doesn't cause the
14114 precompiled header to be ignored, please consider filing a bug report,
14115 see @ref{Bugs}.
14117 If you do use differing options when generating and using the
14118 precompiled header, the actual behavior will be a mixture of the
14119 behavior for the options.  For instance, if you use @option{-g} to
14120 generate the precompiled header but not when using it, you may or may
14121 not get debugging information for routines in the precompiled header.
14123 @node Running Protoize
14124 @section Running Protoize
14126 The program @code{protoize} is an optional part of GCC@.  You can use
14127 it to add prototypes to a program, thus converting the program to ISO
14128 C in one respect.  The companion program @code{unprotoize} does the
14129 reverse: it removes argument types from any prototypes that are found.
14131 When you run these programs, you must specify a set of source files as
14132 command line arguments.  The conversion programs start out by compiling
14133 these files to see what functions they define.  The information gathered
14134 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
14136 After scanning comes actual conversion.  The specified files are all
14137 eligible to be converted; any files they include (whether sources or
14138 just headers) are eligible as well.
14140 But not all the eligible files are converted.  By default,
14141 @code{protoize} and @code{unprotoize} convert only source and header
14142 files in the current directory.  You can specify additional directories
14143 whose files should be converted with the @option{-d @var{directory}}
14144 option.  You can also specify particular files to exclude with the
14145 @option{-x @var{file}} option.  A file is converted if it is eligible, its
14146 directory name matches one of the specified directory names, and its
14147 name within the directory has not been excluded.
14149 Basic conversion with @code{protoize} consists of rewriting most
14150 function definitions and function declarations to specify the types of
14151 the arguments.  The only ones not rewritten are those for varargs
14152 functions.
14154 @code{protoize} optionally inserts prototype declarations at the
14155 beginning of the source file, to make them available for any calls that
14156 precede the function's definition.  Or it can insert prototype
14157 declarations with block scope in the blocks where undeclared functions
14158 are called.
14160 Basic conversion with @code{unprotoize} consists of rewriting most
14161 function declarations to remove any argument types, and rewriting
14162 function definitions to the old-style pre-ISO form.
14164 Both conversion programs print a warning for any function declaration or
14165 definition that they can't convert.  You can suppress these warnings
14166 with @option{-q}.
14168 The output from @code{protoize} or @code{unprotoize} replaces the
14169 original source file.  The original file is renamed to a name ending
14170 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
14171 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
14172 for DOS) file already exists, then the source file is simply discarded.
14174 @code{protoize} and @code{unprotoize} both depend on GCC itself to
14175 scan the program and collect information about the functions it uses.
14176 So neither of these programs will work until GCC is installed.
14178 Here is a table of the options you can use with @code{protoize} and
14179 @code{unprotoize}.  Each option works with both programs unless
14180 otherwise stated.
14182 @table @code
14183 @item -B @var{directory}
14184 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
14185 usual directory (normally @file{/usr/local/lib}).  This file contains
14186 prototype information about standard system functions.  This option
14187 applies only to @code{protoize}.
14189 @item -c @var{compilation-options}
14190 Use @var{compilation-options} as the options when running @command{gcc} to
14191 produce the @samp{.X} files.  The special option @option{-aux-info} is
14192 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
14194 Note that the compilation options must be given as a single argument to
14195 @code{protoize} or @code{unprotoize}.  If you want to specify several
14196 @command{gcc} options, you must quote the entire set of compilation options
14197 to make them a single word in the shell.
14199 There are certain @command{gcc} arguments that you cannot use, because they
14200 would produce the wrong kind of output.  These include @option{-g},
14201 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
14202 the @var{compilation-options}, they are ignored.
14204 @item -C
14205 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
14206 systems) instead of @samp{.c}.  This is convenient if you are converting
14207 a C program to C++.  This option applies only to @code{protoize}.
14209 @item -g
14210 Add explicit global declarations.  This means inserting explicit
14211 declarations at the beginning of each source file for each function
14212 that is called in the file and was not declared.  These declarations
14213 precede the first function definition that contains a call to an
14214 undeclared function.  This option applies only to @code{protoize}.
14216 @item -i @var{string}
14217 Indent old-style parameter declarations with the string @var{string}.
14218 This option applies only to @code{protoize}.
14220 @code{unprotoize} converts prototyped function definitions to old-style
14221 function definitions, where the arguments are declared between the
14222 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
14223 uses five spaces as the indentation.  If you want to indent with just
14224 one space instead, use @option{-i " "}.
14226 @item -k
14227 Keep the @samp{.X} files.  Normally, they are deleted after conversion
14228 is finished.
14230 @item -l
14231 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
14232 a prototype declaration for each function in each block which calls the
14233 function without any declaration.  This option applies only to
14234 @code{protoize}.
14236 @item -n
14237 Make no real changes.  This mode just prints information about the conversions
14238 that would have been done without @option{-n}.
14240 @item -N
14241 Make no @samp{.save} files.  The original files are simply deleted.
14242 Use this option with caution.
14244 @item -p @var{program}
14245 Use the program @var{program} as the compiler.  Normally, the name
14246 @file{gcc} is used.
14248 @item -q
14249 Work quietly.  Most warnings are suppressed.
14251 @item -v
14252 Print the version number, just like @option{-v} for @command{gcc}.
14253 @end table
14255 If you need special compiler options to compile one of your program's
14256 source files, then you should generate that file's @samp{.X} file
14257 specially, by running @command{gcc} on that source file with the
14258 appropriate options and the option @option{-aux-info}.  Then run
14259 @code{protoize} on the entire set of files.  @code{protoize} will use
14260 the existing @samp{.X} file because it is newer than the source file.
14261 For example:
14263 @smallexample
14264 gcc -Dfoo=bar file1.c -aux-info file1.X
14265 protoize *.c
14266 @end smallexample
14268 @noindent
14269 You need to include the special files along with the rest in the
14270 @code{protoize} command, even though their @samp{.X} files already
14271 exist, because otherwise they won't get converted.
14273 @xref{Protoize Caveats}, for more information on how to use
14274 @code{protoize} successfully.