OSDN Git Service

* toplev.c (dump_memory_report): Break out from...
[pf3gnuchains/gcc-fork.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
3 @c This is part of the GCC manual.
4 @c For copying conditions, see the file gcc.texi.
5
6 @ignore
7 @c man begin INCLUDE
8 @include gcc-vers.texi
9 @c man end
10
11 @c man begin COPYRIGHT
12 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
13 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
14
15 Permission is granted to copy, distribute and/or modify this document
16 under the terms of the GNU Free Documentation License, Version 1.2 or
17 any later version published by the Free Software Foundation; with the
18 Invariant Sections being ``GNU General Public License'' and ``Funding
19 Free Software'', the Front-Cover texts being (a) (see below), and with
20 the Back-Cover Texts being (b) (see below).  A copy of the license is
21 included in the gfdl(7) man page.
22
23 (a) The FSF's Front-Cover Text is:
24
25      A GNU Manual
26
27 (b) The FSF's Back-Cover Text is:
28
29      You have freedom to copy and modify this GNU Manual, like GNU
30      software.  Copies published by the Free Software Foundation raise
31      funds for GNU development.
32 @c man end
33 @c Set file name and title for the man page.
34 @setfilename gcc
35 @settitle GNU project C and C++ compiler
36 @c man begin SYNOPSIS
37 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
38     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
39     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
40     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
41     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
42     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
43     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
44
45 Only the most useful options are listed here; see below for the
46 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
47 @c man end
48 @c man begin SEEALSO
49 gpl(7), gfdl(7), fsf-funding(7),
50 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
51 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
52 @file{ld}, @file{binutils} and @file{gdb}.
53 @c man end
54 @c man begin BUGS
55 For instructions on reporting bugs, see
56 @w{@uref{http://gcc.gnu.org/bugs.html}}.
57 @c man end
58 @c man begin AUTHOR
59 See the Info entry for @command{gcc}, or
60 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
61 for contributors to GCC@.
62 @c man end
63 @end ignore
64
65 @node Invoking GCC
66 @chapter GCC Command Options
67 @cindex GCC command options
68 @cindex command options
69 @cindex options, GCC command
70
71 @c man begin DESCRIPTION
72 When you invoke GCC, it normally does preprocessing, compilation,
73 assembly and linking.  The ``overall options'' allow you to stop this
74 process at an intermediate stage.  For example, the @option{-c} option
75 says not to run the linker.  Then the output consists of object files
76 output by the assembler.
77
78 Other options are passed on to one stage of processing.  Some options
79 control the preprocessor and others the compiler itself.  Yet other
80 options control the assembler and linker; most of these are not
81 documented here, since you rarely need to use any of them.
82
83 @cindex C compilation options
84 Most of the command line options that you can use with GCC are useful
85 for C programs; when an option is only useful with another language
86 (usually C++), the explanation says so explicitly.  If the description
87 for a particular option does not mention a source language, you can use
88 that option with all supported languages.
89
90 @cindex C++ compilation options
91 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
92 options for compiling C++ programs.
93
94 @cindex grouping options
95 @cindex options, grouping
96 The @command{gcc} program accepts options and file names as operands.  Many
97 options have multi-letter names; therefore multiple single-letter options
98 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
99 -r}}.
100
101 @cindex order of options
102 @cindex options, order
103 You can mix options and other arguments.  For the most part, the order
104 you use doesn't matter.  Order does matter when you use several options
105 of the same kind; for example, if you specify @option{-L} more than once,
106 the directories are searched in the order specified.
107
108 Many options have long names starting with @samp{-f} or with
109 @samp{-W}---for example, 
110 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
111 these have both positive and negative forms; the negative form of
112 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
113 only one of these two forms, whichever one is not the default.
114
115 @c man end
116
117 @xref{Option Index}, for an index to GCC's options.
118
119 @menu
120 * Option Summary::      Brief list of all options, without explanations.
121 * Overall Options::     Controlling the kind of output:
122                         an executable, object files, assembler files,
123                         or preprocessed source.
124 * Invoking G++::        Compiling C++ programs.
125 * C Dialect Options::   Controlling the variant of C language compiled.
126 * C++ Dialect Options:: Variations on C++.
127 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
128                         and Objective-C++.
129 * Language Independent Options:: Controlling how diagnostics should be
130                         formatted.
131 * Warning Options::     How picky should the compiler be?
132 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
133 * Optimize Options::    How much optimization?
134 * Preprocessor Options:: Controlling header files and macro definitions.
135                          Also, getting dependency information for Make.
136 * Assembler Options::   Passing options to the assembler.
137 * Link Options::        Specifying libraries and so on.
138 * Directory Options::   Where to find header files and libraries.
139                         Where to find the compiler executable files.
140 * Spec Files::          How to pass switches to sub-processes.
141 * Target Options::      Running a cross-compiler, or an old version of GCC.
142 * Submodel Options::    Specifying minor hardware or convention variations,
143                         such as 68010 vs 68020.
144 * Code Gen Options::    Specifying conventions for function calls, data layout
145                         and register usage.
146 * Environment Variables:: Env vars that affect GCC.
147 * Precompiled Headers:: Compiling a header once, and using it many times.
148 * Running Protoize::    Automatically adding or removing function prototypes.
149 @end menu
150
151 @c man begin OPTIONS
152
153 @node Option Summary
154 @section Option Summary
155
156 Here is a summary of all the options, grouped by type.  Explanations are
157 in the following sections.
158
159 @table @emph
160 @item Overall Options
161 @xref{Overall Options,,Options Controlling the Kind of Output}.
162 @gccoptlist{-c  -S  -E  -o @var{file}  -combine -pipe  -pass-exit-codes  @gol
163 -x @var{language}  -v  -###  --help  --target-help  --version @@@var{file}}
164
165 @item C Language Options
166 @xref{C Dialect Options,,Options Controlling C Dialect}.
167 @gccoptlist{-ansi  -std=@var{standard}  -aux-info @var{filename} @gol
168 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
169 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
170 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
171 -fallow-single-precision  -fcond-mismatch @gol
172 -fsigned-bitfields  -fsigned-char @gol
173 -funsigned-bitfields  -funsigned-char}
174
175 @item C++ Language Options
176 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
177 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
178 -fconserve-space  -ffriend-injection @gol
179 -fno-elide-constructors @gol
180 -fno-enforce-eh-specs @gol
181 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
182 -fno-implicit-templates @gol
183 -fno-implicit-inline-templates @gol
184 -fno-implement-inlines  -fms-extensions @gol
185 -fno-nonansi-builtins  -fno-operator-names @gol
186 -fno-optional-diags  -fpermissive @gol
187 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
188 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
189 -fno-default-inline  -fvisibility-inlines-hidden @gol
190 -Wabi  -Wctor-dtor-privacy @gol
191 -Wnon-virtual-dtor  -Wreorder @gol
192 -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel @gol
193 -Wno-non-template-friend  -Wold-style-cast @gol
194 -Woverloaded-virtual  -Wno-pmf-conversions @gol
195 -Wsign-promo}
196
197 @item Objective-C and Objective-C++ Language Options
198 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
199 Objective-C and Objective-C++ Dialects}.
200 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
201 -fgnu-runtime  -fnext-runtime @gol
202 -fno-nil-receivers @gol
203 -fobjc-call-cxx-cdtors @gol
204 -fobjc-direct-dispatch @gol
205 -fobjc-exceptions @gol
206 -fobjc-gc @gol
207 -freplace-objc-classes @gol
208 -fzero-link @gol
209 -gen-decls @gol
210 -Wassign-intercept @gol
211 -Wno-protocol  -Wselector @gol
212 -Wstrict-selector-match @gol
213 -Wundeclared-selector}
214
215 @item Language Independent Options
216 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
217 @gccoptlist{-fmessage-length=@var{n}  @gol
218 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
219 -fdiagnostics-show-option}
220
221 @item Warning Options
222 @xref{Warning Options,,Options to Request or Suppress Warnings}.
223 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
224 -w  -Wextra  -Wall  -Waggregate-return -Walways-true -Wno-attributes @gol
225 -Wc++-compat -Wcast-align  -Wcast-qual  -Wchar-subscripts @gol
226 -Wclobbered  -Wcomment @gol
227 -Wconversion  -Wno-deprecated-declarations @gol
228 -Wdisabled-optimization  -Wno-div-by-zero  @gol
229 -Wempty-body  -Wno-endif-labels @gol
230 -Werror  -Werror-* -Werror-implicit-function-declaration @gol
231 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
232 -Wno-format-extra-args -Wformat-nonliteral @gol
233 -Wformat-security  -Wformat-y2k @gol
234 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
235 -Wimport  -Wno-import  -Winit-self  -Winline @gol
236 -Wno-int-to-pointer-cast @gol
237 -Wno-invalid-offsetof  -Winvalid-pch @gol
238 -Wlarger-than-@var{len}  -Wunsafe-loop-optimizations  -Wlong-long @gol
239 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
240 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
241 -Wmissing-noreturn @gol
242 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
243 -Woverlength-strings  -Wpacked  -Wpadded @gol
244 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
245 -Wredundant-decls @gol
246 -Wreturn-type  -Wsequence-point  -Wshadow @gol
247 -Wsign-compare  -Wstack-protector @gol
248 -Wstrict-aliasing -Wstrict-aliasing=2 @gol
249 -Wstring-literal-comparison @gol
250 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
251 -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
252 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
253 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
254 -Wunused-value  -Wunused-variable  -Wvariadic-macros @gol
255 -Wvolatile-register-var  -Wwrite-strings}
256
257 @item C-only Warning Options
258 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
259 -Wmissing-prototypes  -Wnested-externs  -Wold-style-definition @gol
260 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
261 -Wdeclaration-after-statement -Wpointer-sign}
262
263 @item Debugging Options
264 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
265 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
266 -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
267 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
268 -fdump-ipa-all -fdump-ipa-cgraph @gol
269 -fdump-tree-all @gol
270 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
271 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
272 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
273 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
274 -fdump-tree-ch @gol
275 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
276 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
277 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
278 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
279 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
280 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
281 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
282 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
283 -fdump-tree-nrv -fdump-tree-vect @gol
284 -fdump-tree-sink @gol
285 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-salias @gol
287 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
288 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
289 -ftree-vectorizer-verbose=@var{n} @gol
290 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
291 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
292 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
293 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
294 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
295 -ftest-coverage  -ftime-report -fvar-tracking @gol
296 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
297 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
298 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
299 -print-multi-directory  -print-multi-lib @gol
300 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
301 -save-temps  -time}
302
303 @item Optimization Options
304 @xref{Optimize Options,,Options that Control Optimization}.
305 @gccoptlist{-falign-functions=@var{n}  -falign-jumps=@var{n} @gol
306 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
307 -fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
308 -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
309 -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
310 -fcaller-saves  -fcprop-registers  -fcse-follow-jumps @gol
311 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
312 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
313 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
314 -fforce-addr  -fforward-propagate  -ffunction-sections @gol
315 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
316 -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
317 -finline-functions  -finline-functions-called-once @gol
318 -finline-limit=@var{n}  -fkeep-inline-functions @gol
319 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
320 -fmodulo-sched -fno-branch-count-reg @gol
321 -fno-default-inline  -fno-defer-pop -fmove-loop-invariants @gol
322 -fno-function-cse  -fno-guess-branch-probability @gol
323 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
324 -funsafe-math-optimizations  -funsafe-loop-optimizations  -ffinite-math-only @gol
325 -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss @gol
326 -fomit-frame-pointer  -foptimize-register-move @gol
327 -foptimize-sibling-calls  -fprefetch-loop-arrays @gol
328 -fprofile-generate -fprofile-use @gol
329 -fregmove  -frename-registers @gol
330 -freorder-blocks  -freorder-blocks-and-partition -freorder-functions @gol
331 -frerun-cse-after-loop @gol
332 -frounding-math -frtl-abstract-sequences @gol
333 -fschedule-insns  -fschedule-insns2 @gol
334 -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load @gol
335 -fsched-spec-load-dangerous  @gol
336 -fsched-stalled-insns=@var{n} -fsched-stalled-insns-dep=@var{n} @gol
337 -fsched2-use-superblocks @gol
338 -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops @gol
339 -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant @gol
340 -fstack-protector  -fstack-protector-all @gol
341 -fstrict-aliasing  -ftracer  -fthread-jumps @gol
342 -funroll-all-loops  -funroll-loops  -fpeel-loops @gol
343 -fsplit-ivs-in-unroller -funswitch-loops @gol
344 -fvariable-expansion-in-unroller @gol
345 -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize @gol
346 -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
347 -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol
348 -ftree-ch -ftree-sra -ftree-ter -ftree-lrs -ftree-fre -ftree-vectorize @gol
349 -ftree-vect-loop-version -ftree-salias -fipa-pta -fweb @gol
350 -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program @gol
351 --param @var{name}=@var{value}
352 -O  -O0  -O1  -O2  -O3  -Os}
353
354 @item Preprocessor Options
355 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
356 @gccoptlist{-A@var{question}=@var{answer} @gol
357 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
358 -C  -dD  -dI  -dM  -dN @gol
359 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
360 -idirafter @var{dir} @gol
361 -include @var{file}  -imacros @var{file} @gol
362 -iprefix @var{file}  -iwithprefix @var{dir} @gol
363 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
364 -imultilib @var{dir} -isysroot @var{dir} @gol
365 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
366 -P  -fworking-directory  -remap @gol
367 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
368 -Xpreprocessor @var{option}}
369
370 @item Assembler Option
371 @xref{Assembler Options,,Passing Options to the Assembler}.
372 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
373
374 @item Linker Options
375 @xref{Link Options,,Options for Linking}.
376 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
377 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
378 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
379 -Wl,@var{option}  -Xlinker @var{option} @gol
380 -u @var{symbol}}
381
382 @item Directory Options
383 @xref{Directory Options,,Options for Directory Search}.
384 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
385 -specs=@var{file}  -I- --sysroot=@var{dir}}
386
387 @item Target Options
388 @c I wrote this xref this way to avoid overfull hbox. -- rms
389 @xref{Target Options}.
390 @gccoptlist{-V @var{version}  -b @var{machine}}
391
392 @item Machine Dependent Options
393 @xref{Submodel Options,,Hardware Models and Configurations}.
394 @c This list is ordered alphanumerically by subsection name.
395 @c Try and put the significant identifier (CPU or system) first,
396 @c so users have a clue at guessing where the ones they want will be.
397
398 @emph{ARC Options}
399 @gccoptlist{-EB  -EL @gol
400 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
401 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
402
403 @emph{ARM Options}
404 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
405 -mabi=@var{name} @gol
406 -mapcs-stack-check  -mno-apcs-stack-check @gol
407 -mapcs-float  -mno-apcs-float @gol
408 -mapcs-reentrant  -mno-apcs-reentrant @gol
409 -msched-prolog  -mno-sched-prolog @gol
410 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
411 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
412 -mthumb-interwork  -mno-thumb-interwork @gol
413 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
414 -mstructure-size-boundary=@var{n} @gol
415 -mabort-on-noreturn @gol
416 -mlong-calls  -mno-long-calls @gol
417 -msingle-pic-base  -mno-single-pic-base @gol
418 -mpic-register=@var{reg} @gol
419 -mnop-fun-dllimport @gol
420 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
421 -mpoke-function-name @gol
422 -mthumb  -marm @gol
423 -mtpcs-frame  -mtpcs-leaf-frame @gol
424 -mcaller-super-interworking  -mcallee-super-interworking @gol
425 -mtp=@var{name}}
426
427 @emph{AVR Options}
428 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
429 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
430
431 @emph{Blackfin Options}
432 @gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer @gol
433 -mspecld-anomaly -mno-specld-anomaly -mcsync-anomaly -mno-csync-anomaly @gol
434 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
435 -mno-id-shared-library -mshared-library-id=@var{n} @gol
436 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
437 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls}
438
439 @emph{CRIS Options}
440 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
441 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
442 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
443 -mstack-align  -mdata-align  -mconst-align @gol
444 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
445 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
446 -mmul-bug-workaround  -mno-mul-bug-workaround}
447
448 @emph{CRX Options}
449 @gccoptlist{-mmac -mpush-args}
450
451 @emph{Darwin Options}
452 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
453 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
454 -client_name  -compatibility_version  -current_version @gol
455 -dead_strip @gol
456 -dependency-file  -dylib_file  -dylinker_install_name @gol
457 -dynamic  -dynamiclib  -exported_symbols_list @gol
458 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
459 -force_flat_namespace  -headerpad_max_install_names @gol
460 -image_base  -init  -install_name  -keep_private_externs @gol
461 -multi_module  -multiply_defined  -multiply_defined_unused @gol
462 -noall_load   -no_dead_strip_inits_and_terms @gol
463 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
464 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
465 -private_bundle  -read_only_relocs  -sectalign @gol
466 -sectobjectsymbols  -whyload  -seg1addr @gol
467 -sectcreate  -sectobjectsymbols  -sectorder @gol
468 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
469 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
470 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
471 -single_module  -static  -sub_library  -sub_umbrella @gol
472 -twolevel_namespace  -umbrella  -undefined @gol
473 -unexported_symbols_list  -weak_reference_mismatches @gol
474 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
475 -mkernel -mone-byte-bool}
476
477 @emph{DEC Alpha Options}
478 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
479 -mieee  -mieee-with-inexact  -mieee-conformant @gol
480 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
481 -mtrap-precision=@var{mode}  -mbuild-constants @gol
482 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
483 -mbwx  -mmax  -mfix  -mcix @gol
484 -mfloat-vax  -mfloat-ieee @gol
485 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
486 -msmall-text  -mlarge-text @gol
487 -mmemory-latency=@var{time}}
488
489 @emph{DEC Alpha/VMS Options}
490 @gccoptlist{-mvms-return-codes}
491
492 @emph{FRV Options}
493 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
494 -mhard-float  -msoft-float @gol
495 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
496 -mdouble  -mno-double @gol
497 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
498 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
499 -mlinked-fp  -mlong-calls  -malign-labels @gol
500 -mlibrary-pic  -macc-4  -macc-8 @gol
501 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
502 -moptimize-membar -mno-optimize-membar @gol
503 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
504 -mvliw-branch  -mno-vliw-branch @gol
505 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
506 -mno-nested-cond-exec  -mtomcat-stats @gol
507 -mTLS -mtls @gol
508 -mcpu=@var{cpu}}
509
510 @emph{GNU/Linux Options}
511 @gccoptlist{-muclibc}
512
513 @emph{H8/300 Options}
514 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
515
516 @emph{HPPA Options}
517 @gccoptlist{-march=@var{architecture-type} @gol
518 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
519 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
520 -mfixed-range=@var{register-range} @gol
521 -mjump-in-delay -mlinker-opt -mlong-calls @gol
522 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
523 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
524 -mno-jump-in-delay  -mno-long-load-store @gol
525 -mno-portable-runtime  -mno-soft-float @gol
526 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
527 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
528 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
529 -munix=@var{unix-std}  -nolibdld  -static  -threads}
530
531 @emph{i386 and x86-64 Options}
532 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
533 -mfpmath=@var{unit} @gol
534 -masm=@var{dialect}  -mno-fancy-math-387 @gol
535 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
536 -mno-wide-multiply  -mrtd  -malign-double @gol
537 -mpreferred-stack-boundary=@var{num} @gol
538 -mmmx  -msse  -msse2 -msse3 -mssse3 -m3dnow @gol
539 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
540 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
541 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
542 -mstackrealign @gol
543 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
544 -mcmodel=@var{code-model} @gol
545 -m32  -m64 -mlarge-data-threshold=@var{num}}
546
547 @emph{IA-64 Options}
548 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
549 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
550 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
551 -minline-float-divide-max-throughput @gol
552 -minline-int-divide-min-latency @gol
553 -minline-int-divide-max-throughput  @gol
554 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
555 -mno-dwarf2-asm -mearly-stop-bits @gol
556 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
557 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
558 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
559 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
560 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
561 -mno-sched-prefer-non-data-spec-insns @gol
562 -mno-sched-prefer-non-control-spec-insns @gol
563 -mno-sched-count-spec-in-critical-path}
564
565 @emph{M32R/D Options}
566 @gccoptlist{-m32r2 -m32rx -m32r @gol
567 -mdebug @gol
568 -malign-loops -mno-align-loops @gol
569 -missue-rate=@var{number} @gol
570 -mbranch-cost=@var{number} @gol
571 -mmodel=@var{code-size-model-type} @gol
572 -msdata=@var{sdata-type} @gol
573 -mno-flush-func -mflush-func=@var{name} @gol
574 -mno-flush-trap -mflush-trap=@var{number} @gol
575 -G @var{num}}
576
577 @emph{M32C Options}
578 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
579
580 @emph{M680x0 Options}
581 @gccoptlist{-m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
582 -m68060  -mcpu32  -m5200  -mcfv4e -m68881  -mbitfield  @gol
583 -mc68000  -mc68020   @gol
584 -mnobitfield  -mrtd  -mshort  -msoft-float  -mpcrel @gol
585 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
586 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library}
587
588 @emph{M68hc1x Options}
589 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
590 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
591 -msoft-reg-count=@var{count}}
592
593 @emph{MCore Options}
594 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
595 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
596 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
597 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
598 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
599
600 @emph{MIPS Options}
601 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
602 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips64 @gol
603 -mips16  -mno-mips16  -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
604 -mshared  -mno-shared  -mxgot  -mno-xgot  -mgp32  -mgp64  @gol
605 -mfp32  -mfp64  -mhard-float  -msoft-float  @gol
606 -msingle-float  -mdouble-float  -mdsp  -mpaired-single  -mips3d @gol
607 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
608 -G@var{num}  -membedded-data  -mno-embedded-data @gol
609 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
610 -msplit-addresses  -mno-split-addresses  @gol
611 -mexplicit-relocs  -mno-explicit-relocs  @gol
612 -mcheck-zero-division  -mno-check-zero-division @gol
613 -mdivide-traps  -mdivide-breaks @gol
614 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
615 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
616 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
617 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130 @gol
618 -mfix-sb1  -mno-fix-sb1 @gol
619 -mflush-func=@var{func}  -mno-flush-func @gol
620 -mbranch-likely  -mno-branch-likely @gol
621 -mfp-exceptions -mno-fp-exceptions @gol
622 -mvr4130-align -mno-vr4130-align}
623
624 @emph{MMIX Options}
625 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
626 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
627 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
628 -mno-base-addresses  -msingle-exit  -mno-single-exit}
629
630 @emph{MN10300 Options}
631 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
632 -mam33  -mno-am33 @gol
633 -mam33-2  -mno-am33-2 @gol
634 -mreturn-pointer-on-d0 @gol
635 -mno-crt0  -mrelax}
636
637 @emph{MT Options}
638 @gccoptlist{-mno-crt0 -mbacc -msim @gol
639 -march=@var{cpu-type} }
640
641 @emph{PDP-11 Options}
642 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
643 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
644 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
645 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
646 -mbranch-expensive  -mbranch-cheap @gol
647 -msplit  -mno-split  -munix-asm  -mdec-asm}
648
649 @emph{PowerPC Options}
650 See RS/6000 and PowerPC Options.
651
652 @emph{RS/6000 and PowerPC Options}
653 @gccoptlist{-mcpu=@var{cpu-type} @gol
654 -mtune=@var{cpu-type} @gol
655 -mpower  -mno-power  -mpower2  -mno-power2 @gol
656 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
657 -maltivec  -mno-altivec @gol
658 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
659 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
660 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
661 -mmfpgpr -mno-mfpgpr @gol
662 -mnew-mnemonics  -mold-mnemonics @gol
663 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
664 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
665 -malign-power  -malign-natural @gol
666 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
667 -mstring  -mno-string  -mupdate  -mno-update @gol
668 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
669 -mstrict-align  -mno-strict-align  -mrelocatable @gol
670 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
671 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
672 -mdynamic-no-pic  -maltivec  -mswdiv @gol
673 -mprioritize-restricted-insns=@var{priority} @gol
674 -msched-costly-dep=@var{dependence_type} @gol
675 -minsert-sched-nops=@var{scheme} @gol
676 -mcall-sysv  -mcall-netbsd @gol
677 -maix-struct-return  -msvr4-struct-return @gol
678 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
679 -misel -mno-isel @gol
680 -misel=yes  -misel=no @gol
681 -mspe -mno-spe @gol
682 -mspe=yes  -mspe=no @gol
683 -mvrsave -mno-vrsave @gol
684 -mmulhw -mno-mulhw @gol
685 -mdlmzb -mno-dlmzb @gol
686 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
687 -mprototype  -mno-prototype @gol
688 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
689 -msdata=@var{opt}  -mvxworks  -mwindiss  -G @var{num}  -pthread}
690
691 @emph{S/390 and zSeries Options}
692 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
693 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
694 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
695 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
696 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
697 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
698 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
699
700 @emph{Score Options}
701 @gccoptlist{-mel -mel @gol
702 -mmac @gol
703 -mscore5u -mscore7}
704  
705 @emph{SH Options}
706 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
707 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
708 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
709 -m5-64media  -m5-64media-nofpu @gol
710 -m5-32media  -m5-32media-nofpu @gol
711 -m5-compact  -m5-compact-nofpu @gol
712 -mb  -ml  -mdalign  -mrelax @gol
713 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
714 -mieee  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
715 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
716 -mdivsi3_libfunc=@var{name}  @gol
717 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
718  -minvalid-symbols}
719
720 @emph{SPARC Options}
721 @gccoptlist{-mcpu=@var{cpu-type} @gol
722 -mtune=@var{cpu-type} @gol
723 -mcmodel=@var{code-model} @gol
724 -m32  -m64  -mapp-regs  -mno-app-regs @gol
725 -mfaster-structs  -mno-faster-structs @gol
726 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
727 -mhard-quad-float  -msoft-quad-float @gol
728 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
729 -mstack-bias  -mno-stack-bias @gol
730 -munaligned-doubles  -mno-unaligned-doubles @gol
731 -mv8plus  -mno-v8plus  -mvis  -mno-vis
732 -threads -pthreads -pthread}
733
734 @emph{SPU Options}
735 @gccoptlist{-mwarn-reloc -merror-reloc @gol
736 -msafe-dma -munsafe-dma @gol
737 -mbranch-hints @gol
738 -msmall-mem -mlarge-mem -mstdmain @gol
739 -mfixed-range=@var{register-range}}
740
741 @emph{System V Options}
742 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
743
744 @emph{TMS320C3x/C4x Options}
745 @gccoptlist{-mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
746 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
747 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
748 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
749
750 @emph{V850 Options}
751 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
752 -mprolog-function  -mno-prolog-function  -mspace @gol
753 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
754 -mapp-regs  -mno-app-regs @gol
755 -mdisable-callt  -mno-disable-callt @gol
756 -mv850e1 @gol
757 -mv850e @gol
758 -mv850  -mbig-switch}
759
760 @emph{VAX Options}
761 @gccoptlist{-mg  -mgnu  -munix}
762
763 @emph{x86-64 Options}
764 See i386 and x86-64 Options.
765
766 @emph{Xstormy16 Options}
767 @gccoptlist{-msim}
768
769 @emph{Xtensa Options}
770 @gccoptlist{-mconst16 -mno-const16 @gol
771 -mfused-madd  -mno-fused-madd @gol
772 -mtext-section-literals  -mno-text-section-literals @gol
773 -mtarget-align  -mno-target-align @gol
774 -mlongcalls  -mno-longcalls}
775
776 @emph{zSeries Options}
777 See S/390 and zSeries Options.
778
779 @item Code Generation Options
780 @xref{Code Gen Options,,Options for Code Generation Conventions}.
781 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
782 -ffixed-@var{reg}  -fexceptions @gol
783 -fnon-call-exceptions  -funwind-tables @gol
784 -fasynchronous-unwind-tables @gol
785 -finhibit-size-directive  -finstrument-functions @gol
786 -fno-common  -fno-ident @gol
787 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
788 -fno-jump-tables @gol
789 -frecord-gcc-switches @gol
790 -freg-struct-return  -fshort-enums @gol
791 -fshort-double  -fshort-wchar @gol
792 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
793 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
794 -fargument-alias  -fargument-noalias @gol
795 -fargument-noalias-global  -fargument-noalias-anything
796 -fleading-underscore  -ftls-model=@var{model} @gol
797 -ftrapv  -fwrapv  -fbounds-check @gol
798 -fvisibility}
799 @end table
800
801 @menu
802 * Overall Options::     Controlling the kind of output:
803                         an executable, object files, assembler files,
804                         or preprocessed source.
805 * C Dialect Options::   Controlling the variant of C language compiled.
806 * C++ Dialect Options:: Variations on C++.
807 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
808                         and Objective-C++.
809 * Language Independent Options:: Controlling how diagnostics should be
810                         formatted.
811 * Warning Options::     How picky should the compiler be?
812 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
813 * Optimize Options::    How much optimization?
814 * Preprocessor Options:: Controlling header files and macro definitions.
815                          Also, getting dependency information for Make.
816 * Assembler Options::   Passing options to the assembler.
817 * Link Options::        Specifying libraries and so on.
818 * Directory Options::   Where to find header files and libraries.
819                         Where to find the compiler executable files.
820 * Spec Files::          How to pass switches to sub-processes.
821 * Target Options::      Running a cross-compiler, or an old version of GCC.
822 @end menu
823
824 @node Overall Options
825 @section Options Controlling the Kind of Output
826
827 Compilation can involve up to four stages: preprocessing, compilation
828 proper, assembly and linking, always in that order.  GCC is capable of
829 preprocessing and compiling several files either into several
830 assembler input files, or into one assembler input file; then each
831 assembler input file produces an object file, and linking combines all
832 the object files (those newly compiled, and those specified as input)
833 into an executable file.
834
835 @cindex file name suffix
836 For any given input file, the file name suffix determines what kind of
837 compilation is done:
838
839 @table @gcctabopt
840 @item @var{file}.c
841 C source code which must be preprocessed.
842
843 @item @var{file}.i
844 C source code which should not be preprocessed.
845
846 @item @var{file}.ii
847 C++ source code which should not be preprocessed.
848
849 @item @var{file}.m
850 Objective-C source code.  Note that you must link with the @file{libobjc}
851 library to make an Objective-C program work.
852
853 @item @var{file}.mi
854 Objective-C source code which should not be preprocessed.
855
856 @item @var{file}.mm
857 @itemx @var{file}.M
858 Objective-C++ source code.  Note that you must link with the @file{libobjc}
859 library to make an Objective-C++ program work.  Note that @samp{.M} refers
860 to a literal capital M@.
861
862 @item @var{file}.mii
863 Objective-C++ source code which should not be preprocessed.
864
865 @item @var{file}.h
866 C, C++, Objective-C or Objective-C++ header file to be turned into a
867 precompiled header.
868
869 @item @var{file}.cc
870 @itemx @var{file}.cp
871 @itemx @var{file}.cxx
872 @itemx @var{file}.cpp
873 @itemx @var{file}.CPP
874 @itemx @var{file}.c++
875 @itemx @var{file}.C
876 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
877 the last two letters must both be literally @samp{x}.  Likewise,
878 @samp{.C} refers to a literal capital C@.
879
880 @item @var{file}.mm
881 @itemx @var{file}.M
882 Objective-C++ source code which must be preprocessed.
883
884 @item @var{file}.mii
885 Objective-C++ source code which should not be preprocessed.
886
887 @item @var{file}.hh
888 @itemx @var{file}.H
889 C++ header file to be turned into a precompiled header.
890
891 @item @var{file}.f
892 @itemx @var{file}.for
893 @itemx @var{file}.FOR
894 Fixed form Fortran source code which should not be preprocessed.
895
896 @item @var{file}.F
897 @itemx @var{file}.fpp
898 @itemx @var{file}.FPP
899 Fixed form Fortran source code which must be preprocessed (with the traditional
900 preprocessor).
901
902 @item @var{file}.f90
903 @itemx @var{file}.f95
904 Free form Fortran source code which should not be preprocessed.
905
906 @item @var{file}.F90
907 @itemx @var{file}.F95
908 Free form Fortran source code which must be preprocessed (with the
909 traditional preprocessor).
910
911 @c FIXME: Descriptions of Java file types.
912 @c @var{file}.java
913 @c @var{file}.class
914 @c @var{file}.zip
915 @c @var{file}.jar
916
917 @item @var{file}.ads
918 Ada source code file which contains a library unit declaration (a
919 declaration of a package, subprogram, or generic, or a generic
920 instantiation), or a library unit renaming declaration (a package,
921 generic, or subprogram renaming declaration).  Such files are also
922 called @dfn{specs}.
923
924 @itemx @var{file}.adb
925 Ada source code file containing a library unit body (a subprogram or
926 package body).  Such files are also called @dfn{bodies}.
927
928 @c GCC also knows about some suffixes for languages not yet included:
929 @c Pascal:
930 @c @var{file}.p
931 @c @var{file}.pas
932 @c Ratfor:
933 @c @var{file}.r
934
935 @item @var{file}.s
936 Assembler code.
937
938 @item @var{file}.S
939 Assembler code which must be preprocessed.
940
941 @item @var{other}
942 An object file to be fed straight into linking.
943 Any file name with no recognized suffix is treated this way.
944 @end table
945
946 @opindex x
947 You can specify the input language explicitly with the @option{-x} option:
948
949 @table @gcctabopt
950 @item -x @var{language}
951 Specify explicitly the @var{language} for the following input files
952 (rather than letting the compiler choose a default based on the file
953 name suffix).  This option applies to all following input files until
954 the next @option{-x} option.  Possible values for @var{language} are:
955 @smallexample
956 c  c-header  c-cpp-output
957 c++  c++-header  c++-cpp-output
958 objective-c  objective-c-header  objective-c-cpp-output
959 objective-c++ objective-c++-header objective-c++-cpp-output
960 assembler  assembler-with-cpp
961 ada
962 f95  f95-cpp-input
963 java
964 treelang
965 @end smallexample
966
967 @item -x none
968 Turn off any specification of a language, so that subsequent files are
969 handled according to their file name suffixes (as they are if @option{-x}
970 has not been used at all).
971
972 @item -pass-exit-codes
973 @opindex pass-exit-codes
974 Normally the @command{gcc} program will exit with the code of 1 if any
975 phase of the compiler returns a non-success return code.  If you specify
976 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
977 numerically highest error produced by any phase that returned an error
978 indication.  The C, C++, and Fortran frontends return 4, if an internal
979 compiler error is encountered.
980 @end table
981
982 If you only want some of the stages of compilation, you can use
983 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
984 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
985 @command{gcc} is to stop.  Note that some combinations (for example,
986 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
987
988 @table @gcctabopt
989 @item -c
990 @opindex c
991 Compile or assemble the source files, but do not link.  The linking
992 stage simply is not done.  The ultimate output is in the form of an
993 object file for each source file.
994
995 By default, the object file name for a source file is made by replacing
996 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
997
998 Unrecognized input files, not requiring compilation or assembly, are
999 ignored.
1000
1001 @item -S
1002 @opindex S
1003 Stop after the stage of compilation proper; do not assemble.  The output
1004 is in the form of an assembler code file for each non-assembler input
1005 file specified.
1006
1007 By default, the assembler file name for a source file is made by
1008 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1009
1010 Input files that don't require compilation are ignored.
1011
1012 @item -E
1013 @opindex E
1014 Stop after the preprocessing stage; do not run the compiler proper.  The
1015 output is in the form of preprocessed source code, which is sent to the
1016 standard output.
1017
1018 Input files which don't require preprocessing are ignored.
1019
1020 @cindex output file option
1021 @item -o @var{file}
1022 @opindex o
1023 Place output in file @var{file}.  This applies regardless to whatever
1024 sort of output is being produced, whether it be an executable file,
1025 an object file, an assembler file or preprocessed C code.
1026
1027 If @option{-o} is not specified, the default is to put an executable
1028 file in @file{a.out}, the object file for
1029 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1030 assembler file in @file{@var{source}.s}, a precompiled header file in
1031 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1032 standard output.
1033
1034 @item -v
1035 @opindex v
1036 Print (on standard error output) the commands executed to run the stages
1037 of compilation.  Also print the version number of the compiler driver
1038 program and of the preprocessor and the compiler proper.
1039
1040 @item -###
1041 @opindex ###
1042 Like @option{-v} except the commands are not executed and all command
1043 arguments are quoted.  This is useful for shell scripts to capture the
1044 driver-generated command lines.
1045
1046 @item -pipe
1047 @opindex pipe
1048 Use pipes rather than temporary files for communication between the
1049 various stages of compilation.  This fails to work on some systems where
1050 the assembler is unable to read from a pipe; but the GNU assembler has
1051 no trouble.
1052
1053 @item -combine
1054 @opindex combine
1055 If you are compiling multiple source files, this option tells the driver
1056 to pass all the source files to the compiler at once (for those
1057 languages for which the compiler can handle this).  This will allow
1058 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1059 language for which this is supported is C@.  If you pass source files for
1060 multiple languages to the driver, using this option, the driver will invoke
1061 the compiler(s) that support IMA once each, passing each compiler all the
1062 source files appropriate for it.  For those languages that do not support
1063 IMA this option will be ignored, and the compiler will be invoked once for
1064 each source file in that language.  If you use this option in conjunction
1065 with @option{-save-temps}, the compiler will generate multiple
1066 pre-processed files
1067 (one for each source file), but only one (combined) @file{.o} or
1068 @file{.s} file.
1069
1070 @item --help
1071 @opindex help
1072 Print (on the standard output) a description of the command line options
1073 understood by @command{gcc}.  If the @option{-v} option is also specified
1074 then @option{--help} will also be passed on to the various processes
1075 invoked by @command{gcc}, so that they can display the command line options
1076 they accept.  If the @option{-Wextra} option is also specified then command
1077 line options which have no documentation associated with them will also
1078 be displayed.
1079
1080 @item --target-help
1081 @opindex target-help
1082 Print (on the standard output) a description of target specific command
1083 line options for each tool.
1084
1085 @item --version
1086 @opindex version
1087 Display the version number and copyrights of the invoked GCC@.
1088
1089 @include @value{srcdir}/../libiberty/at-file.texi
1090 @end table
1091
1092 @node Invoking G++
1093 @section Compiling C++ Programs
1094
1095 @cindex suffixes for C++ source
1096 @cindex C++ source file suffixes
1097 C++ source files conventionally use one of the suffixes @samp{.C},
1098 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1099 @samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and
1100 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1101 files with these names and compiles them as C++ programs even if you
1102 call the compiler the same way as for compiling C programs (usually
1103 with the name @command{gcc}).
1104
1105 @findex g++
1106 @findex c++
1107 However, the use of @command{gcc} does not add the C++ library.
1108 @command{g++} is a program that calls GCC and treats @samp{.c},
1109 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1110 files unless @option{-x} is used, and automatically specifies linking
1111 against the C++ library.  This program is also useful when
1112 precompiling a C header file with a @samp{.h} extension for use in C++
1113 compilations.  On many systems, @command{g++} is also installed with
1114 the name @command{c++}.
1115
1116 @cindex invoking @command{g++}
1117 When you compile C++ programs, you may specify many of the same
1118 command-line options that you use for compiling programs in any
1119 language; or command-line options meaningful for C and related
1120 languages; or options that are meaningful only for C++ programs.
1121 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1122 explanations of options for languages related to C@.
1123 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1124 explanations of options that are meaningful only for C++ programs.
1125
1126 @node C Dialect Options
1127 @section Options Controlling C Dialect
1128 @cindex dialect options
1129 @cindex language dialect options
1130 @cindex options, dialect
1131
1132 The following options control the dialect of C (or languages derived
1133 from C, such as C++, Objective-C and Objective-C++) that the compiler
1134 accepts:
1135
1136 @table @gcctabopt
1137 @cindex ANSI support
1138 @cindex ISO support
1139 @item -ansi
1140 @opindex ansi
1141 In C mode, support all ISO C90 programs.  In C++ mode,
1142 remove GNU extensions that conflict with ISO C++.
1143
1144 This turns off certain features of GCC that are incompatible with ISO
1145 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1146 such as the @code{asm} and @code{typeof} keywords, and
1147 predefined macros such as @code{unix} and @code{vax} that identify the
1148 type of system you are using.  It also enables the undesirable and
1149 rarely used ISO trigraph feature.  For the C compiler,
1150 it disables recognition of C++ style @samp{//} comments as well as
1151 the @code{inline} keyword.
1152
1153 The alternate keywords @code{__asm__}, @code{__extension__},
1154 @code{__inline__} and @code{__typeof__} continue to work despite
1155 @option{-ansi}.  You would not want to use them in an ISO C program, of
1156 course, but it is useful to put them in header files that might be included
1157 in compilations done with @option{-ansi}.  Alternate predefined macros
1158 such as @code{__unix__} and @code{__vax__} are also available, with or
1159 without @option{-ansi}.
1160
1161 The @option{-ansi} option does not cause non-ISO programs to be
1162 rejected gratuitously.  For that, @option{-pedantic} is required in
1163 addition to @option{-ansi}.  @xref{Warning Options}.
1164
1165 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1166 option is used.  Some header files may notice this macro and refrain
1167 from declaring certain functions or defining certain macros that the
1168 ISO standard doesn't call for; this is to avoid interfering with any
1169 programs that might use these names for other things.
1170
1171 Functions which would normally be built in but do not have semantics
1172 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1173 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
1174 built-in functions provided by GCC}, for details of the functions
1175 affected.
1176
1177 @item -std=
1178 @opindex std
1179 Determine the language standard.  This option is currently only
1180 supported when compiling C or C++.  A value for this option must be
1181 provided; possible values are
1182
1183 @table @samp
1184 @item c89
1185 @itemx iso9899:1990
1186 ISO C90 (same as @option{-ansi}).
1187
1188 @item iso9899:199409
1189 ISO C90 as modified in amendment 1.
1190
1191 @item c99
1192 @itemx c9x
1193 @itemx iso9899:1999
1194 @itemx iso9899:199x
1195 ISO C99.  Note that this standard is not yet fully supported; see
1196 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1197 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1198
1199 @item gnu89
1200 Default, ISO C90 plus GNU extensions (including some C99 features).
1201
1202 @item gnu99
1203 @itemx gnu9x
1204 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
1205 this will become the default.  The name @samp{gnu9x} is deprecated.
1206
1207 @item c++98
1208 The 1998 ISO C++ standard plus amendments.
1209
1210 @item gnu++98
1211 The same as @option{-std=c++98} plus GNU extensions.  This is the
1212 default for C++ code.
1213
1214 @item c++0x
1215 The working draft of the upcoming ISO C++0x standard. This option
1216 enables experimental features that are likely to be included in
1217 C++0x. The working draft is constantly changing, and any feature that is
1218 enabled by this flag may be removed from future versions of GCC if it is
1219 not part of the C++0x standard.
1220
1221 @item gnu++0x
1222 The same as @option{-std=c++0x} plus GNU extensions. As with
1223 @option{-std=c++0x}, this option enables experimental features that may
1224 be removed in future versions of GCC.
1225 @end table
1226
1227 Even when this option is not specified, you can still use some of the
1228 features of newer standards in so far as they do not conflict with
1229 previous C standards.  For example, you may use @code{__restrict__} even
1230 when @option{-std=c99} is not specified.
1231
1232 The @option{-std} options specifying some version of ISO C have the same
1233 effects as @option{-ansi}, except that features that were not in ISO C90
1234 but are in the specified version (for example, @samp{//} comments and
1235 the @code{inline} keyword in ISO C99) are not disabled.
1236
1237 @xref{Standards,,Language Standards Supported by GCC}, for details of
1238 these standard versions.
1239
1240 @item -aux-info @var{filename}
1241 @opindex aux-info
1242 Output to the given filename prototyped declarations for all functions
1243 declared and/or defined in a translation unit, including those in header
1244 files.  This option is silently ignored in any language other than C@.
1245
1246 Besides declarations, the file indicates, in comments, the origin of
1247 each declaration (source file and line), whether the declaration was
1248 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1249 @samp{O} for old, respectively, in the first character after the line
1250 number and the colon), and whether it came from a declaration or a
1251 definition (@samp{C} or @samp{F}, respectively, in the following
1252 character).  In the case of function definitions, a K&R-style list of
1253 arguments followed by their declarations is also provided, inside
1254 comments, after the declaration.
1255
1256 @item -fno-asm
1257 @opindex fno-asm
1258 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1259 keyword, so that code can use these words as identifiers.  You can use
1260 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1261 instead.  @option{-ansi} implies @option{-fno-asm}.
1262
1263 In C++, this switch only affects the @code{typeof} keyword, since
1264 @code{asm} and @code{inline} are standard keywords.  You may want to
1265 use the @option{-fno-gnu-keywords} flag instead, which has the same
1266 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1267 switch only affects the @code{asm} and @code{typeof} keywords, since
1268 @code{inline} is a standard keyword in ISO C99.
1269
1270 @item -fno-builtin
1271 @itemx -fno-builtin-@var{function}
1272 @opindex fno-builtin
1273 @cindex built-in functions
1274 Don't recognize built-in functions that do not begin with
1275 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1276 functions provided by GCC}, for details of the functions affected,
1277 including those which are not built-in functions when @option{-ansi} or
1278 @option{-std} options for strict ISO C conformance are used because they
1279 do not have an ISO standard meaning.
1280
1281 GCC normally generates special code to handle certain built-in functions
1282 more efficiently; for instance, calls to @code{alloca} may become single
1283 instructions that adjust the stack directly, and calls to @code{memcpy}
1284 may become inline copy loops.  The resulting code is often both smaller
1285 and faster, but since the function calls no longer appear as such, you
1286 cannot set a breakpoint on those calls, nor can you change the behavior
1287 of the functions by linking with a different library.  In addition,
1288 when a function is recognized as a built-in function, GCC may use
1289 information about that function to warn about problems with calls to
1290 that function, or to generate more efficient code, even if the
1291 resulting code still contains calls to that function.  For example,
1292 warnings are given with @option{-Wformat} for bad calls to
1293 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1294 known not to modify global memory.
1295
1296 With the @option{-fno-builtin-@var{function}} option
1297 only the built-in function @var{function} is
1298 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1299 function is named this is not built-in in this version of GCC, this
1300 option is ignored.  There is no corresponding
1301 @option{-fbuiltin-@var{function}} option; if you wish to enable
1302 built-in functions selectively when using @option{-fno-builtin} or
1303 @option{-ffreestanding}, you may define macros such as:
1304
1305 @smallexample
1306 #define abs(n)          __builtin_abs ((n))
1307 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1308 @end smallexample
1309
1310 @item -fhosted
1311 @opindex fhosted
1312 @cindex hosted environment
1313
1314 Assert that compilation takes place in a hosted environment.  This implies
1315 @option{-fbuiltin}.  A hosted environment is one in which the
1316 entire standard library is available, and in which @code{main} has a return
1317 type of @code{int}.  Examples are nearly everything except a kernel.
1318 This is equivalent to @option{-fno-freestanding}.
1319
1320 @item -ffreestanding
1321 @opindex ffreestanding
1322 @cindex hosted environment
1323
1324 Assert that compilation takes place in a freestanding environment.  This
1325 implies @option{-fno-builtin}.  A freestanding environment
1326 is one in which the standard library may not exist, and program startup may
1327 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1328 This is equivalent to @option{-fno-hosted}.
1329
1330 @xref{Standards,,Language Standards Supported by GCC}, for details of
1331 freestanding and hosted environments.
1332
1333 @item -fopenmp
1334 @opindex fopenmp
1335 @cindex openmp parallel
1336 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1337 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1338 compiler generates parallel code according to the OpenMP Application
1339 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.
1340
1341 @item -fms-extensions
1342 @opindex fms-extensions
1343 Accept some non-standard constructs used in Microsoft header files.
1344
1345 Some cases of unnamed fields in structures and unions are only
1346 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1347 fields within structs/unions}, for details.
1348
1349 @item -trigraphs
1350 @opindex trigraphs
1351 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1352 options for strict ISO C conformance) implies @option{-trigraphs}.
1353
1354 @item -no-integrated-cpp
1355 @opindex no-integrated-cpp
1356 Performs a compilation in two passes: preprocessing and compiling.  This
1357 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1358 @option{-B} option.  The user supplied compilation step can then add in
1359 an additional preprocessing step after normal preprocessing but before
1360 compiling.  The default is to use the integrated cpp (internal cpp)
1361
1362 The semantics of this option will change if "cc1", "cc1plus", and
1363 "cc1obj" are merged.
1364
1365 @cindex traditional C language
1366 @cindex C language, traditional
1367 @item -traditional
1368 @itemx -traditional-cpp
1369 @opindex traditional-cpp
1370 @opindex traditional
1371 Formerly, these options caused GCC to attempt to emulate a pre-standard
1372 C compiler.  They are now only supported with the @option{-E} switch.
1373 The preprocessor continues to support a pre-standard mode.  See the GNU
1374 CPP manual for details.
1375
1376 @item -fcond-mismatch
1377 @opindex fcond-mismatch
1378 Allow conditional expressions with mismatched types in the second and
1379 third arguments.  The value of such an expression is void.  This option
1380 is not supported for C++.
1381
1382 @item -funsigned-char
1383 @opindex funsigned-char
1384 Let the type @code{char} be unsigned, like @code{unsigned char}.
1385
1386 Each kind of machine has a default for what @code{char} should
1387 be.  It is either like @code{unsigned char} by default or like
1388 @code{signed char} by default.
1389
1390 Ideally, a portable program should always use @code{signed char} or
1391 @code{unsigned char} when it depends on the signedness of an object.
1392 But many programs have been written to use plain @code{char} and
1393 expect it to be signed, or expect it to be unsigned, depending on the
1394 machines they were written for.  This option, and its inverse, let you
1395 make such a program work with the opposite default.
1396
1397 The type @code{char} is always a distinct type from each of
1398 @code{signed char} or @code{unsigned char}, even though its behavior
1399 is always just like one of those two.
1400
1401 @item -fsigned-char
1402 @opindex fsigned-char
1403 Let the type @code{char} be signed, like @code{signed char}.
1404
1405 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1406 the negative form of @option{-funsigned-char}.  Likewise, the option
1407 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1408
1409 @item -fsigned-bitfields
1410 @itemx -funsigned-bitfields
1411 @itemx -fno-signed-bitfields
1412 @itemx -fno-unsigned-bitfields
1413 @opindex fsigned-bitfields
1414 @opindex funsigned-bitfields
1415 @opindex fno-signed-bitfields
1416 @opindex fno-unsigned-bitfields
1417 These options control whether a bit-field is signed or unsigned, when the
1418 declaration does not use either @code{signed} or @code{unsigned}.  By
1419 default, such a bit-field is signed, because this is consistent: the
1420 basic integer types such as @code{int} are signed types.
1421 @end table
1422
1423 @node C++ Dialect Options
1424 @section Options Controlling C++ Dialect
1425
1426 @cindex compiler options, C++
1427 @cindex C++ options, command line
1428 @cindex options, C++
1429 This section describes the command-line options that are only meaningful
1430 for C++ programs; but you can also use most of the GNU compiler options
1431 regardless of what language your program is in.  For example, you
1432 might compile a file @code{firstClass.C} like this:
1433
1434 @smallexample
1435 g++ -g -frepo -O -c firstClass.C
1436 @end smallexample
1437
1438 @noindent
1439 In this example, only @option{-frepo} is an option meant
1440 only for C++ programs; you can use the other options with any
1441 language supported by GCC@.
1442
1443 Here is a list of options that are @emph{only} for compiling C++ programs:
1444
1445 @table @gcctabopt
1446
1447 @item -fabi-version=@var{n}
1448 @opindex fabi-version
1449 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1450 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1451 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1452 the version that conforms most closely to the C++ ABI specification.
1453 Therefore, the ABI obtained using version 0 will change as ABI bugs
1454 are fixed.
1455
1456 The default is version 2.
1457
1458 @item -fno-access-control
1459 @opindex fno-access-control
1460 Turn off all access checking.  This switch is mainly useful for working
1461 around bugs in the access control code.
1462
1463 @item -fcheck-new
1464 @opindex fcheck-new
1465 Check that the pointer returned by @code{operator new} is non-null
1466 before attempting to modify the storage allocated.  This check is
1467 normally unnecessary because the C++ standard specifies that
1468 @code{operator new} will only return @code{0} if it is declared
1469 @samp{throw()}, in which case the compiler will always check the
1470 return value even without this option.  In all other cases, when
1471 @code{operator new} has a non-empty exception specification, memory
1472 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1473 @samp{new (nothrow)}.
1474
1475 @item -fconserve-space
1476 @opindex fconserve-space
1477 Put uninitialized or runtime-initialized global variables into the
1478 common segment, as C does.  This saves space in the executable at the
1479 cost of not diagnosing duplicate definitions.  If you compile with this
1480 flag and your program mysteriously crashes after @code{main()} has
1481 completed, you may have an object that is being destroyed twice because
1482 two definitions were merged.
1483
1484 This option is no longer useful on most targets, now that support has
1485 been added for putting variables into BSS without making them common.
1486
1487 @item -ffriend-injection
1488 @opindex ffriend-injection
1489 Inject friend functions into the enclosing namespace, so that they are
1490 visible outside the scope of the class in which they are declared.
1491 Friend functions were documented to work this way in the old Annotated
1492 C++ Reference Manual, and versions of G++ before 4.1 always worked
1493 that way.  However, in ISO C++ a friend function which is not declared
1494 in an enclosing scope can only be found using argument dependent
1495 lookup.  This option causes friends to be injected as they were in
1496 earlier releases.
1497
1498 This option is for compatibility, and may be removed in a future
1499 release of G++.
1500
1501 @item -fno-elide-constructors
1502 @opindex fno-elide-constructors
1503 The C++ standard allows an implementation to omit creating a temporary
1504 which is only used to initialize another object of the same type.
1505 Specifying this option disables that optimization, and forces G++ to
1506 call the copy constructor in all cases.
1507
1508 @item -fno-enforce-eh-specs
1509 @opindex fno-enforce-eh-specs
1510 Don't generate code to check for violation of exception specifications
1511 at runtime.  This option violates the C++ standard, but may be useful
1512 for reducing code size in production builds, much like defining
1513 @samp{NDEBUG}.  This does not give user code permission to throw
1514 exceptions in violation of the exception specifications; the compiler
1515 will still optimize based on the specifications, so throwing an
1516 unexpected exception will result in undefined behavior.
1517
1518 @item -ffor-scope
1519 @itemx -fno-for-scope
1520 @opindex ffor-scope
1521 @opindex fno-for-scope
1522 If @option{-ffor-scope} is specified, the scope of variables declared in
1523 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1524 as specified by the C++ standard.
1525 If @option{-fno-for-scope} is specified, the scope of variables declared in
1526 a @i{for-init-statement} extends to the end of the enclosing scope,
1527 as was the case in old versions of G++, and other (traditional)
1528 implementations of C++.
1529
1530 The default if neither flag is given to follow the standard,
1531 but to allow and give a warning for old-style code that would
1532 otherwise be invalid, or have different behavior.
1533
1534 @item -fno-gnu-keywords
1535 @opindex fno-gnu-keywords
1536 Do not recognize @code{typeof} as a keyword, so that code can use this
1537 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1538 @option{-ansi} implies @option{-fno-gnu-keywords}.
1539
1540 @item -fno-implicit-templates
1541 @opindex fno-implicit-templates
1542 Never emit code for non-inline templates which are instantiated
1543 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1544 @xref{Template Instantiation}, for more information.
1545
1546 @item -fno-implicit-inline-templates
1547 @opindex fno-implicit-inline-templates
1548 Don't emit code for implicit instantiations of inline templates, either.
1549 The default is to handle inlines differently so that compiles with and
1550 without optimization will need the same set of explicit instantiations.
1551
1552 @item -fno-implement-inlines
1553 @opindex fno-implement-inlines
1554 To save space, do not emit out-of-line copies of inline functions
1555 controlled by @samp{#pragma implementation}.  This will cause linker
1556 errors if these functions are not inlined everywhere they are called.
1557
1558 @item -fms-extensions
1559 @opindex fms-extensions
1560 Disable pedantic warnings about constructs used in MFC, such as implicit
1561 int and getting a pointer to member function via non-standard syntax.
1562
1563 @item -fno-nonansi-builtins
1564 @opindex fno-nonansi-builtins
1565 Disable built-in declarations of functions that are not mandated by
1566 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1567 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1568
1569 @item -fno-operator-names
1570 @opindex fno-operator-names
1571 Do not treat the operator name keywords @code{and}, @code{bitand},
1572 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1573 synonyms as keywords.
1574
1575 @item -fno-optional-diags
1576 @opindex fno-optional-diags
1577 Disable diagnostics that the standard says a compiler does not need to
1578 issue.  Currently, the only such diagnostic issued by G++ is the one for
1579 a name having multiple meanings within a class.
1580
1581 @item -fpermissive
1582 @opindex fpermissive
1583 Downgrade some diagnostics about nonconformant code from errors to
1584 warnings.  Thus, using @option{-fpermissive} will allow some
1585 nonconforming code to compile.
1586
1587 @item -frepo
1588 @opindex frepo
1589 Enable automatic template instantiation at link time.  This option also
1590 implies @option{-fno-implicit-templates}.  @xref{Template
1591 Instantiation}, for more information.
1592
1593 @item -fno-rtti
1594 @opindex fno-rtti
1595 Disable generation of information about every class with virtual
1596 functions for use by the C++ runtime type identification features
1597 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1598 of the language, you can save some space by using this flag.  Note that
1599 exception handling uses the same information, but it will generate it as
1600 needed. The @samp{dynamic_cast} operator can still be used for casts that
1601 do not require runtime type information, i.e. casts to @code{void *} or to
1602 unambiguous base classes.
1603
1604 @item -fstats
1605 @opindex fstats
1606 Emit statistics about front-end processing at the end of the compilation.
1607 This information is generally only useful to the G++ development team.
1608
1609 @item -ftemplate-depth-@var{n}
1610 @opindex ftemplate-depth
1611 Set the maximum instantiation depth for template classes to @var{n}.
1612 A limit on the template instantiation depth is needed to detect
1613 endless recursions during template class instantiation.  ANSI/ISO C++
1614 conforming programs must not rely on a maximum depth greater than 17.
1615
1616 @item -fno-threadsafe-statics
1617 @opindex fno-threadsafe-statics
1618 Do not emit the extra code to use the routines specified in the C++
1619 ABI for thread-safe initialization of local statics.  You can use this
1620 option to reduce code size slightly in code that doesn't need to be
1621 thread-safe.
1622
1623 @item -fuse-cxa-atexit
1624 @opindex fuse-cxa-atexit
1625 Register destructors for objects with static storage duration with the
1626 @code{__cxa_atexit} function rather than the @code{atexit} function.
1627 This option is required for fully standards-compliant handling of static
1628 destructors, but will only work if your C library supports
1629 @code{__cxa_atexit}.
1630
1631 @item -fno-use-cxa-get-exception-ptr
1632 @opindex fno-use-cxa-get-exception-ptr
1633 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1634 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1635 if the runtime routine is not available.
1636
1637 @item -fvisibility-inlines-hidden
1638 @opindex fvisibility-inlines-hidden
1639 This switch declares that the user does not attempt to compare
1640 pointers to inline methods where the addresses of the two functions
1641 were taken in different shared objects.
1642
1643 The effect of this is that GCC may, effectively, mark inline methods with
1644 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1645 appear in the export table of a DSO and do not require a PLT indirection
1646 when used within the DSO@.  Enabling this option can have a dramatic effect
1647 on load and link times of a DSO as it massively reduces the size of the
1648 dynamic export table when the library makes heavy use of templates.
1649
1650 The behaviour of this switch is not quite the same as marking the
1651 methods as hidden directly, because it does not affect static variables
1652 local to the function or cause the compiler to deduce that
1653 the function is defined in only one shared object.
1654
1655 You may mark a method as having a visibility explicitly to negate the
1656 effect of the switch for that method.  For example, if you do want to
1657 compare pointers to a particular inline method, you might mark it as
1658 having default visibility.  Marking the enclosing class with explicit
1659 visibility will have no effect.
1660
1661 Explicitly instantiated inline methods are unaffected by this option
1662 as their linkage might otherwise cross a shared library boundary.
1663 @xref{Template Instantiation}.
1664
1665 @item -fno-weak
1666 @opindex fno-weak
1667 Do not use weak symbol support, even if it is provided by the linker.
1668 By default, G++ will use weak symbols if they are available.  This
1669 option exists only for testing, and should not be used by end-users;
1670 it will result in inferior code and has no benefits.  This option may
1671 be removed in a future release of G++.
1672
1673 @item -nostdinc++
1674 @opindex nostdinc++
1675 Do not search for header files in the standard directories specific to
1676 C++, but do still search the other standard directories.  (This option
1677 is used when building the C++ library.)
1678 @end table
1679
1680 In addition, these optimization, warning, and code generation options
1681 have meanings only for C++ programs:
1682
1683 @table @gcctabopt
1684 @item -fno-default-inline
1685 @opindex fno-default-inline
1686 Do not assume @samp{inline} for functions defined inside a class scope.
1687 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1688 functions will have linkage like inline functions; they just won't be
1689 inlined by default.
1690
1691 @item -Wabi @r{(C++ only)}
1692 @opindex Wabi
1693 Warn when G++ generates code that is probably not compatible with the
1694 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1695 all such cases, there are probably some cases that are not warned about,
1696 even though G++ is generating incompatible code.  There may also be
1697 cases where warnings are emitted even though the code that is generated
1698 will be compatible.
1699
1700 You should rewrite your code to avoid these warnings if you are
1701 concerned about the fact that code generated by G++ may not be binary
1702 compatible with code generated by other compilers.
1703
1704 The known incompatibilities at this point include:
1705
1706 @itemize @bullet
1707
1708 @item
1709 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1710 pack data into the same byte as a base class.  For example:
1711
1712 @smallexample
1713 struct A @{ virtual void f(); int f1 : 1; @};
1714 struct B : public A @{ int f2 : 1; @};
1715 @end smallexample
1716
1717 @noindent
1718 In this case, G++ will place @code{B::f2} into the same byte
1719 as@code{A::f1}; other compilers will not.  You can avoid this problem
1720 by explicitly padding @code{A} so that its size is a multiple of the
1721 byte size on your platform; that will cause G++ and other compilers to
1722 layout @code{B} identically.
1723
1724 @item
1725 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1726 tail padding when laying out virtual bases.  For example:
1727
1728 @smallexample
1729 struct A @{ virtual void f(); char c1; @};
1730 struct B @{ B(); char c2; @};
1731 struct C : public A, public virtual B @{@};
1732 @end smallexample
1733
1734 @noindent
1735 In this case, G++ will not place @code{B} into the tail-padding for
1736 @code{A}; other compilers will.  You can avoid this problem by
1737 explicitly padding @code{A} so that its size is a multiple of its
1738 alignment (ignoring virtual base classes); that will cause G++ and other
1739 compilers to layout @code{C} identically.
1740
1741 @item
1742 Incorrect handling of bit-fields with declared widths greater than that
1743 of their underlying types, when the bit-fields appear in a union.  For
1744 example:
1745
1746 @smallexample
1747 union U @{ int i : 4096; @};
1748 @end smallexample
1749
1750 @noindent
1751 Assuming that an @code{int} does not have 4096 bits, G++ will make the
1752 union too small by the number of bits in an @code{int}.
1753
1754 @item
1755 Empty classes can be placed at incorrect offsets.  For example:
1756
1757 @smallexample
1758 struct A @{@};
1759
1760 struct B @{
1761   A a;
1762   virtual void f ();
1763 @};
1764
1765 struct C : public B, public A @{@};
1766 @end smallexample
1767
1768 @noindent
1769 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
1770 it should be placed at offset zero.  G++ mistakenly believes that the
1771 @code{A} data member of @code{B} is already at offset zero.
1772
1773 @item
1774 Names of template functions whose types involve @code{typename} or
1775 template template parameters can be mangled incorrectly.
1776
1777 @smallexample
1778 template <typename Q>
1779 void f(typename Q::X) @{@}
1780
1781 template <template <typename> class Q>
1782 void f(typename Q<int>::X) @{@}
1783 @end smallexample
1784
1785 @noindent
1786 Instantiations of these templates may be mangled incorrectly.
1787
1788 @end itemize
1789
1790 @item -Wctor-dtor-privacy @r{(C++ only)}
1791 @opindex Wctor-dtor-privacy
1792 Warn when a class seems unusable because all the constructors or
1793 destructors in that class are private, and it has neither friends nor
1794 public static member functions.
1795
1796 @item -Wnon-virtual-dtor @r{(C++ only)}
1797 @opindex Wnon-virtual-dtor
1798 Warn when a class appears to be polymorphic, thereby requiring a virtual
1799 destructor, yet it declares a non-virtual one.  This warning is also
1800 enabled if -Weffc++ is specified.
1801
1802 @item -Wreorder @r{(C++ only)}
1803 @opindex Wreorder
1804 @cindex reordering, warning
1805 @cindex warning for reordering of member initializers
1806 Warn when the order of member initializers given in the code does not
1807 match the order in which they must be executed.  For instance:
1808
1809 @smallexample
1810 struct A @{
1811   int i;
1812   int j;
1813   A(): j (0), i (1) @{ @}
1814 @};
1815 @end smallexample
1816
1817 The compiler will rearrange the member initializers for @samp{i}
1818 and @samp{j} to match the declaration order of the members, emitting
1819 a warning to that effect.  This warning is enabled by @option{-Wall}.
1820 @end table
1821
1822 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1823
1824 @table @gcctabopt
1825 @item -Weffc++ @r{(C++ only)}
1826 @opindex Weffc++
1827 Warn about violations of the following style guidelines from Scott Meyers'
1828 @cite{Effective C++} book:
1829
1830 @itemize @bullet
1831 @item
1832 Item 11:  Define a copy constructor and an assignment operator for classes
1833 with dynamically allocated memory.
1834
1835 @item
1836 Item 12:  Prefer initialization to assignment in constructors.
1837
1838 @item
1839 Item 14:  Make destructors virtual in base classes.
1840
1841 @item
1842 Item 15:  Have @code{operator=} return a reference to @code{*this}.
1843
1844 @item
1845 Item 23:  Don't try to return a reference when you must return an object.
1846
1847 @end itemize
1848
1849 Also warn about violations of the following style guidelines from
1850 Scott Meyers' @cite{More Effective C++} book:
1851
1852 @itemize @bullet
1853 @item
1854 Item 6:  Distinguish between prefix and postfix forms of increment and
1855 decrement operators.
1856
1857 @item
1858 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
1859
1860 @end itemize
1861
1862 When selecting this option, be aware that the standard library
1863 headers do not obey all of these guidelines; use @samp{grep -v}
1864 to filter out those warnings.
1865
1866 @item -Wno-deprecated @r{(C++ only)}
1867 @opindex Wno-deprecated
1868 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
1869
1870 @item -Wstrict-null-sentinel @r{(C++ only)}
1871 @opindex Wstrict-null-sentinel
1872 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
1873 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
1874 to @code{__null}.  Although it is a null pointer constant not a null pointer,
1875 it is guaranteed to of the same size as a pointer.  But this use is
1876 not portable across different compilers.
1877
1878 @item -Wno-non-template-friend @r{(C++ only)}
1879 @opindex Wno-non-template-friend
1880 Disable warnings when non-templatized friend functions are declared
1881 within a template.  Since the advent of explicit template specification
1882 support in G++, if the name of the friend is an unqualified-id (i.e.,
1883 @samp{friend foo(int)}), the C++ language specification demands that the
1884 friend declare or define an ordinary, nontemplate function.  (Section
1885 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
1886 could be interpreted as a particular specialization of a templatized
1887 function.  Because this non-conforming behavior is no longer the default
1888 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
1889 check existing code for potential trouble spots and is on by default.
1890 This new compiler behavior can be turned off with
1891 @option{-Wno-non-template-friend} which keeps the conformant compiler code
1892 but disables the helpful warning.
1893
1894 @item -Wold-style-cast @r{(C++ only)}
1895 @opindex Wold-style-cast
1896 Warn if an old-style (C-style) cast to a non-void type is used within
1897 a C++ program.  The new-style casts (@samp{dynamic_cast},
1898 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
1899 less vulnerable to unintended effects and much easier to search for.
1900
1901 @item -Woverloaded-virtual @r{(C++ only)}
1902 @opindex Woverloaded-virtual
1903 @cindex overloaded virtual fn, warning
1904 @cindex warning for overloaded virtual fn
1905 Warn when a function declaration hides virtual functions from a
1906 base class.  For example, in:
1907
1908 @smallexample
1909 struct A @{
1910   virtual void f();
1911 @};
1912
1913 struct B: public A @{
1914   void f(int);
1915 @};
1916 @end smallexample
1917
1918 the @code{A} class version of @code{f} is hidden in @code{B}, and code
1919 like:
1920
1921 @smallexample
1922 B* b;
1923 b->f();
1924 @end smallexample
1925
1926 will fail to compile.
1927
1928 @item -Wno-pmf-conversions @r{(C++ only)}
1929 @opindex Wno-pmf-conversions
1930 Disable the diagnostic for converting a bound pointer to member function
1931 to a plain pointer.
1932
1933 @item -Wsign-promo @r{(C++ only)}
1934 @opindex Wsign-promo
1935 Warn when overload resolution chooses a promotion from unsigned or
1936 enumerated type to a signed type, over a conversion to an unsigned type of
1937 the same size.  Previous versions of G++ would try to preserve
1938 unsignedness, but the standard mandates the current behavior.
1939
1940 @smallexample
1941 struct A @{
1942   operator int ();
1943   A& operator = (int);
1944 @};
1945
1946 main ()
1947 @{
1948   A a,b;
1949   a = b;
1950 @}
1951 @end smallexample
1952
1953 In this example, G++ will synthesize a default @samp{A& operator =
1954 (const A&);}, while cfront will use the user-defined @samp{operator =}.
1955 @end table
1956
1957 @node Objective-C and Objective-C++ Dialect Options
1958 @section Options Controlling Objective-C and Objective-C++ Dialects
1959
1960 @cindex compiler options, Objective-C and Objective-C++
1961 @cindex Objective-C and Objective-C++ options, command line
1962 @cindex options, Objective-C and Objective-C++
1963 (NOTE: This manual does not describe the Objective-C and Objective-C++
1964 languages themselves.  See @xref{Standards,,Language Standards
1965 Supported by GCC}, for references.)
1966
1967 This section describes the command-line options that are only meaningful
1968 for Objective-C and Objective-C++ programs, but you can also use most of
1969 the language-independent GNU compiler options.
1970 For example, you might compile a file @code{some_class.m} like this:
1971
1972 @smallexample
1973 gcc -g -fgnu-runtime -O -c some_class.m
1974 @end smallexample
1975
1976 @noindent
1977 In this example, @option{-fgnu-runtime} is an option meant only for
1978 Objective-C and Objective-C++ programs; you can use the other options with
1979 any language supported by GCC@.
1980
1981 Note that since Objective-C is an extension of the C language, Objective-C
1982 compilations may also use options specific to the C front-end (e.g.,
1983 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
1984 C++-specific options (e.g., @option{-Wabi}).
1985
1986 Here is a list of options that are @emph{only} for compiling Objective-C
1987 and Objective-C++ programs:
1988
1989 @table @gcctabopt
1990 @item -fconstant-string-class=@var{class-name}
1991 @opindex fconstant-string-class
1992 Use @var{class-name} as the name of the class to instantiate for each
1993 literal string specified with the syntax @code{@@"@dots{}"}.  The default
1994 class name is @code{NXConstantString} if the GNU runtime is being used, and
1995 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
1996 @option{-fconstant-cfstrings} option, if also present, will override the
1997 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
1998 to be laid out as constant CoreFoundation strings.
1999
2000 @item -fgnu-runtime
2001 @opindex fgnu-runtime
2002 Generate object code compatible with the standard GNU Objective-C
2003 runtime.  This is the default for most types of systems.
2004
2005 @item -fnext-runtime
2006 @opindex fnext-runtime
2007 Generate output compatible with the NeXT runtime.  This is the default
2008 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2009 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2010 used.
2011
2012 @item -fno-nil-receivers
2013 @opindex fno-nil-receivers
2014 Assume that all Objective-C message dispatches (e.g.,
2015 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2016 is not @code{nil}.  This allows for more efficient entry points in the runtime
2017 to be used.  Currently, this option is only available in conjunction with
2018 the NeXT runtime on Mac OS X 10.3 and later.
2019
2020 @item -fobjc-call-cxx-cdtors
2021 @opindex fobjc-call-cxx-cdtors
2022 For each Objective-C class, check if any of its instance variables is a
2023 C++ object with a non-trivial default constructor.  If so, synthesize a
2024 special @code{- (id) .cxx_construct} instance method that will run
2025 non-trivial default constructors on any such instance variables, in order,
2026 and then return @code{self}.  Similarly, check if any instance variable
2027 is a C++ object with a non-trivial destructor, and if so, synthesize a
2028 special @code{- (void) .cxx_destruct} method that will run
2029 all such default destructors, in reverse order.
2030
2031 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2032 thusly generated will only operate on instance variables declared in the
2033 current Objective-C class, and not those inherited from superclasses.  It
2034 is the responsibility of the Objective-C runtime to invoke all such methods
2035 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2036 will be invoked by the runtime immediately after a new object
2037 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2038 be invoked immediately before the runtime deallocates an object instance.
2039
2040 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2041 support for invoking the @code{- (id) .cxx_construct} and
2042 @code{- (void) .cxx_destruct} methods.
2043
2044 @item -fobjc-direct-dispatch
2045 @opindex fobjc-direct-dispatch
2046 Allow fast jumps to the message dispatcher.  On Darwin this is
2047 accomplished via the comm page.
2048
2049 @item -fobjc-exceptions
2050 @opindex fobjc-exceptions
2051 Enable syntactic support for structured exception handling in Objective-C,
2052 similar to what is offered by C++ and Java.  This option is
2053 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2054 earlier.
2055
2056 @smallexample
2057   @@try @{
2058     @dots{}
2059        @@throw expr;
2060     @dots{}
2061   @}
2062   @@catch (AnObjCClass *exc) @{
2063     @dots{}
2064       @@throw expr;
2065     @dots{}
2066       @@throw;
2067     @dots{}
2068   @}
2069   @@catch (AnotherClass *exc) @{
2070     @dots{}
2071   @}
2072   @@catch (id allOthers) @{
2073     @dots{}
2074   @}
2075   @@finally @{
2076     @dots{}
2077       @@throw expr;
2078     @dots{}
2079   @}
2080 @end smallexample
2081
2082 The @code{@@throw} statement may appear anywhere in an Objective-C or
2083 Objective-C++ program; when used inside of a @code{@@catch} block, the
2084 @code{@@throw} may appear without an argument (as shown above), in which case
2085 the object caught by the @code{@@catch} will be rethrown.
2086
2087 Note that only (pointers to) Objective-C objects may be thrown and
2088 caught using this scheme.  When an object is thrown, it will be caught
2089 by the nearest @code{@@catch} clause capable of handling objects of that type,
2090 analogously to how @code{catch} blocks work in C++ and Java.  A
2091 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2092 any and all Objective-C exceptions not caught by previous @code{@@catch}
2093 clauses (if any).
2094
2095 The @code{@@finally} clause, if present, will be executed upon exit from the
2096 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2097 regardless of whether any exceptions are thrown, caught or rethrown
2098 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2099 of the @code{finally} clause in Java.
2100
2101 There are several caveats to using the new exception mechanism:
2102
2103 @itemize @bullet
2104 @item
2105 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2106 idioms provided by the @code{NSException} class, the new
2107 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2108 systems, due to additional functionality needed in the (NeXT) Objective-C
2109 runtime.
2110
2111 @item
2112 As mentioned above, the new exceptions do not support handling
2113 types other than Objective-C objects.   Furthermore, when used from
2114 Objective-C++, the Objective-C exception model does not interoperate with C++
2115 exceptions at this time.  This means you cannot @code{@@throw} an exception
2116 from Objective-C and @code{catch} it in C++, or vice versa
2117 (i.e., @code{throw @dots{} @@catch}).
2118 @end itemize
2119
2120 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2121 blocks for thread-safe execution:
2122
2123 @smallexample
2124   @@synchronized (ObjCClass *guard) @{
2125     @dots{}
2126   @}
2127 @end smallexample
2128
2129 Upon entering the @code{@@synchronized} block, a thread of execution shall
2130 first check whether a lock has been placed on the corresponding @code{guard}
2131 object by another thread.  If it has, the current thread shall wait until
2132 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2133 the current thread will place its own lock on it, execute the code contained in
2134 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2135 making @code{guard} available to other threads).
2136
2137 Unlike Java, Objective-C does not allow for entire methods to be marked
2138 @code{@@synchronized}.  Note that throwing exceptions out of
2139 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2140 to be unlocked properly.
2141
2142 @item -fobjc-gc
2143 @opindex fobjc-gc
2144 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2145
2146 @item -freplace-objc-classes
2147 @opindex freplace-objc-classes
2148 Emit a special marker instructing @command{ld(1)} not to statically link in
2149 the resulting object file, and allow @command{dyld(1)} to load it in at
2150 run time instead.  This is used in conjunction with the Fix-and-Continue
2151 debugging mode, where the object file in question may be recompiled and
2152 dynamically reloaded in the course of program execution, without the need
2153 to restart the program itself.  Currently, Fix-and-Continue functionality
2154 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2155 and later.
2156
2157 @item -fzero-link
2158 @opindex fzero-link
2159 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2160 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2161 compile time) with static class references that get initialized at load time,
2162 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2163 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2164 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2165 for individual class implementations to be modified during program execution.
2166
2167 @item -gen-decls
2168 @opindex gen-decls
2169 Dump interface declarations for all classes seen in the source file to a
2170 file named @file{@var{sourcename}.decl}.
2171
2172 @item -Wassign-intercept
2173 @opindex Wassign-intercept
2174 Warn whenever an Objective-C assignment is being intercepted by the
2175 garbage collector.
2176
2177 @item -Wno-protocol
2178 @opindex Wno-protocol
2179 If a class is declared to implement a protocol, a warning is issued for
2180 every method in the protocol that is not implemented by the class.  The
2181 default behavior is to issue a warning for every method not explicitly
2182 implemented in the class, even if a method implementation is inherited
2183 from the superclass.  If you use the @option{-Wno-protocol} option, then
2184 methods inherited from the superclass are considered to be implemented,
2185 and no warning is issued for them.
2186
2187 @item -Wselector
2188 @opindex Wselector
2189 Warn if multiple methods of different types for the same selector are
2190 found during compilation.  The check is performed on the list of methods
2191 in the final stage of compilation.  Additionally, a check is performed
2192 for each selector appearing in a @code{@@selector(@dots{})}
2193 expression, and a corresponding method for that selector has been found
2194 during compilation.  Because these checks scan the method table only at
2195 the end of compilation, these warnings are not produced if the final
2196 stage of compilation is not reached, for example because an error is
2197 found during compilation, or because the @option{-fsyntax-only} option is
2198 being used.
2199
2200 @item -Wstrict-selector-match
2201 @opindex Wstrict-selector-match
2202 Warn if multiple methods with differing argument and/or return types are
2203 found for a given selector when attempting to send a message using this
2204 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2205 is off (which is the default behavior), the compiler will omit such warnings
2206 if any differences found are confined to types which share the same size
2207 and alignment.
2208
2209 @item -Wundeclared-selector
2210 @opindex Wundeclared-selector
2211 Warn if a @code{@@selector(@dots{})} expression referring to an
2212 undeclared selector is found.  A selector is considered undeclared if no
2213 method with that name has been declared before the
2214 @code{@@selector(@dots{})} expression, either explicitly in an
2215 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2216 an @code{@@implementation} section.  This option always performs its
2217 checks as soon as a @code{@@selector(@dots{})} expression is found,
2218 while @option{-Wselector} only performs its checks in the final stage of
2219 compilation.  This also enforces the coding style convention
2220 that methods and selectors must be declared before being used.
2221
2222 @item -print-objc-runtime-info
2223 @opindex print-objc-runtime-info
2224 Generate C header describing the largest structure that is passed by
2225 value, if any.
2226
2227 @end table
2228
2229 @node Language Independent Options
2230 @section Options to Control Diagnostic Messages Formatting
2231 @cindex options to control diagnostics formatting
2232 @cindex diagnostic messages
2233 @cindex message formatting
2234
2235 Traditionally, diagnostic messages have been formatted irrespective of
2236 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2237 below can be used to control the diagnostic messages formatting
2238 algorithm, e.g.@: how many characters per line, how often source location
2239 information should be reported.  Right now, only the C++ front end can
2240 honor these options.  However it is expected, in the near future, that
2241 the remaining front ends would be able to digest them correctly.
2242
2243 @table @gcctabopt
2244 @item -fmessage-length=@var{n}
2245 @opindex fmessage-length
2246 Try to format error messages so that they fit on lines of about @var{n}
2247 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2248 the front ends supported by GCC@.  If @var{n} is zero, then no
2249 line-wrapping will be done; each error message will appear on a single
2250 line.
2251
2252 @opindex fdiagnostics-show-location
2253 @item -fdiagnostics-show-location=once
2254 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2255 reporter to emit @emph{once} source location information; that is, in
2256 case the message is too long to fit on a single physical line and has to
2257 be wrapped, the source location won't be emitted (as prefix) again,
2258 over and over, in subsequent continuation lines.  This is the default
2259 behavior.
2260
2261 @item -fdiagnostics-show-location=every-line
2262 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2263 messages reporter to emit the same source location information (as
2264 prefix) for physical lines that result from the process of breaking
2265 a message which is too long to fit on a single line.
2266
2267 @item -fdiagnostics-show-option
2268 @opindex fdiagnostics-show-option
2269 This option instructs the diagnostic machinery to add text to each
2270 diagnostic emitted, which indicates which command line option directly
2271 controls that diagnostic, when such an option is known to the
2272 diagnostic machinery.
2273
2274 @end table
2275
2276 @node Warning Options
2277 @section Options to Request or Suppress Warnings
2278 @cindex options to control warnings
2279 @cindex warning messages
2280 @cindex messages, warning
2281 @cindex suppressing warnings
2282
2283 Warnings are diagnostic messages that report constructions which
2284 are not inherently erroneous but which are risky or suggest there
2285 may have been an error.
2286
2287 You can request many specific warnings with options beginning @samp{-W},
2288 for example @option{-Wimplicit} to request warnings on implicit
2289 declarations.  Each of these specific warning options also has a
2290 negative form beginning @samp{-Wno-} to turn off warnings;
2291 for example, @option{-Wno-implicit}.  This manual lists only one of the
2292 two forms, whichever is not the default.
2293
2294 The following options control the amount and kinds of warnings produced
2295 by GCC; for further, language-specific options also refer to
2296 @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect
2297 Options}.
2298
2299 @table @gcctabopt
2300 @cindex syntax checking
2301 @item -fsyntax-only
2302 @opindex fsyntax-only
2303 Check the code for syntax errors, but don't do anything beyond that.
2304
2305 @item -pedantic
2306 @opindex pedantic
2307 Issue all the warnings demanded by strict ISO C and ISO C++;
2308 reject all programs that use forbidden extensions, and some other
2309 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2310 version of the ISO C standard specified by any @option{-std} option used.
2311
2312 Valid ISO C and ISO C++ programs should compile properly with or without
2313 this option (though a rare few will require @option{-ansi} or a
2314 @option{-std} option specifying the required version of ISO C)@.  However,
2315 without this option, certain GNU extensions and traditional C and C++
2316 features are supported as well.  With this option, they are rejected.
2317
2318 @option{-pedantic} does not cause warning messages for use of the
2319 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2320 warnings are also disabled in the expression that follows
2321 @code{__extension__}.  However, only system header files should use
2322 these escape routes; application programs should avoid them.
2323 @xref{Alternate Keywords}.
2324
2325 Some users try to use @option{-pedantic} to check programs for strict ISO
2326 C conformance.  They soon find that it does not do quite what they want:
2327 it finds some non-ISO practices, but not all---only those for which
2328 ISO C @emph{requires} a diagnostic, and some others for which
2329 diagnostics have been added.
2330
2331 A feature to report any failure to conform to ISO C might be useful in
2332 some instances, but would require considerable additional work and would
2333 be quite different from @option{-pedantic}.  We don't have plans to
2334 support such a feature in the near future.
2335
2336 Where the standard specified with @option{-std} represents a GNU
2337 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2338 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2339 extended dialect is based.  Warnings from @option{-pedantic} are given
2340 where they are required by the base standard.  (It would not make sense
2341 for such warnings to be given only for features not in the specified GNU
2342 C dialect, since by definition the GNU dialects of C include all
2343 features the compiler supports with the given option, and there would be
2344 nothing to warn about.)
2345
2346 @item -pedantic-errors
2347 @opindex pedantic-errors
2348 Like @option{-pedantic}, except that errors are produced rather than
2349 warnings.
2350
2351 @item -w
2352 @opindex w
2353 Inhibit all warning messages.
2354
2355 @item -Wno-import
2356 @opindex Wno-import
2357 Inhibit warning messages about the use of @samp{#import}.
2358
2359 @item -Wchar-subscripts
2360 @opindex Wchar-subscripts
2361 Warn if an array subscript has type @code{char}.  This is a common cause
2362 of error, as programmers often forget that this type is signed on some
2363 machines.
2364 This warning is enabled by @option{-Wall}.
2365
2366 @item -Wcomment
2367 @opindex Wcomment
2368 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2369 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2370 This warning is enabled by @option{-Wall}.
2371
2372 @item -Wfatal-errors
2373 @opindex Wfatal-errors
2374 This option causes the compiler to abort compilation on the first error
2375 occurred rather than trying to keep going and printing further error
2376 messages.
2377
2378 @item -Wformat
2379 @opindex Wformat
2380 @opindex ffreestanding
2381 @opindex fno-builtin
2382 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2383 the arguments supplied have types appropriate to the format string
2384 specified, and that the conversions specified in the format string make
2385 sense.  This includes standard functions, and others specified by format
2386 attributes (@pxref{Function Attributes}), in the @code{printf},
2387 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2388 not in the C standard) families (or other target-specific families).
2389 Which functions are checked without format attributes having been
2390 specified depends on the standard version selected, and such checks of
2391 functions without the attribute specified are disabled by
2392 @option{-ffreestanding} or @option{-fno-builtin}.
2393
2394 The formats are checked against the format features supported by GNU
2395 libc version 2.2.  These include all ISO C90 and C99 features, as well
2396 as features from the Single Unix Specification and some BSD and GNU
2397 extensions.  Other library implementations may not support all these
2398 features; GCC does not support warning about features that go beyond a
2399 particular library's limitations.  However, if @option{-pedantic} is used
2400 with @option{-Wformat}, warnings will be given about format features not
2401 in the selected standard version (but not for @code{strfmon} formats,
2402 since those are not in any version of the C standard).  @xref{C Dialect
2403 Options,,Options Controlling C Dialect}.
2404
2405 Since @option{-Wformat} also checks for null format arguments for
2406 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2407
2408 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2409 aspects of format checking, the options @option{-Wformat-y2k},
2410 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2411 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2412 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2413
2414 @item -Wformat-y2k
2415 @opindex Wformat-y2k
2416 If @option{-Wformat} is specified, also warn about @code{strftime}
2417 formats which may yield only a two-digit year.
2418
2419 @item -Wno-format-extra-args
2420 @opindex Wno-format-extra-args
2421 If @option{-Wformat} is specified, do not warn about excess arguments to a
2422 @code{printf} or @code{scanf} format function.  The C standard specifies
2423 that such arguments are ignored.
2424
2425 Where the unused arguments lie between used arguments that are
2426 specified with @samp{$} operand number specifications, normally
2427 warnings are still given, since the implementation could not know what
2428 type to pass to @code{va_arg} to skip the unused arguments.  However,
2429 in the case of @code{scanf} formats, this option will suppress the
2430 warning if the unused arguments are all pointers, since the Single
2431 Unix Specification says that such unused arguments are allowed.
2432
2433 @item -Wno-format-zero-length
2434 @opindex Wno-format-zero-length
2435 If @option{-Wformat} is specified, do not warn about zero-length formats.
2436 The C standard specifies that zero-length formats are allowed.
2437
2438 @item -Wformat-nonliteral
2439 @opindex Wformat-nonliteral
2440 If @option{-Wformat} is specified, also warn if the format string is not a
2441 string literal and so cannot be checked, unless the format function
2442 takes its format arguments as a @code{va_list}.
2443
2444 @item -Wformat-security
2445 @opindex Wformat-security
2446 If @option{-Wformat} is specified, also warn about uses of format
2447 functions that represent possible security problems.  At present, this
2448 warns about calls to @code{printf} and @code{scanf} functions where the
2449 format string is not a string literal and there are no format arguments,
2450 as in @code{printf (foo);}.  This may be a security hole if the format
2451 string came from untrusted input and contains @samp{%n}.  (This is
2452 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2453 in future warnings may be added to @option{-Wformat-security} that are not
2454 included in @option{-Wformat-nonliteral}.)
2455
2456 @item -Wformat=2
2457 @opindex Wformat=2
2458 Enable @option{-Wformat} plus format checks not included in
2459 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2460 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2461
2462 @item -Wnonnull
2463 @opindex Wnonnull
2464 Warn about passing a null pointer for arguments marked as
2465 requiring a non-null value by the @code{nonnull} function attribute.
2466
2467 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2468 can be disabled with the @option{-Wno-nonnull} option.
2469
2470 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2471 @opindex Winit-self
2472 Warn about uninitialized variables which are initialized with themselves.
2473 Note this option can only be used with the @option{-Wuninitialized} option,
2474 which in turn only works with @option{-O1} and above.
2475
2476 For example, GCC will warn about @code{i} being uninitialized in the
2477 following snippet only when @option{-Winit-self} has been specified:
2478 @smallexample
2479 @group
2480 int f()
2481 @{
2482   int i = i;
2483   return i;
2484 @}
2485 @end group
2486 @end smallexample
2487
2488 @item -Wimplicit-int
2489 @opindex Wimplicit-int
2490 Warn when a declaration does not specify a type.
2491 This warning is enabled by @option{-Wall}.
2492
2493 @item -Wimplicit-function-declaration
2494 @itemx -Werror-implicit-function-declaration
2495 @opindex Wimplicit-function-declaration
2496 @opindex Werror-implicit-function-declaration
2497 Give a warning (or error) whenever a function is used before being
2498 declared.  The form @option{-Wno-error-implicit-function-declaration}
2499 is not supported.
2500 This warning is enabled by @option{-Wall} (as a warning, not an error).
2501
2502 @item -Wimplicit
2503 @opindex Wimplicit
2504 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2505 This warning is enabled by @option{-Wall}.
2506
2507 @item -Wmain
2508 @opindex Wmain
2509 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
2510 function with external linkage, returning int, taking either zero
2511 arguments, two, or three arguments of appropriate types.
2512 This warning is enabled by @option{-Wall}.
2513
2514 @item -Wmissing-braces
2515 @opindex Wmissing-braces
2516 Warn if an aggregate or union initializer is not fully bracketed.  In
2517 the following example, the initializer for @samp{a} is not fully
2518 bracketed, but that for @samp{b} is fully bracketed.
2519
2520 @smallexample
2521 int a[2][2] = @{ 0, 1, 2, 3 @};
2522 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2523 @end smallexample
2524
2525 This warning is enabled by @option{-Wall}.
2526
2527 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2528 @opindex Wmissing-include-dirs
2529 Warn if a user-supplied include directory does not exist.
2530
2531 @item -Wparentheses
2532 @opindex Wparentheses
2533 Warn if parentheses are omitted in certain contexts, such
2534 as when there is an assignment in a context where a truth value
2535 is expected, or when operators are nested whose precedence people
2536 often get confused about.
2537
2538 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2539 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2540 interpretation from that of ordinary mathematical notation.
2541
2542 Also warn about constructions where there may be confusion to which
2543 @code{if} statement an @code{else} branch belongs.  Here is an example of
2544 such a case:
2545
2546 @smallexample
2547 @group
2548 @{
2549   if (a)
2550     if (b)
2551       foo ();
2552   else
2553     bar ();
2554 @}
2555 @end group
2556 @end smallexample
2557
2558 In C/C++, every @code{else} branch belongs to the innermost possible
2559 @code{if} statement, which in this example is @code{if (b)}.  This is
2560 often not what the programmer expected, as illustrated in the above
2561 example by indentation the programmer chose.  When there is the
2562 potential for this confusion, GCC will issue a warning when this flag
2563 is specified.  To eliminate the warning, add explicit braces around
2564 the innermost @code{if} statement so there is no way the @code{else}
2565 could belong to the enclosing @code{if}.  The resulting code would
2566 look like this:
2567
2568 @smallexample
2569 @group
2570 @{
2571   if (a)
2572     @{
2573       if (b)
2574         foo ();
2575       else
2576         bar ();
2577     @}
2578 @}
2579 @end group
2580 @end smallexample
2581
2582 This warning is enabled by @option{-Wall}.
2583
2584 @item -Wsequence-point
2585 @opindex Wsequence-point
2586 Warn about code that may have undefined semantics because of violations
2587 of sequence point rules in the C and C++ standards.
2588
2589 The C and C++ standards defines the order in which expressions in a C/C++
2590 program are evaluated in terms of @dfn{sequence points}, which represent
2591 a partial ordering between the execution of parts of the program: those
2592 executed before the sequence point, and those executed after it.  These
2593 occur after the evaluation of a full expression (one which is not part
2594 of a larger expression), after the evaluation of the first operand of a
2595 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
2596 function is called (but after the evaluation of its arguments and the
2597 expression denoting the called function), and in certain other places.
2598 Other than as expressed by the sequence point rules, the order of
2599 evaluation of subexpressions of an expression is not specified.  All
2600 these rules describe only a partial order rather than a total order,
2601 since, for example, if two functions are called within one expression
2602 with no sequence point between them, the order in which the functions
2603 are called is not specified.  However, the standards committee have
2604 ruled that function calls do not overlap.
2605
2606 It is not specified when between sequence points modifications to the
2607 values of objects take effect.  Programs whose behavior depends on this
2608 have undefined behavior; the C and C++ standards specify that ``Between
2609 the previous and next sequence point an object shall have its stored
2610 value modified at most once by the evaluation of an expression.  
2611 Furthermore, the prior value shall be read only to determine the value
2612 to be stored.''.  If a program breaks these rules, the results on any
2613 particular implementation are entirely unpredictable.
2614
2615 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2616 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
2617 diagnosed by this option, and it may give an occasional false positive
2618 result, but in general it has been found fairly effective at detecting
2619 this sort of problem in programs.
2620
2621 The standard is worded confusingly, therefore there is some debate
2622 over the precise meaning of the sequence point rules in subtle cases.
2623 Links to discussions of the problem, including proposed formal
2624 definitions, may be found on the GCC readings page, at
2625 @w{@uref{http://gcc.gnu.org/readings.html}}.
2626
2627 This warning is enabled by @option{-Wall} for C and C++.
2628
2629 @item -Wreturn-type
2630 @opindex Wreturn-type
2631 Warn whenever a function is defined with a return-type that defaults to
2632 @code{int}.  Also warn about any @code{return} statement with no
2633 return-value in a function whose return-type is not @code{void}.
2634
2635 For C, also warn if the return type of a function has a type qualifier
2636 such as @code{const}.  Such a type qualifier has no effect, since the
2637 value returned by a function is not an lvalue.  ISO C prohibits
2638 qualified @code{void} return types on function definitions, so such
2639 return types always receive a warning even without this option.
2640
2641 For C++, a function without return type always produces a diagnostic
2642 message, even when @option{-Wno-return-type} is specified.  The only
2643 exceptions are @samp{main} and functions defined in system headers.
2644
2645 This warning is enabled by @option{-Wall}.
2646
2647 @item -Wswitch
2648 @opindex Wswitch
2649 Warn whenever a @code{switch} statement has an index of enumerated type
2650 and lacks a @code{case} for one or more of the named codes of that
2651 enumeration.  (The presence of a @code{default} label prevents this
2652 warning.)  @code{case} labels outside the enumeration range also
2653 provoke warnings when this option is used.
2654 This warning is enabled by @option{-Wall}.
2655
2656 @item -Wswitch-default
2657 @opindex Wswitch-switch
2658 Warn whenever a @code{switch} statement does not have a @code{default}
2659 case.
2660
2661 @item -Wswitch-enum
2662 @opindex Wswitch-enum
2663 Warn whenever a @code{switch} statement has an index of enumerated type
2664 and lacks a @code{case} for one or more of the named codes of that
2665 enumeration.  @code{case} labels outside the enumeration range also
2666 provoke warnings when this option is used.
2667
2668 @item -Wtrigraphs
2669 @opindex Wtrigraphs
2670 Warn if any trigraphs are encountered that might change the meaning of
2671 the program (trigraphs within comments are not warned about).
2672 This warning is enabled by @option{-Wall}.
2673
2674 @item -Wunused-function
2675 @opindex Wunused-function
2676 Warn whenever a static function is declared but not defined or a
2677 non-inline static function is unused.
2678 This warning is enabled by @option{-Wall}.
2679
2680 @item -Wunused-label
2681 @opindex Wunused-label
2682 Warn whenever a label is declared but not used.
2683 This warning is enabled by @option{-Wall}.
2684
2685 To suppress this warning use the @samp{unused} attribute
2686 (@pxref{Variable Attributes}).
2687
2688 @item -Wunused-parameter
2689 @opindex Wunused-parameter
2690 Warn whenever a function parameter is unused aside from its declaration.
2691
2692 To suppress this warning use the @samp{unused} attribute
2693 (@pxref{Variable Attributes}).
2694
2695 @item -Wunused-variable
2696 @opindex Wunused-variable
2697 Warn whenever a local variable or non-constant static variable is unused
2698 aside from its declaration.
2699 This warning is enabled by @option{-Wall}.
2700
2701 To suppress this warning use the @samp{unused} attribute
2702 (@pxref{Variable Attributes}).
2703
2704 @item -Wunused-value
2705 @opindex Wunused-value
2706 Warn whenever a statement computes a result that is explicitly not used.
2707 This warning is enabled by @option{-Wall}.
2708
2709 To suppress this warning cast the expression to @samp{void}.
2710
2711 @item -Wunused
2712 @opindex Wunused
2713 All the above @option{-Wunused} options combined.
2714
2715 In order to get a warning about an unused function parameter, you must
2716 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
2717 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
2718
2719 @item -Wuninitialized
2720 @opindex Wuninitialized
2721 Warn if an automatic variable is used without first being initialized or
2722 if a variable may be clobbered by a @code{setjmp} call.
2723
2724 These warnings are possible only in optimizing compilation,
2725 because they require data flow information that is computed only
2726 when optimizing.  If you do not specify @option{-O}, you will not get 
2727 these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
2728 requiring @option{-O}.
2729
2730 If you want to warn about code which uses the uninitialized value of the
2731 variable in its own initializer, use the @option{-Winit-self} option.
2732
2733 These warnings occur for individual uninitialized or clobbered
2734 elements of structure, union or array variables as well as for
2735 variables which are uninitialized or clobbered as a whole.  They do
2736 not occur for variables or elements declared @code{volatile}.  Because
2737 these warnings depend on optimization, the exact variables or elements
2738 for which there are warnings will depend on the precise optimization
2739 options and version of GCC used.
2740
2741 Note that there may be no warning about a variable that is used only
2742 to compute a value that itself is never used, because such
2743 computations may be deleted by data flow analysis before the warnings
2744 are printed.
2745
2746 These warnings are made optional because GCC is not smart
2747 enough to see all the reasons why the code might be correct
2748 despite appearing to have an error.  Here is one example of how
2749 this can happen:
2750
2751 @smallexample
2752 @group
2753 @{
2754   int x;
2755   switch (y)
2756     @{
2757     case 1: x = 1;
2758       break;
2759     case 2: x = 4;
2760       break;
2761     case 3: x = 5;
2762     @}
2763   foo (x);
2764 @}
2765 @end group
2766 @end smallexample
2767
2768 @noindent
2769 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2770 always initialized, but GCC doesn't know this.  Here is
2771 another common case:
2772
2773 @smallexample
2774 @{
2775   int save_y;
2776   if (change_y) save_y = y, y = new_y;
2777   @dots{}
2778   if (change_y) y = save_y;
2779 @}
2780 @end smallexample
2781
2782 @noindent
2783 This has no bug because @code{save_y} is used only if it is set.
2784
2785 @cindex @code{longjmp} warnings
2786 This option also warns when a non-volatile automatic variable might be
2787 changed by a call to @code{longjmp}.  These warnings as well are possible
2788 only in optimizing compilation.
2789
2790 The compiler sees only the calls to @code{setjmp}.  It cannot know
2791 where @code{longjmp} will be called; in fact, a signal handler could
2792 call it at any point in the code.  As a result, you may get a warning
2793 even when there is in fact no problem because @code{longjmp} cannot
2794 in fact be called at the place which would cause a problem.
2795
2796 Some spurious warnings can be avoided if you declare all the functions
2797 you use that never return as @code{noreturn}.  @xref{Function
2798 Attributes}.
2799
2800 This warning is enabled by @option{-Wall}.
2801
2802 @item -Wunknown-pragmas
2803 @opindex Wunknown-pragmas
2804 @cindex warning for unknown pragmas
2805 @cindex unknown pragmas, warning
2806 @cindex pragmas, warning of unknown
2807 Warn when a #pragma directive is encountered which is not understood by
2808 GCC@.  If this command line option is used, warnings will even be issued
2809 for unknown pragmas in system header files.  This is not the case if
2810 the warnings were only enabled by the @option{-Wall} command line option.
2811
2812 @item -Wno-pragmas
2813 @opindex Wno-pragmas
2814 @opindex Wpragmas
2815 Do not warn about misuses of pragmas, such as incorrect parameters,
2816 invalid syntax, or conflicts between pragmas.  See also
2817 @samp{-Wunknown-pragmas}.
2818
2819 @item -Wstrict-aliasing
2820 @opindex Wstrict-aliasing
2821 This option is only active when @option{-fstrict-aliasing} is active.
2822 It warns about code which might break the strict aliasing rules that the
2823 compiler is using for optimization.  The warning does not catch all
2824 cases, but does attempt to catch the more common pitfalls.  It is
2825 included in @option{-Wall}.
2826
2827 @item -Wstrict-aliasing=2
2828 @opindex Wstrict-aliasing=2
2829 This option is only active when @option{-fstrict-aliasing} is active.
2830 It warns about code which might break the strict aliasing rules that the
2831 compiler is using for optimization.  This warning catches more cases than
2832 @option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
2833 cases that are safe.
2834
2835 @item -Wall
2836 @opindex Wall
2837 All of the above @samp{-W} options combined.  This enables all the
2838 warnings about constructions that some users consider questionable, and
2839 that are easy to avoid (or modify to prevent the warning), even in
2840 conjunction with macros.  This also enables some language-specific
2841 warnings described in @ref{C++ Dialect Options} and
2842 @ref{Objective-C and Objective-C++ Dialect Options}.
2843 @end table
2844
2845 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
2846 Some of them warn about constructions that users generally do not
2847 consider questionable, but which occasionally you might wish to check
2848 for; others warn about constructions that are necessary or hard to avoid
2849 in some cases, and there is no simple way to modify the code to suppress
2850 the warning.
2851
2852 @table @gcctabopt
2853 @item -Wextra
2854 @opindex W
2855 @opindex Wextra
2856 (This option used to be called @option{-W}.  The older name is still
2857 supported, but the newer name is more descriptive.)  Print extra warning
2858 messages for these events:
2859
2860 @itemize @bullet
2861 @item
2862 A function can return either with or without a value.  (Falling
2863 off the end of the function body is considered returning without
2864 a value.)  For example, this function would evoke such a
2865 warning:
2866
2867 @smallexample
2868 @group
2869 foo (a)
2870 @{
2871   if (a > 0)
2872     return a;
2873 @}
2874 @end group
2875 @end smallexample
2876
2877 @item
2878 An expression-statement or the left-hand side of a comma expression
2879 contains no side effects.
2880 To suppress the warning, cast the unused expression to void.
2881 For example, an expression such as @samp{x[i,j]} will cause a warning,
2882 but @samp{x[(void)i,j]} will not.
2883
2884 @item
2885 An unsigned value is compared against zero with @samp{<} or @samp{>=}.
2886
2887 @item
2888 Storage-class specifiers like @code{static} are not the first things in
2889 a declaration.  According to the C Standard, this usage is obsolescent.
2890
2891 @item
2892 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
2893 arguments.
2894
2895 @item
2896 A comparison between signed and unsigned values could produce an
2897 incorrect result when the signed value is converted to unsigned.
2898 (But don't warn if @option{-Wno-sign-compare} is also specified.)
2899
2900 @item
2901 An aggregate has an initializer which does not initialize all members.
2902 This warning can be independently controlled by
2903 @option{-Wmissing-field-initializers}.
2904
2905 @item
2906 An initialized field without side effects is overridden when using
2907 designated initializers (@pxref{Designated Inits, , Designated
2908 Initializers}).  This warning can be independently controlled by
2909 @option{-Woverride-init}.
2910
2911 @item
2912 A function parameter is declared without a type specifier in K&R-style
2913 functions:
2914
2915 @smallexample
2916 void foo(bar) @{ @}
2917 @end smallexample
2918
2919 @item
2920 An empty body occurs in an @samp{if} or @samp{else} statement. This
2921 warning can be independently controlled by @option{-Wempty-body}.
2922
2923 @item
2924 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2925 @samp{>}, or @samp{>=}.
2926
2927 @item
2928 A variable might be changed by @samp{longjmp} or @samp{vfork}.
2929 This warning can be independently controlled by @option{-Wclobbered}.
2930
2931 @item
2932 Any of several floating-point events that often indicate errors, such as
2933 overflow, underflow, loss of precision, etc.
2934
2935 @item @r{(C++ only)}
2936 An enumerator and a non-enumerator both appear in a conditional expression.
2937
2938 @item @r{(C++ only)}
2939 A non-static reference or non-static @samp{const} member appears in a
2940 class without constructors.
2941
2942 @item @r{(C++ only)}
2943 Ambiguous virtual bases.
2944
2945 @item @r{(C++ only)}
2946 Subscripting an array which has been declared @samp{register}.
2947
2948 @item @r{(C++ only)}
2949 Taking the address of a variable which has been declared @samp{register}.
2950
2951 @item @r{(C++ only)}
2952 A base class is not initialized in a derived class' copy constructor.
2953 @end itemize
2954
2955 @item -Wno-div-by-zero
2956 @opindex Wno-div-by-zero
2957 @opindex Wdiv-by-zero
2958 Do not warn about compile-time integer division by zero.  Floating point
2959 division by zero is not warned about, as it can be a legitimate way of
2960 obtaining infinities and NaNs.
2961
2962 @item -Wsystem-headers
2963 @opindex Wsystem-headers
2964 @cindex warnings from system headers
2965 @cindex system headers, warnings from
2966 Print warning messages for constructs found in system header files.
2967 Warnings from system headers are normally suppressed, on the assumption
2968 that they usually do not indicate real problems and would only make the
2969 compiler output harder to read.  Using this command line option tells
2970 GCC to emit warnings from system headers as if they occurred in user
2971 code.  However, note that using @option{-Wall} in conjunction with this
2972 option will @emph{not} warn about unknown pragmas in system
2973 headers---for that, @option{-Wunknown-pragmas} must also be used.
2974
2975 @item -Wfloat-equal
2976 @opindex Wfloat-equal
2977 Warn if floating point values are used in equality comparisons.
2978
2979 The idea behind this is that sometimes it is convenient (for the
2980 programmer) to consider floating-point values as approximations to
2981 infinitely precise real numbers.  If you are doing this, then you need
2982 to compute (by analyzing the code, or in some other way) the maximum or
2983 likely maximum error that the computation introduces, and allow for it
2984 when performing comparisons (and when producing output, but that's a
2985 different problem).  In particular, instead of testing for equality, you
2986 would check to see whether the two values have ranges that overlap; and
2987 this is done with the relational operators, so equality comparisons are
2988 probably mistaken.
2989
2990 @item -Wtraditional @r{(C only)}
2991 @opindex Wtraditional
2992 Warn about certain constructs that behave differently in traditional and
2993 ISO C@.  Also warn about ISO C constructs that have no traditional C
2994 equivalent, and/or problematic constructs which should be avoided.
2995
2996 @itemize @bullet
2997 @item
2998 Macro parameters that appear within string literals in the macro body.
2999 In traditional C macro replacement takes place within string literals,
3000 but does not in ISO C@.
3001
3002 @item
3003 In traditional C, some preprocessor directives did not exist.
3004 Traditional preprocessors would only consider a line to be a directive
3005 if the @samp{#} appeared in column 1 on the line.  Therefore
3006 @option{-Wtraditional} warns about directives that traditional C
3007 understands but would ignore because the @samp{#} does not appear as the
3008 first character on the line.  It also suggests you hide directives like
3009 @samp{#pragma} not understood by traditional C by indenting them.  Some
3010 traditional implementations would not recognize @samp{#elif}, so it
3011 suggests avoiding it altogether.
3012
3013 @item
3014 A function-like macro that appears without arguments.
3015
3016 @item
3017 The unary plus operator.
3018
3019 @item
3020 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3021 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3022 constants.)  Note, these suffixes appear in macros defined in the system
3023 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3024 Use of these macros in user code might normally lead to spurious
3025 warnings, however GCC's integrated preprocessor has enough context to
3026 avoid warning in these cases.
3027
3028 @item
3029 A function declared external in one block and then used after the end of
3030 the block.
3031
3032 @item
3033 A @code{switch} statement has an operand of type @code{long}.
3034
3035 @item
3036 A non-@code{static} function declaration follows a @code{static} one.
3037 This construct is not accepted by some traditional C compilers.
3038
3039 @item
3040 The ISO type of an integer constant has a different width or
3041 signedness from its traditional type.  This warning is only issued if
3042 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3043 typically represent bit patterns, are not warned about.
3044
3045 @item
3046 Usage of ISO string concatenation is detected.
3047
3048 @item
3049 Initialization of automatic aggregates.
3050
3051 @item
3052 Identifier conflicts with labels.  Traditional C lacks a separate
3053 namespace for labels.
3054
3055 @item
3056 Initialization of unions.  If the initializer is zero, the warning is
3057 omitted.  This is done under the assumption that the zero initializer in
3058 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3059 initializer warnings and relies on default initialization to zero in the
3060 traditional C case.
3061
3062 @item
3063 Conversions by prototypes between fixed/floating point values and vice
3064 versa.  The absence of these prototypes when compiling with traditional
3065 C would cause serious problems.  This is a subset of the possible
3066 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3067
3068 @item
3069 Use of ISO C style function definitions.  This warning intentionally is
3070 @emph{not} issued for prototype declarations or variadic functions
3071 because these ISO C features will appear in your code when using
3072 libiberty's traditional C compatibility macros, @code{PARAMS} and
3073 @code{VPARAMS}.  This warning is also bypassed for nested functions
3074 because that feature is already a GCC extension and thus not relevant to
3075 traditional C compatibility.
3076 @end itemize
3077
3078 @item -Wtraditional-conversion @r{(C only)}
3079 @opindex Wtraditional-conversion
3080 Warn if a prototype causes a type conversion that is different from what
3081 would happen to the same argument in the absence of a prototype.  This
3082 includes conversions of fixed point to floating and vice versa, and
3083 conversions changing the width or signedness of a fixed point argument
3084 except when the same as the default promotion.
3085
3086 @item -Wdeclaration-after-statement @r{(C only)}
3087 @opindex Wdeclaration-after-statement
3088 Warn when a declaration is found after a statement in a block.  This
3089 construct, known from C++, was introduced with ISO C99 and is by default
3090 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3091 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3092
3093 @item -Wundef
3094 @opindex Wundef
3095 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3096
3097 @item -Wno-endif-labels
3098 @opindex Wno-endif-labels
3099 @opindex Wendif-labels
3100 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3101
3102 @item -Wshadow
3103 @opindex Wshadow
3104 Warn whenever a local variable shadows another local variable, parameter or
3105 global variable or whenever a built-in function is shadowed.
3106
3107 @item -Wlarger-than-@var{len}
3108 @opindex Wlarger-than
3109 Warn whenever an object of larger than @var{len} bytes is defined.
3110
3111 @item -Wunsafe-loop-optimizations
3112 @opindex Wunsafe-loop-optimizations
3113 Warn if the loop cannot be optimized because the compiler could not
3114 assume anything on the bounds of the loop indices.  With
3115 @option{-funsafe-loop-optimizations} warn if the compiler made
3116 such assumptions.
3117
3118 @item -Wpointer-arith
3119 @opindex Wpointer-arith
3120 Warn about anything that depends on the ``size of'' a function type or
3121 of @code{void}.  GNU C assigns these types a size of 1, for
3122 convenience in calculations with @code{void *} pointers and pointers
3123 to functions.
3124
3125 @item -Wbad-function-cast @r{(C only)}
3126 @opindex Wbad-function-cast
3127 Warn whenever a function call is cast to a non-matching type.
3128 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3129
3130 @item -Wc++-compat
3131 Warn about ISO C constructs that are outside of the common subset of
3132 ISO C and ISO C++, e.g.@: request for implicit conversion from
3133 @code{void *} to a pointer to non-@code{void} type.
3134
3135 @item -Wcast-qual
3136 @opindex Wcast-qual
3137 Warn whenever a pointer is cast so as to remove a type qualifier from
3138 the target type.  For example, warn if a @code{const char *} is cast
3139 to an ordinary @code{char *}.
3140
3141 @item -Wcast-align
3142 @opindex Wcast-align
3143 Warn whenever a pointer is cast such that the required alignment of the
3144 target is increased.  For example, warn if a @code{char *} is cast to
3145 an @code{int *} on machines where integers can only be accessed at
3146 two- or four-byte boundaries.
3147
3148 @item -Wwrite-strings
3149 @opindex Wwrite-strings
3150 When compiling C, give string constants the type @code{const
3151 char[@var{length}]} so that
3152 copying the address of one into a non-@code{const} @code{char *}
3153 pointer will get a warning; when compiling C++, warn about the
3154 deprecated conversion from string literals to @code{char *}.  This
3155 warning, by default, is enabled for C++ programs.
3156 These warnings will help you find at
3157 compile time code that can try to write into a string constant, but
3158 only if you have been very careful about using @code{const} in
3159 declarations and prototypes.  Otherwise, it will just be a nuisance;
3160 this is why we did not make @option{-Wall} request these warnings.
3161
3162 @item -Wclobbered
3163 @opindex Wclobbered
3164 Warn for variables that might be changed by @samp{longjmp} or
3165 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3166
3167 @item -Wconversion
3168 @opindex Wconversion
3169 Warn for implicit conversions that may alter a value. This includes
3170 conversions between real and integer, like @code{abs (x)} when
3171 @code{x} is @code{double}; conversions between signed and unsigned,
3172 like @code{unsigned ui = -1}; and conversions to smaller types, like
3173 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3174 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3175 changed by the conversion like in @code{abs (2.0)}.
3176
3177 @item -Wempty-body
3178 @opindex Wempty-body
3179 An empty body occurs in an @samp{if} or @samp{else} statement. 
3180 This warning is also enabled by @option{-Wextra}.
3181
3182 @item -Wsign-compare
3183 @opindex Wsign-compare
3184 @cindex warning for comparison of signed and unsigned values
3185 @cindex comparison of signed and unsigned values, warning
3186 @cindex signed and unsigned values, comparison warning
3187 Warn when a comparison between signed and unsigned values could produce
3188 an incorrect result when the signed value is converted to unsigned.
3189 This warning is also enabled by @option{-Wextra}; to get the other warnings
3190 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3191
3192 @item -Waggregate-return
3193 @opindex Waggregate-return
3194 Warn if any functions that return structures or unions are defined or
3195 called.  (In languages where you can return an array, this also elicits
3196 a warning.)
3197
3198 @item -Walways-true
3199 @opindex Walways-true
3200 Warn about comparisons which are always true such as testing if
3201 unsigned values are greater than or equal to zero.  This warning is
3202 enabled by @option{-Wall}.
3203
3204 @item -Wno-attributes
3205 @opindex Wno-attributes
3206 @opindex Wattributes
3207 Do not warn if an unexpected @code{__attribute__} is used, such as
3208 unrecognized attributes, function attributes applied to variables,
3209 etc.  This will not stop errors for incorrect use of supported
3210 attributes.
3211
3212 @item -Wstrict-prototypes @r{(C only)}
3213 @opindex Wstrict-prototypes
3214 Warn if a function is declared or defined without specifying the
3215 argument types.  (An old-style function definition is permitted without
3216 a warning if preceded by a declaration which specifies the argument
3217 types.)
3218
3219 @item -Wold-style-definition @r{(C only)}
3220 @opindex Wold-style-definition
3221 Warn if an old-style function definition is used.  A warning is given
3222 even if there is a previous prototype.
3223
3224 @item -Wmissing-prototypes @r{(C only)}
3225 @opindex Wmissing-prototypes
3226 Warn if a global function is defined without a previous prototype
3227 declaration.  This warning is issued even if the definition itself
3228 provides a prototype.  The aim is to detect global functions that fail
3229 to be declared in header files.
3230
3231 @item -Wmissing-declarations @r{(C and C++ only)}
3232 @opindex Wmissing-declarations
3233 Warn if a global function is defined without a previous declaration.
3234 Do so even if the definition itself provides a prototype.
3235 Use this option to detect global functions that are not declared in
3236 header files.  In C++, no warnings are issued for function templates,
3237 or for inline functions, or for functions in anonymous namespaces.
3238
3239 @item -Wmissing-field-initializers
3240 @opindex Wmissing-field-initializers
3241 @opindex W
3242 @opindex Wextra
3243 Warn if a structure's initializer has some fields missing.  For
3244 example, the following code would cause such a warning, because
3245 @code{x.h} is implicitly zero:
3246
3247 @smallexample
3248 struct s @{ int f, g, h; @};
3249 struct s x = @{ 3, 4 @};
3250 @end smallexample
3251
3252 This option does not warn about designated initializers, so the following
3253 modification would not trigger a warning:
3254
3255 @smallexample
3256 struct s @{ int f, g, h; @};
3257 struct s x = @{ .f = 3, .g = 4 @};
3258 @end smallexample
3259
3260 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3261 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3262
3263 @item -Wmissing-noreturn
3264 @opindex Wmissing-noreturn
3265 Warn about functions which might be candidates for attribute @code{noreturn}.
3266 Note these are only possible candidates, not absolute ones.  Care should
3267 be taken to manually verify functions actually do not ever return before
3268 adding the @code{noreturn} attribute, otherwise subtle code generation
3269 bugs could be introduced.  You will not get a warning for @code{main} in
3270 hosted C environments.
3271
3272 @item -Wmissing-format-attribute
3273 @opindex Wmissing-format-attribute
3274 @opindex Wformat
3275 Warn about function pointers which might be candidates for @code{format}
3276 attributes.  Note these are only possible candidates, not absolute ones.
3277 GCC will guess that function pointers with @code{format} attributes that
3278 are used in assignment, initialization, parameter passing or return
3279 statements should have a corresponding @code{format} attribute in the
3280 resulting type.  I.e.@: the left-hand side of the assignment or
3281 initialization, the type of the parameter variable, or the return type
3282 of the containing function respectively should also have a @code{format}
3283 attribute to avoid the warning.
3284
3285 GCC will also warn about function definitions which might be
3286 candidates for @code{format} attributes.  Again, these are only
3287 possible candidates.  GCC will guess that @code{format} attributes
3288 might be appropriate for any function that calls a function like
3289 @code{vprintf} or @code{vscanf}, but this might not always be the
3290 case, and some functions for which @code{format} attributes are
3291 appropriate may not be detected.
3292
3293 @item -Wno-multichar
3294 @opindex Wno-multichar
3295 @opindex Wmultichar
3296 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3297 Usually they indicate a typo in the user's code, as they have
3298 implementation-defined values, and should not be used in portable code.
3299
3300 @item -Wnormalized=<none|id|nfc|nfkc>
3301 @opindex Wnormalized
3302 @cindex NFC
3303 @cindex NFKC
3304 @cindex character set, input normalization
3305 In ISO C and ISO C++, two identifiers are different if they are
3306 different sequences of characters.  However, sometimes when characters
3307 outside the basic ASCII character set are used, you can have two
3308 different character sequences that look the same.  To avoid confusion,
3309 the ISO 10646 standard sets out some @dfn{normalization rules} which
3310 when applied ensure that two sequences that look the same are turned into
3311 the same sequence.  GCC can warn you if you are using identifiers which
3312 have not been normalized; this option controls that warning.
3313
3314 There are four levels of warning that GCC supports.  The default is
3315 @option{-Wnormalized=nfc}, which warns about any identifier which is
3316 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3317 recommended form for most uses.
3318
3319 Unfortunately, there are some characters which ISO C and ISO C++ allow
3320 in identifiers that when turned into NFC aren't allowable as
3321 identifiers.  That is, there's no way to use these symbols in portable
3322 ISO C or C++ and have all your identifiers in NFC.
3323 @option{-Wnormalized=id} suppresses the warning for these characters.
3324 It is hoped that future versions of the standards involved will correct
3325 this, which is why this option is not the default.
3326
3327 You can switch the warning off for all characters by writing
3328 @option{-Wnormalized=none}.  You would only want to do this if you
3329 were using some other normalization scheme (like ``D''), because
3330 otherwise you can easily create bugs that are literally impossible to see.
3331
3332 Some characters in ISO 10646 have distinct meanings but look identical
3333 in some fonts or display methodologies, especially once formatting has
3334 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3335 LETTER N'', will display just like a regular @code{n} which has been
3336 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3337 normalization scheme to convert all these into a standard form as
3338 well, and GCC will warn if your code is not in NFKC if you use
3339 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3340 about every identifier that contains the letter O because it might be
3341 confused with the digit 0, and so is not the default, but may be
3342 useful as a local coding convention if the programming environment is
3343 unable to be fixed to display these characters distinctly.
3344
3345 @item -Wno-deprecated-declarations
3346 @opindex Wno-deprecated-declarations
3347 Do not warn about uses of functions (@pxref{Function Attributes}),
3348 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3349 Attributes}) marked as deprecated by using the @code{deprecated}
3350 attribute.
3351
3352 @item -Wno-overflow
3353 @opindex Wno-overflow
3354 Do not warn about compile-time overflow in constant expressions.
3355
3356 @item -Woverride-init
3357 @opindex Woverride-init
3358 @opindex W
3359 @opindex Wextra
3360 Warn if an initialized field without side effects is overridden when
3361 using designated initializers (@pxref{Designated Inits, , Designated
3362 Initializers}).
3363
3364 This warning is included in @option{-Wextra}.  To get other
3365 @option{-Wextra} warnings without this one, use @samp{-Wextra
3366 -Wno-override-init}.
3367
3368 @item -Wpacked
3369 @opindex Wpacked
3370 Warn if a structure is given the packed attribute, but the packed
3371 attribute has no effect on the layout or size of the structure.
3372 Such structures may be mis-aligned for little benefit.  For
3373 instance, in this code, the variable @code{f.x} in @code{struct bar}
3374 will be misaligned even though @code{struct bar} does not itself
3375 have the packed attribute:
3376
3377 @smallexample
3378 @group
3379 struct foo @{
3380   int x;
3381   char a, b, c, d;
3382 @} __attribute__((packed));
3383 struct bar @{
3384   char z;
3385   struct foo f;
3386 @};
3387 @end group
3388 @end smallexample
3389
3390 @item -Wpadded
3391 @opindex Wpadded
3392 Warn if padding is included in a structure, either to align an element
3393 of the structure or to align the whole structure.  Sometimes when this
3394 happens it is possible to rearrange the fields of the structure to
3395 reduce the padding and so make the structure smaller.
3396
3397 @item -Wredundant-decls
3398 @opindex Wredundant-decls
3399 Warn if anything is declared more than once in the same scope, even in
3400 cases where multiple declaration is valid and changes nothing.
3401
3402 @item -Wnested-externs @r{(C only)}
3403 @opindex Wnested-externs
3404 Warn if an @code{extern} declaration is encountered within a function.
3405
3406 @item -Wunreachable-code
3407 @opindex Wunreachable-code
3408 Warn if the compiler detects that code will never be executed.
3409
3410 This option is intended to warn when the compiler detects that at
3411 least a whole line of source code will never be executed, because
3412 some condition is never satisfied or because it is after a
3413 procedure that never returns.
3414
3415 It is possible for this option to produce a warning even though there
3416 are circumstances under which part of the affected line can be executed,
3417 so care should be taken when removing apparently-unreachable code.
3418
3419 For instance, when a function is inlined, a warning may mean that the
3420 line is unreachable in only one inlined copy of the function.
3421
3422 This option is not made part of @option{-Wall} because in a debugging
3423 version of a program there is often substantial code which checks
3424 correct functioning of the program and is, hopefully, unreachable
3425 because the program does work.  Another common use of unreachable
3426 code is to provide behavior which is selectable at compile-time.
3427
3428 @item -Winline
3429 @opindex Winline
3430 Warn if a function can not be inlined and it was declared as inline.
3431 Even with this option, the compiler will not warn about failures to
3432 inline functions declared in system headers.
3433
3434 The compiler uses a variety of heuristics to determine whether or not
3435 to inline a function.  For example, the compiler takes into account
3436 the size of the function being inlined and the amount of inlining
3437 that has already been done in the current function.  Therefore,
3438 seemingly insignificant changes in the source program can cause the
3439 warnings produced by @option{-Winline} to appear or disappear.
3440
3441 @item -Wno-invalid-offsetof @r{(C++ only)}
3442 @opindex Wno-invalid-offsetof
3443 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
3444 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
3445 to a non-POD type is undefined.  In existing C++ implementations,
3446 however, @samp{offsetof} typically gives meaningful results even when
3447 applied to certain kinds of non-POD types. (Such as a simple
3448 @samp{struct} that fails to be a POD type only by virtue of having a
3449 constructor.)  This flag is for users who are aware that they are
3450 writing nonportable code and who have deliberately chosen to ignore the
3451 warning about it.
3452
3453 The restrictions on @samp{offsetof} may be relaxed in a future version
3454 of the C++ standard.
3455
3456 @item -Wno-int-to-pointer-cast @r{(C only)}
3457 @opindex Wno-int-to-pointer-cast
3458 Suppress warnings from casts to pointer type of an integer of a
3459 different size.
3460
3461 @item -Wno-pointer-to-int-cast @r{(C only)}
3462 @opindex Wno-pointer-to-int-cast
3463 Suppress warnings from casts from a pointer to an integer type of a
3464 different size.
3465
3466 @item -Winvalid-pch
3467 @opindex Winvalid-pch
3468 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
3469 the search path but can't be used.
3470
3471 @item -Wlong-long
3472 @opindex Wlong-long
3473 @opindex Wno-long-long
3474 Warn if @samp{long long} type is used.  This is default.  To inhibit
3475 the warning messages, use @option{-Wno-long-long}.  Flags
3476 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
3477 only when @option{-pedantic} flag is used.
3478
3479 @item -Wvariadic-macros
3480 @opindex Wvariadic-macros
3481 @opindex Wno-variadic-macros
3482 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
3483 alternate syntax when in pedantic ISO C99 mode.  This is default.
3484 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
3485
3486 @item -Wvolatile-register-var
3487 @opindex Wvolatile-register-var
3488 @opindex Wno-volatile-register-var
3489 Warn if a register variable is declared volatile.  The volatile
3490 modifier does not inhibit all optimizations that may eliminate reads
3491 and/or writes to register variables.
3492
3493 @item -Wdisabled-optimization
3494 @opindex Wdisabled-optimization
3495 Warn if a requested optimization pass is disabled.  This warning does
3496 not generally indicate that there is anything wrong with your code; it
3497 merely indicates that GCC's optimizers were unable to handle the code
3498 effectively.  Often, the problem is that your code is too big or too
3499 complex; GCC will refuse to optimize programs when the optimization
3500 itself is likely to take inordinate amounts of time.
3501
3502 @item -Wpointer-sign
3503 @opindex Wpointer-sign
3504 @opindex Wno-pointer-sign
3505 Warn for pointer argument passing or assignment with different signedness.
3506 This option is only supported for C and Objective-C@.  It is implied by
3507 @option{-Wall} and by @option{-pedantic}, which can be disabled with
3508 @option{-Wno-pointer-sign}.
3509
3510 @item -Werror
3511 @opindex Werror
3512 Make all warnings into errors.
3513
3514 @item -Werror=
3515 @opindex Werror=
3516 Make the specified warning into an errors.  The specifier for a
3517 warning is appended, for example @option{-Werror=switch} turns the
3518 warnings controlled by @option{-Wswitch} into errors.  This switch
3519 takes a negative form, to be used to negate @option{-Werror} for
3520 specific warnings, for example @option{-Wno-error=switch} makes
3521 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3522 is in effect.  You can use the @option{-fdiagnostics-show-option}
3523 option to have each controllable warning amended with the option which
3524 controls it, to determine what to use with this option.
3525
3526 Note that specifying @option{-Werror=}@var{foo} automatically implies
3527 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3528 imply anything.
3529
3530 @item -Wstack-protector
3531 @opindex Wstack-protector
3532 This option is only active when @option{-fstack-protector} is active.  It
3533 warns about functions that will not be protected against stack smashing.
3534
3535 @item -Wstring-literal-comparison
3536 @opindex Wstring-literal-comparison
3537 Warn about suspicious comparisons to string literal constants.  In C,
3538 direct comparisons against the memory address of a string literal, such
3539 as @code{if (x == "abc")}, typically indicate a programmer error, and
3540 even when intentional, result in unspecified behavior and are not portable.
3541 Usually these warnings alert that the programmer intended to use
3542 @code{strcmp}.  This warning is enabled by @option{-Wall}.
3543
3544 @item -Woverlength-strings
3545 @opindex Woverlength-strings
3546 Warn about string constants which are longer than the ``minimum
3547 maximum'' length specified in the C standard.  Modern compilers
3548 generally allow string constants which are much longer than the
3549 standard's minimum limit, but very portable programs should avoid
3550 using longer strings.
3551
3552 The limit applies @emph{after} string constant concatenation, and does
3553 not count the trailing NUL@.  In C89, the limit was 509 characters; in
3554 C99, it was raised to 4095.  C++98 does not specify a normative
3555 minimum maximum, so we do not diagnose overlength strings in C++@.
3556
3557 This option is implied by @option{-pedantic}, and can be disabled with
3558 @option{-Wno-overlength-strings}.
3559 @end table
3560
3561 @node Debugging Options
3562 @section Options for Debugging Your Program or GCC
3563 @cindex options, debugging
3564 @cindex debugging information options
3565
3566 GCC has various special options that are used for debugging
3567 either your program or GCC:
3568
3569 @table @gcctabopt
3570 @item -g
3571 @opindex g
3572 Produce debugging information in the operating system's native format
3573 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
3574 information.
3575
3576 On most systems that use stabs format, @option{-g} enables use of extra
3577 debugging information that only GDB can use; this extra information
3578 makes debugging work better in GDB but will probably make other debuggers
3579 crash or
3580 refuse to read the program.  If you want to control for certain whether
3581 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
3582 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
3583
3584 GCC allows you to use @option{-g} with
3585 @option{-O}.  The shortcuts taken by optimized code may occasionally
3586 produce surprising results: some variables you declared may not exist
3587 at all; flow of control may briefly move where you did not expect it;
3588 some statements may not be executed because they compute constant
3589 results or their values were already at hand; some statements may
3590 execute in different places because they were moved out of loops.
3591
3592 Nevertheless it proves possible to debug optimized output.  This makes
3593 it reasonable to use the optimizer for programs that might have bugs.
3594
3595 The following options are useful when GCC is generated with the
3596 capability for more than one debugging format.
3597
3598 @item -ggdb
3599 @opindex ggdb
3600 Produce debugging information for use by GDB@.  This means to use the
3601 most expressive format available (DWARF 2, stabs, or the native format
3602 if neither of those are supported), including GDB extensions if at all
3603 possible.
3604
3605 @item -gstabs
3606 @opindex gstabs
3607 Produce debugging information in stabs format (if that is supported),
3608 without GDB extensions.  This is the format used by DBX on most BSD
3609 systems.  On MIPS, Alpha and System V Release 4 systems this option
3610 produces stabs debugging output which is not understood by DBX or SDB@.
3611 On System V Release 4 systems this option requires the GNU assembler.
3612
3613 @item -feliminate-unused-debug-symbols
3614 @opindex feliminate-unused-debug-symbols
3615 Produce debugging information in stabs format (if that is supported),
3616 for only symbols that are actually used.
3617
3618 @item -femit-class-debug-always
3619 Instead of emitting debugging information for a C++ class in only one
3620 object file, emit it in all object files using the class.  This option
3621 should be used only with debuggers that are unable to handle the way GCC
3622 normally emits debugging information for classes because using this
3623 option will increase the size of debugging information by as much as a
3624 factor of two.
3625
3626 @item -gstabs+
3627 @opindex gstabs+
3628 Produce debugging information in stabs format (if that is supported),
3629 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3630 use of these extensions is likely to make other debuggers crash or
3631 refuse to read the program.
3632
3633 @item -gcoff
3634 @opindex gcoff
3635 Produce debugging information in COFF format (if that is supported).
3636 This is the format used by SDB on most System V systems prior to
3637 System V Release 4.
3638
3639 @item -gxcoff
3640 @opindex gxcoff
3641 Produce debugging information in XCOFF format (if that is supported).
3642 This is the format used by the DBX debugger on IBM RS/6000 systems.
3643
3644 @item -gxcoff+
3645 @opindex gxcoff+
3646 Produce debugging information in XCOFF format (if that is supported),
3647 using GNU extensions understood only by the GNU debugger (GDB)@.  The
3648 use of these extensions is likely to make other debuggers crash or
3649 refuse to read the program, and may cause assemblers other than the GNU
3650 assembler (GAS) to fail with an error.
3651
3652 @item -gdwarf-2
3653 @opindex gdwarf-2
3654 Produce debugging information in DWARF version 2 format (if that is
3655 supported).  This is the format used by DBX on IRIX 6.  With this
3656 option, GCC uses features of DWARF version 3 when they are useful;
3657 version 3 is upward compatible with version 2, but may still cause
3658 problems for older debuggers.
3659
3660 @item -gvms
3661 @opindex gvms
3662 Produce debugging information in VMS debug format (if that is
3663 supported).  This is the format used by DEBUG on VMS systems.
3664
3665 @item -g@var{level}
3666 @itemx -ggdb@var{level}
3667 @itemx -gstabs@var{level}
3668 @itemx -gcoff@var{level}
3669 @itemx -gxcoff@var{level}
3670 @itemx -gvms@var{level}
3671 Request debugging information and also use @var{level} to specify how
3672 much information.  The default level is 2.
3673
3674 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
3675 @option{-g}.
3676
3677 Level 1 produces minimal information, enough for making backtraces in
3678 parts of the program that you don't plan to debug.  This includes
3679 descriptions of functions and external variables, but no information
3680 about local variables and no line numbers.
3681
3682 Level 3 includes extra information, such as all the macro definitions
3683 present in the program.  Some debuggers support macro expansion when
3684 you use @option{-g3}.
3685
3686 @option{-gdwarf-2} does not accept a concatenated debug level, because
3687 GCC used to support an option @option{-gdwarf} that meant to generate
3688 debug information in version 1 of the DWARF format (which is very
3689 different from version 2), and it would have been too confusing.  That
3690 debug format is long obsolete, but the option cannot be changed now.
3691 Instead use an additional @option{-g@var{level}} option to change the
3692 debug level for DWARF2.
3693
3694 @item -feliminate-dwarf2-dups
3695 @opindex feliminate-dwarf2-dups
3696 Compress DWARF2 debugging information by eliminating duplicated
3697 information about each symbol.  This option only makes sense when
3698 generating DWARF2 debugging information with @option{-gdwarf-2}.
3699
3700 @cindex @command{prof}
3701 @item -p
3702 @opindex p
3703 Generate extra code to write profile information suitable for the
3704 analysis program @command{prof}.  You must use this option when compiling
3705 the source files you want data about, and you must also use it when
3706 linking.
3707
3708 @cindex @command{gprof}
3709 @item -pg
3710 @opindex pg
3711 Generate extra code to write profile information suitable for the
3712 analysis program @command{gprof}.  You must use this option when compiling
3713 the source files you want data about, and you must also use it when
3714 linking.
3715
3716 @item -Q
3717 @opindex Q
3718 Makes the compiler print out each function name as it is compiled, and
3719 print some statistics about each pass when it finishes.
3720
3721 @item -ftime-report
3722 @opindex ftime-report
3723 Makes the compiler print some statistics about the time consumed by each
3724 pass when it finishes.
3725
3726 @item -fmem-report
3727 @opindex fmem-report
3728 Makes the compiler print some statistics about permanent memory
3729 allocation when it finishes.
3730
3731 @item -fpre-ipa-mem-report
3732 @opindex fpre-ipa-mem-report
3733 @item -fpost-ipa-mem-report
3734 @opindex fpost-ipa-mem-report
3735 Makes the compiler print some statistics about permanent memory
3736 allocation before or after interprocedural optimization.
3737
3738 @item -fprofile-arcs
3739 @opindex fprofile-arcs
3740 Add code so that program flow @dfn{arcs} are instrumented.  During
3741 execution the program records how many times each branch and call is
3742 executed and how many times it is taken or returns.  When the compiled
3743 program exits it saves this data to a file called
3744 @file{@var{auxname}.gcda} for each source file.  The data may be used for
3745 profile-directed optimizations (@option{-fbranch-probabilities}), or for
3746 test coverage analysis (@option{-ftest-coverage}).  Each object file's
3747 @var{auxname} is generated from the name of the output file, if
3748 explicitly specified and it is not the final executable, otherwise it is
3749 the basename of the source file.  In both cases any suffix is removed
3750 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
3751 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
3752 @xref{Cross-profiling}.
3753
3754 @cindex @command{gcov}
3755 @item --coverage
3756 @opindex coverage
3757
3758 This option is used to compile and link code instrumented for coverage
3759 analysis.  The option is a synonym for @option{-fprofile-arcs}
3760 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
3761 linking).  See the documentation for those options for more details.
3762
3763 @itemize
3764
3765 @item
3766 Compile the source files with @option{-fprofile-arcs} plus optimization
3767 and code generation options.  For test coverage analysis, use the
3768 additional @option{-ftest-coverage} option.  You do not need to profile
3769 every source file in a program.
3770
3771 @item
3772 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
3773 (the latter implies the former).
3774
3775 @item
3776 Run the program on a representative workload to generate the arc profile
3777 information.  This may be repeated any number of times.  You can run
3778 concurrent instances of your program, and provided that the file system
3779 supports locking, the data files will be correctly updated.  Also
3780 @code{fork} calls are detected and correctly handled (double counting
3781 will not happen).
3782
3783 @item
3784 For profile-directed optimizations, compile the source files again with
3785 the same optimization and code generation options plus
3786 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
3787 Control Optimization}).
3788
3789 @item
3790 For test coverage analysis, use @command{gcov} to produce human readable
3791 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
3792 @command{gcov} documentation for further information.
3793
3794 @end itemize
3795
3796 With @option{-fprofile-arcs}, for each function of your program GCC
3797 creates a program flow graph, then finds a spanning tree for the graph.
3798 Only arcs that are not on the spanning tree have to be instrumented: the
3799 compiler adds code to count the number of times that these arcs are
3800 executed.  When an arc is the only exit or only entrance to a block, the
3801 instrumentation code can be added to the block; otherwise, a new basic
3802 block must be created to hold the instrumentation code.
3803
3804 @need 2000
3805 @item -ftest-coverage
3806 @opindex ftest-coverage
3807 Produce a notes file that the @command{gcov} code-coverage utility
3808 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
3809 show program coverage.  Each source file's note file is called
3810 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
3811 above for a description of @var{auxname} and instructions on how to
3812 generate test coverage data.  Coverage data will match the source files
3813 more closely, if you do not optimize.
3814
3815 @item -d@var{letters}
3816 @item -fdump-rtl-@var{pass}
3817 @opindex d
3818 Says to make debugging dumps during compilation at times specified by
3819 @var{letters}.    This is used for debugging the RTL-based passes of the
3820 compiler.  The file names for most of the dumps are made by appending a
3821 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
3822 from the name of the output file, if explicitly specified and it is not
3823 an executable, otherwise it is the basename of the source file.
3824
3825 Most debug dumps can be enabled either passing a letter to the @option{-d}
3826 option, or with a long @option{-fdump-rtl} switch; here are the possible
3827 letters for use in @var{letters} and @var{pass}, and their meanings:
3828
3829 @table @gcctabopt
3830 @item -dA
3831 @opindex dA
3832 Annotate the assembler output with miscellaneous debugging information.
3833
3834 @item -dB
3835 @itemx -fdump-rtl-bbro
3836 @opindex dB
3837 @opindex fdump-rtl-bbro
3838 Dump after block reordering, to @file{@var{file}.148r.bbro}.
3839
3840 @item -dc
3841 @itemx -fdump-rtl-combine
3842 @opindex dc
3843 @opindex fdump-rtl-combine
3844 Dump after instruction combination, to the file @file{@var{file}.129r.combine}.
3845
3846 @item -dC
3847 @itemx -fdump-rtl-ce1
3848 @itemx -fdump-rtl-ce2
3849 @opindex dC
3850 @opindex fdump-rtl-ce1
3851 @opindex fdump-rtl-ce2
3852 @option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the
3853 first if conversion, to the file @file{@var{file}.117r.ce1}.  @option{-dC}
3854 and @option{-fdump-rtl-ce2} enable dumping after the second if
3855 conversion, to the file @file{@var{file}.130r.ce2}.
3856
3857 @item -dd
3858 @itemx -fdump-rtl-btl
3859 @itemx -fdump-rtl-dbr
3860 @opindex dd
3861 @opindex fdump-rtl-btl
3862 @opindex fdump-rtl-dbr
3863 @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch
3864 target load optimization, to @file{@var{file}.31.btl}.  @option{-dd}
3865 and @option{-fdump-rtl-dbr} enable dumping after delayed branch
3866 scheduling, to @file{@var{file}.36.dbr}.
3867
3868 @item -dD
3869 @opindex dD
3870 Dump all macro definitions, at the end of preprocessing, in addition to
3871 normal output.
3872
3873 @item -dE
3874 @itemx -fdump-rtl-ce3
3875 @opindex dE
3876 @opindex fdump-rtl-ce3
3877 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
3878
3879 @item -df
3880 @itemx -fdump-rtl-cfg
3881 @itemx -fdump-rtl-life
3882 @opindex df
3883 @opindex fdump-rtl-cfg
3884 @opindex fdump-rtl-life
3885 @option{-df} and @option{-fdump-rtl-cfg} enable dumping after control
3886 and data flow analysis, to @file{@var{file}.116r.cfg}.  @option{-df}
3887 and @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
3888 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
3889
3890 @item -dg
3891 @itemx -fdump-rtl-greg
3892 @opindex dg
3893 @opindex fdump-rtl-greg
3894 Dump after global register allocation, to @file{@var{file}.139r.greg}.
3895
3896 @item -dG
3897 @itemx -fdump-rtl-gcse
3898 @itemx -fdump-rtl-bypass
3899 @opindex dG
3900 @opindex fdump-rtl-gcse
3901 @opindex fdump-rtl-bypass
3902 @option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to
3903 @file{@var{file}.114r.gcse}.  @option{-dG} and @option{-fdump-rtl-bypass}
3904 enable dumping after jump bypassing and control flow optimizations, to
3905 @file{@var{file}.115r.bypass}.
3906
3907 @item -dh
3908 @itemx -fdump-rtl-eh
3909 @opindex dh
3910 @opindex fdump-rtl-eh
3911 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
3912
3913 @item -di
3914 @itemx -fdump-rtl-sibling
3915 @opindex di
3916 @opindex fdump-rtl-sibling
3917 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
3918
3919 @item -dj
3920 @itemx -fdump-rtl-jump
3921 @opindex dj
3922 @opindex fdump-rtl-jump
3923 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
3924
3925 @item -dk
3926 @itemx -fdump-rtl-stack
3927 @opindex dk
3928 @opindex fdump-rtl-stack
3929 Dump after conversion from registers to stack, to @file{@var{file}.152r.stack}.
3930
3931 @item -dl
3932 @itemx -fdump-rtl-lreg
3933 @opindex dl
3934 @opindex fdump-rtl-lreg
3935 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
3936
3937 @item -dL
3938 @itemx -fdump-rtl-loop2
3939 @opindex dL
3940 @opindex fdump-rtl-loop2
3941 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
3942 loop optimization pass, to @file{@var{file}.119r.loop2},
3943 @file{@var{file}.120r.loop2_init},
3944 @file{@var{file}.121r.loop2_invariant}, and
3945 @file{@var{file}.125r.loop2_done}.
3946
3947 @item -dm
3948 @itemx -fdump-rtl-sms
3949 @opindex dm
3950 @opindex fdump-rtl-sms
3951 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
3952
3953 @item -dM
3954 @itemx -fdump-rtl-mach
3955 @opindex dM
3956 @opindex fdump-rtl-mach
3957 Dump after performing the machine dependent reorganization pass, to
3958 @file{@var{file}.155r.mach}.
3959
3960 @item -dn
3961 @itemx -fdump-rtl-rnreg
3962 @opindex dn
3963 @opindex fdump-rtl-rnreg
3964 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
3965
3966 @item -dN
3967 @itemx -fdump-rtl-regmove
3968 @opindex dN
3969 @opindex fdump-rtl-regmove
3970 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
3971
3972 @item -do
3973 @itemx -fdump-rtl-postreload
3974 @opindex do
3975 @opindex fdump-rtl-postreload
3976 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
3977
3978 @item -dr
3979 @itemx -fdump-rtl-expand
3980 @opindex dr
3981 @opindex fdump-rtl-expand
3982 Dump after RTL generation, to @file{@var{file}.104r.expand}.
3983
3984 @item -dR
3985 @itemx -fdump-rtl-sched2
3986 @opindex dR
3987 @opindex fdump-rtl-sched2
3988 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
3989
3990 @item -ds
3991 @itemx -fdump-rtl-cse
3992 @opindex ds
3993 @opindex fdump-rtl-cse
3994 Dump after CSE (including the jump optimization that sometimes follows
3995 CSE), to @file{@var{file}.113r.cse}.
3996
3997 @item -dS
3998 @itemx -fdump-rtl-sched1
3999 @opindex dS
4000 @opindex fdump-rtl-sched1
4001 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4002
4003 @item -dt
4004 @itemx -fdump-rtl-cse2
4005 @opindex dt
4006 @opindex fdump-rtl-cse2
4007 Dump after the second CSE pass (including the jump optimization that
4008 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4009
4010 @item -dT
4011 @itemx -fdump-rtl-tracer
4012 @opindex dT
4013 @opindex fdump-rtl-tracer
4014 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4015
4016 @item -dV
4017 @itemx -fdump-rtl-vpt
4018 @itemx -fdump-rtl-vartrack
4019 @opindex dV
4020 @opindex fdump-rtl-vpt
4021 @opindex fdump-rtl-vartrack
4022 @option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value
4023 profile transformations, to @file{@var{file}.10.vpt}.  @option{-dV}
4024 and @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4025 to @file{@var{file}.154r.vartrack}.
4026
4027 @item -dw
4028 @itemx -fdump-rtl-flow2
4029 @opindex dw
4030 @opindex fdump-rtl-flow2
4031 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4032
4033 @item -dz
4034 @itemx -fdump-rtl-peephole2
4035 @opindex dz
4036 @opindex fdump-rtl-peephole2
4037 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4038
4039 @item -dZ
4040 @itemx -fdump-rtl-web
4041 @opindex dZ
4042 @opindex fdump-rtl-web
4043 Dump after live range splitting, to @file{@var{file}.126r.web}.
4044
4045 @item -da
4046 @itemx -fdump-rtl-all
4047 @opindex da
4048 @opindex fdump-rtl-all
4049 Produce all the dumps listed above.
4050
4051 @item -dH
4052 @opindex dH
4053 Produce a core dump whenever an error occurs.
4054
4055 @item -dm
4056 @opindex dm
4057 Print statistics on memory usage, at the end of the run, to
4058 standard error.
4059
4060 @item -dp
4061 @opindex dp
4062 Annotate the assembler output with a comment indicating which
4063 pattern and alternative was used.  The length of each instruction is
4064 also printed.
4065
4066 @item -dP
4067 @opindex dP
4068 Dump the RTL in the assembler output as a comment before each instruction.
4069 Also turns on @option{-dp} annotation.
4070
4071 @item -dv
4072 @opindex dv
4073 For each of the other indicated dump files (either with @option{-d} or
4074 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4075 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4076
4077 @item -dx
4078 @opindex dx
4079 Just generate RTL for a function instead of compiling it.  Usually used
4080 with @samp{r} (@option{-fdump-rtl-expand}).
4081
4082 @item -dy
4083 @opindex dy
4084 Dump debugging information during parsing, to standard error.
4085 @end table
4086
4087 @item -fdump-noaddr
4088 @opindex fdump-noaddr
4089 When doing debugging dumps (see @option{-d} option above), suppress
4090 address output.  This makes it more feasible to use diff on debugging
4091 dumps for compiler invocations with different compiler binaries and/or
4092 different text / bss / data / heap / stack / dso start locations.
4093
4094 @item -fdump-unnumbered
4095 @opindex fdump-unnumbered
4096 When doing debugging dumps (see @option{-d} option above), suppress instruction
4097 numbers, line number note and address output.  This makes it more feasible to
4098 use diff on debugging dumps for compiler invocations with different
4099 options, in particular with and without @option{-g}.
4100
4101 @item -fdump-translation-unit @r{(C++ only)}
4102 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4103 @opindex fdump-translation-unit
4104 Dump a representation of the tree structure for the entire translation
4105 unit to a file.  The file name is made by appending @file{.tu} to the
4106 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4107 controls the details of the dump as described for the
4108 @option{-fdump-tree} options.
4109
4110 @item -fdump-class-hierarchy @r{(C++ only)}
4111 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4112 @opindex fdump-class-hierarchy
4113 Dump a representation of each class's hierarchy and virtual function
4114 table layout to a file.  The file name is made by appending @file{.class}
4115 to the source file name.  If the @samp{-@var{options}} form is used,
4116 @var{options} controls the details of the dump as described for the
4117 @option{-fdump-tree} options.
4118
4119 @item -fdump-ipa-@var{switch}
4120 @opindex fdump-ipa
4121 Control the dumping at various stages of inter-procedural analysis
4122 language tree to a file.  The file name is generated by appending a switch
4123 specific suffix to the source file name.  The following dumps are possible:
4124
4125 @table @samp
4126 @item all
4127 Enables all inter-procedural analysis dumps; currently the only produced
4128 dump is the @samp{cgraph} dump.
4129
4130 @item cgraph
4131 Dumps information about call-graph optimization, unused function removal,
4132 and inlining decisions.
4133 @end table
4134
4135 @item -fdump-tree-@var{switch}
4136 @itemx -fdump-tree-@var{switch}-@var{options}
4137 @opindex fdump-tree
4138 Control the dumping at various stages of processing the intermediate
4139 language tree to a file.  The file name is generated by appending a switch
4140 specific suffix to the source file name.  If the @samp{-@var{options}}
4141 form is used, @var{options} is a list of @samp{-} separated options that
4142 control the details of the dump.  Not all options are applicable to all
4143 dumps, those which are not meaningful will be ignored.  The following
4144 options are available
4145
4146 @table @samp
4147 @item address
4148 Print the address of each node.  Usually this is not meaningful as it
4149 changes according to the environment and source file.  Its primary use
4150 is for tying up a dump file with a debug environment.
4151 @item slim
4152 Inhibit dumping of members of a scope or body of a function merely
4153 because that scope has been reached.  Only dump such items when they
4154 are directly reachable by some other path.  When dumping pretty-printed
4155 trees, this option inhibits dumping the bodies of control structures.
4156 @item raw
4157 Print a raw representation of the tree.  By default, trees are
4158 pretty-printed into a C-like representation.
4159 @item details
4160 Enable more detailed dumps (not honored by every dump option).
4161 @item stats
4162 Enable dumping various statistics about the pass (not honored by every dump
4163 option).
4164 @item blocks
4165 Enable showing basic block boundaries (disabled in raw dumps).
4166 @item vops
4167 Enable showing virtual operands for every statement.
4168 @item lineno
4169 Enable showing line numbers for statements.
4170 @item uid
4171 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4172 @item all
4173 Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
4174 @end table
4175
4176 The following tree dumps are possible:
4177 @table @samp
4178
4179 @item original
4180 Dump before any tree based optimization, to @file{@var{file}.original}.
4181
4182 @item optimized
4183 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4184
4185 @item inlined
4186 Dump after function inlining, to @file{@var{file}.inlined}.
4187
4188 @item gimple
4189 @opindex fdump-tree-gimple
4190 Dump each function before and after the gimplification pass to a file.  The
4191 file name is made by appending @file{.gimple} to the source file name.
4192
4193 @item cfg
4194 @opindex fdump-tree-cfg
4195 Dump the control flow graph of each function to a file.  The file name is
4196 made by appending @file{.cfg} to the source file name.
4197
4198 @item vcg
4199 @opindex fdump-tree-vcg
4200 Dump the control flow graph of each function to a file in VCG format.  The
4201 file name is made by appending @file{.vcg} to the source file name.  Note
4202 that if the file contains more than one function, the generated file cannot
4203 be used directly by VCG@.  You will need to cut and paste each function's
4204 graph into its own separate file first.
4205
4206 @item ch
4207 @opindex fdump-tree-ch
4208 Dump each function after copying loop headers.  The file name is made by
4209 appending @file{.ch} to the source file name.
4210
4211 @item ssa
4212 @opindex fdump-tree-ssa
4213 Dump SSA related information to a file.  The file name is made by appending
4214 @file{.ssa} to the source file name.
4215
4216 @item salias
4217 @opindex fdump-tree-salias
4218 Dump structure aliasing variable information to a file.  This file name
4219 is made by appending @file{.salias} to the source file name.
4220
4221 @item alias
4222 @opindex fdump-tree-alias
4223 Dump aliasing information for each function.  The file name is made by
4224 appending @file{.alias} to the source file name.
4225
4226 @item ccp
4227 @opindex fdump-tree-ccp
4228 Dump each function after CCP@.  The file name is made by appending
4229 @file{.ccp} to the source file name.
4230
4231 @item storeccp
4232 @opindex fdump-tree-storeccp
4233 Dump each function after STORE-CCP.  The file name is made by appending
4234 @file{.storeccp} to the source file name.
4235
4236 @item pre
4237 @opindex fdump-tree-pre
4238 Dump trees after partial redundancy elimination.  The file name is made
4239 by appending @file{.pre} to the source file name.
4240
4241 @item fre
4242 @opindex fdump-tree-fre
4243 Dump trees after full redundancy elimination.  The file name is made
4244 by appending @file{.fre} to the source file name.
4245
4246 @item copyprop
4247 @opindex fdump-tree-copyprop
4248 Dump trees after copy propagation.  The file name is made
4249 by appending @file{.copyprop} to the source file name.
4250
4251 @item store_copyprop
4252 @opindex fdump-tree-store_copyprop
4253 Dump trees after store copy-propagation.  The file name is made
4254 by appending @file{.store_copyprop} to the source file name.
4255
4256 @item dce
4257 @opindex fdump-tree-dce
4258 Dump each function after dead code elimination.  The file name is made by
4259 appending @file{.dce} to the source file name.
4260
4261 @item mudflap
4262 @opindex fdump-tree-mudflap
4263 Dump each function after adding mudflap instrumentation.  The file name is
4264 made by appending @file{.mudflap} to the source file name.
4265
4266 @item sra
4267 @opindex fdump-tree-sra
4268 Dump each function after performing scalar replacement of aggregates.  The
4269 file name is made by appending @file{.sra} to the source file name.
4270
4271 @item sink
4272 @opindex fdump-tree-sink
4273 Dump each function after performing code sinking.  The file name is made
4274 by appending @file{.sink} to the source file name. 
4275
4276 @item dom
4277 @opindex fdump-tree-dom
4278 Dump each function after applying dominator tree optimizations.  The file
4279 name is made by appending @file{.dom} to the source file name.
4280
4281 @item dse
4282 @opindex fdump-tree-dse
4283 Dump each function after applying dead store elimination.  The file
4284 name is made by appending @file{.dse} to the source file name.
4285
4286 @item phiopt
4287 @opindex fdump-tree-phiopt
4288 Dump each function after optimizing PHI nodes into straightline code.  The file
4289 name is made by appending @file{.phiopt} to the source file name.
4290
4291 @item forwprop
4292 @opindex fdump-tree-forwprop
4293 Dump each function after forward propagating single use variables.  The file
4294 name is made by appending @file{.forwprop} to the source file name.
4295
4296 @item copyrename
4297 @opindex fdump-tree-copyrename
4298 Dump each function after applying the copy rename optimization.  The file
4299 name is made by appending @file{.copyrename} to the source file name.
4300
4301 @item nrv
4302 @opindex fdump-tree-nrv
4303 Dump each function after applying the named return value optimization on
4304 generic trees.  The file name is made by appending @file{.nrv} to the source
4305 file name.
4306
4307 @item vect
4308 @opindex fdump-tree-vect
4309 Dump each function after applying vectorization of loops.  The file name is
4310 made by appending @file{.vect} to the source file name.
4311
4312 @item vrp
4313 @opindex fdump-tree-vrp
4314 Dump each function after Value Range Propagation (VRP).  The file name
4315 is made by appending @file{.vrp} to the source file name.
4316
4317 @item all
4318 @opindex fdump-tree-all
4319 Enable all the available tree dumps with the flags provided in this option.
4320 @end table
4321
4322 @item -ftree-vectorizer-verbose=@var{n}
4323 @opindex ftree-vectorizer-verbose
4324 This option controls the amount of debugging output the vectorizer prints.
4325 This information is written to standard error, unless 
4326 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified, 
4327 in which case it is output to the usual dump listing file, @file{.vect}.
4328 For @var{n}=0 no diagnostic information is reported.
4329 If @var{n}=1 the vectorizer reports each loop that got vectorized, 
4330 and the total number of loops that got vectorized.
4331 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed 
4332 the first analysis phase (vect_analyze_loop_form) - i.e. countable, 
4333 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity 
4334 level that @option{-fdump-tree-vect-stats} uses.
4335 Higher verbosity levels mean either more information dumped for each 
4336 reported loop, or same amount of information reported for more loops:
4337 If @var{n}=3, alignment related information is added to the reports.
4338 If @var{n}=4, data-references related information (e.g. memory dependences, 
4339 memory access-patterns) is added to the reports.
4340 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops 
4341 that did not pass the first analysis phase (i.e. may not be countable, or 
4342 may have complicated control-flow).
4343 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4344 For @var{n}=7, all the information the vectorizer generates during its 
4345 analysis and transformation is reported.  This is the same verbosity level
4346 that @option{-fdump-tree-vect-details} uses.
4347
4348 @item -frandom-seed=@var{string}
4349 @opindex frandom-string
4350 This option provides a seed that GCC uses when it would otherwise use
4351 random numbers.  It is used to generate certain symbol names
4352 that have to be different in every compiled file.  It is also used to
4353 place unique stamps in coverage data files and the object files that
4354 produce them.  You can use the @option{-frandom-seed} option to produce
4355 reproducibly identical object files.
4356
4357 The @var{string} should be different for every file you compile.
4358
4359 @item -fsched-verbose=@var{n}
4360 @opindex fsched-verbose
4361 On targets that use instruction scheduling, this option controls the
4362 amount of debugging output the scheduler prints.  This information is
4363 written to standard error, unless @option{-dS} or @option{-dR} is
4364 specified, in which case it is output to the usual dump
4365 listing file, @file{.sched} or @file{.sched2} respectively.  However
4366 for @var{n} greater than nine, the output is always printed to standard
4367 error.
4368
4369 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4370 same information as @option{-dRS}.  For @var{n} greater than one, it
4371 also output basic block probabilities, detailed ready list information
4372 and unit/insn info.  For @var{n} greater than two, it includes RTL
4373 at abort point, control-flow and regions info.  And for @var{n} over
4374 four, @option{-fsched-verbose} also includes dependence info.
4375
4376 @item -save-temps
4377 @opindex save-temps
4378 Store the usual ``temporary'' intermediate files permanently; place them
4379 in the current directory and name them based on the source file.  Thus,
4380 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4381 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4382 preprocessed @file{foo.i} output file even though the compiler now
4383 normally uses an integrated preprocessor.
4384
4385 When used in combination with the @option{-x} command line option,
4386 @option{-save-temps} is sensible enough to avoid over writing an
4387 input source file with the same extension as an intermediate file.
4388 The corresponding intermediate file may be obtained by renaming the
4389 source file before using @option{-save-temps}.
4390
4391 @item -time
4392 @opindex time
4393 Report the CPU time taken by each subprocess in the compilation
4394 sequence.  For C source files, this is the compiler proper and assembler
4395 (plus the linker if linking is done).  The output looks like this:
4396
4397 @smallexample
4398 # cc1 0.12 0.01
4399 # as 0.00 0.01
4400 @end smallexample
4401
4402 The first number on each line is the ``user time'', that is time spent
4403 executing the program itself.  The second number is ``system time'',
4404 time spent executing operating system routines on behalf of the program.
4405 Both numbers are in seconds.
4406
4407 @item -fvar-tracking
4408 @opindex fvar-tracking
4409 Run variable tracking pass.  It computes where variables are stored at each
4410 position in code.  Better debugging information is then generated
4411 (if the debugging information format supports this information).
4412
4413 It is enabled by default when compiling with optimization (@option{-Os},
4414 @option{-O}, @option{-O2}, ...), debugging information (@option{-g}) and
4415 the debug info format supports it.
4416
4417 @item -print-file-name=@var{library}
4418 @opindex print-file-name
4419 Print the full absolute name of the library file @var{library} that
4420 would be used when linking---and don't do anything else.  With this
4421 option, GCC does not compile or link anything; it just prints the
4422 file name.
4423
4424 @item -print-multi-directory
4425 @opindex print-multi-directory
4426 Print the directory name corresponding to the multilib selected by any
4427 other switches present in the command line.  This directory is supposed
4428 to exist in @env{GCC_EXEC_PREFIX}.
4429
4430 @item -print-multi-lib
4431 @opindex print-multi-lib
4432 Print the mapping from multilib directory names to compiler switches
4433 that enable them.  The directory name is separated from the switches by
4434 @samp{;}, and each switch starts with an @samp{@@} instead of the
4435 @samp{-}, without spaces between multiple switches.  This is supposed to
4436 ease shell-processing.
4437
4438 @item -print-prog-name=@var{program}
4439 @opindex print-prog-name
4440 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
4441
4442 @item -print-libgcc-file-name
4443 @opindex print-libgcc-file-name
4444 Same as @option{-print-file-name=libgcc.a}.
4445
4446 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
4447 but you do want to link with @file{libgcc.a}.  You can do
4448
4449 @smallexample
4450 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
4451 @end smallexample
4452
4453 @item -print-search-dirs
4454 @opindex print-search-dirs
4455 Print the name of the configured installation directory and a list of
4456 program and library directories @command{gcc} will search---and don't do anything else.
4457
4458 This is useful when @command{gcc} prints the error message
4459 @samp{installation problem, cannot exec cpp0: No such file or directory}.
4460 To resolve this you either need to put @file{cpp0} and the other compiler
4461 components where @command{gcc} expects to find them, or you can set the environment
4462 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
4463 Don't forget the trailing @samp{/}.
4464 @xref{Environment Variables}.
4465
4466 @item -dumpmachine
4467 @opindex dumpmachine
4468 Print the compiler's target machine (for example,
4469 @samp{i686-pc-linux-gnu})---and don't do anything else.
4470
4471 @item -dumpversion
4472 @opindex dumpversion
4473 Print the compiler version (for example, @samp{3.0})---and don't do
4474 anything else.
4475
4476 @item -dumpspecs
4477 @opindex dumpspecs
4478 Print the compiler's built-in specs---and don't do anything else.  (This
4479 is used when GCC itself is being built.)  @xref{Spec Files}.
4480
4481 @item -feliminate-unused-debug-types
4482 @opindex feliminate-unused-debug-types
4483 Normally, when producing DWARF2 output, GCC will emit debugging
4484 information for all types declared in a compilation
4485 unit, regardless of whether or not they are actually used
4486 in that compilation unit.  Sometimes this is useful, such as
4487 if, in the debugger, you want to cast a value to a type that is
4488 not actually used in your program (but is declared).  More often,
4489 however, this results in a significant amount of wasted space.
4490 With this option, GCC will avoid producing debug symbol output
4491 for types that are nowhere used in the source file being compiled.
4492 @end table
4493
4494 @node Optimize Options
4495 @section Options That Control Optimization
4496 @cindex optimize options
4497 @cindex options, optimization
4498
4499 These options control various sorts of optimizations.
4500
4501 Without any optimization option, the compiler's goal is to reduce the
4502 cost of compilation and to make debugging produce the expected
4503 results.  Statements are independent: if you stop the program with a
4504 breakpoint between statements, you can then assign a new value to any
4505 variable or change the program counter to any other statement in the
4506 function and get exactly the results you would expect from the source
4507 code.
4508
4509 Turning on optimization flags makes the compiler attempt to improve
4510 the performance and/or code size at the expense of compilation time
4511 and possibly the ability to debug the program.
4512
4513 The compiler performs optimization based on the knowledge it has of
4514 the program.  Optimization levels @option{-O} and above, in
4515 particular, enable @emph{unit-at-a-time} mode, which allows the
4516 compiler to consider information gained from later functions in
4517 the file when compiling a function.  Compiling multiple files at
4518 once to a single output file in @emph{unit-at-a-time} mode allows
4519 the compiler to use information gained from all of the files when
4520 compiling each of them.
4521
4522 Not all optimizations are controlled directly by a flag.  Only
4523 optimizations that have a flag are listed.
4524
4525 @table @gcctabopt
4526 @item -O
4527 @itemx -O1
4528 @opindex O
4529 @opindex O1
4530 Optimize.  Optimizing compilation takes somewhat more time, and a lot
4531 more memory for a large function.
4532
4533 With @option{-O}, the compiler tries to reduce code size and execution
4534 time, without performing any optimizations that take a great deal of
4535 compilation time.
4536
4537 @option{-O} turns on the following optimization flags:
4538 @gccoptlist{-fdefer-pop @gol
4539 -fdelayed-branch @gol
4540 -fguess-branch-probability @gol
4541 -fcprop-registers @gol
4542 -fif-conversion @gol
4543 -fif-conversion2 @gol
4544 -ftree-ccp @gol
4545 -ftree-dce @gol
4546 -ftree-dominator-opts @gol
4547 -ftree-dse @gol
4548 -ftree-ter @gol
4549 -ftree-lrs @gol
4550 -ftree-sra @gol
4551 -ftree-copyrename @gol
4552 -ftree-fre @gol
4553 -ftree-ch @gol
4554 -funit-at-a-time @gol
4555 -fmerge-constants}
4556
4557 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
4558 where doing so does not interfere with debugging.
4559
4560 @item -O2
4561 @opindex O2
4562 Optimize even more.  GCC performs nearly all supported optimizations
4563 that do not involve a space-speed tradeoff.  The compiler does not
4564 perform loop unrolling or function inlining when you specify @option{-O2}.
4565 As compared to @option{-O}, this option increases both compilation time
4566 and the performance of the generated code.
4567
4568 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
4569 also turns on the following optimization flags:
4570 @gccoptlist{-fthread-jumps @gol
4571 -fcrossjumping @gol
4572 -foptimize-sibling-calls @gol
4573 -fcse-follow-jumps  -fcse-skip-blocks @gol
4574 -fgcse  -fgcse-lm  @gol
4575 -fexpensive-optimizations @gol
4576 -frerun-cse-after-loop  @gol
4577 -fcaller-saves @gol
4578 -fpeephole2 @gol
4579 -fschedule-insns  -fschedule-insns2 @gol
4580 -fsched-interblock  -fsched-spec @gol
4581 -fregmove @gol
4582 -fstrict-aliasing @gol
4583 -fdelete-null-pointer-checks @gol
4584 -freorder-blocks  -freorder-functions @gol
4585 -falign-functions  -falign-jumps @gol
4586 -falign-loops  -falign-labels @gol
4587 -ftree-vrp @gol
4588 -ftree-pre}
4589
4590 Please note the warning under @option{-fgcse} about
4591 invoking @option{-O2} on programs that use computed gotos.
4592
4593 @item -O3
4594 @opindex O3
4595 Optimize yet more.  @option{-O3} turns on all optimizations specified by
4596 @option{-O2} and also turns on the @option{-finline-functions},
4597 @option{-funswitch-loops} and @option{-fgcse-after-reload} options.
4598
4599 @item -O0
4600 @opindex O0
4601 Do not optimize.  This is the default.
4602
4603 @item -Os
4604 @opindex Os
4605 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
4606 do not typically increase code size.  It also performs further
4607 optimizations designed to reduce code size.
4608
4609 @option{-Os} disables the following optimization flags:
4610 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
4611 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
4612 -fprefetch-loop-arrays  -ftree-vect-loop-version}
4613
4614 If you use multiple @option{-O} options, with or without level numbers,
4615 the last such option is the one that is effective.
4616 @end table
4617
4618 Options of the form @option{-f@var{flag}} specify machine-independent
4619 flags.  Most flags have both positive and negative forms; the negative
4620 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
4621 below, only one of the forms is listed---the one you typically will
4622 use.  You can figure out the other form by either removing @samp{no-}
4623 or adding it.
4624
4625 The following options control specific optimizations.  They are either
4626 activated by @option{-O} options or are related to ones that are.  You
4627 can use the following flags in the rare cases when ``fine-tuning'' of
4628 optimizations to be performed is desired.
4629
4630 @table @gcctabopt
4631 @item -fno-default-inline
4632 @opindex fno-default-inline
4633 Do not make member functions inline by default merely because they are
4634 defined inside the class scope (C++ only).  Otherwise, when you specify
4635 @w{@option{-O}}, member functions defined inside class scope are compiled
4636 inline by default; i.e., you don't need to add @samp{inline} in front of
4637 the member function name.
4638
4639 @item -fno-defer-pop
4640 @opindex fno-defer-pop
4641 Always pop the arguments to each function call as soon as that function
4642 returns.  For machines which must pop arguments after a function call,
4643 the compiler normally lets arguments accumulate on the stack for several
4644 function calls and pops them all at once.
4645
4646 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4647
4648 @item -fforce-mem
4649 @opindex fforce-mem
4650 Force memory operands to be copied into registers before doing
4651 arithmetic on them.  This produces better code by making all memory
4652 references potential common subexpressions.  When they are not common
4653 subexpressions, instruction combination should eliminate the separate
4654 register-load. This option is now a nop and will be removed in 4.2.
4655
4656 @item -fforce-addr
4657 @opindex fforce-addr
4658 Force memory address constants to be copied into registers before
4659 doing arithmetic on them.
4660
4661 @item -fforward-propagate
4662 @opindex fforward-propagate
4663 Perform a forward propagation pass on RTL.  The pass tries to combine two
4664 instructions and checks if the result can be simplified.  If loop unrolling
4665 is active, two passes are performed and the second is scheduled after
4666 loop unrolling.
4667
4668 This option is enabled by default at optimization levels @option{-O2},
4669 @option{-O3}, @option{-Os}.
4670
4671 @item -fomit-frame-pointer
4672 @opindex fomit-frame-pointer
4673 Don't keep the frame pointer in a register for functions that
4674 don't need one.  This avoids the instructions to save, set up and
4675 restore frame pointers; it also makes an extra register available
4676 in many functions.  @strong{It also makes debugging impossible on
4677 some machines.}
4678
4679 On some machines, such as the VAX, this flag has no effect, because
4680 the standard calling sequence automatically handles the frame pointer
4681 and nothing is saved by pretending it doesn't exist.  The
4682 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
4683 whether a target machine supports this flag.  @xref{Registers,,Register
4684 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
4685
4686 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4687
4688 @item -foptimize-sibling-calls
4689 @opindex foptimize-sibling-calls
4690 Optimize sibling and tail recursive calls.
4691
4692 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4693
4694 @item -fno-inline
4695 @opindex fno-inline
4696 Don't pay attention to the @code{inline} keyword.  Normally this option
4697 is used to keep the compiler from expanding any functions inline.
4698 Note that if you are not optimizing, no functions can be expanded inline.
4699
4700 @item -finline-functions
4701 @opindex finline-functions
4702 Integrate all simple functions into their callers.  The compiler
4703 heuristically decides which functions are simple enough to be worth
4704 integrating in this way.
4705
4706 If all calls to a given function are integrated, and the function is
4707 declared @code{static}, then the function is normally not output as
4708 assembler code in its own right.
4709
4710 Enabled at level @option{-O3}.
4711
4712 @item -finline-functions-called-once
4713 @opindex finline-functions-called-once
4714 Consider all @code{static} functions called once for inlining into their
4715 caller even if they are not marked @code{inline}.  If a call to a given
4716 function is integrated, then the function is not output as assembler code
4717 in its own right.
4718
4719 Enabled if @option{-funit-at-a-time} is enabled.
4720
4721 @item -fearly-inlining
4722 @opindex fearly-inlining
4723 Inline functions marked by @code{always_inline} and functions whose body seems
4724 smaller than the function call overhead early before doing
4725 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
4726 makes profiling significantly cheaper and usually inlining faster on programs
4727 having large chains of nested wrapper functions.
4728
4729 Enabled by default.
4730
4731 @item -finline-limit=@var{n}
4732 @opindex finline-limit
4733 By default, GCC limits the size of functions that can be inlined.  This flag
4734 allows the control of this limit for functions that are explicitly marked as
4735 inline (i.e., marked with the inline keyword or defined within the class
4736 definition in c++).  @var{n} is the size of functions that can be inlined in
4737 number of pseudo instructions (not counting parameter handling).  The default
4738 value of @var{n} is 600.
4739 Increasing this value can result in more inlined code at
4740 the cost of compilation time and memory consumption.  Decreasing usually makes
4741 the compilation faster and less code will be inlined (which presumably
4742 means slower programs).  This option is particularly useful for programs that
4743 use inlining heavily such as those based on recursive templates with C++.
4744
4745 Inlining is actually controlled by a number of parameters, which may be
4746 specified individually by using @option{--param @var{name}=@var{value}}.
4747 The @option{-finline-limit=@var{n}} option sets some of these parameters
4748 as follows:
4749
4750 @table @gcctabopt
4751 @item max-inline-insns-single
4752  is set to @var{n}/2.
4753 @item max-inline-insns-auto
4754  is set to @var{n}/2.
4755 @item min-inline-insns
4756  is set to 130 or @var{n}/4, whichever is smaller.
4757 @item max-inline-insns-rtl
4758  is set to @var{n}.
4759 @end table
4760
4761 See below for a documentation of the individual
4762 parameters controlling inlining.
4763
4764 @emph{Note:} pseudo instruction represents, in this particular context, an
4765 abstract measurement of function's size.  In no way does it represent a count
4766 of assembly instructions and as such its exact meaning might change from one
4767 release to an another.
4768
4769 @item -fkeep-inline-functions
4770 @opindex fkeep-inline-functions
4771 In C, emit @code{static} functions that are declared @code{inline}
4772 into the object file, even if the function has been inlined into all
4773 of its callers.  This switch does not affect functions using the
4774 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
4775 inline functions into the object file.
4776
4777 @item -fkeep-static-consts
4778 @opindex fkeep-static-consts
4779 Emit variables declared @code{static const} when optimization isn't turned
4780 on, even if the variables aren't referenced.
4781
4782 GCC enables this option by default.  If you want to force the compiler to
4783 check if the variable was referenced, regardless of whether or not
4784 optimization is turned on, use the @option{-fno-keep-static-consts} option.
4785
4786 @item -fmerge-constants
4787 Attempt to merge identical constants (string constants and floating point
4788 constants) across compilation units.
4789
4790 This option is the default for optimized compilation if the assembler and
4791 linker support it.  Use @option{-fno-merge-constants} to inhibit this
4792 behavior.
4793
4794 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4795
4796 @item -fmerge-all-constants
4797 Attempt to merge identical constants and identical variables.
4798
4799 This option implies @option{-fmerge-constants}.  In addition to
4800 @option{-fmerge-constants} this considers e.g.@: even constant initialized
4801 arrays or initialized constant variables with integral or floating point
4802 types.  Languages like C or C++ require each non-automatic variable to
4803 have distinct location, so using this option will result in non-conforming
4804 behavior.
4805
4806 @item -fmodulo-sched
4807 @opindex fmodulo-sched
4808 Perform swing modulo scheduling immediately before the first scheduling
4809 pass.  This pass looks at innermost loops and reorders their
4810 instructions by overlapping different iterations.
4811
4812 @item -fno-branch-count-reg
4813 @opindex fno-branch-count-reg
4814 Do not use ``decrement and branch'' instructions on a count register,
4815 but instead generate a sequence of instructions that decrement a
4816 register, compare it against zero, then branch based upon the result.
4817 This option is only meaningful on architectures that support such
4818 instructions, which include x86, PowerPC, IA-64 and S/390.
4819
4820 The default is @option{-fbranch-count-reg}.
4821
4822 @item -fno-function-cse
4823 @opindex fno-function-cse
4824 Do not put function addresses in registers; make each instruction that
4825 calls a constant function contain the function's address explicitly.
4826
4827 This option results in less efficient code, but some strange hacks
4828 that alter the assembler output may be confused by the optimizations
4829 performed when this option is not used.
4830
4831 The default is @option{-ffunction-cse}
4832
4833 @item -fno-zero-initialized-in-bss
4834 @opindex fno-zero-initialized-in-bss
4835 If the target supports a BSS section, GCC by default puts variables that
4836 are initialized to zero into BSS@.  This can save space in the resulting
4837 code.
4838
4839 This option turns off this behavior because some programs explicitly
4840 rely on variables going to the data section.  E.g., so that the
4841 resulting executable can find the beginning of that section and/or make
4842 assumptions based on that.
4843
4844 The default is @option{-fzero-initialized-in-bss}.
4845
4846 @item -fbounds-check
4847 @opindex fbounds-check
4848 For front-ends that support it, generate additional code to check that
4849 indices used to access arrays are within the declared range.  This is
4850 currently only supported by the Java and Fortran front-ends, where
4851 this option defaults to true and false respectively.
4852
4853 @item -fmudflap -fmudflapth -fmudflapir
4854 @opindex fmudflap
4855 @opindex fmudflapth
4856 @opindex fmudflapir
4857 @cindex bounds checking
4858 @cindex mudflap
4859 For front-ends that support it (C and C++), instrument all risky
4860 pointer/array dereferencing operations, some standard library
4861 string/heap functions, and some other associated constructs with
4862 range/validity tests.  Modules so instrumented should be immune to
4863 buffer overflows, invalid heap use, and some other classes of C/C++
4864 programming errors.  The instrumentation relies on a separate runtime
4865 library (@file{libmudflap}), which will be linked into a program if
4866 @option{-fmudflap} is given at link time.  Run-time behavior of the
4867 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
4868 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
4869 for its options.
4870
4871 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
4872 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
4873 addition to @option{-fmudflap} or @option{-fmudflapth}, if
4874 instrumentation should ignore pointer reads.  This produces less
4875 instrumentation (and therefore faster execution) and still provides
4876 some protection against outright memory corrupting writes, but allows
4877 erroneously read data to propagate within a program.
4878
4879 @item -fthread-jumps
4880 @opindex fthread-jumps
4881 Perform optimizations where we check to see if a jump branches to a
4882 location where another comparison subsumed by the first is found.  If
4883 so, the first branch is redirected to either the destination of the
4884 second branch or a point immediately following it, depending on whether
4885 the condition is known to be true or false.
4886
4887 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4888
4889 @item -fcse-follow-jumps
4890 @opindex fcse-follow-jumps
4891 In common subexpression elimination, scan through jump instructions
4892 when the target of the jump is not reached by any other path.  For
4893 example, when CSE encounters an @code{if} statement with an
4894 @code{else} clause, CSE will follow the jump when the condition
4895 tested is false.
4896
4897 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4898
4899 @item -fcse-skip-blocks
4900 @opindex fcse-skip-blocks
4901 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
4902 follow jumps which conditionally skip over blocks.  When CSE
4903 encounters a simple @code{if} statement with no else clause,
4904 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
4905 body of the @code{if}.
4906
4907 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4908
4909 @item -frerun-cse-after-loop
4910 @opindex frerun-cse-after-loop
4911 Re-run common subexpression elimination after loop optimizations has been
4912 performed.
4913
4914 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4915
4916 @item -fgcse
4917 @opindex fgcse
4918 Perform a global common subexpression elimination pass.
4919 This pass also performs global constant and copy propagation.
4920
4921 @emph{Note:} When compiling a program using computed gotos, a GCC
4922 extension, you may get better runtime performance if you disable
4923 the global common subexpression elimination pass by adding
4924 @option{-fno-gcse} to the command line.
4925
4926 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4927
4928 @item -fgcse-lm
4929 @opindex fgcse-lm
4930 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
4931 attempt to move loads which are only killed by stores into themselves.  This
4932 allows a loop containing a load/store sequence to be changed to a load outside
4933 the loop, and a copy/store within the loop.
4934
4935 Enabled by default when gcse is enabled.
4936
4937 @item -fgcse-sm
4938 @opindex fgcse-sm
4939 When @option{-fgcse-sm} is enabled, a store motion pass is run after
4940 global common subexpression elimination.  This pass will attempt to move
4941 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
4942 loops containing a load/store sequence can be changed to a load before
4943 the loop and a store after the loop.
4944
4945 Not enabled at any optimization level.
4946
4947 @item -fgcse-las
4948 @opindex fgcse-las
4949 When @option{-fgcse-las} is enabled, the global common subexpression
4950 elimination pass eliminates redundant loads that come after stores to the
4951 same memory location (both partial and full redundancies).
4952
4953 Not enabled at any optimization level.
4954
4955 @item -fgcse-after-reload
4956 @opindex fgcse-after-reload
4957 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
4958 pass is performed after reload.  The purpose of this pass is to cleanup
4959 redundant spilling.
4960
4961 @item -funsafe-loop-optimizations
4962 @opindex funsafe-loop-optimizations
4963 If given, the loop optimizer will assume that loop indices do not
4964 overflow, and that the loops with nontrivial exit condition are not
4965 infinite.  This enables a wider range of loop optimizations even if
4966 the loop optimizer itself cannot prove that these assumptions are valid.
4967 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
4968 if it finds this kind of loop.
4969
4970 @item -fcrossjumping
4971 @opindex crossjumping
4972 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
4973 resulting code may or may not perform better than without cross-jumping.
4974
4975 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
4976
4977 @item -fif-conversion
4978 @opindex if-conversion
4979 Attempt to transform conditional jumps into branch-less equivalents.  This
4980 include use of conditional moves, min, max, set flags and abs instructions, and
4981 some tricks doable by standard arithmetics.  The use of conditional execution
4982 on chips where it is available is controlled by @code{if-conversion2}.
4983
4984 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4985
4986 @item -fif-conversion2
4987 @opindex if-conversion2
4988 Use conditional execution (where available) to transform conditional jumps into
4989 branch-less equivalents.
4990
4991 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
4992
4993 @item -fdelete-null-pointer-checks
4994 @opindex fdelete-null-pointer-checks
4995 Use global dataflow analysis to identify and eliminate useless checks
4996 for null pointers.  The compiler assumes that dereferencing a null
4997 pointer would have halted the program.  If a pointer is checked after
4998 it has already been dereferenced, it cannot be null.
4999
5000 In some environments, this assumption is not true, and programs can
5001 safely dereference null pointers.  Use
5002 @option{-fno-delete-null-pointer-checks} to disable this optimization
5003 for programs which depend on that behavior.
5004
5005 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5006
5007 @item -fexpensive-optimizations
5008 @opindex fexpensive-optimizations
5009 Perform a number of minor optimizations that are relatively expensive.
5010
5011 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5012
5013 @item -foptimize-register-move
5014 @itemx -fregmove
5015 @opindex foptimize-register-move
5016 @opindex fregmove
5017 Attempt to reassign register numbers in move instructions and as
5018 operands of other simple instructions in order to maximize the amount of
5019 register tying.  This is especially helpful on machines with two-operand
5020 instructions.
5021
5022 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5023 optimization.
5024
5025 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5026
5027 @item -fdelayed-branch
5028 @opindex fdelayed-branch
5029 If supported for the target machine, attempt to reorder instructions
5030 to exploit instruction slots available after delayed branch
5031 instructions.
5032
5033 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5034
5035 @item -fschedule-insns
5036 @opindex fschedule-insns
5037 If supported for the target machine, attempt to reorder instructions to
5038 eliminate execution stalls due to required data being unavailable.  This
5039 helps machines that have slow floating point or memory load instructions
5040 by allowing other instructions to be issued until the result of the load
5041 or floating point instruction is required.
5042
5043 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5044
5045 @item -fschedule-insns2
5046 @opindex fschedule-insns2
5047 Similar to @option{-fschedule-insns}, but requests an additional pass of
5048 instruction scheduling after register allocation has been done.  This is
5049 especially useful on machines with a relatively small number of
5050 registers and where memory load instructions take more than one cycle.
5051
5052 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5053
5054 @item -fno-sched-interblock
5055 @opindex fno-sched-interblock
5056 Don't schedule instructions across basic blocks.  This is normally
5057 enabled by default when scheduling before register allocation, i.e.@:
5058 with @option{-fschedule-insns} or at @option{-O2} or higher.
5059
5060 @item -fno-sched-spec
5061 @opindex fno-sched-spec
5062 Don't allow speculative motion of non-load instructions.  This is normally
5063 enabled by default when scheduling before register allocation, i.e.@:
5064 with @option{-fschedule-insns} or at @option{-O2} or higher.
5065
5066 @item -fsched-spec-load
5067 @opindex fsched-spec-load
5068 Allow speculative motion of some load instructions.  This only makes
5069 sense when scheduling before register allocation, i.e.@: with
5070 @option{-fschedule-insns} or at @option{-O2} or higher.
5071
5072 @item -fsched-spec-load-dangerous
5073 @opindex fsched-spec-load-dangerous
5074 Allow speculative motion of more load instructions.  This only makes
5075 sense when scheduling before register allocation, i.e.@: with
5076 @option{-fschedule-insns} or at @option{-O2} or higher.
5077
5078 @item -fsched-stalled-insns=@var{n}
5079 @opindex fsched-stalled-insns
5080 Define how many insns (if any) can be moved prematurely from the queue
5081 of stalled insns into the ready list, during the second scheduling pass.
5082
5083 @item -fsched-stalled-insns-dep=@var{n}
5084 @opindex fsched-stalled-insns-dep
5085 Define how many insn groups (cycles) will be examined for a dependency
5086 on a stalled insn that is candidate for premature removal from the queue
5087 of stalled insns.  Has an effect only during the second scheduling pass,
5088 and only if @option{-fsched-stalled-insns} is used and its value is not zero.
5089
5090 @item -fsched2-use-superblocks
5091 @opindex fsched2-use-superblocks
5092 When scheduling after register allocation, do use superblock scheduling
5093 algorithm.  Superblock scheduling allows motion across basic block boundaries
5094 resulting on faster schedules.  This option is experimental, as not all machine
5095 descriptions used by GCC model the CPU closely enough to avoid unreliable
5096 results from the algorithm.
5097
5098 This only makes sense when scheduling after register allocation, i.e.@: with
5099 @option{-fschedule-insns2} or at @option{-O2} or higher.
5100
5101 @item -fsched2-use-traces
5102 @opindex fsched2-use-traces
5103 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5104 allocation and additionally perform code duplication in order to increase the
5105 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5106 trace formation.
5107
5108 This mode should produce faster but significantly longer programs.  Also
5109 without @option{-fbranch-probabilities} the traces constructed may not
5110 match the reality and hurt the performance.  This only makes
5111 sense when scheduling after register allocation, i.e.@: with
5112 @option{-fschedule-insns2} or at @option{-O2} or higher.
5113
5114 @item -fsee
5115 @opindex fsee
5116 Eliminates redundant extension instructions and move the non redundant
5117 ones to optimal placement using LCM.
5118
5119 @item -freschedule-modulo-scheduled-loops
5120 @opindex fscheduling-in-modulo-scheduled-loops
5121 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
5122 we may want to prevent the later scheduling passes from changing its schedule, we use this
5123 option to control that.
5124
5125 @item -fcaller-saves
5126 @opindex fcaller-saves
5127 Enable values to be allocated in registers that will be clobbered by
5128 function calls, by emitting extra instructions to save and restore the
5129 registers around such calls.  Such allocation is done only when it
5130 seems to result in better code than would otherwise be produced.
5131
5132 This option is always enabled by default on certain machines, usually
5133 those which have no call-preserved registers to use instead.
5134
5135 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5136
5137 @item -ftree-pre
5138 Perform Partial Redundancy Elimination (PRE) on trees.  This flag is
5139 enabled by default at @option{-O2} and @option{-O3}.
5140
5141 @item -ftree-fre
5142 Perform Full Redundancy Elimination (FRE) on trees.  The difference
5143 between FRE and PRE is that FRE only considers expressions
5144 that are computed on all paths leading to the redundant computation.
5145 This analysis faster than PRE, though it exposes fewer redundancies.
5146 This flag is enabled by default at @option{-O} and higher.
5147
5148 @item -ftree-copy-prop
5149 Perform copy propagation on trees.  This pass eliminates unnecessary
5150 copy operations.  This flag is enabled by default at @option{-O} and
5151 higher.
5152
5153 @item -ftree-store-copy-prop
5154 Perform copy propagation of memory loads and stores.  This pass
5155 eliminates unnecessary copy operations in memory references
5156 (structures, global variables, arrays, etc).  This flag is enabled by
5157 default at @option{-O2} and higher.
5158
5159 @item -ftree-salias
5160 Perform structural alias analysis on trees.  This flag
5161 is enabled by default at @option{-O} and higher.
5162
5163 @item -fipa-pta
5164 Perform interprocedural pointer analysis.
5165
5166 @item -ftree-sink
5167 Perform forward store motion  on trees.  This flag is
5168 enabled by default at @option{-O} and higher.
5169
5170 @item -ftree-ccp
5171 Perform sparse conditional constant propagation (CCP) on trees.  This
5172 pass only operates on local scalar variables and is enabled by default
5173 at @option{-O} and higher.
5174
5175 @item -ftree-store-ccp
5176 Perform sparse conditional constant propagation (CCP) on trees.  This
5177 pass operates on both local scalar variables and memory stores and
5178 loads (global variables, structures, arrays, etc).  This flag is
5179 enabled by default at @option{-O2} and higher.
5180
5181 @item -ftree-dce
5182 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5183 default at @option{-O} and higher.
5184
5185 @item -ftree-dominator-opts
5186 Perform a variety of simple scalar cleanups (constant/copy
5187 propagation, redundancy elimination, range propagation and expression
5188 simplification) based on a dominator tree traversal.  This also
5189 performs jump threading (to reduce jumps to jumps). This flag is
5190 enabled by default at @option{-O} and higher.
5191
5192 @item -ftree-ch
5193 Perform loop header copying on trees.  This is beneficial since it increases
5194 effectiveness of code motion optimizations.  It also saves one jump.  This flag
5195 is enabled by default at @option{-O} and higher.  It is not enabled
5196 for @option{-Os}, since it usually increases code size.
5197
5198 @item -ftree-loop-optimize
5199 Perform loop optimizations on trees.  This flag is enabled by default
5200 at @option{-O} and higher.
5201
5202 @item -ftree-loop-linear
5203 Perform linear loop transformations on tree.  This flag can improve cache
5204 performance and allow further loop optimizations to take place.
5205
5206 @item -ftree-loop-im
5207 Perform loop invariant motion on trees.  This pass moves only invariants that
5208 would be hard to handle at RTL level (function calls, operations that expand to
5209 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
5210 operands of conditions that are invariant out of the loop, so that we can use
5211 just trivial invariantness analysis in loop unswitching.  The pass also includes
5212 store motion.
5213
5214 @item -ftree-loop-ivcanon
5215 Create a canonical counter for number of iterations in the loop for that
5216 determining number of iterations requires complicated analysis.  Later
5217 optimizations then may determine the number easily.  Useful especially
5218 in connection with unrolling.
5219
5220 @item -fivopts
5221 Perform induction variable optimizations (strength reduction, induction
5222 variable merging and induction variable elimination) on trees.
5223
5224 @item -ftree-sra
5225 Perform scalar replacement of aggregates.  This pass replaces structure
5226 references with scalars to prevent committing structures to memory too
5227 early.  This flag is enabled by default at @option{-O} and higher.
5228
5229 @item -ftree-copyrename
5230 Perform copy renaming on trees.  This pass attempts to rename compiler
5231 temporaries to other variables at copy locations, usually resulting in
5232 variable names which more closely resemble the original variables.  This flag
5233 is enabled by default at @option{-O} and higher.
5234
5235 @item -ftree-ter
5236 Perform temporary expression replacement during the SSA->normal phase.  Single
5237 use/single def temporaries are replaced at their use location with their
5238 defining expression.  This results in non-GIMPLE code, but gives the expanders
5239 much more complex trees to work on resulting in better RTL generation.  This is
5240 enabled by default at @option{-O} and higher.
5241
5242 @item -ftree-lrs
5243 Perform live range splitting during the SSA->normal phase.  Distinct live
5244 ranges of a variable are split into unique variables, allowing for better
5245 optimization later.  This is enabled by default at @option{-O} and higher.
5246
5247 @item -ftree-vectorize
5248 Perform loop vectorization on trees.
5249
5250 @item -ftree-vect-loop-version
5251 @opindex ftree-vect-loop-version
5252 Perform loop versioning when doing loop vectorization on trees.  When a loop
5253 appears to be vectorizable except that data alignment or data dependence cannot
5254 be determined at compile time then vectorized and non-vectorized versions of
5255 the loop are generated along with runtime checks for alignment or dependence
5256 to control which version is executed.  This option is enabled by default
5257 except at level @option{-Os} where it is disabled.
5258
5259 @item -ftree-vrp
5260 Perform Value Range Propagation on trees.  This is similar to the
5261 constant propagation pass, but instead of values, ranges of values are
5262 propagated.  This allows the optimizers to remove unnecessary range
5263 checks like array bound checks and null pointer checks.  This is
5264 enabled by default at @option{-O2} and higher.  Null pointer check
5265 elimination is only done if @option{-fdelete-null-pointer-checks} is
5266 enabled.
5267
5268 @item -ftracer
5269 @opindex ftracer
5270 Perform tail duplication to enlarge superblock size.  This transformation
5271 simplifies the control flow of the function allowing other optimizations to do
5272 better job.
5273
5274 @item -funroll-loops
5275 @opindex funroll-loops
5276 Unroll loops whose number of iterations can be determined at compile
5277 time or upon entry to the loop.  @option{-funroll-loops} implies
5278 @option{-frerun-cse-after-loop}.  This option makes code larger,
5279 and may or may not make it run faster.
5280
5281 @item -funroll-all-loops
5282 @opindex funroll-all-loops
5283 Unroll all loops, even if their number of iterations is uncertain when
5284 the loop is entered.  This usually makes programs run more slowly.
5285 @option{-funroll-all-loops} implies the same options as
5286 @option{-funroll-loops},
5287
5288 @item -fsplit-ivs-in-unroller
5289 @opindex -fsplit-ivs-in-unroller
5290 Enables expressing of values of induction variables in later iterations
5291 of the unrolled loop using the value in the first iteration.  This breaks
5292 long dependency chains, thus improving efficiency of the scheduling passes.
5293
5294 Combination of @option{-fweb} and CSE is often sufficient to obtain the
5295 same effect.  However in cases the loop body is more complicated than
5296 a single basic block, this is not reliable.  It also does not work at all
5297 on some of the architectures due to restrictions in the CSE pass.
5298
5299 This optimization is enabled by default.
5300
5301 @item -fvariable-expansion-in-unroller
5302 @opindex -fvariable-expansion-in-unroller
5303 With this option, the compiler will create multiple copies of some
5304 local variables when unrolling a loop which can result in superior code.
5305
5306 @item -fprefetch-loop-arrays
5307 @opindex fprefetch-loop-arrays
5308 If supported by the target machine, generate instructions to prefetch
5309 memory to improve the performance of loops that access large arrays.
5310
5311 This option may generate better or worse code; results are highly
5312 dependent on the structure of loops within the source code.
5313
5314 Disabled at level @option{-Os}.
5315
5316 @item -fno-peephole
5317 @itemx -fno-peephole2
5318 @opindex fno-peephole
5319 @opindex fno-peephole2
5320 Disable any machine-specific peephole optimizations.  The difference
5321 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
5322 are implemented in the compiler; some targets use one, some use the
5323 other, a few use both.
5324
5325 @option{-fpeephole} is enabled by default.
5326 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5327
5328 @item -fno-guess-branch-probability
5329 @opindex fno-guess-branch-probability
5330 Do not guess branch probabilities using heuristics.
5331
5332 GCC will use heuristics to guess branch probabilities if they are
5333 not provided by profiling feedback (@option{-fprofile-arcs}).  These
5334 heuristics are based on the control flow graph.  If some branch probabilities
5335 are specified by @samp{__builtin_expect}, then the heuristics will be
5336 used to guess branch probabilities for the rest of the control flow graph,
5337 taking the @samp{__builtin_expect} info into account.  The interactions
5338 between the heuristics and @samp{__builtin_expect} can be complex, and in
5339 some cases, it may be useful to disable the heuristics so that the effects
5340 of @samp{__builtin_expect} are easier to understand.
5341
5342 The default is @option{-fguess-branch-probability} at levels
5343 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5344
5345 @item -freorder-blocks
5346 @opindex freorder-blocks
5347 Reorder basic blocks in the compiled function in order to reduce number of
5348 taken branches and improve code locality.
5349
5350 Enabled at levels @option{-O2}, @option{-O3}.
5351
5352 @item -freorder-blocks-and-partition
5353 @opindex freorder-blocks-and-partition
5354 In addition to reordering basic blocks in the compiled function, in order
5355 to reduce number of taken branches, partitions hot and cold basic blocks
5356 into separate sections of the assembly and .o files, to improve
5357 paging and cache locality performance.
5358
5359 This optimization is automatically turned off in the presence of
5360 exception handling, for linkonce sections, for functions with a user-defined
5361 section attribute and on any architecture that does not support named
5362 sections.
5363
5364 @item -freorder-functions
5365 @opindex freorder-functions
5366 Reorder functions in the object file in order to
5367 improve code locality.  This is implemented by using special
5368 subsections @code{.text.hot} for most frequently executed functions and
5369 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
5370 the linker so object file format must support named sections and linker must
5371 place them in a reasonable way.
5372
5373 Also profile feedback must be available in to make this option effective.  See
5374 @option{-fprofile-arcs} for details.
5375
5376 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5377
5378 @item -fstrict-aliasing
5379 @opindex fstrict-aliasing
5380 Allows the compiler to assume the strictest aliasing rules applicable to
5381 the language being compiled.  For C (and C++), this activates
5382 optimizations based on the type of expressions.  In particular, an
5383 object of one type is assumed never to reside at the same address as an
5384 object of a different type, unless the types are almost the same.  For
5385 example, an @code{unsigned int} can alias an @code{int}, but not a
5386 @code{void*} or a @code{double}.  A character type may alias any other
5387 type.
5388
5389 Pay special attention to code like this:
5390 @smallexample
5391 union a_union @{
5392   int i;
5393   double d;
5394 @};
5395
5396 int f() @{
5397   a_union t;
5398   t.d = 3.0;
5399   return t.i;
5400 @}
5401 @end smallexample
5402 The practice of reading from a different union member than the one most
5403 recently written to (called ``type-punning'') is common.  Even with
5404 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
5405 is accessed through the union type.  So, the code above will work as
5406 expected.  However, this code might not:
5407 @smallexample
5408 int f() @{
5409   a_union t;
5410   int* ip;
5411   t.d = 3.0;
5412   ip = &t.i;
5413   return *ip;
5414 @}
5415 @end smallexample
5416
5417 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5418
5419 @item -falign-functions
5420 @itemx -falign-functions=@var{n}
5421 @opindex falign-functions
5422 Align the start of functions to the next power-of-two greater than
5423 @var{n}, skipping up to @var{n} bytes.  For instance,
5424 @option{-falign-functions=32} aligns functions to the next 32-byte
5425 boundary, but @option{-falign-functions=24} would align to the next
5426 32-byte boundary only if this can be done by skipping 23 bytes or less.
5427
5428 @option{-fno-align-functions} and @option{-falign-functions=1} are
5429 equivalent and mean that functions will not be aligned.
5430
5431 Some assemblers only support this flag when @var{n} is a power of two;
5432 in that case, it is rounded up.
5433
5434 If @var{n} is not specified or is zero, use a machine-dependent default.
5435
5436 Enabled at levels @option{-O2}, @option{-O3}.
5437
5438 @item -falign-labels
5439 @itemx -falign-labels=@var{n}
5440 @opindex falign-labels
5441 Align all branch targets to a power-of-two boundary, skipping up to
5442 @var{n} bytes like @option{-falign-functions}.  This option can easily
5443 make code slower, because it must insert dummy operations for when the
5444 branch target is reached in the usual flow of the code.
5445
5446 @option{-fno-align-labels} and @option{-falign-labels=1} are
5447 equivalent and mean that labels will not be aligned.
5448
5449 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
5450 are greater than this value, then their values are used instead.
5451
5452 If @var{n} is not specified or is zero, use a machine-dependent default
5453 which is very likely to be @samp{1}, meaning no alignment.
5454
5455 Enabled at levels @option{-O2}, @option{-O3}.
5456
5457 @item -falign-loops
5458 @itemx -falign-loops=@var{n}
5459 @opindex falign-loops
5460 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
5461 like @option{-falign-functions}.  The hope is that the loop will be
5462 executed many times, which will make up for any execution of the dummy
5463 operations.
5464
5465 @option{-fno-align-loops} and @option{-falign-loops=1} are
5466 equivalent and mean that loops will not be aligned.
5467
5468 If @var{n} is not specified or is zero, use a machine-dependent default.
5469
5470 Enabled at levels @option{-O2}, @option{-O3}.
5471
5472 @item -falign-jumps
5473 @itemx -falign-jumps=@var{n}
5474 @opindex falign-jumps
5475 Align branch targets to a power-of-two boundary, for branch targets
5476 where the targets can only be reached by jumping, skipping up to @var{n}
5477 bytes like @option{-falign-functions}.  In this case, no dummy operations
5478 need be executed.
5479
5480 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
5481 equivalent and mean that loops will not be aligned.
5482
5483 If @var{n} is not specified or is zero, use a machine-dependent default.
5484
5485 Enabled at levels @option{-O2}, @option{-O3}.
5486
5487 @item -funit-at-a-time
5488 @opindex funit-at-a-time
5489 Parse the whole compilation unit before starting to produce code.
5490 This allows some extra optimizations to take place but consumes
5491 more memory (in general).  There are some compatibility issues
5492 with @emph{unit-at-a-time} mode:
5493 @itemize @bullet
5494 @item
5495 enabling @emph{unit-at-a-time} mode may change the order
5496 in which functions, variables, and top-level @code{asm} statements
5497 are emitted, and will likely break code relying on some particular
5498 ordering.  The majority of such top-level @code{asm} statements,
5499 though, can be replaced by @code{section} attributes.  The
5500 @option{fno-toplevel-reorder} option may be used to keep the ordering
5501 used in the input file, at the cost of some optimizations.
5502
5503 @item
5504 @emph{unit-at-a-time} mode removes unreferenced static variables
5505 and functions.  This may result in undefined references
5506 when an @code{asm} statement refers directly to variables or functions
5507 that are otherwise unused.  In that case either the variable/function
5508 shall be listed as an operand of the @code{asm} statement operand or,
5509 in the case of top-level @code{asm} statements the attribute @code{used}
5510 shall be used on the declaration.
5511
5512 @item
5513 Static functions now can use non-standard passing conventions that
5514 may break @code{asm} statements calling functions directly.  Again,
5515 attribute @code{used} will prevent this behavior.
5516 @end itemize
5517
5518 As a temporary workaround, @option{-fno-unit-at-a-time} can be used,
5519 but this scheme may not be supported by future releases of GCC@.
5520
5521 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5522
5523 @item -fno-toplevel-reorder
5524 Do not reorder top-level functions, variables, and @code{asm}
5525 statements.  Output them in the same order that they appear in the
5526 input file.  When this option is used, unreferenced static variables
5527 will not be removed.  This option is intended to support existing code
5528 which relies on a particular ordering.  For new code, it is better to
5529 use attributes.
5530
5531 @item -fweb
5532 @opindex fweb
5533 Constructs webs as commonly used for register allocation purposes and assign
5534 each web individual pseudo register.  This allows the register allocation pass
5535 to operate on pseudos directly, but also strengthens several other optimization
5536 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
5537 however, make debugging impossible, since variables will no longer stay in a
5538 ``home register''.
5539
5540 Enabled by default with @option{-funroll-loops}.
5541
5542 @item -fwhole-program
5543 @opindex fwhole-program
5544 Assume that the current compilation unit represents whole program being
5545 compiled.  All public functions and variables with the exception of @code{main}
5546 and those merged by attribute @code{externally_visible} become static functions
5547 and in a affect gets more aggressively optimized by interprocedural optimizers.
5548 While this option is equivalent to proper use of @code{static} keyword for
5549 programs consisting of single file, in combination with option
5550 @option{--combine} this flag can be used to compile most of smaller scale C
5551 programs since the functions and variables become local for the whole combined
5552 compilation unit, not for the single source file itself.
5553
5554
5555 @item -fno-cprop-registers
5556 @opindex fno-cprop-registers
5557 After register allocation and post-register allocation instruction splitting,
5558 we perform a copy-propagation pass to try to reduce scheduling dependencies
5559 and occasionally eliminate the copy.
5560
5561 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5562
5563 @item -fprofile-generate
5564 @opindex fprofile-generate
5565
5566 Enable options usually used for instrumenting application to produce
5567 profile useful for later recompilation with profile feedback based
5568 optimization.  You must use @option{-fprofile-generate} both when
5569 compiling and when linking your program.
5570
5571 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
5572
5573 @item -fprofile-use
5574 @opindex fprofile-use
5575 Enable profile feedback directed optimizations, and optimizations
5576 generally profitable only with profile feedback available.
5577
5578 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
5579 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
5580
5581 @end table
5582
5583 The following options control compiler behavior regarding floating
5584 point arithmetic.  These options trade off between speed and
5585 correctness.  All must be specifically enabled.
5586
5587 @table @gcctabopt
5588 @item -ffloat-store
5589 @opindex ffloat-store
5590 Do not store floating point variables in registers, and inhibit other
5591 options that might change whether a floating point value is taken from a
5592 register or memory.
5593
5594 @cindex floating point precision
5595 This option prevents undesirable excess precision on machines such as
5596 the 68000 where the floating registers (of the 68881) keep more
5597 precision than a @code{double} is supposed to have.  Similarly for the
5598 x86 architecture.  For most programs, the excess precision does only
5599 good, but a few programs rely on the precise definition of IEEE floating
5600 point.  Use @option{-ffloat-store} for such programs, after modifying
5601 them to store all pertinent intermediate computations into variables.
5602
5603 @item -ffast-math
5604 @opindex ffast-math
5605 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
5606 @option{-fno-trapping-math}, @option{-ffinite-math-only},
5607 @option{-fno-rounding-math}, @option{-fno-signaling-nans}
5608 and @option{fcx-limited-range}.
5609
5610 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
5611
5612 This option should never be turned on by any @option{-O} option since
5613 it can result in incorrect output for programs which depend on
5614 an exact implementation of IEEE or ISO rules/specifications for
5615 math functions.
5616
5617 @item -fno-math-errno
5618 @opindex fno-math-errno
5619 Do not set ERRNO after calling math functions that are executed
5620 with a single instruction, e.g., sqrt.  A program that relies on
5621 IEEE exceptions for math error handling may want to use this flag
5622 for speed while maintaining IEEE arithmetic compatibility.
5623
5624 This option should never be turned on by any @option{-O} option since
5625 it can result in incorrect output for programs which depend on
5626 an exact implementation of IEEE or ISO rules/specifications for
5627 math functions.
5628
5629 The default is @option{-fmath-errno}.
5630
5631 On Darwin systems, the math library never sets @code{errno}.  There is therefore
5632 no reason for the compiler to consider the possibility that it might,
5633 and @option{-fno-math-errno} is the default.
5634
5635 @item -funsafe-math-optimizations
5636 @opindex funsafe-math-optimizations
5637 Allow optimizations for floating-point arithmetic that (a) assume
5638 that arguments and results are valid and (b) may violate IEEE or
5639 ANSI standards.  When used at link-time, it may include libraries
5640 or startup files that change the default FPU control word or other
5641 similar optimizations.
5642
5643 This option should never be turned on by any @option{-O} option since
5644 it can result in incorrect output for programs which depend on
5645 an exact implementation of IEEE or ISO rules/specifications for
5646 math functions.
5647
5648 The default is @option{-fno-unsafe-math-optimizations}.
5649
5650 @item -ffinite-math-only
5651 @opindex ffinite-math-only
5652 Allow optimizations for floating-point arithmetic that assume
5653 that arguments and results are not NaNs or +-Infs.
5654
5655 This option should never be turned on by any @option{-O} option since
5656 it can result in incorrect output for programs which depend on
5657 an exact implementation of IEEE or ISO rules/specifications.
5658
5659 The default is @option{-fno-finite-math-only}.
5660
5661 @item -fno-trapping-math
5662 @opindex fno-trapping-math
5663 Compile code assuming that floating-point operations cannot generate
5664 user-visible traps.  These traps include division by zero, overflow,
5665 underflow, inexact result and invalid operation.  This option implies
5666 @option{-fno-signaling-nans}.  Setting this option may allow faster
5667 code if one relies on ``non-stop'' IEEE arithmetic, for example.
5668
5669 This option should never be turned on by any @option{-O} option since
5670 it can result in incorrect output for programs which depend on
5671 an exact implementation of IEEE or ISO rules/specifications for
5672 math functions.
5673
5674 The default is @option{-ftrapping-math}.
5675
5676 @item -frounding-math
5677 @opindex frounding-math
5678 Disable transformations and optimizations that assume default floating
5679 point rounding behavior.  This is round-to-zero for all floating point
5680 to integer conversions, and round-to-nearest for all other arithmetic
5681 truncations.  This option should be specified for programs that change
5682 the FP rounding mode dynamically, or that may be executed with a
5683 non-default rounding mode.  This option disables constant folding of
5684 floating point expressions at compile-time (which may be affected by
5685 rounding mode) and arithmetic transformations that are unsafe in the
5686 presence of sign-dependent rounding modes.
5687
5688 The default is @option{-fno-rounding-math}.
5689
5690 This option is experimental and does not currently guarantee to
5691 disable all GCC optimizations that are affected by rounding mode.
5692 Future versions of GCC may provide finer control of this setting
5693 using C99's @code{FENV_ACCESS} pragma.  This command line option
5694 will be used to specify the default state for @code{FENV_ACCESS}.
5695
5696 @item -frtl-abstract-sequences
5697 @opindex frtl-abstract-sequences
5698 It is a size optimization method. This option is to find identical
5699 sequences of code, which can be turned into pseudo-procedures  and
5700 then  replace  all  occurrences with  calls to  the  newly created
5701 subroutine. It is kind of an opposite of @option{-finline-functions}.
5702 This optimization runs at RTL level.
5703
5704 @item -fsignaling-nans
5705 @opindex fsignaling-nans
5706 Compile code assuming that IEEE signaling NaNs may generate user-visible
5707 traps during floating-point operations.  Setting this option disables
5708 optimizations that may change the number of exceptions visible with
5709 signaling NaNs.  This option implies @option{-ftrapping-math}.
5710
5711 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
5712 be defined.
5713
5714 The default is @option{-fno-signaling-nans}.
5715
5716 This option is experimental and does not currently guarantee to
5717 disable all GCC optimizations that affect signaling NaN behavior.
5718
5719 @item -fsingle-precision-constant
5720 @opindex fsingle-precision-constant
5721 Treat floating point constant as single precision constant instead of
5722 implicitly converting it to double precision constant.
5723
5724 @item -fcx-limited-range
5725 @itemx -fno-cx-limited-range
5726 @opindex fcx-limited-range
5727 @opindex fno-cx-limited-range
5728 When enabled, this option states that a range reduction step is not
5729 needed when performing complex division.  The default is
5730 @option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
5731
5732 This option controls the default setting of the ISO C99 
5733 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
5734 all languages.
5735
5736 @end table
5737
5738 The following options control optimizations that may improve
5739 performance, but are not enabled by any @option{-O} options.  This
5740 section includes experimental options that may produce broken code.
5741
5742 @table @gcctabopt
5743 @item -fbranch-probabilities
5744 @opindex fbranch-probabilities
5745 After running a program compiled with @option{-fprofile-arcs}
5746 (@pxref{Debugging Options,, Options for Debugging Your Program or
5747 @command{gcc}}), you can compile it a second time using
5748 @option{-fbranch-probabilities}, to improve optimizations based on
5749 the number of times each branch was taken.  When the program
5750 compiled with @option{-fprofile-arcs} exits it saves arc execution
5751 counts to a file called @file{@var{sourcename}.gcda} for each source
5752 file.  The information in this data file is very dependent on the
5753 structure of the generated code, so you must use the same source code
5754 and the same optimization options for both compilations.
5755
5756 With @option{-fbranch-probabilities}, GCC puts a
5757 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
5758 These can be used to improve optimization.  Currently, they are only
5759 used in one place: in @file{reorg.c}, instead of guessing which path a
5760 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
5761 exactly determine which path is taken more often.
5762
5763 @item -fprofile-values
5764 @opindex fprofile-values
5765 If combined with @option{-fprofile-arcs}, it adds code so that some
5766 data about values of expressions in the program is gathered.
5767
5768 With @option{-fbranch-probabilities}, it reads back the data gathered
5769 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
5770 notes to instructions for their later usage in optimizations.
5771
5772 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
5773
5774 @item -fvpt
5775 @opindex fvpt
5776 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
5777 a code to gather information about values of expressions.
5778
5779 With @option{-fbranch-probabilities}, it reads back the data gathered
5780 and actually performs the optimizations based on them.
5781 Currently the optimizations include specialization of division operation
5782 using the knowledge about the value of the denominator.
5783
5784 @item -frename-registers
5785 @opindex frename-registers
5786 Attempt to avoid false dependencies in scheduled code by making use
5787 of registers left over after register allocation.  This optimization
5788 will most benefit processors with lots of registers.  Depending on the
5789 debug information format adopted by the target, however, it can
5790 make debugging impossible, since variables will no longer stay in
5791 a ``home register''.
5792
5793 Enabled by default with @option{-funroll-loops}.
5794
5795 @item -ftracer
5796 @opindex ftracer
5797 Perform tail duplication to enlarge superblock size.  This transformation
5798 simplifies the control flow of the function allowing other optimizations to do
5799 better job.
5800
5801 Enabled with @option{-fprofile-use}.
5802
5803 @item -funroll-loops
5804 @opindex funroll-loops
5805 Unroll loops whose number of iterations can be determined at compile time or
5806 upon entry to the loop.  @option{-funroll-loops} implies
5807 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}. 
5808 It also turns on complete loop peeling (i.e.@: complete removal of loops with
5809 small constant number of iterations).  This option makes code larger, and may
5810 or may not make it run faster.
5811
5812 Enabled with @option{-fprofile-use}.
5813
5814 @item -funroll-all-loops
5815 @opindex funroll-all-loops
5816 Unroll all loops, even if their number of iterations is uncertain when
5817 the loop is entered.  This usually makes programs run more slowly.
5818 @option{-funroll-all-loops} implies the same options as
5819 @option{-funroll-loops}.
5820
5821 @item -fpeel-loops
5822 @opindex fpeel-loops
5823 Peels the loops for that there is enough information that they do not
5824 roll much (from profile feedback).  It also turns on complete loop peeling
5825 (i.e.@: complete removal of loops with small constant number of iterations).
5826
5827 Enabled with @option{-fprofile-use}.
5828
5829 @item -fmove-loop-invariants
5830 @opindex fmove-loop-invariants
5831 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
5832 at level @option{-O1}
5833
5834 @item -funswitch-loops
5835 @opindex funswitch-loops
5836 Move branches with loop invariant conditions out of the loop, with duplicates
5837 of the loop on both branches (modified according to result of the condition).
5838
5839 @item -ffunction-sections
5840 @itemx -fdata-sections
5841 @opindex ffunction-sections
5842 @opindex fdata-sections
5843 Place each function or data item into its own section in the output
5844 file if the target supports arbitrary sections.  The name of the
5845 function or the name of the data item determines the section's name
5846 in the output file.
5847
5848 Use these options on systems where the linker can perform optimizations
5849 to improve locality of reference in the instruction space.  Most systems
5850 using the ELF object format and SPARC processors running Solaris 2 have
5851 linkers with such optimizations.  AIX may have these optimizations in
5852 the future.
5853
5854 Only use these options when there are significant benefits from doing
5855 so.  When you specify these options, the assembler and linker will
5856 create larger object and executable files and will also be slower.
5857 You will not be able to use @code{gprof} on all systems if you
5858 specify this option and you may have problems with debugging if
5859 you specify both this option and @option{-g}.
5860
5861 @item -fbranch-target-load-optimize
5862 @opindex fbranch-target-load-optimize
5863 Perform branch target register load optimization before prologue / epilogue
5864 threading.
5865 The use of target registers can typically be exposed only during reload,
5866 thus hoisting loads out of loops and doing inter-block scheduling needs
5867 a separate optimization pass.
5868
5869 @item -fbranch-target-load-optimize2
5870 @opindex fbranch-target-load-optimize2
5871 Perform branch target register load optimization after prologue / epilogue
5872 threading.
5873
5874 @item -fbtr-bb-exclusive
5875 @opindex fbtr-bb-exclusive
5876 When performing branch target register load optimization, don't reuse
5877 branch target registers in within any basic block.
5878
5879 @item -fstack-protector
5880 Emit extra code to check for buffer overflows, such as stack smashing
5881 attacks.  This is done by adding a guard variable to functions with
5882 vulnerable objects.  This includes functions that call alloca, and
5883 functions with buffers larger than 8 bytes.  The guards are initialized
5884 when a function is entered and then checked when the function exits.
5885 If a guard check fails, an error message is printed and the program exits.
5886
5887 @item -fstack-protector-all
5888 Like @option{-fstack-protector} except that all functions are protected.
5889
5890 @item -fsection-anchors
5891 @opindex fsection-anchors
5892 Try to reduce the number of symbolic address calculations by using
5893 shared ``anchor'' symbols to address nearby objects.  This transformation
5894 can help to reduce the number of GOT entries and GOT accesses on some
5895 targets.
5896
5897 For example, the implementation of the following function @code{foo}:
5898
5899 @smallexample
5900 static int a, b, c;
5901 int foo (void) @{ return a + b + c; @}
5902 @end smallexample
5903
5904 would usually calculate the addresses of all three variables, but if you
5905 compile it with @option{-fsection-anchors}, it will access the variables
5906 from a common anchor point instead.  The effect is similar to the
5907 following pseudocode (which isn't valid C):
5908
5909 @smallexample
5910 int foo (void)
5911 @{
5912   register int *xr = &x;
5913   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
5914 @}
5915 @end smallexample
5916
5917 Not all targets support this option.
5918
5919 @item --param @var{name}=@var{value}
5920 @opindex param
5921 In some places, GCC uses various constants to control the amount of
5922 optimization that is done.  For example, GCC will not inline functions
5923 that contain more that a certain number of instructions.  You can
5924 control some of these constants on the command-line using the
5925 @option{--param} option.
5926
5927 The names of specific parameters, and the meaning of the values, are
5928 tied to the internals of the compiler, and are subject to change
5929 without notice in future releases.
5930
5931 In each case, the @var{value} is an integer.  The allowable choices for
5932 @var{name} are given in the following table:
5933
5934 @table @gcctabopt
5935 @item salias-max-implicit-fields
5936 The maximum number of fields in a variable without direct
5937 structure accesses for which structure aliasing will consider trying 
5938 to track each field.  The default is 5
5939
5940 @item salias-max-array-elements
5941 The maximum number of elements an array can have and its elements
5942 still be tracked individually by structure aliasing. The default is 4
5943
5944 @item sra-max-structure-size
5945 The maximum structure size, in bytes, at which the scalar replacement
5946 of aggregates (SRA) optimization will perform block copies.  The
5947 default value, 0, implies that GCC will select the most appropriate
5948 size itself.
5949
5950 @item sra-field-structure-ratio
5951 The threshold ratio (as a percentage) between instantiated fields and
5952 the complete structure size.  We say that if the ratio of the number
5953 of bytes in instantiated fields to the number of bytes in the complete
5954 structure exceeds this parameter, then block copies are not used.  The
5955 default is 75.
5956
5957 @item max-crossjump-edges
5958 The maximum number of incoming edges to consider for crossjumping.
5959 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
5960 the number of edges incoming to each block.  Increasing values mean
5961 more aggressive optimization, making the compile time increase with
5962 probably small improvement in executable size.
5963
5964 @item min-crossjump-insns
5965 The minimum number of instructions which must be matched at the end
5966 of two blocks before crossjumping will be performed on them.  This
5967 value is ignored in the case where all instructions in the block being
5968 crossjumped from are matched.  The default value is 5.
5969
5970 @item max-grow-copy-bb-insns
5971 The maximum code size expansion factor when copying basic blocks
5972 instead of jumping.  The expansion is relative to a jump instruction.
5973 The default value is 8.
5974
5975 @item max-goto-duplication-insns
5976 The maximum number of instructions to duplicate to a block that jumps
5977 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
5978 passes, GCC factors computed gotos early in the compilation process,
5979 and unfactors them as late as possible.  Only computed jumps at the
5980 end of a basic blocks with no more than max-goto-duplication-insns are
5981 unfactored.  The default value is 8.
5982
5983 @item max-delay-slot-insn-search
5984 The maximum number of instructions to consider when looking for an
5985 instruction to fill a delay slot.  If more than this arbitrary number of
5986 instructions is searched, the time savings from filling the delay slot
5987 will be minimal so stop searching.  Increasing values mean more
5988 aggressive optimization, making the compile time increase with probably
5989 small improvement in executable run time.
5990
5991 @item max-delay-slot-live-search
5992 When trying to fill delay slots, the maximum number of instructions to
5993 consider when searching for a block with valid live register
5994 information.  Increasing this arbitrarily chosen value means more
5995 aggressive optimization, increasing the compile time.  This parameter
5996 should be removed when the delay slot code is rewritten to maintain the
5997 control-flow graph.
5998
5999 @item max-gcse-memory
6000 The approximate maximum amount of memory that will be allocated in
6001 order to perform the global common subexpression elimination
6002 optimization.  If more memory than specified is required, the
6003 optimization will not be done.
6004
6005 @item max-gcse-passes
6006 The maximum number of passes of GCSE to run.  The default is 1.
6007
6008 @item max-pending-list-length
6009 The maximum number of pending dependencies scheduling will allow
6010 before flushing the current state and starting over.  Large functions
6011 with few branches or calls can create excessively large lists which
6012 needlessly consume memory and resources.
6013
6014 @item max-inline-insns-single
6015 Several parameters control the tree inliner used in gcc.
6016 This number sets the maximum number of instructions (counted in GCC's
6017 internal representation) in a single function that the tree inliner
6018 will consider for inlining.  This only affects functions declared
6019 inline and methods implemented in a class declaration (C++).
6020 The default value is 450.
6021
6022 @item max-inline-insns-auto
6023 When you use @option{-finline-functions} (included in @option{-O3}),
6024 a lot of functions that would otherwise not be considered for inlining
6025 by the compiler will be investigated.  To those functions, a different
6026 (more restrictive) limit compared to functions declared inline can
6027 be applied.
6028 The default value is 90.
6029
6030 @item large-function-insns
6031 The limit specifying really large functions.  For functions larger than this
6032 limit after inlining inlining is constrained by
6033 @option{--param large-function-growth}.  This parameter is useful primarily
6034 to avoid extreme compilation time caused by non-linear algorithms used by the
6035 backend.
6036 This parameter is ignored when @option{-funit-at-a-time} is not used.
6037 The default value is 2700.
6038
6039 @item large-function-growth
6040 Specifies maximal growth of large function caused by inlining in percents.
6041 This parameter is ignored when @option{-funit-at-a-time} is not used.
6042 The default value is 100 which limits large function growth to 2.0 times
6043 the original size.
6044
6045 @item large-unit-insns
6046 The limit specifying large translation unit.  Growth caused by inlining of
6047 units larger than this limit is limited by @option{--param inline-unit-growth}.
6048 For small units this might be too tight (consider unit consisting of function A
6049 that is inline and B that just calls A three time.  If B is small relative to
6050 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
6051 large units consisting of small inlininable functions however the overall unit
6052 growth limit is needed to avoid exponential explosion of code size.  Thus for
6053 smaller units, the size is increased to @option{--param large-unit-insns}
6054 before applying @option{--param inline-unit-growth}.  The default is 10000
6055
6056 @item inline-unit-growth
6057 Specifies maximal overall growth of the compilation unit caused by inlining.
6058 This parameter is ignored when @option{-funit-at-a-time} is not used.
6059 The default value is 50 which limits unit growth to 1.5 times the original
6060 size.
6061
6062 @item large-stack-frame
6063 The limit specifying large stack frames.  While inlining the algorithm is trying
6064 to not grow past this limit too much.  Default value is 256 bytes.
6065
6066 @item large-stack-frame-growth
6067 Specifies maximal growth of large stack frames caused by inlining in percents.
6068 The default value is 1000 which limits large stack frame growth to 11 times
6069 the original size.
6070
6071 @item max-inline-insns-recursive
6072 @itemx max-inline-insns-recursive-auto
6073 Specifies maximum number of instructions out-of-line copy of self recursive inline
6074 function can grow into by performing recursive inlining.
6075
6076 For functions declared inline @option{--param max-inline-insns-recursive} is
6077 taken into account.  For function not declared inline, recursive inlining
6078 happens only when @option{-finline-functions} (included in @option{-O3}) is
6079 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
6080 default value is 450.
6081
6082 @item max-inline-recursive-depth
6083 @itemx max-inline-recursive-depth-auto
6084 Specifies maximum recursion depth used by the recursive inlining.
6085
6086 For functions declared inline @option{--param max-inline-recursive-depth} is
6087 taken into account.  For function not declared inline, recursive inlining
6088 happens only when @option{-finline-functions} (included in @option{-O3}) is
6089 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
6090 default value is 450.
6091
6092 @item min-inline-recursive-probability
6093 Recursive inlining is profitable only for function having deep recursion
6094 in average and can hurt for function having little recursion depth by
6095 increasing the prologue size or complexity of function body to other
6096 optimizers.
6097
6098 When profile feedback is available (see @option{-fprofile-generate}) the actual
6099 recursion depth can be guessed from probability that function will recurse via
6100 given call expression.  This parameter limits inlining only to call expression
6101 whose probability exceeds given threshold (in percents).  The default value is
6102 10.
6103
6104 @item inline-call-cost
6105 Specify cost of call instruction relative to simple arithmetics operations
6106 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
6107 functions and at the same time increases size of leaf function that is believed to
6108 reduce function size by being inlined.  In effect it increases amount of
6109 inlining for code having large abstraction penalty (many functions that just
6110 pass the arguments to other functions) and decrease inlining for code with low
6111 abstraction penalty.  The default value is 16.
6112
6113 @item max-unrolled-insns
6114 The maximum number of instructions that a loop should have if that loop
6115 is unrolled, and if the loop is unrolled, it determines how many times
6116 the loop code is unrolled.
6117
6118 @item max-average-unrolled-insns
6119 The maximum number of instructions biased by probabilities of their execution
6120 that a loop should have if that loop is unrolled, and if the loop is unrolled,
6121 it determines how many times the loop code is unrolled.
6122
6123 @item max-unroll-times
6124 The maximum number of unrollings of a single loop.
6125
6126 @item max-peeled-insns
6127 The maximum number of instructions that a loop should have if that loop
6128 is peeled, and if the loop is peeled, it determines how many times
6129 the loop code is peeled.
6130
6131 @item max-peel-times
6132 The maximum number of peelings of a single loop.
6133
6134 @item max-completely-peeled-insns
6135 The maximum number of insns of a completely peeled loop.
6136
6137 @item max-completely-peel-times
6138 The maximum number of iterations of a loop to be suitable for complete peeling.
6139
6140 @item max-unswitch-insns
6141 The maximum number of insns of an unswitched loop.
6142
6143 @item max-unswitch-level
6144 The maximum number of branches unswitched in a single loop.
6145
6146 @item lim-expensive
6147 The minimum cost of an expensive expression in the loop invariant motion.
6148
6149 @item iv-consider-all-candidates-bound
6150 Bound on number of candidates for induction variables below that
6151 all candidates are considered for each use in induction variable
6152 optimizations.  Only the most relevant candidates are considered
6153 if there are more candidates, to avoid quadratic time complexity.
6154
6155 @item iv-max-considered-uses
6156 The induction variable optimizations give up on loops that contain more
6157 induction variable uses.
6158
6159 @item iv-always-prune-cand-set-bound
6160 If number of candidates in the set is smaller than this value,
6161 we always try to remove unnecessary ivs from the set during its
6162 optimization when a new iv is added to the set.
6163
6164 @item scev-max-expr-size
6165 Bound on size of expressions used in the scalar evolutions analyzer.
6166 Large expressions slow the analyzer.
6167
6168 @item vect-max-version-checks
6169 The maximum number of runtime checks that can be performed when doing
6170 loop versioning in the vectorizer.  See option ftree-vect-loop-version
6171 for more information.
6172
6173 @item max-iterations-to-track
6174
6175 The maximum number of iterations of a loop the brute force algorithm
6176 for analysis of # of iterations of the loop tries to evaluate.
6177
6178 @item hot-bb-count-fraction
6179 Select fraction of the maximal count of repetitions of basic block in program
6180 given basic block needs to have to be considered hot.
6181
6182 @item hot-bb-frequency-fraction
6183 Select fraction of the maximal frequency of executions of basic block in
6184 function given basic block needs to have to be considered hot
6185
6186 @item max-predicted-iterations
6187 The maximum number of loop iterations we predict statically.  This is useful
6188 in cases where function contain single loop with known bound and other loop
6189 with unknown.  We predict the known number of iterations correctly, while
6190 the unknown number of iterations average to roughly 10.  This means that the
6191 loop without bounds would appear artificially cold relative to the other one.
6192
6193 @item tracer-dynamic-coverage
6194 @itemx tracer-dynamic-coverage-feedback
6195
6196 This value is used to limit superblock formation once the given percentage of
6197 executed instructions is covered.  This limits unnecessary code size
6198 expansion.
6199
6200 The @option{tracer-dynamic-coverage-feedback} is used only when profile
6201 feedback is available.  The real profiles (as opposed to statically estimated
6202 ones) are much less balanced allowing the threshold to be larger value.
6203
6204 @item tracer-max-code-growth
6205 Stop tail duplication once code growth has reached given percentage.  This is
6206 rather hokey argument, as most of the duplicates will be eliminated later in
6207 cross jumping, so it may be set to much higher values than is the desired code
6208 growth.
6209
6210 @item tracer-min-branch-ratio
6211
6212 Stop reverse growth when the reverse probability of best edge is less than this
6213 threshold (in percent).
6214
6215 @item tracer-min-branch-ratio
6216 @itemx tracer-min-branch-ratio-feedback
6217
6218 Stop forward growth if the best edge do have probability lower than this
6219 threshold.
6220
6221 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
6222 compilation for profile feedback and one for compilation without.  The value
6223 for compilation with profile feedback needs to be more conservative (higher) in
6224 order to make tracer effective.
6225
6226 @item max-cse-path-length
6227
6228 Maximum number of basic blocks on path that cse considers.  The default is 10.
6229
6230 @item max-cse-insns
6231 The maximum instructions CSE process before flushing. The default is 1000.
6232
6233 @item max-aliased-vops
6234
6235 Maximum number of virtual operands per statement allowed to represent
6236 aliases before triggering the alias grouping heuristic.  Alias
6237 grouping reduces compile times and memory consumption needed for
6238 aliasing at the expense of precision loss in alias information.
6239
6240 @item ggc-min-expand
6241
6242 GCC uses a garbage collector to manage its own memory allocation.  This
6243 parameter specifies the minimum percentage by which the garbage
6244 collector's heap should be allowed to expand between collections.
6245 Tuning this may improve compilation speed; it has no effect on code
6246 generation.
6247
6248 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
6249 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
6250 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
6251 GCC is not able to calculate RAM on a particular platform, the lower
6252 bound of 30% is used.  Setting this parameter and
6253 @option{ggc-min-heapsize} to zero causes a full collection to occur at
6254 every opportunity.  This is extremely slow, but can be useful for
6255 debugging.
6256
6257 @item ggc-min-heapsize
6258
6259 Minimum size of the garbage collector's heap before it begins bothering
6260 to collect garbage.  The first collection occurs after the heap expands
6261 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
6262 tuning this may improve compilation speed, and has no effect on code
6263 generation.
6264
6265 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
6266 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
6267 with a lower bound of 4096 (four megabytes) and an upper bound of
6268 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
6269 particular platform, the lower bound is used.  Setting this parameter
6270 very large effectively disables garbage collection.  Setting this
6271 parameter and @option{ggc-min-expand} to zero causes a full collection
6272 to occur at every opportunity.
6273
6274 @item max-reload-search-insns
6275 The maximum number of instruction reload should look backward for equivalent
6276 register.  Increasing values mean more aggressive optimization, making the
6277 compile time increase with probably slightly better performance.  The default
6278 value is 100.
6279
6280 @item max-cselib-memory-locations
6281 The maximum number of memory locations cselib should take into account.
6282 Increasing values mean more aggressive optimization, making the compile time
6283 increase with probably slightly better performance.  The default value is 500.
6284
6285 @item max-flow-memory-locations
6286 Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
6287 The default value is 100.
6288
6289 @item reorder-blocks-duplicate
6290 @itemx reorder-blocks-duplicate-feedback
6291
6292 Used by basic block reordering pass to decide whether to use unconditional
6293 branch or duplicate the code on its destination.  Code is duplicated when its
6294 estimated size is smaller than this value multiplied by the estimated size of
6295 unconditional jump in the hot spots of the program.
6296
6297 The @option{reorder-block-duplicate-feedback} is used only when profile
6298 feedback is available and may be set to higher values than
6299 @option{reorder-block-duplicate} since information about the hot spots is more
6300 accurate.
6301
6302 @item max-sched-ready-insns
6303 The maximum number of instructions ready to be issued the scheduler should
6304 consider at any given time during the first scheduling pass.  Increasing
6305 values mean more thorough searches, making the compilation time increase
6306 with probably little benefit.  The default value is 100.
6307
6308 @item max-sched-region-blocks
6309 The maximum number of blocks in a region to be considered for
6310 interblock scheduling.  The default value is 10.
6311
6312 @item max-sched-region-insns
6313 The maximum number of insns in a region to be considered for
6314 interblock scheduling.  The default value is 100.
6315
6316 @item min-spec-prob
6317 The minimum probability (in percents) of reaching a source block
6318 for interblock speculative scheduling.  The default value is 40.
6319
6320 @item max-sched-extend-regions-iters
6321 The maximum number of iterations through CFG to extend regions.
6322 0 - disable region extension,
6323 N - do at most N iterations.
6324 The default value is 0.
6325
6326 @item max-sched-insn-conflict-delay
6327 The maximum conflict delay for an insn to be considered for speculative motion.
6328 The default value is 3.
6329
6330 @item sched-spec-prob-cutoff
6331 The minimal probability of speculation success (in percents), so that
6332 speculative insn will be scheduled.
6333 The default value is 40.
6334
6335 @item max-last-value-rtl
6336
6337 The maximum size measured as number of RTLs that can be recorded in an expression
6338 in combiner for a pseudo register as last known value of that register.  The default
6339 is 10000.
6340
6341 @item integer-share-limit
6342 Small integer constants can use a shared data structure, reducing the
6343 compiler's memory usage and increasing its speed.  This sets the maximum
6344 value of a shared integer constant's.  The default value is 256.
6345
6346 @item min-virtual-mappings
6347 Specifies the minimum number of virtual mappings in the incremental
6348 SSA updater that should be registered to trigger the virtual mappings
6349 heuristic defined by virtual-mappings-ratio.  The default value is
6350 100.
6351
6352 @item virtual-mappings-ratio
6353 If the number of virtual mappings is virtual-mappings-ratio bigger
6354 than the number of virtual symbols to be updated, then the incremental
6355 SSA updater switches to a full update for those symbols.  The default
6356 ratio is 3.
6357
6358 @item ssp-buffer-size
6359 The minimum size of buffers (i.e. arrays) that will receive stack smashing
6360 protection when @option{-fstack-protection} is used.
6361
6362 @item max-jump-thread-duplication-stmts
6363 Maximum number of statements allowed in a block that needs to be
6364 duplicated when threading jumps.
6365
6366 @item max-fields-for-field-sensitive
6367 Maximum number of fields in a structure we will treat in
6368 a field sensitive manner during pointer analysis.
6369
6370 @item prefetch-latency
6371 Estimate on average number of instructions that are executed before
6372 prefetch finishes.  The distance we prefetch ahead is proportional
6373 to this constant.  Increasing this number may also lead to less
6374 streams being prefetched (see @option{simultaneous-prefetches}).
6375
6376 @item simultaneous-prefetches
6377 Maximum number of prefetches that can run at the same time.
6378
6379 @item l1-cache-line-size
6380 The size of cache line in L1 cache, in bytes.
6381
6382 @item l1-cache-size
6383 The number of cache lines in L1 cache.
6384
6385 @end table
6386 @end table
6387
6388 @node Preprocessor Options
6389 @section Options Controlling the Preprocessor
6390 @cindex preprocessor options
6391 @cindex options, preprocessor
6392
6393 These options control the C preprocessor, which is run on each C source
6394 file before actual compilation.
6395
6396 If you use the @option{-E} option, nothing is done except preprocessing.
6397 Some of these options make sense only together with @option{-E} because
6398 they cause the preprocessor output to be unsuitable for actual
6399 compilation.
6400
6401 @table @gcctabopt
6402 @opindex Wp
6403 You can use @option{-Wp,@var{option}} to bypass the compiler driver
6404 and pass @var{option} directly through to the preprocessor.  If
6405 @var{option} contains commas, it is split into multiple options at the
6406 commas.  However, many options are modified, translated or interpreted
6407 by the compiler driver before being passed to the preprocessor, and
6408 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
6409 interface is undocumented and subject to change, so whenever possible
6410 you should avoid using @option{-Wp} and let the driver handle the
6411 options instead.
6412
6413 @item -Xpreprocessor @var{option}
6414 @opindex preprocessor
6415 Pass @var{option} as an option to the preprocessor.  You can use this to
6416 supply system-specific preprocessor options which GCC does not know how to
6417 recognize.
6418
6419 If you want to pass an option that takes an argument, you must use
6420 @option{-Xpreprocessor} twice, once for the option and once for the argument.
6421 @end table
6422
6423 @include cppopts.texi
6424
6425 @node Assembler Options
6426 @section Passing Options to the Assembler
6427
6428 @c prevent bad page break with this line
6429 You can pass options to the assembler.
6430
6431 @table @gcctabopt
6432 @item -Wa,@var{option}
6433 @opindex Wa
6434 Pass @var{option} as an option to the assembler.  If @var{option}
6435 contains commas, it is split into multiple options at the commas.
6436
6437 @item -Xassembler @var{option}
6438 @opindex Xassembler
6439 Pass @var{option} as an option to the assembler.  You can use this to
6440 supply system-specific assembler options which GCC does not know how to
6441 recognize.
6442
6443 If you want to pass an option that takes an argument, you must use
6444 @option{-Xassembler} twice, once for the option and once for the argument.
6445
6446 @end table
6447
6448 @node Link Options
6449 @section Options for Linking
6450 @cindex link options
6451 @cindex options, linking
6452
6453 These options come into play when the compiler links object files into
6454 an executable output file.  They are meaningless if the compiler is
6455 not doing a link step.
6456
6457 @table @gcctabopt
6458 @cindex file names
6459 @item @var{object-file-name}
6460 A file name that does not end in a special recognized suffix is
6461 considered to name an object file or library.  (Object files are
6462 distinguished from libraries by the linker according to the file
6463 contents.)  If linking is done, these object files are used as input
6464 to the linker.
6465
6466 @item -c
6467 @itemx -S
6468 @itemx -E
6469 @opindex c
6470 @opindex S
6471 @opindex E
6472 If any of these options is used, then the linker is not run, and
6473 object file names should not be used as arguments.  @xref{Overall
6474 Options}.
6475
6476 @cindex Libraries
6477 @item -l@var{library}
6478 @itemx -l @var{library}
6479 @opindex l
6480 Search the library named @var{library} when linking.  (The second
6481 alternative with the library as a separate argument is only for
6482 POSIX compliance and is not recommended.)
6483
6484 It makes a difference where in the command you write this option; the
6485 linker searches and processes libraries and object files in the order they
6486 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
6487 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
6488 to functions in @samp{z}, those functions may not be loaded.
6489
6490 The linker searches a standard list of directories for the library,
6491 which is actually a file named @file{lib@var{library}.a}.  The linker
6492 then uses this file as if it had been specified precisely by name.
6493
6494 The directories searched include several standard system directories
6495 plus any that you specify with @option{-L}.
6496
6497 Normally the files found this way are library files---archive files
6498 whose members are object files.  The linker handles an archive file by
6499 scanning through it for members which define symbols that have so far
6500 been referenced but not defined.  But if the file that is found is an
6501 ordinary object file, it is linked in the usual fashion.  The only
6502 difference between using an @option{-l} option and specifying a file name
6503 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
6504 and searches several directories.
6505
6506 @item -lobjc
6507 @opindex lobjc
6508 You need this special case of the @option{-l} option in order to
6509 link an Objective-C or Objective-C++ program.
6510
6511 @item -nostartfiles
6512 @opindex nostartfiles
6513 Do not use the standard system startup files when linking.
6514 The standard system libraries are used normally, unless @option{-nostdlib}
6515 or @option{-nodefaultlibs} is used.
6516
6517 @item -nodefaultlibs
6518 @opindex nodefaultlibs
6519 Do not use the standard system libraries when linking.
6520 Only the libraries you specify will be passed to the linker.
6521 The standard startup files are used normally, unless @option{-nostartfiles}
6522 is used.  The compiler may generate calls to @code{memcmp},
6523 @code{memset}, @code{memcpy} and @code{memmove}.
6524 These entries are usually resolved by entries in
6525 libc.  These entry points should be supplied through some other
6526 mechanism when this option is specified.
6527
6528 @item -nostdlib
6529 @opindex nostdlib
6530 Do not use the standard system startup files or libraries when linking.
6531 No startup files and only the libraries you specify will be passed to
6532 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
6533 @code{memcpy} and @code{memmove}.
6534 These entries are usually resolved by entries in
6535 libc.  These entry points should be supplied through some other
6536 mechanism when this option is specified.
6537
6538 @cindex @option{-lgcc}, use with @option{-nostdlib}
6539 @cindex @option{-nostdlib} and unresolved references
6540 @cindex unresolved references and @option{-nostdlib}
6541 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
6542 @cindex @option{-nodefaultlibs} and unresolved references
6543 @cindex unresolved references and @option{-nodefaultlibs}
6544 One of the standard libraries bypassed by @option{-nostdlib} and
6545 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
6546 that GCC uses to overcome shortcomings of particular machines, or special
6547 needs for some languages.
6548 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
6549 Collection (GCC) Internals},
6550 for more discussion of @file{libgcc.a}.)
6551 In most cases, you need @file{libgcc.a} even when you want to avoid
6552 other standard libraries.  In other words, when you specify @option{-nostdlib}
6553 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
6554 This ensures that you have no unresolved references to internal GCC
6555 library subroutines.  (For example, @samp{__main}, used to ensure C++
6556 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
6557 GNU Compiler Collection (GCC) Internals}.)
6558
6559 @item -pie
6560 @opindex pie
6561 Produce a position independent executable on targets which support it.
6562 For predictable results, you must also specify the same set of options
6563 that were used to generate code (@option{-fpie}, @option{-fPIE},
6564 or model suboptions) when you specify this option.
6565
6566 @item -rdynamic
6567 @opindex rdynamic
6568 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
6569 that support it. This instructs the linker to add all symbols, not
6570 only used ones, to the dynamic symbol table. This option is needed
6571 for some uses of @code{dlopen} or to allow obtaining backtraces
6572 from within a program.
6573
6574 @item -s
6575 @opindex s
6576 Remove all symbol table and relocation information from the executable.
6577
6578 @item -static
6579 @opindex static
6580 On systems that support dynamic linking, this prevents linking with the shared
6581 libraries.  On other systems, this option has no effect.
6582
6583 @item -shared
6584 @opindex shared
6585 Produce a shared object which can then be linked with other objects to
6586 form an executable.  Not all systems support this option.  For predictable
6587 results, you must also specify the same set of options that were used to
6588 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
6589 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
6590 needs to build supplementary stub code for constructors to work.  On
6591 multi-libbed systems, @samp{gcc -shared} must select the correct support
6592 libraries to link against.  Failing to supply the correct flags may lead
6593 to subtle defects.  Supplying them in cases where they are not necessary
6594 is innocuous.}
6595
6596 @item -shared-libgcc
6597 @itemx -static-libgcc
6598 @opindex shared-libgcc
6599 @opindex static-libgcc
6600 On systems that provide @file{libgcc} as a shared library, these options
6601 force the use of either the shared or static version respectively.
6602 If no shared version of @file{libgcc} was built when the compiler was
6603 configured, these options have no effect.
6604
6605 There are several situations in which an application should use the
6606 shared @file{libgcc} instead of the static version.  The most common
6607 of these is when the application wishes to throw and catch exceptions
6608 across different shared libraries.  In that case, each of the libraries
6609 as well as the application itself should use the shared @file{libgcc}.
6610
6611 Therefore, the G++ and GCJ drivers automatically add
6612 @option{-shared-libgcc} whenever you build a shared library or a main
6613 executable, because C++ and Java programs typically use exceptions, so
6614 this is the right thing to do.
6615
6616 If, instead, you use the GCC driver to create shared libraries, you may
6617 find that they will not always be linked with the shared @file{libgcc}.
6618 If GCC finds, at its configuration time, that you have a non-GNU linker
6619 or a GNU linker that does not support option @option{--eh-frame-hdr},
6620 it will link the shared version of @file{libgcc} into shared libraries
6621 by default.  Otherwise, it will take advantage of the linker and optimize
6622 away the linking with the shared version of @file{libgcc}, linking with
6623 the static version of libgcc by default.  This allows exceptions to
6624 propagate through such shared libraries, without incurring relocation
6625 costs at library load time.
6626
6627 However, if a library or main executable is supposed to throw or catch
6628 exceptions, you must link it using the G++ or GCJ driver, as appropriate
6629 for the languages used in the program, or using the option
6630 @option{-shared-libgcc}, such that it is linked with the shared
6631 @file{libgcc}.
6632
6633 @item -symbolic
6634 @opindex symbolic
6635 Bind references to global symbols when building a shared object.  Warn
6636 about any unresolved references (unless overridden by the link editor
6637 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
6638 this option.
6639
6640 @item -Xlinker @var{option}
6641 @opindex Xlinker
6642 Pass @var{option} as an option to the linker.  You can use this to
6643 supply system-specific linker options which GCC does not know how to
6644 recognize.
6645
6646 If you want to pass an option that takes an argument, you must use
6647 @option{-Xlinker} twice, once for the option and once for the argument.
6648 For example, to pass @option{-assert definitions}, you must write
6649 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
6650 @option{-Xlinker "-assert definitions"}, because this passes the entire
6651 string as a single argument, which is not what the linker expects.
6652
6653 @item -Wl,@var{option}
6654 @opindex Wl
6655 Pass @var{option} as an option to the linker.  If @var{option} contains
6656 commas, it is split into multiple options at the commas.
6657
6658 @item -u @var{symbol}
6659 @opindex u
6660 Pretend the symbol @var{symbol} is undefined, to force linking of
6661 library modules to define it.  You can use @option{-u} multiple times with
6662 different symbols to force loading of additional library modules.
6663 @end table
6664
6665 @node Directory Options
6666 @section Options for Directory Search
6667 @cindex directory options
6668 @cindex options, directory search
6669 @cindex search path
6670
6671 These options specify directories to search for header files, for
6672 libraries and for parts of the compiler:
6673
6674 @table @gcctabopt
6675 @item -I@var{dir}
6676 @opindex I
6677 Add the directory @var{dir} to the head of the list of directories to be
6678 searched for header files.  This can be used to override a system header
6679 file, substituting your own version, since these directories are
6680 searched before the system header file directories.  However, you should
6681 not use this option to add directories that contain vendor-supplied
6682 system header files (use @option{-isystem} for that).  If you use more than
6683 one @option{-I} option, the directories are scanned in left-to-right
6684 order; the standard system directories come after.
6685
6686 If a standard system include directory, or a directory specified with
6687 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
6688 option will be ignored.  The directory will still be searched but as a
6689 system directory at its normal position in the system include chain.
6690 This is to ensure that GCC's procedure to fix buggy system headers and
6691 the ordering for the include_next directive are not inadvertently changed.
6692 If you really need to change the search order for system directories,
6693 use the @option{-nostdinc} and/or @option{-isystem} options.
6694
6695 @item -iquote@var{dir}
6696 @opindex iquote
6697 Add the directory @var{dir} to the head of the list of directories to
6698 be searched for header files only for the case of @samp{#include
6699 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
6700 otherwise just like @option{-I}.
6701
6702 @item -L@var{dir}
6703 @opindex L
6704 Add directory @var{dir} to the list of directories to be searched
6705 for @option{-l}.
6706
6707 @item -B@var{prefix}
6708 @opindex B
6709 This option specifies where to find the executables, libraries,
6710 include files, and data files of the compiler itself.
6711
6712 The compiler driver program runs one or more of the subprograms
6713 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
6714 @var{prefix} as a prefix for each program it tries to run, both with and
6715 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
6716
6717 For each subprogram to be run, the compiler driver first tries the
6718 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
6719 was not specified, the driver tries two standard prefixes, which are
6720 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
6721 those results in a file name that is found, the unmodified program
6722 name is searched for using the directories specified in your
6723 @env{PATH} environment variable.
6724
6725 The compiler will check to see if the path provided by the @option{-B}
6726 refers to a directory, and if necessary it will add a directory
6727 separator character at the end of the path.
6728
6729 @option{-B} prefixes that effectively specify directory names also apply
6730 to libraries in the linker, because the compiler translates these
6731 options into @option{-L} options for the linker.  They also apply to
6732 includes files in the preprocessor, because the compiler translates these
6733 options into @option{-isystem} options for the preprocessor.  In this case,
6734 the compiler appends @samp{include} to the prefix.
6735
6736 The run-time support file @file{libgcc.a} can also be searched for using
6737 the @option{-B} prefix, if needed.  If it is not found there, the two
6738 standard prefixes above are tried, and that is all.  The file is left
6739 out of the link if it is not found by those means.
6740
6741 Another way to specify a prefix much like the @option{-B} prefix is to use
6742 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
6743 Variables}.
6744
6745 As a special kludge, if the path provided by @option{-B} is
6746 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
6747 9, then it will be replaced by @file{[dir/]include}.  This is to help
6748 with boot-strapping the compiler.
6749
6750 @item -specs=@var{file}
6751 @opindex specs
6752 Process @var{file} after the compiler reads in the standard @file{specs}
6753 file, in order to override the defaults that the @file{gcc} driver
6754 program uses when determining what switches to pass to @file{cc1},
6755 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
6756 @option{-specs=@var{file}} can be specified on the command line, and they
6757 are processed in order, from left to right.
6758
6759 @item --sysroot=@var{dir}
6760 @opindex sysroot
6761 Use @var{dir} as the logical root directory for headers and libraries.
6762 For example, if the compiler would normally search for headers in
6763 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
6764 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.  
6765
6766 If you use both this option and the @option{-isysroot} option, then
6767 the @option{--sysroot} option will apply to libraries, but the
6768 @option{-isysroot} option will apply to header files.
6769
6770 The GNU linker (beginning with version 2.16) has the necessary support
6771 for this option.  If your linker does not support this option, the
6772 header file aspect of @option{--sysroot} will still work, but the
6773 library aspect will not.
6774
6775 @item -I-
6776 @opindex I-
6777 This option has been deprecated.  Please use @option{-iquote} instead for
6778 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
6779 Any directories you specify with @option{-I} options before the @option{-I-}
6780 option are searched only for the case of @samp{#include "@var{file}"};
6781 they are not searched for @samp{#include <@var{file}>}.
6782
6783 If additional directories are specified with @option{-I} options after
6784 the @option{-I-}, these directories are searched for all @samp{#include}
6785 directives.  (Ordinarily @emph{all} @option{-I} directories are used
6786 this way.)
6787
6788 In addition, the @option{-I-} option inhibits the use of the current
6789 directory (where the current input file came from) as the first search
6790 directory for @samp{#include "@var{file}"}.  There is no way to
6791 override this effect of @option{-I-}.  With @option{-I.} you can specify
6792 searching the directory which was current when the compiler was
6793 invoked.  That is not exactly the same as what the preprocessor does
6794 by default, but it is often satisfactory.
6795
6796 @option{-I-} does not inhibit the use of the standard system directories
6797 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
6798 independent.
6799 @end table
6800
6801 @c man end
6802
6803 @node Spec Files
6804 @section Specifying subprocesses and the switches to pass to them
6805 @cindex Spec Files
6806
6807 @command{gcc} is a driver program.  It performs its job by invoking a
6808 sequence of other programs to do the work of compiling, assembling and
6809 linking.  GCC interprets its command-line parameters and uses these to
6810 deduce which programs it should invoke, and which command-line options
6811 it ought to place on their command lines.  This behavior is controlled
6812 by @dfn{spec strings}.  In most cases there is one spec string for each
6813 program that GCC can invoke, but a few programs have multiple spec
6814 strings to control their behavior.  The spec strings built into GCC can
6815 be overridden by using the @option{-specs=} command-line switch to specify
6816 a spec file.
6817
6818 @dfn{Spec files} are plaintext files that are used to construct spec
6819 strings.  They consist of a sequence of directives separated by blank
6820 lines.  The type of directive is determined by the first non-whitespace
6821 character on the line and it can be one of the following:
6822
6823 @table @code
6824 @item %@var{command}
6825 Issues a @var{command} to the spec file processor.  The commands that can
6826 appear here are:
6827
6828 @table @code
6829 @item %include <@var{file}>
6830 @cindex %include
6831 Search for @var{file} and insert its text at the current point in the
6832 specs file.
6833
6834 @item %include_noerr <@var{file}>
6835 @cindex %include_noerr
6836 Just like @samp{%include}, but do not generate an error message if the include
6837 file cannot be found.
6838
6839 @item %rename @var{old_name} @var{new_name}
6840 @cindex %rename
6841 Rename the spec string @var{old_name} to @var{new_name}.
6842
6843 @end table
6844
6845 @item *[@var{spec_name}]:
6846 This tells the compiler to create, override or delete the named spec
6847 string.  All lines after this directive up to the next directive or
6848 blank line are considered to be the text for the spec string.  If this
6849 results in an empty string then the spec will be deleted.  (Or, if the
6850 spec did not exist, then nothing will happened.)  Otherwise, if the spec
6851 does not currently exist a new spec will be created.  If the spec does
6852 exist then its contents will be overridden by the text of this
6853 directive, unless the first character of that text is the @samp{+}
6854 character, in which case the text will be appended to the spec.
6855
6856 @item [@var{suffix}]:
6857 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
6858 and up to the next directive or blank line are considered to make up the
6859 spec string for the indicated suffix.  When the compiler encounters an
6860 input file with the named suffix, it will processes the spec string in
6861 order to work out how to compile that file.  For example:
6862
6863 @smallexample
6864 .ZZ:
6865 z-compile -input %i
6866 @end smallexample
6867
6868 This says that any input file whose name ends in @samp{.ZZ} should be
6869 passed to the program @samp{z-compile}, which should be invoked with the
6870 command-line switch @option{-input} and with the result of performing the
6871 @samp{%i} substitution.  (See below.)
6872
6873 As an alternative to providing a spec string, the text that follows a
6874 suffix directive can be one of the following:
6875
6876 @table @code
6877 @item @@@var{language}
6878 This says that the suffix is an alias for a known @var{language}.  This is
6879 similar to using the @option{-x} command-line switch to GCC to specify a
6880 language explicitly.  For example:
6881
6882 @smallexample
6883 .ZZ:
6884 @@c++
6885 @end smallexample
6886
6887 Says that .ZZ files are, in fact, C++ source files.
6888
6889 @item #@var{name}
6890 This causes an error messages saying:
6891
6892 @smallexample
6893 @var{name} compiler not installed on this system.
6894 @end smallexample
6895 @end table
6896
6897 GCC already has an extensive list of suffixes built into it.
6898 This directive will add an entry to the end of the list of suffixes, but
6899 since the list is searched from the end backwards, it is effectively
6900 possible to override earlier entries using this technique.
6901
6902 @end table
6903
6904 GCC has the following spec strings built into it.  Spec files can
6905 override these strings or create their own.  Note that individual
6906 targets can also add their own spec strings to this list.
6907
6908 @smallexample
6909 asm          Options to pass to the assembler
6910 asm_final    Options to pass to the assembler post-processor
6911 cpp          Options to pass to the C preprocessor
6912 cc1          Options to pass to the C compiler
6913 cc1plus      Options to pass to the C++ compiler
6914 endfile      Object files to include at the end of the link
6915 link         Options to pass to the linker
6916 lib          Libraries to include on the command line to the linker
6917 libgcc       Decides which GCC support library to pass to the linker
6918 linker       Sets the name of the linker
6919 predefines   Defines to be passed to the C preprocessor
6920 signed_char  Defines to pass to CPP to say whether @code{char} is signed
6921              by default
6922 startfile    Object files to include at the start of the link
6923 @end smallexample
6924
6925 Here is a small example of a spec file:
6926
6927 @smallexample
6928 %rename lib                 old_lib
6929
6930 *lib:
6931 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
6932 @end smallexample
6933
6934 This example renames the spec called @samp{lib} to @samp{old_lib} and
6935 then overrides the previous definition of @samp{lib} with a new one.
6936 The new definition adds in some extra command-line options before
6937 including the text of the old definition.
6938
6939 @dfn{Spec strings} are a list of command-line options to be passed to their
6940 corresponding program.  In addition, the spec strings can contain
6941 @samp{%}-prefixed sequences to substitute variable text or to
6942 conditionally insert text into the command line.  Using these constructs
6943 it is possible to generate quite complex command lines.
6944
6945 Here is a table of all defined @samp{%}-sequences for spec
6946 strings.  Note that spaces are not generated automatically around the
6947 results of expanding these sequences.  Therefore you can concatenate them
6948 together or combine them with constant text in a single argument.
6949
6950 @table @code
6951 @item %%
6952 Substitute one @samp{%} into the program name or argument.
6953
6954 @item %i
6955 Substitute the name of the input file being processed.
6956
6957 @item %b
6958 Substitute the basename of the input file being processed.
6959 This is the substring up to (and not including) the last period
6960 and not including the directory.
6961
6962 @item %B
6963 This is the same as @samp{%b}, but include the file suffix (text after
6964 the last period).
6965
6966 @item %d
6967 Marks the argument containing or following the @samp{%d} as a
6968 temporary file name, so that that file will be deleted if GCC exits
6969 successfully.  Unlike @samp{%g}, this contributes no text to the
6970 argument.
6971
6972 @item %g@var{suffix}
6973 Substitute a file name that has suffix @var{suffix} and is chosen
6974 once per compilation, and mark the argument in the same way as
6975 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
6976 name is now chosen in a way that is hard to predict even when previously
6977 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
6978 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
6979 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
6980 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
6981 was simply substituted with a file name chosen once per compilation,
6982 without regard to any appended suffix (which was therefore treated
6983 just like ordinary text), making such attacks more likely to succeed.
6984
6985 @item %u@var{suffix}
6986 Like @samp{%g}, but generates a new temporary file name even if
6987 @samp{%u@var{suffix}} was already seen.
6988
6989 @item %U@var{suffix}
6990 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
6991 new one if there is no such last file name.  In the absence of any
6992 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
6993 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
6994 would involve the generation of two distinct file names, one
6995 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
6996 simply substituted with a file name chosen for the previous @samp{%u},
6997 without regard to any appended suffix.
6998
6999 @item %j@var{suffix}
7000 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
7001 writable, and if save-temps is off; otherwise, substitute the name
7002 of a temporary file, just like @samp{%u}.  This temporary file is not
7003 meant for communication between processes, but rather as a junk
7004 disposal mechanism.
7005
7006 @item %|@var{suffix}
7007 @itemx %m@var{suffix}
7008 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
7009 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
7010 all.  These are the two most common ways to instruct a program that it
7011 should read from standard input or write to standard output.  If you
7012 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
7013 construct: see for example @file{f/lang-specs.h}.
7014
7015 @item %.@var{SUFFIX}
7016 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
7017 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
7018 terminated by the next space or %.
7019
7020 @item %w
7021 Marks the argument containing or following the @samp{%w} as the
7022 designated output file of this compilation.  This puts the argument
7023 into the sequence of arguments that @samp{%o} will substitute later.
7024
7025 @item %o
7026 Substitutes the names of all the output files, with spaces
7027 automatically placed around them.  You should write spaces
7028 around the @samp{%o} as well or the results are undefined.
7029 @samp{%o} is for use in the specs for running the linker.
7030 Input files whose names have no recognized suffix are not compiled
7031 at all, but they are included among the output files, so they will
7032 be linked.
7033
7034 @item %O
7035 Substitutes the suffix for object files.  Note that this is
7036 handled specially when it immediately follows @samp{%g, %u, or %U},
7037 because of the need for those to form complete file names.  The
7038 handling is such that @samp{%O} is treated exactly as if it had already
7039 been substituted, except that @samp{%g, %u, and %U} do not currently
7040 support additional @var{suffix} characters following @samp{%O} as they would
7041 following, for example, @samp{.o}.
7042
7043 @item %p
7044 Substitutes the standard macro predefinitions for the
7045 current target machine.  Use this when running @code{cpp}.
7046
7047 @item %P
7048 Like @samp{%p}, but puts @samp{__} before and after the name of each
7049 predefined macro, except for macros that start with @samp{__} or with
7050 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
7051 C@.
7052
7053 @item %I
7054 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
7055 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
7056 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
7057 and @option{-imultilib} as necessary.
7058
7059 @item %s
7060 Current argument is the name of a library or startup file of some sort.
7061 Search for that file in a standard list of directories and substitute
7062 the full name found.
7063
7064 @item %e@var{str}
7065 Print @var{str} as an error message.  @var{str} is terminated by a newline.
7066 Use this when inconsistent options are detected.
7067
7068 @item %(@var{name})
7069 Substitute the contents of spec string @var{name} at this point.
7070
7071 @item %[@var{name}]
7072 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
7073
7074 @item %x@{@var{option}@}
7075 Accumulate an option for @samp{%X}.
7076
7077 @item %X
7078 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
7079 spec string.
7080
7081 @item %Y
7082 Output the accumulated assembler options specified by @option{-Wa}.
7083
7084 @item %Z
7085 Output the accumulated preprocessor options specified by @option{-Wp}.
7086
7087 @item %a
7088 Process the @code{asm} spec.  This is used to compute the
7089 switches to be passed to the assembler.
7090
7091 @item %A
7092 Process the @code{asm_final} spec.  This is a spec string for
7093 passing switches to an assembler post-processor, if such a program is
7094 needed.
7095
7096 @item %l
7097 Process the @code{link} spec.  This is the spec for computing the
7098 command line passed to the linker.  Typically it will make use of the
7099 @samp{%L %G %S %D and %E} sequences.
7100
7101 @item %D
7102 Dump out a @option{-L} option for each directory that GCC believes might
7103 contain startup files.  If the target supports multilibs then the
7104 current multilib directory will be prepended to each of these paths.
7105
7106 @item %L
7107 Process the @code{lib} spec.  This is a spec string for deciding which
7108 libraries should be included on the command line to the linker.
7109
7110 @item %G
7111 Process the @code{libgcc} spec.  This is a spec string for deciding
7112 which GCC support library should be included on the command line to the linker.
7113
7114 @item %S
7115 Process the @code{startfile} spec.  This is a spec for deciding which
7116 object files should be the first ones passed to the linker.  Typically
7117 this might be a file named @file{crt0.o}.
7118
7119 @item %E
7120 Process the @code{endfile} spec.  This is a spec string that specifies
7121 the last object files that will be passed to the linker.
7122
7123 @item %C
7124 Process the @code{cpp} spec.  This is used to construct the arguments
7125 to be passed to the C preprocessor.
7126
7127 @item %1
7128 Process the @code{cc1} spec.  This is used to construct the options to be
7129 passed to the actual C compiler (@samp{cc1}).
7130
7131 @item %2
7132 Process the @code{cc1plus} spec.  This is used to construct the options to be
7133 passed to the actual C++ compiler (@samp{cc1plus}).
7134
7135 @item %*
7136 Substitute the variable part of a matched option.  See below.
7137 Note that each comma in the substituted string is replaced by
7138 a single space.
7139
7140 @item %<@code{S}
7141 Remove all occurrences of @code{-S} from the command line.  Note---this
7142 command is position dependent.  @samp{%} commands in the spec string
7143 before this one will see @code{-S}, @samp{%} commands in the spec string
7144 after this one will not.
7145
7146 @item %:@var{function}(@var{args})
7147 Call the named function @var{function}, passing it @var{args}.
7148 @var{args} is first processed as a nested spec string, then split
7149 into an argument vector in the usual fashion.  The function returns
7150 a string which is processed as if it had appeared literally as part
7151 of the current spec.
7152
7153 The following built-in spec functions are provided:
7154
7155 @table @code
7156 @item @code{if-exists}
7157 The @code{if-exists} spec function takes one argument, an absolute
7158 pathname to a file.  If the file exists, @code{if-exists} returns the
7159 pathname.  Here is a small example of its usage:
7160
7161 @smallexample
7162 *startfile:
7163 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
7164 @end smallexample
7165
7166 @item @code{if-exists-else}
7167 The @code{if-exists-else} spec function is similar to the @code{if-exists}
7168 spec function, except that it takes two arguments.  The first argument is
7169 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
7170 returns the pathname.  If it does not exist, it returns the second argument.
7171 This way, @code{if-exists-else} can be used to select one file or another,
7172 based on the existence of the first.  Here is a small example of its usage:
7173
7174 @smallexample
7175 *startfile:
7176 crt0%O%s %:if-exists(crti%O%s) \
7177 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
7178 @end smallexample
7179
7180 @item @code{replace-outfile}
7181 The @code{replace-outfile} spec function takes two arguments.  It looks for the
7182 first argument in the outfiles array and replaces it with the second argument.  Here
7183 is a small example of its usage:
7184
7185 @smallexample
7186 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
7187 @end smallexample
7188
7189 @end table
7190
7191 @item %@{@code{S}@}
7192 Substitutes the @code{-S} switch, if that switch was given to GCC@.
7193 If that switch was not specified, this substitutes nothing.  Note that
7194 the leading dash is omitted when specifying this option, and it is
7195 automatically inserted if the substitution is performed.  Thus the spec
7196 string @samp{%@{foo@}} would match the command-line option @option{-foo}
7197 and would output the command line option @option{-foo}.
7198
7199 @item %W@{@code{S}@}
7200 Like %@{@code{S}@} but mark last argument supplied within as a file to be
7201 deleted on failure.
7202
7203 @item %@{@code{S}*@}
7204 Substitutes all the switches specified to GCC whose names start
7205 with @code{-S}, but which also take an argument.  This is used for
7206 switches like @option{-o}, @option{-D}, @option{-I}, etc.
7207 GCC considers @option{-o foo} as being
7208 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
7209 text, including the space.  Thus two arguments would be generated.
7210
7211 @item %@{@code{S}*&@code{T}*@}
7212 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
7213 (the order of @code{S} and @code{T} in the spec is not significant).
7214 There can be any number of ampersand-separated variables; for each the
7215 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
7216
7217 @item %@{@code{S}:@code{X}@}
7218 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
7219
7220 @item %@{!@code{S}:@code{X}@}
7221 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
7222
7223 @item %@{@code{S}*:@code{X}@}
7224 Substitutes @code{X} if one or more switches whose names start with
7225 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
7226 once, no matter how many such switches appeared.  However, if @code{%*}
7227 appears somewhere in @code{X}, then @code{X} will be substituted once
7228 for each matching switch, with the @code{%*} replaced by the part of
7229 that switch that matched the @code{*}.
7230
7231 @item %@{.@code{S}:@code{X}@}
7232 Substitutes @code{X}, if processing a file with suffix @code{S}.
7233
7234 @item %@{!.@code{S}:@code{X}@}
7235 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
7236
7237 @item %@{@code{S}|@code{P}:@code{X}@}
7238 Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@.
7239 This may be combined with @samp{!}, @samp{.}, and @code{*} sequences as well,
7240 although they have a stronger binding than the @samp{|}.  If @code{%*}
7241 appears in @code{X}, all of the alternatives must be starred, and only
7242 the first matching alternative is substituted.
7243
7244 For example, a spec string like this:
7245
7246 @smallexample
7247 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
7248 @end smallexample
7249
7250 will output the following command-line options from the following input
7251 command-line options:
7252
7253 @smallexample
7254 fred.c        -foo -baz
7255 jim.d         -bar -boggle
7256 -d fred.c     -foo -baz -boggle
7257 -d jim.d      -bar -baz -boggle
7258 @end smallexample
7259
7260 @item %@{S:X; T:Y; :D@}
7261
7262 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
7263 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
7264 be as many clauses as you need.  This may be combined with @code{.},
7265 @code{!}, @code{|}, and @code{*} as needed.
7266
7267
7268 @end table
7269
7270 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
7271 construct may contain other nested @samp{%} constructs or spaces, or
7272 even newlines.  They are processed as usual, as described above.
7273 Trailing white space in @code{X} is ignored.  White space may also
7274 appear anywhere on the left side of the colon in these constructs,
7275 except between @code{.} or @code{*} and the corresponding word.
7276
7277 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
7278 handled specifically in these constructs.  If another value of
7279 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
7280 @option{-W} switch is found later in the command line, the earlier
7281 switch value is ignored, except with @{@code{S}*@} where @code{S} is
7282 just one letter, which passes all matching options.
7283
7284 The character @samp{|} at the beginning of the predicate text is used to
7285 indicate that a command should be piped to the following command, but
7286 only if @option{-pipe} is specified.
7287
7288 It is built into GCC which switches take arguments and which do not.
7289 (You might think it would be useful to generalize this to allow each
7290 compiler's spec to say which switches take arguments.  But this cannot
7291 be done in a consistent fashion.  GCC cannot even decide which input
7292 files have been specified without knowing which switches take arguments,
7293 and it must know which input files to compile in order to tell which
7294 compilers to run).
7295
7296 GCC also knows implicitly that arguments starting in @option{-l} are to be
7297 treated as compiler output files, and passed to the linker in their
7298 proper position among the other output files.
7299
7300 @c man begin OPTIONS
7301
7302 @node Target Options
7303 @section Specifying Target Machine and Compiler Version
7304 @cindex target options
7305 @cindex cross compiling
7306 @cindex specifying machine version
7307 @cindex specifying compiler version and target machine
7308 @cindex compiler version, specifying
7309 @cindex target machine, specifying
7310
7311 The usual way to run GCC is to run the executable called @file{gcc}, or
7312 @file{<machine>-gcc} when cross-compiling, or
7313 @file{<machine>-gcc-<version>} to run a version other than the one that
7314 was installed last.  Sometimes this is inconvenient, so GCC provides
7315 options that will switch to another cross-compiler or version.
7316
7317 @table @gcctabopt
7318 @item -b @var{machine}
7319 @opindex b
7320 The argument @var{machine} specifies the target machine for compilation.
7321
7322 The value to use for @var{machine} is the same as was specified as the
7323 machine type when configuring GCC as a cross-compiler.  For
7324 example, if a cross-compiler was configured with @samp{configure
7325 arm-elf}, meaning to compile for an arm processor with elf binaries,
7326 then you would specify @option{-b arm-elf} to run that cross compiler.
7327 Because there are other options beginning with @option{-b}, the
7328 configuration must contain a hyphen. 
7329
7330 @item -V @var{version}
7331 @opindex V
7332 The argument @var{version} specifies which version of GCC to run.
7333 This is useful when multiple versions are installed.  For example,
7334 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
7335 @end table
7336
7337 The @option{-V} and @option{-b} options work by running the
7338 @file{<machine>-gcc-<version>} executable, so there's no real reason to
7339 use them if you can just run that directly.
7340
7341 @node Submodel Options
7342 @section Hardware Models and Configurations
7343 @cindex submodel options
7344 @cindex specifying hardware config
7345 @cindex hardware models and configurations, specifying
7346 @cindex machine dependent options
7347
7348 Earlier we discussed the standard option @option{-b} which chooses among
7349 different installed compilers for completely different target
7350 machines, such as VAX vs.@: 68000 vs.@: 80386.
7351
7352 In addition, each of these target machine types can have its own
7353 special options, starting with @samp{-m}, to choose among various
7354 hardware models or configurations---for example, 68010 vs 68020,
7355 floating coprocessor or none.  A single installed version of the
7356 compiler can compile for any model or configuration, according to the
7357 options specified.
7358
7359 Some configurations of the compiler also support additional special
7360 options, usually for compatibility with other compilers on the same
7361 platform.
7362
7363 @c This list is ordered alphanumerically by subsection name.
7364 @c It should be the same order and spelling as these options are listed
7365 @c in Machine Dependent Options
7366
7367 @menu
7368 * ARC Options::
7369 * ARM Options::
7370 * AVR Options::
7371 * Blackfin Options::
7372 * CRIS Options::
7373 * CRX Options::
7374 * Darwin Options::
7375 * DEC Alpha Options::
7376 * DEC Alpha/VMS Options::
7377 * FRV Options::
7378 * GNU/Linux Options::
7379 * H8/300 Options::
7380 * HPPA Options::
7381 * i386 and x86-64 Options::
7382 * IA-64 Options::
7383 * M32C Options::
7384 * M32R/D Options::
7385 * M680x0 Options::
7386 * M68hc1x Options::
7387 * MCore Options::
7388 * MIPS Options::
7389 * MMIX Options::
7390 * MN10300 Options::
7391 * MT Options::
7392 * PDP-11 Options::
7393 * PowerPC Options::
7394 * RS/6000 and PowerPC Options::
7395 * S/390 and zSeries Options::
7396 * Score Options::
7397 * SH Options::
7398 * SPARC Options::
7399 * SPU Options::
7400 * System V Options::
7401 * TMS320C3x/C4x Options::
7402 * V850 Options::
7403 * VAX Options::
7404 * x86-64 Options::
7405 * Xstormy16 Options::
7406 * Xtensa Options::
7407 * zSeries Options::
7408 @end menu
7409
7410 @node ARC Options
7411 @subsection ARC Options
7412 @cindex ARC Options
7413
7414 These options are defined for ARC implementations:
7415
7416 @table @gcctabopt
7417 @item -EL
7418 @opindex EL
7419 Compile code for little endian mode.  This is the default.
7420
7421 @item -EB
7422 @opindex EB
7423 Compile code for big endian mode.
7424
7425 @item -mmangle-cpu
7426 @opindex mmangle-cpu
7427 Prepend the name of the cpu to all public symbol names.
7428 In multiple-processor systems, there are many ARC variants with different
7429 instruction and register set characteristics.  This flag prevents code
7430 compiled for one cpu to be linked with code compiled for another.
7431 No facility exists for handling variants that are ``almost identical''.
7432 This is an all or nothing option.
7433
7434 @item -mcpu=@var{cpu}
7435 @opindex mcpu
7436 Compile code for ARC variant @var{cpu}.
7437 Which variants are supported depend on the configuration.
7438 All variants support @option{-mcpu=base}, this is the default.
7439
7440 @item -mtext=@var{text-section}
7441 @itemx -mdata=@var{data-section}
7442 @itemx -mrodata=@var{readonly-data-section}
7443 @opindex mtext
7444 @opindex mdata
7445 @opindex mrodata
7446 Put functions, data, and readonly data in @var{text-section},
7447 @var{data-section}, and @var{readonly-data-section} respectively
7448 by default.  This can be overridden with the @code{section} attribute.
7449 @xref{Variable Attributes}.
7450
7451 @end table
7452
7453 @node ARM Options
7454 @subsection ARM Options
7455 @cindex ARM options
7456
7457 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
7458 architectures:
7459
7460 @table @gcctabopt
7461 @item -mabi=@var{name}
7462 @opindex mabi
7463 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
7464 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
7465
7466 @item -mapcs-frame
7467 @opindex mapcs-frame
7468 Generate a stack frame that is compliant with the ARM Procedure Call
7469 Standard for all functions, even if this is not strictly necessary for
7470 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
7471 with this option will cause the stack frames not to be generated for
7472 leaf functions.  The default is @option{-mno-apcs-frame}.
7473
7474 @item -mapcs
7475 @opindex mapcs
7476 This is a synonym for @option{-mapcs-frame}.
7477
7478 @ignore
7479 @c not currently implemented
7480 @item -mapcs-stack-check
7481 @opindex mapcs-stack-check
7482 Generate code to check the amount of stack space available upon entry to
7483 every function (that actually uses some stack space).  If there is
7484 insufficient space available then either the function
7485 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
7486 called, depending upon the amount of stack space required.  The run time
7487 system is required to provide these functions.  The default is
7488 @option{-mno-apcs-stack-check}, since this produces smaller code.
7489
7490 @c not currently implemented
7491 @item -mapcs-float
7492 @opindex mapcs-float
7493 Pass floating point arguments using the float point registers.  This is
7494 one of the variants of the APCS@.  This option is recommended if the
7495 target hardware has a floating point unit or if a lot of floating point
7496 arithmetic is going to be performed by the code.  The default is
7497 @option{-mno-apcs-float}, since integer only code is slightly increased in
7498 size if @option{-mapcs-float} is used.
7499
7500 @c not currently implemented
7501 @item -mapcs-reentrant
7502 @opindex mapcs-reentrant
7503 Generate reentrant, position independent code.  The default is
7504 @option{-mno-apcs-reentrant}.
7505 @end ignore
7506
7507 @item -mthumb-interwork
7508 @opindex mthumb-interwork
7509 Generate code which supports calling between the ARM and Thumb
7510 instruction sets.  Without this option the two instruction sets cannot
7511 be reliably used inside one program.  The default is
7512 @option{-mno-thumb-interwork}, since slightly larger code is generated
7513 when @option{-mthumb-interwork} is specified.
7514
7515 @item -mno-sched-prolog
7516 @opindex mno-sched-prolog
7517 Prevent the reordering of instructions in the function prolog, or the
7518 merging of those instruction with the instructions in the function's
7519 body.  This means that all functions will start with a recognizable set
7520 of instructions (or in fact one of a choice from a small set of
7521 different function prologues), and this information can be used to
7522 locate the start if functions inside an executable piece of code.  The
7523 default is @option{-msched-prolog}.
7524
7525 @item -mhard-float
7526 @opindex mhard-float
7527 Generate output containing floating point instructions.  This is the
7528 default.
7529
7530 @item -msoft-float
7531 @opindex msoft-float
7532 Generate output containing library calls for floating point.
7533 @strong{Warning:} the requisite libraries are not available for all ARM
7534 targets.  Normally the facilities of the machine's usual C compiler are
7535 used, but this cannot be done directly in cross-compilation.  You must make
7536 your own arrangements to provide suitable library functions for
7537 cross-compilation.
7538
7539 @option{-msoft-float} changes the calling convention in the output file;
7540 therefore, it is only useful if you compile @emph{all} of a program with
7541 this option.  In particular, you need to compile @file{libgcc.a}, the
7542 library that comes with GCC, with @option{-msoft-float} in order for
7543 this to work.
7544
7545 @item -mfloat-abi=@var{name}
7546 @opindex mfloat-abi
7547 Specifies which ABI to use for floating point values.  Permissible values
7548 are: @samp{soft}, @samp{softfp} and @samp{hard}.
7549
7550 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
7551 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
7552 of floating point instructions, but still uses the soft-float calling
7553 conventions.
7554
7555 @item -mlittle-endian
7556 @opindex mlittle-endian
7557 Generate code for a processor running in little-endian mode.  This is
7558 the default for all standard configurations.
7559
7560 @item -mbig-endian
7561 @opindex mbig-endian
7562 Generate code for a processor running in big-endian mode; the default is
7563 to compile code for a little-endian processor.
7564
7565 @item -mwords-little-endian
7566 @opindex mwords-little-endian
7567 This option only applies when generating code for big-endian processors.
7568 Generate code for a little-endian word order but a big-endian byte
7569 order.  That is, a byte order of the form @samp{32107654}.  Note: this
7570 option should only be used if you require compatibility with code for
7571 big-endian ARM processors generated by versions of the compiler prior to
7572 2.8.
7573
7574 @item -mcpu=@var{name}
7575 @opindex mcpu
7576 This specifies the name of the target ARM processor.  GCC uses this name
7577 to determine what kind of instructions it can emit when generating
7578 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
7579 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
7580 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
7581 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
7582 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
7583 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
7584 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
7585 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
7586 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
7587 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
7588 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
7589 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
7590 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
7591 @samp{arm1176jz-s}, @samp{arm1176jzf-s}, @samp{xscale}, @samp{iwmmxt},
7592 @samp{ep9312}.
7593
7594 @itemx -mtune=@var{name}
7595 @opindex mtune
7596 This option is very similar to the @option{-mcpu=} option, except that
7597 instead of specifying the actual target processor type, and hence
7598 restricting which instructions can be used, it specifies that GCC should
7599 tune the performance of the code as if the target were of the type
7600 specified in this option, but still choosing the instructions that it
7601 will generate based on the cpu specified by a @option{-mcpu=} option.
7602 For some ARM implementations better performance can be obtained by using
7603 this option.
7604
7605 @item -march=@var{name}
7606 @opindex march
7607 This specifies the name of the target ARM architecture.  GCC uses this
7608 name to determine what kind of instructions it can emit when generating
7609 assembly code.  This option can be used in conjunction with or instead
7610 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
7611 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
7612 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
7613 @samp{iwmmxt}, @samp{ep9312}.
7614
7615 @item -mfpu=@var{name}
7616 @itemx -mfpe=@var{number}
7617 @itemx -mfp=@var{number}
7618 @opindex mfpu
7619 @opindex mfpe
7620 @opindex mfp
7621 This specifies what floating point hardware (or hardware emulation) is
7622 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
7623 @samp{fpe3}, @samp{maverick}, @samp{vfp}.  @option{-mfp} and @option{-mfpe}
7624 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
7625 with older versions of GCC@.
7626
7627 If @option{-msoft-float} is specified this specifies the format of
7628 floating point values.
7629
7630 @item -mstructure-size-boundary=@var{n}
7631 @opindex mstructure-size-boundary
7632 The size of all structures and unions will be rounded up to a multiple
7633 of the number of bits set by this option.  Permissible values are 8, 32
7634 and 64.  The default value varies for different toolchains.  For the COFF
7635 targeted toolchain the default value is 8.  A value of 64 is only allowed
7636 if the underlying ABI supports it.
7637
7638 Specifying the larger number can produce faster, more efficient code, but
7639 can also increase the size of the program.  Different values are potentially
7640 incompatible.  Code compiled with one value cannot necessarily expect to
7641 work with code or libraries compiled with another value, if they exchange
7642 information using structures or unions.
7643
7644 @item -mabort-on-noreturn
7645 @opindex mabort-on-noreturn
7646 Generate a call to the function @code{abort} at the end of a
7647 @code{noreturn} function.  It will be executed if the function tries to
7648 return.
7649
7650 @item -mlong-calls
7651 @itemx -mno-long-calls
7652 @opindex mlong-calls
7653 @opindex mno-long-calls
7654 Tells the compiler to perform function calls by first loading the
7655 address of the function into a register and then performing a subroutine
7656 call on this register.  This switch is needed if the target function
7657 will lie outside of the 64 megabyte addressing range of the offset based
7658 version of subroutine call instruction.
7659
7660 Even if this switch is enabled, not all function calls will be turned
7661 into long calls.  The heuristic is that static functions, functions
7662 which have the @samp{short-call} attribute, functions that are inside
7663 the scope of a @samp{#pragma no_long_calls} directive and functions whose
7664 definitions have already been compiled within the current compilation
7665 unit, will not be turned into long calls.  The exception to this rule is
7666 that weak function definitions, functions with the @samp{long-call}
7667 attribute or the @samp{section} attribute, and functions that are within
7668 the scope of a @samp{#pragma long_calls} directive, will always be
7669 turned into long calls.
7670
7671 This feature is not enabled by default.  Specifying
7672 @option{-mno-long-calls} will restore the default behavior, as will
7673 placing the function calls within the scope of a @samp{#pragma
7674 long_calls_off} directive.  Note these switches have no effect on how
7675 the compiler generates code to handle function calls via function
7676 pointers.
7677
7678 @item -mnop-fun-dllimport
7679 @opindex mnop-fun-dllimport
7680 Disable support for the @code{dllimport} attribute.
7681
7682 @item -msingle-pic-base
7683 @opindex msingle-pic-base
7684 Treat the register used for PIC addressing as read-only, rather than
7685 loading it in the prologue for each function.  The run-time system is
7686 responsible for initializing this register with an appropriate value
7687 before execution begins.
7688
7689 @item -mpic-register=@var{reg}
7690 @opindex mpic-register
7691 Specify the register to be used for PIC addressing.  The default is R10
7692 unless stack-checking is enabled, when R9 is used.
7693
7694 @item -mcirrus-fix-invalid-insns
7695 @opindex mcirrus-fix-invalid-insns
7696 @opindex mno-cirrus-fix-invalid-insns
7697 Insert NOPs into the instruction stream to in order to work around
7698 problems with invalid Maverick instruction combinations.  This option
7699 is only valid if the @option{-mcpu=ep9312} option has been used to
7700 enable generation of instructions for the Cirrus Maverick floating
7701 point co-processor.  This option is not enabled by default, since the
7702 problem is only present in older Maverick implementations.  The default
7703 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
7704 switch.
7705
7706 @item -mpoke-function-name
7707 @opindex mpoke-function-name
7708 Write the name of each function into the text section, directly
7709 preceding the function prologue.  The generated code is similar to this:
7710
7711 @smallexample
7712      t0
7713          .ascii "arm_poke_function_name", 0
7714          .align
7715      t1
7716          .word 0xff000000 + (t1 - t0)
7717      arm_poke_function_name
7718          mov     ip, sp
7719          stmfd   sp!, @{fp, ip, lr, pc@}
7720          sub     fp, ip, #4
7721 @end smallexample
7722
7723 When performing a stack backtrace, code can inspect the value of
7724 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
7725 location @code{pc - 12} and the top 8 bits are set, then we know that
7726 there is a function name embedded immediately preceding this location
7727 and has length @code{((pc[-3]) & 0xff000000)}.
7728
7729 @item -mthumb
7730 @opindex mthumb
7731 Generate code for the 16-bit Thumb instruction set.  The default is to
7732 use the 32-bit ARM instruction set.
7733
7734 @item -mtpcs-frame
7735 @opindex mtpcs-frame
7736 Generate a stack frame that is compliant with the Thumb Procedure Call
7737 Standard for all non-leaf functions.  (A leaf function is one that does
7738 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
7739
7740 @item -mtpcs-leaf-frame
7741 @opindex mtpcs-leaf-frame
7742 Generate a stack frame that is compliant with the Thumb Procedure Call
7743 Standard for all leaf functions.  (A leaf function is one that does
7744 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
7745
7746 @item -mcallee-super-interworking
7747 @opindex mcallee-super-interworking
7748 Gives all externally visible functions in the file being compiled an ARM
7749 instruction set header which switches to Thumb mode before executing the
7750 rest of the function.  This allows these functions to be called from
7751 non-interworking code.
7752
7753 @item -mcaller-super-interworking
7754 @opindex mcaller-super-interworking
7755 Allows calls via function pointers (including virtual functions) to
7756 execute correctly regardless of whether the target code has been
7757 compiled for interworking or not.  There is a small overhead in the cost
7758 of executing a function pointer if this option is enabled.
7759
7760 @item -mtp=@var{name}
7761 @opindex mtp
7762 Specify the access model for the thread local storage pointer.  The valid
7763 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
7764 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
7765 (supported in the arm6k architecture), and @option{auto}, which uses the
7766 best available method for the selected processor.  The default setting is
7767 @option{auto}.
7768
7769 @end table
7770
7771 @node AVR Options
7772 @subsection AVR Options
7773 @cindex AVR Options
7774
7775 These options are defined for AVR implementations:
7776
7777 @table @gcctabopt
7778 @item -mmcu=@var{mcu}
7779 @opindex mmcu
7780 Specify ATMEL AVR instruction set or MCU type.
7781
7782 Instruction set avr1 is for the minimal AVR core, not supported by the C
7783 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
7784 attiny11, attiny12, attiny15, attiny28).
7785
7786 Instruction set avr2 (default) is for the classic AVR core with up to
7787 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
7788 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
7789 at90c8534, at90s8535).
7790
7791 Instruction set avr3 is for the classic AVR core with up to 128K program
7792 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
7793
7794 Instruction set avr4 is for the enhanced AVR core with up to 8K program
7795 memory space (MCU types: atmega8, atmega83, atmega85).
7796
7797 Instruction set avr5 is for the enhanced AVR core with up to 128K program
7798 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
7799 atmega64, atmega128, at43usb355, at94k).
7800
7801 @item -msize
7802 @opindex msize
7803 Output instruction sizes to the asm file.
7804
7805 @item -minit-stack=@var{N}
7806 @opindex minit-stack
7807 Specify the initial stack address, which may be a symbol or numeric value,
7808 @samp{__stack} is the default.
7809
7810 @item -mno-interrupts
7811 @opindex mno-interrupts
7812 Generated code is not compatible with hardware interrupts.
7813 Code size will be smaller.
7814
7815 @item -mcall-prologues
7816 @opindex mcall-prologues
7817 Functions prologues/epilogues expanded as call to appropriate
7818 subroutines.  Code size will be smaller.
7819
7820 @item -mno-tablejump
7821 @opindex mno-tablejump
7822 Do not generate tablejump insns which sometimes increase code size.
7823
7824 @item -mtiny-stack
7825 @opindex mtiny-stack
7826 Change only the low 8 bits of the stack pointer.
7827
7828 @item -mint8
7829 @opindex mint8
7830 Assume int to be 8 bit integer.  This affects the sizes of all types: A
7831 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
7832 and long long will be 4 bytes.  Please note that this option does not
7833 comply to the C standards, but it will provide you with smaller code
7834 size.
7835 @end table
7836
7837 @node Blackfin Options
7838 @subsection Blackfin Options
7839 @cindex Blackfin Options
7840
7841 @table @gcctabopt
7842 @item -momit-leaf-frame-pointer
7843 @opindex momit-leaf-frame-pointer
7844 Don't keep the frame pointer in a register for leaf functions.  This
7845 avoids the instructions to save, set up and restore frame pointers and
7846 makes an extra register available in leaf functions.  The option
7847 @option{-fomit-frame-pointer} removes the frame pointer for all functions
7848 which might make debugging harder.
7849
7850 @item -mspecld-anomaly
7851 @opindex mspecld-anomaly
7852 When enabled, the compiler will ensure that the generated code does not
7853 contain speculative loads after jump instructions.  This option is enabled
7854 by default.
7855
7856 @item -mno-specld-anomaly
7857 @opindex mno-specld-anomaly
7858 Don't generate extra code to prevent speculative loads from occurring.
7859
7860 @item -mcsync-anomaly
7861 @opindex mcsync-anomaly
7862 When enabled, the compiler will ensure that the generated code does not
7863 contain CSYNC or SSYNC instructions too soon after conditional branches.
7864 This option is enabled by default.
7865
7866 @item -mno-csync-anomaly
7867 @opindex mno-csync-anomaly
7868 Don't generate extra code to prevent CSYNC or SSYNC instructions from
7869 occurring too soon after a conditional branch.
7870
7871 @item -mlow-64k
7872 @opindex mlow-64k
7873 When enabled, the compiler is free to take advantage of the knowledge that
7874 the entire program fits into the low 64k of memory.
7875
7876 @item -mno-low-64k
7877 @opindex mno-low-64k
7878 Assume that the program is arbitrarily large.  This is the default.
7879
7880 @item -mstack-check-l1
7881 @opindex mstack-check-l1
7882 Do stack checking using information placed into L1 scratchpad memory by the
7883 uClinux kernel.
7884
7885 @item -mid-shared-library
7886 @opindex mid-shared-library
7887 Generate code that supports shared libraries via the library ID method.
7888 This allows for execute in place and shared libraries in an environment
7889 without virtual memory management.  This option implies @option{-fPIC}.
7890
7891 @item -mno-id-shared-library
7892 @opindex mno-id-shared-library
7893 Generate code that doesn't assume ID based shared libraries are being used.
7894 This is the default.
7895
7896 @item -mleaf-id-shared-library
7897 @opindex mleaf-id-shared-library
7898 Generate code that supports shared libraries via the library ID method,
7899 but assumes that this library or executable won't link against any other
7900 ID shared libraries.  That allows the compiler to use faster code for jumps
7901 and calls.
7902
7903 @item -mno-leaf-id-shared-library
7904 @opindex mno-leaf-id-shared-library
7905 Do not assume that the code being compiled won't link against any ID shared
7906 libraries.  Slower code will be generated for jump and call insns.
7907
7908 @item -mshared-library-id=n
7909 @opindex mshared-library-id
7910 Specified the identification number of the ID based shared library being
7911 compiled.  Specifying a value of 0 will generate more compact code, specifying
7912 other values will force the allocation of that number to the current
7913 library but is no more space or time efficient than omitting this option.
7914
7915 @item -msep-data
7916 @opindex msep-data
7917 Generate code that allows the data segment to be located in a different
7918 area of memory from the text segment.  This allows for execute in place in
7919 an environment without virtual memory management by eliminating relocations
7920 against the text section.
7921
7922 @item -mno-sep-data
7923 @opindex mno-sep-data
7924 Generate code that assumes that the data segment follows the text segment.
7925 This is the default.
7926
7927 @item -mlong-calls
7928 @itemx -mno-long-calls
7929 @opindex mlong-calls
7930 @opindex mno-long-calls
7931 Tells the compiler to perform function calls by first loading the
7932 address of the function into a register and then performing a subroutine
7933 call on this register.  This switch is needed if the target function
7934 will lie outside of the 24 bit addressing range of the offset based
7935 version of subroutine call instruction.
7936
7937 This feature is not enabled by default.  Specifying
7938 @option{-mno-long-calls} will restore the default behavior.  Note these
7939 switches have no effect on how the compiler generates code to handle
7940 function calls via function pointers.
7941 @end table
7942
7943 @node CRIS Options
7944 @subsection CRIS Options
7945 @cindex CRIS Options
7946
7947 These options are defined specifically for the CRIS ports.
7948
7949 @table @gcctabopt
7950 @item -march=@var{architecture-type}
7951 @itemx -mcpu=@var{architecture-type}
7952 @opindex march
7953 @opindex mcpu
7954 Generate code for the specified architecture.  The choices for
7955 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
7956 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
7957 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
7958 @samp{v10}.
7959
7960 @item -mtune=@var{architecture-type}
7961 @opindex mtune
7962 Tune to @var{architecture-type} everything applicable about the generated
7963 code, except for the ABI and the set of available instructions.  The
7964 choices for @var{architecture-type} are the same as for
7965 @option{-march=@var{architecture-type}}.
7966
7967 @item -mmax-stack-frame=@var{n}
7968 @opindex mmax-stack-frame
7969 Warn when the stack frame of a function exceeds @var{n} bytes.
7970
7971 @item -melinux-stacksize=@var{n}
7972 @opindex melinux-stacksize
7973 Only available with the @samp{cris-axis-aout} target.  Arranges for
7974 indications in the program to the kernel loader that the stack of the
7975 program should be set to @var{n} bytes.
7976
7977 @item -metrax4
7978 @itemx -metrax100
7979 @opindex metrax4
7980 @opindex metrax100
7981 The options @option{-metrax4} and @option{-metrax100} are synonyms for
7982 @option{-march=v3} and @option{-march=v8} respectively.
7983
7984 @item -mmul-bug-workaround
7985 @itemx -mno-mul-bug-workaround
7986 @opindex mmul-bug-workaround
7987 @opindex mno-mul-bug-workaround
7988 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
7989 models where it applies.  This option is active by default.
7990
7991 @item -mpdebug
7992 @opindex mpdebug
7993 Enable CRIS-specific verbose debug-related information in the assembly
7994 code.  This option also has the effect to turn off the @samp{#NO_APP}
7995 formatted-code indicator to the assembler at the beginning of the
7996 assembly file.
7997
7998 @item -mcc-init
7999 @opindex mcc-init
8000 Do not use condition-code results from previous instruction; always emit
8001 compare and test instructions before use of condition codes.
8002
8003 @item -mno-side-effects
8004 @opindex mno-side-effects
8005 Do not emit instructions with side-effects in addressing modes other than
8006 post-increment.
8007
8008 @item -mstack-align
8009 @itemx -mno-stack-align
8010 @itemx -mdata-align
8011 @itemx -mno-data-align
8012 @itemx -mconst-align
8013 @itemx -mno-const-align
8014 @opindex mstack-align
8015 @opindex mno-stack-align
8016 @opindex mdata-align
8017 @opindex mno-data-align
8018 @opindex mconst-align
8019 @opindex mno-const-align
8020 These options (no-options) arranges (eliminate arrangements) for the
8021 stack-frame, individual data and constants to be aligned for the maximum
8022 single data access size for the chosen CPU model.  The default is to
8023 arrange for 32-bit alignment.  ABI details such as structure layout are
8024 not affected by these options.
8025
8026 @item -m32-bit
8027 @itemx -m16-bit
8028 @itemx -m8-bit
8029 @opindex m32-bit
8030 @opindex m16-bit
8031 @opindex m8-bit
8032 Similar to the stack- data- and const-align options above, these options
8033 arrange for stack-frame, writable data and constants to all be 32-bit,
8034 16-bit or 8-bit aligned.  The default is 32-bit alignment.
8035
8036 @item -mno-prologue-epilogue
8037 @itemx -mprologue-epilogue
8038 @opindex mno-prologue-epilogue
8039 @opindex mprologue-epilogue
8040 With @option{-mno-prologue-epilogue}, the normal function prologue and
8041 epilogue that sets up the stack-frame are omitted and no return
8042 instructions or return sequences are generated in the code.  Use this
8043 option only together with visual inspection of the compiled code: no
8044 warnings or errors are generated when call-saved registers must be saved,
8045 or storage for local variable needs to be allocated.
8046
8047 @item -mno-gotplt
8048 @itemx -mgotplt
8049 @opindex mno-gotplt
8050 @opindex mgotplt
8051 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
8052 instruction sequences that load addresses for functions from the PLT part
8053 of the GOT rather than (traditional on other architectures) calls to the
8054 PLT@.  The default is @option{-mgotplt}.
8055
8056 @item -maout
8057 @opindex maout
8058 Legacy no-op option only recognized with the cris-axis-aout target.
8059
8060 @item -melf
8061 @opindex melf
8062 Legacy no-op option only recognized with the cris-axis-elf and
8063 cris-axis-linux-gnu targets.
8064
8065 @item -melinux
8066 @opindex melinux
8067 Only recognized with the cris-axis-aout target, where it selects a
8068 GNU/linux-like multilib, include files and instruction set for
8069 @option{-march=v8}.
8070
8071 @item -mlinux
8072 @opindex mlinux
8073 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8074
8075 @item -sim
8076 @opindex sim
8077 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
8078 to link with input-output functions from a simulator library.  Code,
8079 initialized data and zero-initialized data are allocated consecutively.
8080
8081 @item -sim2
8082 @opindex sim2
8083 Like @option{-sim}, but pass linker options to locate initialized data at
8084 0x40000000 and zero-initialized data at 0x80000000.
8085 @end table
8086
8087 @node CRX Options
8088 @subsection CRX Options
8089 @cindex CRX Options
8090
8091 These options are defined specifically for the CRX ports.
8092
8093 @table @gcctabopt
8094
8095 @item -mmac
8096 @opindex mmac
8097 Enable the use of multiply-accumulate instructions. Disabled by default.
8098
8099 @item -mpush-args
8100 @opindex mpush-args
8101 Push instructions will be used to pass outgoing arguments when functions
8102 are called. Enabled by default.
8103 @end table
8104
8105 @node Darwin Options
8106 @subsection Darwin Options
8107 @cindex Darwin options
8108
8109 These options are defined for all architectures running the Darwin operating
8110 system.
8111
8112 FSF GCC on Darwin does not create ``fat'' object files; it will create
8113 an object file for the single architecture that it was built to
8114 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
8115 @option{-arch} options are used; it does so by running the compiler or
8116 linker multiple times and joining the results together with
8117 @file{lipo}.
8118
8119 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
8120 @samp{i686}) is determined by the flags that specify the ISA
8121 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
8122 @option{-force_cpusubtype_ALL} option can be used to override this.
8123
8124 The Darwin tools vary in their behavior when presented with an ISA
8125 mismatch.  The assembler, @file{as}, will only permit instructions to
8126 be used that are valid for the subtype of the file it is generating,
8127 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
8128 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
8129 and print an error if asked to create a shared library with a less
8130 restrictive subtype than its input files (for instance, trying to put
8131 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
8132 for executables, @file{ld}, will quietly give the executable the most
8133 restrictive subtype of any of its input files.
8134
8135 @table @gcctabopt
8136 @item -F@var{dir}
8137 @opindex F
8138 Add the framework directory @var{dir} to the head of the list of
8139 directories to be searched for header files.  These directories are
8140 interleaved with those specified by @option{-I} options and are
8141 scanned in a left-to-right order.
8142
8143 A framework directory is a directory with frameworks in it.  A
8144 framework is a directory with a @samp{"Headers"} and/or
8145 @samp{"PrivateHeaders"} directory contained directly in it that ends
8146 in @samp{".framework"}.  The name of a framework is the name of this
8147 directory excluding the @samp{".framework"}.  Headers associated with
8148 the framework are found in one of those two directories, with
8149 @samp{"Headers"} being searched first.  A subframework is a framework
8150 directory that is in a framework's @samp{"Frameworks"} directory.
8151 Includes of subframework headers can only appear in a header of a
8152 framework that contains the subframework, or in a sibling subframework
8153 header.  Two subframeworks are siblings if they occur in the same
8154 framework.  A subframework should not have the same name as a
8155 framework, a warning will be issued if this is violated.  Currently a
8156 subframework cannot have subframeworks, in the future, the mechanism
8157 may be extended to support this.  The standard frameworks can be found
8158 in @samp{"/System/Library/Frameworks"} and
8159 @samp{"/Library/Frameworks"}.  An example include looks like
8160 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
8161 the name of the framework and header.h is found in the
8162 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
8163
8164 @item -gused
8165 @opindex -gused
8166 Emit debugging information for symbols that are used.  For STABS
8167 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
8168 This is by default ON@.
8169
8170 @item -gfull
8171 @opindex -gfull
8172 Emit debugging information for all symbols and types.
8173
8174 @item -mmacosx-version-min=@var{version}
8175 The earliest version of MacOS X that this executable will run on
8176 is @var{version}.  Typical values of @var{version} include @code{10.1},
8177 @code{10.2}, and @code{10.3.9}.
8178
8179 The default for this option is to make choices that seem to be most
8180 useful.  
8181
8182 @item -mkernel
8183 @opindex mkernel
8184 Enable kernel development mode.  The @option{-mkernel} option sets
8185 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
8186 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
8187 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
8188 applicable.  This mode also sets @option{-mno-altivec},
8189 @option{-msoft-float}, @option{-fno-builtin} and
8190 @option{-mlong-branch} for PowerPC targets.
8191
8192 @item -mone-byte-bool
8193 @opindex -mone-byte-bool
8194 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
8195 By default @samp{sizeof(bool)} is @samp{4} when compiling for
8196 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
8197 option has no effect on x86.
8198
8199 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
8200 to generate code that is not binary compatible with code generated
8201 without that switch.  Using this switch may require recompiling all
8202 other modules in a program, including system libraries.  Use this
8203 switch to conform to a non-default data model.
8204
8205 @item -mfix-and-continue
8206 @itemx -ffix-and-continue
8207 @itemx -findirect-data
8208 @opindex mfix-and-continue
8209 @opindex ffix-and-continue
8210 @opindex findirect-data
8211 Generate code suitable for fast turn around development.  Needed to
8212 enable gdb to dynamically load @code{.o} files into already running
8213 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
8214 are provided for backwards compatibility.
8215
8216 @item -all_load
8217 @opindex all_load
8218 Loads all members of static archive libraries.
8219 See man ld(1) for more information.
8220
8221 @item -arch_errors_fatal
8222 @opindex arch_errors_fatal
8223 Cause the errors having to do with files that have the wrong architecture
8224 to be fatal.
8225
8226 @item -bind_at_load
8227 @opindex bind_at_load
8228 Causes the output file to be marked such that the dynamic linker will
8229 bind all undefined references when the file is loaded or launched.
8230
8231 @item -bundle
8232 @opindex bundle
8233 Produce a Mach-o bundle format file.
8234 See man ld(1) for more information.
8235
8236 @item -bundle_loader @var{executable}
8237 @opindex bundle_loader
8238 This option specifies the @var{executable} that will be loading the build
8239 output file being linked.  See man ld(1) for more information.
8240
8241 @item -dynamiclib
8242 @opindex -dynamiclib
8243 When passed this option, GCC will produce a dynamic library instead of
8244 an executable when linking, using the Darwin @file{libtool} command.
8245
8246 @item -force_cpusubtype_ALL
8247 @opindex -force_cpusubtype_ALL
8248 This causes GCC's output file to have the @var{ALL} subtype, instead of
8249 one controlled by the @option{-mcpu} or @option{-march} option.
8250
8251 @item -allowable_client  @var{client_name}
8252 @itemx -client_name
8253 @itemx -compatibility_version
8254 @itemx -current_version
8255 @itemx -dead_strip
8256 @itemx -dependency-file
8257 @itemx -dylib_file
8258 @itemx -dylinker_install_name
8259 @itemx -dynamic
8260 @itemx -exported_symbols_list
8261 @itemx -filelist
8262 @itemx -flat_namespace
8263 @itemx -force_flat_namespace
8264 @itemx -headerpad_max_install_names
8265 @itemx -image_base
8266 @itemx -init
8267 @itemx -install_name
8268 @itemx -keep_private_externs
8269 @itemx -multi_module
8270 @itemx -multiply_defined
8271 @itemx -multiply_defined_unused
8272 @itemx -noall_load
8273 @itemx -no_dead_strip_inits_and_terms
8274 @itemx -nofixprebinding
8275 @itemx -nomultidefs
8276 @itemx -noprebind
8277 @itemx -noseglinkedit
8278 @itemx -pagezero_size
8279 @itemx -prebind
8280 @itemx -prebind_all_twolevel_modules
8281 @itemx -private_bundle
8282 @itemx -read_only_relocs
8283 @itemx -sectalign
8284 @itemx -sectobjectsymbols
8285 @itemx -whyload
8286 @itemx -seg1addr
8287 @itemx -sectcreate
8288 @itemx -sectobjectsymbols
8289 @itemx -sectorder
8290 @itemx -segaddr
8291 @itemx -segs_read_only_addr
8292 @itemx -segs_read_write_addr
8293 @itemx -seg_addr_table
8294 @itemx -seg_addr_table_filename
8295 @itemx -seglinkedit
8296 @itemx -segprot
8297 @itemx -segs_read_only_addr
8298 @itemx -segs_read_write_addr
8299 @itemx -single_module
8300 @itemx -static
8301 @itemx -sub_library
8302 @itemx -sub_umbrella
8303 @itemx -twolevel_namespace
8304 @itemx -umbrella
8305 @itemx -undefined
8306 @itemx -unexported_symbols_list
8307 @itemx -weak_reference_mismatches
8308 @itemx -whatsloaded
8309
8310 @opindex allowable_client
8311 @opindex client_name
8312 @opindex compatibility_version
8313 @opindex current_version
8314 @opindex dead_strip
8315 @opindex dependency-file
8316 @opindex dylib_file
8317 @opindex dylinker_install_name
8318 @opindex dynamic
8319 @opindex exported_symbols_list
8320 @opindex filelist
8321 @opindex flat_namespace
8322 @opindex force_flat_namespace
8323 @opindex headerpad_max_install_names
8324 @opindex image_base
8325 @opindex init
8326 @opindex install_name
8327 @opindex keep_private_externs
8328 @opindex multi_module
8329 @opindex multiply_defined
8330 @opindex multiply_defined_unused
8331 @opindex noall_load
8332 @opindex no_dead_strip_inits_and_terms
8333 @opindex nofixprebinding
8334 @opindex nomultidefs
8335 @opindex noprebind
8336 @opindex noseglinkedit
8337 @opindex pagezero_size
8338 @opindex prebind
8339 @opindex prebind_all_twolevel_modules
8340 @opindex private_bundle
8341 @opindex read_only_relocs
8342 @opindex sectalign
8343 @opindex sectobjectsymbols
8344 @opindex whyload
8345 @opindex seg1addr
8346 @opindex sectcreate
8347 @opindex sectobjectsymbols
8348 @opindex sectorder
8349 @opindex segaddr
8350 @opindex segs_read_only_addr
8351 @opindex segs_read_write_addr
8352 @opindex seg_addr_table
8353 @opindex seg_addr_table_filename
8354 @opindex seglinkedit
8355 @opindex segprot
8356 @opindex segs_read_only_addr
8357 @opindex segs_read_write_addr
8358 @opindex single_module
8359 @opindex static
8360 @opindex sub_library
8361 @opindex sub_umbrella
8362 @opindex twolevel_namespace
8363 @opindex umbrella
8364 @opindex undefined
8365 @opindex unexported_symbols_list
8366 @opindex weak_reference_mismatches
8367 @opindex whatsloaded
8368
8369 These options are passed to the Darwin linker.  The Darwin linker man page
8370 describes them in detail.
8371 @end table
8372
8373 @node DEC Alpha Options
8374 @subsection DEC Alpha Options
8375
8376 These @samp{-m} options are defined for the DEC Alpha implementations:
8377
8378 @table @gcctabopt
8379 @item -mno-soft-float
8380 @itemx -msoft-float
8381 @opindex mno-soft-float
8382 @opindex msoft-float
8383 Use (do not use) the hardware floating-point instructions for
8384 floating-point operations.  When @option{-msoft-float} is specified,
8385 functions in @file{libgcc.a} will be used to perform floating-point
8386 operations.  Unless they are replaced by routines that emulate the
8387 floating-point operations, or compiled in such a way as to call such
8388 emulations routines, these routines will issue floating-point
8389 operations.   If you are compiling for an Alpha without floating-point
8390 operations, you must ensure that the library is built so as not to call
8391 them.
8392
8393 Note that Alpha implementations without floating-point operations are
8394 required to have floating-point registers.
8395
8396 @item -mfp-reg
8397 @itemx -mno-fp-regs
8398 @opindex mfp-reg
8399 @opindex mno-fp-regs
8400 Generate code that uses (does not use) the floating-point register set.
8401 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8402 register set is not used, floating point operands are passed in integer
8403 registers as if they were integers and floating-point results are passed
8404 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
8405 so any function with a floating-point argument or return value called by code
8406 compiled with @option{-mno-fp-regs} must also be compiled with that
8407 option.
8408
8409 A typical use of this option is building a kernel that does not use,
8410 and hence need not save and restore, any floating-point registers.
8411
8412 @item -mieee
8413 @opindex mieee
8414 The Alpha architecture implements floating-point hardware optimized for
8415 maximum performance.  It is mostly compliant with the IEEE floating
8416 point standard.  However, for full compliance, software assistance is
8417 required.  This option generates code fully IEEE compliant code
8418 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8419 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8420 defined during compilation.  The resulting code is less efficient but is
8421 able to correctly support denormalized numbers and exceptional IEEE
8422 values such as not-a-number and plus/minus infinity.  Other Alpha
8423 compilers call this option @option{-ieee_with_no_inexact}.
8424
8425 @item -mieee-with-inexact
8426 @opindex mieee-with-inexact
8427 This is like @option{-mieee} except the generated code also maintains
8428 the IEEE @var{inexact-flag}.  Turning on this option causes the
8429 generated code to implement fully-compliant IEEE math.  In addition to
8430 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8431 macro.  On some Alpha implementations the resulting code may execute
8432 significantly slower than the code generated by default.  Since there is
8433 very little code that depends on the @var{inexact-flag}, you should
8434 normally not specify this option.  Other Alpha compilers call this
8435 option @option{-ieee_with_inexact}.
8436
8437 @item -mfp-trap-mode=@var{trap-mode}
8438 @opindex mfp-trap-mode
8439 This option controls what floating-point related traps are enabled.
8440 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8441 The trap mode can be set to one of four values:
8442
8443 @table @samp
8444 @item n
8445 This is the default (normal) setting.  The only traps that are enabled
8446 are the ones that cannot be disabled in software (e.g., division by zero
8447 trap).
8448
8449 @item u
8450 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8451 as well.
8452
8453 @item su
8454 Like @samp{u}, but the instructions are marked to be safe for software
8455 completion (see Alpha architecture manual for details).
8456
8457 @item sui
8458 Like @samp{su}, but inexact traps are enabled as well.
8459 @end table
8460
8461 @item -mfp-rounding-mode=@var{rounding-mode}
8462 @opindex mfp-rounding-mode
8463 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8464 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8465 of:
8466
8467 @table @samp
8468 @item n
8469 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8470 the nearest machine number or towards the even machine number in case
8471 of a tie.
8472
8473 @item m
8474 Round towards minus infinity.
8475
8476 @item c
8477 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8478
8479 @item d
8480 Dynamic rounding mode.  A field in the floating point control register
8481 (@var{fpcr}, see Alpha architecture reference manual) controls the
8482 rounding mode in effect.  The C library initializes this register for
8483 rounding towards plus infinity.  Thus, unless your program modifies the
8484 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8485 @end table
8486
8487 @item -mtrap-precision=@var{trap-precision}
8488 @opindex mtrap-precision
8489 In the Alpha architecture, floating point traps are imprecise.  This
8490 means without software assistance it is impossible to recover from a
8491 floating trap and program execution normally needs to be terminated.
8492 GCC can generate code that can assist operating system trap handlers
8493 in determining the exact location that caused a floating point trap.
8494 Depending on the requirements of an application, different levels of
8495 precisions can be selected:
8496
8497 @table @samp
8498 @item p
8499 Program precision.  This option is the default and means a trap handler
8500 can only identify which program caused a floating point exception.
8501
8502 @item f
8503 Function precision.  The trap handler can determine the function that
8504 caused a floating point exception.
8505
8506 @item i
8507 Instruction precision.  The trap handler can determine the exact
8508 instruction that caused a floating point exception.
8509 @end table
8510
8511 Other Alpha compilers provide the equivalent options called
8512 @option{-scope_safe} and @option{-resumption_safe}.
8513
8514 @item -mieee-conformant
8515 @opindex mieee-conformant
8516 This option marks the generated code as IEEE conformant.  You must not
8517 use this option unless you also specify @option{-mtrap-precision=i} and either
8518 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8519 is to emit the line @samp{.eflag 48} in the function prologue of the
8520 generated assembly file.  Under DEC Unix, this has the effect that
8521 IEEE-conformant math library routines will be linked in.
8522
8523 @item -mbuild-constants
8524 @opindex mbuild-constants
8525 Normally GCC examines a 32- or 64-bit integer constant to
8526 see if it can construct it from smaller constants in two or three
8527 instructions.  If it cannot, it will output the constant as a literal and
8528 generate code to load it from the data segment at runtime.
8529
8530 Use this option to require GCC to construct @emph{all} integer constants
8531 using code, even if it takes more instructions (the maximum is six).
8532
8533 You would typically use this option to build a shared library dynamic
8534 loader.  Itself a shared library, it must relocate itself in memory
8535 before it can find the variables and constants in its own data segment.
8536
8537 @item -malpha-as
8538 @itemx -mgas
8539 @opindex malpha-as
8540 @opindex mgas
8541 Select whether to generate code to be assembled by the vendor-supplied
8542 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8543
8544 @item -mbwx
8545 @itemx -mno-bwx
8546 @itemx -mcix
8547 @itemx -mno-cix
8548 @itemx -mfix
8549 @itemx -mno-fix
8550 @itemx -mmax
8551 @itemx -mno-max
8552 @opindex mbwx
8553 @opindex mno-bwx
8554 @opindex mcix
8555 @opindex mno-cix
8556 @opindex mfix
8557 @opindex mno-fix
8558 @opindex mmax
8559 @opindex mno-max
8560 Indicate whether GCC should generate code to use the optional BWX,
8561 CIX, FIX and MAX instruction sets.  The default is to use the instruction
8562 sets supported by the CPU type specified via @option{-mcpu=} option or that
8563 of the CPU on which GCC was built if none was specified.
8564
8565 @item -mfloat-vax
8566 @itemx -mfloat-ieee
8567 @opindex mfloat-vax
8568 @opindex mfloat-ieee
8569 Generate code that uses (does not use) VAX F and G floating point
8570 arithmetic instead of IEEE single and double precision.
8571
8572 @item -mexplicit-relocs
8573 @itemx -mno-explicit-relocs
8574 @opindex mexplicit-relocs
8575 @opindex mno-explicit-relocs
8576 Older Alpha assemblers provided no way to generate symbol relocations
8577 except via assembler macros.  Use of these macros does not allow
8578 optimal instruction scheduling.  GNU binutils as of version 2.12
8579 supports a new syntax that allows the compiler to explicitly mark
8580 which relocations should apply to which instructions.  This option
8581 is mostly useful for debugging, as GCC detects the capabilities of
8582 the assembler when it is built and sets the default accordingly.
8583
8584 @item -msmall-data
8585 @itemx -mlarge-data
8586 @opindex msmall-data
8587 @opindex mlarge-data
8588 When @option{-mexplicit-relocs} is in effect, static data is
8589 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
8590 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
8591 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
8592 16-bit relocations off of the @code{$gp} register.  This limits the
8593 size of the small data area to 64KB, but allows the variables to be
8594 directly accessed via a single instruction.
8595
8596 The default is @option{-mlarge-data}.  With this option the data area
8597 is limited to just below 2GB@.  Programs that require more than 2GB of
8598 data must use @code{malloc} or @code{mmap} to allocate the data in the
8599 heap instead of in the program's data segment.
8600
8601 When generating code for shared libraries, @option{-fpic} implies
8602 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
8603
8604 @item -msmall-text
8605 @itemx -mlarge-text
8606 @opindex msmall-text
8607 @opindex mlarge-text
8608 When @option{-msmall-text} is used, the compiler assumes that the
8609 code of the entire program (or shared library) fits in 4MB, and is
8610 thus reachable with a branch instruction.  When @option{-msmall-data}
8611 is used, the compiler can assume that all local symbols share the
8612 same @code{$gp} value, and thus reduce the number of instructions
8613 required for a function call from 4 to 1.
8614
8615 The default is @option{-mlarge-text}.
8616
8617 @item -mcpu=@var{cpu_type}
8618 @opindex mcpu
8619 Set the instruction set and instruction scheduling parameters for
8620 machine type @var{cpu_type}.  You can specify either the @samp{EV}
8621 style name or the corresponding chip number.  GCC supports scheduling
8622 parameters for the EV4, EV5 and EV6 family of processors and will
8623 choose the default values for the instruction set from the processor
8624 you specify.  If you do not specify a processor type, GCC will default
8625 to the processor on which the compiler was built.
8626
8627 Supported values for @var{cpu_type} are
8628
8629 @table @samp
8630 @item ev4
8631 @itemx ev45
8632 @itemx 21064
8633 Schedules as an EV4 and has no instruction set extensions.
8634
8635 @item ev5
8636 @itemx 21164
8637 Schedules as an EV5 and has no instruction set extensions.
8638
8639 @item ev56
8640 @itemx 21164a
8641 Schedules as an EV5 and supports the BWX extension.
8642
8643 @item pca56
8644 @itemx 21164pc
8645 @itemx 21164PC
8646 Schedules as an EV5 and supports the BWX and MAX extensions.
8647
8648 @item ev6
8649 @itemx 21264
8650 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
8651
8652 @item ev67
8653 @itemx 21264a
8654 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
8655 @end table
8656
8657 @item -mtune=@var{cpu_type}
8658 @opindex mtune
8659 Set only the instruction scheduling parameters for machine type
8660 @var{cpu_type}.  The instruction set is not changed.
8661
8662 @item -mmemory-latency=@var{time}
8663 @opindex mmemory-latency
8664 Sets the latency the scheduler should assume for typical memory
8665 references as seen by the application.  This number is highly
8666 dependent on the memory access patterns used by the application
8667 and the size of the external cache on the machine.
8668
8669 Valid options for @var{time} are
8670
8671 @table @samp
8672 @item @var{number}
8673 A decimal number representing clock cycles.
8674
8675 @item L1
8676 @itemx L2
8677 @itemx L3
8678 @itemx main
8679 The compiler contains estimates of the number of clock cycles for
8680 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
8681 (also called Dcache, Scache, and Bcache), as well as to main memory.
8682 Note that L3 is only valid for EV5.
8683
8684 @end table
8685 @end table
8686
8687 @node DEC Alpha/VMS Options
8688 @subsection DEC Alpha/VMS Options
8689
8690 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
8691
8692 @table @gcctabopt
8693 @item -mvms-return-codes
8694 @opindex mvms-return-codes
8695 Return VMS condition codes from main.  The default is to return POSIX
8696 style condition (e.g.@ error) codes.
8697 @end table
8698
8699 @node FRV Options
8700 @subsection FRV Options
8701 @cindex FRV Options
8702
8703 @table @gcctabopt
8704 @item -mgpr-32
8705 @opindex mgpr-32
8706
8707 Only use the first 32 general purpose registers.
8708
8709 @item -mgpr-64
8710 @opindex mgpr-64
8711
8712 Use all 64 general purpose registers.
8713
8714 @item -mfpr-32
8715 @opindex mfpr-32
8716
8717 Use only the first 32 floating point registers.
8718
8719 @item -mfpr-64
8720 @opindex mfpr-64
8721
8722 Use all 64 floating point registers
8723
8724 @item -mhard-float
8725 @opindex mhard-float
8726
8727 Use hardware instructions for floating point operations.
8728
8729 @item -msoft-float
8730 @opindex msoft-float
8731
8732 Use library routines for floating point operations.
8733
8734 @item -malloc-cc
8735 @opindex malloc-cc
8736
8737 Dynamically allocate condition code registers.
8738
8739 @item -mfixed-cc
8740 @opindex mfixed-cc
8741
8742 Do not try to dynamically allocate condition code registers, only
8743 use @code{icc0} and @code{fcc0}.
8744
8745 @item -mdword
8746 @opindex mdword
8747
8748 Change ABI to use double word insns.
8749
8750 @item -mno-dword
8751 @opindex mno-dword
8752
8753 Do not use double word instructions.
8754
8755 @item -mdouble
8756 @opindex mdouble
8757
8758 Use floating point double instructions.
8759
8760 @item -mno-double
8761 @opindex mno-double
8762
8763 Do not use floating point double instructions.
8764
8765 @item -mmedia
8766 @opindex mmedia
8767
8768 Use media instructions.
8769
8770 @item -mno-media
8771 @opindex mno-media
8772
8773 Do not use media instructions.
8774
8775 @item -mmuladd
8776 @opindex mmuladd
8777
8778 Use multiply and add/subtract instructions.
8779
8780 @item -mno-muladd
8781 @opindex mno-muladd
8782
8783 Do not use multiply and add/subtract instructions.
8784
8785 @item -mfdpic
8786 @opindex mfdpic
8787
8788 Select the FDPIC ABI, that uses function descriptors to represent
8789 pointers to functions.  Without any PIC/PIE-related options, it
8790 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
8791 assumes GOT entries and small data are within a 12-bit range from the
8792 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
8793 are computed with 32 bits.
8794
8795 @item -minline-plt
8796 @opindex minline-plt
8797
8798 Enable inlining of PLT entries in function calls to functions that are
8799 not known to bind locally.  It has no effect without @option{-mfdpic}.
8800 It's enabled by default if optimizing for speed and compiling for
8801 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
8802 optimization option such as @option{-O3} or above is present in the
8803 command line.
8804
8805 @item -mTLS
8806 @opindex TLS
8807
8808 Assume a large TLS segment when generating thread-local code.
8809
8810 @item -mtls
8811 @opindex tls
8812
8813 Do not assume a large TLS segment when generating thread-local code.
8814
8815 @item -mgprel-ro
8816 @opindex mgprel-ro
8817
8818 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
8819 that is known to be in read-only sections.  It's enabled by default,
8820 except for @option{-fpic} or @option{-fpie}: even though it may help
8821 make the global offset table smaller, it trades 1 instruction for 4.
8822 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
8823 one of which may be shared by multiple symbols, and it avoids the need
8824 for a GOT entry for the referenced symbol, so it's more likely to be a
8825 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
8826
8827 @item -multilib-library-pic
8828 @opindex multilib-library-pic
8829
8830 Link with the (library, not FD) pic libraries.  It's implied by
8831 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
8832 @option{-fpic} without @option{-mfdpic}.  You should never have to use
8833 it explicitly.
8834
8835 @item -mlinked-fp
8836 @opindex mlinked-fp
8837
8838 Follow the EABI requirement of always creating a frame pointer whenever
8839 a stack frame is allocated.  This option is enabled by default and can
8840 be disabled with @option{-mno-linked-fp}.
8841
8842 @item -mlong-calls
8843 @opindex mlong-calls
8844
8845 Use indirect addressing to call functions outside the current
8846 compilation unit.  This allows the functions to be placed anywhere
8847 within the 32-bit address space.
8848
8849 @item -malign-labels
8850 @opindex malign-labels
8851
8852 Try to align labels to an 8-byte boundary by inserting nops into the
8853 previous packet.  This option only has an effect when VLIW packing
8854 is enabled.  It doesn't create new packets; it merely adds nops to
8855 existing ones.
8856
8857 @item -mlibrary-pic
8858 @opindex mlibrary-pic
8859
8860 Generate position-independent EABI code.
8861
8862 @item -macc-4
8863 @opindex macc-4
8864
8865 Use only the first four media accumulator registers.
8866
8867 @item -macc-8
8868 @opindex macc-8
8869
8870 Use all eight media accumulator registers.
8871
8872 @item -mpack
8873 @opindex mpack
8874
8875 Pack VLIW instructions.
8876
8877 @item -mno-pack
8878 @opindex mno-pack
8879
8880 Do not pack VLIW instructions.
8881
8882 @item -mno-eflags
8883 @opindex mno-eflags
8884
8885 Do not mark ABI switches in e_flags.
8886
8887 @item -mcond-move
8888 @opindex mcond-move
8889
8890 Enable the use of conditional-move instructions (default).
8891
8892 This switch is mainly for debugging the compiler and will likely be removed
8893 in a future version.
8894
8895 @item -mno-cond-move
8896 @opindex mno-cond-move
8897
8898 Disable the use of conditional-move instructions.
8899
8900 This switch is mainly for debugging the compiler and will likely be removed
8901 in a future version.
8902
8903 @item -mscc
8904 @opindex mscc
8905
8906 Enable the use of conditional set instructions (default).
8907
8908 This switch is mainly for debugging the compiler and will likely be removed
8909 in a future version.
8910
8911 @item -mno-scc
8912 @opindex mno-scc
8913
8914 Disable the use of conditional set instructions.
8915
8916 This switch is mainly for debugging the compiler and will likely be removed
8917 in a future version.
8918
8919 @item -mcond-exec
8920 @opindex mcond-exec
8921
8922 Enable the use of conditional execution (default).
8923
8924 This switch is mainly for debugging the compiler and will likely be removed
8925 in a future version.
8926
8927 @item -mno-cond-exec
8928 @opindex mno-cond-exec
8929
8930 Disable the use of conditional execution.
8931
8932 This switch is mainly for debugging the compiler and will likely be removed
8933 in a future version.
8934
8935 @item -mvliw-branch
8936 @opindex mvliw-branch
8937
8938 Run a pass to pack branches into VLIW instructions (default).
8939
8940 This switch is mainly for debugging the compiler and will likely be removed
8941 in a future version.
8942
8943 @item -mno-vliw-branch
8944 @opindex mno-vliw-branch
8945
8946 Do not run a pass to pack branches into VLIW instructions.
8947
8948 This switch is mainly for debugging the compiler and will likely be removed
8949 in a future version.
8950
8951 @item -mmulti-cond-exec
8952 @opindex mmulti-cond-exec
8953
8954 Enable optimization of @code{&&} and @code{||} in conditional execution
8955 (default).
8956
8957 This switch is mainly for debugging the compiler and will likely be removed
8958 in a future version.
8959
8960 @item -mno-multi-cond-exec
8961 @opindex mno-multi-cond-exec
8962
8963 Disable optimization of @code{&&} and @code{||} in conditional execution.
8964
8965 This switch is mainly for debugging the compiler and will likely be removed
8966 in a future version.
8967
8968 @item -mnested-cond-exec
8969 @opindex mnested-cond-exec
8970
8971 Enable nested conditional execution optimizations (default).
8972
8973 This switch is mainly for debugging the compiler and will likely be removed
8974 in a future version.
8975
8976 @item -mno-nested-cond-exec
8977 @opindex mno-nested-cond-exec
8978
8979 Disable nested conditional execution optimizations.
8980
8981 This switch is mainly for debugging the compiler and will likely be removed
8982 in a future version.
8983
8984 @item -moptimize-membar
8985 @opindex moptimize-membar
8986
8987 This switch removes redundant @code{membar} instructions from the
8988 compiler generated code.  It is enabled by default.
8989
8990 @item -mno-optimize-membar
8991 @opindex mno-optimize-membar
8992
8993 This switch disables the automatic removal of redundant @code{membar}
8994 instructions from the generated code.
8995
8996 @item -mtomcat-stats
8997 @opindex mtomcat-stats
8998
8999 Cause gas to print out tomcat statistics.
9000
9001 @item -mcpu=@var{cpu}
9002 @opindex mcpu
9003
9004 Select the processor type for which to generate code.  Possible values are
9005 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
9006 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
9007
9008 @end table
9009
9010 @node GNU/Linux Options
9011 @subsection GNU/Linux Options
9012
9013 These @samp{-m} options are defined for GNU/Linux targets:
9014
9015 @table @gcctabopt
9016 @item -mglibc
9017 @opindex mglibc
9018 Use the GNU C library instead of uClibc.  This is the default except
9019 on @samp{*-*-linux-*uclibc*} targets.
9020
9021 @item -muclibc
9022 @opindex muclibc
9023 Use uClibc instead of the GNU C library.  This is the default on
9024 @samp{*-*-linux-*uclibc*} targets.
9025 @end table
9026
9027 @node H8/300 Options
9028 @subsection H8/300 Options
9029
9030 These @samp{-m} options are defined for the H8/300 implementations:
9031
9032 @table @gcctabopt
9033 @item -mrelax
9034 @opindex mrelax
9035 Shorten some address references at link time, when possible; uses the
9036 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
9037 ld, Using ld}, for a fuller description.
9038
9039 @item -mh
9040 @opindex mh
9041 Generate code for the H8/300H@.
9042
9043 @item -ms
9044 @opindex ms
9045 Generate code for the H8S@.
9046
9047 @item -mn
9048 @opindex mn
9049 Generate code for the H8S and H8/300H in the normal mode.  This switch
9050 must be used either with @option{-mh} or @option{-ms}.
9051
9052 @item -ms2600
9053 @opindex ms2600
9054 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
9055
9056 @item -mint32
9057 @opindex mint32
9058 Make @code{int} data 32 bits by default.
9059
9060 @item -malign-300
9061 @opindex malign-300
9062 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
9063 The default for the H8/300H and H8S is to align longs and floats on 4
9064 byte boundaries.
9065 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
9066 This option has no effect on the H8/300.
9067 @end table
9068
9069 @node HPPA Options
9070 @subsection HPPA Options
9071 @cindex HPPA Options
9072
9073 These @samp{-m} options are defined for the HPPA family of computers:
9074
9075 @table @gcctabopt
9076 @item -march=@var{architecture-type}
9077 @opindex march
9078 Generate code for the specified architecture.  The choices for
9079 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
9080 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
9081 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
9082 architecture option for your machine.  Code compiled for lower numbered
9083 architectures will run on higher numbered architectures, but not the
9084 other way around.
9085
9086 @item -mpa-risc-1-0
9087 @itemx -mpa-risc-1-1
9088 @itemx -mpa-risc-2-0
9089 @opindex mpa-risc-1-0
9090 @opindex mpa-risc-1-1
9091 @opindex mpa-risc-2-0
9092 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
9093
9094 @item -mbig-switch
9095 @opindex mbig-switch
9096 Generate code suitable for big switch tables.  Use this option only if
9097 the assembler/linker complain about out of range branches within a switch
9098 table.
9099
9100 @item -mjump-in-delay
9101 @opindex mjump-in-delay
9102 Fill delay slots of function calls with unconditional jump instructions
9103 by modifying the return pointer for the function call to be the target
9104 of the conditional jump.
9105
9106 @item -mdisable-fpregs
9107 @opindex mdisable-fpregs
9108 Prevent floating point registers from being used in any manner.  This is
9109 necessary for compiling kernels which perform lazy context switching of
9110 floating point registers.  If you use this option and attempt to perform
9111 floating point operations, the compiler will abort.
9112
9113 @item -mdisable-indexing
9114 @opindex mdisable-indexing
9115 Prevent the compiler from using indexing address modes.  This avoids some
9116 rather obscure problems when compiling MIG generated code under MACH@.
9117
9118 @item -mno-space-regs
9119 @opindex mno-space-regs
9120 Generate code that assumes the target has no space registers.  This allows
9121 GCC to generate faster indirect calls and use unscaled index address modes.
9122
9123 Such code is suitable for level 0 PA systems and kernels.
9124
9125 @item -mfast-indirect-calls
9126 @opindex mfast-indirect-calls
9127 Generate code that assumes calls never cross space boundaries.  This
9128 allows GCC to emit code which performs faster indirect calls.
9129
9130 This option will not work in the presence of shared libraries or nested
9131 functions.
9132
9133 @item -mfixed-range=@var{register-range}
9134 @opindex mfixed-range
9135 Generate code treating the given register range as fixed registers.
9136 A fixed register is one that the register allocator can not use.  This is
9137 useful when compiling kernel code.  A register range is specified as
9138 two registers separated by a dash.  Multiple register ranges can be
9139 specified separated by a comma.
9140
9141 @item -mlong-load-store
9142 @opindex mlong-load-store
9143 Generate 3-instruction load and store sequences as sometimes required by
9144 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
9145 the HP compilers.
9146
9147 @item -mportable-runtime
9148 @opindex mportable-runtime
9149 Use the portable calling conventions proposed by HP for ELF systems.
9150
9151 @item -mgas
9152 @opindex mgas
9153 Enable the use of assembler directives only GAS understands.
9154
9155 @item -mschedule=@var{cpu-type}
9156 @opindex mschedule
9157 Schedule code according to the constraints for the machine type
9158 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
9159 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
9160 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
9161 proper scheduling option for your machine.  The default scheduling is
9162 @samp{8000}.
9163
9164 @item -mlinker-opt
9165 @opindex mlinker-opt
9166 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
9167 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
9168 linkers in which they give bogus error messages when linking some programs.
9169
9170 @item -msoft-float
9171 @opindex msoft-float
9172 Generate output containing library calls for floating point.
9173 @strong{Warning:} the requisite libraries are not available for all HPPA
9174 targets.  Normally the facilities of the machine's usual C compiler are
9175 used, but this cannot be done directly in cross-compilation.  You must make
9176 your own arrangements to provide suitable library functions for
9177 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
9178 does provide software floating point support.
9179
9180 @option{-msoft-float} changes the calling convention in the output file;
9181 therefore, it is only useful if you compile @emph{all} of a program with
9182 this option.  In particular, you need to compile @file{libgcc.a}, the
9183 library that comes with GCC, with @option{-msoft-float} in order for
9184 this to work.
9185
9186 @item -msio
9187 @opindex msio
9188 Generate the predefine, @code{_SIO}, for server IO@.  The default is
9189 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
9190 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
9191 options are available under HP-UX and HI-UX@.
9192
9193 @item -mgnu-ld
9194 @opindex gnu-ld
9195 Use GNU ld specific options.  This passes @option{-shared} to ld when
9196 building a shared library.  It is the default when GCC is configured,
9197 explicitly or implicitly, with the GNU linker.  This option does not
9198 have any affect on which ld is called, it only changes what parameters
9199 are passed to that ld.  The ld that is called is determined by the
9200 @option{--with-ld} configure option, GCC's program search path, and
9201 finally by the user's @env{PATH}.  The linker used by GCC can be printed
9202 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
9203 on the 64 bit HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9204
9205 @item -mhp-ld
9206 @opindex hp-ld
9207 Use HP ld specific options.  This passes @option{-b} to ld when building
9208 a shared library and passes @option{+Accept TypeMismatch} to ld on all
9209 links.  It is the default when GCC is configured, explicitly or
9210 implicitly, with the HP linker.  This option does not have any affect on
9211 which ld is called, it only changes what parameters are passed to that
9212 ld.  The ld that is called is determined by the @option{--with-ld}
9213 configure option, GCC's program search path, and finally by the user's
9214 @env{PATH}.  The linker used by GCC can be printed using @samp{which
9215 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
9216 HP-UX GCC, i.e. configured with @samp{hppa*64*-*-hpux*}.
9217
9218 @item -mlong-calls
9219 @opindex mno-long-calls
9220 Generate code that uses long call sequences.  This ensures that a call
9221 is always able to reach linker generated stubs.  The default is to generate
9222 long calls only when the distance from the call site to the beginning
9223 of the function or translation unit, as the case may be, exceeds a
9224 predefined limit set by the branch type being used.  The limits for
9225 normal calls are 7,600,000 and 240,000 bytes, respectively for the
9226 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
9227 240,000 bytes.
9228
9229 Distances are measured from the beginning of functions when using the
9230 @option{-ffunction-sections} option, or when using the @option{-mgas}
9231 and @option{-mno-portable-runtime} options together under HP-UX with
9232 the SOM linker.
9233
9234 It is normally not desirable to use this option as it will degrade
9235 performance.  However, it may be useful in large applications,
9236 particularly when partial linking is used to build the application.
9237
9238 The types of long calls used depends on the capabilities of the
9239 assembler and linker, and the type of code being generated.  The
9240 impact on systems that support long absolute calls, and long pic
9241 symbol-difference or pc-relative calls should be relatively small.
9242 However, an indirect call is used on 32-bit ELF systems in pic code
9243 and it is quite long.
9244
9245 @item -munix=@var{unix-std}
9246 @opindex march
9247 Generate compiler predefines and select a startfile for the specified
9248 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
9249 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
9250 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
9251 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
9252 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
9253 and later.
9254
9255 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
9256 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
9257 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
9258 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
9259 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
9260 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
9261
9262 It is @emph{important} to note that this option changes the interfaces
9263 for various library routines.  It also affects the operational behavior
9264 of the C library.  Thus, @emph{extreme} care is needed in using this
9265 option.
9266
9267 Library code that is intended to operate with more than one UNIX
9268 standard must test, set and restore the variable @var{__xpg4_extended_mask}
9269 as appropriate.  Most GNU software doesn't provide this capability.
9270
9271 @item -nolibdld
9272 @opindex nolibdld
9273 Suppress the generation of link options to search libdld.sl when the
9274 @option{-static} option is specified on HP-UX 10 and later.
9275
9276 @item -static
9277 @opindex static
9278 The HP-UX implementation of setlocale in libc has a dependency on
9279 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
9280 when the @option{-static} option is specified, special link options
9281 are needed to resolve this dependency.
9282
9283 On HP-UX 10 and later, the GCC driver adds the necessary options to
9284 link with libdld.sl when the @option{-static} option is specified.
9285 This causes the resulting binary to be dynamic.  On the 64-bit port,
9286 the linkers generate dynamic binaries by default in any case.  The
9287 @option{-nolibdld} option can be used to prevent the GCC driver from
9288 adding these link options.
9289
9290 @item -threads
9291 @opindex threads
9292 Add support for multithreading with the @dfn{dce thread} library
9293 under HP-UX@.  This option sets flags for both the preprocessor and
9294 linker.
9295 @end table
9296
9297 @node i386 and x86-64 Options
9298 @subsection Intel 386 and AMD x86-64 Options
9299 @cindex i386 Options
9300 @cindex x86-64 Options
9301 @cindex Intel 386 Options
9302 @cindex AMD x86-64 Options
9303
9304 These @samp{-m} options are defined for the i386 and x86-64 family of
9305 computers:
9306
9307 @table @gcctabopt
9308 @item -mtune=@var{cpu-type}
9309 @opindex mtune
9310 Tune to @var{cpu-type} everything applicable about the generated code, except
9311 for the ABI and the set of available instructions.  The choices for
9312 @var{cpu-type} are:
9313 @table @emph
9314 @item generic
9315 Produce code optimized for the most common IA32/AMD64/EM64T processors.
9316 If you know the CPU on which your code will run, then you should use
9317 the corresponding @option{-mtune} option instead of
9318 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
9319 of your application will have, then you should use this option.
9320
9321 As new processors are deployed in the marketplace, the behavior of this
9322 option will change.  Therefore, if you upgrade to a newer version of
9323 GCC, the code generated option will change to reflect the processors
9324 that were most common when that version of GCC was released.
9325
9326 There is no @option{-march=generic} option because @option{-march}
9327 indicates the instruction set the compiler can use, and there is no
9328 generic instruction set applicable to all processors.  In contrast,
9329 @option{-mtune} indicates the processor (or, in this case, collection of
9330 processors) for which the code is optimized.
9331 @item native
9332 This selects the CPU to tune for at compilation time by determining
9333 the processor type of the compiling machine.  Using @option{-mtune=native}
9334 will produce code optimized for the local machine under the constraints
9335 of the selected instruction set.  Using @option{-march=native} will
9336 enable all instruction subsets supported by the local machine (hence
9337 the result might not run on different machines).
9338 @item i386
9339 Original Intel's i386 CPU@.
9340 @item i486
9341 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
9342 @item i586, pentium
9343 Intel Pentium CPU with no MMX support.
9344 @item pentium-mmx
9345 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9346 @item pentiumpro
9347 Intel PentiumPro CPU@.
9348 @item i686
9349 Same as @code{generic}, but when used as @code{march} option, PentiumPro
9350 instruction set will be used, so the code will run on all i686 family chips.
9351 @item pentium2
9352 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9353 @item pentium3, pentium3m
9354 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
9355 support.
9356 @item pentium-m
9357 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
9358 support.  Used by Centrino notebooks.
9359 @item pentium4, pentium4m
9360 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9361 @item prescott
9362 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
9363 set support.
9364 @item nocona
9365 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
9366 SSE2 and SSE3 instruction set support.
9367 @item core2
9368 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
9369 instruction set support.
9370 @item k6
9371 AMD K6 CPU with MMX instruction set support.
9372 @item k6-2, k6-3
9373 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9374 @item athlon, athlon-tbird
9375 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions
9376 support.
9377 @item athlon-4, athlon-xp, athlon-mp
9378 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE
9379 instruction set support.
9380 @item k8, opteron, athlon64, athlon-fx
9381 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
9382 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9383 @item winchip-c6
9384 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
9385 set support.
9386 @item winchip2
9387 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!
9388 instruction set support.
9389 @item c3
9390 Via C3 CPU with MMX and 3dNOW! instruction set support.  (No scheduling is
9391 implemented for this chip.)
9392 @item c3-2
9393 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
9394 implemented for this chip.)
9395 @item geode
9396 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
9397 @end table
9398
9399 While picking a specific @var{cpu-type} will schedule things appropriately
9400 for that particular chip, the compiler will not generate any code that
9401 does not run on the i386 without the @option{-march=@var{cpu-type}} option
9402 being used.
9403
9404 @item -march=@var{cpu-type}
9405 @opindex march
9406 Generate instructions for the machine type @var{cpu-type}.  The choices
9407 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
9408 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
9409
9410 @item -mcpu=@var{cpu-type}
9411 @opindex mcpu
9412 A deprecated synonym for @option{-mtune}.
9413
9414 @item -m386
9415 @itemx -m486
9416 @itemx -mpentium
9417 @itemx -mpentiumpro
9418 @opindex m386
9419 @opindex m486
9420 @opindex mpentium
9421 @opindex mpentiumpro
9422 These options are synonyms for @option{-mtune=i386}, @option{-mtune=i486},
9423 @option{-mtune=pentium}, and @option{-mtune=pentiumpro} respectively.
9424 These synonyms are deprecated.
9425
9426 @item -mfpmath=@var{unit}
9427 @opindex march
9428 Generate floating point arithmetics for selected unit @var{unit}.  The choices
9429 for @var{unit} are:
9430
9431 @table @samp
9432 @item 387
9433 Use the standard 387 floating point coprocessor present majority of chips and
9434 emulated otherwise.  Code compiled with this option will run almost everywhere.
9435 The temporary results are computed in 80bit precision instead of precision
9436 specified by the type resulting in slightly different results compared to most
9437 of other chips.  See @option{-ffloat-store} for more detailed description.
9438
9439 This is the default choice for i386 compiler.
9440
9441 @item sse
9442 Use scalar floating point instructions present in the SSE instruction set.
9443 This instruction set is supported by Pentium3 and newer chips, in the AMD line
9444 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
9445 instruction set supports only single precision arithmetics, thus the double and
9446 extended precision arithmetics is still done using 387.  Later version, present
9447 only in Pentium4 and the future AMD x86-64 chips supports double precision
9448 arithmetics too.
9449
9450 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
9451 or @option{-msse2} switches to enable SSE extensions and make this option
9452 effective.  For the x86-64 compiler, these extensions are enabled by default.
9453
9454 The resulting code should be considerably faster in the majority of cases and avoid
9455 the numerical instability problems of 387 code, but may break some existing
9456 code that expects temporaries to be 80bit.
9457
9458 This is the default choice for the x86-64 compiler.
9459
9460 @item sse,387
9461 Attempt to utilize both instruction sets at once.  This effectively double the
9462 amount of available registers and on chips with separate execution units for
9463 387 and SSE the execution resources too.  Use this option with care, as it is
9464 still experimental, because the GCC register allocator does not model separate
9465 functional units well resulting in instable performance.
9466 @end table
9467
9468 @item -masm=@var{dialect}
9469 @opindex masm=@var{dialect}
9470 Output asm instructions using selected @var{dialect}.  Supported
9471 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
9472 not support @samp{intel}.
9473
9474 @item -mieee-fp
9475 @itemx -mno-ieee-fp
9476 @opindex mieee-fp
9477 @opindex mno-ieee-fp
9478 Control whether or not the compiler uses IEEE floating point
9479 comparisons.  These handle correctly the case where the result of a
9480 comparison is unordered.
9481
9482 @item -msoft-float
9483 @opindex msoft-float
9484 Generate output containing library calls for floating point.
9485 @strong{Warning:} the requisite libraries are not part of GCC@.
9486 Normally the facilities of the machine's usual C compiler are used, but
9487 this can't be done directly in cross-compilation.  You must make your
9488 own arrangements to provide suitable library functions for
9489 cross-compilation.
9490
9491 On machines where a function returns floating point results in the 80387
9492 register stack, some floating point opcodes may be emitted even if
9493 @option{-msoft-float} is used.
9494
9495 @item -mno-fp-ret-in-387
9496 @opindex mno-fp-ret-in-387
9497 Do not use the FPU registers for return values of functions.
9498
9499 The usual calling convention has functions return values of types
9500 @code{float} and @code{double} in an FPU register, even if there
9501 is no FPU@.  The idea is that the operating system should emulate
9502 an FPU@.
9503
9504 The option @option{-mno-fp-ret-in-387} causes such values to be returned
9505 in ordinary CPU registers instead.
9506
9507 @item -mno-fancy-math-387
9508 @opindex mno-fancy-math-387
9509 Some 387 emulators do not support the @code{sin}, @code{cos} and
9510 @code{sqrt} instructions for the 387.  Specify this option to avoid
9511 generating those instructions.  This option is the default on FreeBSD,
9512 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
9513 indicates that the target cpu will always have an FPU and so the
9514 instruction will not need emulation.  As of revision 2.6.1, these
9515 instructions are not generated unless you also use the
9516 @option{-funsafe-math-optimizations} switch.
9517
9518 @item -malign-double
9519 @itemx -mno-align-double
9520 @opindex malign-double
9521 @opindex mno-align-double
9522 Control whether GCC aligns @code{double}, @code{long double}, and
9523 @code{long long} variables on a two word boundary or a one word
9524 boundary.  Aligning @code{double} variables on a two word boundary will
9525 produce code that runs somewhat faster on a @samp{Pentium} at the
9526 expense of more memory.
9527
9528 On x86-64, @option{-malign-double} is enabled by default.
9529
9530 @strong{Warning:} if you use the @option{-malign-double} switch,
9531 structures containing the above types will be aligned differently than
9532 the published application binary interface specifications for the 386
9533 and will not be binary compatible with structures in code compiled
9534 without that switch.
9535
9536 @item -m96bit-long-double
9537 @itemx -m128bit-long-double
9538 @opindex m96bit-long-double
9539 @opindex m128bit-long-double
9540 These switches control the size of @code{long double} type.  The i386
9541 application binary interface specifies the size to be 96 bits,
9542 so @option{-m96bit-long-double} is the default in 32 bit mode.
9543
9544 Modern architectures (Pentium and newer) would prefer @code{long double}
9545 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
9546 conforming to the ABI, this would not be possible.  So specifying a
9547 @option{-m128bit-long-double} will align @code{long double}
9548 to a 16 byte boundary by padding the @code{long double} with an additional
9549 32 bit zero.
9550
9551 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
9552 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
9553
9554 Notice that neither of these options enable any extra precision over the x87
9555 standard of 80 bits for a @code{long double}.
9556
9557 @strong{Warning:} if you override the default value for your target ABI, the
9558 structures and arrays containing @code{long double} variables will change
9559 their size as well as function calling convention for function taking
9560 @code{long double} will be modified.  Hence they will not be binary
9561 compatible with arrays or structures in code compiled without that switch.
9562
9563 @item -mmlarge-data-threshold=@var{number}
9564 @opindex mlarge-data-threshold=@var{number}
9565 When @option{-mcmodel=medium} is specified, the data greater than
9566 @var{threshold} are placed in large data section.  This value must be the
9567 same across all object linked into the binary and defaults to 65535.
9568
9569 @item -msvr3-shlib
9570 @itemx -mno-svr3-shlib
9571 @opindex msvr3-shlib
9572 @opindex mno-svr3-shlib
9573 Control whether GCC places uninitialized local variables into the
9574 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
9575 into @code{bss}.  These options are meaningful only on System V Release 3.
9576
9577 @item -mrtd
9578 @opindex mrtd
9579 Use a different function-calling convention, in which functions that
9580 take a fixed number of arguments return with the @code{ret} @var{num}
9581 instruction, which pops their arguments while returning.  This saves one
9582 instruction in the caller since there is no need to pop the arguments
9583 there.
9584
9585 You can specify that an individual function is called with this calling
9586 sequence with the function attribute @samp{stdcall}.  You can also
9587 override the @option{-mrtd} option by using the function attribute
9588 @samp{cdecl}.  @xref{Function Attributes}.
9589
9590 @strong{Warning:} this calling convention is incompatible with the one
9591 normally used on Unix, so you cannot use it if you need to call
9592 libraries compiled with the Unix compiler.
9593
9594 Also, you must provide function prototypes for all functions that
9595 take variable numbers of arguments (including @code{printf});
9596 otherwise incorrect code will be generated for calls to those
9597 functions.
9598
9599 In addition, seriously incorrect code will result if you call a
9600 function with too many arguments.  (Normally, extra arguments are
9601 harmlessly ignored.)
9602
9603 @item -mregparm=@var{num}
9604 @opindex mregparm
9605 Control how many registers are used to pass integer arguments.  By
9606 default, no registers are used to pass arguments, and at most 3
9607 registers can be used.  You can control this behavior for a specific
9608 function by using the function attribute @samp{regparm}.
9609 @xref{Function Attributes}.
9610
9611 @strong{Warning:} if you use this switch, and
9612 @var{num} is nonzero, then you must build all modules with the same
9613 value, including any libraries.  This includes the system libraries and
9614 startup modules.
9615
9616 @item -msseregparm
9617 @opindex msseregparm
9618 Use SSE register passing conventions for float and double arguments
9619 and return values.  You can control this behavior for a specific
9620 function by using the function attribute @samp{sseregparm}.
9621 @xref{Function Attributes}.
9622
9623 @strong{Warning:} if you use this switch then you must build all
9624 modules with the same value, including any libraries.  This includes
9625 the system libraries and startup modules.
9626
9627 @item -mstackrealign
9628 @opindex mstackrealign
9629 Realign the stack at entry.  On the Intel x86, the
9630 @option{-mstackrealign} option will generate an alternate prologue and
9631 epilogue that realigns the runtime stack.  This supports mixing legacy
9632 codes that keep a 4-byte aligned stack with modern codes that keep a
9633 16-byte stack for SSE compatibility.  The alternate prologue and
9634 epilogue are slower and bigger than the regular ones, and the
9635 alternate prologue requires an extra scratch register; this lowers the
9636 number of registers available if used in conjunction with the
9637 @code{regparm} attribute.  The @option{-mstackrealign} option is
9638 incompatible with the nested function prologue; this is considered a
9639 hard error.  See also the attribute @code{force_align_arg_pointer},
9640 applicable to individual functions.
9641
9642 @item -mpreferred-stack-boundary=@var{num}
9643 @opindex mpreferred-stack-boundary
9644 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
9645 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
9646 the default is 4 (16 bytes or 128 bits).
9647
9648 On Pentium and PentiumPro, @code{double} and @code{long double} values
9649 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
9650 suffer significant run time performance penalties.  On Pentium III, the
9651 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
9652 properly if it is not 16 byte aligned.
9653
9654 To ensure proper alignment of this values on the stack, the stack boundary
9655 must be as aligned as that required by any value stored on the stack.
9656 Further, every function must be generated such that it keeps the stack
9657 aligned.  Thus calling a function compiled with a higher preferred
9658 stack boundary from a function compiled with a lower preferred stack
9659 boundary will most likely misalign the stack.  It is recommended that
9660 libraries that use callbacks always use the default setting.
9661
9662 This extra alignment does consume extra stack space, and generally
9663 increases code size.  Code that is sensitive to stack space usage, such
9664 as embedded systems and operating system kernels, may want to reduce the
9665 preferred alignment to @option{-mpreferred-stack-boundary=2}.
9666
9667 @item -mmmx
9668 @itemx -mno-mmx
9669 @item -msse
9670 @itemx -mno-sse
9671 @item -msse2
9672 @itemx -mno-sse2
9673 @item -msse3
9674 @itemx -mno-sse3
9675 @item -mssse3
9676 @itemx -mno-ssse3
9677 @item -m3dnow
9678 @itemx -mno-3dnow
9679 @opindex mmmx
9680 @opindex mno-mmx
9681 @opindex msse
9682 @opindex mno-sse
9683 @opindex m3dnow
9684 @opindex mno-3dnow
9685 These switches enable or disable the use of instructions in the MMX,
9686 SSE, SSE2, SSE3, SSSE3 or 3DNow! extended instruction sets.
9687 These extensions are also available as built-in functions: see
9688 @ref{X86 Built-in Functions}, for details of the functions enabled and
9689 disabled by these switches.
9690
9691 To have SSE/SSE2 instructions generated automatically from floating-point
9692 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
9693
9694 These options will enable GCC to use these extended instructions in
9695 generated code, even without @option{-mfpmath=sse}.  Applications which
9696 perform runtime CPU detection must compile separate files for each
9697 supported architecture, using the appropriate flags.  In particular,
9698 the file containing the CPU detection code should be compiled without
9699 these options.
9700
9701 @item -mpush-args
9702 @itemx -mno-push-args
9703 @opindex mpush-args
9704 @opindex mno-push-args
9705 Use PUSH operations to store outgoing parameters.  This method is shorter
9706 and usually equally fast as method using SUB/MOV operations and is enabled
9707 by default.  In some cases disabling it may improve performance because of
9708 improved scheduling and reduced dependencies.
9709
9710 @item -maccumulate-outgoing-args
9711 @opindex maccumulate-outgoing-args
9712 If enabled, the maximum amount of space required for outgoing arguments will be
9713 computed in the function prologue.  This is faster on most modern CPUs
9714 because of reduced dependencies, improved scheduling and reduced stack usage
9715 when preferred stack boundary is not equal to 2.  The drawback is a notable
9716 increase in code size.  This switch implies @option{-mno-push-args}.
9717
9718 @item -mthreads
9719 @opindex mthreads
9720 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
9721 on thread-safe exception handling must compile and link all code with the
9722 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
9723 @option{-D_MT}; when linking, it links in a special thread helper library
9724 @option{-lmingwthrd} which cleans up per thread exception handling data.
9725
9726 @item -mno-align-stringops
9727 @opindex mno-align-stringops
9728 Do not align destination of inlined string operations.  This switch reduces
9729 code size and improves performance in case the destination is already aligned,
9730 but GCC doesn't know about it.
9731
9732 @item -minline-all-stringops
9733 @opindex minline-all-stringops
9734 By default GCC inlines string operations only when destination is known to be
9735 aligned at least to 4 byte boundary.  This enables more inlining, increase code
9736 size, but may improve performance of code that depends on fast memcpy, strlen
9737 and memset for short lengths.
9738
9739 @item -minline-stringops-dynamically
9740 @opindex minline-stringops-dynamically
9741 For string operation of unknown size, inline runtime checks so for small
9742 blocks inline code is used, while for large blocks library call is used.
9743
9744 @item -mstringop-strategy=@var{alg}
9745 @opindex mstringop-strategy=@var{alg}
9746 Overwrite internal decision heuristic about particular algorithm to inline
9747 string operation with.  The allowed values are @code{rep_byte},
9748 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
9749 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
9750 expanding inline loop, @code{libcall} for always expanding library call.
9751
9752 @item -momit-leaf-frame-pointer
9753 @opindex momit-leaf-frame-pointer
9754 Don't keep the frame pointer in a register for leaf functions.  This
9755 avoids the instructions to save, set up and restore frame pointers and
9756 makes an extra register available in leaf functions.  The option
9757 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9758 which might make debugging harder.
9759
9760 @item -mtls-direct-seg-refs
9761 @itemx -mno-tls-direct-seg-refs
9762 @opindex mtls-direct-seg-refs
9763 Controls whether TLS variables may be accessed with offsets from the
9764 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
9765 or whether the thread base pointer must be added.  Whether or not this
9766 is legal depends on the operating system, and whether it maps the
9767 segment to cover the entire TLS area.
9768
9769 For systems that use GNU libc, the default is on.
9770 @end table
9771
9772 These @samp{-m} switches are supported in addition to the above
9773 on AMD x86-64 processors in 64-bit environments.
9774
9775 @table @gcctabopt
9776 @item -m32
9777 @itemx -m64
9778 @opindex m32
9779 @opindex m64
9780 Generate code for a 32-bit or 64-bit environment.
9781 The 32-bit environment sets int, long and pointer to 32 bits and
9782 generates code that runs on any i386 system.
9783 The 64-bit environment sets int to 32 bits and long and pointer
9784 to 64 bits and generates code for AMD's x86-64 architecture.
9785
9786 @item -mno-red-zone
9787 @opindex no-red-zone
9788 Do not use a so called red zone for x86-64 code.  The red zone is mandated
9789 by the x86-64 ABI, it is a 128-byte area beyond the location of the
9790 stack pointer that will not be modified by signal or interrupt handlers
9791 and therefore can be used for temporary data without adjusting the stack
9792 pointer.  The flag @option{-mno-red-zone} disables this red zone.
9793
9794 @item -mcmodel=small
9795 @opindex mcmodel=small
9796 Generate code for the small code model: the program and its symbols must
9797 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
9798 Programs can be statically or dynamically linked.  This is the default
9799 code model.
9800
9801 @item -mcmodel=kernel
9802 @opindex mcmodel=kernel
9803 Generate code for the kernel code model.  The kernel runs in the
9804 negative 2 GB of the address space.
9805 This model has to be used for Linux kernel code.
9806
9807 @item -mcmodel=medium
9808 @opindex mcmodel=medium
9809 Generate code for the medium model: The program is linked in the lower 2
9810 GB of the address space but symbols can be located anywhere in the
9811 address space.  Programs can be statically or dynamically linked, but
9812 building of shared libraries are not supported with the medium model.
9813
9814 @item -mcmodel=large
9815 @opindex mcmodel=large
9816 Generate code for the large model: This model makes no assumptions
9817 about addresses and sizes of sections.  Currently GCC does not implement
9818 this model.
9819 @end table
9820
9821 @node IA-64 Options
9822 @subsection IA-64 Options
9823 @cindex IA-64 Options
9824
9825 These are the @samp{-m} options defined for the Intel IA-64 architecture.
9826
9827 @table @gcctabopt
9828 @item -mbig-endian
9829 @opindex mbig-endian
9830 Generate code for a big endian target.  This is the default for HP-UX@.
9831
9832 @item -mlittle-endian
9833 @opindex mlittle-endian
9834 Generate code for a little endian target.  This is the default for AIX5
9835 and GNU/Linux.
9836
9837 @item -mgnu-as
9838 @itemx -mno-gnu-as
9839 @opindex mgnu-as
9840 @opindex mno-gnu-as
9841 Generate (or don't) code for the GNU assembler.  This is the default.
9842 @c Also, this is the default if the configure option @option{--with-gnu-as}
9843 @c is used.
9844
9845 @item -mgnu-ld
9846 @itemx -mno-gnu-ld
9847 @opindex mgnu-ld
9848 @opindex mno-gnu-ld
9849 Generate (or don't) code for the GNU linker.  This is the default.
9850 @c Also, this is the default if the configure option @option{--with-gnu-ld}
9851 @c is used.
9852
9853 @item -mno-pic
9854 @opindex mno-pic
9855 Generate code that does not use a global pointer register.  The result
9856 is not position independent code, and violates the IA-64 ABI@.
9857
9858 @item -mvolatile-asm-stop
9859 @itemx -mno-volatile-asm-stop
9860 @opindex mvolatile-asm-stop
9861 @opindex mno-volatile-asm-stop
9862 Generate (or don't) a stop bit immediately before and after volatile asm
9863 statements.
9864
9865 @item -mregister-names
9866 @itemx -mno-register-names
9867 @opindex mregister-names
9868 @opindex mno-register-names
9869 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
9870 the stacked registers.  This may make assembler output more readable.
9871
9872 @item -mno-sdata
9873 @itemx -msdata
9874 @opindex mno-sdata
9875 @opindex msdata
9876 Disable (or enable) optimizations that use the small data section.  This may
9877 be useful for working around optimizer bugs.
9878
9879 @item -mconstant-gp
9880 @opindex mconstant-gp
9881 Generate code that uses a single constant global pointer value.  This is
9882 useful when compiling kernel code.
9883
9884 @item -mauto-pic
9885 @opindex mauto-pic
9886 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
9887 This is useful when compiling firmware code.
9888
9889 @item -minline-float-divide-min-latency
9890 @opindex minline-float-divide-min-latency
9891 Generate code for inline divides of floating point values
9892 using the minimum latency algorithm.
9893
9894 @item -minline-float-divide-max-throughput
9895 @opindex minline-float-divide-max-throughput
9896 Generate code for inline divides of floating point values
9897 using the maximum throughput algorithm.
9898
9899 @item -minline-int-divide-min-latency
9900 @opindex minline-int-divide-min-latency
9901 Generate code for inline divides of integer values
9902 using the minimum latency algorithm.
9903
9904 @item -minline-int-divide-max-throughput
9905 @opindex minline-int-divide-max-throughput
9906 Generate code for inline divides of integer values
9907 using the maximum throughput algorithm.
9908
9909 @item -minline-sqrt-min-latency
9910 @opindex minline-sqrt-min-latency
9911 Generate code for inline square roots
9912 using the minimum latency algorithm.
9913
9914 @item -minline-sqrt-max-throughput
9915 @opindex minline-sqrt-max-throughput
9916 Generate code for inline square roots
9917 using the maximum throughput algorithm.
9918
9919 @item -mno-dwarf2-asm
9920 @itemx -mdwarf2-asm
9921 @opindex mno-dwarf2-asm
9922 @opindex mdwarf2-asm
9923 Don't (or do) generate assembler code for the DWARF2 line number debugging
9924 info.  This may be useful when not using the GNU assembler.
9925
9926 @item -mearly-stop-bits
9927 @itemx -mno-early-stop-bits
9928 @opindex mearly-stop-bits
9929 @opindex mno-early-stop-bits
9930 Allow stop bits to be placed earlier than immediately preceding the
9931 instruction that triggered the stop bit.  This can improve instruction
9932 scheduling, but does not always do so.
9933
9934 @item -mfixed-range=@var{register-range}
9935 @opindex mfixed-range
9936 Generate code treating the given register range as fixed registers.
9937 A fixed register is one that the register allocator can not use.  This is
9938 useful when compiling kernel code.  A register range is specified as
9939 two registers separated by a dash.  Multiple register ranges can be
9940 specified separated by a comma.
9941
9942 @item -mtls-size=@var{tls-size}
9943 @opindex mtls-size
9944 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
9945 64.
9946
9947 @item -mtune=@var{cpu-type}
9948 @opindex mtune
9949 Tune the instruction scheduling for a particular CPU, Valid values are
9950 itanium, itanium1, merced, itanium2, and mckinley.
9951
9952 @item -mt
9953 @itemx -pthread
9954 @opindex mt
9955 @opindex pthread
9956 Add support for multithreading using the POSIX threads library.  This
9957 option sets flags for both the preprocessor and linker.  It does
9958 not affect the thread safety of object code produced by the compiler or
9959 that of libraries supplied with it.  These are HP-UX specific flags.
9960
9961 @item -milp32
9962 @itemx -mlp64
9963 @opindex milp32
9964 @opindex mlp64
9965 Generate code for a 32-bit or 64-bit environment.
9966 The 32-bit environment sets int, long and pointer to 32 bits.
9967 The 64-bit environment sets int to 32 bits and long and pointer
9968 to 64 bits.  These are HP-UX specific flags.
9969
9970 @item -mno-sched-br-data-spec
9971 @itemx -msched-br-data-spec
9972 @opindex -mno-sched-br-data-spec
9973 @opindex -msched-br-data-spec
9974 (Dis/En)able data speculative scheduling before reload.
9975 This will result in generation of the ld.a instructions and
9976 the corresponding check instructions (ld.c / chk.a).
9977 The default is 'disable'.
9978
9979 @item -msched-ar-data-spec
9980 @itemx -mno-sched-ar-data-spec
9981 @opindex -msched-ar-data-spec
9982 @opindex -mno-sched-ar-data-spec
9983 (En/Dis)able data speculative scheduling after reload.
9984 This will result in generation of the ld.a instructions and
9985 the corresponding check instructions (ld.c / chk.a).
9986 The default is 'enable'.
9987
9988 @item -mno-sched-control-spec
9989 @itemx -msched-control-spec
9990 @opindex -mno-sched-control-spec
9991 @opindex -msched-control-spec
9992 (Dis/En)able control speculative scheduling.  This feature is
9993 available only during region scheduling (i.e. before reload).
9994 This will result in generation of the ld.s instructions and
9995 the corresponding check instructions chk.s .
9996 The default is 'disable'.
9997
9998 @item -msched-br-in-data-spec
9999 @itemx -mno-sched-br-in-data-spec
10000 @opindex -msched-br-in-data-spec
10001 @opindex -mno-sched-br-in-data-spec
10002 (En/Dis)able speculative scheduling of the instructions that
10003 are dependent on the data speculative loads before reload.
10004 This is effective only with @option{-msched-br-data-spec} enabled.
10005 The default is 'enable'.
10006
10007 @item -msched-ar-in-data-spec
10008 @itemx -mno-sched-ar-in-data-spec
10009 @opindex -msched-ar-in-data-spec
10010 @opindex -mno-sched-ar-in-data-spec
10011 (En/Dis)able speculative scheduling of the instructions that
10012 are dependent on the data speculative loads after reload.
10013 This is effective only with @option{-msched-ar-data-spec} enabled.
10014 The default is 'enable'.
10015
10016 @item -msched-in-control-spec
10017 @itemx -mno-sched-in-control-spec
10018 @opindex -msched-in-control-spec
10019 @opindex -mno-sched-in-control-spec
10020 (En/Dis)able speculative scheduling of the instructions that
10021 are dependent on the control speculative loads.
10022 This is effective only with @option{-msched-control-spec} enabled.
10023 The default is 'enable'.
10024
10025 @item -msched-ldc
10026 @itemx -mno-sched-ldc
10027 @opindex -msched-ldc
10028 @opindex -mno-sched-ldc
10029 (En/Dis)able use of simple data speculation checks ld.c .
10030 If disabled, only chk.a instructions will be emitted to check
10031 data speculative loads.
10032 The default is 'enable'.
10033
10034 @item -mno-sched-control-ldc
10035 @itemx -msched-control-ldc
10036 @opindex -mno-sched-control-ldc
10037 @opindex -msched-control-ldc 
10038 (Dis/En)able use of ld.c instructions to check control speculative loads.
10039 If enabled, in case of control speculative load with no speculatively
10040 scheduled dependent instructions this load will be emitted as ld.sa and
10041 ld.c will be used to check it.
10042 The default is 'disable'.
10043
10044 @item -mno-sched-spec-verbose
10045 @itemx -msched-spec-verbose
10046 @opindex -mno-sched-spec-verbose
10047 @opindex -msched-spec-verbose
10048 (Dis/En)able printing of the information about speculative motions.
10049
10050 @item -mno-sched-prefer-non-data-spec-insns
10051 @itemx -msched-prefer-non-data-spec-insns
10052 @opindex -mno-sched-prefer-non-data-spec-insns
10053 @opindex -msched-prefer-non-data-spec-insns
10054 If enabled, data speculative instructions will be chosen for schedule
10055 only if there are no other choices at the moment.  This will make
10056 the use of the data speculation much more conservative.
10057 The default is 'disable'.
10058
10059 @item -mno-sched-prefer-non-control-spec-insns
10060 @itemx -msched-prefer-non-control-spec-insns
10061 @opindex -mno-sched-prefer-non-control-spec-insns
10062 @opindex -msched-prefer-non-control-spec-insns
10063 If enabled, control speculative instructions will be chosen for schedule
10064 only if there are no other choices at the moment.  This will make
10065 the use of the control speculation much more conservative.
10066 The default is 'disable'.
10067
10068 @item -mno-sched-count-spec-in-critical-path
10069 @itemx -msched-count-spec-in-critical-path
10070 @opindex -mno-sched-count-spec-in-critical-path
10071 @opindex -msched-count-spec-in-critical-path
10072 If enabled, speculative dependencies will be considered during
10073 computation of the instructions priorities.  This will make the use of the
10074 speculation a bit more conservative.
10075 The default is 'disable'.
10076
10077 @end table
10078
10079 @node M32C Options
10080 @subsection M32C Options
10081 @cindex M32C options
10082
10083 @table @gcctabopt
10084 @item -mcpu=@var{name}
10085 @opindex mcpu=
10086 Select the CPU for which code is generated.  @var{name} may be one of
10087 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
10088 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
10089 the M32C/80 series.
10090
10091 @item -msim
10092 @opindex msim
10093 Specifies that the program will be run on the simulator.  This causes
10094 an alternate runtime library to be linked in which supports, for
10095 example, file I/O.  You must not use this option when generating
10096 programs that will run on real hardware; you must provide your own
10097 runtime library for whatever I/O functions are needed.
10098
10099 @item -memregs=@var{number}
10100 @opindex memregs=
10101 Specifies the number of memory-based pseudo-registers GCC will use
10102 during code generation.  These pseudo-registers will be used like real
10103 registers, so there is a tradeoff between GCC's ability to fit the
10104 code into available registers, and the performance penalty of using
10105 memory instead of registers.  Note that all modules in a program must
10106 be compiled with the same value for this option.  Because of that, you
10107 must not use this option with the default runtime libraries gcc
10108 builds.
10109
10110 @end table
10111
10112 @node M32R/D Options
10113 @subsection M32R/D Options
10114 @cindex M32R/D options
10115
10116 These @option{-m} options are defined for Renesas M32R/D architectures:
10117
10118 @table @gcctabopt
10119 @item -m32r2
10120 @opindex m32r2
10121 Generate code for the M32R/2@.
10122
10123 @item -m32rx
10124 @opindex m32rx
10125 Generate code for the M32R/X@.
10126
10127 @item -m32r
10128 @opindex m32r
10129 Generate code for the M32R@.  This is the default.
10130
10131 @item -mmodel=small
10132 @opindex mmodel=small
10133 Assume all objects live in the lower 16MB of memory (so that their addresses
10134 can be loaded with the @code{ld24} instruction), and assume all subroutines
10135 are reachable with the @code{bl} instruction.
10136 This is the default.
10137
10138 The addressability of a particular object can be set with the
10139 @code{model} attribute.
10140
10141 @item -mmodel=medium
10142 @opindex mmodel=medium
10143 Assume objects may be anywhere in the 32-bit address space (the compiler
10144 will generate @code{seth/add3} instructions to load their addresses), and
10145 assume all subroutines are reachable with the @code{bl} instruction.
10146
10147 @item -mmodel=large
10148 @opindex mmodel=large
10149 Assume objects may be anywhere in the 32-bit address space (the compiler
10150 will generate @code{seth/add3} instructions to load their addresses), and
10151 assume subroutines may not be reachable with the @code{bl} instruction
10152 (the compiler will generate the much slower @code{seth/add3/jl}
10153 instruction sequence).
10154
10155 @item -msdata=none
10156 @opindex msdata=none
10157 Disable use of the small data area.  Variables will be put into
10158 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
10159 @code{section} attribute has been specified).
10160 This is the default.
10161
10162 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
10163 Objects may be explicitly put in the small data area with the
10164 @code{section} attribute using one of these sections.
10165
10166 @item -msdata=sdata
10167 @opindex msdata=sdata
10168 Put small global and static data in the small data area, but do not
10169 generate special code to reference them.
10170
10171 @item -msdata=use
10172 @opindex msdata=use
10173 Put small global and static data in the small data area, and generate
10174 special instructions to reference them.
10175
10176 @item -G @var{num}
10177 @opindex G
10178 @cindex smaller data references
10179 Put global and static objects less than or equal to @var{num} bytes
10180 into the small data or bss sections instead of the normal data or bss
10181 sections.  The default value of @var{num} is 8.
10182 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
10183 for this option to have any effect.
10184
10185 All modules should be compiled with the same @option{-G @var{num}} value.
10186 Compiling with different values of @var{num} may or may not work; if it
10187 doesn't the linker will give an error message---incorrect code will not be
10188 generated.
10189
10190 @item -mdebug
10191 @opindex mdebug
10192 Makes the M32R specific code in the compiler display some statistics
10193 that might help in debugging programs.
10194
10195 @item -malign-loops
10196 @opindex malign-loops
10197 Align all loops to a 32-byte boundary.
10198
10199 @item -mno-align-loops
10200 @opindex mno-align-loops
10201 Do not enforce a 32-byte alignment for loops.  This is the default.
10202
10203 @item -missue-rate=@var{number}
10204 @opindex missue-rate=@var{number}
10205 Issue @var{number} instructions per cycle.  @var{number} can only be 1
10206 or 2.
10207
10208 @item -mbranch-cost=@var{number}
10209 @opindex mbranch-cost=@var{number}
10210 @var{number} can only be 1 or 2.  If it is 1 then branches will be
10211 preferred over conditional code, if it is 2, then the opposite will
10212 apply.
10213
10214 @item -mflush-trap=@var{number}
10215 @opindex mflush-trap=@var{number}
10216 Specifies the trap number to use to flush the cache.  The default is
10217 12.  Valid numbers are between 0 and 15 inclusive.
10218
10219 @item -mno-flush-trap
10220 @opindex mno-flush-trap
10221 Specifies that the cache cannot be flushed by using a trap.
10222
10223 @item -mflush-func=@var{name}
10224 @opindex mflush-func=@var{name}
10225 Specifies the name of the operating system function to call to flush
10226 the cache.  The default is @emph{_flush_cache}, but a function call
10227 will only be used if a trap is not available.
10228
10229 @item -mno-flush-func
10230 @opindex mno-flush-func
10231 Indicates that there is no OS function for flushing the cache.
10232
10233 @end table
10234
10235 @node M680x0 Options
10236 @subsection M680x0 Options
10237 @cindex M680x0 options
10238
10239 These are the @samp{-m} options defined for the 68000 series.  The default
10240 values for these options depends on which style of 68000 was selected when
10241 the compiler was configured; the defaults for the most common choices are
10242 given below.
10243
10244 @table @gcctabopt
10245 @item -m68000
10246 @itemx -mc68000
10247 @opindex m68000
10248 @opindex mc68000
10249 Generate output for a 68000.  This is the default
10250 when the compiler is configured for 68000-based systems.
10251
10252 Use this option for microcontrollers with a 68000 or EC000 core,
10253 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
10254
10255 @item -m68020
10256 @itemx -mc68020
10257 @opindex m68020
10258 @opindex mc68020
10259 Generate output for a 68020.  This is the default
10260 when the compiler is configured for 68020-based systems.
10261
10262 @item -m68881
10263 @opindex m68881
10264 Generate output containing 68881 instructions for floating point.
10265 This is the default for most 68020 systems unless @option{--nfp} was
10266 specified when the compiler was configured.
10267
10268 @item -m68030
10269 @opindex m68030
10270 Generate output for a 68030.  This is the default when the compiler is
10271 configured for 68030-based systems.
10272
10273 @item -m68040
10274 @opindex m68040
10275 Generate output for a 68040.  This is the default when the compiler is
10276 configured for 68040-based systems.
10277
10278 This option inhibits the use of 68881/68882 instructions that have to be
10279 emulated by software on the 68040.  Use this option if your 68040 does not
10280 have code to emulate those instructions.
10281
10282 @item -m68060
10283 @opindex m68060
10284 Generate output for a 68060.  This is the default when the compiler is
10285 configured for 68060-based systems.
10286
10287 This option inhibits the use of 68020 and 68881/68882 instructions that
10288 have to be emulated by software on the 68060.  Use this option if your 68060
10289 does not have code to emulate those instructions.
10290
10291 @item -mcpu32
10292 @opindex mcpu32
10293 Generate output for a CPU32.  This is the default
10294 when the compiler is configured for CPU32-based systems.
10295
10296 Use this option for microcontrollers with a
10297 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
10298 68336, 68340, 68341, 68349 and 68360.
10299
10300 @item -m5200
10301 @opindex m5200
10302 Generate output for a 520X ``coldfire'' family cpu.  This is the default
10303 when the compiler is configured for 520X-based systems.
10304
10305 Use this option for microcontroller with a 5200 core, including
10306 the MCF5202, MCF5203, MCF5204 and MCF5202.
10307
10308 @item -mcfv4e
10309 @opindex mcfv4e
10310 Generate output for a ColdFire V4e family cpu (e.g.@: 547x/548x).
10311 This includes use of hardware floating point instructions.
10312
10313 @item -m68020-40
10314 @opindex m68020-40
10315 Generate output for a 68040, without using any of the new instructions.
10316 This results in code which can run relatively efficiently on either a
10317 68020/68881 or a 68030 or a 68040.  The generated code does use the
10318 68881 instructions that are emulated on the 68040.
10319
10320 @item -m68020-60
10321 @opindex m68020-60
10322 Generate output for a 68060, without using any of the new instructions.
10323 This results in code which can run relatively efficiently on either a
10324 68020/68881 or a 68030 or a 68040.  The generated code does use the
10325 68881 instructions that are emulated on the 68060.
10326
10327 @item -msoft-float
10328 @opindex msoft-float
10329 Generate output containing library calls for floating point.
10330 @strong{Warning:} the requisite libraries are not available for all m68k
10331 targets.  Normally the facilities of the machine's usual C compiler are
10332 used, but this can't be done directly in cross-compilation.  You must
10333 make your own arrangements to provide suitable library functions for
10334 cross-compilation.  The embedded targets @samp{m68k-*-aout} and
10335 @samp{m68k-*-coff} do provide software floating point support.
10336
10337 @item -mshort
10338 @opindex mshort
10339 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10340 Additionally, parameters passed on the stack are also aligned to a
10341 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10342
10343 @item -mnobitfield
10344 @opindex mnobitfield
10345 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
10346 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
10347
10348 @item -mbitfield
10349 @opindex mbitfield
10350 Do use the bit-field instructions.  The @option{-m68020} option implies
10351 @option{-mbitfield}.  This is the default if you use a configuration
10352 designed for a 68020.
10353
10354 @item -mrtd
10355 @opindex mrtd
10356 Use a different function-calling convention, in which functions
10357 that take a fixed number of arguments return with the @code{rtd}
10358 instruction, which pops their arguments while returning.  This
10359 saves one instruction in the caller since there is no need to pop
10360 the arguments there.
10361
10362 This calling convention is incompatible with the one normally
10363 used on Unix, so you cannot use it if you need to call libraries
10364 compiled with the Unix compiler.
10365
10366 Also, you must provide function prototypes for all functions that
10367 take variable numbers of arguments (including @code{printf});
10368 otherwise incorrect code will be generated for calls to those
10369 functions.
10370
10371 In addition, seriously incorrect code will result if you call a
10372 function with too many arguments.  (Normally, extra arguments are
10373 harmlessly ignored.)
10374
10375 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
10376 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10377
10378 @item -malign-int
10379 @itemx -mno-align-int
10380 @opindex malign-int
10381 @opindex mno-align-int
10382 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
10383 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
10384 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
10385 Aligning variables on 32-bit boundaries produces code that runs somewhat
10386 faster on processors with 32-bit busses at the expense of more memory.
10387
10388 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
10389 align structures containing the above types  differently than
10390 most published application binary interface specifications for the m68k.
10391
10392 @item -mpcrel
10393 @opindex mpcrel
10394 Use the pc-relative addressing mode of the 68000 directly, instead of
10395 using a global offset table.  At present, this option implies @option{-fpic},
10396 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
10397 not presently supported with @option{-mpcrel}, though this could be supported for
10398 68020 and higher processors.
10399
10400 @item -mno-strict-align
10401 @itemx -mstrict-align
10402 @opindex mno-strict-align
10403 @opindex mstrict-align
10404 Do not (do) assume that unaligned memory references will be handled by
10405 the system.
10406
10407 @item -msep-data
10408 Generate code that allows the data segment to be located in a different
10409 area of memory from the text segment.  This allows for execute in place in
10410 an environment without virtual memory management.  This option implies
10411 @option{-fPIC}.
10412
10413 @item -mno-sep-data
10414 Generate code that assumes that the data segment follows the text segment.
10415 This is the default.
10416
10417 @item -mid-shared-library
10418 Generate code that supports shared libraries via the library ID method.
10419 This allows for execute in place and shared libraries in an environment
10420 without virtual memory management.  This option implies @option{-fPIC}.
10421
10422 @item -mno-id-shared-library
10423 Generate code that doesn't assume ID based shared libraries are being used.
10424 This is the default.
10425
10426 @item -mshared-library-id=n
10427 Specified the identification number of the ID based shared library being
10428 compiled.  Specifying a value of 0 will generate more compact code, specifying
10429 other values will force the allocation of that number to the current
10430 library but is no more space or time efficient than omitting this option.
10431
10432 @end table
10433
10434 @node M68hc1x Options
10435 @subsection M68hc1x Options
10436 @cindex M68hc1x options
10437
10438 These are the @samp{-m} options defined for the 68hc11 and 68hc12
10439 microcontrollers.  The default values for these options depends on
10440 which style of microcontroller was selected when the compiler was configured;
10441 the defaults for the most common choices are given below.
10442
10443 @table @gcctabopt
10444 @item -m6811
10445 @itemx -m68hc11
10446 @opindex m6811
10447 @opindex m68hc11
10448 Generate output for a 68HC11.  This is the default
10449 when the compiler is configured for 68HC11-based systems.
10450
10451 @item -m6812
10452 @itemx -m68hc12
10453 @opindex m6812
10454 @opindex m68hc12
10455 Generate output for a 68HC12.  This is the default
10456 when the compiler is configured for 68HC12-based systems.
10457
10458 @item -m68S12
10459 @itemx -m68hcs12
10460 @opindex m68S12
10461 @opindex m68hcs12
10462 Generate output for a 68HCS12.
10463
10464 @item -mauto-incdec
10465 @opindex mauto-incdec
10466 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
10467 addressing modes.
10468
10469 @item -minmax
10470 @itemx -nominmax
10471 @opindex minmax
10472 @opindex mnominmax
10473 Enable the use of 68HC12 min and max instructions.
10474
10475 @item -mlong-calls
10476 @itemx -mno-long-calls
10477 @opindex mlong-calls
10478 @opindex mno-long-calls
10479 Treat all calls as being far away (near).  If calls are assumed to be
10480 far away, the compiler will use the @code{call} instruction to
10481 call a function and the @code{rtc} instruction for returning.
10482
10483 @item -mshort
10484 @opindex mshort
10485 Consider type @code{int} to be 16 bits wide, like @code{short int}.
10486
10487 @item -msoft-reg-count=@var{count}
10488 @opindex msoft-reg-count
10489 Specify the number of pseudo-soft registers which are used for the
10490 code generation.  The maximum number is 32.  Using more pseudo-soft
10491 register may or may not result in better code depending on the program.
10492 The default is 4 for 68HC11 and 2 for 68HC12.
10493
10494 @end table
10495
10496 @node MCore Options
10497 @subsection MCore Options
10498 @cindex MCore options
10499
10500 These are the @samp{-m} options defined for the Motorola M*Core
10501 processors.
10502
10503 @table @gcctabopt
10504
10505 @item -mhardlit
10506 @itemx -mno-hardlit
10507 @opindex mhardlit
10508 @opindex mno-hardlit
10509 Inline constants into the code stream if it can be done in two
10510 instructions or less.
10511
10512 @item -mdiv
10513 @itemx -mno-div
10514 @opindex mdiv
10515 @opindex mno-div
10516 Use the divide instruction.  (Enabled by default).
10517
10518 @item -mrelax-immediate
10519 @itemx -mno-relax-immediate
10520 @opindex mrelax-immediate
10521 @opindex mno-relax-immediate
10522 Allow arbitrary sized immediates in bit operations.
10523
10524 @item -mwide-bitfields
10525 @itemx -mno-wide-bitfields
10526 @opindex mwide-bitfields
10527 @opindex mno-wide-bitfields
10528 Always treat bit-fields as int-sized.
10529
10530 @item -m4byte-functions
10531 @itemx -mno-4byte-functions
10532 @opindex m4byte-functions
10533 @opindex mno-4byte-functions
10534 Force all functions to be aligned to a four byte boundary.
10535
10536 @item -mcallgraph-data
10537 @itemx -mno-callgraph-data
10538 @opindex mcallgraph-data
10539 @opindex mno-callgraph-data
10540 Emit callgraph information.
10541
10542 @item -mslow-bytes
10543 @itemx -mno-slow-bytes
10544 @opindex mslow-bytes
10545 @opindex mno-slow-bytes
10546 Prefer word access when reading byte quantities.
10547
10548 @item -mlittle-endian
10549 @itemx -mbig-endian
10550 @opindex mlittle-endian
10551 @opindex mbig-endian
10552 Generate code for a little endian target.
10553
10554 @item -m210
10555 @itemx -m340
10556 @opindex m210
10557 @opindex m340
10558 Generate code for the 210 processor.
10559 @end table
10560
10561 @node MIPS Options
10562 @subsection MIPS Options
10563 @cindex MIPS options
10564
10565 @table @gcctabopt
10566
10567 @item -EB
10568 @opindex EB
10569 Generate big-endian code.
10570
10571 @item -EL
10572 @opindex EL
10573 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
10574 configurations.
10575
10576 @item -march=@var{arch}
10577 @opindex march
10578 Generate code that will run on @var{arch}, which can be the name of a
10579 generic MIPS ISA, or the name of a particular processor.
10580 The ISA names are:
10581 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
10582 @samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
10583 The processor names are:
10584 @samp{4kc}, @samp{4km}, @samp{4kp},
10585 @samp{4kec}, @samp{4kem}, @samp{4kep},
10586 @samp{5kc}, @samp{5kf},
10587 @samp{20kc},
10588 @samp{24kc}, @samp{24kf}, @samp{24kx},
10589 @samp{24kec}, @samp{24kef}, @samp{24kex},
10590 @samp{34kc}, @samp{34kf}, @samp{34kx},
10591 @samp{m4k},
10592 @samp{orion},
10593 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
10594 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
10595 @samp{rm7000}, @samp{rm9000},
10596 @samp{sb1},
10597 @samp{sr71000},
10598 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
10599 @samp{vr5000}, @samp{vr5400} and @samp{vr5500}.
10600 The special value @samp{from-abi} selects the
10601 most compatible architecture for the selected ABI (that is,
10602 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
10603
10604 In processor names, a final @samp{000} can be abbreviated as @samp{k}
10605 (for example, @samp{-march=r2k}).  Prefixes are optional, and
10606 @samp{vr} may be written @samp{r}.
10607
10608 GCC defines two macros based on the value of this option.  The first
10609 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
10610 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
10611 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
10612 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
10613 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
10614
10615 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
10616 above.  In other words, it will have the full prefix and will not
10617 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
10618 the macro names the resolved architecture (either @samp{"mips1"} or
10619 @samp{"mips3"}).  It names the default architecture when no
10620 @option{-march} option is given.
10621
10622 @item -mtune=@var{arch}
10623 @opindex mtune
10624 Optimize for @var{arch}.  Among other things, this option controls
10625 the way instructions are scheduled, and the perceived cost of arithmetic
10626 operations.  The list of @var{arch} values is the same as for
10627 @option{-march}.
10628
10629 When this option is not used, GCC will optimize for the processor
10630 specified by @option{-march}.  By using @option{-march} and
10631 @option{-mtune} together, it is possible to generate code that will
10632 run on a family of processors, but optimize the code for one
10633 particular member of that family.
10634
10635 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
10636 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
10637 @samp{-march} ones described above.
10638
10639 @item -mips1
10640 @opindex mips1
10641 Equivalent to @samp{-march=mips1}.
10642
10643 @item -mips2
10644 @opindex mips2
10645 Equivalent to @samp{-march=mips2}.
10646
10647 @item -mips3
10648 @opindex mips3
10649 Equivalent to @samp{-march=mips3}.
10650
10651 @item -mips4
10652 @opindex mips4
10653 Equivalent to @samp{-march=mips4}.
10654
10655 @item -mips32
10656 @opindex mips32
10657 Equivalent to @samp{-march=mips32}.
10658
10659 @item -mips32r2
10660 @opindex mips32r2
10661 Equivalent to @samp{-march=mips32r2}.
10662
10663 @item -mips64
10664 @opindex mips64
10665 Equivalent to @samp{-march=mips64}.
10666
10667 @item -mips16
10668 @itemx -mno-mips16
10669 @opindex mips16
10670 @opindex mno-mips16
10671 Generate (do not generate) MIPS16 code.  If GCC is targetting a
10672 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
10673
10674 @item -mabi=32
10675 @itemx -mabi=o64
10676 @itemx -mabi=n32
10677 @itemx -mabi=64
10678 @itemx -mabi=eabi
10679 @opindex mabi=32
10680 @opindex mabi=o64
10681 @opindex mabi=n32
10682 @opindex mabi=64
10683 @opindex mabi=eabi
10684 Generate code for the given ABI@.
10685
10686 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
10687 generates 64-bit code when you select a 64-bit architecture, but you
10688 can use @option{-mgp32} to get 32-bit code instead.
10689
10690 For information about the O64 ABI, see
10691 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
10692
10693 GCC supports a variant of the o32 ABI in which floating-point registers
10694 are 64 rather than 32 bits wide.  You can select this combination with
10695 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
10696 and @samp{mfhc1} instructions and is therefore only supported for
10697 MIPS32R2 processors.
10698
10699 The register assignments for arguments and return values remain the
10700 same, but each scalar value is passed in a single 64-bit register
10701 rather than a pair of 32-bit registers.  For example, scalar
10702 floating-point values are returned in @samp{$f0} only, not a
10703 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
10704 remains the same, but all 64 bits are saved.
10705
10706 @item -mabicalls
10707 @itemx -mno-abicalls
10708 @opindex mabicalls
10709 @opindex mno-abicalls
10710 Generate (do not generate) code that is suitable for SVR4-style
10711 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
10712 systems.
10713
10714 @item -mshared
10715 @itemx -mno-shared
10716 Generate (do not generate) code that is fully position-independent,
10717 and that can therefore be linked into shared libraries.  This option
10718 only affects @option{-mabicalls}.
10719
10720 All @option{-mabicalls} code has traditionally been position-independent,
10721 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
10722 as an extension, the GNU toolchain allows executables to use absolute
10723 accesses for locally-binding symbols.  It can also use shorter GP
10724 initialization sequences and generate direct calls to locally-defined
10725 functions.  This mode is selected by @option{-mno-shared}.
10726
10727 @option{-mno-shared} depends on binutils 2.16 or higher and generates
10728 objects that can only be linked by the GNU linker.  However, the option
10729 does not affect the ABI of the final executable; it only affects the ABI
10730 of relocatable objects.  Using @option{-mno-shared} will generally make
10731 executables both smaller and quicker.
10732
10733 @option{-mshared} is the default.
10734
10735 @item -mxgot
10736 @itemx -mno-xgot
10737 @opindex mxgot
10738 @opindex mno-xgot
10739 Lift (do not lift) the usual restrictions on the size of the global
10740 offset table.
10741
10742 GCC normally uses a single instruction to load values from the GOT@.
10743 While this is relatively efficient, it will only work if the GOT
10744 is smaller than about 64k.  Anything larger will cause the linker
10745 to report an error such as:
10746
10747 @cindex relocation truncated to fit (MIPS)
10748 @smallexample
10749 relocation truncated to fit: R_MIPS_GOT16 foobar
10750 @end smallexample
10751
10752 If this happens, you should recompile your code with @option{-mxgot}.
10753 It should then work with very large GOTs, although it will also be
10754 less efficient, since it will take three instructions to fetch the
10755 value of a global symbol.
10756
10757 Note that some linkers can create multiple GOTs.  If you have such a
10758 linker, you should only need to use @option{-mxgot} when a single object
10759 file accesses more than 64k's worth of GOT entries.  Very few do.
10760
10761 These options have no effect unless GCC is generating position
10762 independent code.
10763
10764 @item -mgp32
10765 @opindex mgp32
10766 Assume that general-purpose registers are 32 bits wide.
10767
10768 @item -mgp64
10769 @opindex mgp64
10770 Assume that general-purpose registers are 64 bits wide.
10771
10772 @item -mfp32
10773 @opindex mfp32
10774 Assume that floating-point registers are 32 bits wide.
10775
10776 @item -mfp64
10777 @opindex mfp64
10778 Assume that floating-point registers are 64 bits wide.
10779
10780 @item -mhard-float
10781 @opindex mhard-float
10782 Use floating-point coprocessor instructions.
10783
10784 @item -msoft-float
10785 @opindex msoft-float
10786 Do not use floating-point coprocessor instructions.  Implement
10787 floating-point calculations using library calls instead.
10788
10789 @item -msingle-float
10790 @opindex msingle-float
10791 Assume that the floating-point coprocessor only supports single-precision
10792 operations.
10793
10794 @itemx -mdouble-float
10795 @opindex mdouble-float
10796 Assume that the floating-point coprocessor supports double-precision
10797 operations.  This is the default.
10798
10799 @itemx -mdsp
10800 @itemx -mno-dsp
10801 @opindex mdsp
10802 @opindex mno-dsp
10803 Use (do not use) the MIPS DSP ASE.  @xref{MIPS DSP Built-in Functions}.
10804
10805 @itemx -mpaired-single
10806 @itemx -mno-paired-single
10807 @opindex mpaired-single
10808 @opindex mno-paired-single
10809 Use (do not use) paired-single floating-point instructions.
10810 @xref{MIPS Paired-Single Support}.  This option can only be used
10811 when generating 64-bit code and requires hardware floating-point
10812 support to be enabled.
10813
10814 @itemx -mips3d
10815 @itemx -mno-mips3d
10816 @opindex mips3d
10817 @opindex mno-mips3d
10818 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
10819 The option @option{-mips3d} implies @option{-mpaired-single}.
10820
10821 @item -mlong64
10822 @opindex mlong64
10823 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
10824 an explanation of the default and the way that the pointer size is
10825 determined.
10826
10827 @item -mlong32
10828 @opindex mlong32
10829 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
10830
10831 The default size of @code{int}s, @code{long}s and pointers depends on
10832 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
10833 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
10834 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
10835 or the same size as integer registers, whichever is smaller.
10836
10837 @item -msym32
10838 @itemx -mno-sym32
10839 @opindex msym32
10840 @opindex mno-sym32
10841 Assume (do not assume) that all symbols have 32-bit values, regardless
10842 of the selected ABI@.  This option is useful in combination with
10843 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
10844 to generate shorter and faster references to symbolic addresses.
10845
10846 @item -G @var{num}
10847 @opindex G
10848 @cindex smaller data references (MIPS)
10849 @cindex gp-relative references (MIPS)
10850 Put global and static items less than or equal to @var{num} bytes into
10851 the small data or bss section instead of the normal data or bss section.
10852 This allows the data to be accessed using a single instruction.
10853
10854 All modules should be compiled with the same @option{-G @var{num}}
10855 value.
10856
10857 @item -membedded-data
10858 @itemx -mno-embedded-data
10859 @opindex membedded-data
10860 @opindex mno-embedded-data
10861 Allocate variables to the read-only data section first if possible, then
10862 next in the small data section if possible, otherwise in data.  This gives
10863 slightly slower code than the default, but reduces the amount of RAM required
10864 when executing, and thus may be preferred for some embedded systems.
10865
10866 @item -muninit-const-in-rodata
10867 @itemx -mno-uninit-const-in-rodata
10868 @opindex muninit-const-in-rodata
10869 @opindex mno-uninit-const-in-rodata
10870 Put uninitialized @code{const} variables in the read-only data section.
10871 This option is only meaningful in conjunction with @option{-membedded-data}.
10872
10873 @item -msplit-addresses
10874 @itemx -mno-split-addresses
10875 @opindex msplit-addresses
10876 @opindex mno-split-addresses
10877 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
10878 relocation operators.  This option has been superseded by
10879 @option{-mexplicit-relocs} but is retained for backwards compatibility.
10880
10881 @item -mexplicit-relocs
10882 @itemx -mno-explicit-relocs
10883 @opindex mexplicit-relocs
10884 @opindex mno-explicit-relocs
10885 Use (do not use) assembler relocation operators when dealing with symbolic
10886 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
10887 is to use assembler macros instead.
10888
10889 @option{-mexplicit-relocs} is the default if GCC was configured
10890 to use an assembler that supports relocation operators.
10891
10892 @item -mcheck-zero-division
10893 @itemx -mno-check-zero-division
10894 @opindex mcheck-zero-division
10895 @opindex mno-check-zero-division
10896 Trap (do not trap) on integer division by zero.  The default is
10897 @option{-mcheck-zero-division}.
10898
10899 @item -mdivide-traps
10900 @itemx -mdivide-breaks
10901 @opindex mdivide-traps
10902 @opindex mdivide-breaks
10903 MIPS systems check for division by zero by generating either a
10904 conditional trap or a break instruction.  Using traps results in
10905 smaller code, but is only supported on MIPS II and later.  Also, some
10906 versions of the Linux kernel have a bug that prevents trap from
10907 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
10908 allow conditional traps on architectures that support them and
10909 @option{-mdivide-breaks} to force the use of breaks.
10910
10911 The default is usually @option{-mdivide-traps}, but this can be
10912 overridden at configure time using @option{--with-divide=breaks}.
10913 Divide-by-zero checks can be completely disabled using
10914 @option{-mno-check-zero-division}.
10915
10916 @item -mmemcpy
10917 @itemx -mno-memcpy
10918 @opindex mmemcpy
10919 @opindex mno-memcpy
10920 Force (do not force) the use of @code{memcpy()} for non-trivial block
10921 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
10922 most constant-sized copies.
10923
10924 @item -mlong-calls
10925 @itemx -mno-long-calls
10926 @opindex mlong-calls
10927 @opindex mno-long-calls
10928 Disable (do not disable) use of the @code{jal} instruction.  Calling
10929 functions using @code{jal} is more efficient but requires the caller
10930 and callee to be in the same 256 megabyte segment.
10931
10932 This option has no effect on abicalls code.  The default is
10933 @option{-mno-long-calls}.
10934
10935 @item -mmad
10936 @itemx -mno-mad
10937 @opindex mmad
10938 @opindex mno-mad
10939 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
10940 instructions, as provided by the R4650 ISA@.
10941
10942 @item -mfused-madd
10943 @itemx -mno-fused-madd
10944 @opindex mfused-madd
10945 @opindex mno-fused-madd
10946 Enable (disable) use of the floating point multiply-accumulate
10947 instructions, when they are available.  The default is
10948 @option{-mfused-madd}.
10949
10950 When multiply-accumulate instructions are used, the intermediate
10951 product is calculated to infinite precision and is not subject to
10952 the FCSR Flush to Zero bit.  This may be undesirable in some
10953 circumstances.
10954
10955 @item -nocpp
10956 @opindex nocpp
10957 Tell the MIPS assembler to not run its preprocessor over user
10958 assembler files (with a @samp{.s} suffix) when assembling them.
10959
10960 @item -mfix-r4000
10961 @itemx -mno-fix-r4000
10962 @opindex mfix-r4000
10963 @opindex mno-fix-r4000
10964 Work around certain R4000 CPU errata:
10965 @itemize @minus
10966 @item
10967 A double-word or a variable shift may give an incorrect result if executed
10968 immediately after starting an integer division.
10969 @item
10970 A double-word or a variable shift may give an incorrect result if executed
10971 while an integer multiplication is in progress.
10972 @item
10973 An integer division may give an incorrect result if started in a delay slot
10974 of a taken branch or a jump.
10975 @end itemize
10976
10977 @item -mfix-r4400
10978 @itemx -mno-fix-r4400
10979 @opindex mfix-r4400
10980 @opindex mno-fix-r4400
10981 Work around certain R4400 CPU errata:
10982 @itemize @minus
10983 @item
10984 A double-word or a variable shift may give an incorrect result if executed
10985 immediately after starting an integer division.
10986 @end itemize
10987
10988 @item -mfix-vr4120
10989 @itemx -mno-fix-vr4120
10990 @opindex mfix-vr4120
10991 Work around certain VR4120 errata:
10992 @itemize @minus
10993 @item
10994 @code{dmultu} does not always produce the correct result.
10995 @item
10996 @code{div} and @code{ddiv} do not always produce the correct result if one
10997 of the operands is negative.
10998 @end itemize
10999 The workarounds for the division errata rely on special functions in
11000 @file{libgcc.a}.  At present, these functions are only provided by
11001 the @code{mips64vr*-elf} configurations.
11002
11003 Other VR4120 errata require a nop to be inserted between certain pairs of
11004 instructions.  These errata are handled by the assembler, not by GCC itself.
11005
11006 @item -mfix-vr4130
11007 @opindex mfix-vr4130
11008 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
11009 workarounds are implemented by the assembler rather than by GCC,
11010 although GCC will avoid using @code{mflo} and @code{mfhi} if the
11011 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
11012 instructions are available instead.
11013
11014 @item -mfix-sb1
11015 @itemx -mno-fix-sb1
11016 @opindex mfix-sb1
11017 Work around certain SB-1 CPU core errata.
11018 (This flag currently works around the SB-1 revision 2
11019 ``F1'' and ``F2'' floating point errata.)
11020
11021 @item -mflush-func=@var{func}
11022 @itemx -mno-flush-func
11023 @opindex mflush-func
11024 Specifies the function to call to flush the I and D caches, or to not
11025 call any such function.  If called, the function must take the same
11026 arguments as the common @code{_flush_func()}, that is, the address of the
11027 memory range for which the cache is being flushed, the size of the
11028 memory range, and the number 3 (to flush both caches).  The default
11029 depends on the target GCC was configured for, but commonly is either
11030 @samp{_flush_func} or @samp{__cpu_flush}.
11031
11032 @item -mbranch-likely
11033 @itemx -mno-branch-likely
11034 @opindex mbranch-likely
11035 @opindex mno-branch-likely
11036 Enable or disable use of Branch Likely instructions, regardless of the
11037 default for the selected architecture.  By default, Branch Likely
11038 instructions may be generated if they are supported by the selected
11039 architecture.  An exception is for the MIPS32 and MIPS64 architectures
11040 and processors which implement those architectures; for those, Branch
11041 Likely instructions will not be generated by default because the MIPS32
11042 and MIPS64 architectures specifically deprecate their use.
11043
11044 @item -mfp-exceptions
11045 @itemx -mno-fp-exceptions
11046 @opindex mfp-exceptions
11047 Specifies whether FP exceptions are enabled.  This affects how we schedule
11048 FP instructions for some processors.  The default is that FP exceptions are
11049 enabled.
11050
11051 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
11052 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
11053 FP pipe.
11054
11055 @item -mvr4130-align
11056 @itemx -mno-vr4130-align
11057 @opindex mvr4130-align
11058 The VR4130 pipeline is two-way superscalar, but can only issue two
11059 instructions together if the first one is 8-byte aligned.  When this
11060 option is enabled, GCC will align pairs of instructions that it
11061 thinks should execute in parallel.
11062
11063 This option only has an effect when optimizing for the VR4130.
11064 It normally makes code faster, but at the expense of making it bigger.
11065 It is enabled by default at optimization level @option{-O3}.
11066 @end table
11067
11068 @node MMIX Options
11069 @subsection MMIX Options
11070 @cindex MMIX Options
11071
11072 These options are defined for the MMIX:
11073
11074 @table @gcctabopt
11075 @item -mlibfuncs
11076 @itemx -mno-libfuncs
11077 @opindex mlibfuncs
11078 @opindex mno-libfuncs
11079 Specify that intrinsic library functions are being compiled, passing all
11080 values in registers, no matter the size.
11081
11082 @item -mepsilon
11083 @itemx -mno-epsilon
11084 @opindex mepsilon
11085 @opindex mno-epsilon
11086 Generate floating-point comparison instructions that compare with respect
11087 to the @code{rE} epsilon register.
11088
11089 @item -mabi=mmixware
11090 @itemx -mabi=gnu
11091 @opindex mabi-mmixware
11092 @opindex mabi=gnu
11093 Generate code that passes function parameters and return values that (in
11094 the called function) are seen as registers @code{$0} and up, as opposed to
11095 the GNU ABI which uses global registers @code{$231} and up.
11096
11097 @item -mzero-extend
11098 @itemx -mno-zero-extend
11099 @opindex mzero-extend
11100 @opindex mno-zero-extend
11101 When reading data from memory in sizes shorter than 64 bits, use (do not
11102 use) zero-extending load instructions by default, rather than
11103 sign-extending ones.
11104
11105 @item -mknuthdiv
11106 @itemx -mno-knuthdiv
11107 @opindex mknuthdiv
11108 @opindex mno-knuthdiv
11109 Make the result of a division yielding a remainder have the same sign as
11110 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
11111 remainder follows the sign of the dividend.  Both methods are
11112 arithmetically valid, the latter being almost exclusively used.
11113
11114 @item -mtoplevel-symbols
11115 @itemx -mno-toplevel-symbols
11116 @opindex mtoplevel-symbols
11117 @opindex mno-toplevel-symbols
11118 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
11119 code can be used with the @code{PREFIX} assembly directive.
11120
11121 @item -melf
11122 @opindex melf
11123 Generate an executable in the ELF format, rather than the default
11124 @samp{mmo} format used by the @command{mmix} simulator.
11125
11126 @item -mbranch-predict
11127 @itemx -mno-branch-predict
11128 @opindex mbranch-predict
11129 @opindex mno-branch-predict
11130 Use (do not use) the probable-branch instructions, when static branch
11131 prediction indicates a probable branch.
11132
11133 @item -mbase-addresses
11134 @itemx -mno-base-addresses
11135 @opindex mbase-addresses
11136 @opindex mno-base-addresses
11137 Generate (do not generate) code that uses @emph{base addresses}.  Using a
11138 base address automatically generates a request (handled by the assembler
11139 and the linker) for a constant to be set up in a global register.  The
11140 register is used for one or more base address requests within the range 0
11141 to 255 from the value held in the register.  The generally leads to short
11142 and fast code, but the number of different data items that can be
11143 addressed is limited.  This means that a program that uses lots of static
11144 data may require @option{-mno-base-addresses}.
11145
11146 @item -msingle-exit
11147 @itemx -mno-single-exit
11148 @opindex msingle-exit
11149 @opindex mno-single-exit
11150 Force (do not force) generated code to have a single exit point in each
11151 function.
11152 @end table
11153
11154 @node MN10300 Options
11155 @subsection MN10300 Options
11156 @cindex MN10300 options
11157
11158 These @option{-m} options are defined for Matsushita MN10300 architectures:
11159
11160 @table @gcctabopt
11161 @item -mmult-bug
11162 @opindex mmult-bug
11163 Generate code to avoid bugs in the multiply instructions for the MN10300
11164 processors.  This is the default.
11165
11166 @item -mno-mult-bug
11167 @opindex mno-mult-bug
11168 Do not generate code to avoid bugs in the multiply instructions for the
11169 MN10300 processors.
11170
11171 @item -mam33
11172 @opindex mam33
11173 Generate code which uses features specific to the AM33 processor.
11174
11175 @item -mno-am33
11176 @opindex mno-am33
11177 Do not generate code which uses features specific to the AM33 processor.  This
11178 is the default.
11179
11180 @item -mreturn-pointer-on-d0
11181 @opindex mreturn-pointer-on-d0
11182 When generating a function which returns a pointer, return the pointer
11183 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
11184 only in a0, and attempts to call such functions without a prototype
11185 would result in errors.  Note that this option is on by default; use
11186 @option{-mno-return-pointer-on-d0} to disable it.
11187
11188 @item -mno-crt0
11189 @opindex mno-crt0
11190 Do not link in the C run-time initialization object file.
11191
11192 @item -mrelax
11193 @opindex mrelax
11194 Indicate to the linker that it should perform a relaxation optimization pass
11195 to shorten branches, calls and absolute memory addresses.  This option only
11196 has an effect when used on the command line for the final link step.
11197
11198 This option makes symbolic debugging impossible.
11199 @end table
11200
11201 @node MT Options
11202 @subsection MT Options
11203 @cindex MT options
11204
11205 These @option{-m} options are defined for Morpho MT architectures:
11206
11207 @table @gcctabopt
11208
11209 @item -march=@var{cpu-type}
11210 @opindex march
11211 Generate code that will run on @var{cpu-type}, which is the name of a system
11212 representing a certain processor type.  Possible values for
11213 @var{cpu-type} are @samp{ms1-64-001}, @samp{ms1-16-002},
11214 @samp{ms1-16-003} and @samp{ms2}.
11215
11216 When this option is not used, the default is @option{-march=ms1-16-002}.
11217
11218 @item -mbacc
11219 @opindex mbacc
11220 Use byte loads and stores when generating code.
11221
11222 @item -mno-bacc
11223 @opindex mno-bacc
11224 Do not use byte loads and stores when generating code.
11225
11226 @item -msim
11227 @opindex msim
11228 Use simulator runtime
11229
11230 @item -mno-crt0
11231 @opindex mno-crt0
11232 Do not link in the C run-time initialization object file
11233 @file{crti.o}.  Other run-time initialization and termination files
11234 such as @file{startup.o} and @file{exit.o} are still included on the
11235 linker command line.
11236
11237 @end table
11238
11239 @node PDP-11 Options
11240 @subsection PDP-11 Options
11241 @cindex PDP-11 Options
11242
11243 These options are defined for the PDP-11:
11244
11245 @table @gcctabopt
11246 @item -mfpu
11247 @opindex mfpu
11248 Use hardware FPP floating point.  This is the default.  (FIS floating
11249 point on the PDP-11/40 is not supported.)
11250
11251 @item -msoft-float
11252 @opindex msoft-float
11253 Do not use hardware floating point.
11254
11255 @item -mac0
11256 @opindex mac0
11257 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
11258
11259 @item -mno-ac0
11260 @opindex mno-ac0
11261 Return floating-point results in memory.  This is the default.
11262
11263 @item -m40
11264 @opindex m40
11265 Generate code for a PDP-11/40.
11266
11267 @item -m45
11268 @opindex m45
11269 Generate code for a PDP-11/45.  This is the default.
11270
11271 @item -m10
11272 @opindex m10
11273 Generate code for a PDP-11/10.
11274
11275 @item -mbcopy-builtin
11276 @opindex bcopy-builtin
11277 Use inline @code{movmemhi} patterns for copying memory.  This is the
11278 default.
11279
11280 @item -mbcopy
11281 @opindex mbcopy
11282 Do not use inline @code{movmemhi} patterns for copying memory.
11283
11284 @item -mint16
11285 @itemx -mno-int32
11286 @opindex mint16
11287 @opindex mno-int32
11288 Use 16-bit @code{int}.  This is the default.
11289
11290 @item -mint32
11291 @itemx -mno-int16
11292 @opindex mint32
11293 @opindex mno-int16
11294 Use 32-bit @code{int}.
11295
11296 @item -mfloat64
11297 @itemx -mno-float32
11298 @opindex mfloat64
11299 @opindex mno-float32
11300 Use 64-bit @code{float}.  This is the default.
11301
11302 @item -mfloat32
11303 @itemx -mno-float64
11304 @opindex mfloat32
11305 @opindex mno-float64
11306 Use 32-bit @code{float}.
11307
11308 @item -mabshi
11309 @opindex mabshi
11310 Use @code{abshi2} pattern.  This is the default.
11311
11312 @item -mno-abshi
11313 @opindex mno-abshi
11314 Do not use @code{abshi2} pattern.
11315
11316 @item -mbranch-expensive
11317 @opindex mbranch-expensive
11318 Pretend that branches are expensive.  This is for experimenting with
11319 code generation only.
11320
11321 @item -mbranch-cheap
11322 @opindex mbranch-cheap
11323 Do not pretend that branches are expensive.  This is the default.
11324
11325 @item -msplit
11326 @opindex msplit
11327 Generate code for a system with split I&D@.
11328
11329 @item -mno-split
11330 @opindex mno-split
11331 Generate code for a system without split I&D@.  This is the default.
11332
11333 @item -munix-asm
11334 @opindex munix-asm
11335 Use Unix assembler syntax.  This is the default when configured for
11336 @samp{pdp11-*-bsd}.
11337
11338 @item -mdec-asm
11339 @opindex mdec-asm
11340 Use DEC assembler syntax.  This is the default when configured for any
11341 PDP-11 target other than @samp{pdp11-*-bsd}.
11342 @end table
11343
11344 @node PowerPC Options
11345 @subsection PowerPC Options
11346 @cindex PowerPC options
11347
11348 These are listed under @xref{RS/6000 and PowerPC Options}.
11349
11350 @node RS/6000 and PowerPC Options
11351 @subsection IBM RS/6000 and PowerPC Options
11352 @cindex RS/6000 and PowerPC Options
11353 @cindex IBM RS/6000 and PowerPC Options
11354
11355 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
11356 @table @gcctabopt
11357 @item -mpower
11358 @itemx -mno-power
11359 @itemx -mpower2
11360 @itemx -mno-power2
11361 @itemx -mpowerpc
11362 @itemx -mno-powerpc
11363 @itemx -mpowerpc-gpopt
11364 @itemx -mno-powerpc-gpopt
11365 @itemx -mpowerpc-gfxopt
11366 @itemx -mno-powerpc-gfxopt
11367 @itemx -mpowerpc64
11368 @itemx -mno-powerpc64
11369 @itemx -mmfcrf
11370 @itemx -mno-mfcrf
11371 @itemx -mpopcntb
11372 @itemx -mno-popcntb
11373 @itemx -mfprnd
11374 @itemx -mno-fprnd
11375 @itemx -mmfpgpr
11376 @itemx -mno-mfpgpr
11377 @opindex mpower
11378 @opindex mno-power
11379 @opindex mpower2
11380 @opindex mno-power2
11381 @opindex mpowerpc
11382 @opindex mno-powerpc
11383 @opindex mpowerpc-gpopt
11384 @opindex mno-powerpc-gpopt
11385 @opindex mpowerpc-gfxopt
11386 @opindex mno-powerpc-gfxopt
11387 @opindex mpowerpc64
11388 @opindex mno-powerpc64
11389 @opindex mmfcrf
11390 @opindex mno-mfcrf
11391 @opindex mpopcntb
11392 @opindex mno-popcntb
11393 @opindex mfprnd
11394 @opindex mno-fprnd
11395 @opindex mmfpgpr
11396 @opindex mno-mfpgpr
11397 GCC supports two related instruction set architectures for the
11398 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
11399 instructions supported by the @samp{rios} chip set used in the original
11400 RS/6000 systems and the @dfn{PowerPC} instruction set is the
11401 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
11402 the IBM 4xx, 6xx, and follow-on microprocessors.
11403
11404 Neither architecture is a subset of the other.  However there is a
11405 large common subset of instructions supported by both.  An MQ
11406 register is included in processors supporting the POWER architecture.
11407
11408 You use these options to specify which instructions are available on the
11409 processor you are using.  The default value of these options is
11410 determined when configuring GCC@.  Specifying the
11411 @option{-mcpu=@var{cpu_type}} overrides the specification of these
11412 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
11413 rather than the options listed above.
11414
11415 The @option{-mpower} option allows GCC to generate instructions that
11416 are found only in the POWER architecture and to use the MQ register.
11417 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
11418 to generate instructions that are present in the POWER2 architecture but
11419 not the original POWER architecture.
11420
11421 The @option{-mpowerpc} option allows GCC to generate instructions that
11422 are found only in the 32-bit subset of the PowerPC architecture.
11423 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
11424 GCC to use the optional PowerPC architecture instructions in the
11425 General Purpose group, including floating-point square root.  Specifying
11426 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
11427 use the optional PowerPC architecture instructions in the Graphics
11428 group, including floating-point select.
11429
11430 The @option{-mmfcrf} option allows GCC to generate the move from
11431 condition register field instruction implemented on the POWER4
11432 processor and other processors that support the PowerPC V2.01
11433 architecture.
11434 The @option{-mpopcntb} option allows GCC to generate the popcount and
11435 double precision FP reciprocal estimate instruction implemented on the
11436 POWER5 processor and other processors that support the PowerPC V2.02
11437 architecture.
11438 The @option{-mfprnd} option allows GCC to generate the FP round to
11439 integer instructions implemented on the POWER5+ processor and other
11440 processors that support the PowerPC V2.03 architecture.
11441 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
11442 general purpose register instructions implemented on the POWER6X
11443 processor and other processors that support the extended PowerPC V2.05
11444 architecture.
11445
11446 The @option{-mpowerpc64} option allows GCC to generate the additional
11447 64-bit instructions that are found in the full PowerPC64 architecture
11448 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
11449 @option{-mno-powerpc64}.
11450
11451 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
11452 will use only the instructions in the common subset of both
11453 architectures plus some special AIX common-mode calls, and will not use
11454 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
11455 permits GCC to use any instruction from either architecture and to
11456 allow use of the MQ register; specify this for the Motorola MPC601.
11457
11458 @item -mnew-mnemonics
11459 @itemx -mold-mnemonics
11460 @opindex mnew-mnemonics
11461 @opindex mold-mnemonics
11462 Select which mnemonics to use in the generated assembler code.  With
11463 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
11464 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
11465 assembler mnemonics defined for the POWER architecture.  Instructions
11466 defined in only one architecture have only one mnemonic; GCC uses that
11467 mnemonic irrespective of which of these options is specified.
11468
11469 GCC defaults to the mnemonics appropriate for the architecture in
11470 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
11471 value of these option.  Unless you are building a cross-compiler, you
11472 should normally not specify either @option{-mnew-mnemonics} or
11473 @option{-mold-mnemonics}, but should instead accept the default.
11474
11475 @item -mcpu=@var{cpu_type}
11476 @opindex mcpu
11477 Set architecture type, register usage, choice of mnemonics, and
11478 instruction scheduling parameters for machine type @var{cpu_type}.
11479 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
11480 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
11481 @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
11482 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
11483 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
11484 @samp{860}, @samp{970}, @samp{8540}, @samp{ec603e}, @samp{G3},
11485 @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
11486 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6},
11487 @samp{power6x}, @samp{common}, @samp{powerpc}, @samp{powerpc64},
11488 @samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
11489
11490 @option{-mcpu=common} selects a completely generic processor.  Code
11491 generated under this option will run on any POWER or PowerPC processor.
11492 GCC will use only the instructions in the common subset of both
11493 architectures, and will not use the MQ register.  GCC assumes a generic
11494 processor model for scheduling purposes.
11495
11496 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
11497 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
11498 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
11499 types, with an appropriate, generic processor model assumed for
11500 scheduling purposes.
11501
11502 The other options specify a specific processor.  Code generated under
11503 those options will run best on that processor, and may not run at all on
11504 others.
11505
11506 The @option{-mcpu} options automatically enable or disable the
11507 following options: @option{-maltivec}, @option{-mfprnd},
11508 @option{-mhard-float}, @option{-mmfcrf}, @option{-mmultiple},
11509 @option{-mnew-mnemonics}, @option{-mpopcntb}, @option{-mpower},
11510 @option{-mpower2}, @option{-mpowerpc64}, @option{-mpowerpc-gpopt},
11511 @option{-mpowerpc-gfxopt}, @option{-mstring}, @option{-mmulhw},
11512 @option{-mdlmzb}, @option{-mmfpgpr}.
11513 The particular options set for any particular CPU will vary between
11514 compiler versions, depending on what setting seems to produce optimal
11515 code for that CPU; it doesn't necessarily reflect the actual hardware's
11516 capabilities.  If you wish to set an individual option to a particular
11517 value, you may specify it after the @option{-mcpu} option, like
11518 @samp{-mcpu=970 -mno-altivec}.
11519
11520 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
11521 not enabled or disabled by the @option{-mcpu} option at present because
11522 AIX does not have full support for these options.  You may still
11523 enable or disable them individually if you're sure it'll work in your
11524 environment.
11525
11526 @item -mtune=@var{cpu_type}
11527 @opindex mtune
11528 Set the instruction scheduling parameters for machine type
11529 @var{cpu_type}, but do not set the architecture type, register usage, or
11530 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
11531 values for @var{cpu_type} are used for @option{-mtune} as for
11532 @option{-mcpu}.  If both are specified, the code generated will use the
11533 architecture, registers, and mnemonics set by @option{-mcpu}, but the
11534 scheduling parameters set by @option{-mtune}.
11535
11536 @item -mswdiv
11537 @itemx -mno-swdiv
11538 @opindex mswdiv
11539 @opindex mno-swdiv
11540 Generate code to compute division as reciprocal estimate and iterative
11541 refinement, creating opportunities for increased throughput.  This
11542 feature requires: optional PowerPC Graphics instruction set for single
11543 precision and FRE instruction for double precision, assuming divides
11544 cannot generate user-visible traps, and the domain values not include
11545 Infinities, denormals or zero denominator.
11546
11547 @item -maltivec
11548 @itemx -mno-altivec
11549 @opindex maltivec
11550 @opindex mno-altivec
11551 Generate code that uses (does not use) AltiVec instructions, and also
11552 enable the use of built-in functions that allow more direct access to
11553 the AltiVec instruction set.  You may also need to set
11554 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
11555 enhancements.
11556
11557 @item -mvrsave
11558 @item -mno-vrsave
11559 @opindex mvrsave
11560 @opindex mno-vrsave
11561 Generate VRSAVE instructions when generating AltiVec code.
11562
11563 @item -msecure-plt
11564 @opindex msecure-plt
11565 Generate code that allows ld and ld.so to build executables and shared
11566 libraries with non-exec .plt and .got sections.  This is a PowerPC
11567 32-bit SYSV ABI option.
11568
11569 @item -mbss-plt
11570 @opindex mbss-plt
11571 Generate code that uses a BSS .plt section that ld.so fills in, and
11572 requires .plt and .got sections that are both writable and executable.
11573 This is a PowerPC 32-bit SYSV ABI option.
11574
11575 @item -misel
11576 @itemx -mno-isel
11577 @opindex misel
11578 @opindex mno-isel
11579 This switch enables or disables the generation of ISEL instructions.
11580
11581 @item -misel=@var{yes/no}
11582 This switch has been deprecated.  Use @option{-misel} and
11583 @option{-mno-isel} instead.
11584
11585 @item -mspe
11586 @itemx -mno-spe
11587 @opindex mspe
11588 @opindex mno-spe
11589 This switch enables or disables the generation of SPE simd
11590 instructions.
11591
11592 @item -mspe=@var{yes/no}
11593 This option has been deprecated.  Use @option{-mspe} and
11594 @option{-mno-spe} instead.
11595
11596 @item -mfloat-gprs=@var{yes/single/double/no}
11597 @itemx -mfloat-gprs
11598 @opindex mfloat-gprs
11599 This switch enables or disables the generation of floating point
11600 operations on the general purpose registers for architectures that
11601 support it.
11602
11603 The argument @var{yes} or @var{single} enables the use of
11604 single-precision floating point operations.
11605
11606 The argument @var{double} enables the use of single and
11607 double-precision floating point operations.
11608
11609 The argument @var{no} disables floating point operations on the
11610 general purpose registers.
11611
11612 This option is currently only available on the MPC854x.
11613
11614 @item -m32
11615 @itemx -m64
11616 @opindex m32
11617 @opindex m64
11618 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
11619 targets (including GNU/Linux).  The 32-bit environment sets int, long
11620 and pointer to 32 bits and generates code that runs on any PowerPC
11621 variant.  The 64-bit environment sets int to 32 bits and long and
11622 pointer to 64 bits, and generates code for PowerPC64, as for
11623 @option{-mpowerpc64}.
11624
11625 @item -mfull-toc
11626 @itemx -mno-fp-in-toc
11627 @itemx -mno-sum-in-toc
11628 @itemx -mminimal-toc
11629 @opindex mfull-toc
11630 @opindex mno-fp-in-toc
11631 @opindex mno-sum-in-toc
11632 @opindex mminimal-toc
11633 Modify generation of the TOC (Table Of Contents), which is created for
11634 every executable file.  The @option{-mfull-toc} option is selected by
11635 default.  In that case, GCC will allocate at least one TOC entry for
11636 each unique non-automatic variable reference in your program.  GCC
11637 will also place floating-point constants in the TOC@.  However, only
11638 16,384 entries are available in the TOC@.
11639
11640 If you receive a linker error message that saying you have overflowed
11641 the available TOC space, you can reduce the amount of TOC space used
11642 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
11643 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
11644 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
11645 generate code to calculate the sum of an address and a constant at
11646 run-time instead of putting that sum into the TOC@.  You may specify one
11647 or both of these options.  Each causes GCC to produce very slightly
11648 slower and larger code at the expense of conserving TOC space.
11649
11650 If you still run out of space in the TOC even when you specify both of
11651 these options, specify @option{-mminimal-toc} instead.  This option causes
11652 GCC to make only one TOC entry for every file.  When you specify this
11653 option, GCC will produce code that is slower and larger but which
11654 uses extremely little TOC space.  You may wish to use this option
11655 only on files that contain less frequently executed code.
11656
11657 @item -maix64
11658 @itemx -maix32
11659 @opindex maix64
11660 @opindex maix32
11661 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
11662 @code{long} type, and the infrastructure needed to support them.
11663 Specifying @option{-maix64} implies @option{-mpowerpc64} and
11664 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
11665 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
11666
11667 @item -mxl-compat
11668 @itemx -mno-xl-compat
11669 @opindex mxl-compat
11670 @opindex mno-xl-compat
11671 Produce code that conforms more closely to IBM XL compiler semantics
11672 when using AIX-compatible ABI.  Pass floating-point arguments to
11673 prototyped functions beyond the register save area (RSA) on the stack
11674 in addition to argument FPRs.  Do not assume that most significant
11675 double in 128-bit long double value is properly rounded when comparing
11676 values and converting to double.  Use XL symbol names for long double
11677 support routines.
11678
11679 The AIX calling convention was extended but not initially documented to
11680 handle an obscure K&R C case of calling a function that takes the
11681 address of its arguments with fewer arguments than declared.  IBM XL
11682 compilers access floating point arguments which do not fit in the
11683 RSA from the stack when a subroutine is compiled without
11684 optimization.  Because always storing floating-point arguments on the
11685 stack is inefficient and rarely needed, this option is not enabled by
11686 default and only is necessary when calling subroutines compiled by IBM
11687 XL compilers without optimization.
11688
11689 @item -mpe
11690 @opindex mpe
11691 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
11692 application written to use message passing with special startup code to
11693 enable the application to run.  The system must have PE installed in the
11694 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
11695 must be overridden with the @option{-specs=} option to specify the
11696 appropriate directory location.  The Parallel Environment does not
11697 support threads, so the @option{-mpe} option and the @option{-pthread}
11698 option are incompatible.
11699
11700 @item -malign-natural
11701 @itemx -malign-power
11702 @opindex malign-natural
11703 @opindex malign-power
11704 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
11705 @option{-malign-natural} overrides the ABI-defined alignment of larger
11706 types, such as floating-point doubles, on their natural size-based boundary.
11707 The option @option{-malign-power} instructs GCC to follow the ABI-specified
11708 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
11709
11710 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
11711 is not supported.
11712
11713 @item -msoft-float
11714 @itemx -mhard-float
11715 @opindex msoft-float
11716 @opindex mhard-float
11717 Generate code that does not use (uses) the floating-point register set.
11718 Software floating point emulation is provided if you use the
11719 @option{-msoft-float} option, and pass the option to GCC when linking.
11720
11721 @item -mmultiple
11722 @itemx -mno-multiple
11723 @opindex mmultiple
11724 @opindex mno-multiple
11725 Generate code that uses (does not use) the load multiple word
11726 instructions and the store multiple word instructions.  These
11727 instructions are generated by default on POWER systems, and not
11728 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
11729 endian PowerPC systems, since those instructions do not work when the
11730 processor is in little endian mode.  The exceptions are PPC740 and
11731 PPC750 which permit the instructions usage in little endian mode.
11732
11733 @item -mstring
11734 @itemx -mno-string
11735 @opindex mstring
11736 @opindex mno-string
11737 Generate code that uses (does not use) the load string instructions
11738 and the store string word instructions to save multiple registers and
11739 do small block moves.  These instructions are generated by default on
11740 POWER systems, and not generated on PowerPC systems.  Do not use
11741 @option{-mstring} on little endian PowerPC systems, since those
11742 instructions do not work when the processor is in little endian mode.
11743 The exceptions are PPC740 and PPC750 which permit the instructions
11744 usage in little endian mode.
11745
11746 @item -mupdate
11747 @itemx -mno-update
11748 @opindex mupdate
11749 @opindex mno-update
11750 Generate code that uses (does not use) the load or store instructions
11751 that update the base register to the address of the calculated memory
11752 location.  These instructions are generated by default.  If you use
11753 @option{-mno-update}, there is a small window between the time that the
11754 stack pointer is updated and the address of the previous frame is
11755 stored, which means code that walks the stack frame across interrupts or
11756 signals may get corrupted data.
11757
11758 @item -mfused-madd
11759 @itemx -mno-fused-madd
11760 @opindex mfused-madd
11761 @opindex mno-fused-madd
11762 Generate code that uses (does not use) the floating point multiply and
11763 accumulate instructions.  These instructions are generated by default if
11764 hardware floating is used.
11765
11766 @item -mmulhw
11767 @itemx -mno-mulhw
11768 @opindex mmulhw
11769 @opindex mno-mulhw
11770 Generate code that uses (does not use) the half-word multiply and
11771 multiply-accumulate instructions on the IBM 405 and 440 processors.
11772 These instructions are generated by default when targetting those
11773 processors.
11774
11775 @item -mdlmzb
11776 @itemx -mno-dlmzb
11777 @opindex mdlmzb
11778 @opindex mno-dlmzb
11779 Generate code that uses (does not use) the string-search @samp{dlmzb}
11780 instruction on the IBM 405 and 440 processors.  This instruction is
11781 generated by default when targetting those processors.
11782
11783 @item -mno-bit-align
11784 @itemx -mbit-align
11785 @opindex mno-bit-align
11786 @opindex mbit-align
11787 On System V.4 and embedded PowerPC systems do not (do) force structures
11788 and unions that contain bit-fields to be aligned to the base type of the
11789 bit-field.
11790
11791 For example, by default a structure containing nothing but 8
11792 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
11793 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
11794 the structure would be aligned to a 1 byte boundary and be one byte in
11795 size.
11796
11797 @item -mno-strict-align
11798 @itemx -mstrict-align
11799 @opindex mno-strict-align
11800 @opindex mstrict-align
11801 On System V.4 and embedded PowerPC systems do not (do) assume that
11802 unaligned memory references will be handled by the system.
11803
11804 @item -mrelocatable
11805 @itemx -mno-relocatable
11806 @opindex mrelocatable
11807 @opindex mno-relocatable
11808 On embedded PowerPC systems generate code that allows (does not allow)
11809 the program to be relocated to a different address at runtime.  If you
11810 use @option{-mrelocatable} on any module, all objects linked together must
11811 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
11812
11813 @item -mrelocatable-lib
11814 @itemx -mno-relocatable-lib
11815 @opindex mrelocatable-lib
11816 @opindex mno-relocatable-lib
11817 On embedded PowerPC systems generate code that allows (does not allow)
11818 the program to be relocated to a different address at runtime.  Modules
11819 compiled with @option{-mrelocatable-lib} can be linked with either modules
11820 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
11821 with modules compiled with the @option{-mrelocatable} options.
11822
11823 @item -mno-toc
11824 @itemx -mtoc
11825 @opindex mno-toc
11826 @opindex mtoc
11827 On System V.4 and embedded PowerPC systems do not (do) assume that
11828 register 2 contains a pointer to a global area pointing to the addresses
11829 used in the program.
11830
11831 @item -mlittle
11832 @itemx -mlittle-endian
11833 @opindex mlittle
11834 @opindex mlittle-endian
11835 On System V.4 and embedded PowerPC systems compile code for the
11836 processor in little endian mode.  The @option{-mlittle-endian} option is
11837 the same as @option{-mlittle}.
11838
11839 @item -mbig
11840 @itemx -mbig-endian
11841 @opindex mbig
11842 @opindex mbig-endian
11843 On System V.4 and embedded PowerPC systems compile code for the
11844 processor in big endian mode.  The @option{-mbig-endian} option is
11845 the same as @option{-mbig}.
11846
11847 @item -mdynamic-no-pic
11848 @opindex mdynamic-no-pic
11849 On Darwin and Mac OS X systems, compile code so that it is not
11850 relocatable, but that its external references are relocatable.  The
11851 resulting code is suitable for applications, but not shared
11852 libraries.
11853
11854 @item -mprioritize-restricted-insns=@var{priority}
11855 @opindex mprioritize-restricted-insns
11856 This option controls the priority that is assigned to
11857 dispatch-slot restricted instructions during the second scheduling
11858 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
11859 @var{no/highest/second-highest} priority to dispatch slot restricted
11860 instructions.
11861
11862 @item -msched-costly-dep=@var{dependence_type}
11863 @opindex msched-costly-dep
11864 This option controls which dependences are considered costly
11865 by the target during instruction scheduling.  The argument
11866 @var{dependence_type} takes one of the following values:
11867 @var{no}: no dependence is costly,
11868 @var{all}: all dependences are costly,
11869 @var{true_store_to_load}: a true dependence from store to load is costly,
11870 @var{store_to_load}: any dependence from store to load is costly,
11871 @var{number}: any dependence which latency >= @var{number} is costly.
11872
11873 @item -minsert-sched-nops=@var{scheme}
11874 @opindex minsert-sched-nops
11875 This option controls which nop insertion scheme will be used during
11876 the second scheduling pass.  The argument @var{scheme} takes one of the
11877 following values:
11878 @var{no}: Don't insert nops.
11879 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
11880 according to the scheduler's grouping.
11881 @var{regroup_exact}: Insert nops to force costly dependent insns into
11882 separate groups.  Insert exactly as many nops as needed to force an insn
11883 to a new group, according to the estimated processor grouping.
11884 @var{number}: Insert nops to force costly dependent insns into
11885 separate groups.  Insert @var{number} nops to force an insn to a new group.
11886
11887 @item -mcall-sysv
11888 @opindex mcall-sysv
11889 On System V.4 and embedded PowerPC systems compile code using calling
11890 conventions that adheres to the March 1995 draft of the System V
11891 Application Binary Interface, PowerPC processor supplement.  This is the
11892 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
11893
11894 @item -mcall-sysv-eabi
11895 @opindex mcall-sysv-eabi
11896 Specify both @option{-mcall-sysv} and @option{-meabi} options.
11897
11898 @item -mcall-sysv-noeabi
11899 @opindex mcall-sysv-noeabi
11900 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
11901
11902 @item -mcall-solaris
11903 @opindex mcall-solaris
11904 On System V.4 and embedded PowerPC systems compile code for the Solaris
11905 operating system.
11906
11907 @item -mcall-linux
11908 @opindex mcall-linux
11909 On System V.4 and embedded PowerPC systems compile code for the
11910 Linux-based GNU system.
11911
11912 @item -mcall-gnu
11913 @opindex mcall-gnu
11914 On System V.4 and embedded PowerPC systems compile code for the
11915 Hurd-based GNU system.
11916
11917 @item -mcall-netbsd
11918 @opindex mcall-netbsd
11919 On System V.4 and embedded PowerPC systems compile code for the
11920 NetBSD operating system.
11921
11922 @item -maix-struct-return
11923 @opindex maix-struct-return
11924 Return all structures in memory (as specified by the AIX ABI)@.
11925
11926 @item -msvr4-struct-return
11927 @opindex msvr4-struct-return
11928 Return structures smaller than 8 bytes in registers (as specified by the
11929 SVR4 ABI)@.
11930
11931 @item -mabi=@var{abi-type}
11932 @opindex mabi
11933 Extend the current ABI with a particular extension, or remove such extension.
11934 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
11935 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
11936
11937 @item -mabi=spe
11938 @opindex mabi=spe
11939 Extend the current ABI with SPE ABI extensions.  This does not change
11940 the default ABI, instead it adds the SPE ABI extensions to the current
11941 ABI@.
11942
11943 @item -mabi=no-spe
11944 @opindex mabi=no-spe
11945 Disable Booke SPE ABI extensions for the current ABI@.
11946
11947 @item -mabi=ibmlongdouble
11948 @opindex mabi=ibmlongdouble
11949 Change the current ABI to use IBM extended precision long double.
11950 This is a PowerPC 32-bit SYSV ABI option.
11951
11952 @item -mabi=ieeelongdouble
11953 @opindex mabi=ieeelongdouble
11954 Change the current ABI to use IEEE extended precision long double.
11955 This is a PowerPC 32-bit Linux ABI option.
11956
11957 @item -mprototype
11958 @itemx -mno-prototype
11959 @opindex mprototype
11960 @opindex mno-prototype
11961 On System V.4 and embedded PowerPC systems assume that all calls to
11962 variable argument functions are properly prototyped.  Otherwise, the
11963 compiler must insert an instruction before every non prototyped call to
11964 set or clear bit 6 of the condition code register (@var{CR}) to
11965 indicate whether floating point values were passed in the floating point
11966 registers in case the function takes a variable arguments.  With
11967 @option{-mprototype}, only calls to prototyped variable argument functions
11968 will set or clear the bit.
11969
11970 @item -msim
11971 @opindex msim
11972 On embedded PowerPC systems, assume that the startup module is called
11973 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
11974 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
11975 configurations.
11976
11977 @item -mmvme
11978 @opindex mmvme
11979 On embedded PowerPC systems, assume that the startup module is called
11980 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
11981 @file{libc.a}.
11982
11983 @item -mads
11984 @opindex mads
11985 On embedded PowerPC systems, assume that the startup module is called
11986 @file{crt0.o} and the standard C libraries are @file{libads.a} and
11987 @file{libc.a}.
11988
11989 @item -myellowknife
11990 @opindex myellowknife
11991 On embedded PowerPC systems, assume that the startup module is called
11992 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
11993 @file{libc.a}.
11994
11995 @item -mvxworks
11996 @opindex mvxworks
11997 On System V.4 and embedded PowerPC systems, specify that you are
11998 compiling for a VxWorks system.
11999
12000 @item -mwindiss
12001 @opindex mwindiss
12002 Specify that you are compiling for the WindISS simulation environment.
12003
12004 @item -memb
12005 @opindex memb
12006 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
12007 header to indicate that @samp{eabi} extended relocations are used.
12008
12009 @item -meabi
12010 @itemx -mno-eabi
12011 @opindex meabi
12012 @opindex mno-eabi
12013 On System V.4 and embedded PowerPC systems do (do not) adhere to the
12014 Embedded Applications Binary Interface (eabi) which is a set of
12015 modifications to the System V.4 specifications.  Selecting @option{-meabi}
12016 means that the stack is aligned to an 8 byte boundary, a function
12017 @code{__eabi} is called to from @code{main} to set up the eabi
12018 environment, and the @option{-msdata} option can use both @code{r2} and
12019 @code{r13} to point to two separate small data areas.  Selecting
12020 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
12021 do not call an initialization function from @code{main}, and the
12022 @option{-msdata} option will only use @code{r13} to point to a single
12023 small data area.  The @option{-meabi} option is on by default if you
12024 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
12025
12026 @item -msdata=eabi
12027 @opindex msdata=eabi
12028 On System V.4 and embedded PowerPC systems, put small initialized
12029 @code{const} global and static data in the @samp{.sdata2} section, which
12030 is pointed to by register @code{r2}.  Put small initialized
12031 non-@code{const} global and static data in the @samp{.sdata} section,
12032 which is pointed to by register @code{r13}.  Put small uninitialized
12033 global and static data in the @samp{.sbss} section, which is adjacent to
12034 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
12035 incompatible with the @option{-mrelocatable} option.  The
12036 @option{-msdata=eabi} option also sets the @option{-memb} option.
12037
12038 @item -msdata=sysv
12039 @opindex msdata=sysv
12040 On System V.4 and embedded PowerPC systems, put small global and static
12041 data in the @samp{.sdata} section, which is pointed to by register
12042 @code{r13}.  Put small uninitialized global and static data in the
12043 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
12044 The @option{-msdata=sysv} option is incompatible with the
12045 @option{-mrelocatable} option.
12046
12047 @item -msdata=default
12048 @itemx -msdata
12049 @opindex msdata=default
12050 @opindex msdata
12051 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
12052 compile code the same as @option{-msdata=eabi}, otherwise compile code the
12053 same as @option{-msdata=sysv}.
12054
12055 @item -msdata-data
12056 @opindex msdata-data
12057 On System V.4 and embedded PowerPC systems, put small global
12058 data in the @samp{.sdata} section.  Put small uninitialized global
12059 data in the @samp{.sbss} section.  Do not use register @code{r13}
12060 to address small data however.  This is the default behavior unless
12061 other @option{-msdata} options are used.
12062
12063 @item -msdata=none
12064 @itemx -mno-sdata
12065 @opindex msdata=none
12066 @opindex mno-sdata
12067 On embedded PowerPC systems, put all initialized global and static data
12068 in the @samp{.data} section, and all uninitialized data in the
12069 @samp{.bss} section.
12070
12071 @item -G @var{num}
12072 @opindex G
12073 @cindex smaller data references (PowerPC)
12074 @cindex .sdata/.sdata2 references (PowerPC)
12075 On embedded PowerPC systems, put global and static items less than or
12076 equal to @var{num} bytes into the small data or bss sections instead of
12077 the normal data or bss section.  By default, @var{num} is 8.  The
12078 @option{-G @var{num}} switch is also passed to the linker.
12079 All modules should be compiled with the same @option{-G @var{num}} value.
12080
12081 @item -mregnames
12082 @itemx -mno-regnames
12083 @opindex mregnames
12084 @opindex mno-regnames
12085 On System V.4 and embedded PowerPC systems do (do not) emit register
12086 names in the assembly language output using symbolic forms.
12087
12088 @item -mlongcall
12089 @itemx -mno-longcall
12090 @opindex mlongcall
12091 @opindex mno-longcall
12092 By default assume that all calls are far away so that a longer more
12093 expensive calling sequence is required.  This is required for calls
12094 further than 32 megabytes (33,554,432 bytes) from the current location.
12095 A short call will be generated if the compiler knows
12096 the call cannot be that far away.  This setting can be overridden by
12097 the @code{shortcall} function attribute, or by @code{#pragma
12098 longcall(0)}.
12099
12100 Some linkers are capable of detecting out-of-range calls and generating
12101 glue code on the fly.  On these systems, long calls are unnecessary and
12102 generate slower code.  As of this writing, the AIX linker can do this,
12103 as can the GNU linker for PowerPC/64.  It is planned to add this feature
12104 to the GNU linker for 32-bit PowerPC systems as well.
12105
12106 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
12107 callee, L42'', plus a ``branch island'' (glue code).  The two target
12108 addresses represent the callee and the ``branch island''.  The
12109 Darwin/PPC linker will prefer the first address and generate a ``bl
12110 callee'' if the PPC ``bl'' instruction will reach the callee directly;
12111 otherwise, the linker will generate ``bl L42'' to call the ``branch
12112 island''.  The ``branch island'' is appended to the body of the
12113 calling function; it computes the full 32-bit address of the callee
12114 and jumps to it.
12115
12116 On Mach-O (Darwin) systems, this option directs the compiler emit to
12117 the glue for every direct call, and the Darwin linker decides whether
12118 to use or discard it.
12119
12120 In the future, we may cause GCC to ignore all longcall specifications
12121 when the linker is known to generate glue.
12122
12123 @item -pthread
12124 @opindex pthread
12125 Adds support for multithreading with the @dfn{pthreads} library.
12126 This option sets flags for both the preprocessor and linker.
12127
12128 @end table
12129
12130 @node S/390 and zSeries Options
12131 @subsection S/390 and zSeries Options
12132 @cindex S/390 and zSeries Options
12133
12134 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
12135
12136 @table @gcctabopt
12137 @item -mhard-float
12138 @itemx -msoft-float
12139 @opindex mhard-float
12140 @opindex msoft-float
12141 Use (do not use) the hardware floating-point instructions and registers
12142 for floating-point operations.  When @option{-msoft-float} is specified,
12143 functions in @file{libgcc.a} will be used to perform floating-point
12144 operations.  When @option{-mhard-float} is specified, the compiler
12145 generates IEEE floating-point instructions.  This is the default.
12146
12147 @item -mlong-double-64
12148 @itemx -mlong-double-128
12149 @opindex mlong-double-64
12150 @opindex mlong-double-128
12151 These switches control the size of @code{long double} type. A size
12152 of 64bit makes the @code{long double} type equivalent to the @code{double}
12153 type. This is the default.
12154
12155 @item -mbackchain
12156 @itemx -mno-backchain
12157 @opindex mbackchain
12158 @opindex mno-backchain
12159 Store (do not store) the address of the caller's frame as backchain pointer
12160 into the callee's stack frame.
12161 A backchain may be needed to allow debugging using tools that do not understand
12162 DWARF-2 call frame information.
12163 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
12164 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
12165 the backchain is placed into the topmost word of the 96/160 byte register
12166 save area.
12167
12168 In general, code compiled with @option{-mbackchain} is call-compatible with
12169 code compiled with @option{-mmo-backchain}; however, use of the backchain
12170 for debugging purposes usually requires that the whole binary is built with
12171 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
12172 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12173 to build a linux kernel use @option{-msoft-float}.
12174
12175 The default is to not maintain the backchain.
12176
12177 @item -mpacked-stack
12178 @item -mno-packed-stack
12179 @opindex mpacked-stack
12180 @opindex mno-packed-stack
12181 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
12182 specified, the compiler uses the all fields of the 96/160 byte register save
12183 area only for their default purpose; unused fields still take up stack space.
12184 When @option{-mpacked-stack} is specified, register save slots are densely
12185 packed at the top of the register save area; unused space is reused for other
12186 purposes, allowing for more efficient use of the available stack space.
12187 However, when @option{-mbackchain} is also in effect, the topmost word of
12188 the save area is always used to store the backchain, and the return address
12189 register is always saved two words below the backchain.
12190
12191 As long as the stack frame backchain is not used, code generated with
12192 @option{-mpacked-stack} is call-compatible with code generated with
12193 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
12194 S/390 or zSeries generated code that uses the stack frame backchain at run
12195 time, not just for debugging purposes.  Such code is not call-compatible
12196 with code compiled with @option{-mpacked-stack}.  Also, note that the
12197 combination of @option{-mbackchain},
12198 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
12199 to build a linux kernel use @option{-msoft-float}.
12200
12201 The default is to not use the packed stack layout.
12202
12203 @item -msmall-exec
12204 @itemx -mno-small-exec
12205 @opindex msmall-exec
12206 @opindex mno-small-exec
12207 Generate (or do not generate) code using the @code{bras} instruction
12208 to do subroutine calls.
12209 This only works reliably if the total executable size does not
12210 exceed 64k.  The default is to use the @code{basr} instruction instead,
12211 which does not have this limitation.
12212
12213 @item -m64
12214 @itemx -m31
12215 @opindex m64
12216 @opindex m31
12217 When @option{-m31} is specified, generate code compliant to the
12218 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
12219 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
12220 particular to generate 64-bit instructions.  For the @samp{s390}
12221 targets, the default is @option{-m31}, while the @samp{s390x}
12222 targets default to @option{-m64}.
12223
12224 @item -mzarch
12225 @itemx -mesa
12226 @opindex mzarch
12227 @opindex mesa
12228 When @option{-mzarch} is specified, generate code using the
12229 instructions available on z/Architecture.
12230 When @option{-mesa} is specified, generate code using the
12231 instructions available on ESA/390.  Note that @option{-mesa} is
12232 not possible with @option{-m64}.
12233 When generating code compliant to the GNU/Linux for S/390 ABI,
12234 the default is @option{-mesa}.  When generating code compliant
12235 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
12236
12237 @item -mmvcle
12238 @itemx -mno-mvcle
12239 @opindex mmvcle
12240 @opindex mno-mvcle
12241 Generate (or do not generate) code using the @code{mvcle} instruction
12242 to perform block moves.  When @option{-mno-mvcle} is specified,
12243 use a @code{mvc} loop instead.  This is the default unless optimizing for
12244 size.
12245
12246 @item -mdebug
12247 @itemx -mno-debug
12248 @opindex mdebug
12249 @opindex mno-debug
12250 Print (or do not print) additional debug information when compiling.
12251 The default is to not print debug information.
12252
12253 @item -march=@var{cpu-type}
12254 @opindex march
12255 Generate code that will run on @var{cpu-type}, which is the name of a system
12256 representing a certain processor type.  Possible values for
12257 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
12258 When generating code using the instructions available on z/Architecture,
12259 the default is @option{-march=z900}.  Otherwise, the default is
12260 @option{-march=g5}.
12261
12262 @item -mtune=@var{cpu-type}
12263 @opindex mtune
12264 Tune to @var{cpu-type} everything applicable about the generated code,
12265 except for the ABI and the set of available instructions.
12266 The list of @var{cpu-type} values is the same as for @option{-march}.
12267 The default is the value used for @option{-march}.
12268
12269 @item -mtpf-trace
12270 @itemx -mno-tpf-trace
12271 @opindex mtpf-trace
12272 @opindex mno-tpf-trace
12273 Generate code that adds (does not add) in TPF OS specific branches to trace
12274 routines in the operating system.  This option is off by default, even
12275 when compiling for the TPF OS@.
12276
12277 @item -mfused-madd
12278 @itemx -mno-fused-madd
12279 @opindex mfused-madd
12280 @opindex mno-fused-madd
12281 Generate code that uses (does not use) the floating point multiply and
12282 accumulate instructions.  These instructions are generated by default if
12283 hardware floating point is used.
12284
12285 @item -mwarn-framesize=@var{framesize}
12286 @opindex mwarn-framesize
12287 Emit a warning if the current function exceeds the given frame size.  Because
12288 this is a compile time check it doesn't need to be a real problem when the program
12289 runs.  It is intended to identify functions which most probably cause
12290 a stack overflow.  It is useful to be used in an environment with limited stack
12291 size e.g.@: the linux kernel.
12292
12293 @item -mwarn-dynamicstack
12294 @opindex mwarn-dynamicstack
12295 Emit a warning if the function calls alloca or uses dynamically
12296 sized arrays.  This is generally a bad idea with a limited stack size.
12297
12298 @item -mstack-guard=@var{stack-guard}
12299 @item -mstack-size=@var{stack-size}
12300 @opindex mstack-guard
12301 @opindex mstack-size
12302 These arguments always have to be used in conjunction.  If they are present the s390
12303 back end emits additional instructions in the function prologue which trigger a trap
12304 if the stack size is @var{stack-guard} bytes above the @var{stack-size}
12305 (remember that the stack on s390 grows downward).  These options are intended to
12306 be used to help debugging stack overflow problems.  The additionally emitted code
12307 causes only little overhead and hence can also be used in production like systems
12308 without greater performance degradation.  The given values have to be exact
12309 powers of 2 and @var{stack-size} has to be greater than @var{stack-guard} without
12310 exceeding 64k.
12311 In order to be efficient the extra code makes the assumption that the stack starts
12312 at an address aligned to the value given by @var{stack-size}.
12313 @end table
12314
12315 @node Score Options
12316 @subsection Score Options
12317 @cindex Score Options
12318
12319 These options are defined for Score implementations:
12320
12321 @table @gcctabopt
12322 @item -mel
12323 @opindex -mel
12324 Compile code for little endian mode. 
12325
12326 @item -meb
12327 @opindex meb
12328 Compile code for big endian mode.  This is the default.
12329
12330 @item -mmac
12331 @opindex mmac
12332 Enable the use of multiply-accumulate instructions. Disabled by default. 
12333
12334 @item -mscore5u
12335 @opindex mscore5u
12336 Specify the SCORE5U of the target architecture.
12337
12338 @item -mscore7
12339 @opindex mscore7
12340 Specify the SCORE7 of the target architecture. This is the default.
12341 @end table
12342
12343 @node SH Options
12344 @subsection SH Options
12345
12346 These @samp{-m} options are defined for the SH implementations:
12347
12348 @table @gcctabopt
12349 @item -m1
12350 @opindex m1
12351 Generate code for the SH1.
12352
12353 @item -m2
12354 @opindex m2
12355 Generate code for the SH2.
12356
12357 @item -m2e
12358 Generate code for the SH2e.
12359
12360 @item -m3
12361 @opindex m3
12362 Generate code for the SH3.
12363
12364 @item -m3e
12365 @opindex m3e
12366 Generate code for the SH3e.
12367
12368 @item -m4-nofpu
12369 @opindex m4-nofpu
12370 Generate code for the SH4 without a floating-point unit.
12371
12372 @item -m4-single-only
12373 @opindex m4-single-only
12374 Generate code for the SH4 with a floating-point unit that only
12375 supports single-precision arithmetic.
12376
12377 @item -m4-single
12378 @opindex m4-single
12379 Generate code for the SH4 assuming the floating-point unit is in
12380 single-precision mode by default.
12381
12382 @item -m4
12383 @opindex m4
12384 Generate code for the SH4.
12385
12386 @item -m4a-nofpu
12387 @opindex m4a-nofpu
12388 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
12389 floating-point unit is not used.
12390
12391 @item -m4a-single-only
12392 @opindex m4a-single-only
12393 Generate code for the SH4a, in such a way that no double-precision
12394 floating point operations are used.
12395
12396 @item -m4a-single
12397 @opindex m4a-single
12398 Generate code for the SH4a assuming the floating-point unit is in
12399 single-precision mode by default.
12400
12401 @item -m4a
12402 @opindex m4a
12403 Generate code for the SH4a.
12404
12405 @item -m4al
12406 @opindex m4al
12407 Same as @option{-m4a-nofpu}, except that it implicitly passes
12408 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
12409 instructions at the moment.
12410
12411 @item -mb
12412 @opindex mb
12413 Compile code for the processor in big endian mode.
12414
12415 @item -ml
12416 @opindex ml
12417 Compile code for the processor in little endian mode.
12418
12419 @item -mdalign
12420 @opindex mdalign
12421 Align doubles at 64-bit boundaries.  Note that this changes the calling
12422 conventions, and thus some functions from the standard C library will
12423 not work unless you recompile it first with @option{-mdalign}.
12424
12425 @item -mrelax
12426 @opindex mrelax
12427 Shorten some address references at link time, when possible; uses the
12428 linker option @option{-relax}.
12429
12430 @item -mbigtable
12431 @opindex mbigtable
12432 Use 32-bit offsets in @code{switch} tables.  The default is to use
12433 16-bit offsets.
12434
12435 @item -mfmovd
12436 @opindex mfmovd
12437 Enable the use of the instruction @code{fmovd}.
12438
12439 @item -mhitachi
12440 @opindex mhitachi
12441 Comply with the calling conventions defined by Renesas.
12442
12443 @item -mrenesas
12444 @opindex mhitachi
12445 Comply with the calling conventions defined by Renesas.
12446
12447 @item -mno-renesas
12448 @opindex mhitachi
12449 Comply with the calling conventions defined for GCC before the Renesas
12450 conventions were available.  This option is the default for all
12451 targets of the SH toolchain except for @samp{sh-symbianelf}.
12452
12453 @item -mnomacsave
12454 @opindex mnomacsave
12455 Mark the @code{MAC} register as call-clobbered, even if
12456 @option{-mhitachi} is given.
12457
12458 @item -mieee
12459 @opindex mieee
12460 Increase IEEE-compliance of floating-point code.
12461 At the moment, this is equivalent to @option{-fno-finite-math-only}.
12462 When generating 16 bit SH opcodes, getting IEEE-conforming results for
12463 comparisons of NANs / infinities incurs extra overhead in every
12464 floating point comparison, therefore the default is set to
12465 @option{-ffinite-math-only}.
12466
12467 @item -minline-ic_invalidate
12468 @opindex minline-ic_invalidate
12469 Inline code to invalidate instruction cache entries after setting up
12470 nested function trampolines.
12471 This option has no effect if -musermode is in effect and the selected
12472 code generation option (e.g. -m4) does not allow the use of the icbi
12473 instruction.
12474 If the selected code generation option does not allow the use of the icbi
12475 instruction, and -musermode is not in effect, the inlined code will
12476 manipulate the instruction cache address array directly with an associative
12477 write.  This not only requires privileged mode, but it will also
12478 fail if the cache line had been mapped via the TLB and has become unmapped.
12479
12480 @item -misize
12481 @opindex misize
12482 Dump instruction size and location in the assembly code.
12483
12484 @item -mpadstruct
12485 @opindex mpadstruct
12486 This option is deprecated.  It pads structures to multiple of 4 bytes,
12487 which is incompatible with the SH ABI@.
12488
12489 @item -mspace
12490 @opindex mspace
12491 Optimize for space instead of speed.  Implied by @option{-Os}.
12492
12493 @item -mprefergot
12494 @opindex mprefergot
12495 When generating position-independent code, emit function calls using
12496 the Global Offset Table instead of the Procedure Linkage Table.
12497
12498 @item -musermode
12499 @opindex musermode
12500 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
12501 if the inlined code would not work in user mode.
12502 This is the default when the target is @code{sh-*-linux*}.
12503
12504 @item -multcost=@var{number}
12505 @opindex multcost=@var{number}
12506 Set the cost to assume for a multiply insn.
12507
12508 @item -mdiv=@var{strategy}
12509 @opindex mdiv=@var{strategy}
12510 Set the division strategy to use for SHmedia code.  @var{strategy} must be
12511 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
12512 inv:call2, inv:fp .
12513 "fp" performs the operation in floating point.  This has a very high latency,
12514 but needs only a few instructions, so it might be a good choice if
12515 your code has enough easily exploitable ILP to allow the compiler to
12516 schedule the floating point instructions together with other instructions.
12517 Division by zero causes a floating point exception.
12518 "inv" uses integer operations to calculate the inverse of the divisor,
12519 and then multiplies the dividend with the inverse.  This strategy allows
12520 cse and hoisting of the inverse calculation.  Division by zero calculates
12521 an unspecified result, but does not trap.
12522 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
12523 have been found, or if the entire operation has been hoisted to the same
12524 place, the last stages of the inverse calculation are intertwined with the
12525 final multiply to reduce the overall latency, at the expense of using a few
12526 more instructions, and thus offering fewer scheduling opportunities with
12527 other code.
12528 "call" calls a library function that usually implements the inv:minlat
12529 strategy.
12530 This gives high code density for m5-*media-nofpu compilations.
12531 "call2" uses a different entry point of the same library function, where it
12532 assumes that a pointer to a lookup table has already been set up, which
12533 exposes the pointer load to cse / code hoisting optimizations.
12534 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
12535 code generation, but if the code stays unoptimized, revert to the "call",
12536 "call2", or "fp" strategies, respectively.  Note that the
12537 potentially-trapping side effect of division by zero is carried by a
12538 separate instruction, so it is possible that all the integer instructions
12539 are hoisted out, but the marker for the side effect stays where it is.
12540 A recombination to fp operations or a call is not possible in that case.
12541 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
12542 that the inverse calculation was nor separated from the multiply, they speed
12543 up division where the dividend fits into 20 bits (plus sign where applicable),
12544 by inserting a test to skip a number of operations in this case; this test
12545 slows down the case of larger dividends.  inv20u assumes the case of a such
12546 a small dividend to be unlikely, and inv20l assumes it to be likely.
12547
12548 @item -mdivsi3_libfunc=@var{name}
12549 @opindex mdivsi3_libfunc=@var{name}
12550 Set the name of the library function used for 32 bit signed division to
12551 @var{name}.  This only affect the name used in the call and inv:call
12552 division strategies, and the compiler will still expect the same
12553 sets of input/output/clobbered registers as if this option was not present.
12554
12555 @item -madjust-unroll
12556 @opindex madjust-unroll
12557 Throttle unrolling to avoid thrashing target registers.
12558 This option only has an effect if the gcc code base supports the
12559 TARGET_ADJUST_UNROLL_MAX target hook.
12560
12561 @item -mindexed-addressing
12562 @opindex mindexed-addressing
12563 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
12564 This is only safe if the hardware and/or OS implement 32 bit wrap-around
12565 semantics for the indexed addressing mode.  The architecture allows the
12566 implementation of processors with 64 bit MMU, which the OS could use to
12567 get 32 bit addressing, but since no current hardware implementation supports
12568 this or any other way to make the indexed addressing mode safe to use in
12569 the 32 bit ABI, the default is -mno-indexed-addressing.
12570
12571 @item -mgettrcost=@var{number}
12572 @opindex mgettrcost=@var{number}
12573 Set the cost assumed for the gettr instruction to @var{number}.
12574 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
12575
12576 @item -mpt-fixed
12577 @opindex mpt-fixed
12578 Assume pt* instructions won't trap.  This will generally generate better
12579 scheduled code, but is unsafe on current hardware.  The current architecture
12580 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
12581 This has the unintentional effect of making it unsafe to schedule ptabs /
12582 ptrel before a branch, or hoist it out of a loop.  For example,
12583 __do_global_ctors, a part of libgcc that runs constructors at program
12584 startup, calls functions in a list which is delimited by -1.  With the
12585 -mpt-fixed option, the ptabs will be done before testing against -1.
12586 That means that all the constructors will be run a bit quicker, but when
12587 the loop comes to the end of the list, the program crashes because ptabs
12588 loads -1 into a target register.  Since this option is unsafe for any
12589 hardware implementing the current architecture specification, the default
12590 is -mno-pt-fixed.  Unless the user specifies a specific cost with
12591 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
12592 this deters register allocation using target registers for storing
12593 ordinary integers.
12594
12595 @item -minvalid-symbols
12596 @opindex minvalid-symbols
12597 Assume symbols might be invalid.  Ordinary function symbols generated by
12598 the compiler will always be valid to load with movi/shori/ptabs or
12599 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
12600 to generate symbols that will cause ptabs / ptrel to trap.
12601 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
12602 It will then prevent cross-basic-block cse, hoisting and most scheduling
12603 of symbol loads.  The default is @option{-mno-invalid-symbols}.
12604 @end table
12605
12606 @node SPARC Options
12607 @subsection SPARC Options
12608 @cindex SPARC options
12609
12610 These @samp{-m} options are supported on the SPARC:
12611
12612 @table @gcctabopt
12613 @item -mno-app-regs
12614 @itemx -mapp-regs
12615 @opindex mno-app-regs
12616 @opindex mapp-regs
12617 Specify @option{-mapp-regs} to generate output using the global registers
12618 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
12619 is the default.
12620
12621 To be fully SVR4 ABI compliant at the cost of some performance loss,
12622 specify @option{-mno-app-regs}.  You should compile libraries and system
12623 software with this option.
12624
12625 @item -mfpu
12626 @itemx -mhard-float
12627 @opindex mfpu
12628 @opindex mhard-float
12629 Generate output containing floating point instructions.  This is the
12630 default.
12631
12632 @item -mno-fpu
12633 @itemx -msoft-float
12634 @opindex mno-fpu
12635 @opindex msoft-float
12636 Generate output containing library calls for floating point.
12637 @strong{Warning:} the requisite libraries are not available for all SPARC
12638 targets.  Normally the facilities of the machine's usual C compiler are
12639 used, but this cannot be done directly in cross-compilation.  You must make
12640 your own arrangements to provide suitable library functions for
12641 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
12642 @samp{sparclite-*-*} do provide software floating point support.
12643
12644 @option{-msoft-float} changes the calling convention in the output file;
12645 therefore, it is only useful if you compile @emph{all} of a program with
12646 this option.  In particular, you need to compile @file{libgcc.a}, the
12647 library that comes with GCC, with @option{-msoft-float} in order for
12648 this to work.
12649
12650 @item -mhard-quad-float
12651 @opindex mhard-quad-float
12652 Generate output containing quad-word (long double) floating point
12653 instructions.
12654
12655 @item -msoft-quad-float
12656 @opindex msoft-quad-float
12657 Generate output containing library calls for quad-word (long double)
12658 floating point instructions.  The functions called are those specified
12659 in the SPARC ABI@.  This is the default.
12660
12661 As of this writing, there are no SPARC implementations that have hardware
12662 support for the quad-word floating point instructions.  They all invoke
12663 a trap handler for one of these instructions, and then the trap handler
12664 emulates the effect of the instruction.  Because of the trap handler overhead,
12665 this is much slower than calling the ABI library routines.  Thus the
12666 @option{-msoft-quad-float} option is the default.
12667
12668 @item -mno-unaligned-doubles
12669 @itemx -munaligned-doubles
12670 @opindex mno-unaligned-doubles
12671 @opindex munaligned-doubles
12672 Assume that doubles have 8 byte alignment.  This is the default.
12673
12674 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
12675 alignment only if they are contained in another type, or if they have an
12676 absolute address.  Otherwise, it assumes they have 4 byte alignment.
12677 Specifying this option avoids some rare compatibility problems with code
12678 generated by other compilers.  It is not the default because it results
12679 in a performance loss, especially for floating point code.
12680
12681 @item -mno-faster-structs
12682 @itemx -mfaster-structs
12683 @opindex mno-faster-structs
12684 @opindex mfaster-structs
12685 With @option{-mfaster-structs}, the compiler assumes that structures
12686 should have 8 byte alignment.  This enables the use of pairs of
12687 @code{ldd} and @code{std} instructions for copies in structure
12688 assignment, in place of twice as many @code{ld} and @code{st} pairs.
12689 However, the use of this changed alignment directly violates the SPARC
12690 ABI@.  Thus, it's intended only for use on targets where the developer
12691 acknowledges that their resulting code will not be directly in line with
12692 the rules of the ABI@.
12693
12694 @item -mimpure-text
12695 @opindex mimpure-text
12696 @option{-mimpure-text}, used in addition to @option{-shared}, tells
12697 the compiler to not pass @option{-z text} to the linker when linking a
12698 shared object.  Using this option, you can link position-dependent
12699 code into a shared object.
12700
12701 @option{-mimpure-text} suppresses the ``relocations remain against
12702 allocatable but non-writable sections'' linker error message.
12703 However, the necessary relocations will trigger copy-on-write, and the
12704 shared object is not actually shared across processes.  Instead of
12705 using @option{-mimpure-text}, you should compile all source code with
12706 @option{-fpic} or @option{-fPIC}.
12707
12708 This option is only available on SunOS and Solaris.
12709
12710 @item -mcpu=@var{cpu_type}
12711 @opindex mcpu
12712 Set the instruction set, register set, and instruction scheduling parameters
12713 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
12714 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
12715 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
12716 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
12717 @samp{ultrasparc3}, and @samp{niagara}.
12718
12719 Default instruction scheduling parameters are used for values that select
12720 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
12721 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
12722
12723 Here is a list of each supported architecture and their supported
12724 implementations.
12725
12726 @smallexample
12727     v7:             cypress
12728     v8:             supersparc, hypersparc
12729     sparclite:      f930, f934, sparclite86x
12730     sparclet:       tsc701
12731     v9:             ultrasparc, ultrasparc3, niagara
12732 @end smallexample
12733
12734 By default (unless configured otherwise), GCC generates code for the V7
12735 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
12736 additionally optimizes it for the Cypress CY7C602 chip, as used in the
12737 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
12738 SPARCStation 1, 2, IPX etc.
12739
12740 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
12741 architecture.  The only difference from V7 code is that the compiler emits
12742 the integer multiply and integer divide instructions which exist in SPARC-V8
12743 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
12744 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
12745 2000 series.
12746
12747 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
12748 the SPARC architecture.  This adds the integer multiply, integer divide step
12749 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
12750 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
12751 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
12752 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
12753 MB86934 chip, which is the more recent SPARClite with FPU@.
12754
12755 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
12756 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
12757 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
12758 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
12759 optimizes it for the TEMIC SPARClet chip.
12760
12761 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
12762 architecture.  This adds 64-bit integer and floating-point move instructions,
12763 3 additional floating-point condition code registers and conditional move
12764 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
12765 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
12766 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
12767 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
12768 @option{-mcpu=niagara}, the compiler additionally optimizes it for
12769 Sun UltraSPARC T1 chips.
12770
12771 @item -mtune=@var{cpu_type}
12772 @opindex mtune
12773 Set the instruction scheduling parameters for machine type
12774 @var{cpu_type}, but do not set the instruction set or register set that the
12775 option @option{-mcpu=@var{cpu_type}} would.
12776
12777 The same values for @option{-mcpu=@var{cpu_type}} can be used for
12778 @option{-mtune=@var{cpu_type}}, but the only useful values are those
12779 that select a particular cpu implementation.  Those are @samp{cypress},
12780 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
12781 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
12782 @samp{ultrasparc3}, and @samp{niagara}.
12783
12784 @item -mv8plus
12785 @itemx -mno-v8plus
12786 @opindex mv8plus
12787 @opindex mno-v8plus
12788 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
12789 difference from the V8 ABI is that the global and out registers are
12790 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
12791 mode for all SPARC-V9 processors.
12792
12793 @item -mvis
12794 @itemx -mno-vis
12795 @opindex mvis
12796 @opindex mno-vis
12797 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
12798 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
12799 @end table
12800
12801 These @samp{-m} options are supported in addition to the above
12802 on SPARC-V9 processors in 64-bit environments:
12803
12804 @table @gcctabopt
12805 @item -mlittle-endian
12806 @opindex mlittle-endian
12807 Generate code for a processor running in little-endian mode.  It is only
12808 available for a few configurations and most notably not on Solaris and Linux.
12809
12810 @item -m32
12811 @itemx -m64
12812 @opindex m32
12813 @opindex m64
12814 Generate code for a 32-bit or 64-bit environment.
12815 The 32-bit environment sets int, long and pointer to 32 bits.
12816 The 64-bit environment sets int to 32 bits and long and pointer
12817 to 64 bits.
12818
12819 @item -mcmodel=medlow
12820 @opindex mcmodel=medlow
12821 Generate code for the Medium/Low code model: 64-bit addresses, programs
12822 must be linked in the low 32 bits of memory.  Programs can be statically
12823 or dynamically linked.
12824
12825 @item -mcmodel=medmid
12826 @opindex mcmodel=medmid
12827 Generate code for the Medium/Middle code model: 64-bit addresses, programs
12828 must be linked in the low 44 bits of memory, the text and data segments must
12829 be less than 2GB in size and the data segment must be located within 2GB of
12830 the text segment.
12831
12832 @item -mcmodel=medany
12833 @opindex mcmodel=medany
12834 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
12835 may be linked anywhere in memory, the text and data segments must be less
12836 than 2GB in size and the data segment must be located within 2GB of the
12837 text segment.
12838
12839 @item -mcmodel=embmedany
12840 @opindex mcmodel=embmedany
12841 Generate code for the Medium/Anywhere code model for embedded systems:
12842 64-bit addresses, the text and data segments must be less than 2GB in
12843 size, both starting anywhere in memory (determined at link time).  The
12844 global register %g4 points to the base of the data segment.  Programs
12845 are statically linked and PIC is not supported.
12846
12847 @item -mstack-bias
12848 @itemx -mno-stack-bias
12849 @opindex mstack-bias
12850 @opindex mno-stack-bias
12851 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
12852 frame pointer if present, are offset by @minus{}2047 which must be added back
12853 when making stack frame references.  This is the default in 64-bit mode.
12854 Otherwise, assume no such offset is present.
12855 @end table
12856
12857 These switches are supported in addition to the above on Solaris:
12858
12859 @table @gcctabopt
12860 @item -threads
12861 @opindex threads
12862 Add support for multithreading using the Solaris threads library.  This
12863 option sets flags for both the preprocessor and linker.  This option does
12864 not affect the thread safety of object code produced by the compiler or
12865 that of libraries supplied with it.
12866
12867 @item -pthreads
12868 @opindex pthreads
12869 Add support for multithreading using the POSIX threads library.  This
12870 option sets flags for both the preprocessor and linker.  This option does
12871 not affect the thread safety of object code produced  by the compiler or
12872 that of libraries supplied with it.
12873
12874 @item -pthread
12875 @opindex pthread
12876 This is a synonym for @option{-pthreads}.
12877 @end table
12878
12879 @node SPU Options
12880 @subsection SPU Options
12881 @cindex SPU options
12882
12883 These @samp{-m} options are supported on the SPU:
12884
12885 @table @gcctabopt
12886 @item -mwarn-reloc
12887 @itemx -merror-reloc
12888 @opindex mwarn-reloc
12889 @opindex merror-reloc
12890
12891 The loader for SPU does not handle dynamic relocations.  By default, GCC
12892 will give an error when it generates code that requires a dynamic
12893 relocation.  @option{-mno-error-reloc} disables the error,
12894 @option{-mwarn-reloc} will generate a warning instead.
12895
12896 @item -msafe-dma
12897 @itemx -munsafe-dma
12898 @opindex msafe-dma
12899 @opindex munsafe-dma
12900
12901 Instructions which initiate or test completion of DMA must not be
12902 reordered with respect to loads and stores of the memory which is being
12903 accessed.  Users typically address this problem using the volatile
12904 keyword, but that can lead to inefficient code in places where the
12905 memory is known to not change.  Rather than mark the memory as volatile
12906 we treat the DMA instructions as potentially effecting all memory.  With
12907 @option{-munsafe-dma} users must use the volatile keyword to protect
12908 memory accesses.
12909
12910 @item -mbranch-hints
12911 @opindex mbranch-hints
12912
12913 By default, GCC will generate a branch hint instruction to avoid
12914 pipeline stalls for always taken or probably taken branches.  A hint
12915 will not be generated closer than 8 instructions away from its branch.
12916 There is little reason to disable them, except for debugging purposes,
12917 or to make an object a little bit smaller.
12918
12919 @item -msmall-mem
12920 @itemx -mlarge-mem
12921 @opindex msmall-mem
12922 @opindex mlarge-mem
12923
12924 By default, GCC generates code assuming that addresses are never larger
12925 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
12926 a full 32 bit address.
12927
12928 @item -mstdmain
12929 @opindex mstdmain
12930
12931 By default, GCC links against startup code that assumes the SPU-style
12932 main function interface (which has an unconventional parameter list).
12933 With @option{-mstdmain}, GCC will link your program against startup
12934 code that assumes a C99-style interface to @code{main}, including a
12935 local copy of @code{argv} strings.
12936
12937 @item -mfixed-range=@var{register-range}
12938 @opindex mfixed-range
12939 Generate code treating the given register range as fixed registers.
12940 A fixed register is one that the register allocator can not use.  This is
12941 useful when compiling kernel code.  A register range is specified as
12942 two registers separated by a dash.  Multiple register ranges can be
12943 specified separated by a comma.
12944
12945 @end table
12946
12947 @node System V Options
12948 @subsection Options for System V
12949
12950 These additional options are available on System V Release 4 for
12951 compatibility with other compilers on those systems:
12952
12953 @table @gcctabopt
12954 @item -G
12955 @opindex G
12956 Create a shared object.
12957 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
12958
12959 @item -Qy
12960 @opindex Qy
12961 Identify the versions of each tool used by the compiler, in a
12962 @code{.ident} assembler directive in the output.
12963
12964 @item -Qn
12965 @opindex Qn
12966 Refrain from adding @code{.ident} directives to the output file (this is
12967 the default).
12968
12969 @item -YP,@var{dirs}
12970 @opindex YP
12971 Search the directories @var{dirs}, and no others, for libraries
12972 specified with @option{-l}.
12973
12974 @item -Ym,@var{dir}
12975 @opindex Ym
12976 Look in the directory @var{dir} to find the M4 preprocessor.
12977 The assembler uses this option.
12978 @c This is supposed to go with a -Yd for predefined M4 macro files, but
12979 @c the generic assembler that comes with Solaris takes just -Ym.
12980 @end table
12981
12982 @node TMS320C3x/C4x Options
12983 @subsection TMS320C3x/C4x Options
12984 @cindex TMS320C3x/C4x Options
12985
12986 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
12987
12988 @table @gcctabopt
12989
12990 @item -mcpu=@var{cpu_type}
12991 @opindex mcpu
12992 Set the instruction set, register set, and instruction scheduling
12993 parameters for machine type @var{cpu_type}.  Supported values for
12994 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
12995 @samp{c44}.  The default is @samp{c40} to generate code for the
12996 TMS320C40.
12997
12998 @item -mbig-memory
12999 @itemx -mbig
13000 @itemx -msmall-memory
13001 @itemx -msmall
13002 @opindex mbig-memory
13003 @opindex mbig
13004 @opindex msmall-memory
13005 @opindex msmall
13006 Generates code for the big or small memory model.  The small memory
13007 model assumed that all data fits into one 64K word page.  At run-time
13008 the data page (DP) register must be set to point to the 64K page
13009 containing the .bss and .data program sections.  The big memory model is
13010 the default and requires reloading of the DP register for every direct
13011 memory access.
13012
13013 @item -mbk
13014 @itemx -mno-bk
13015 @opindex mbk
13016 @opindex mno-bk
13017 Allow (disallow) allocation of general integer operands into the block
13018 count register BK@.
13019
13020 @item -mdb
13021 @itemx -mno-db
13022 @opindex mdb
13023 @opindex mno-db
13024 Enable (disable) generation of code using decrement and branch,
13025 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
13026 on the safe side, this is disabled for the C3x, since the maximum
13027 iteration count on the C3x is @math{2^{23} + 1} (but who iterates loops more than
13028 @math{2^{23}} times on the C3x?).  Note that GCC will try to reverse a loop so
13029 that it can utilize the decrement and branch instruction, but will give
13030 up if there is more than one memory reference in the loop.  Thus a loop
13031 where the loop counter is decremented can generate slightly more
13032 efficient code, in cases where the RPTB instruction cannot be utilized.
13033
13034 @item -mdp-isr-reload
13035 @itemx -mparanoid
13036 @opindex mdp-isr-reload
13037 @opindex mparanoid
13038 Force the DP register to be saved on entry to an interrupt service
13039 routine (ISR), reloaded to point to the data section, and restored on
13040 exit from the ISR@.  This should not be required unless someone has
13041 violated the small memory model by modifying the DP register, say within
13042 an object library.
13043
13044 @item -mmpyi
13045 @itemx -mno-mpyi
13046 @opindex mmpyi
13047 @opindex mno-mpyi
13048 For the C3x use the 24-bit MPYI instruction for integer multiplies
13049 instead of a library call to guarantee 32-bit results.  Note that if one
13050 of the operands is a constant, then the multiplication will be performed
13051 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
13052 then squaring operations are performed inline instead of a library call.
13053
13054 @item -mfast-fix
13055 @itemx -mno-fast-fix
13056 @opindex mfast-fix
13057 @opindex mno-fast-fix
13058 The C3x/C4x FIX instruction to convert a floating point value to an
13059 integer value chooses the nearest integer less than or equal to the
13060 floating point value rather than to the nearest integer.  Thus if the
13061 floating point number is negative, the result will be incorrectly
13062 truncated an additional code is necessary to detect and correct this
13063 case.  This option can be used to disable generation of the additional
13064 code required to correct the result.
13065
13066 @item -mrptb
13067 @itemx -mno-rptb
13068 @opindex mrptb
13069 @opindex mno-rptb
13070 Enable (disable) generation of repeat block sequences using the RPTB
13071 instruction for zero overhead looping.  The RPTB construct is only used
13072 for innermost loops that do not call functions or jump across the loop
13073 boundaries.  There is no advantage having nested RPTB loops due to the
13074 overhead required to save and restore the RC, RS, and RE registers.
13075 This is enabled by default with @option{-O2}.
13076
13077 @item -mrpts=@var{count}
13078 @itemx -mno-rpts
13079 @opindex mrpts
13080 @opindex mno-rpts
13081 Enable (disable) the use of the single instruction repeat instruction
13082 RPTS@.  If a repeat block contains a single instruction, and the loop
13083 count can be guaranteed to be less than the value @var{count}, GCC will
13084 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
13085 then a RPTS will be emitted even if the loop count cannot be determined
13086 at compile time.  Note that the repeated instruction following RPTS does
13087 not have to be reloaded from memory each iteration, thus freeing up the
13088 CPU buses for operands.  However, since interrupts are blocked by this
13089 instruction, it is disabled by default.
13090
13091 @item -mloop-unsigned
13092 @itemx -mno-loop-unsigned
13093 @opindex mloop-unsigned
13094 @opindex mno-loop-unsigned
13095 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
13096 is @math{2^{31} + 1} since these instructions test if the iteration count is
13097 negative to terminate the loop.  If the iteration count is unsigned
13098 there is a possibility than the @math{2^{31} + 1} maximum iteration count may be
13099 exceeded.  This switch allows an unsigned iteration count.
13100
13101 @item -mti
13102 @opindex mti
13103 Try to emit an assembler syntax that the TI assembler (asm30) is happy
13104 with.  This also enforces compatibility with the API employed by the TI
13105 C3x C compiler.  For example, long doubles are passed as structures
13106 rather than in floating point registers.
13107
13108 @item -mregparm
13109 @itemx -mmemparm
13110 @opindex mregparm
13111 @opindex mmemparm
13112 Generate code that uses registers (stack) for passing arguments to functions.
13113 By default, arguments are passed in registers where possible rather
13114 than by pushing arguments on to the stack.
13115
13116 @item -mparallel-insns
13117 @itemx -mno-parallel-insns
13118 @opindex mparallel-insns
13119 @opindex mno-parallel-insns
13120 Allow the generation of parallel instructions.  This is enabled by
13121 default with @option{-O2}.
13122
13123 @item -mparallel-mpy
13124 @itemx -mno-parallel-mpy
13125 @opindex mparallel-mpy
13126 @opindex mno-parallel-mpy
13127 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
13128 provided @option{-mparallel-insns} is also specified.  These instructions have
13129 tight register constraints which can pessimize the code generation
13130 of large functions.
13131
13132 @end table
13133
13134 @node V850 Options
13135 @subsection V850 Options
13136 @cindex V850 Options
13137
13138 These @samp{-m} options are defined for V850 implementations:
13139
13140 @table @gcctabopt
13141 @item -mlong-calls
13142 @itemx -mno-long-calls
13143 @opindex mlong-calls
13144 @opindex mno-long-calls
13145 Treat all calls as being far away (near).  If calls are assumed to be
13146 far away, the compiler will always load the functions address up into a
13147 register, and call indirect through the pointer.
13148
13149 @item -mno-ep
13150 @itemx -mep
13151 @opindex mno-ep
13152 @opindex mep
13153 Do not optimize (do optimize) basic blocks that use the same index
13154 pointer 4 or more times to copy pointer into the @code{ep} register, and
13155 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
13156 option is on by default if you optimize.
13157
13158 @item -mno-prolog-function
13159 @itemx -mprolog-function
13160 @opindex mno-prolog-function
13161 @opindex mprolog-function
13162 Do not use (do use) external functions to save and restore registers
13163 at the prologue and epilogue of a function.  The external functions
13164 are slower, but use less code space if more than one function saves
13165 the same number of registers.  The @option{-mprolog-function} option
13166 is on by default if you optimize.
13167
13168 @item -mspace
13169 @opindex mspace
13170 Try to make the code as small as possible.  At present, this just turns
13171 on the @option{-mep} and @option{-mprolog-function} options.
13172
13173 @item -mtda=@var{n}
13174 @opindex mtda
13175 Put static or global variables whose size is @var{n} bytes or less into
13176 the tiny data area that register @code{ep} points to.  The tiny data
13177 area can hold up to 256 bytes in total (128 bytes for byte references).
13178
13179 @item -msda=@var{n}
13180 @opindex msda
13181 Put static or global variables whose size is @var{n} bytes or less into
13182 the small data area that register @code{gp} points to.  The small data
13183 area can hold up to 64 kilobytes.
13184
13185 @item -mzda=@var{n}
13186 @opindex mzda
13187 Put static or global variables whose size is @var{n} bytes or less into
13188 the first 32 kilobytes of memory.
13189
13190 @item -mv850
13191 @opindex mv850
13192 Specify that the target processor is the V850.
13193
13194 @item -mbig-switch
13195 @opindex mbig-switch
13196 Generate code suitable for big switch tables.  Use this option only if
13197 the assembler/linker complain about out of range branches within a switch
13198 table.
13199
13200 @item -mapp-regs
13201 @opindex mapp-regs
13202 This option will cause r2 and r5 to be used in the code generated by
13203 the compiler.  This setting is the default.
13204
13205 @item -mno-app-regs
13206 @opindex mno-app-regs
13207 This option will cause r2 and r5 to be treated as fixed registers.
13208
13209 @item -mv850e1
13210 @opindex mv850e1
13211 Specify that the target processor is the V850E1.  The preprocessor
13212 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
13213 this option is used.
13214
13215 @item -mv850e
13216 @opindex mv850e
13217 Specify that the target processor is the V850E@.  The preprocessor
13218 constant @samp{__v850e__} will be defined if this option is used.
13219
13220 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
13221 are defined then a default target processor will be chosen and the
13222 relevant @samp{__v850*__} preprocessor constant will be defined.
13223
13224 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
13225 defined, regardless of which processor variant is the target.
13226
13227 @item -mdisable-callt
13228 @opindex mdisable-callt
13229 This option will suppress generation of the CALLT instruction for the
13230 v850e and v850e1 flavors of the v850 architecture.  The default is
13231 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
13232
13233 @end table
13234
13235 @node VAX Options
13236 @subsection VAX Options
13237 @cindex VAX options
13238
13239 These @samp{-m} options are defined for the VAX:
13240
13241 @table @gcctabopt
13242 @item -munix
13243 @opindex munix
13244 Do not output certain jump instructions (@code{aobleq} and so on)
13245 that the Unix assembler for the VAX cannot handle across long
13246 ranges.
13247
13248 @item -mgnu
13249 @opindex mgnu
13250 Do output those jump instructions, on the assumption that you
13251 will assemble with the GNU assembler.
13252
13253 @item -mg
13254 @opindex mg
13255 Output code for g-format floating point numbers instead of d-format.
13256 @end table
13257
13258 @node x86-64 Options
13259 @subsection x86-64 Options
13260 @cindex x86-64 options
13261
13262 These are listed under @xref{i386 and x86-64 Options}.
13263
13264 @node Xstormy16 Options
13265 @subsection Xstormy16 Options
13266 @cindex Xstormy16 Options
13267
13268 These options are defined for Xstormy16:
13269
13270 @table @gcctabopt
13271 @item -msim
13272 @opindex msim
13273 Choose startup files and linker script suitable for the simulator.
13274 @end table
13275
13276 @node Xtensa Options
13277 @subsection Xtensa Options
13278 @cindex Xtensa Options
13279
13280 These options are supported for Xtensa targets:
13281
13282 @table @gcctabopt
13283 @item -mconst16
13284 @itemx -mno-const16
13285 @opindex mconst16
13286 @opindex mno-const16
13287 Enable or disable use of @code{CONST16} instructions for loading
13288 constant values.  The @code{CONST16} instruction is currently not a
13289 standard option from Tensilica.  When enabled, @code{CONST16}
13290 instructions are always used in place of the standard @code{L32R}
13291 instructions.  The use of @code{CONST16} is enabled by default only if
13292 the @code{L32R} instruction is not available.
13293
13294 @item -mfused-madd
13295 @itemx -mno-fused-madd
13296 @opindex mfused-madd
13297 @opindex mno-fused-madd
13298 Enable or disable use of fused multiply/add and multiply/subtract
13299 instructions in the floating-point option.  This has no effect if the
13300 floating-point option is not also enabled.  Disabling fused multiply/add
13301 and multiply/subtract instructions forces the compiler to use separate
13302 instructions for the multiply and add/subtract operations.  This may be
13303 desirable in some cases where strict IEEE 754-compliant results are
13304 required: the fused multiply add/subtract instructions do not round the
13305 intermediate result, thereby producing results with @emph{more} bits of
13306 precision than specified by the IEEE standard.  Disabling fused multiply
13307 add/subtract instructions also ensures that the program output is not
13308 sensitive to the compiler's ability to combine multiply and add/subtract
13309 operations.
13310
13311 @item -mtext-section-literals
13312 @itemx -mno-text-section-literals
13313 @opindex mtext-section-literals
13314 @opindex mno-text-section-literals
13315 Control the treatment of literal pools.  The default is
13316 @option{-mno-text-section-literals}, which places literals in a separate
13317 section in the output file.  This allows the literal pool to be placed
13318 in a data RAM/ROM, and it also allows the linker to combine literal
13319 pools from separate object files to remove redundant literals and
13320 improve code size.  With @option{-mtext-section-literals}, the literals
13321 are interspersed in the text section in order to keep them as close as
13322 possible to their references.  This may be necessary for large assembly
13323 files.
13324
13325 @item -mtarget-align
13326 @itemx -mno-target-align
13327 @opindex mtarget-align
13328 @opindex mno-target-align
13329 When this option is enabled, GCC instructs the assembler to
13330 automatically align instructions to reduce branch penalties at the
13331 expense of some code density.  The assembler attempts to widen density
13332 instructions to align branch targets and the instructions following call
13333 instructions.  If there are not enough preceding safe density
13334 instructions to align a target, no widening will be performed.  The
13335 default is @option{-mtarget-align}.  These options do not affect the
13336 treatment of auto-aligned instructions like @code{LOOP}, which the
13337 assembler will always align, either by widening density instructions or
13338 by inserting no-op instructions.
13339
13340 @item -mlongcalls
13341 @itemx -mno-longcalls
13342 @opindex mlongcalls
13343 @opindex mno-longcalls
13344 When this option is enabled, GCC instructs the assembler to translate
13345 direct calls to indirect calls unless it can determine that the target
13346 of a direct call is in the range allowed by the call instruction.  This
13347 translation typically occurs for calls to functions in other source
13348 files.  Specifically, the assembler translates a direct @code{CALL}
13349 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
13350 The default is @option{-mno-longcalls}.  This option should be used in
13351 programs where the call target can potentially be out of range.  This
13352 option is implemented in the assembler, not the compiler, so the
13353 assembly code generated by GCC will still show direct call
13354 instructions---look at the disassembled object code to see the actual
13355 instructions.  Note that the assembler will use an indirect call for
13356 every cross-file call, not just those that really will be out of range.
13357 @end table
13358
13359 @node zSeries Options
13360 @subsection zSeries Options
13361 @cindex zSeries options
13362
13363 These are listed under @xref{S/390 and zSeries Options}.
13364
13365 @node Code Gen Options
13366 @section Options for Code Generation Conventions
13367 @cindex code generation conventions
13368 @cindex options, code generation
13369 @cindex run-time options
13370
13371 These machine-independent options control the interface conventions
13372 used in code generation.
13373
13374 Most of them have both positive and negative forms; the negative form
13375 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
13376 one of the forms is listed---the one which is not the default.  You
13377 can figure out the other form by either removing @samp{no-} or adding
13378 it.
13379
13380 @table @gcctabopt
13381 @item -fbounds-check
13382 @opindex fbounds-check
13383 For front-ends that support it, generate additional code to check that
13384 indices used to access arrays are within the declared range.  This is
13385 currently only supported by the Java and Fortran front-ends, where
13386 this option defaults to true and false respectively.
13387
13388 @item -ftrapv
13389 @opindex ftrapv
13390 This option generates traps for signed overflow on addition, subtraction,
13391 multiplication operations.
13392
13393 @item -fwrapv
13394 @opindex fwrapv
13395 This option instructs the compiler to assume that signed arithmetic
13396 overflow of addition, subtraction and multiplication wraps around
13397 using twos-complement representation.  This flag enables some optimizations
13398 and disables others.  This option is enabled by default for the Java
13399 front-end, as required by the Java language specification.
13400
13401 @item -fexceptions
13402 @opindex fexceptions
13403 Enable exception handling.  Generates extra code needed to propagate
13404 exceptions.  For some targets, this implies GCC will generate frame
13405 unwind information for all functions, which can produce significant data
13406 size overhead, although it does not affect execution.  If you do not
13407 specify this option, GCC will enable it by default for languages like
13408 C++ which normally require exception handling, and disable it for
13409 languages like C that do not normally require it.  However, you may need
13410 to enable this option when compiling C code that needs to interoperate
13411 properly with exception handlers written in C++.  You may also wish to
13412 disable this option if you are compiling older C++ programs that don't
13413 use exception handling.
13414
13415 @item -fnon-call-exceptions
13416 @opindex fnon-call-exceptions
13417 Generate code that allows trapping instructions to throw exceptions.
13418 Note that this requires platform-specific runtime support that does
13419 not exist everywhere.  Moreover, it only allows @emph{trapping}
13420 instructions to throw exceptions, i.e.@: memory references or floating
13421 point instructions.  It does not allow exceptions to be thrown from
13422 arbitrary signal handlers such as @code{SIGALRM}.
13423
13424 @item -funwind-tables
13425 @opindex funwind-tables
13426 Similar to @option{-fexceptions}, except that it will just generate any needed
13427 static data, but will not affect the generated code in any other way.
13428 You will normally not enable this option; instead, a language processor
13429 that needs this handling would enable it on your behalf.
13430
13431 @item -fasynchronous-unwind-tables
13432 @opindex fasynchronous-unwind-tables
13433 Generate unwind table in dwarf2 format, if supported by target machine.  The
13434 table is exact at each instruction boundary, so it can be used for stack
13435 unwinding from asynchronous events (such as debugger or garbage collector).
13436
13437 @item -fpcc-struct-return
13438 @opindex fpcc-struct-return
13439 Return ``short'' @code{struct} and @code{union} values in memory like
13440 longer ones, rather than in registers.  This convention is less
13441 efficient, but it has the advantage of allowing intercallability between
13442 GCC-compiled files and files compiled with other compilers, particularly
13443 the Portable C Compiler (pcc).
13444
13445 The precise convention for returning structures in memory depends
13446 on the target configuration macros.
13447
13448 Short structures and unions are those whose size and alignment match
13449 that of some integer type.
13450
13451 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
13452 switch is not binary compatible with code compiled with the
13453 @option{-freg-struct-return} switch.
13454 Use it to conform to a non-default application binary interface.
13455
13456 @item -freg-struct-return
13457 @opindex freg-struct-return
13458 Return @code{struct} and @code{union} values in registers when possible.
13459 This is more efficient for small structures than
13460 @option{-fpcc-struct-return}.
13461
13462 If you specify neither @option{-fpcc-struct-return} nor
13463 @option{-freg-struct-return}, GCC defaults to whichever convention is
13464 standard for the target.  If there is no standard convention, GCC
13465 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
13466 the principal compiler.  In those cases, we can choose the standard, and
13467 we chose the more efficient register return alternative.
13468
13469 @strong{Warning:} code compiled with the @option{-freg-struct-return}
13470 switch is not binary compatible with code compiled with the
13471 @option{-fpcc-struct-return} switch.
13472 Use it to conform to a non-default application binary interface.
13473
13474 @item -fshort-enums
13475 @opindex fshort-enums
13476 Allocate to an @code{enum} type only as many bytes as it needs for the
13477 declared range of possible values.  Specifically, the @code{enum} type
13478 will be equivalent to the smallest integer type which has enough room.
13479
13480 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
13481 code that is not binary compatible with code generated without that switch.
13482 Use it to conform to a non-default application binary interface.
13483
13484 @item -fshort-double
13485 @opindex fshort-double
13486 Use the same size for @code{double} as for @code{float}.
13487
13488 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
13489 code that is not binary compatible with code generated without that switch.
13490 Use it to conform to a non-default application binary interface.
13491
13492 @item -fshort-wchar
13493 @opindex fshort-wchar
13494 Override the underlying type for @samp{wchar_t} to be @samp{short
13495 unsigned int} instead of the default for the target.  This option is
13496 useful for building programs to run under WINE@.
13497
13498 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
13499 code that is not binary compatible with code generated without that switch.
13500 Use it to conform to a non-default application binary interface.
13501
13502 @item -fno-common
13503 @opindex fno-common
13504 In C, allocate even uninitialized global variables in the data section of the
13505 object file, rather than generating them as common blocks.  This has the
13506 effect that if the same variable is declared (without @code{extern}) in
13507 two different compilations, you will get an error when you link them.
13508 The only reason this might be useful is if you wish to verify that the
13509 program will work on other systems which always work this way.
13510
13511 @item -fno-ident
13512 @opindex fno-ident
13513 Ignore the @samp{#ident} directive.
13514
13515 @item -finhibit-size-directive
13516 @opindex finhibit-size-directive
13517 Don't output a @code{.size} assembler directive, or anything else that
13518 would cause trouble if the function is split in the middle, and the
13519 two halves are placed at locations far apart in memory.  This option is
13520 used when compiling @file{crtstuff.c}; you should not need to use it
13521 for anything else.
13522
13523 @item -fverbose-asm
13524 @opindex fverbose-asm
13525 Put extra commentary information in the generated assembly code to
13526 make it more readable.  This option is generally only of use to those
13527 who actually need to read the generated assembly code (perhaps while
13528 debugging the compiler itself).
13529
13530 @option{-fno-verbose-asm}, the default, causes the
13531 extra information to be omitted and is useful when comparing two assembler
13532 files.
13533
13534 @item -frecord-gcc-switches
13535 @opindex frecord-gcc-switches
13536 This switch causes the command line that was used to invoke the
13537 compiler to be recorded into the object file that is being created.
13538 This switch is only implemented on some targets and the exact format
13539 of the recording is target and binary file format dependent, but it
13540 usually takes the form of a section containing ASCII text.  This
13541 switch is related to the @option{-fverbose-asm} switch, but that
13542 switch only records information in the assembler output file as
13543 comments, so it never reaches the object file.
13544
13545 @item -fpic
13546 @opindex fpic
13547 @cindex global offset table
13548 @cindex PIC
13549 Generate position-independent code (PIC) suitable for use in a shared
13550 library, if supported for the target machine.  Such code accesses all
13551 constant addresses through a global offset table (GOT)@.  The dynamic
13552 loader resolves the GOT entries when the program starts (the dynamic
13553 loader is not part of GCC; it is part of the operating system).  If
13554 the GOT size for the linked executable exceeds a machine-specific
13555 maximum size, you get an error message from the linker indicating that
13556 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
13557 instead.  (These maximums are 8k on the SPARC and 32k
13558 on the m68k and RS/6000.  The 386 has no such limit.)
13559
13560 Position-independent code requires special support, and therefore works
13561 only on certain machines.  For the 386, GCC supports PIC for System V
13562 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
13563 position-independent.
13564
13565 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13566 are defined to 1.
13567
13568 @item -fPIC
13569 @opindex fPIC
13570 If supported for the target machine, emit position-independent code,
13571 suitable for dynamic linking and avoiding any limit on the size of the
13572 global offset table.  This option makes a difference on the m68k,
13573 PowerPC and SPARC@.
13574
13575 Position-independent code requires special support, and therefore works
13576 only on certain machines.
13577
13578 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
13579 are defined to 2.
13580
13581 @item -fpie
13582 @itemx -fPIE
13583 @opindex fpie
13584 @opindex fPIE
13585 These options are similar to @option{-fpic} and @option{-fPIC}, but
13586 generated position independent code can be only linked into executables.
13587 Usually these options are used when @option{-pie} GCC option will be
13588 used during linking.
13589
13590 @item -fno-jump-tables
13591 @opindex fno-jump-tables
13592 Do not use jump tables for switch statements even where it would be
13593 more efficient than other code generation strategies.  This option is
13594 of use in conjunction with @option{-fpic} or @option{-fPIC} for
13595 building code which forms part of a dynamic linker and cannot
13596 reference the address of a jump table.  On some targets, jump tables
13597 do not require a GOT and this option is not needed.
13598
13599 @item -ffixed-@var{reg}
13600 @opindex ffixed
13601 Treat the register named @var{reg} as a fixed register; generated code
13602 should never refer to it (except perhaps as a stack pointer, frame
13603 pointer or in some other fixed role).
13604
13605 @var{reg} must be the name of a register.  The register names accepted
13606 are machine-specific and are defined in the @code{REGISTER_NAMES}
13607 macro in the machine description macro file.
13608
13609 This flag does not have a negative form, because it specifies a
13610 three-way choice.
13611
13612 @item -fcall-used-@var{reg}
13613 @opindex fcall-used
13614 Treat the register named @var{reg} as an allocable register that is
13615 clobbered by function calls.  It may be allocated for temporaries or
13616 variables that do not live across a call.  Functions compiled this way
13617 will not save and restore the register @var{reg}.
13618
13619 It is an error to used this flag with the frame pointer or stack pointer.
13620 Use of this flag for other registers that have fixed pervasive roles in
13621 the machine's execution model will produce disastrous results.
13622
13623 This flag does not have a negative form, because it specifies a
13624 three-way choice.
13625
13626 @item -fcall-saved-@var{reg}
13627 @opindex fcall-saved
13628 Treat the register named @var{reg} as an allocable register saved by
13629 functions.  It may be allocated even for temporaries or variables that
13630 live across a call.  Functions compiled this way will save and restore
13631 the register @var{reg} if they use it.
13632
13633 It is an error to used this flag with the frame pointer or stack pointer.
13634 Use of this flag for other registers that have fixed pervasive roles in
13635 the machine's execution model will produce disastrous results.
13636
13637 A different sort of disaster will result from the use of this flag for
13638 a register in which function values may be returned.
13639
13640 This flag does not have a negative form, because it specifies a
13641 three-way choice.
13642
13643 @item -fpack-struct[=@var{n}]
13644 @opindex fpack-struct
13645 Without a value specified, pack all structure members together without
13646 holes.  When a value is specified (which must be a small power of two), pack
13647 structure members according to this value, representing the maximum
13648 alignment (that is, objects with default alignment requirements larger than
13649 this will be output potentially unaligned at the next fitting location.
13650
13651 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
13652 code that is not binary compatible with code generated without that switch.
13653 Additionally, it makes the code suboptimal.
13654 Use it to conform to a non-default application binary interface.
13655
13656 @item -finstrument-functions
13657 @opindex finstrument-functions
13658 Generate instrumentation calls for entry and exit to functions.  Just
13659 after function entry and just before function exit, the following
13660 profiling functions will be called with the address of the current
13661 function and its call site.  (On some platforms,
13662 @code{__builtin_return_address} does not work beyond the current
13663 function, so the call site information may not be available to the
13664 profiling functions otherwise.)
13665
13666 @smallexample
13667 void __cyg_profile_func_enter (void *this_fn,
13668                                void *call_site);
13669 void __cyg_profile_func_exit  (void *this_fn,
13670                                void *call_site);
13671 @end smallexample
13672
13673 The first argument is the address of the start of the current function,
13674 which may be looked up exactly in the symbol table.
13675
13676 This instrumentation is also done for functions expanded inline in other
13677 functions.  The profiling calls will indicate where, conceptually, the
13678 inline function is entered and exited.  This means that addressable
13679 versions of such functions must be available.  If all your uses of a
13680 function are expanded inline, this may mean an additional expansion of
13681 code size.  If you use @samp{extern inline} in your C code, an
13682 addressable version of such functions must be provided.  (This is
13683 normally the case anyways, but if you get lucky and the optimizer always
13684 expands the functions inline, you might have gotten away without
13685 providing static copies.)
13686
13687 A function may be given the attribute @code{no_instrument_function}, in
13688 which case this instrumentation will not be done.  This can be used, for
13689 example, for the profiling functions listed above, high-priority
13690 interrupt routines, and any functions from which the profiling functions
13691 cannot safely be called (perhaps signal handlers, if the profiling
13692 routines generate output or allocate memory).
13693
13694 @item -fstack-check
13695 @opindex fstack-check
13696 Generate code to verify that you do not go beyond the boundary of the
13697 stack.  You should specify this flag if you are running in an
13698 environment with multiple threads, but only rarely need to specify it in
13699 a single-threaded environment since stack overflow is automatically
13700 detected on nearly all systems if there is only one stack.
13701
13702 Note that this switch does not actually cause checking to be done; the
13703 operating system must do that.  The switch causes generation of code
13704 to ensure that the operating system sees the stack being extended.
13705
13706 @item -fstack-limit-register=@var{reg}
13707 @itemx -fstack-limit-symbol=@var{sym}
13708 @itemx -fno-stack-limit
13709 @opindex fstack-limit-register
13710 @opindex fstack-limit-symbol
13711 @opindex fno-stack-limit
13712 Generate code to ensure that the stack does not grow beyond a certain value,
13713 either the value of a register or the address of a symbol.  If the stack
13714 would grow beyond the value, a signal is raised.  For most targets,
13715 the signal is raised before the stack overruns the boundary, so
13716 it is possible to catch the signal without taking special precautions.
13717
13718 For instance, if the stack starts at absolute address @samp{0x80000000}
13719 and grows downwards, you can use the flags
13720 @option{-fstack-limit-symbol=__stack_limit} and
13721 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
13722 of 128KB@.  Note that this may only work with the GNU linker.
13723
13724 @cindex aliasing of parameters
13725 @cindex parameters, aliased
13726 @item -fargument-alias
13727 @itemx -fargument-noalias
13728 @itemx -fargument-noalias-global
13729 @itemx -fargument-noalias-anything
13730 @opindex fargument-alias
13731 @opindex fargument-noalias
13732 @opindex fargument-noalias-global
13733 @opindex fargument-noalias-anything
13734 Specify the possible relationships among parameters and between
13735 parameters and global data.
13736
13737 @option{-fargument-alias} specifies that arguments (parameters) may
13738 alias each other and may alias global storage.@*
13739 @option{-fargument-noalias} specifies that arguments do not alias
13740 each other, but may alias global storage.@*
13741 @option{-fargument-noalias-global} specifies that arguments do not
13742 alias each other and do not alias global storage.
13743 @option{-fargument-noalias-anything} specifies that arguments do not
13744 alias any other storage.
13745
13746 Each language will automatically use whatever option is required by
13747 the language standard.  You should not need to use these options yourself.
13748
13749 @item -fleading-underscore
13750 @opindex fleading-underscore
13751 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
13752 change the way C symbols are represented in the object file.  One use
13753 is to help link with legacy assembly code.
13754
13755 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
13756 generate code that is not binary compatible with code generated without that
13757 switch.  Use it to conform to a non-default application binary interface.
13758 Not all targets provide complete support for this switch.
13759
13760 @item -ftls-model=@var{model}
13761 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
13762 The @var{model} argument should be one of @code{global-dynamic},
13763 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
13764
13765 The default without @option{-fpic} is @code{initial-exec}; with
13766 @option{-fpic} the default is @code{global-dynamic}.
13767
13768 @item -fvisibility=@var{default|internal|hidden|protected}
13769 @opindex fvisibility
13770 Set the default ELF image symbol visibility to the specified option---all
13771 symbols will be marked with this unless overridden within the code.
13772 Using this feature can very substantially improve linking and
13773 load times of shared object libraries, produce more optimized
13774 code, provide near-perfect API export and prevent symbol clashes.
13775 It is @strong{strongly} recommended that you use this in any shared objects
13776 you distribute.
13777
13778 Despite the nomenclature, @code{default} always means public ie;
13779 available to be linked against from outside the shared object.
13780 @code{protected} and @code{internal} are pretty useless in real-world
13781 usage so the only other commonly used option will be @code{hidden}.
13782 The default if @option{-fvisibility} isn't specified is
13783 @code{default}, i.e., make every
13784 symbol public---this causes the same behavior as previous versions of
13785 GCC@.
13786
13787 A good explanation of the benefits offered by ensuring ELF
13788 symbols have the correct visibility is given by ``How To Write
13789 Shared Libraries'' by Ulrich Drepper (which can be found at
13790 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
13791 solution made possible by this option to marking things hidden when
13792 the default is public is to make the default hidden and mark things
13793 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
13794 and @code{__attribute__ ((visibility("default")))} instead of
13795 @code{__declspec(dllexport)} you get almost identical semantics with
13796 identical syntax.  This is a great boon to those working with
13797 cross-platform projects.
13798
13799 For those adding visibility support to existing code, you may find
13800 @samp{#pragma GCC visibility} of use.  This works by you enclosing
13801 the declarations you wish to set visibility for with (for example)
13802 @samp{#pragma GCC visibility push(hidden)} and
13803 @samp{#pragma GCC visibility pop}.
13804 Bear in mind that symbol visibility should be viewed @strong{as
13805 part of the API interface contract} and thus all new code should
13806 always specify visibility when it is not the default ie; declarations
13807 only for use within the local DSO should @strong{always} be marked explicitly
13808 as hidden as so to avoid PLT indirection overheads---making this
13809 abundantly clear also aids readability and self-documentation of the code.
13810 Note that due to ISO C++ specification requirements, operator new and
13811 operator delete must always be of default visibility.
13812
13813 Be aware that headers from outside your project, in particular system
13814 headers and headers from any other library you use, may not be
13815 expecting to be compiled with visibility other than the default.  You
13816 may need to explicitly say @samp{#pragma GCC visibility push(default)}
13817 before including any such headers.
13818
13819 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
13820 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
13821 no modifications.  However, this means that calls to @samp{extern}
13822 functions with no explicit visibility will use the PLT, so it is more
13823 effective to use @samp{__attribute ((visibility))} and/or
13824 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
13825 declarations should be treated as hidden.
13826
13827 Note that @samp{-fvisibility} does affect C++ vague linkage
13828 entities. This means that, for instance, an exception class that will
13829 be thrown between DSOs must be explicitly marked with default
13830 visibility so that the @samp{type_info} nodes will be unified between
13831 the DSOs.
13832
13833 An overview of these techniques, their benefits and how to use them
13834 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
13835
13836 @end table
13837
13838 @c man end
13839
13840 @node Environment Variables
13841 @section Environment Variables Affecting GCC
13842 @cindex environment variables
13843
13844 @c man begin ENVIRONMENT
13845 This section describes several environment variables that affect how GCC
13846 operates.  Some of them work by specifying directories or prefixes to use
13847 when searching for various kinds of files.  Some are used to specify other
13848 aspects of the compilation environment.
13849
13850 Note that you can also specify places to search using options such as
13851 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
13852 take precedence over places specified using environment variables, which
13853 in turn take precedence over those specified by the configuration of GCC@.
13854 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
13855 GNU Compiler Collection (GCC) Internals}.
13856
13857 @table @env
13858 @item LANG
13859 @itemx LC_CTYPE
13860 @c @itemx LC_COLLATE
13861 @itemx LC_MESSAGES
13862 @c @itemx LC_MONETARY
13863 @c @itemx LC_NUMERIC
13864 @c @itemx LC_TIME
13865 @itemx LC_ALL
13866 @findex LANG
13867 @findex LC_CTYPE
13868 @c @findex LC_COLLATE
13869 @findex LC_MESSAGES
13870 @c @findex LC_MONETARY
13871 @c @findex LC_NUMERIC
13872 @c @findex LC_TIME
13873 @findex LC_ALL
13874 @cindex locale
13875 These environment variables control the way that GCC uses
13876 localization information that allow GCC to work with different
13877 national conventions.  GCC inspects the locale categories
13878 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
13879 so.  These locale categories can be set to any value supported by your
13880 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
13881 Kingdom encoded in UTF-8.
13882
13883 The @env{LC_CTYPE} environment variable specifies character
13884 classification.  GCC uses it to determine the character boundaries in
13885 a string; this is needed for some multibyte encodings that contain quote
13886 and escape characters that would otherwise be interpreted as a string
13887 end or escape.
13888
13889 The @env{LC_MESSAGES} environment variable specifies the language to
13890 use in diagnostic messages.
13891
13892 If the @env{LC_ALL} environment variable is set, it overrides the value
13893 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
13894 and @env{LC_MESSAGES} default to the value of the @env{LANG}
13895 environment variable.  If none of these variables are set, GCC
13896 defaults to traditional C English behavior.
13897
13898 @item TMPDIR
13899 @findex TMPDIR
13900 If @env{TMPDIR} is set, it specifies the directory to use for temporary
13901 files.  GCC uses temporary files to hold the output of one stage of
13902 compilation which is to be used as input to the next stage: for example,
13903 the output of the preprocessor, which is the input to the compiler
13904 proper.
13905
13906 @item GCC_EXEC_PREFIX
13907 @findex GCC_EXEC_PREFIX
13908 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
13909 names of the subprograms executed by the compiler.  No slash is added
13910 when this prefix is combined with the name of a subprogram, but you can
13911 specify a prefix that ends with a slash if you wish.
13912
13913 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
13914 an appropriate prefix to use based on the pathname it was invoked with.
13915
13916 If GCC cannot find the subprogram using the specified prefix, it
13917 tries looking in the usual places for the subprogram.
13918
13919 The default value of @env{GCC_EXEC_PREFIX} is
13920 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the value
13921 of @code{prefix} when you ran the @file{configure} script.
13922
13923 Other prefixes specified with @option{-B} take precedence over this prefix.
13924
13925 This prefix is also used for finding files such as @file{crt0.o} that are
13926 used for linking.
13927
13928 In addition, the prefix is used in an unusual way in finding the
13929 directories to search for header files.  For each of the standard
13930 directories whose name normally begins with @samp{/usr/local/lib/gcc}
13931 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
13932 replacing that beginning with the specified prefix to produce an
13933 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
13934 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
13935 These alternate directories are searched first; the standard directories
13936 come next.
13937
13938 @item COMPILER_PATH
13939 @findex COMPILER_PATH
13940 The value of @env{COMPILER_PATH} is a colon-separated list of
13941 directories, much like @env{PATH}.  GCC tries the directories thus
13942 specified when searching for subprograms, if it can't find the
13943 subprograms using @env{GCC_EXEC_PREFIX}.
13944
13945 @item LIBRARY_PATH
13946 @findex LIBRARY_PATH
13947 The value of @env{LIBRARY_PATH} is a colon-separated list of
13948 directories, much like @env{PATH}.  When configured as a native compiler,
13949 GCC tries the directories thus specified when searching for special
13950 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
13951 using GCC also uses these directories when searching for ordinary
13952 libraries for the @option{-l} option (but directories specified with
13953 @option{-L} come first).
13954
13955 @item LANG
13956 @findex LANG
13957 @cindex locale definition
13958 This variable is used to pass locale information to the compiler.  One way in
13959 which this information is used is to determine the character set to be used
13960 when character literals, string literals and comments are parsed in C and C++.
13961 When the compiler is configured to allow multibyte characters,
13962 the following values for @env{LANG} are recognized:
13963
13964 @table @samp
13965 @item C-JIS
13966 Recognize JIS characters.
13967 @item C-SJIS
13968 Recognize SJIS characters.
13969 @item C-EUCJP
13970 Recognize EUCJP characters.
13971 @end table
13972
13973 If @env{LANG} is not defined, or if it has some other value, then the
13974 compiler will use mblen and mbtowc as defined by the default locale to
13975 recognize and translate multibyte characters.
13976 @end table
13977
13978 @noindent
13979 Some additional environments variables affect the behavior of the
13980 preprocessor.
13981
13982 @include cppenv.texi
13983
13984 @c man end
13985
13986 @node Precompiled Headers
13987 @section Using Precompiled Headers
13988 @cindex precompiled headers
13989 @cindex speed of compilation
13990
13991 Often large projects have many header files that are included in every
13992 source file.  The time the compiler takes to process these header files
13993 over and over again can account for nearly all of the time required to
13994 build the project.  To make builds faster, GCC allows users to
13995 `precompile' a header file; then, if builds can use the precompiled
13996 header file they will be much faster.
13997
13998 To create a precompiled header file, simply compile it as you would any
13999 other file, if necessary using the @option{-x} option to make the driver
14000 treat it as a C or C++ header file.  You will probably want to use a
14001 tool like @command{make} to keep the precompiled header up-to-date when
14002 the headers it contains change.
14003
14004 A precompiled header file will be searched for when @code{#include} is
14005 seen in the compilation.  As it searches for the included file
14006 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
14007 compiler looks for a precompiled header in each directory just before it
14008 looks for the include file in that directory.  The name searched for is
14009 the name specified in the @code{#include} with @samp{.gch} appended.  If
14010 the precompiled header file can't be used, it is ignored.
14011
14012 For instance, if you have @code{#include "all.h"}, and you have
14013 @file{all.h.gch} in the same directory as @file{all.h}, then the
14014 precompiled header file will be used if possible, and the original
14015 header will be used otherwise.
14016
14017 Alternatively, you might decide to put the precompiled header file in a
14018 directory and use @option{-I} to ensure that directory is searched
14019 before (or instead of) the directory containing the original header.
14020 Then, if you want to check that the precompiled header file is always
14021 used, you can put a file of the same name as the original header in this
14022 directory containing an @code{#error} command.
14023
14024 This also works with @option{-include}.  So yet another way to use
14025 precompiled headers, good for projects not designed with precompiled
14026 header files in mind, is to simply take most of the header files used by
14027 a project, include them from another header file, precompile that header
14028 file, and @option{-include} the precompiled header.  If the header files
14029 have guards against multiple inclusion, they will be skipped because
14030 they've already been included (in the precompiled header).
14031
14032 If you need to precompile the same header file for different
14033 languages, targets, or compiler options, you can instead make a
14034 @emph{directory} named like @file{all.h.gch}, and put each precompiled
14035 header in the directory, perhaps using @option{-o}.  It doesn't matter
14036 what you call the files in the directory, every precompiled header in
14037 the directory will be considered.  The first precompiled header
14038 encountered in the directory that is valid for this compilation will
14039 be used; they're searched in no particular order.
14040
14041 There are many other possibilities, limited only by your imagination,
14042 good sense, and the constraints of your build system.
14043
14044 A precompiled header file can be used only when these conditions apply:
14045
14046 @itemize
14047 @item
14048 Only one precompiled header can be used in a particular compilation.
14049
14050 @item
14051 A precompiled header can't be used once the first C token is seen.  You
14052 can have preprocessor directives before a precompiled header; you can
14053 even include a precompiled header from inside another header, so long as
14054 there are no C tokens before the @code{#include}.
14055
14056 @item
14057 The precompiled header file must be produced for the same language as
14058 the current compilation.  You can't use a C precompiled header for a C++
14059 compilation.
14060
14061 @item
14062 The precompiled header file must have been produced by the same compiler
14063 binary as the current compilation is using.
14064
14065 @item
14066 Any macros defined before the precompiled header is included must
14067 either be defined in the same way as when the precompiled header was
14068 generated, or must not affect the precompiled header, which usually
14069 means that they don't appear in the precompiled header at all.
14070
14071 The @option{-D} option is one way to define a macro before a
14072 precompiled header is included; using a @code{#define} can also do it.
14073 There are also some options that define macros implicitly, like
14074 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
14075 defined this way.
14076
14077 @item If debugging information is output when using the precompiled
14078 header, using @option{-g} or similar, the same kind of debugging information
14079 must have been output when building the precompiled header.  However,
14080 a precompiled header built using @option{-g} can be used in a compilation
14081 when no debugging information is being output.
14082
14083 @item The same @option{-m} options must generally be used when building
14084 and using the precompiled header.  @xref{Submodel Options},
14085 for any cases where this rule is relaxed.
14086
14087 @item Each of the following options must be the same when building and using
14088 the precompiled header:
14089
14090 @gccoptlist{-fexceptions -funit-at-a-time}
14091
14092 @item
14093 Some other command-line options starting with @option{-f},
14094 @option{-p}, or @option{-O} must be defined in the same way as when
14095 the precompiled header was generated.  At present, it's not clear
14096 which options are safe to change and which are not; the safest choice
14097 is to use exactly the same options when generating and using the
14098 precompiled header.  The following are known to be safe:
14099
14100 @gccoptlist{-fmessage-length= -fpreprocessed
14101 -fsched-interblock -fsched-spec -fsched-spec-load -fsched-spec-load-dangerous
14102 -fsched-verbose=<number> -fschedule-insns -fvisibility=
14103 -pedantic-errors}
14104
14105 @end itemize
14106
14107 For all of these except the last, the compiler will automatically
14108 ignore the precompiled header if the conditions aren't met.  If you
14109 find an option combination that doesn't work and doesn't cause the
14110 precompiled header to be ignored, please consider filing a bug report,
14111 see @ref{Bugs}.
14112
14113 If you do use differing options when generating and using the
14114 precompiled header, the actual behavior will be a mixture of the
14115 behavior for the options.  For instance, if you use @option{-g} to
14116 generate the precompiled header but not when using it, you may or may
14117 not get debugging information for routines in the precompiled header.
14118
14119 @node Running Protoize
14120 @section Running Protoize
14121
14122 The program @code{protoize} is an optional part of GCC@.  You can use
14123 it to add prototypes to a program, thus converting the program to ISO
14124 C in one respect.  The companion program @code{unprotoize} does the
14125 reverse: it removes argument types from any prototypes that are found.
14126
14127 When you run these programs, you must specify a set of source files as
14128 command line arguments.  The conversion programs start out by compiling
14129 these files to see what functions they define.  The information gathered
14130 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
14131
14132 After scanning comes actual conversion.  The specified files are all
14133 eligible to be converted; any files they include (whether sources or
14134 just headers) are eligible as well.
14135
14136 But not all the eligible files are converted.  By default,
14137 @code{protoize} and @code{unprotoize} convert only source and header
14138 files in the current directory.  You can specify additional directories
14139 whose files should be converted with the @option{-d @var{directory}}
14140 option.  You can also specify particular files to exclude with the
14141 @option{-x @var{file}} option.  A file is converted if it is eligible, its
14142 directory name matches one of the specified directory names, and its
14143 name within the directory has not been excluded.
14144
14145 Basic conversion with @code{protoize} consists of rewriting most
14146 function definitions and function declarations to specify the types of
14147 the arguments.  The only ones not rewritten are those for varargs
14148 functions.
14149
14150 @code{protoize} optionally inserts prototype declarations at the
14151 beginning of the source file, to make them available for any calls that
14152 precede the function's definition.  Or it can insert prototype
14153 declarations with block scope in the blocks where undeclared functions
14154 are called.
14155
14156 Basic conversion with @code{unprotoize} consists of rewriting most
14157 function declarations to remove any argument types, and rewriting
14158 function definitions to the old-style pre-ISO form.
14159
14160 Both conversion programs print a warning for any function declaration or
14161 definition that they can't convert.  You can suppress these warnings
14162 with @option{-q}.
14163
14164 The output from @code{protoize} or @code{unprotoize} replaces the
14165 original source file.  The original file is renamed to a name ending
14166 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
14167 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
14168 for DOS) file already exists, then the source file is simply discarded.
14169
14170 @code{protoize} and @code{unprotoize} both depend on GCC itself to
14171 scan the program and collect information about the functions it uses.
14172 So neither of these programs will work until GCC is installed.
14173
14174 Here is a table of the options you can use with @code{protoize} and
14175 @code{unprotoize}.  Each option works with both programs unless
14176 otherwise stated.
14177
14178 @table @code
14179 @item -B @var{directory}
14180 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
14181 usual directory (normally @file{/usr/local/lib}).  This file contains
14182 prototype information about standard system functions.  This option
14183 applies only to @code{protoize}.
14184
14185 @item -c @var{compilation-options}
14186 Use @var{compilation-options} as the options when running @command{gcc} to
14187 produce the @samp{.X} files.  The special option @option{-aux-info} is
14188 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
14189
14190 Note that the compilation options must be given as a single argument to
14191 @code{protoize} or @code{unprotoize}.  If you want to specify several
14192 @command{gcc} options, you must quote the entire set of compilation options
14193 to make them a single word in the shell.
14194
14195 There are certain @command{gcc} arguments that you cannot use, because they
14196 would produce the wrong kind of output.  These include @option{-g},
14197 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
14198 the @var{compilation-options}, they are ignored.
14199
14200 @item -C
14201 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
14202 systems) instead of @samp{.c}.  This is convenient if you are converting
14203 a C program to C++.  This option applies only to @code{protoize}.
14204
14205 @item -g
14206 Add explicit global declarations.  This means inserting explicit
14207 declarations at the beginning of each source file for each function
14208 that is called in the file and was not declared.  These declarations
14209 precede the first function definition that contains a call to an
14210 undeclared function.  This option applies only to @code{protoize}.
14211
14212 @item -i @var{string}
14213 Indent old-style parameter declarations with the string @var{string}.
14214 This option applies only to @code{protoize}.
14215
14216 @code{unprotoize} converts prototyped function definitions to old-style
14217 function definitions, where the arguments are declared between the
14218 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
14219 uses five spaces as the indentation.  If you want to indent with just
14220 one space instead, use @option{-i " "}.
14221
14222 @item -k
14223 Keep the @samp{.X} files.  Normally, they are deleted after conversion
14224 is finished.
14225
14226 @item -l
14227 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
14228 a prototype declaration for each function in each block which calls the
14229 function without any declaration.  This option applies only to
14230 @code{protoize}.
14231
14232 @item -n
14233 Make no real changes.  This mode just prints information about the conversions
14234 that would have been done without @option{-n}.
14235
14236 @item -N
14237 Make no @samp{.save} files.  The original files are simply deleted.
14238 Use this option with caution.
14239
14240 @item -p @var{program}
14241 Use the program @var{program} as the compiler.  Normally, the name
14242 @file{gcc} is used.
14243
14244 @item -q
14245 Work quietly.  Most warnings are suppressed.
14246
14247 @item -v
14248 Print the version number, just like @option{-v} for @command{gcc}.
14249 @end table
14250
14251 If you need special compiler options to compile one of your program's
14252 source files, then you should generate that file's @samp{.X} file
14253 specially, by running @command{gcc} on that source file with the
14254 appropriate options and the option @option{-aux-info}.  Then run
14255 @code{protoize} on the entire set of files.  @code{protoize} will use
14256 the existing @samp{.X} file because it is newer than the source file.
14257 For example:
14258
14259 @smallexample
14260 gcc -Dfoo=bar file1.c -aux-info file1.X
14261 protoize *.c
14262 @end smallexample
14263
14264 @noindent
14265 You need to include the special files along with the rest in the
14266 @code{protoize} command, even though their @samp{.X} files already
14267 exist, because otherwise they won't get converted.
14268
14269 @xref{Protoize Caveats}, for more information on how to use
14270 @code{protoize} successfully.